@ekyc_qoobiss/qbs-ect-cmp 4.7.18 → 4.7.20

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.
@@ -1,3 +0,0 @@
1
- import{r as t,c as i,h as e,g as n}from"./p-CUNWjaUv.js";import{a as r,T as s,A as a,s as o,F as c,d as f,b as u,e as l,g as h}from"./p-D7pEBPsF.js";import{B as d,E as w,l as b,V as g,S as M,M as m,d as y,C as v,a as I,b as p,D as L,g as D,A as N,c as x,e as C,f as k,h as j,i as z,n as S,j as T,k as A}from"./p-75NmhV7H.js";const E="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MSIgaGVpZ2h0PSI2MSIgdmlld0JveD0iMCAwIDYxIDYxIj4NCiAgPGcgaWQ9ImZpbGUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNDEgLTQ5KSI+DQogICAgPGcgaWQ9Ikljb24iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0MSA0OSkiPg0KICAgICAgPHBhdGggaWQ9IlBhdGhfNDc3MyIgZGF0YS1uYW1lPSJQYXRoIDQ3NzMiIGQ9Ik0yNzkuNTg3LDczYTE0LjU4NywxNC41ODcsMCwxLDAsMTQuNTg3LDE0LjU4N0ExNC41OTQsMTQuNTk0LDAsMCwwLDI3OS41ODcsNzNabTAsMi42NTJhMTEuOTM1LDExLjkzNSwwLDEsMS0xMS45MzUsMTEuOTM1QTExLjk0MSwxMS45NDEsMCwwLDEsMjc5LjU4Nyw3NS42NTJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjMzLjE3NCAtNDEuMTc0KSIgZmlsbD0iIzI1MmM4MiIgZmlsbC1ydWxlPSJldmVub2RkIi8+DQogICAgICA8cGF0aCBpZD0iUGF0aF80Nzc0IiBkYXRhLW5hbWU9IlBhdGggNDc3NCIgZD0iTTI4Ny40MTMsNDlIMjU2L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giIGRhdGEtbmFtZT0iUGF0aCA0Nzc4IiBkPSJNMjUwLjMyNiw3MS42NTJoMTUuOTEzYTEuMzI2LDEuMzI2LDAsMSwwLDAtMi42NTJIMjUwLjMyNmExLjMyNiwxLjMyNiwwLDEsMCwwLDIuNjUyWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI0OSAtNjkpIiBmaWxsPSIjMjUyYzgyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4NCiAgICAgIDwvZz4NCiAgICAgIDxnIGlkPSJHcm91cF80NjI5IiBkYXRhLW5hbWU9Ikdyb3VwIDQ2MjkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwLjYwOSA0Ny43MzkpIj4NCiAgICAgICAgPHBhdGggaWQ9IlBhdGhfNDc3OSIgZGF0YS1uYW1lPSJQYXRoIDQ3NzkiIGQ9Ik0yNTAuMzI2LDcxLjY1MmgxNS45MTNhMS4zMjYsMS4zMjYsMCwxLDAsMC0yLjY1MkgyNTAuMzI2YTEuMzI2LDEuMzI2LDAsMSwwLDAsMi42NTJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjQ5IC02OSkiIGZpbGw9IiMyNTJjODIiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPg0KICAgICAgPC9nPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+DQo=";const Y="";const O=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError")}async componentDidLoad(){await d.initialize(r.Agreements)}async componentWillLoad(){this.translations=await s.getValues();this.buttonDisabled=true}async disconnectedCallback(){await d.finalize(r.Agreements)}async buttonClick(){try{a.instance.GenerateAgreement("both");o.flowStatus=await a.instance.GetNextFlowState()}catch(t){this.apiErrorEvent.emit(t)}}atBottomEmitted(t){this.buttonDisabled=!t.detail}async leaveFlow(){try{let t=await a.instance.AbortRequest();o.flowStatus=c[t.state];await f.ectdata.delete(o.requestId);w.flowAborted()}catch(t){w.flowAborted();this.apiErrorEvent.emit(t)}}render(){return e("div",{key:"4b832e988a255d5d9de58fbe28a9126b499bfa22",class:"container flex center"},e("div",{key:"d321d2aaf082e309ae85d787e422c87f651d5354",class:"px-1"},e("div",{key:"367bbf0c3e39565e84d6c4a9e2d56a21f92f174c",class:"mb-1 text-center"},e("img",{key:"36d1126fadf8bad0c8b7ba7242b20efff0319d1c",src:E})),e("h1",{key:"e03027bd5ee88a5c3057ada91488497eb21459be",class:"text-center",innerHTML:this.translations.AgreementInfoValues.Title}),e("div",{key:"e53481b5b71bcd070614e9cf7a922350f2cfe37f",style:{height:"47vh"}},e("agreement-view",{key:"fd326986ac049cfa53d85cd7e93e79d459c07af5",agreementType:"both"})),e("div",{key:"7cd60673d6226571d4e8adbfc714c2f88a84c398",class:"button flex mb-1 mx-3"},e("button",{key:"1a4d02ce62886ad0fe3ee320efb2d7845fc81c0a",class:"main-button",disabled:this.buttonDisabled,onClick:()=>this.buttonClick()},this.translations.AgreementCheckValues.ButtonYes)),e("div",{key:"ed3d758ab45140b4ce656e0cdd562d2b7e4542a0"},e("p",{key:"33a05db2301c09009eae42412917bd034254f2c7",class:"main-text link-text text-center",onClick:()=>this.leaveFlow()},this.translations.AgreementCheckValues.ButtonNo)),e("div",{key:"4dbd5e1ce84589706f6b13e53aaf44b3b54164d1",class:"footer text-center"},e("img",{key:"cec16f1b322e8c92d35159e6f588a4b4f8b68140",src:b}))))}};O.style=Y;const Z="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTAiIGhlaWdodD0iMTciIHZpZXdCb3g9IjAgMCAxMCAxNyI+DQogIDxkZWZzPg0KICAgIDxjbGlwUGF0aCBpZD0iY2xpcC1wYXRoIj4NCiAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGVfMTMwOSIgZGF0YS1uYW1lPSJSZWN0YW5nbGUgMT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hbnNmb3JtPSJ0cmFuc2xhdGUoMTQ1Ljk4NyA4NSkiPg0KICAgICAgPGcgaWQ9Ikdyb3VwXzQ1OTAtMiIgZGF0YS1uYW1lPSJHcm91cCA0NTkwIiBjbGlwLXBhdGg9InVybCgjY2xpcC1wYXRoLTIpIj4NCiAgICAgICAgPHBhdGggaWQ9IlBhdGhfNDc0NS0yIiBkYXRhLW5hbWU9IlBhdGggNDc0NSIgZD0iTTcuMSw1Ljk2My45NzYsMTAuODU1QS42LjYsMCwwLDEsMCwxMC4zODdWLjZBLjYuNiwwLDAsMSwuOTc2LjEzM0w3LjEsNS4wMjZhLjYuNiwwLDAsMSwwLC45MzYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgMCkiIGZpbGw9IiMyNTJjODIiLz4NCiAgICAgIDwvZz4NCiAgICA8L2c+DQogIDwvZz4NCjwvc3ZnPg0K";const R=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError");this.atBottomEvent=i(this,"atBottom");this.atBottom=false;this.scrollingToBottom=false;this.scrollClass="scroll";this.handleScroll=t=>{if(this.scrollingToBottom){return}const i=t.target;const e=5;this.atBottom=i.scrollHeight-i.scrollTop-i.clientHeight<e;if(this.atBottom)this.atBottomEvent.emit(true)};this.scrollToBottom=()=>{this.scrollingToBottom=true;this.atBottom=true;this.atBottomEvent.emit(true);if(this.scrollContainer){this.scrollContainer.scrollTo({top:this.scrollContainer.scrollHeight,behavior:"smooth"})}setTimeout((()=>{this.scrollingToBottom=false}),200)}}async componentDidLoad(){try{this.htmlContent=await a.instance.GetAgreement(this.agreementType)}catch(t){this.apiErrorEvent.emit(t)}}render(){return e("div",{key:"cd56c70a5a3881b46bb546f69f23ebef4faf5eaa",class:"document-view"},e("div",{key:"7584d49c9577b96937e7732a171f2e9128ad4187",ref:t=>this.scrollContainer=t,class:this.scrollClass,style:{height:"calc(100% - 60px)"},onScroll:this.handleScroll,innerHTML:this.htmlContent}),e("div",{key:"968c63096b18be3fc3edd2c7330d3039f1810dd6",class:"flex center text-center",onClick:this.scrollToBottom,style:{height:"60px"}},e("img",{key:"b9b91752debd3ffc951cfb9e87eb16a3aeaf84eb",src:Z})))}};const G="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KDTwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIFRyYW5zZm9ybWVkIGJ5OiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4KPHN2ZyBmaWxsPSIjZmZmZmZmIiBoZWlnaHQ9IjgwMHB4IiB3aWR0aD0iODAwcHgiIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDQ4NyA0ODciIHhtbDpzcGFjZT0icHJlc2VydmUiIHN0cm9rZT0iI2ZmZmZmZiI+Cg08ZyBpZD0iU1ZHUmVwb19iZ0NhcnJpZXIiIHN0cm9rZS13aWR0aD0iMCIvPgoNPGcgaWQ9IlNWR1JlcG9fdHJhY2VyQ2FycmllciIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cg08ZyBpZD0iU1ZHUmVwb19pY29uQ2FycmllciI+IDxnPiA8Zz4gPHBhdGggZD0iTTMwOC4xLDI3Ny45NWMwLDM1LjctMjguOSw2NC42LTY0LjYsNjQuNnMtNjQuNi0yOC45LTY0LjYtNjQuNnMyOC45LTY0LjYsNjQuNi02NC42UzMwOC4xLDI0Mi4yNSwzMDguMSwyNzcuOTV6IE00NDAuMywxMTYuMDVjMjUuOCwwLDQ2LjcsMjAuOSw0Ni43LDQ2Ljd2MTIyLjR2MTAzLjhjMCwyNy41LTIyLjMsNDkuOC00OS44LDQ5LjhINDkuOGMtMjcuNSwwLTQ5LjgtMjIuMy00OS44LTQ5Ljh2LTEwMy45IHYtMTIyLjNsMCwwYzAtMjUuOCwyMC45LTQ2LjcsNDYuNy00Ni43aDkzLjRsNC40LTE4LjZjNi43LTI4LjgsMzIuNC00OS4yLDYyLTQ5LjJoNzQuMWMyOS42LDAsNTUuMywyMC40LDYyLDQ5LjJsNC4zLDE4LjZINDQwLjN6IE05Ny40LDE4My40NWMwLTEyLjktMTAuNS0yMy40LTIzLjQtMjMuNGMtMTMsMC0yMy41LDEwLjUtMjMuNSwyMy40czEwLjUsMjMuNCwyMy40LDIzLjRDODYuOSwyMDYuOTUsOTcuNCwxOTYuNDUsOTcuNCwxODMuNDV6IE0zNTguNywyNzcuOTVjMC02My42LTUxLjYtMTE1LjItMTE1LjItMTE1LjJzLTExNS4yLDUxLjYtMTE1LjIsMTE1LjJzNTEuNiwxMTUuMiwxMTUuMiwxMTUuMlMzNTguNywzNDEuNTUsMzU4LjcsMjc3Ljk1eiIvPiA8L2c+IDwvZz4gPC9nPgoNPC9zdmc+";const Q=".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;position:absolute;max-width:100%;max-height:100%;border-radius:10px}.cameraVideoSelfie,.cameraVideoSelfieDesk{transform:scale(-1, 1);-webkit-transform:scale(-1, 1)}.cameraMobile{position:fixed;top:0;left:0;background:black}.take-photo{height:36px;background:#7BB40E;border-radius:50px;padding:14px}";const W=class{constructor(e){t(this,e);this.eventVideoStarted=i(this,"videoStarted");this.eventTakePhoto=i(this,"takePhoto");this.eventRecordingSelfieReady=i(this,"recordingSelfieCapture");this.eventRecordingIdReady=i(this,"recordingIdCapture");this.eventTimeElapsed=i(this,"timeElapsed");this.eventInfoTimeElapsed=i(this,"infoTimeElapsed");this.verificationFinished=i(this,"verificationFinished");this.infoFullDetected=i(this,"infoFullDetected");this.infoNoneDetected=i(this,"infoNoneDetected");this.callbackAutoCapturing=()=>{this.eventTakePhoto.emit()};this.callbackSelfieRecordingReady=t=>{this.eventRecordingSelfieReady.emit(t)};this.callbackIdRecordingReady=t=>{this.eventRecordingIdReady.emit(t)};this.callbackTimeElapsed=()=>{this.eventTimeElapsed.emit()};this.callbackInfoTimeElapsed=()=>{this.eventInfoTimeElapsed.emit()};this.callbackVideoStarted=()=>{this.eventVideoStarted.emit(this.component.getBoundingClientRect())};this.callbackVerificationFinished=()=>{this.verificationFinished.emit()};this.callbackFullDetected=()=>{this.infoFullDetected.emit()};this.callbackNoneDetected=()=>{this.infoNoneDetected.emit()}}componentDidLoad(){if(o.debug)console.log("camera | componentDidLoad");this.startStream()}render(){this.verificationMode=[c.IDTILT,c.LIVENESSGESTURE].includes(o.flowStatus)?g.Tilt:g.Full;let t="cameraVideo";let i="cameraCanvas";if(o.device.isDesktop){t="cameraVideoSelfieDesk";i="cameraCanvasSelfieDesk"}if(this.captureMode=="selfie"){t="cameraVideoSelfie";i="cameraCanvasSelfie"}return e("div",{key:"eded9cea998b42421947655f886aa7dd27afb5cd",class:([c.IDFRONT,c.IDBACK].includes(o.flowStatus)?"":"bg-black ")+"w-100 h-100 rounded"},e("div",{key:"9d821df8d32923d4c31b66ecf534cb81822b76e1",class:"camera rounded"},e("video",{key:"f9d0f7a5dd35b4709cdf7cdec7a74c7e1a8c2d7c",id:"video",loop:true,autoplay:true,playsinline:true,muted:true,class:t,ref:t=>this.cameraVideo=t}),e("canvas",{key:"5ad51f98ac4b7be16199d0a2b0f1bbacaa985ca4",id:"output",class:i,ref:t=>this.cameraCanvas=t})),[c.IDFRONT,c.IDBACK].includes(o.flowStatus)?e("div",{class:"flex center"},e("div",{class:"take-photo flex center mt-2 w-100 mx-2",onClick:()=>this.eventTakePhoto.emit()},e("img",{class:"h-100 d-block",src:G}))):null)}startStream(){if(o.debug)console.log("camera | startStream");const t=M.getNewInstance(this.verificationMode);t.updateHtmlElements(this.cameraVideo,this.cameraCanvas,this.component);if(this.captureMode=="selfie"){t.setFaceDetection(true);t.setCallbackRecordingReady(this.callbackSelfieRecordingReady)}else{if(this.verificationMode==g.Tilt){t.setIdDetection(true)}else t.setIdMask(true);t.setCallbackRecordingReady(this.callbackIdRecordingReady)}t.setCallbackAutoCapturing(this.callbackAutoCapturing);t.setCallbackVideoStarted(this.callbackVideoStarted);t.setCallbackTimeElapsed(this.callbackTimeElapsed);t.setCallbackInfoTimeElapsed(this.callbackInfoTimeElapsed);t.setCallbackFullDetected(this.callbackFullDetected);t.setCallbackNoneDetected(this.callbackNoneDetected);t.setVerificationFinished(this.callbackVerificationFinished)}get component(){return n(this)}};W.style=Q;const U="data:image/svg+xml;base64,PHN2ZyBpZD0ic3Bpbm5lckxvYWRlclJlZiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBvdmVyZmxvdz0idmlzaWJsZSIgZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSIjMDMwMzAzIiBjbGFzcz0ic2luZ2xlLWxvYWRlciI+DQogIDxkZWZzPg0KICAgIDxjaXJjbGUgaWQ9InNwaW5uZXIiIHI9IjQiIGN4PSI1MCIgY3k9IjUwIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIC0zMCkiLz4gICAgDQogIDwvZGVmcz4NCiAgPHVzZSB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeGxpbms6aHJl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IiB2aWV3Qm94PSIwIDAgMjIuNzQ3IDIyLjYiPg0KICA8cGF0aCBpZD0iUGF0aF80NzcxIiBkYXRhLW5hbWU9IlBhdGggNDc3MSIgZD0iTTExLjM3MywyMi42QTExLjMsMTEuMywwLDEsMSwyMi43NDcsMTEuMywxMS4zMzcsMTEuMzM3LDAsMCwxLDExLjM3MywyMi42Wm0wLTIxLjE4N0E5Ljg4OCw5Ljg4OCwwLDEsMCwyMS4zMjUsMTEuM2E5LjkyLDkuOTIsMCwwLDAtOS45NTItOS44ODdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDApIiBmaWxsPSIjMjUyYzgyIi8+DQogIDxwYXRoIGlkPSJQYXRoXzQ3NzIiIGRhdGEtbmFtZT0iUGF0aCA0NzcyIiBkPSJNMTAuNzQsOS42NDgsMTUuMjMzLDUuMmEuNjkzLjY5MywwLDAsMCwwLS45ODkuNzE1LjcxNSwwLDAsMC0xLDBMOS43MjQsOC42NDUsNS4yMTcsNC4yMWEuNzE1LjcxNSwwLDAsMC0xLDAsLjY5My42OTMsMCwwLDAsMCwuOTg5TDguNzA4LDkuNjQ4LDQuMjE1LDE0LjFhLjY3Mi42NzIsMCwwLDAsMCwuOTg5LjY5My42OTMsMCwwLDAsMSwwbDQuNTA3LTQuNDM1LDQuNTA3LDQuNDM1YS42OTMuNjkzLDAsMCwwLDEsMCwuNjcyLjY3MiwwLDAsMCwwLS45ODlaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxLjY0OSAxLjY1MikiIGZpbGw9IiMyNTJjODIiLz4NCjwvc3ZnPg0K";const J="";const H=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError")}async componentWillLoad(){this.translations=await s.getValues();this.modal=false;this.buttonDisabled=false;this.title=this.translations.CameraErrorValues.Title;this.description=this.translations.CameraErrorValues.Description;this.info=this.translations.CameraErrorValues.Info;this.infoTitle=this.translations.CameraErrorValues.InfoTitle;this.buttonText=this.translations.CameraErrorValues.Button;this.ectData=await f.ectdata.get(o.requestId)}async componentDidLoad(){await d.initialize(r.CameraError);if(o.device.mobileOS!=m.iOS){this.demoVideo.src=this.translations.CameraErrorValues.HowToLink;this.demoVideo.loop=true;this.demoVideo.play()}else{if(this.ectData.refreshStarted){this.ectData.refreshStarted=false;await f.ectdata.put(this.ectData);o.flowStatus=c.LANDING}}}async disconnectedCallback(){await d.finalize(r.CameraError)}async infoClick(){this.modal=true}async buttonClick(){this.buttonDisabled=true;if(o.device.mobileOS==m.iOS){this.ectData.refreshStarted=true;await f.ectdata.put(this.ectData);window.location.reload()}else{o.flowStatus=c.LANDING}}render(){return e("div",{key:"5fde479e2f83125b59840b35641c058e4aef5cda",class:"container flex center"},e("div",{key:"eabfd6ab1e4cc67ccf808355d2fde9b211e34199",hidden:!this.modal,class:"modal flex center w-100"},e("div",{key:"2e4d4c67c2f9b0996ebacbbc499a4d00442e2a5a",class:"inner w-100 text-center mx-1"},e("img",{key:"e41d18d92ab95c5d388327e8d01e7e0857b62cbc",class:"close-modal",src:B,onClick:()=>this.modal=false}),e("img",{key:"af68bf5158603f79297ffa966c7eb0786f53b037",src:F}),e("h2",{key:"ed1ada6e108112537dc2769beb4d7acc9717b29a",class:"loud-text color-blue mb-1"},e("strong",{key:"b75871a97f4fbc74af1ced28aa1c143a40ea2e8d"},this.infoTitle)),e("video",{key:"b1df51ad00dee8ae21150fc784ab163205d93a25",id:"howtoPermissions",class:"video-demo",playsinline:true,ref:t=>this.demoVideo=t},e("source",{key:"bf592950eec132fdac00dc2b7e638f34c5793024",type:"video/mp4"})))),e("div",{key:"85a93f6837f68e6d81f39c1d2574562b64fd3b79",class:"px-3 text-center"},e("img",{key:"c010a34c3e24b6420cc13aea354f33553b1a62aa",class:"mb-1 ml-1",src:P}),e("h1",{key:"b0d6f3389435b532e5e875f516a18b1ab63096b2",class:"color-red mb-2"},this.title),e("div",{key:"0fd28d9ea2feb730d25edf6efd414ebcfc69f43a",class:"color-blue mb-2 loud-text",innerHTML:this.description}),e("p",{key:"a298b57e9a22366130320d95c2b94dff2970eb63",hidden:o.device.mobileOS==m.iOS,class:"flex center mb-3",onClick:()=>this.infoClick()},e("strong",{key:"82fd00afdc9d217e6b1c3e7ee2a3bc4183bedde7",class:"color-blue loud-text"},this.info),"   ",e("img",{key:"5bd78ff27ed145c76711ad7c7f3dea8b42e123cb",src:F})),e("div",{key:"6456a3f6ac2ef6402626e8a03c33a0a8b5806b2b",class:"button flex"},this.buttonDisabled?e("div",{class:"img-loader img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{key:"2ad740b507a038c6859665080c063486ef49377e",class:"main-button",type:"button",disabled:this.buttonDisabled,onClick:()=>this.buttonClick()},this.buttonText)),e("div",{key:"628cb1174f9103401bb96397e1a3849264935d54",class:"footer text-center"},e("img",{key:"19f268fcb3252aea30ebb212f464e565a388c2f0",src:b}))))}};H.style=J;const X="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2Ny4zNDYiIGhlaWdodD0iNTQuNzA0IiB2aWV3Qm94PSIwIDAgNjcuMzQ2IDU0LjcwNCI+DQogIDxnIGlkPSJpZC1jYXJkX3giIGRhdGEtbmFtZT0iaWQtY2FyZCB4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcgLTI5KSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MSIgZGF0YS1uYW1lPSJQYXRoIDQ3NTEiIGQ9Ik0yMS4zNDUsNzcuODhINTAuMTNhMS4wODYsMS4wODYsMCwwLDAsMC0yLjE3MkgyMS4zNDVhMi4xNzUsMi4xNzUsMCwwLDEtMi4xNzItMi4xNzJWMzMuMzQ1YTIuMTc1LDIuMTc1LDAsMCwxLDIuMTcyLTIuMTcySDgwYTIuMTc1LDIuMTc1LDAsMCwxLDIuMTcyLDIuMTcyVjU1LjA2OWExLjA4NiwxLjA4NiwwLDAsMCwyLjE3MiwwVjMzLjM0NUE0LjM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SJQYXRoIDQ3NzIiIGQ9Ik0xMS43NTksMTAuNTg1LDE2LjkzMSw1LjRhLjgxNS44MTUsMCwxLDAtMS4xNTMtMS4xNTNMMTAuNTg5LDkuNDE2LDUuNCw0LjI0NEEuODE1LjgxNSwwLDAsMCw0LjI0OCw1LjRMOS40MiwxMC41ODUsNC4yNDgsMTUuNzc0QS44MTUuODE1LDAsMSwwLDUuNCwxNi45MjdsNS4xODgtNS4xNzIsNS4xODgsNS4xNzJhLjgxNS44MTUsMCwxLDAsMS4xNTMtMS4xNTNaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyLjU4OCAyLjU5MikiIGZpbGw9IiNmZjUzNTMiLz4NCiAgICA8L2c+DQogIDwvZz4NCjwvc3ZnPg0K";const _="";const K=class{constructor(e){t(this,e);this.eventCaptureErrorDone=i(this,"captureErrorDone")}async componentWillLoad(){this.translations=await s.getValues();this.modal=false;this.buttonEnabled=false;if(this.type=="ID"){this.titleR1=this.translations.IdCaptureValues.ErrorTitleR1;this.titleR2=this.translations.IdCaptureValues.ErrorTitleR2;this.descriptionR1=this.translations.IdCaptureValues.ErrorR1;this.descriptionR2=this.translations.IdCaptureValues.ErrorR2}if(this.type=="LIVENESS"){this.titleR1=this.translations.SelfieCaptureValues.ErrorTitleR1;this.titleR2=this.translations.SelfieCaptureValues.ErrorTitleR2;this.descriptionR1=this.translations.SelfieCaptureValues.ErrorR1;this.descriptionR2=this.translations.SelfieCaptureValues.ErrorR2}}async componentDidLoad(){await d.logStep(r.CiError,u.Initialized);for(let t=5;t>=1;t--){this.buttonText=t.toString();await y(1e3)}this.buttonText=this.translations.IdCaptureValues.Button;this.buttonEnabled=true}async buttonClick(){this.buttonEnabled=false;await d.logStep(r.CiError,u.Finalized);if(this.reason=="Upload Failed"){var t=await a.instance.GetNextStateForCaptureError();o.flowStatus=t}else if(this.reason=="Invalid"&&o.flowStatus==c.IDBACK){var t=await a.instance.GetNextStateForCaptureError();o.flowStatus=t}this.eventCaptureErrorDone.emit()}async infoClick(){this.modal=true}render(){return e("div",{key:"349d7fa03a02951b62722f587305f41a4e1822d5",class:"container flex center"},e("div",{key:"69347f4e7f7b79b21a873b2c6b233bb3812c8d38",hidden:!this.modal,class:"modal flex center w-100"},e("div",{key:"d6bfa730ab7f5e9de1737647ff9a41fd05317b1a",class:"inner w-100 text-center mx-1"},e("img",{key:"10ace42445eed8729731fe4428b6ebe11b4e3bb5",class:"close-modal",src:B,onClick:()=>this.modal=false}),e("img",{key:"51821b42f04de47aa3d291d8bce53e99cdf43c60",src:F}),e("h2",{key:"c97a89e8b991d9947ce89a1e44f1975ae020642e",class:"loud-text color-blue mb-1"},e("strong",{key:"732bd2e0e71e8d4087b0b95537689d075e751baf"},this.titleR2)),e("div",{key:"5436c6d47968a2d3830fd6242e2fbf1bdd3f7ef1",class:"color-blue checklist loud-text",innerHTML:this.descriptionR2}))),e("div",{key:"c2da9164c0fa361e4a77b6422dbad7c58d831aab",class:"px-3 text-center"},e("img",{key:"ea4faa250945d5ef5c3de281e4e4db10f2b983bf",class:"mb-1 ml-1",src:this.type=="ID"?X:V}),e("h1",{key:"d811c92d3012c6e6bf597de94096556ea9a53ea4",class:"color-red mb-2",innerHTML:this.titleR1}),e("div",{key:"a8ff782d5b94c0e84c1746de13752900df266f97",class:"color-blue mb-2 loud-text",innerHTML:this.descriptionR1}),e("p",{key:"a76e03a0048f4d5e8b3a88053adb54df00cd1d81",class:"flex center mb-3",onClick:()=>this.infoClick()},e("strong",{key:"4406c5c81501829735231786ea830695d529dd2f",class:"color-blue loud-text"},this.translations.CameraErrorValues.Info),"   ",e("img",{key:"287f1d9cdb1f02c29ede72b9a96e80df66d991d8",src:F})),o.debug?e("p",{class:"font-size-1"},`${this.reason} ${this.error}`):null,e("div",{key:"4c21add72c6fb20ce0fe0ea8732036d963b090dd",class:"button flex"},e("button",{key:"637a6b53ccb431663d5cec1a032cb5de9bcdc98f",class:"main-button",type:"button",disabled:!this.buttonEnabled,onClick:()=>this.buttonClick()},this.buttonText)),e("div",{key:"74645fc1e15e7de1b66dec2da8fd3032ec4bdca9",class:"footer text-center"},e("img",{key:"7afb2ed0b8f0369dee1fbe3072bfde656d263513",src:b}))))}};K.style=_;const q="";const $=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError");this.canCancel=true;this.selected=null;this.citizenships=[];this.imgClass="cit-selector"}async componentWillLoad(){this.ectData=await f.ectdata.get(o.requestId)}async componentWillRender(){this.translations=await s.getValues();if(o.device.isDesktop){this.imgClass="cit-selector-desktop"}if(!o.showCitizenshipSelector){if(o.citizenship&&o.citizenship!=""){await this.citizenshipSelected(o.citizenship)}else{o.flowStatus=await a.instance.GetNextFlowState()}}else{this.citizenships=await a.instance.GetCitizenshipList()}}async doAction(){if(!this.canCancel){return}this.canCancel=false;try{let t=await a.instance.AbortRequest();o.flowStatus=c[t.state];await f.ectdata.delete(o.requestId);w.flowAborted()}catch(t){w.flowAborted();this.apiErrorEvent.emit(t)}}async setCitizenship(t){this.selected=t;this.citizenshipSelected(t.name)}async citizenshipSelected(t){if(!this.canCancel){return}this.canCancel=false;o.citizenship=t;if(!this.ectData){await y(500);if(!this.ectData)this.ectData=await f.ectdata.get(o.requestId)}this.ectData.citizenship=t;f.ectdata.put(this.ectData);try{await a.instance.SetCitizenship()}catch(t){this.apiErrorEvent.emit(t)}}render(){return e("div",{key:"287b2c812b46511271ddad5bdc0e849dd7f0cb74",class:"container flex center"},e("div",{key:"bc69627effede3617c261e8e6c2fb8be16b01af5",class:"px-3"},e("h1",{key:"509e2dcc606b2ea4ee370b82dd56b75e34013abb",class:"text-center"},this.translations.CitizenshipSelectionValues.Title),e("p",{key:"0daf674daeb550da249981e0180e67396e6e2e9f",class:"loud-text color-blue text-center"},this.translations.CitizenshipSelectionValues.Description),e("div",{key:"7a44baae7e5c89a411486ead2d165d3546e78ade",class:"py-1"},this.citizenships.map((t=>{var i;return e("div",{class:"d-flex center mb-1",onClick:()=>this.setCitizenship(t)},e("h3",null,t.name),e("div",{class:this.imgClass+" relative ml-1"},((i=this.selected)===null||i===void 0?void 0:i.name)==t.name?e("div",{class:"img-loader rounded w-100 h-100 flex center"},e("img",{class:"loading-image",src:U})):null,e("img",{class:"rounded d-block w-100",src:t.image})))}))),e("div",{key:"6d8225151acc81a4af59b8e417bea884bf1c86ce",class:"text-center"},e("p",{key:"26f757f05edc3731dd793a95749c4c10fd081783",class:"main-text link-text",onClick:()=>this.doAction()},this.translations.LandingValues.ButtonLeave)),e("div",{key:"10b5b4bd64b988c74a02eecd060c602b6b1d0220",class:"footer text-center"},e("img",{key:"5d90a8a35eb68b26a76b1b2f9f9de687cca55982",src:b}))))}};$.style=q;const tt="p{font-size:0.8em;color:silver;font-weight:600}";const it=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError")}async componentWillLoad(){this.translations=await s.getValues()}async componentDidLoad(){await f.ectdata.delete(o.requestId);w.flowCompleted()}render(){return e("div",{key:"9521e24898605a284745e91db50a4c66db800c19",class:"container flex center"},e("div",{key:"0e72bba01cd3ebd7ba32fb7a8d82b37f90a441e1",class:"px-2 w-100"},e("h1",{key:"3ae1272bb871e2a998164509b8883c1f3337518b",class:"text-center mb-1"},this.translations.CompleteValues.Title),e("img",{key:"f6802dd11be663ff018393a95d229f41a3af2c25",class:"w-100 mb-1",src:"https://ekyc.blob.core.windows.net/$web/process_complete.gif"}),e("h1",{key:"9025fa02ed7e236e78e0c20b3eddc1f482155783",class:"text-center"},this.translations.CompleteValues.Message),e("p",{key:"135d221c124a73c815115afa27f1ab4a41846426",class:"text-center"},o.requestId),e("div",{key:"bd51d5aad400e48b6e7a263938d36d8073f0406a",class:"footer text-center"},e("img",{key:"f70538c3eb79ec51ed4608f4e4227f474796bdb9",src:b}))))}};it.style=tt;const et="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OSIgaGVpZ2h0PSI2MC43ODgiIHZpZXdCb3g9IjAgMCA0OSA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LjEwOSwwLDAsMSw5Ni43NjQsMTAwLjg2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTgzIC03NSkiIGZpbGw9IiNmZjUzNTMiLz4NCiAgICA8L2c+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc3MiIgZGF0YS1uYW1lPSJQYXRoIDQ3NzIiIGQ9Ik0xMi41OSwxMS4yOWw1LjcyNi01Ljc0NEEuOS45LDAsMSwwLDE3LjA0LDQuMjY5TDExLjMsMTAsNS41NTEsNC4yNjlBLjkuOSwwLDEsMCw0LjI3NSw1LjU0NkwxMCwxMS4yOSw0LjI3NSwxNy4wMzVhLjkuOSwwLDEsMCwxLjI3NywxLjI3N0wxMS4zLDEyLjU4NWw1Ljc0NCw1LjcyNmEuOS45LDAsMSwwLDEuMjc3LTEuMjc3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTg2LjMzOSA5MC4wMTgpIiBmaWxsPSIjZmY1MzUzIi8+DQogIDwvZz4NCjwvc3ZnPg0K";const nt="";const rt=class{constructor(i){t(this,i)}async componentDidLoad(){}render(){return e("div",{key:"bc2799a2299733d489b02615893039c074d5c200",class:"container flex center"},e("div",{key:"c4a760672274ca15b99b091ee7a49d9f1d78776b",class:"px-3"},e("div",{key:"8772772f74921390f3b5cb9c5e2161154ec5e50f",class:"mb-1 ml-1 text-center"},e("img",{key:"e7c1d974fcc48539f998758c9cf8c67c435f1860",src:et,style:{width:"60px"}})),e("h1",{key:"3d7fc7ebe301e895df11b34dddd594b8240ce393",class:"text-center mb-2"},this.errorTitle),e("div",{key:"b027b1d4a52092e33d244f34eaf0c1c1d83fa610",class:"text-center mb-4"},e("p",{key:"ce8e4704efc541af1e956bb1c3fce1d4e44de8ab"},o.requestId)),e("div",{key:"97110f0abcc99a9cc4058b12789a1745a1631cc5"},e("p",{key:"27d813efc212681c7e082857b74a67831276ea16",class:"color-red text-center"},this.message)),e("div",{key:"9ab179c115f0c9cf1c00752875dad317e20f1aac",class:"footer text-center"},e("img",{key:"9ff74f79124e70ba9aca90bfba88dbfe2b60a1a7",src:b}))))}};rt.style=nt;const st="";const at=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError");this.loadImage=t=>new Promise(((i,e)=>{this.image.onload=()=>{this.imageLoaded=true;i(this.image)};this.image.onerror=e;this.image.src=t}))}async componentDidLoad(){if(o.flowStatus==c.IDFRONTHOWTO){this.imageLoaded=false;this.currentStep=r.CiFrontHowTo;this.topTitle=this.translations.HowToValues.IdFaceTitle;this.subTitle=this.translations.HowToValues.IdFaceSubTitle;this.buttonText=this.translations.HowToValues.IdButton;this.loadImage("https://ekyc.blob.core.windows.net/$web/howto_id.gif")}else if(o.flowStatus==c.IDBACKHOWTO){this.currentStep=r.CiBackHowTo;this.topTitle=this.translations.HowToValues.IdBackTitle;this.subTitle=this.translations.HowToValues.IdBackSubTitle;this.buttonText=this.translations.HowToValues.IdButton;this.loadImage("https://ekyc.blob.core.windows.net/$web/howto_id_back.gif")}else if(o.flowStatus==c.IDTILTHOWTO){this.imageLoaded=false;this.currentStep=r.CiTiltHowTo;this.topTitle=this.translations.HowToValues.TiltTitle;this.subTitle=this.translations.HowToValues.TiltSubTitle;this.buttonText=this.translations.HowToValues.TiltButton;this.loadImage("https://ekyc.blob.core.windows.net/$web/howto_id_tilt.gif")}else if(o.flowStatus==c.LIVENESSHOWTO){this.imageLoaded=false;this.currentStep=r.SelfieHowTo;this.topTitle=this.translations.HowToValues.SelfieTitle;this.subTitle=this.translations.HowToValues.SelfieSubTitle;this.buttonText=this.translations.HowToValues.SelfieButton;this.loadImage("https://ekyc.blob.core.windows.net/$web/howto_selfie.gif")}await d.initialize(this.currentStep)}async disconnectedCallback(){await d.finalize(this.currentStep)}async buttonClick(){this.buttonEnabled=false;o.flowStatus=await a.instance.GetNextFlowState()}async componentWillLoad(){this.translations=await s.getValues();this.buttonEnabled=true}render(){let t=e("div",{key:"7148240e3af7ff3e33b052660583a9f0f8070ef0",class:"container flex center"},e("div",{key:"0a92afe9ba7d7413be4f989a88d561b98efb5c87",hidden:this.imageLoaded==false,class:"px-2 w-100"},e("h1",{key:"a3e17693aba73b1bf8ab4ecf28dec2db25624f3f",class:"text-center px-1 mb-1",innerHTML:this.topTitle}),e("div",{key:"b1ce3e5fb75af0017c936da434dbd0998ac16e6f",class:"mb-1"},e("img",{key:"e07adc4ae239ec8b2b297cc1b5daa3d3e4175aa3",class:"w-100",ref:t=>this.image=t})),e("div",{key:"49322825ea16b96f0350c6866ac20a86aec6cab3",class:"button flex mb-1"},!this.buttonEnabled?e("div",{class:"img-loader rounded img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{key:"d91867f3c1e4b1d271e9c21b597e4635df4e041c",class:"main-button",type:"button",disabled:!this.buttonEnabled,onClick:()=>this.buttonClick()},this.buttonText)),e("div",{key:"567f4ac6f56ab7cc37ed26c27f82abfb61180920",class:"footer text-center"},e("img",{key:"05055f45486d2ffe1c8b93198b96e33890bc85ca",src:b}))));return t}};at.style=st;const ot="@keyframes capture-flash{0%{opacity:0}50%{opacity:1}100%{opacity:0}}.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;}.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;}";const ct=class{constructor(e){t(this,e);this.eventPhotoCapture=i(this,"photoIdCapture");this.eventRecordingIdReady=i(this,"recordingIdCapture");this.mediaRecorder=null;this.mediaStream=null;this.animationFrameId=null;this.opencvScriptElement=null;this.recordedChunks=[];this.countdown=0;this.capturedImage=null;this.isRecording=false;this.recordedVideoUrl=null;this.isDetecting=false;this.opencvReady=false;this.isCapturing=false;this.handleOpencvReady=()=>{this.opencvReady=true;console.log("OpenCV.js loaded. Ready to start detection.");this.getMedia();this.handleStartDetection()};this.startRecording=()=>{if(this.mediaStream&&this.videoElement){this.recordedChunks=[];var t={mimeType:v.webmMimeType.mime,videoBitsPerSecond:13e5};if(!MediaRecorder.isTypeSupported(t.mimeType)){if(o.device.mobileOS==m.iOS||o.device.browser==I.Safari)t.mimeType=v.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){const t=new Blob(this.recordedChunks,{type:"video/webm"});this.recordedVideoUrl=URL.createObjectURL(t)}};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.eventRecordingIdReady.emit(this.recordedVideoUrl)}};this.capture=()=>{if(this.videoElement&&this.canvasElement){const t=this.videoElement;const i=this.canvasElement;const e=i.getContext("2d");i.width=t.videoWidth;i.height=t.videoHeight;e.drawImage(t,0,0,i.width,i.height);this.capturedImage=i.toDataURL("image/png");console.log("Image captured!");this.verified=true;this.isCapturing=true;setTimeout((()=>{this.isCapturing=false}),200);this.eventPhotoCapture.emit(this.capturedImage)}};this.processVideoFrame=()=>{if(this.videoElement&&this.processingCanvasElement&&this.opencvReady&&this.isDetecting){const t=this.videoElement;const i=this.processingCanvasElement;const e=i.getContext("2d");i.width=t.videoWidth;i.height=t.videoHeight;e.drawImage(t,0,0,i.width,i.height);const n=e.getImageData(0,0,i.width,i.height);let r=cv.matFromImageData(n);let s=new cv.Mat;let a=new cv.Mat;let o=new cv.Mat;let c=new cv.MatVector;let f=new cv.Mat;try{cv.cvtColor(r,s,cv.COLOR_RGBA2GRAY,0);cv.GaussianBlur(s,a,new cv.Size(5,5),0,0,cv.BORDER_DEFAULT);cv.Canny(a,o,75,200,3,false);cv.findContours(o,c,f,cv.RETR_EXTERNAL,cv.CHAIN_APPROX_SIMPLE);let i=false;let e=0;for(let n=0;n<c.size();++n){let r=c.get(n);let s=cv.contourArea(r);if(s>1e3&&s>e){let n=cv.arcLength(r,true);let a=new cv.Mat;cv.approxPolyDP(r,a,.02*n,true);if(a.rows===4){let n=cv.boundingRect(a);const r=n.width/n.height;if(r>1.4&&r<1.8){if(n.width>t.videoWidth*.3&&n.height>t.videoHeight*.3){i=true;e=s}}}a.delete()}r.delete()}if(i){console.log("ID document detected! Starting countdown...");this.countdown=3;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}const t=setInterval((()=>{this.countdown--;if(this.countdown<=0){clearInterval(t);this.capture();this.stopRecording();this.isDetecting=false;console.log("Picture taken. You can now stop recording.");this.countdown=0}}),1e3)}}catch(t){console.error("OpenCV processing error:",t);this.isDetecting=false;if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}}finally{r.delete();s.delete();a.delete();o.delete();c.delete();f.delete()}}if(this.isDetecting&&this.animationFrameId!==null){this.animationFrameId=requestAnimationFrame(this.processVideoFrame)}};this.startFrameProcessing=()=>{if(this.opencvReady&&this.videoElement&&this.videoElement.readyState>=2){if(this.animationFrameId===null){this.animationFrameId=requestAnimationFrame(this.processVideoFrame)}}};this.handleStartDetection=()=>{if(!this.mediaStream){console.log("Camera not ready. Please allow camera access.");return}if(!this.opencvReady){console.log("OpenCV.js is not loaded yet. Please wait.");return}console.log("Starting ID detection...");this.isDetecting=true;this.capturedImage=null;this.recordedChunks=[];this.recordedVideoUrl=null;this.startRecording();this.startFrameProcessing()};this.verified=false}async componentWillLoad(){}async componentDidLoad(){console.log("Loading OpenCV.js...");this.loadOpenCVScript();document.addEventListener("opencv:ready",this.handleOpencvReady);if(typeof cv!=="undefined"&&cv.Mat){this.handleOpencvReady()}}disconnectedCallback(){if(this.mediaStream){this.mediaStream.getTracks().forEach((t=>t.stop()))}if(this.animationFrameId!==null){cancelAnimationFrame(this.animationFrameId);this.animationFrameId=null}if(this.recordedVideoUrl){URL.revokeObjectURL(this.recordedVideoUrl)}document.removeEventListener("opencv:ready",this.handleOpencvReady);if(this.opencvScriptElement&&this.opencvScriptElement.parentNode){this.opencvScriptElement.parentNode.removeChild(this.opencvScriptElement);this.opencvScriptElement=null}}loadOpenCVScript(){if(!this.opencvScriptElement){this.opencvScriptElement=document.createElement("script");this.opencvScriptElement.type="text/javascript";this.opencvScriptElement.async=true;this.opencvScriptElement.src="https://docs.opencv.org/4.x/opencv.js";document.body.appendChild(this.opencvScriptElement);console.log("Dynamically loaded opencv.js")}}async getMedia(){try{if(!o.cameraId){await v.InitCameras(o.device)}const t=v.GetConstraints(o.cameraId,o.device);const i=await navigator.mediaDevices.getUserMedia(t);if(this.videoElement){this.videoElement.srcObject=i;this.videoElement.play()}this.mediaStream=i}catch(t){console.error("Error accessing camera:",t)}}render(){let t="cameraVideo";let i="cameraCanvas";if(o.device.isDesktop){t="cameraVideoSelfieDesk";i="cameraCanvasSelfieDesk"}return e("div",{key:"f9dab73e130d1eb9d868aa8fbd7e7f87130bd3e4",class:"container flex center"},e("div",{key:"7b4a33981b50f7574575eee00daec592e6e18112",class:"px-2 w-100"},e("h1",{key:"66ed25207cd0ab02365d729fdfc01c8c14ebb012",class:this.titleStyle,innerHTML:this.titleMesage}),e("div",{key:"7bd8211e03cd853803446a25ce862365b0be0a06",hidden:this.verified},e("div",{key:"151a2cfb5fc0af17ab607be928fc181969fb38ca",class:"w-100 h-100 rounded"},e("div",{key:"dc34730669f4ebedaac894e5cd190680658ac743",class:"camera rounded"},e("video",{key:"7e01b3eabb9945e4629f685a1f4141fc14899f5a",id:"video",loop:true,autoplay:true,playsinline:true,muted:true,class:t,ref:t=>this.videoElement=t}),e("canvas",{key:"85675e9533b0d2ecbe448bed08f94a285455817d",id:"output",class:i,ref:t=>this.canvasElement=t}),e("canvas",{key:"b51d0c04ba8cf8bb07f0719095b858223b3637f7",id:"processingCanvasElement",ref:t=>this.processingCanvasElement=t,style:{display:"none"}}),e("div",{key:"d59716f98cd2241dcde8be542d9452c37145232e",class:"id-guide-rectangle"}),this.isCapturing&&e("div",{key:"73f6a68f5935a3b9dc13494773426734665f325a",class:"capture-flash-overlay"}),this.countdown>0&&e("div",{key:"cb1cd5ec46cbfea0dd82c35b6a9af9a0dffd9a46",class:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center"},e("span",{key:"4d8494b1edab23158ea1c22f30cc14df3387c2de",class:"text-white text-9xl font-bold animate-bounce"},this.countdown))))),e("div",{key:"8ca97d57b739c3b0fa44bc57c1a2289a3f81dd6c",class:"footer text-center"},e("img",{key:"4e19d95e0e212a83f41a2c0d35a53f216446c978",src:b}))))}get el(){return n(this)}};ct.style=ot;const ft=class{constructor(e){t(this,e);this.idCaptureConfirmation=i(this,"idCaptureConfirmation");this.idCaptureRetry=i(this,"idCaptureRetry")}async componentWillLoad(){this.translations=await s.getValues();this.image=await p(this.capture)}async componentDidLoad(){}confirm(){this.idCaptureConfirmation.emit()}retry(){this.idCaptureRetry.emit()}render(){return e("div",{key:"2f0b65867b8426570769239b25080a2af8b49740",class:"container flex center"},e("div",{key:"0689c4a8d7b390919d2547c68094dde267e69516",class:"px-2 w-100"},e("h1",{key:"6b6bb058075505ec5612426c94fe4b7a8053f68f",class:"text-center px-1 mb-2",innerHTML:this.translations.IdCaptureConfirmValues.Title}),e("div",{key:"a51508d12602dd258acfe769e3c5f7871f92c1f3",class:"mb-3"},e("img",{key:"86c74567b9f0766672fa76b23bf1f3803d9887ef",class:"w-100 rounded",src:this.image})),e("div",{key:"1a2cbd17d02c5eb64e5f7a0508daeac44b1d190f",class:"button flex mb-1 mx-3"},e("button",{key:"82b65c0bd4e38d83f01a0c496cb17e9737dea213",class:"main-button",type:"button",onClick:()=>this.confirm()},this.translations.IdCaptureConfirmValues.Confirm)),e("div",{key:"c6ff5f2cc71df5d6b614c41870e46ba3a113774d",class:"text-center"},e("p",{key:"57c718c27a32af277c815b0ba9b6c00d48467cae",class:"main-text link-text",onClick:()=>this.retry()},this.translations.IdCaptureConfirmValues.Retry)),e("div",{key:"9683cbe2cf2b6a3e92609e54d633fabddd9d1a37",class:"footer text-center"},e("img",{key:"c3d200c44bcb581cd92925df39132ab3572056b0",src:b}))))}get component(){return n(this)}};const ut="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1Mi4yOTIiIGhlaWdodD0iNDMuODU4IiB2aWV3Qm94PSIwIDAgNTIuMjkyIDQzLjg1OCI+DQogIDxnIGlkPSJpZC1jYXJkIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcgLTI5KSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MSIgZGF0YS1uYW1lPSJQYXRoIDQ3NTEiIGQ9Ik0yMC4zNzQsNjYuOTU0aDIyLjM1YS44NDMuODQzLDAsMCwwLDAtMS42ODdIMjAuMzc0YTEuNjg5LDEuNjg5LDAsMCwxLTEuNjg3LTEuNjg3VjMyLjM3NGExLjY4OSwxLjY4OSwwLDAsMSwxLjY4Ny0xLjY4N0g2NS45MThBMS42ODksMS42ODksMCwwLDEsNjcuNiwzMi4zNzRWNDkuMjQyYS44NDMuODQzLDAsMCwwLDEuNjg3LDBWMzIuMzc0QTMuMzc4LDMuMzc4LDAsMCwwLDY1LjkxOCwyOUgyMC4zNzRBMy4zNzgsMy4zNzgsMCwwLDAsMTcsMzIuMzc0VjYzLjU4QTMuMzc4LDMuMzc4LDAsMCwwLDIwLjM3NCw2Ni45NTRaIiBmaWxsPSIjMjUyYzgyIi8+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc1MiIgZGF0YS1uYW1lPSJQYXRoIDQ3NTIiIGQ9Ik01MC42NTEsNTAuMzI2YTYuMzI2LDYuMzI2LDAsMSwwLTYuMzI2LDYuMzI2QTYuMzMzLDYuMzMzLDAsMCwwLDUwLjY1MSw1MC4zMjZabS0xMC45NjQsMGE0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GUoLTM5LjMyNCAtMTkuMDg0KSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTYiIGRhdGEtbmFtZT0iUGF0aCA0NzU2IiBkPSJNOTUuMjI5LDc1YTEyLjIzLDEyLjIzLDAsMSwwLDEyLjIzLDEyLjIzQTEyLjI0NCwxMi4yNDQsMCwwLDAsOTUuMjI5LDc1Wm0wLDIyLjk3N0ExMC43NDcsMTAuNzQ3LDAsMSwxLDEwNS45NzcsODcuMjMsMTAuNzU5LDEwLjc1OSwwLDAsMSw5NS4yMjksOTcuOTc3WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTM4LjE2NyAtMjYuNjAyKSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NTciIGRhdGEtbmFtZT0iUGF0aCA0NzU3IiBkPSJNMTExLjA1OSw5OC43MTdsLTcuNDQ0LDcuNDQzLTQuODUtNC44NDlhLjc0MS43NDEsMCwwLDAtMS4wNDgsMS4wNDhsNS4zNzQsNS4zNzRhLjc0MS43NDEsMCwwLDAsMS4wNDgsMGw3Ljk2OC03Ljk2OGEuNzQxLjc0MSwwLDAsMC0xLjA0OC0xLjA0OFoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00Ny4yOTQgLTQxLjM5MykiIGZpbGw9IiM3YmI0MGYiLz4NCiAgPC9nPg0KPC9zdmc+DQo=";const lt="";const ht=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError")}async componentWillRender(){this.translations=await s.getValues()}componentWillLoad(){this.yesButtonPressed=false;this.noButtonPressed=false}async hasBackSelected(){this.yesButtonPressed=true;try{await a.instance.SetTwoSidedId()}catch(t){this.apiErrorEvent.emit(t)}}async onlyFrontSelected(){this.noButtonPressed=true;try{o.flowStatus=await a.instance.GetNextFlowState()}catch(t){this.apiErrorEvent.emit(t)}}render(){return e("div",{key:"548285cac25fd57d07e58a35eee366f5eb8c9fe2",class:"container flex center"},e("div",{key:"c1af7851a9eb66ec4a53ce281a447988c31260b9",class:"px-3"},e("div",{key:"8c206909ac9de445003807112af0709f825041a1",class:"mb-1 ml-1 text-center"},e("img",{key:"aa365d1d3ca0d120d76ac8e12b507702c805a153",src:ut,style:{width:"70px"}})),e("h1",{key:"e5a44748d186507e7c388a504f8cb6fd33be5b5d",class:"text-center mb-1"},this.translations.IdSelectionValues.Title),e("div",{key:"d4a4ea745473573f080aaf779058f8b0ced69f8d",class:"color-blue mb-2 loud-text",innerHTML:this.translations.IdSelectionValues.Description}),!this.noButtonPressed?e("div",{class:"button flex mb-1"},this.yesButtonPressed?e("div",{class:"img-loader rounded img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{class:"main-button",type:"button",disabled:this.yesButtonPressed,onClick:()=>this.hasBackSelected()},this.translations.IdSelectionValues.ButtonYes)):null,e("div",{key:"4c74b01c98cd6b4cdcbc2df21eade9a00f2ec921"}),!this.yesButtonPressed?e("div",{class:"button flex mb-1"},this.noButtonPressed?e("div",{class:"img-loader rounded img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{class:"main-button",type:"button",disabled:this.noButtonPressed,onClick:()=>this.onlyFrontSelected()},this.translations.IdSelectionValues.ButtonNo)):null,e("div",{key:"0dfa681171e9aa928df7fda88278e7fba5816936",class:"footer text-center"},e("img",{key:"3e244427a827a5f1f6025127e531587cd9d02446",src:b}))))}};ht.style=lt;const dt="4.7.17";var wt={version:dt};class bt{constructor(){var t,i,e,n;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=(i=(t=((screen===null||screen===void 0?void 0:screen.orientation)||{}).type)!==null&&t!==void 0?t:screen.mozOrientation)!==null&&i!==void 0?i:screen.msOrientation;this.safariScreenOrientation=!(screen===null||screen===void 0?void 0:screen.orientation)&&matchMedia("(orientation: portrait)").matches?"portrait-primary":"landscape-primary";this.initialScreenOrientation=(n=(e=this.supportedScreenOrientation)!==null&&e!==void 0?e:this.safariScreenOrientation)!==null&&n!==void 0?n:"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 m.WindowsPhone;else if(/android/i.test(this.userAgent))return m.Android;else if(/iPad|iPhone|iPod/.test(this.userAgent)&&!window.MSStream)return m.iOS;return m.Unknown}else return undefined}getDesktopOS(){if(this.isDesktop){if(this.userAgent.indexOf("Win")!==-1)return L.Windows;else if(this.userAgent.indexOf("Mac")!==-1)return L.MacOS;else if(this.userAgent.indexOf("X11")!==-1)return L.Unix;else if(this.userAgent.indexOf("Linux")!==-1)return L.Linux;return L.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 I.Mi;var t=/chrome/i.test(this.userAgent);if(t)return I.Chrome;if(/firefox/i.test(navigator.userAgent))return I.Firefox;else if(!t&&/safari/i.test(navigator.userAgent))return I.Safari;else return I.Unknown}async checkIfMobileBySensors(){var t,i;if(typeof((t=window.DeviceMotionEvent)===null||t===void 0?void 0:t.requestPermission)==="function"){var e=window.DeviceMotionEvent.requestPermission();if(e==="granted"){await this.getMotionValues()}}else{await this.getMotionValues()}await y(200);var n=false;if(this.motionValues.length>0){n=this.motionValues.filter((t=>t.x!=0)).length>=3}if(typeof((i=window.DeviceOrientationEvent)===null||i===void 0?void 0:i.requestPermission)==="function"){var e=window.DeviceOrientationEvent.requestPermission();if(e==="granted"){await this.getOrientationValues()}}else{await this.getOrientationValues()}await y(500);var r=false;if(this.orientationValues.length>0){r=this.orientationValues.map((t=>t.beta)).every(((t,i,e)=>i==0?t!==e[e.length-1]:t!==e[i-1]))||this.orientationValues.map((t=>t.gamma)).every(((t,i,e)=>i==0?t!==e[e.length-1]:t!==e[i-1]))}return n||r}async getOrientationValues(){window.addEventListener("deviceorientation",this.addItemsToOrientation)}async getMotionValues(){window.addEventListener("devicemotion",this.addItemsToMotion)}async getDevice(){var t=await this.checkIfMobileBySensors();var i={isMobileBySensors:t,isDesktop:this.isDesktop,desktopOS:this.getDesktopOS(),isWindowsDesktop:this.getDeviceOS()===L.Windows,isLinuxOrUnixDesktop:this.getDeviceOS()===L.Linux||this.getDeviceOS()===L.Unix,isMobile:this.isMobile,mobileOS:this.getMobileOS(),isAndroidDevice:this.getDeviceOS()===m.Android,isAppleDevice:this.getDeviceOS()===m.iOS||this.getDeviceOS()===L.MacOS,isUnknownMobileDevice:this.getDeviceOS()===m.Unknown,browser:this.getBrowser(),isTablet:this.isTablet,initialScreenOrientation:this.initialScreenOrientation};return i}}const gt="@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 Mt=class{async onTokenChange(t,i){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{a.instance.GenerateAgreement(t.detail.agreementType)}catch(t){this.apiErrorEmitter(t,"Agreement Acceptance")}}async apiErrorEmitter(t,i){var e,n,r,s,u,l;if(t.detail){this.errorTitle=(n=(e=t.detail.message)!==null&&e!==void 0?e:t.detail.status)!==null&&n!==void 0?n:"";this.errorMessage=(s=(r=t.detail.stack)!==null&&r!==void 0?r:t.detail.statusText)!==null&&s!==void 0?s:""}else if(t.message){this.errorTitle=t.message}else if(t.status){this.errorTitle=(u=t.status)!==null&&u!==void 0?u:"";this.errorMessage=(l=t.statusText)!==null&&l!==void 0?l:""}else{this.errorTitle=t}let h={message:this.errorTitle,stack:this.errorMessage,zone:i};try{await a.instance.AddLog(h,await D(this.order_id,this.redirect_id,this.token))}catch(t){}await f.ectdata.delete(o.requestId);w.flowError(this.errorTitle);o.flowStatus=c.ERROREND}constructor(i){t(this,i);this.logInit={};this.initialised=false}async componentWillLoad(){var t,i,e;o.analytics=(t=this.analytics)!==null&&t!==void 0?t:true;this.appInsights=N.getInstance();this.appInsights.trackEvent("IdentificationComponent | init",{requestId:o.requestId});w.init(window);w.flowEvent(r.ComponentLoaded,u.Initialized);o.apiBaseUrl=this.api_url;if(this.env&&this.env!=""){o.environment=this.env}if(o.environment!="PROD"){o.debug=true}a.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=(i=this.show_citizenship_selector)!==null&&i!==void 0?i:false;o.scrollMode=(e=this.scroll_mode)!==null&&e!==void 0?e:false}async componentDidLoad(){var t,i,e,n,r,s;if(this.order_id&&this.order_id!=""){this.ectData=await f.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 c=await f.getLastEctData(false);if(c){this.ectData=c;o.requestId=this.ectData.orderId;o.initialized=this.ectData.initialized}}if(((t=this.ectData)===null||t===void 0?void 0:t.modelsPath)&&((i=this.ectData)===null||i===void 0?void 0:i.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 f.ectdata.put(this.ectData)}else if(((e=this.ectData)===null||e===void 0?void 0:e.phoneNumber)&&((n=this.ectData)===null||n===void 0?void 0:n.phoneNumber)!=""){o.phoneNumber=this.ectData.phoneNumber}if(this.citizenship&&this.citizenship!=""){o.citizenship=this.citizenship;this.ectData.citizenship=this.citizenship;await f.ectdata.put(this.ectData)}else if(((r=this.ectData)===null||r===void 0?void 0:r.citizenship)&&((s=this.ectData)===null||s===void 0?void 0:s.citizenship)!=""){o.citizenship=this.ectData.citizenship}await this.initializeRequest();try{if(this.ectData.initialized){o.flowStatus=await a.instance.GetFlowState()}}catch(t){}}async initializeRequest(){if(this.initialised){return}this.initialised=true;if(!o.device){o.device=await(new bt).getDevice()}if(o.device.browser==I.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 a.instance.AddLog({phase:"debug mode"},this.logInit)}catch(t){}try{if(!o.device.isMobile&&o.redirectId==""&&o.environment!="DEMO"){o.redirectId=x();this.redirect_id=o.redirectId}if(o.token!=""&&(o.requestId!=""||o.redirectId!="")&&!o.initialized){await a.instance.AddIdentificationRequest(o.device,wt.version);await this.treatMobileRedirect();this.ectData.initialized=true;this.ectData.flowStatus=o.flowStatus;this.ectData.modelsPath=o.modelsPath;await f.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 f.ectdata.get(o.requestId);if(!this.ectData){await f.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 f.ectdata.get(o.requestId)}}disconnectedCallback(){w.flowEvent(r.ComponentLoaded,u.Finalized)}render(){let t=e("div",{key:"a216d5b456c30a303de5ad230a9405b4d9403bca",class:"container flex center text-center"},e("img",{key:"e6516da2c241a641b7a1d4882da83823f3696cbe",src:U}));if(o.flowStatus==c.CITIZENSHIP){t=e("citizenship-selection",{key:"0146bbb07abad5228528955c1e1a900a0996d092"})}else if(o.flowStatus==c.LANDING){t=e("landing-validation",{key:"d5941e07dfbc39837df0575a8255a720d6455d9e"})}else if(o.flowStatus==c.MOBILE){t=e("mobile-redirect",{key:"6f6e0aff8e22cd7dfa8eed8ddbf5aae599e33759"})}else if(o.flowStatus==c.AGREEMENT){t=e("agreement-info",{key:"d426b76e6eaad5c6dfef06287097ea6901255971"})}else if(o.flowStatus==c.PHONE){t=e("sms-send",{key:"fa703c3d4fc6587b6fc01eaee3d1553598d9c0fd"})}else if(o.flowStatus==c.CODE){t=e("sms-code-validation",{key:"24cc9cfa7c77527d81a8eca34262a96abddb47ad"})}else if(o.flowStatus==c.CODEERROR){t=e("sms-code-validation",{key:"d99905b23dc860c509044085ef23722cd45ec61b"})}else if(o.flowStatus==c.IDTYPE){t=e("id-selection",{key:"7e54a3d3c2d5a4e8811aa38e016a85039768c362"})}else if(o.flowStatus==c.IDFRONTHOWTO){if(o.debug)console.log("identification-component | render | IDFRONTHOWTO");t=e("how-to-info",{key:"09e4b17d4725c7a1e3e05a5f4cace74d14cca7cc"})}else if(o.flowStatus==c.IDFRONT){if(o.debug)console.log("identification-component | render | IDFRONT");t=e("process-id",{key:"6b03639c53ce29d20e1d5ae0e28f724865b53986",id:"processIdFront",mode:"front"})}else if(o.flowStatus==c.IDBACKHOWTO){if(o.debug)console.log("identification-component | render | IDBACKHOWTO");t=e("how-to-info",{key:"0b15e26408f5dba005bb2d72cab84813c7b29beb"})}else if(o.flowStatus==c.IDBACK){if(o.debug)console.log("identification-component | render | IDBACK");t=e("process-id",{key:"b7fe0c75f3fa1facb1cecb8e698ac3d283da6dcf",id:"processIdBack",mode:"back"})}else if(o.flowStatus==c.IDTILTHOWTO){if(o.debug)console.log("identification-component | render | IDTILTHOWTO");t=e("how-to-info",{key:"9758fb199122745eb0ad52f3e60428c646a6d6dd"})}else if(o.flowStatus==c.IDTILT){if(o.debug)console.log("identification-component | render | TILT");t=e("process-id",{key:"8ef11a8b33b5a4a98178a06c829e9271cbd811f9",id:"processIdTilt",mode:"tilt"})}else if(o.flowStatus==c.LIVENESSHOWTO){if(o.debug)console.log("identification-component | render | LIVENESSHOWTO");t=e("how-to-info",{key:"7d9cd7d51a3cb8c0d30dcc4de557d743c3c42fdb"})}else if(o.flowStatus==c.LIVENESS){if(o.debug)console.log("identification-component | render | LIVENESS");t=e("user-liveness",{key:"6950bad1c8c3bee45126f68d67ed538bcf5c4033",id:"userLiveness",mode:"selfie"})}else if(o.flowStatus==c.LIVENESSGESTUREHOWTO){if(o.debug)console.log("identification-component | render | LIVENESSGESTUREHOWTO");t=e("state-transition",{key:"d33d76cd24e93137a670c1020b9eeab0e6d9a2e5"})}else if(o.flowStatus==c.LIVENESSGESTURE){if(o.debug)console.log("identification-component | render | LIVENESSGESTURE");t=e("user-liveness",{key:"0bec27ff3f16d8834ecbccfa3d92cb244f366927",id:"userLivenessGesture",mode:"selfieGesture"})}else if(o.flowStatus==c.COMPLETE){if(o.debug)console.log("identification-component | render | COMPLETE");t=e("end-redirect",{key:"ac5e445b98e84fbca762933abf9e7a2dd3ffd9e4"})}else if(o.flowStatus==c.ERROREND){t=e("error-end",{key:"25e11b9fde77d95fa6c89ef15c0c6f8d380ac7c2",errorTitle:this.errorTitle,message:this.errorMessage})}else if(o.flowStatus==c.CAMERAERROR){t=e("camera-error",{key:"f7e68824b67027c67a3cb59f991f8610d6e61901"})}else if(o.flowStatus==c.RANDOM){if(o.debug)console.log("identification-component | render | RANDOM");t=e("random-action",{key:"9a6d158487796f3c5c49cc94737bd24e36c55fa1"})}return e("div",{key:"854aea3a45b7fb45f75ed31b3aefb6e53b3560b2",class:"full"},t)}static get watchers(){return{token:["onTokenChange"]}}};Mt.style=gt;const mt="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0Mi4xMDkiIGhlaWdodD0iNTIuNzg4IiB2aWV3Qm94PSIwIDAgNDIuMTA5IDUyLjc4OCI+DQogIDxnIGlkPSJtb2JpbGVfcGhvbmUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yNSAtMzQyKSI+DQogICAgPHBhdGggaWQ9IlBhdGhfNDc0NiIgZGF0YS1uYW1lPSJQYXRoIDQ3NDYiIGQ9Ik0yOS45MSw1NWEuOTEuOTEsMCwxLDAsMCwxLjgyaDMuNjQxYS45MS45MSwwLDEsMCwwLTEuODJaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg4Ljc0MiAzMzQuMzI3KSIvPg0KICAgIDxwYXRoIGlkPSJQYXRoXzQ3NDgiIGRhdGEtbmFtZT0iUGF0aCA0NzQ4IiBkPSJNMzYuNTEyLDgu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NOTQuOTUzLDc1YTExLjk1MywxMS45NTMsMCwxLDAsMTEuOTUzLDExLjk1M0ExMS45NjcsMTEuOTY3LDAsMCwwLDk0Ljk1Myw3NVptMCwyMi40NTdhMTAuNSwxMC41LDAsMSwxLDEwLjUtMTAuNUExMC41MTYsMTAuNTE2LDAsMCwxLDk0Ljk1Myw5Ny40NTdaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODMgLTc1KSIgZmlsbD0iIzI1MmM4MiIvPg0KICAgICAgICA8cGF0aCBpZD0iUGF0aF80NzU5IiBkYXRhLW5hbWU9IlBhdGggNDc1OSIgZD0iTTExMC43NTIsOTguNzEybC03LjI3NSw3LjI3NS00Ljc0LTQuNzM5YS43MjQuNzI0LDAsMCwwLTEuMDI0LDEuMDI0bDUuMjUyLDUuMjUyYS43MjQuNzI0LDAsMCwwLDEuMDI0LDBsNy43ODctNy43ODdhLjcyNC43MjQsMCwwLDAtMS4wMjQtMS4wMjRaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOTIuMjQ4IC04OS45ODgpIiBmaWxsPSIjN2JiNDBlIi8+DQogICAgICA8L2c+DQogICAgPC9nPg0KICA8L2c+DQo8L3N2Zz4NCg==";const yt="";const vt=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError")}async componentWillLoad(){w.flowStarted();this.translations=await s.getValues();this.buttonDisabled=false;this.ectData=await f.ectdata.get(o.requestId);await this.initRequest()}async componentDidLoad(){await d.initialize(r.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 v.InitCameras(o.device);if(!t&&o.device.mobileOS==m.iOS){this.ectData.refreshStarted=false;await f.ectdata.put(this.ectData)}try{o.flowStatus=await a.instance.LandingValidationStartFlow(t)}catch(t){this.apiErrorEvent.emit(t)}}}async disconnectedCallback(){await d.finalize(r.Landing)}async leaveFlow(){if(this.buttonDisabled)return;try{let t=await a.instance.AbortRequest();o.flowStatus=c[t.state];await f.ectdata.delete(o.requestId);w.flowAborted()}catch(t){w.flowAborted();this.apiErrorEvent.emit(t)}}render(){return e("div",{key:"d618ec737203dbca23c71ba70eb50535b371e5e9",class:"container flex center"},e("div",{key:"556e4ffd78cd47a607a08edf42eafdccb7d9eaa4",class:"px-4"},e("h1",{key:"4e612b4eb40d3d0aaf701f80c0328c6e26a17b05",class:"text-center px-1 mb-1"},this.translations.LandingValues.Title),e("div",{key:"5e2db6b1834a9104dbfc11f74bc3dbfb302bc885",class:"info-container mb-2"},e("div",{key:"b171929655a72d7438c0f0b6a6d18dddb7edd918",class:"img-text"},e("div",{key:"352f446d7b6873c46fd0262f5f5735e2410003cb",class:"bg-img"},e("img",{key:"1e4ff14942591343c4180756f89cbcf42bf3fb56",src:ut})),e("h2",{key:"0c634ab83da1fb69873ca2165bef6fa07fb14b79"},this.translations.LandingValues.IdInfo)),e("div",{key:"2a047549762b3e19e7ee98e86a9337ad89e4c068",class:"img-text"},e("div",{key:"33eb0d5268aa6f03b7b27599df018b7507a0a0f3",class:"bg-img"},e("img",{key:"2dd8a5bc6e863a4e8a6bd73c4cf5adaf7ddf41bf",src:mt})),e("h2",{key:"f1fd0cf00a75ff68fa80d5e32abe26c98d78d4db"},this.translations.LandingValues.DeviceInfo))),e("div",{key:"bc30b452807ed7172bfb52ad72846c3092eaed69",class:"button flex mb-1"},this.buttonDisabled?e("div",{class:"img-loader rounded img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{key:"5968b62df868fa80d3695142629bd8f9adb2dfbc",class:"main-button",type:"button",disabled:this.buttonDisabled,onClick:()=>this.startFlow()},this.translations.LandingValues.Button)),e("div",{key:"d8596565c817c5c5a3dec47abe5e5e040bb656bf",class:"text-center"},e("p",{key:"db30ed026e83f1560080db831eb2ea7c45513f97",class:"main-text link-text",onClick:()=>this.leaveFlow()},this.translations.LandingValues.ButtonLeave)),e("div",{key:"fd15ffcd70247a4e20c1812ea0f87dc6118042e9",class:"footer text-center"},e("img",{key:"58a008db51ad76882d01f18ecbc50b31ac58c697",src:b}))))}};vt.style=yt;var It={};var pt;var Lt;function Dt(){if(Lt)return pt;Lt=1;pt=function(){return typeof Promise==="function"&&Promise.prototype&&Promise.prototype.then};return pt}var Nt={};var xt={};var Ct;function kt(){if(Ct)return xt;Ct=1;let t;const i=[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];xt.getSymbolSize=function t(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17};xt.getSymbolTotalCodewords=function t(e){return i[e]};xt.getBCHDigit=function(t){let i=0;while(t!==0){i++;t>>>=1}return i};xt.setToSJISFunction=function i(e){if(typeof e!=="function"){throw new Error('"toSJISFunc" is not a valid function.')}t=e};xt.isKanjiModeEnabled=function(){return typeof t!=="undefined"};xt.toSJIS=function i(e){return t(e)};return xt}var jt={};var zt;function St(){if(zt)return jt;zt=1;(function(t){t.L={bit:1};t.M={bit:0};t.Q={bit:3};t.H={bit:2};function i(i){if(typeof i!=="string"){throw new Error("Param is not a string")}const e=i.toLowerCase();switch(e){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: "+i)}}t.isValid=function t(i){return i&&typeof i.bit!=="undefined"&&i.bit>=0&&i.bit<4};t.from=function e(n,r){if(t.isValid(n)){return n}try{return i(n)}catch(t){return r}}})(jt);return jt}var Tt;var At;function Et(){if(At)return Tt;At=1;function t(){this.buffer=[];this.length=0}t.prototype={get:function(t){const i=Math.floor(t/8);return(this.buffer[i]>>>7-t%8&1)===1},put:function(t,i){for(let e=0;e<i;e++){this.putBit((t>>>i-e-1&1)===1)}},getLengthInBits:function(){return this.length},putBit:function(t){const i=Math.floor(this.length/8);if(this.buffer.length<=i){this.buffer.push(0)}if(t){this.buffer[i]|=128>>>this.length%8}this.length++}};Tt=t;return Tt}var Yt;var Ot;function Zt(){if(Ot)return Yt;Ot=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,i,e,n){const r=t*this.size+i;this.data[r]=e;if(n)this.reservedBit[r]=true};t.prototype.get=function(t,i){return this.data[t*this.size+i]};t.prototype.xor=function(t,i,e){this.data[t*this.size+i]^=e};t.prototype.isReserved=function(t,i){return this.reservedBit[t*this.size+i]};Yt=t;return Yt}var Rt={};var Gt;function Qt(){if(Gt)return Rt;Gt=1;(function(t){const i=kt().getSymbolSize;t.getRowColCoords=function t(e){if(e===1)return[];const n=Math.floor(e/7)+2;const r=i(e);const s=r===145?26:Math.ceil((r-13)/(2*n-2))*2;const a=[r-7];for(let t=1;t<n-1;t++){a[t]=a[t-1]-s}a.push(6);return a.reverse()};t.getPositions=function i(e){const n=[];const r=t.getRowColCoords(e);const s=r.length;for(let t=0;t<s;t++){for(let i=0;i<s;i++){if(t===0&&i===0||t===0&&i===s-1||t===s-1&&i===0){continue}n.push([r[t],r[i]])}}return n}})(Rt);return Rt}var Wt={};var Ut;function Pt(){if(Ut)return Wt;Ut=1;const t=kt().getSymbolSize;const i=7;Wt.getPositions=function e(n){const r=t(n);return[[0,0],[r-i,0],[0,r-i]]};return Wt}var Ft={};var Bt;function Jt(){if(Bt)return Ft;Bt=1;(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const i={N1:3,N2:3,N3:40,N4:10};t.isValid=function t(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7};t.from=function i(e){return t.isValid(e)?parseInt(e,10):undefined};t.getPenaltyN1=function t(e){const n=e.size;let r=0;let s=0;let a=0;let o=null;let c=null;for(let t=0;t<n;t++){s=a=0;o=c=null;for(let f=0;f<n;f++){let n=e.get(t,f);if(n===o){s++}else{if(s>=5)r+=i.N1+(s-5);o=n;s=1}n=e.get(f,t);if(n===c){a++}else{if(a>=5)r+=i.N1+(a-5);c=n;a=1}}if(s>=5)r+=i.N1+(s-5);if(a>=5)r+=i.N1+(a-5)}return r};t.getPenaltyN2=function t(e){const n=e.size;let r=0;for(let t=0;t<n-1;t++){for(let i=0;i<n-1;i++){const n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);if(n===4||n===0)r++}}return r*i.N2};t.getPenaltyN3=function t(e){const n=e.size;let r=0;let s=0;let a=0;for(let t=0;t<n;t++){s=a=0;for(let i=0;i<n;i++){s=s<<1&2047|e.get(t,i);if(i>=10&&(s===1488||s===93))r++;a=a<<1&2047|e.get(i,t);if(i>=10&&(a===1488||a===93))r++}}return r*i.N3};t.getPenaltyN4=function t(e){let n=0;const r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];const s=Math.abs(Math.ceil(n*100/r/5)-10);return s*i.N4};function e(i,e,n){switch(i){case t.Patterns.PATTERN000:return(e+n)%2===0;case t.Patterns.PATTERN001:return e%2===0;case t.Patterns.PATTERN010:return n%3===0;case t.Patterns.PATTERN011:return(e+n)%3===0;case t.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2===0;case t.Patterns.PATTERN101:return e*n%2+e*n%3===0;case t.Patterns.PATTERN110:return(e*n%2+e*n%3)%2===0;case t.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function t(i,n){const r=n.size;for(let t=0;t<r;t++){for(let s=0;s<r;s++){if(n.isReserved(s,t))continue;n.xor(s,t,e(i,s,t))}}};t.getBestMask=function i(e,n){const r=Object.keys(t.Patterns).length;let s=0;let a=Infinity;for(let i=0;i<r;i++){n(i);t.applyMask(i,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(i,e);if(r<a){a=r;s=i}}return s}})(Ft);return Ft}var Ht={};var Xt;function Vt(){if(Xt)return Ht;Xt=1;const t=St();const i=[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 e=[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];Ht.getBlocksCount=function e(n,r){switch(r){case t.L:return i[(n-1)*4+0];case t.M:return i[(n-1)*4+1];case t.Q:return i[(n-1)*4+2];case t.H:return i[(n-1)*4+3];default:return undefined}};Ht.getTotalCodewordsCount=function i(n,r){switch(r){case t.L:return e[(n-1)*4+0];case t.M:return e[(n-1)*4+1];case t.Q:return e[(n-1)*4+2];case t.H:return e[(n-1)*4+3];default:return undefined}};return Ht}var _t={};var Kt={};var qt;function $t(){if(qt)return Kt;qt=1;const t=new Uint8Array(512);const i=new Uint8Array(256);(function e(){let n=1;for(let e=0;e<255;e++){t[e]=n;i[n]=e;n<<=1;if(n&256){n^=285}}for(let i=255;i<512;i++){t[i]=t[i-255]}})();Kt.log=function t(e){if(e<1)throw new Error("log("+e+")");return i[e]};Kt.exp=function i(e){return t[e]};Kt.mul=function e(n,r){if(n===0||r===0)return 0;return t[i[n]+i[r]]};return Kt}var ti;function ii(){if(ti)return _t;ti=1;(function(t){const i=$t();t.mul=function t(e,n){const r=new Uint8Array(e.length+n.length-1);for(let t=0;t<e.length;t++){for(let s=0;s<n.length;s++){r[t+s]^=i.mul(e[t],n[s])}}return r};t.mod=function t(e,n){let r=new Uint8Array(e);while(r.length-n.length>=0){const t=r[0];for(let e=0;e<n.length;e++){r[e]^=i.mul(n[e],t)}let e=0;while(e<r.length&&r[e]===0)e++;r=r.slice(e)}return r};t.generateECPolynomial=function e(n){let r=new Uint8Array([1]);for(let e=0;e<n;e++){r=t.mul(r,new Uint8Array([1,i.exp(e)]))}return r}})(_t);return _t}var ei;var ni;function ri(){if(ni)return ei;ni=1;const t=ii();function i(t){this.genPoly=undefined;this.degree=t;if(this.degree)this.initialize(this.degree)}i.prototype.initialize=function i(e){this.degree=e;this.genPoly=t.generateECPolynomial(this.degree)};i.prototype.encode=function i(e){if(!this.genPoly){throw new Error("Encoder not initialized")}const n=new Uint8Array(e.length+this.degree);n.set(e);const r=t.mod(n,this.genPoly);const s=this.degree-r.length;if(s>0){const t=new Uint8Array(this.degree);t.set(r,s);return t}return r};ei=i;return ei}var si={};var ai={};var oi={};var ci;function fi(){if(ci)return oi;ci=1;oi.isValid=function t(i){return!isNaN(i)&&i>=1&&i<=40};return oi}var ui={};var li;function hi(){if(li)return ui;li=1;const t="[0-9]+";const i="[A-Z $%*+\\-./:]+";let e="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|"+"[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|"+"[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|"+"[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";e=e.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+e+")(?:.|[\r\n]))+";ui.KANJI=new RegExp(e,"g");ui.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ui.BYTE=new RegExp(n,"g");ui.NUMERIC=new RegExp(t,"g");ui.ALPHANUMERIC=new RegExp(i,"g");const r=new RegExp("^"+e+"$");const s=new RegExp("^"+t+"$");const a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ui.testKanji=function t(i){return r.test(i)};ui.testNumeric=function t(i){return s.test(i)};ui.testAlphanumeric=function t(i){return a.test(i)};return ui}var di;function wi(){if(di)return ai;di=1;(function(t){const i=fi();const e=hi();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(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!i.isValid(n)){throw new Error("Invalid version: "+n)}if(n>=1&&n<10)return e.ccBits[0];else if(n<27)return e.ccBits[1];return e.ccBits[2]};t.getBestModeForData=function i(n){if(e.testNumeric(n))return t.NUMERIC;else if(e.testAlphanumeric(n))return t.ALPHANUMERIC;else if(e.testKanji(n))return t.KANJI;else return t.BYTE};t.toString=function t(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")};t.isValid=function t(i){return i&&i.bit&&i.ccBits};function n(i){if(typeof i!=="string"){throw new Error("Param is not a string")}const e=i.toLowerCase();switch(e){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: "+i)}}t.from=function i(e,r){if(t.isValid(e)){return e}try{return n(e)}catch(t){return r}}})(ai);return ai}var bi;function gi(){if(bi)return si;bi=1;(function(t){const i=kt();const e=Vt();const n=St();const r=wi();const s=fi();const a=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0;const o=i.getBCHDigit(a);function c(i,e,n){for(let r=1;r<=40;r++){if(e<=t.getCapacity(r,n,i)){return r}}return undefined}function f(t,i){return r.getCharCountIndicator(t,i)+4}function u(t,i){let e=0;t.forEach((function(t){const n=f(t.mode,i);e+=n+t.getBitsLength()}));return e}function l(i,e){for(let n=1;n<=40;n++){const s=u(i,n);if(s<=t.getCapacity(n,e,r.MIXED)){return n}}return undefined}t.from=function t(i,e){if(s.isValid(i)){return parseInt(i,10)}return e};t.getCapacity=function t(n,a,o){if(!s.isValid(n)){throw new Error("Invalid QR Code version")}if(typeof o==="undefined")o=r.BYTE;const c=i.getSymbolTotalCodewords(n);const u=e.getTotalCodewordsCount(n,a);const l=(c-u)*8;if(o===r.MIXED)return l;const h=l-f(o,n);switch(o){case r.NUMERIC:return Math.floor(h/10*3);case r.ALPHANUMERIC:return Math.floor(h/11*2);case r.KANJI:return Math.floor(h/13);case r.BYTE:default:return Math.floor(h/8)}};t.getBestVersionForData=function t(i,e){let r;const s=n.from(e,n.M);if(Array.isArray(i)){if(i.length>1){return l(i,s)}if(i.length===0){return 1}r=i[0]}else{r=i}return c(r.mode,r.getLength(),s)};t.getEncodedBits=function t(e){if(!s.isValid(e)||e<7){throw new Error("Invalid QR Code version")}let n=e<<12;while(i.getBCHDigit(n)-o>=0){n^=a<<i.getBCHDigit(n)-o}return e<<12|n}})(si);return si}var Mi={};var mi;function yi(){if(mi)return Mi;mi=1;const t=kt();const i=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0;const e=1<<14|1<<12|1<<10|1<<4|1<<1;const n=t.getBCHDigit(i);Mi.getEncodedBits=function r(s,a){const o=s.bit<<3|a;let c=o<<10;while(t.getBCHDigit(c)-n>=0){c^=i<<t.getBCHDigit(c)-n}return(o<<10|c)^e};return Mi}var vi={};var Ii;var pi;function Li(){if(pi)return Ii;pi=1;const t=wi();function i(i){this.mode=t.NUMERIC;this.data=i.toString()}i.getBitsLength=function t(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)};i.prototype.getLength=function t(){return this.data.length};i.prototype.getBitsLength=function t(){return i.getBitsLength(this.data.length)};i.prototype.write=function t(i){let e,n,r;for(e=0;e+3<=this.data.length;e+=3){n=this.data.substr(e,3);r=parseInt(n,10);i.put(r,10)}const s=this.data.length-e;if(s>0){n=this.data.substr(e);r=parseInt(n,10);i.put(r,s*3+1)}};Ii=i;return Ii}var Di;var Ni;function xi(){if(Ni)return Di;Ni=1;const t=wi();const i=["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 e(i){this.mode=t.ALPHANUMERIC;this.data=i}e.getBitsLength=function t(i){return 11*Math.floor(i/2)+6*(i%2)};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;for(n=0;n+2<=this.data.length;n+=2){let t=i.indexOf(this.data[n])*45;t+=i.indexOf(this.data[n+1]);e.put(t,11)}if(this.data.length%2){e.put(i.indexOf(this.data[n]),6)}};Di=e;return Di}var Ci;var ki;function ji(){if(ki)return Ci;ki=1;const t=wi();function i(i){this.mode=t.BYTE;if(typeof i==="string"){this.data=(new TextEncoder).encode(i)}else{this.data=new Uint8Array(i)}}i.getBitsLength=function t(i){return i*8};i.prototype.getLength=function t(){return this.data.length};i.prototype.getBitsLength=function t(){return i.getBitsLength(this.data.length)};i.prototype.write=function(t){for(let i=0,e=this.data.length;i<e;i++){t.put(this.data[i],8)}};Ci=i;return Ci}var zi;var Si;function Ti(){if(Si)return zi;Si=1;const t=wi();const i=kt();function e(i){this.mode=t.KANJI;this.data=i}e.getBitsLength=function t(i){return i*13};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){let e;for(e=0;e<this.data.length;e++){let n=i.toSJIS(this.data[e]);if(n>=33088&&n<=40956){n-=33088}else if(n>=57408&&n<=60351){n-=49472}else{throw new Error("Invalid SJIS character: "+this.data[e]+"\n"+"Make sure your charset is UTF-8")}n=(n>>>8&255)*192+(n&255);t.put(n,13)}};zi=e;return zi}var Ai={exports:{}};var Ei;function Yi(){if(Ei)return Ai.exports;Ei=1;(function(t){var i={single_source_shortest_paths:function(t,e,n){var r={};var s={};s[e]=0;var a=i.PriorityQueue.make();a.push(e,0);var o,c,f,u,l,h,d,w,b;while(!a.empty()){o=a.pop();c=o.value;u=o.cost;l=t[c]||{};for(f in l){if(l.hasOwnProperty(f)){h=l[f];d=u+h;w=s[f];b=typeof s[f]==="undefined";if(b||w>d){s[f]=d;a.push(f,d);r[f]=c}}}}if(typeof n!=="undefined"&&typeof s[n]==="undefined"){var g=["Could not find a path from ",e," to ",n,"."].join("");throw new Error(g)}return r},extract_shortest_path_from_predecessor_list:function(t,i){var e=[];var n=i;while(n){e.push(n);n=t[n]}e.reverse();return e},find_path:function(t,e,n){var r=i.single_source_shortest_paths(t,e,n);return i.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(t){var e=i.PriorityQueue,n={},r;t=t||{};for(r in e){if(e.hasOwnProperty(r)){n[r]=e[r]}}n.queue=[];n.sorter=t.sorter||e.default_sorter;return n},default_sorter:function(t,i){return t.cost-i.cost},push:function(t,i){var e={value:t,cost:i};this.queue.push(e);this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};{t.exports=i}})(Ai);return Ai.exports}var Oi;function Zi(){if(Oi)return vi;Oi=1;(function(t){const i=wi();const e=Li();const n=xi();const r=ji();const s=Ti();const a=hi();const o=kt();const c=Yi();function f(t){return unescape(encodeURIComponent(t)).length}function u(t,i,e){const n=[];let r;while((r=t.exec(e))!==null){n.push({data:r[0],index:r.index,mode:i,length:r[0].length})}return n}function l(t){const e=u(a.NUMERIC,i.NUMERIC,t);const n=u(a.ALPHANUMERIC,i.ALPHANUMERIC,t);let r;let s;if(o.isKanjiModeEnabled()){r=u(a.BYTE,i.BYTE,t);s=u(a.KANJI,i.KANJI,t)}else{r=u(a.BYTE_KANJI,i.BYTE,t);s=[]}const c=e.concat(n,r,s);return c.sort((function(t,i){return t.index-i.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function h(t,a){switch(a){case i.NUMERIC:return e.getBitsLength(t);case i.ALPHANUMERIC:return n.getBitsLength(t);case i.KANJI:return s.getBitsLength(t);case i.BYTE:return r.getBitsLength(t)}}function d(t){return t.reduce((function(t,i){const e=t.length-1>=0?t[t.length-1]:null;if(e&&e.mode===i.mode){t[t.length-1].data+=i.data;return t}t.push(i);return t}),[])}function w(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];switch(r.mode){case i.NUMERIC:e.push([r,{data:r.data,mode:i.ALPHANUMERIC,length:r.length},{data:r.data,mode:i.BYTE,length:r.length}]);break;case i.ALPHANUMERIC:e.push([r,{data:r.data,mode:i.BYTE,length:r.length}]);break;case i.KANJI:e.push([r,{data:r.data,mode:i.BYTE,length:f(r.data)}]);break;case i.BYTE:e.push([{data:r.data,mode:i.BYTE,length:f(r.data)}])}}return e}function b(t,e){const n={};const r={start:{}};let s=["start"];for(let a=0;a<t.length;a++){const o=t[a];const c=[];for(let t=0;t<o.length;t++){const f=o[t];const u=""+a+t;c.push(u);n[u]={node:f,lastCount:0};r[u]={};for(let t=0;t<s.length;t++){const a=s[t];if(n[a]&&n[a].node.mode===f.mode){r[a][u]=h(n[a].lastCount+f.length,f.mode)-h(n[a].lastCount,f.mode);n[a].lastCount+=f.length}else{if(n[a])n[a].lastCount=f.length;r[a][u]=h(f.length,f.mode)+4+i.getCharCountIndicator(f.mode,e)}}}s=c}for(let t=0;t<s.length;t++){r[s[t]].end=0}return{map:r,table:n}}function g(t,a){let c;const f=i.getBestModeForData(t);c=i.from(a,f);if(c!==i.BYTE&&c.bit<f.bit){throw new Error('"'+t+'"'+" cannot be encoded with mode "+i.toString(c)+".\n Suggested mode is: "+i.toString(f))}if(c===i.KANJI&&!o.isKanjiModeEnabled()){c=i.BYTE}switch(c){case i.NUMERIC:return new e(t);case i.ALPHANUMERIC:return new n(t);case i.KANJI:return new s(t);case i.BYTE:return new r(t)}}t.fromArray=function t(i){return i.reduce((function(t,i){if(typeof i==="string"){t.push(g(i,null))}else if(i.data){t.push(g(i.data,i.mode))}return t}),[])};t.fromString=function i(e,n){const r=l(e,o.isKanjiModeEnabled());const s=w(r);const a=b(s,n);const f=c.find_path(a.map,"start","end");const u=[];for(let t=1;t<f.length-1;t++){u.push(a.table[f[t]].node)}return t.fromArray(d(u))};t.rawSplit=function i(e){return t.fromArray(l(e,o.isKanjiModeEnabled()))}})(vi);return vi}var Ri;function Gi(){if(Ri)return Nt;Ri=1;const t=kt();const i=St();const e=Et();const n=Zt();const r=Qt();const s=Pt();const a=Jt();const o=Vt();const c=ri();const f=gi();const u=yi();const l=wi();const h=Zi();function d(t,i){const e=t.size;const n=s.getPositions(i);for(let i=0;i<n.length;i++){const r=n[i][0];const s=n[i][1];for(let i=-1;i<=7;i++){if(r+i<=-1||e<=r+i)continue;for(let n=-1;n<=7;n++){if(s+n<=-1||e<=s+n)continue;if(i>=0&&i<=6&&(n===0||n===6)||n>=0&&n<=6&&(i===0||i===6)||i>=2&&i<=4&&n>=2&&n<=4){t.set(r+i,s+n,true,true)}else{t.set(r+i,s+n,false,true)}}}}}function w(t){const i=t.size;for(let e=8;e<i-8;e++){const i=e%2===0;t.set(e,6,i,true);t.set(6,e,i,true)}}function b(t,i){const e=r.getPositions(i);for(let i=0;i<e.length;i++){const n=e[i][0];const r=e[i][1];for(let i=-2;i<=2;i++){for(let e=-2;e<=2;e++){if(i===-2||i===2||e===-2||e===2||i===0&&e===0){t.set(n+i,r+e,true,true)}else{t.set(n+i,r+e,false,true)}}}}}function g(t,i){const e=t.size;const n=f.getEncodedBits(i);let r,s,a;for(let i=0;i<18;i++){r=Math.floor(i/3);s=i%3+e-8-3;a=(n>>i&1)===1;t.set(r,s,a,true);t.set(s,r,a,true)}}function M(t,i,e){const n=t.size;const r=u.getEncodedBits(i,e);let s,a;for(s=0;s<15;s++){a=(r>>s&1)===1;if(s<6){t.set(s,8,a,true)}else if(s<8){t.set(s+1,8,a,true)}else{t.set(n-15+s,8,a,true)}if(s<8){t.set(8,n-s-1,a,true)}else if(s<9){t.set(8,15-s-1+1,a,true)}else{t.set(8,15-s-1,a,true)}}t.set(n-8,8,1,true)}function m(t,i){const e=t.size;let n=-1;let r=e-1;let s=7;let a=0;for(let o=e-1;o>0;o-=2){if(o===6)o--;while(true){for(let e=0;e<2;e++){if(!t.isReserved(r,o-e)){let n=false;if(a<i.length){n=(i[a]>>>s&1)===1}t.set(r,o-e,n);s--;if(s===-1){a++;s=7}}}r+=n;if(r<0||e<=r){r-=n;n=-n;break}}}}function y(i,n,r){const s=new e;r.forEach((function(t){s.put(t.mode.bit,4);s.put(t.getLength(),l.getCharCountIndicator(t.mode,i));t.write(s)}));const a=t.getSymbolTotalCodewords(i);const c=o.getTotalCodewordsCount(i,n);const f=(a-c)*8;if(s.getLengthInBits()+4<=f){s.put(0,4)}while(s.getLengthInBits()%8!==0){s.putBit(0)}const u=(f-s.getLengthInBits())/8;for(let t=0;t<u;t++){s.put(t%2?17:236,8)}return v(s,i,n)}function v(i,e,n){const r=t.getSymbolTotalCodewords(e);const s=o.getTotalCodewordsCount(e,n);const a=r-s;const f=o.getBlocksCount(e,n);const u=r%f;const l=f-u;const h=Math.floor(r/f);const d=Math.floor(a/f);const w=d+1;const b=h-d;const g=new c(b);let M=0;const m=new Array(f);const y=new Array(f);let v=0;const I=new Uint8Array(i.buffer);for(let t=0;t<f;t++){const i=t<l?d:w;m[t]=I.slice(M,M+i);y[t]=g.encode(m[t]);M+=i;v=Math.max(v,i)}const p=new Uint8Array(r);let L=0;let D,N;for(D=0;D<v;D++){for(N=0;N<f;N++){if(D<m[N].length){p[L++]=m[N][D]}}}for(D=0;D<b;D++){for(N=0;N<f;N++){p[L++]=y[N][D]}}return p}function I(i,e,r,s){let o;if(Array.isArray(i)){o=h.fromArray(i)}else if(typeof i==="string"){let t=e;if(!t){const e=h.rawSplit(i);t=f.getBestVersionForData(e,r)}o=h.fromString(i,t||40)}else{throw new Error("Invalid data")}const c=f.getBestVersionForData(o,r);if(!c){throw new Error("The amount of data is too big to be stored in a QR Code")}if(!e){e=c}else if(e<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 u=y(e,r,o);const l=t.getSymbolSize(e);const v=new n(l);d(v,e);w(v);b(v,e);M(v,r,0);if(e>=7){g(v,e)}m(v,u);if(isNaN(s)){s=a.getBestMask(v,M.bind(null,v,r))}a.applyMask(s,v);M(v,r,s);return{modules:v,version:e,errorCorrectionLevel:r,maskPattern:s,segments:o}}Nt.create=function e(n,r){if(typeof n==="undefined"||n===""){throw new Error("No input text")}let s=i.M;let o;let c;if(typeof r!=="undefined"){s=i.from(r.errorCorrectionLevel,i.M);o=f.from(r.version);c=a.from(r.maskPattern);if(r.toSJISFunc){t.setToSJISFunction(r.toSJISFunc)}}return I(n,o,s,c)};return Nt}var Qi={};var Wi={};var Ui=Object.freeze({__proto__:null,default:Wi});var Pi=l(Ui);var Fi={};var Bi;if(typeof Object.create==="function"){Bi=function t(i,e){i.super_=e;i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:false,writable:true,configurable:true}})}}else{Bi=function t(i,e){i.super_=e;var n=function(){};n.prototype=e.prototype;i.prototype=new n;i.prototype.constructor=i}}var Ji=/%[sdj%]/g;function Hi(t){if(!de(t)){var i=[];for(var e=0;e<arguments.length;e++){i.push(qi(arguments[e]))}return i.join(" ")}var e=1;var n=arguments;var r=n.length;var s=String(t).replace(Ji,(function(t){if(t==="%%")return"%";if(e>=r)return t;switch(t){case"%s":return String(n[e++]);case"%d":return Number(n[e++]);case"%j":try{return JSON.stringify(n[e++])}catch(t){return"[Circular]"}default:return t}}));for(var a=n[e];e<r;a=n[++e]){if(ue(a)||!Me(a)){s+=" "+a}else{s+=" "+qi(a)}}return s}function Xi(t,i){if(be(j.process)){return function(){return Xi(t,i).apply(this,arguments)}}if(C.noDeprecation===true){return t}var e=false;function n(){if(!e){if(C.throwDeprecation){throw new Error(i)}else if(C.traceDeprecation){console.trace(i)}else{console.error(i)}e=true}return t.apply(this,arguments)}return n}var Vi={};var _i;function Ki(t){if(be(_i))_i=C.env.NODE_DEBUG||"";t=t.toUpperCase();if(!Vi[t]){if(new RegExp("\\b"+t+"\\b","i").test(_i)){var i=0;Vi[t]=function(){var e=Hi.apply(null,arguments);console.error("%s %d: %s",t,i,e)}}else{Vi[t]=function(){}}}return Vi[t]}function qi(t,i){var e={seen:[],stylize:te};if(arguments.length>=3)e.depth=arguments[2];if(arguments.length>=4)e.colors=arguments[3];if(fe(i)){e.showHidden=i}else if(i){ke(e,i)}if(be(e.showHidden))e.showHidden=false;if(be(e.depth))e.depth=2;if(be(e.colors))e.colors=false;if(be(e.customInspect))e.customInspect=true;if(e.colors)e.stylize=$i;return ee(e,t,e.depth)}qi.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]};qi.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function $i(t,i){var e=qi.styles[i];if(e){return"["+qi.colors[e][0]+"m"+t+"["+qi.colors[e][1]+"m"}else{return t}}function te(t,i){return t}function ie(t){var i={};t.forEach((function(t,e){i[t]=true}));return i}function ee(t,i,e){if(t.customInspect&&i&&ve(i.inspect)&&i.inspect!==qi&&!(i.constructor&&i.constructor.prototype===i)){var n=i.inspect(e,t);if(!de(n)){n=ee(t,n,e)}return n}var r=ne(t,i);if(r){return r}var s=Object.keys(i);var a=ie(s);if(t.showHidden){s=Object.getOwnPropertyNames(i)}if(ye(i)&&(s.indexOf("message")>=0||s.indexOf("description")>=0)){return re(i)}if(s.length===0){if(ve(i)){var o=i.name?": "+i.name:"";return t.stylize("[Function"+o+"]","special")}if(ge(i)){return t.stylize(RegExp.prototype.toString.call(i),"regexp")}if(me(i)){return t.stylize(Date.prototype.toString.call(i),"date")}if(ye(i)){return re(i)}}var c="",f=false,u=["{","}"];if(ce(i)){f=true;u=["[","]"]}if(ve(i)){var l=i.name?": "+i.name:"";c=" [Function"+l+"]"}if(ge(i)){c=" "+RegExp.prototype.toString.call(i)}if(me(i)){c=" "+Date.prototype.toUTCString.call(i)}if(ye(i)){c=" "+re(i)}if(s.length===0&&(!f||i.length==0)){return u[0]+c+u[1]}if(e<0){if(ge(i)){return t.stylize(RegExp.prototype.toString.call(i),"regexp")}else{return t.stylize("[Object]","special")}}t.seen.push(i);var h;if(f){h=se(t,i,e,a,s)}else{h=s.map((function(n){return ae(t,i,e,a,n,f)}))}t.seen.pop();return oe(h,c,u)}function ne(t,i){if(be(i))return t.stylize("undefined","undefined");if(de(i)){var e="'"+JSON.stringify(i).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(e,"string")}if(he(i))return t.stylize(""+i,"number");if(fe(i))return t.stylize(""+i,"boolean");if(ue(i))return t.stylize("null","null")}function re(t){return"["+Error.prototype.toString.call(t)+"]"}function se(t,i,e,n,r){var s=[];for(var a=0,o=i.length;a<o;++a){if(je(i,String(a))){s.push(ae(t,i,e,n,String(a),true))}else{s.push("")}}r.forEach((function(r){if(!r.match(/^\d+$/)){s.push(ae(t,i,e,n,r,true))}}));return s}function ae(t,i,e,n,r,s){var a,o,c;c=Object.getOwnPropertyDescriptor(i,r)||{value:i[r]};if(c.get){if(c.set){o=t.stylize("[Getter/Setter]","special")}else{o=t.stylize("[Getter]","special")}}else{if(c.set){o=t.stylize("[Setter]","special")}}if(!je(n,r)){a="["+r+"]"}if(!o){if(t.seen.indexOf(c.value)<0){if(ue(e)){o=ee(t,c.value,null)}else{o=ee(t,c.value,e-1)}if(o.indexOf("\n")>-1){if(s){o=o.split("\n").map((function(t){return" "+t})).join("\n").substr(2)}else{o="\n"+o.split("\n").map((function(t){return" "+t})).join("\n")}}}else{o=t.stylize("[Circular]","special")}}if(be(a)){if(s&&r.match(/^\d+$/)){return o}a=JSON.stringify(""+r);if(a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){a=a.substr(1,a.length-2);a=t.stylize(a,"name")}else{a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");a=t.stylize(a,"string")}}return a+": "+o}function oe(t,i,e){var n=t.reduce((function(t,i){if(i.indexOf("\n")>=0);return t+i.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60){return e[0]+(i===""?"":i+"\n ")+" "+t.join(",\n ")+" "+e[1]}return e[0]+i+" "+t.join(", ")+" "+e[1]}function ce(t){return Array.isArray(t)}function fe(t){return typeof t==="boolean"}function ue(t){return t===null}function le(t){return t==null}function he(t){return typeof t==="number"}function de(t){return typeof t==="string"}function we(t){return typeof t==="symbol"}function be(t){return t===void 0}function ge(t){return Me(t)&&Le(t)==="[object RegExp]"}function Me(t){return typeof t==="object"&&t!==null}function me(t){return Me(t)&&Le(t)==="[object Date]"}function ye(t){return Me(t)&&(Le(t)==="[object Error]"||t instanceof Error)}function ve(t){return typeof t==="function"}function Ie(t){return t===null||typeof t==="boolean"||typeof t==="number"||typeof t==="string"||typeof t==="symbol"||typeof t==="undefined"}function pe(t){return k.isBuffer(t)}function Le(t){return Object.prototype.toString.call(t)}function De(t){return t<10?"0"+t.toString(10):t.toString(10)}var Ne=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(){var t=new Date;var i=[De(t.getHours()),De(t.getMinutes()),De(t.getSeconds())].join(":");return[t.getDate(),Ne[t.getMonth()],i].join(" ")}function Ce(){console.log("%s - %s",xe(),Hi.apply(null,arguments))}function ke(t,i){if(!i||!Me(i))return t;var e=Object.keys(i);var n=e.length;while(n--){t[e[n]]=i[e[n]]}return t}function je(t,i){return Object.prototype.hasOwnProperty.call(t,i)}var ze={inherits:Bi,_extend:ke,log:Ce,isBuffer:pe,isPrimitive:Ie,isFunction:ve,isError:ye,isDate:me,isObject:Me,isRegExp:ge,isUndefined:be,isSymbol:we,isString:de,isNumber:he,isNullOrUndefined:le,isNull:ue,isBoolean:fe,isArray:ce,inspect:qi,deprecate:Xi,format:Hi,debuglog:Ki};var Se=Object.freeze({__proto__:null,_extend:ke,debuglog:Ki,default:ze,deprecate:Xi,format:Hi,inherits:Bi,inspect:qi,isArray:ce,isBoolean:fe,isBuffer:pe,isDate:me,isError:ye,isFunction:ve,isNull:ue,isNullOrUndefined:le,isNumber:he,isObject:Me,isPrimitive:Ie,isRegExp:ge,isString:de,isSymbol:we,isUndefined:be,log:Ce});var Te=l(Se);var Ae;function Ee(){}Ee.prototype=Object.create(null);function Ye(){Ye.init.call(this)}Ye.EventEmitter=Ye;Ye.usingDomains=false;Ye.prototype.domain=undefined;Ye.prototype._events=undefined;Ye.prototype._maxListeners=undefined;Ye.defaultMaxListeners=10;Ye.init=function(){this.domain=null;if(Ye.usingDomains){if(Ae.active&&!(this instanceof Ae.Domain)){this.domain=Ae.active}}if(!this._events||this._events===Object.getPrototypeOf(this)._events){this._events=new Ee;this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};Ye.prototype.setMaxListeners=function t(i){if(typeof i!=="number"||i<0||isNaN(i))throw new TypeError('"n" argument must be a positive number');this._maxListeners=i;return this};function Oe(t){if(t._maxListeners===undefined)return Ye.defaultMaxListeners;return t._maxListeners}Ye.prototype.getMaxListeners=function t(){return Oe(this)};function Ze(t,i,e){if(i)t.call(e);else{var n=t.length;var r=He(t,n);for(var s=0;s<n;++s)r[s].call(e)}}function Re(t,i,e,n){if(i)t.call(e,n);else{var r=t.length;var s=He(t,r);for(var a=0;a<r;++a)s[a].call(e,n)}}function Ge(t,i,e,n,r){if(i)t.call(e,n,r);else{var s=t.length;var a=He(t,s);for(var o=0;o<s;++o)a[o].call(e,n,r)}}function Qe(t,i,e,n,r,s){if(i)t.call(e,n,r,s);else{var a=t.length;var o=He(t,a);for(var c=0;c<a;++c)o[c].call(e,n,r,s)}}function We(t,i,e,n){if(i)t.apply(e,n);else{var r=t.length;var s=He(t,r);for(var a=0;a<r;++a)s[a].apply(e,n)}}Ye.prototype.emit=function t(i){var e,n,r,s,a,o,c;var f=i==="error";o=this._events;if(o)f=f&&o.error==null;else if(!f)return false;c=this.domain;if(f){e=arguments[1];if(c){if(!e)e=new Error('Uncaught, unspecified "error" event');e.domainEmitter=this;e.domain=c;e.domainThrown=false;c.emit("error",e)}else if(e instanceof Error){throw e}else{var u=new Error('Uncaught, unspecified "error" event. ('+e+")");u.context=e;throw u}return false}n=o[i];if(!n)return false;var l=typeof n==="function";r=arguments.length;switch(r){case 1:Ze(n,l,this);break;case 2:Re(n,l,this,arguments[1]);break;case 3:Ge(n,l,this,arguments[1],arguments[2]);break;case 4:Qe(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:s=new Array(r-1);for(a=1;a<r;a++)s[a-1]=arguments[a];We(n,l,this,s)}return true};function Ue(t,i,e,n){var r;var s;var a;if(typeof e!=="function")throw new TypeError('"listener" argument must be a function');s=t._events;if(!s){s=t._events=new Ee;t._eventsCount=0}else{if(s.newListener){t.emit("newListener",i,e.listener?e.listener:e);s=t._events}a=s[i]}if(!a){a=s[i]=e;++t._eventsCount}else{if(typeof a==="function"){a=s[i]=n?[e,a]:[a,e]}else{if(n){a.unshift(e)}else{a.push(e)}}if(!a.warned){r=Oe(t);if(r&&r>0&&a.length>r){a.warned=true;var o=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+i+" listeners added. "+"Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning";o.emitter=t;o.type=i;o.count=a.length;Pe(o)}}}return t}function Pe(t){typeof console.warn==="function"?console.warn(t):console.log(t)}Ye.prototype.addListener=function t(i,e){return Ue(this,i,e,false)};Ye.prototype.on=Ye.prototype.addListener;Ye.prototype.prependListener=function t(i,e){return Ue(this,i,e,true)};function Fe(t,i,e){var n=false;function r(){t.removeListener(i,r);if(!n){n=true;e.apply(t,arguments)}}r.listener=e;return r}Ye.prototype.once=function t(i,e){if(typeof e!=="function")throw new TypeError('"listener" argument must be a function');this.on(i,Fe(this,i,e));return this};Ye.prototype.prependOnceListener=function t(i,e){if(typeof e!=="function")throw new TypeError('"listener" argument must be a function');this.prependListener(i,Fe(this,i,e));return this};Ye.prototype.removeListener=function t(i,e){var n,r,s,a,o;if(typeof e!=="function")throw new TypeError('"listener" argument must be a function');r=this._events;if(!r)return this;n=r[i];if(!n)return this;if(n===e||n.listener&&n.listener===e){if(--this._eventsCount===0)this._events=new Ee;else{delete r[i];if(r.removeListener)this.emit("removeListener",i,n.listener||e)}}else if(typeof n!=="function"){s=-1;for(a=n.length;a-- >0;){if(n[a]===e||n[a].listener&&n[a].listener===e){o=n[a].listener;s=a;break}}if(s<0)return this;if(n.length===1){n[0]=undefined;if(--this._eventsCount===0){this._events=new Ee;return this}else{delete r[i]}}else{Je(n,s)}if(r.removeListener)this.emit("removeListener",i,o||e)}return this};Ye.prototype.removeAllListeners=function t(i){var e,n;n=this._events;if(!n)return this;if(!n.removeListener){if(arguments.length===0){this._events=new Ee;this._eventsCount=0}else if(n[i]){if(--this._eventsCount===0)this._events=new Ee;else delete n[i]}return this}if(arguments.length===0){var r=Object.keys(n);for(var s=0,a;s<r.length;++s){a=r[s];if(a==="removeListener")continue;this.removeAllListeners(a)}this.removeAllListeners("removeListener");this._events=new Ee;this._eventsCount=0;return this}e=n[i];if(typeof e==="function"){this.removeListener(i,e)}else if(e){do{this.removeListener(i,e[e.length-1])}while(e[0])}return this};Ye.prototype.listeners=function t(i){var e;var n;var r=this._events;if(!r)n=[];else{e=r[i];if(!e)n=[];else if(typeof e==="function")n=[e.listener||e];else n=Xe(e)}return n};Ye.listenerCount=function(t,i){if(typeof t.listenerCount==="function"){return t.listenerCount(i)}else{return Be.call(t,i)}};Ye.prototype.listenerCount=Be;function Be(t){var i=this._events;if(i){var e=i[t];if(typeof e==="function"){return 1}else if(e){return e.length}}return 0}Ye.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Je(t,i){for(var e=i,n=e+1,r=t.length;n<r;e+=1,n+=1)t[e]=t[n];t.pop()}function He(t,i){var e=new Array(i);while(i--)e[i]=t[i];return e}function Xe(t){var i=new Array(t.length);for(var e=0;e<i.length;++e){i[e]=t[e].listener||t[e]}return i}function Ve(){this.head=null;this.tail=null;this.length=0}Ve.prototype.push=function(t){var i={data:t,next:null};if(this.length>0)this.tail.next=i;else this.head=i;this.tail=i;++this.length};Ve.prototype.unshift=function(t){var i={data:t,next:this.head};if(this.length===0)this.tail=i;this.head=i;++this.length};Ve.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};Ve.prototype.clear=function(){this.head=this.tail=null;this.length=0};Ve.prototype.join=function(t){if(this.length===0)return"";var i=this.head;var e=""+i.data;while(i=i.next){e+=t+i.data}return e};Ve.prototype.concat=function(t){if(this.length===0)return k.alloc(0);if(this.length===1)return this.head.data;var i=k.allocUnsafe(t>>>0);var e=this.head;var n=0;while(e){e.data.copy(i,n);n+=e.data.length;e=e.next}return i};var _e={};var Ke={exports:{}};var qe=l(z);
2
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var $e;function tn(){if($e)return Ke.exports;$e=1;(function(t,i){var e=qe;var n=e.Buffer;function r(t,i){for(var e in t){i[e]=t[e]}}if(n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow){t.exports=e}else{r(e,i);i.Buffer=s}function s(t,i,e){return n(t,i,e)}s.prototype=Object.create(n.prototype);r(n,s);s.from=function(t,i,e){if(typeof t==="number"){throw new TypeError("Argument must not be a number")}return n(t,i,e)};s.alloc=function(t,i,e){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}var r=n(t);if(i!==undefined){if(typeof e==="string"){r.fill(i,e)}else{r.fill(i)}}else{r.fill(0)}return r};s.allocUnsafe=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return n(t)};s.allocUnsafeSlow=function(t){if(typeof t!=="number"){throw new TypeError("Argument must be a number")}return e.SlowBuffer(t)}})(Ke,Ke.exports);return Ke.exports}var en;function nn(){if(en)return _e;en=1;var t=tn().Buffer;var i=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 e(t){if(!t)return"utf8";var i;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(i)return;t=(""+t).toLowerCase();i=true}}}function n(n){var r=e(n);if(typeof r!=="string"&&(t.isEncoding===i||!i(n)))throw new Error("Unknown encoding: "+n);return r||n}_e.StringDecoder=r;function r(i){this.encoding=n(i);var e;switch(this.encoding){case"utf16le":this.text=l;this.end=h;e=4;break;case"utf8":this.fillLast=c;e=4;break;case"base64":this.text=d;this.end=w;e=3;break;default:this.write=b;this.end=g;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=t.allocUnsafe(e)}r.prototype.write=function(t){if(t.length===0)return"";var i;var e;if(this.lastNeed){i=this.fillLast(t);if(i===undefined)return"";e=this.lastNeed;this.lastNeed=0}else{e=0}if(e<t.length)return i?i+this.text(t,e):this.text(t,e);return i||""};r.prototype.end=u;r.prototype.text=f;r.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 s(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 a(t,i,e){var n=i.length-1;if(n<e)return 0;var r=s(i[n]);if(r>=0){if(r>0)t.lastNeed=r-1;return r}if(--n<e||r===-2)return 0;r=s(i[n]);if(r>=0){if(r>0)t.lastNeed=r-2;return r}if(--n<e||r===-2)return 0;r=s(i[n]);if(r>=0){if(r>0){if(r===2)r=0;else t.lastNeed=r-3}return r}return 0}function o(t,i,e){if((i[0]&192)!==128){t.lastNeed=0;return"�"}if(t.lastNeed>1&&i.length>1){if((i[1]&192)!==128){t.lastNeed=1;return"�"}if(t.lastNeed>2&&i.length>2){if((i[2]&192)!==128){t.lastNeed=2;return"�"}}}}function c(t){var i=this.lastTotal-this.lastNeed;var e=o(this,t);if(e!==undefined)return e;if(this.lastNeed<=t.length){t.copy(this.lastChar,i,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}t.copy(this.lastChar,i,0,t.length);this.lastNeed-=t.length}function f(t,i){var e=a(this,t,i);if(!this.lastNeed)return t.toString("utf8",i);this.lastTotal=e;var n=t.length-(e-this.lastNeed);t.copy(this.lastChar,0,n);return t.toString("utf8",i,n)}function u(t){var i=t&&t.length?this.write(t):"";if(this.lastNeed)return i+"�";return i}function l(t,i){if((t.length-i)%2===0){var e=t.toString("utf16le",i);if(e){var n=e.charCodeAt(e.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=t[t.length-2];this.lastChar[1]=t[t.length-1];return e.slice(0,-1)}}return e}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=t[t.length-1];return t.toString("utf16le",i,t.length-1)}function h(t){var i=t&&t.length?this.write(t):"";if(this.lastNeed){var e=this.lastTotal-this.lastNeed;return i+this.lastChar.toString("utf16le",0,e)}return i}function d(t,i){var e=(t.length-i)%3;if(e===0)return t.toString("base64",i);this.lastNeed=3-e;this.lastTotal=3;if(e===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",i,t.length-e)}function w(t){var i=t&&t.length?this.write(t):"";if(this.lastNeed)return i+this.lastChar.toString("base64",0,3-this.lastNeed);return i}function b(t){return t.toString(this.encoding)}function g(t){return t&&t.length?this.write(t):""}return _e}var rn=nn();fn.ReadableState=cn;var sn=Ki("stream");Bi(fn,Ye);function an(t,i,e){if(typeof t.prependListener==="function"){return t.prependListener(i,e)}else{if(!t._events||!t._events[i])t.on(i,e);else if(Array.isArray(t._events[i]))t._events[i].unshift(e);else t._events[i]=[e,t._events[i]]}}function on(t,i){return t.listeners(i).length}function cn(t,i){t=t||{};this.objectMode=!!t.objectMode;if(i instanceof nr)this.objectMode=this.objectMode||!!t.readableObjectMode;var e=t.highWaterMark;var n=this.objectMode?16:16*1024;this.highWaterMark=e||e===0?e:n;this.highWaterMark=~~this.highWaterMark;this.buffer=new Ve;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 rn.StringDecoder(t.encoding);this.encoding=t.encoding}}function fn(t){if(!(this instanceof fn))return new fn(t);this._readableState=new cn(t,this);this.readable=true;if(t&&typeof t.read==="function")this._read=t.read;Ye.call(this)}fn.prototype.push=function(t,i){var e=this._readableState;if(!e.objectMode&&typeof t==="string"){i=i||e.defaultEncoding;if(i!==e.encoding){t=k.from(t,i);i=""}}return un(this,e,t,i,false)};fn.prototype.unshift=function(t){var i=this._readableState;return un(this,i,t,"",true)};fn.prototype.isPaused=function(){return this._readableState.flowing===false};function un(t,i,e,n,r){var s=bn(i,e);if(s){t.emit("error",s)}else if(e===null){i.reading=false;gn(t,i)}else if(i.objectMode||e&&e.length>0){if(i.ended&&!r){var a=new Error("stream.push() after EOF");t.emit("error",a)}else if(i.endEmitted&&r){var o=new Error("stream.unshift() after end event");t.emit("error",o)}else{var c;if(i.decoder&&!r&&!n){e=i.decoder.write(e);c=!i.objectMode&&e.length===0}if(!r)i.reading=false;if(!c){if(i.flowing&&i.length===0&&!i.sync){t.emit("data",e);t.read(0)}else{i.length+=i.objectMode?1:e.length;if(r)i.buffer.unshift(e);else i.buffer.push(e);if(i.needReadable)Mn(t)}}yn(t,i)}}else if(!r){i.reading=false}return ln(i)}function ln(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||t.length===0)}fn.prototype.setEncoding=function(t){this._readableState.decoder=new rn.StringDecoder(t);this._readableState.encoding=t;return this};var hn=8388608;function dn(t){if(t>=hn){t=hn}else{t--;t|=t>>>1;t|=t>>>2;t|=t>>>4;t|=t>>>8;t|=t>>>16;t++}return t}function wn(t,i){if(t<=0||i.length===0&&i.ended)return 0;if(i.objectMode)return 1;if(t!==t){if(i.flowing&&i.length)return i.buffer.head.data.length;else return i.length}if(t>i.highWaterMark)i.highWaterMark=dn(t);if(t<=i.length)return t;if(!i.ended){i.needReadable=true;return 0}return i.length}fn.prototype.read=function(t){sn("read",t);t=parseInt(t,10);var i=this._readableState;var e=t;if(t!==0)i.emittedReadable=false;if(t===0&&i.needReadable&&(i.length>=i.highWaterMark||i.ended)){sn("read: emitReadable",i.length,i.ended);if(i.length===0&&i.ended)zn(this);else Mn(this);return null}t=wn(t,i);if(t===0&&i.ended){if(i.length===0)zn(this);return null}var n=i.needReadable;sn("need readable",n);if(i.length===0||i.length-t<i.highWaterMark){n=true;sn("length less than watermark",n)}if(i.ended||i.reading){n=false;sn("reading or ended",n)}else if(n){sn("do read");i.reading=true;i.sync=true;if(i.length===0)i.needReadable=true;this._read(i.highWaterMark);i.sync=false;if(!i.reading)t=wn(e,i)}var r;if(t>0)r=xn(t,i);else r=null;if(r===null){i.needReadable=true;t=0}else{i.length-=t}if(i.length===0){if(!i.ended)i.needReadable=true;if(e!==t&&i.ended)zn(this)}if(r!==null)this.emit("data",r);return r};function bn(t,i){var e=null;if(!k.isBuffer(i)&&typeof i!=="string"&&i!==null&&i!==undefined&&!t.objectMode){e=new TypeError("Invalid non-string/buffer chunk")}return e}function gn(t,i){if(i.ended)return;if(i.decoder){var e=i.decoder.end();if(e&&e.length){i.buffer.push(e);i.length+=i.objectMode?1:e.length}}i.ended=true;Mn(t)}function Mn(t){var i=t._readableState;i.needReadable=false;if(!i.emittedReadable){sn("emitReadable",i.flowing);i.emittedReadable=true;if(i.sync)S(mn,t);else mn(t)}}function mn(t){sn("emit readable");t.emit("readable");Nn(t)}function yn(t,i){if(!i.readingMore){i.readingMore=true;S(vn,t,i)}}function vn(t,i){var e=i.length;while(!i.reading&&!i.flowing&&!i.ended&&i.length<i.highWaterMark){sn("maybeReadMore read 0");t.read(0);if(e===i.length)break;else e=i.length}i.readingMore=false}fn.prototype._read=function(t){this.emit("error",new Error("not implemented"))};fn.prototype.pipe=function(t,i){var e=this;var n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1;sn("pipe count=%d opts=%j",n.pipesCount,i);var r=!i||i.end!==false;var s=r?o:u;if(n.endEmitted)S(s);else e.once("end",s);t.on("unpipe",a);function a(t){sn("onunpipe");if(t===e){u()}}function o(){sn("onend");t.end()}var c=In(e);t.on("drain",c);var f=false;function u(){sn("cleanup");t.removeListener("close",w);t.removeListener("finish",b);t.removeListener("drain",c);t.removeListener("error",d);t.removeListener("unpipe",a);e.removeListener("end",o);e.removeListener("end",u);e.removeListener("data",h);f=true;if(n.awaitDrain&&(!t._writableState||t._writableState.needDrain))c()}var l=false;e.on("data",h);function h(i){sn("ondata");l=false;var r=t.write(i);if(false===r&&!l){if((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&An(n.pipes,t)!==-1)&&!f){sn("false write response, pause",e._readableState.awaitDrain);e._readableState.awaitDrain++;l=true}e.pause()}}function d(i){sn("onerror",i);g();t.removeListener("error",d);if(on(t,"error")===0)t.emit("error",i)}an(t,"error",d);function w(){t.removeListener("finish",b);g()}t.once("close",w);function b(){sn("onfinish");t.removeListener("close",w);g()}t.once("finish",b);function g(){sn("unpipe");e.unpipe(t)}t.emit("pipe",e);if(!n.flowing){sn("pipe resume");e.resume()}return t};function In(t){return function(){var i=t._readableState;sn("pipeOnDrain",i.awaitDrain);if(i.awaitDrain)i.awaitDrain--;if(i.awaitDrain===0&&t.listeners("data").length){i.flowing=true;Nn(t)}}}fn.prototype.unpipe=function(t){var i=this._readableState;if(i.pipesCount===0)return this;if(i.pipesCount===1){if(t&&t!==i.pipes)return this;if(!t)t=i.pipes;i.pipes=null;i.pipesCount=0;i.flowing=false;if(t)t.emit("unpipe",this);return this}if(!t){var e=i.pipes;var n=i.pipesCount;i.pipes=null;i.pipesCount=0;i.flowing=false;for(var r=0;r<n;r++){e[r].emit("unpipe",this)}return this}var s=An(i.pipes,t);if(s===-1)return this;i.pipes.splice(s,1);i.pipesCount-=1;if(i.pipesCount===1)i.pipes=i.pipes[0];t.emit("unpipe",this);return this};fn.prototype.on=function(t,i){var e=Ye.prototype.on.call(this,t,i);if(t==="data"){if(this._readableState.flowing!==false)this.resume()}else if(t==="readable"){var n=this._readableState;if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.emittedReadable=false;if(!n.reading){S(pn,this)}else if(n.length){Mn(this)}}}return e};fn.prototype.addListener=fn.prototype.on;function pn(t){sn("readable nexttick read 0");t.read(0)}fn.prototype.resume=function(){var t=this._readableState;if(!t.flowing){sn("resume");t.flowing=true;Ln(this,t)}return this};function Ln(t,i){if(!i.resumeScheduled){i.resumeScheduled=true;S(Dn,t,i)}}function Dn(t,i){if(!i.reading){sn("resume read 0");t.read(0)}i.resumeScheduled=false;i.awaitDrain=0;t.emit("resume");Nn(t);if(i.flowing&&!i.reading)t.read(0)}fn.prototype.pause=function(){sn("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){sn("pause");this._readableState.flowing=false;this.emit("pause")}return this};function Nn(t){var i=t._readableState;sn("flow",i.flowing);while(i.flowing&&t.read()!==null){}}fn.prototype.wrap=function(t){var i=this._readableState;var e=false;var n=this;t.on("end",(function(){sn("wrapped end");if(i.decoder&&!i.ended){var t=i.decoder.end();if(t&&t.length)n.push(t)}n.push(null)}));t.on("data",(function(r){sn("wrapped data");if(i.decoder)r=i.decoder.write(r);if(i.objectMode&&(r===null||r===undefined))return;else if(!i.objectMode&&(!r||!r.length))return;var s=n.push(r);if(!s){e=true;t.pause()}}));for(var r in t){if(this[r]===undefined&&typeof t[r]==="function"){this[r]=function(i){return function(){return t[i].apply(t,arguments)}}(r)}}var s=["error","close","destroy","pause","resume"];Tn(s,(function(i){t.on(i,n.emit.bind(n,i))}));n._read=function(i){sn("wrapped _read",i);if(e){e=false;t.resume()}};return n};fn._fromList=xn;function xn(t,i){if(i.length===0)return null;var e;if(i.objectMode)e=i.buffer.shift();else if(!t||t>=i.length){if(i.decoder)e=i.buffer.join("");else if(i.buffer.length===1)e=i.buffer.head.data;else e=i.buffer.concat(i.length);i.buffer.clear()}else{e=Cn(t,i.buffer,i.decoder)}return e}function Cn(t,i,e){var n;if(t<i.head.data.length){n=i.head.data.slice(0,t);i.head.data=i.head.data.slice(t)}else if(t===i.head.data.length){n=i.shift()}else{n=e?kn(t,i):jn(t,i)}return n}function kn(t,i){var e=i.head;var n=1;var r=e.data;t-=r.length;while(e=e.next){var s=e.data;var a=t>s.length?s.length:t;if(a===s.length)r+=s;else r+=s.slice(0,t);t-=a;if(t===0){if(a===s.length){++n;if(e.next)i.head=e.next;else i.head=i.tail=null}else{i.head=e;e.data=s.slice(a)}break}++n}i.length-=n;return r}function jn(t,i){var e=k.allocUnsafe(t);var n=i.head;var r=1;n.data.copy(e);t-=n.data.length;while(n=n.next){var s=n.data;var a=t>s.length?s.length:t;s.copy(e,e.length-t,0,a);t-=a;if(t===0){if(a===s.length){++r;if(n.next)i.head=n.next;else i.head=i.tail=null}else{i.head=n;n.data=s.slice(a)}break}++r}i.length-=r;return e}function zn(t){var i=t._readableState;if(i.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!i.endEmitted){i.ended=true;S(Sn,i,t)}}function Sn(t,i){if(!t.endEmitted&&t.length===0){t.endEmitted=true;i.readable=false;i.emit("end")}}function Tn(t,i){for(var e=0,n=t.length;e<n;e++){i(t[e],e)}}function An(t,i){for(var e=0,n=t.length;e<n;e++){if(t[e]===i)return e}return-1}Zn.WritableState=On;Bi(Zn,Ye);function En(){}function Yn(t,i,e){this.chunk=t;this.encoding=i;this.callback=e;this.next=null}function On(t,i){Object.defineProperty(this,"buffer",{get:Xi((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")});t=t||{};this.objectMode=!!t.objectMode;if(i instanceof nr)this.objectMode=this.objectMode||!!t.writableObjectMode;var e=t.highWaterMark;var n=this.objectMode?16:16*1024;this.highWaterMark=e||e===0?e:n;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var r=t.decodeStrings===false;this.decodeStrings=!r;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(t){Bn(i,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 $n(this)}On.prototype.getBuffer=function t(){var i=this.bufferedRequest;var e=[];while(i){e.push(i);i=i.next}return e};function Zn(t){if(!(this instanceof Zn)&&!(this instanceof nr))return new Zn(t);this._writableState=new On(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}Ye.call(this)}Zn.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function Rn(t,i){var e=new Error("write after end");t.emit("error",e);S(i,e)}function Gn(t,i,e,n){var r=true;var s=false;if(e===null){s=new TypeError("May not write null values to stream")}else if(!k.isBuffer(e)&&typeof e!=="string"&&e!==undefined&&!i.objectMode){s=new TypeError("Invalid non-string/buffer chunk")}if(s){t.emit("error",s);S(n,s);r=false}return r}Zn.prototype.write=function(t,i,e){var n=this._writableState;var r=false;if(typeof i==="function"){e=i;i=null}if(k.isBuffer(t))i="buffer";else if(!i)i=n.defaultEncoding;if(typeof e!=="function")e=En;if(n.ended)Rn(this,e);else if(Gn(this,n,t,e)){n.pendingcb++;r=Wn(this,n,t,i,e)}return r};Zn.prototype.cork=function(){var t=this._writableState;t.corked++};Zn.prototype.uncork=function(){var t=this._writableState;if(t.corked){t.corked--;if(!t.writing&&!t.corked&&!t.finished&&!t.bufferProcessing&&t.bufferedRequest)Xn(this,t)}};Zn.prototype.setDefaultEncoding=function t(i){if(typeof i==="string")i=i.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((i+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+i);this._writableState.defaultEncoding=i;return this};function Qn(t,i,e){if(!t.objectMode&&t.decodeStrings!==false&&typeof i==="string"){i=k.from(i,e)}return i}function Wn(t,i,e,n,r){e=Qn(i,e,n);if(k.isBuffer(e))n="buffer";var s=i.objectMode?1:e.length;i.length+=s;var a=i.length<i.highWaterMark;if(!a)i.needDrain=true;if(i.writing||i.corked){var o=i.lastBufferedRequest;i.lastBufferedRequest=new Yn(e,n,r);if(o){o.next=i.lastBufferedRequest}else{i.bufferedRequest=i.lastBufferedRequest}i.bufferedRequestCount+=1}else{Un(t,i,false,s,e,n,r)}return a}function Un(t,i,e,n,r,s,a){i.writelen=n;i.writecb=a;i.writing=true;i.sync=true;if(e)t._writev(r,i.onwrite);else t._write(r,s,i.onwrite);i.sync=false}function Pn(t,i,e,n,r){--i.pendingcb;if(e)S(r,n);else r(n);t._writableState.errorEmitted=true;t.emit("error",n)}function Fn(t){t.writing=false;t.writecb=null;t.length-=t.writelen;t.writelen=0}function Bn(t,i){var e=t._writableState;var n=e.sync;var r=e.writecb;Fn(e);if(i)Pn(t,e,n,i,r);else{var s=Vn(e);if(!s&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest){Xn(t,e)}if(n){S(Jn,t,e,s,r)}else{Jn(t,e,s,r)}}}function Jn(t,i,e,n){if(!e)Hn(t,i);i.pendingcb--;n();Kn(t,i)}function Hn(t,i){if(i.length===0&&i.needDrain){i.needDrain=false;t.emit("drain")}}function Xn(t,i){i.bufferProcessing=true;var e=i.bufferedRequest;if(t._writev&&e&&e.next){var n=i.bufferedRequestCount;var r=new Array(n);var s=i.corkedRequestsFree;s.entry=e;var a=0;while(e){r[a]=e;e=e.next;a+=1}Un(t,i,true,i.length,r,"",s.finish);i.pendingcb++;i.lastBufferedRequest=null;if(s.next){i.corkedRequestsFree=s.next;s.next=null}else{i.corkedRequestsFree=new $n(i)}}else{while(e){var o=e.chunk;var c=e.encoding;var f=e.callback;var u=i.objectMode?1:o.length;Un(t,i,false,u,o,c,f);e=e.next;if(i.writing){break}}if(e===null)i.lastBufferedRequest=null}i.bufferedRequestCount=0;i.bufferedRequest=e;i.bufferProcessing=false}Zn.prototype._write=function(t,i,e){e(new Error("not implemented"))};Zn.prototype._writev=null;Zn.prototype.end=function(t,i,e){var n=this._writableState;if(typeof t==="function"){e=t;t=null;i=null}else if(typeof i==="function"){e=i;i=null}if(t!==null&&t!==undefined)this.write(t,i);if(n.corked){n.corked=1;this.uncork()}if(!n.ending&&!n.finished)qn(this,n,e)};function Vn(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function _n(t,i){if(!i.prefinished){i.prefinished=true;t.emit("prefinish")}}function Kn(t,i){var e=Vn(i);if(e){if(i.pendingcb===0){_n(t,i);i.finished=true;t.emit("finish")}else{_n(t,i)}}return e}function qn(t,i,e){i.ending=true;Kn(t,i);if(e){if(i.finished)S(e);else t.once("finish",e)}i.ended=true;t.writable=false}function $n(t){var i=this;this.next=null;this.entry=null;this.finish=function(e){var n=i.entry;i.entry=null;while(n){var r=n.callback;t.pendingcb--;r(e);n=n.next}if(t.corkedRequestsFree){t.corkedRequestsFree.next=i}else{t.corkedRequestsFree=i}}}Bi(nr,fn);var tr=Object.keys(Zn.prototype);for(var ir=0;ir<tr.length;ir++){var er=tr[ir];if(!nr.prototype[er])nr.prototype[er]=Zn.prototype[er]}function nr(t){if(!(this instanceof nr))return new nr(t);fn.call(this,t);Zn.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",rr)}function rr(){if(this.allowHalfOpen||this._writableState.ended)return;S(sr,this)}function sr(t){t.end()}Bi(cr,nr);function ar(t){this.afterTransform=function(i,e){return or(t,i,e)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null;this.writeencoding=null}function or(t,i,e){var n=t._transformState;n.transforming=false;var r=n.writecb;if(!r)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null;n.writecb=null;if(e!==null&&e!==undefined)t.push(e);r(i);var s=t._readableState;s.reading=false;if(s.needReadable||s.length<s.highWaterMark){t._read(s.highWaterMark)}}function cr(t){if(!(this instanceof cr))return new cr(t);nr.call(this,t);this._transformState=new ar(this);var i=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){fr(i,t)}));else fr(i)}))}cr.prototype.push=function(t,i){this._transformState.needTransform=false;return nr.prototype.push.call(this,t,i)};cr.prototype._transform=function(t,i,e){throw new Error("Not implemented")};cr.prototype._write=function(t,i,e){var n=this._transformState;n.writecb=e;n.writechunk=t;n.writeencoding=i;if(!n.transforming){var r=this._readableState;if(n.needTransform||r.needReadable||r.length<r.highWaterMark)this._read(r.highWaterMark)}};cr.prototype._read=function(t){var i=this._transformState;if(i.writechunk!==null&&i.writecb&&!i.transforming){i.transforming=true;this._transform(i.writechunk,i.writeencoding,i.afterTransform)}else{i.needTransform=true}};function fr(t,i){if(i)return t.emit("error",i);var e=t._writableState;var n=t._transformState;if(e.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}Bi(ur,cr);function ur(t){if(!(this instanceof ur))return new ur(t);cr.call(this,t)}ur.prototype._transform=function(t,i,e){e(null,t)};Bi(lr,Ye);lr.Readable=fn;lr.Writable=Zn;lr.Duplex=nr;lr.Transform=cr;lr.PassThrough=ur;lr.Stream=lr;function lr(){Ye.call(this)}lr.prototype.pipe=function(t,i){var e=this;function n(i){if(t.writable){if(false===t.write(i)&&e.pause){e.pause()}}}e.on("data",n);function r(){if(e.readable&&e.resume){e.resume()}}t.on("drain",r);if(!t._isStdio&&(!i||i.end!==false)){e.on("end",a);e.on("close",o)}var s=false;function a(){if(s)return;s=true;t.end()}function o(){if(s)return;s=true;if(typeof t.destroy==="function")t.destroy()}function c(t){f();if(Ye.listenerCount(this,"error")===0){throw t}}e.on("error",c);t.on("error",c);function f(){e.removeListener("data",n);t.removeListener("drain",r);e.removeListener("end",a);e.removeListener("close",o);e.removeListener("error",c);t.removeListener("error",c);e.removeListener("end",f);e.removeListener("close",f);t.removeListener("close",f)}e.on("end",f);e.on("close",f);t.on("close",f);t.emit("pipe",e);return t};var hr=Object.freeze({__proto__:null,Duplex:nr,PassThrough:ur,Readable:fn,Stream:lr,Transform:cr,Writable:Zn,default:lr});var dr=l(hr);var wr={exports:{}};var br={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 gr(){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 Mr(t,i,e,n,r){if(i.subarray&&t.subarray){t.set(i.subarray(e,e+n),r);return}for(var s=0;s<n;s++){t[r+s]=i[e+s]}}var mr=Uint8Array;var yr=Uint16Array;var vr=Int32Array;var Ir=4;var pr=0;var Lr=1;var Dr=2;function Nr(t){var i=t.length;while(--i>=0){t[i]=0}}var xr=0;var Cr=1;var kr=2;var jr=3;var zr=258;var Sr=29;var Tr=256;var Ar=Tr+1+Sr;var Er=30;var Yr=19;var Or=2*Ar+1;var Zr=15;var Rr=16;var Gr=7;var Qr=256;var Wr=16;var Ur=17;var Pr=18;var Fr=[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 Br=[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 Jr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var Hr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var Xr=512;var Vr=new Array((Ar+2)*2);Nr(Vr);var _r=new Array(Er*2);Nr(_r);var Kr=new Array(Xr);Nr(Kr);var qr=new Array(zr-jr+1);Nr(qr);var $r=new Array(Sr);Nr($r);var ts=new Array(Er);Nr(ts);function is(t,i,e,n,r){this.static_tree=t;this.extra_bits=i;this.extra_base=e;this.elems=n;this.max_length=r;this.has_stree=t&&t.length}var es;var ns;var rs;function ss(t,i){this.dyn_tree=t;this.max_code=0;this.stat_desc=i}function as(t){return t<256?Kr[t]:Kr[256+(t>>>7)]}function os(t,i){t.pending_buf[t.pending++]=i&255;t.pending_buf[t.pending++]=i>>>8&255}function cs(t,i,e){if(t.bi_valid>Rr-e){t.bi_buf|=i<<t.bi_valid&65535;os(t,t.bi_buf);t.bi_buf=i>>Rr-t.bi_valid;t.bi_valid+=e-Rr}else{t.bi_buf|=i<<t.bi_valid&65535;t.bi_valid+=e}}function fs(t,i,e){cs(t,e[i*2],e[i*2+1])}function us(t,i){var e=0;do{e|=t&1;t>>>=1;e<<=1}while(--i>0);return e>>>1}function ls(t){if(t.bi_valid===16){os(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 hs(t,i){var e=i.dyn_tree;var n=i.max_code;var r=i.stat_desc.static_tree;var s=i.stat_desc.has_stree;var a=i.stat_desc.extra_bits;var o=i.stat_desc.extra_base;var c=i.stat_desc.max_length;var f;var u,l;var h;var d;var w;var b=0;for(h=0;h<=Zr;h++){t.bl_count[h]=0}e[t.heap[t.heap_max]*2+1]=0;for(f=t.heap_max+1;f<Or;f++){u=t.heap[f];h=e[e[u*2+1]*2+1]+1;if(h>c){h=c;b++}e[u*2+1]=h;if(u>n){continue}t.bl_count[h]++;d=0;if(u>=o){d=a[u-o]}w=e[u*2];t.opt_len+=w*(h+d);if(s){t.static_len+=w*(r[u*2+1]+d)}}if(b===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]--;b-=2}while(b>0);for(h=c;h!==0;h--){u=t.bl_count[h];while(u!==0){l=t.heap[--f];if(l>n){continue}if(e[l*2+1]!==h){t.opt_len+=(h-e[l*2+1])*e[l*2];e[l*2+1]=h}u--}}}function ds(t,i,e){var n=new Array(Zr+1);var r=0;var s;var a;for(s=1;s<=Zr;s++){n[s]=r=r+e[s-1]<<1}for(a=0;a<=i;a++){var o=t[a*2+1];if(o===0){continue}t[a*2]=us(n[o]++,o)}}function ws(){var t;var i;var e;var n;var r;var s=new Array(Zr+1);e=0;for(n=0;n<Sr-1;n++){$r[n]=e;for(t=0;t<1<<Fr[n];t++){qr[e++]=n}}qr[e-1]=n;r=0;for(n=0;n<16;n++){ts[n]=r;for(t=0;t<1<<Br[n];t++){Kr[r++]=n}}r>>=7;for(;n<Er;n++){ts[n]=r<<7;for(t=0;t<1<<Br[n]-7;t++){Kr[256+r++]=n}}for(i=0;i<=Zr;i++){s[i]=0}t=0;while(t<=143){Vr[t*2+1]=8;t++;s[8]++}while(t<=255){Vr[t*2+1]=9;t++;s[9]++}while(t<=279){Vr[t*2+1]=7;t++;s[7]++}while(t<=287){Vr[t*2+1]=8;t++;s[8]++}ds(Vr,Ar+1,s);for(t=0;t<Er;t++){_r[t*2+1]=5;_r[t*2]=us(t,5)}es=new is(Vr,Fr,Tr+1,Ar,Zr);ns=new is(_r,Br,0,Er,Zr);rs=new is(new Array(0),Jr,0,Yr,Gr)}function bs(t){var i;for(i=0;i<Ar;i++){t.dyn_ltree[i*2]=0}for(i=0;i<Er;i++){t.dyn_dtree[i*2]=0}for(i=0;i<Yr;i++){t.bl_tree[i*2]=0}t.dyn_ltree[Qr*2]=1;t.opt_len=t.static_len=0;t.last_lit=t.matches=0}function gs(t){if(t.bi_valid>8){os(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 Ms(t,i,e,n){gs(t);{os(t,e);os(t,~e)}Mr(t.pending_buf,t.window,i,e,t.pending);t.pending+=e}function ms(t,i,e,n){var r=i*2;var s=e*2;return t[r]<t[s]||t[r]===t[s]&&n[i]<=n[e]}function ys(t,i,e){var n=t.heap[e];var r=e<<1;while(r<=t.heap_len){if(r<t.heap_len&&ms(i,t.heap[r+1],t.heap[r],t.depth)){r++}if(ms(i,n,t.heap[r],t.depth)){break}t.heap[e]=t.heap[r];e=r;r<<=1}t.heap[e]=n}function vs(t,i,e){var n;var r;var s=0;var a;var o;if(t.last_lit!==0){do{n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1];r=t.pending_buf[t.l_buf+s];s++;if(n===0){fs(t,r,i)}else{a=qr[r];fs(t,a+Tr+1,i);o=Fr[a];if(o!==0){r-=$r[a];cs(t,r,o)}n--;a=as(n);fs(t,a,e);o=Br[a];if(o!==0){n-=ts[a];cs(t,n,o)}}}while(s<t.last_lit)}fs(t,Qr,i)}function Is(t,i){var e=i.dyn_tree;var n=i.stat_desc.static_tree;var r=i.stat_desc.has_stree;var s=i.stat_desc.elems;var a,o;var c=-1;var f;t.heap_len=0;t.heap_max=Or;for(a=0;a<s;a++){if(e[a*2]!==0){t.heap[++t.heap_len]=c=a;t.depth[a]=0}else{e[a*2+1]=0}}while(t.heap_len<2){f=t.heap[++t.heap_len]=c<2?++c:0;e[f*2]=1;t.depth[f]=0;t.opt_len--;if(r){t.static_len-=n[f*2+1]}}i.max_code=c;for(a=t.heap_len>>1;a>=1;a--){ys(t,e,a)}f=s;do{a=t.heap[1];t.heap[1]=t.heap[t.heap_len--];ys(t,e,1);o=t.heap[1];t.heap[--t.heap_max]=a;t.heap[--t.heap_max]=o;e[f*2]=e[a*2]+e[o*2];t.depth[f]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1;e[a*2+1]=e[o*2+1]=f;t.heap[1]=f++;ys(t,e,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1];hs(t,i);ds(e,c,t.bl_count)}function ps(t,i,e){var n;var r=-1;var s;var a=i[0*2+1];var o=0;var c=7;var f=4;if(a===0){c=138;f=3}i[(e+1)*2+1]=65535;for(n=0;n<=e;n++){s=a;a=i[(n+1)*2+1];if(++o<c&&s===a){continue}else if(o<f){t.bl_tree[s*2]+=o}else if(s!==0){if(s!==r){t.bl_tree[s*2]++}t.bl_tree[Wr*2]++}else if(o<=10){t.bl_tree[Ur*2]++}else{t.bl_tree[Pr*2]++}o=0;r=s;if(a===0){c=138;f=3}else if(s===a){c=6;f=3}else{c=7;f=4}}}function Ls(t,i,e){var n;var r=-1;var s;var a=i[0*2+1];var o=0;var c=7;var f=4;if(a===0){c=138;f=3}for(n=0;n<=e;n++){s=a;a=i[(n+1)*2+1];if(++o<c&&s===a){continue}else if(o<f){do{fs(t,s,t.bl_tree)}while(--o!==0)}else if(s!==0){if(s!==r){fs(t,s,t.bl_tree);o--}fs(t,Wr,t.bl_tree);cs(t,o-3,2)}else if(o<=10){fs(t,Ur,t.bl_tree);cs(t,o-3,3)}else{fs(t,Pr,t.bl_tree);cs(t,o-11,7)}o=0;r=s;if(a===0){c=138;f=3}else if(s===a){c=6;f=3}else{c=7;f=4}}}function Ds(t){var i;ps(t,t.dyn_ltree,t.l_desc.max_code);ps(t,t.dyn_dtree,t.d_desc.max_code);Is(t,t.bl_desc);for(i=Yr-1;i>=3;i--){if(t.bl_tree[Hr[i]*2+1]!==0){break}}t.opt_len+=3*(i+1)+5+5+4;return i}function Ns(t,i,e,n){var r;cs(t,i-257,5);cs(t,e-1,5);cs(t,n-4,4);for(r=0;r<n;r++){cs(t,t.bl_tree[Hr[r]*2+1],3)}Ls(t,t.dyn_ltree,i-1);Ls(t,t.dyn_dtree,e-1)}function xs(t){var i=4093624447;var e;for(e=0;e<=31;e++,i>>>=1){if(i&1&&t.dyn_ltree[e*2]!==0){return pr}}if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0){return Lr}for(e=32;e<Tr;e++){if(t.dyn_ltree[e*2]!==0){return Lr}}return pr}var Cs=false;function ks(t){if(!Cs){ws();Cs=true}t.l_desc=new ss(t.dyn_ltree,es);t.d_desc=new ss(t.dyn_dtree,ns);t.bl_desc=new ss(t.bl_tree,rs);t.bi_buf=0;t.bi_valid=0;bs(t)}function js(t,i,e,n){cs(t,(xr<<1)+(n?1:0),3);Ms(t,i,e)}function zs(t){cs(t,Cr<<1,3);fs(t,Qr,Vr);ls(t)}function Ss(t,i,e,n){var r,s;var a=0;if(t.level>0){if(t.strm.data_type===Dr){t.strm.data_type=xs(t)}Is(t,t.l_desc);Is(t,t.d_desc);a=Ds(t);r=t.opt_len+3+7>>>3;s=t.static_len+3+7>>>3;if(s<=r){r=s}}else{r=s=e+5}if(e+4<=r&&i!==-1){js(t,i,e,n)}else if(t.strategy===Ir||s===r){cs(t,(Cr<<1)+(n?1:0),3);vs(t,Vr,_r)}else{cs(t,(kr<<1)+(n?1:0),3);Ns(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1);vs(t,t.dyn_ltree,t.dyn_dtree)}bs(t);if(n){gs(t)}}function Ts(t,i,e){t.pending_buf[t.d_buf+t.last_lit*2]=i>>>8&255;t.pending_buf[t.d_buf+t.last_lit*2+1]=i&255;t.pending_buf[t.l_buf+t.last_lit]=e&255;t.last_lit++;if(i===0){t.dyn_ltree[e*2]++}else{t.matches++;i--;t.dyn_ltree[(qr[e]+Tr+1)*2]++;t.dyn_dtree[as(i)*2]++}return t.last_lit===t.lit_bufsize-1}function As(t,i,e,n){var r=t&65535|0,s=t>>>16&65535|0,a=0;while(e!==0){a=e>2e3?2e3:e;e-=a;do{r=r+i[n++]|0;s=s+r|0}while(--a);r%=65521;s%=65521}return r|s<<16|0}function Es(){var t,i=[];for(var e=0;e<256;e++){t=e;for(var n=0;n<8;n++){t=t&1?3988292384^t>>>1:t>>>1}i[e]=t}return i}var Ys=Es();function Os(t,i,e,n){var r=Ys,s=n+e;t^=-1;for(var a=n;a<s;a++){t=t>>>8^r[(t^i[a])&255]}return t^-1}var Zs=0;var Rs=1;var Gs=3;var Qs=4;var Ws=5;var Us=0;var Ps=1;var Fs=-2;var Bs=-3;var Js=-5;var Hs=-1;var Xs=1;var Vs=2;var _s=3;var Ks=4;var qs=2;var $s=8;var ta=9;var ia=29;var ea=256;var na=ea+1+ia;var ra=30;var sa=19;var aa=2*na+1;var oa=15;var ca=3;var fa=258;var ua=fa+ca+1;var la=32;var ha=42;var da=69;var wa=73;var ba=91;var ga=103;var Ma=113;var ma=666;var ya=1;var va=2;var Ia=3;var pa=4;var La=3;function Da(t,i){t.msg=br[i];return i}function Na(t){return(t<<1)-(t>4?9:0)}function xa(t){var i=t.length;while(--i>=0){t[i]=0}}function Ca(t){var i=t.state;var e=i.pending;if(e>t.avail_out){e=t.avail_out}if(e===0){return}Mr(t.output,i.pending_buf,i.pending_out,e,t.next_out);t.next_out+=e;i.pending_out+=e;t.total_out+=e;t.avail_out-=e;i.pending-=e;if(i.pending===0){i.pending_out=0}}function ka(t,i){Ss(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,i);t.block_start=t.strstart;Ca(t.strm)}function ja(t,i){t.pending_buf[t.pending++]=i}function za(t,i){t.pending_buf[t.pending++]=i>>>8&255;t.pending_buf[t.pending++]=i&255}function Sa(t,i,e,n){var r=t.avail_in;if(r>n){r=n}if(r===0){return 0}t.avail_in-=r;Mr(i,t.input,t.next_in,r,e);if(t.state.wrap===1){t.adler=As(t.adler,i,r,e)}else if(t.state.wrap===2){t.adler=Os(t.adler,i,r,e)}t.next_in+=r;t.total_in+=r;return r}function Ta(t,i){var e=t.max_chain_length;var n=t.strstart;var r;var s;var a=t.prev_length;var o=t.nice_match;var c=t.strstart>t.w_size-ua?t.strstart-(t.w_size-ua):0;var f=t.window;var u=t.w_mask;var l=t.prev;var h=t.strstart+fa;var d=f[n+a-1];var w=f[n+a];if(t.prev_length>=t.good_match){e>>=2}if(o>t.lookahead){o=t.lookahead}do{r=i;if(f[r+a]!==w||f[r+a-1]!==d||f[r]!==f[n]||f[++r]!==f[n+1]){continue}n+=2;r++;do{}while(f[++n]===f[++r]&&f[++n]===f[++r]&&f[++n]===f[++r]&&f[++n]===f[++r]&&f[++n]===f[++r]&&f[++n]===f[++r]&&f[++n]===f[++r]&&f[++n]===f[++r]&&n<h);s=fa-(h-n);n=h-fa;if(s>a){t.match_start=i;a=s;if(s>=o){break}d=f[n+a-1];w=f[n+a]}}while((i=l[i&u])>c&&--e!==0);if(a<=t.lookahead){return a}return t.lookahead}function Aa(t){var i=t.w_size;var e,n,r,s,a;do{s=t.window_size-t.lookahead-t.strstart;if(t.strstart>=i+(i-ua)){Mr(t.window,t.window,i,i,0);t.match_start-=i;t.strstart-=i;t.block_start-=i;n=t.hash_size;e=n;do{r=t.head[--e];t.head[e]=r>=i?r-i:0}while(--n);n=i;e=n;do{r=t.prev[--e];t.prev[e]=r>=i?r-i:0}while(--n);s+=i}if(t.strm.avail_in===0){break}n=Sa(t.strm,t.window,t.strstart+t.lookahead,s);t.lookahead+=n;if(t.lookahead+t.insert>=ca){a=t.strstart-t.insert;t.ins_h=t.window[a];t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+1])&t.hash_mask;while(t.insert){t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+ca-1])&t.hash_mask;t.prev[a&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=a;a++;t.insert--;if(t.lookahead+t.insert<ca){break}}}}while(t.lookahead<ua&&t.strm.avail_in!==0)}function Ea(t,i){var e=65535;if(e>t.pending_buf_size-5){e=t.pending_buf_size-5}for(;;){if(t.lookahead<=1){Aa(t);if(t.lookahead===0&&i===Zs){return ya}if(t.lookahead===0){break}}t.strstart+=t.lookahead;t.lookahead=0;var n=t.block_start+e;if(t.strstart===0||t.strstart>=n){t.lookahead=t.strstart-n;t.strstart=n;ka(t,false);if(t.strm.avail_out===0){return ya}}if(t.strstart-t.block_start>=t.w_size-ua){ka(t,false);if(t.strm.avail_out===0){return ya}}}t.insert=0;if(i===Qs){ka(t,true);if(t.strm.avail_out===0){return Ia}return pa}if(t.strstart>t.block_start){ka(t,false);if(t.strm.avail_out===0){return ya}}return ya}function Ya(t,i){var e;var n;for(;;){if(t.lookahead<ua){Aa(t);if(t.lookahead<ua&&i===Zs){return ya}if(t.lookahead===0){break}}e=0;if(t.lookahead>=ca){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ca-1])&t.hash_mask;e=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h];t.head[t.ins_h]=t.strstart}if(e!==0&&t.strstart-e<=t.w_size-ua){t.match_length=Ta(t,e)}if(t.match_length>=ca){n=Ts(t,t.strstart-t.match_start,t.match_length-ca);t.lookahead-=t.match_length;if(t.match_length<=t.max_lazy_match&&t.lookahead>=ca){t.match_length--;do{t.strstart++;t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ca-1])&t.hash_mask;e=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{n=Ts(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(n){ka(t,false);if(t.strm.avail_out===0){return ya}}}t.insert=t.strstart<ca-1?t.strstart:ca-1;if(i===Qs){ka(t,true);if(t.strm.avail_out===0){return Ia}return pa}if(t.last_lit){ka(t,false);if(t.strm.avail_out===0){return ya}}return va}function Oa(t,i){var e;var n;var r;for(;;){if(t.lookahead<ua){Aa(t);if(t.lookahead<ua&&i===Zs){return ya}if(t.lookahead===0){break}}e=0;if(t.lookahead>=ca){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ca-1])&t.hash_mask;e=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=ca-1;if(e!==0&&t.prev_length<t.max_lazy_match&&t.strstart-e<=t.w_size-ua){t.match_length=Ta(t,e);if(t.match_length<=5&&(t.strategy===Xs||t.match_length===ca&&t.strstart-t.match_start>4096)){t.match_length=ca-1}}if(t.prev_length>=ca&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-ca;n=Ts(t,t.strstart-1-t.prev_match,t.prev_length-ca);t.lookahead-=t.prev_length-1;t.prev_length-=2;do{if(++t.strstart<=r){t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ca-1])&t.hash_mask;e=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=ca-1;t.strstart++;if(n){ka(t,false);if(t.strm.avail_out===0){return ya}}}else if(t.match_available){n=Ts(t,0,t.window[t.strstart-1]);if(n){ka(t,false)}t.strstart++;t.lookahead--;if(t.strm.avail_out===0){return ya}}else{t.match_available=1;t.strstart++;t.lookahead--}}if(t.match_available){n=Ts(t,0,t.window[t.strstart-1]);t.match_available=0}t.insert=t.strstart<ca-1?t.strstart:ca-1;if(i===Qs){ka(t,true);if(t.strm.avail_out===0){return Ia}return pa}if(t.last_lit){ka(t,false);if(t.strm.avail_out===0){return ya}}return va}function Za(t,i){var e;var n;var r,s;var a=t.window;for(;;){if(t.lookahead<=fa){Aa(t);if(t.lookahead<=fa&&i===Zs){return ya}if(t.lookahead===0){break}}t.match_length=0;if(t.lookahead>=ca&&t.strstart>0){r=t.strstart-1;n=a[r];if(n===a[++r]&&n===a[++r]&&n===a[++r]){s=t.strstart+fa;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<s);t.match_length=fa-(s-r);if(t.match_length>t.lookahead){t.match_length=t.lookahead}}}if(t.match_length>=ca){e=Ts(t,1,t.match_length-ca);t.lookahead-=t.match_length;t.strstart+=t.match_length;t.match_length=0}else{e=Ts(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++}if(e){ka(t,false);if(t.strm.avail_out===0){return ya}}}t.insert=0;if(i===Qs){ka(t,true);if(t.strm.avail_out===0){return Ia}return pa}if(t.last_lit){ka(t,false);if(t.strm.avail_out===0){return ya}}return va}function Ra(t,i){var e;for(;;){if(t.lookahead===0){Aa(t);if(t.lookahead===0){if(i===Zs){return ya}break}}t.match_length=0;e=Ts(t,0,t.window[t.strstart]);t.lookahead--;t.strstart++;if(e){ka(t,false);if(t.strm.avail_out===0){return ya}}}t.insert=0;if(i===Qs){ka(t,true);if(t.strm.avail_out===0){return Ia}return pa}if(t.last_lit){ka(t,false);if(t.strm.avail_out===0){return ya}}return va}function Ga(t,i,e,n,r){this.good_length=t;this.max_lazy=i;this.nice_length=e;this.max_chain=n;this.func=r}var Qa;Qa=[new Ga(0,0,0,0,Ea),new Ga(4,4,8,4,Ya),new Ga(4,5,16,8,Ya),new Ga(4,6,32,32,Ya),new Ga(4,4,16,16,Oa),new Ga(8,16,32,32,Oa),new Ga(8,16,128,128,Oa),new Ga(8,32,128,256,Oa),new Ga(32,128,258,1024,Oa),new Ga(32,258,258,4096,Oa)];function Wa(t){t.window_size=2*t.w_size;xa(t.head);t.max_lazy_match=Qa[t.level].max_lazy;t.good_match=Qa[t.level].good_length;t.nice_match=Qa[t.level].nice_length;t.max_chain_length=Qa[t.level].max_chain;t.strstart=0;t.block_start=0;t.lookahead=0;t.insert=0;t.match_length=t.prev_length=ca-1;t.match_available=0;t.ins_h=0}function Ua(){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=$s;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 yr(aa*2);this.dyn_dtree=new yr((2*ra+1)*2);this.bl_tree=new yr((2*sa+1)*2);xa(this.dyn_ltree);xa(this.dyn_dtree);xa(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new yr(oa+1);this.heap=new yr(2*na+1);xa(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new yr(2*na+1);xa(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 Pa(t){var i;if(!t||!t.state){return Da(t,Fs)}t.total_in=t.total_out=0;t.data_type=qs;i=t.state;i.pending=0;i.pending_out=0;if(i.wrap<0){i.wrap=-i.wrap}i.status=i.wrap?ha:Ma;t.adler=i.wrap===2?0:1;i.last_flush=Zs;ks(i);return Us}function Fa(t){var i=Pa(t);if(i===Us){Wa(t.state)}return i}function Ba(t,i,e,n,r,s){if(!t){return Fs}var a=1;if(i===Hs){i=6}if(n<0){a=0;n=-n}else if(n>15){a=2;n-=16}if(r<1||r>ta||e!==$s||n<8||n>15||i<0||i>9||s<0||s>Ks){return Da(t,Fs)}if(n===8){n=9}var o=new Ua;t.state=o;o.strm=t;o.wrap=a;o.gzhead=null;o.w_bits=n;o.w_size=1<<o.w_bits;o.w_mask=o.w_size-1;o.hash_bits=r+7;o.hash_size=1<<o.hash_bits;o.hash_mask=o.hash_size-1;o.hash_shift=~~((o.hash_bits+ca-1)/ca);o.window=new mr(o.w_size*2);o.head=new yr(o.hash_size);o.prev=new yr(o.w_size);o.lit_bufsize=1<<r+6;o.pending_buf_size=o.lit_bufsize*4;o.pending_buf=new mr(o.pending_buf_size);o.d_buf=1*o.lit_bufsize;o.l_buf=(1+2)*o.lit_bufsize;o.level=i;o.strategy=s;o.method=e;return Fa(t)}function Ja(t,i){var e,n;var r,s;if(!t||!t.state||i>Ws||i<0){return t?Da(t,Fs):Fs}n=t.state;if(!t.output||!t.input&&t.avail_in!==0||n.status===ma&&i!==Qs){return Da(t,t.avail_out===0?Js:Fs)}n.strm=t;e=n.last_flush;n.last_flush=i;if(n.status===ha){if(n.wrap===2){t.adler=0;ja(n,31);ja(n,139);ja(n,8);if(!n.gzhead){ja(n,0);ja(n,0);ja(n,0);ja(n,0);ja(n,0);ja(n,n.level===9?2:n.strategy>=Vs||n.level<2?4:0);ja(n,La);n.status=Ma}else{ja(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(!n.gzhead.extra?0:4)+(!n.gzhead.name?0:8)+(!n.gzhead.comment?0:16));ja(n,n.gzhead.time&255);ja(n,n.gzhead.time>>8&255);ja(n,n.gzhead.time>>16&255);ja(n,n.gzhead.time>>24&255);ja(n,n.level===9?2:n.strategy>=Vs||n.level<2?4:0);ja(n,n.gzhead.os&255);if(n.gzhead.extra&&n.gzhead.extra.length){ja(n,n.gzhead.extra.length&255);ja(n,n.gzhead.extra.length>>8&255)}if(n.gzhead.hcrc){t.adler=Os(t.adler,n.pending_buf,n.pending,0)}n.gzindex=0;n.status=da}}else{var a=$s+(n.w_bits-8<<4)<<8;var o=-1;if(n.strategy>=Vs||n.level<2){o=0}else if(n.level<6){o=1}else if(n.level===6){o=2}else{o=3}a|=o<<6;if(n.strstart!==0){a|=la}a+=31-a%31;n.status=Ma;za(n,a);if(n.strstart!==0){za(n,t.adler>>>16);za(n,t.adler&65535)}t.adler=1}}if(n.status===da){if(n.gzhead.extra){r=n.pending;while(n.gzindex<(n.gzhead.extra.length&65535)){if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r){t.adler=Os(t.adler,n.pending_buf,n.pending-r,r)}Ca(t);r=n.pending;if(n.pending===n.pending_buf_size){break}}ja(n,n.gzhead.extra[n.gzindex]&255);n.gzindex++}if(n.gzhead.hcrc&&n.pending>r){t.adler=Os(t.adler,n.pending_buf,n.pending-r,r)}if(n.gzindex===n.gzhead.extra.length){n.gzindex=0;n.status=wa}}else{n.status=wa}}if(n.status===wa){if(n.gzhead.name){r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r){t.adler=Os(t.adler,n.pending_buf,n.pending-r,r)}Ca(t);r=n.pending;if(n.pending===n.pending_buf_size){s=1;break}}if(n.gzindex<n.gzhead.name.length){s=n.gzhead.name.charCodeAt(n.gzindex++)&255}else{s=0}ja(n,s)}while(s!==0);if(n.gzhead.hcrc&&n.pending>r){t.adler=Os(t.adler,n.pending_buf,n.pending-r,r)}if(s===0){n.gzindex=0;n.status=ba}}else{n.status=ba}}if(n.status===ba){if(n.gzhead.comment){r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r){t.adler=Os(t.adler,n.pending_buf,n.pending-r,r)}Ca(t);r=n.pending;if(n.pending===n.pending_buf_size){s=1;break}}if(n.gzindex<n.gzhead.comment.length){s=n.gzhead.comment.charCodeAt(n.gzindex++)&255}else{s=0}ja(n,s)}while(s!==0);if(n.gzhead.hcrc&&n.pending>r){t.adler=Os(t.adler,n.pending_buf,n.pending-r,r)}if(s===0){n.status=ga}}else{n.status=ga}}if(n.status===ga){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size){Ca(t)}if(n.pending+2<=n.pending_buf_size){ja(n,t.adler&255);ja(n,t.adler>>8&255);t.adler=0;n.status=Ma}}else{n.status=Ma}}if(n.pending!==0){Ca(t);if(t.avail_out===0){n.last_flush=-1;return Us}}else if(t.avail_in===0&&Na(i)<=Na(e)&&i!==Qs){return Da(t,Js)}if(n.status===ma&&t.avail_in!==0){return Da(t,Js)}if(t.avail_in!==0||n.lookahead!==0||i!==Zs&&n.status!==ma){var c=n.strategy===Vs?Ra(n,i):n.strategy===_s?Za(n,i):Qa[n.level].func(n,i);if(c===Ia||c===pa){n.status=ma}if(c===ya||c===Ia){if(t.avail_out===0){n.last_flush=-1}return Us}if(c===va){if(i===Rs){zs(n)}else if(i!==Ws){js(n,0,0,false);if(i===Gs){xa(n.head);if(n.lookahead===0){n.strstart=0;n.block_start=0;n.insert=0}}}Ca(t);if(t.avail_out===0){n.last_flush=-1;return Us}}}if(i!==Qs){return Us}if(n.wrap<=0){return Ps}if(n.wrap===2){ja(n,t.adler&255);ja(n,t.adler>>8&255);ja(n,t.adler>>16&255);ja(n,t.adler>>24&255);ja(n,t.total_in&255);ja(n,t.total_in>>8&255);ja(n,t.total_in>>16&255);ja(n,t.total_in>>24&255)}else{za(n,t.adler>>>16);za(n,t.adler&65535)}Ca(t);if(n.wrap>0){n.wrap=-n.wrap}return n.pending!==0?Us:Ps}function Ha(t){var i;if(!t||!t.state){return Fs}i=t.state.status;if(i!==ha&&i!==da&&i!==wa&&i!==ba&&i!==ga&&i!==Ma&&i!==ma){return Da(t,Fs)}t.state=null;return i===Ma?Da(t,Bs):Us}var Xa=30;var Va=12;function _a(t,i){var e;var n;var r;var s;var a;var o;var c;var f;var u;var l;var h;var d;var w;var b;var g;var M;var m;var y;var v;var I;var p;var L;var D;var N,x;e=t.state;n=t.next_in;N=t.input;r=n+(t.avail_in-5);s=t.next_out;x=t.output;a=s-(i-t.avail_out);o=s+(t.avail_out-257);c=e.dmax;f=e.wsize;u=e.whave;l=e.wnext;h=e.window;d=e.hold;w=e.bits;b=e.lencode;g=e.distcode;M=(1<<e.lenbits)-1;m=(1<<e.distbits)-1;t:do{if(w<15){d+=N[n++]<<w;w+=8;d+=N[n++]<<w;w+=8}y=b[d&M];i:for(;;){v=y>>>24;d>>>=v;w-=v;v=y>>>16&255;if(v===0){x[s++]=y&65535}else if(v&16){I=y&65535;v&=15;if(v){if(w<v){d+=N[n++]<<w;w+=8}I+=d&(1<<v)-1;d>>>=v;w-=v}if(w<15){d+=N[n++]<<w;w+=8;d+=N[n++]<<w;w+=8}y=g[d&m];e:for(;;){v=y>>>24;d>>>=v;w-=v;v=y>>>16&255;if(v&16){p=y&65535;v&=15;if(w<v){d+=N[n++]<<w;w+=8;if(w<v){d+=N[n++]<<w;w+=8}}p+=d&(1<<v)-1;if(p>c){t.msg="invalid distance too far back";e.mode=Xa;break t}d>>>=v;w-=v;v=s-a;if(p>v){v=p-v;if(v>u){if(e.sane){t.msg="invalid distance too far back";e.mode=Xa;break t}}L=0;D=h;if(l===0){L+=f-v;if(v<I){I-=v;do{x[s++]=h[L++]}while(--v);L=s-p;D=x}}else if(l<v){L+=f+l-v;v-=l;if(v<I){I-=v;do{x[s++]=h[L++]}while(--v);L=0;if(l<I){v=l;I-=v;do{x[s++]=h[L++]}while(--v);L=s-p;D=x}}}else{L+=l-v;if(v<I){I-=v;do{x[s++]=h[L++]}while(--v);L=s-p;D=x}}while(I>2){x[s++]=D[L++];x[s++]=D[L++];x[s++]=D[L++];I-=3}if(I){x[s++]=D[L++];if(I>1){x[s++]=D[L++]}}}else{L=s-p;do{x[s++]=x[L++];x[s++]=x[L++];x[s++]=x[L++];I-=3}while(I>2);if(I){x[s++]=x[L++];if(I>1){x[s++]=x[L++]}}}}else if((v&64)===0){y=g[(y&65535)+(d&(1<<v)-1)];continue e}else{t.msg="invalid distance code";e.mode=Xa;break t}break}}else if((v&64)===0){y=b[(y&65535)+(d&(1<<v)-1)];continue i}else if(v&32){e.mode=Va;break t}else{t.msg="invalid literal/length code";e.mode=Xa;break t}break}}while(n<r&&s<o);I=w>>3;n-=I;w-=I<<3;d&=(1<<w)-1;t.next_in=n;t.next_out=s;t.avail_in=n<r?5+(r-n):5-(n-r);t.avail_out=s<o?257+(o-s):257-(s-o);e.hold=d;e.bits=w;return}var Ka=15;var qa=852;var $a=592;var to=0;var io=1;var eo=2;var no=[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 ro=[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 so=[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 ao=[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 oo(t,i,e,n,r,s,a,o){var c=o.bits;var f=0;var u=0;var l=0,h=0;var d=0;var w=0;var b=0;var g=0;var M=0;var m=0;var y;var v;var I;var p;var L;var D=null;var N=0;var x;var C=new yr(Ka+1);var k=new yr(Ka+1);var j=null;var z=0;var S,T,A;for(f=0;f<=Ka;f++){C[f]=0}for(u=0;u<n;u++){C[i[e+u]]++}d=c;for(h=Ka;h>=1;h--){if(C[h]!==0){break}}if(d>h){d=h}if(h===0){r[s++]=1<<24|64<<16|0;r[s++]=1<<24|64<<16|0;o.bits=1;return 0}for(l=1;l<h;l++){if(C[l]!==0){break}}if(d<l){d=l}g=1;for(f=1;f<=Ka;f++){g<<=1;g-=C[f];if(g<0){return-1}}if(g>0&&(t===to||h!==1)){return-1}k[1]=0;for(f=1;f<Ka;f++){k[f+1]=k[f]+C[f]}for(u=0;u<n;u++){if(i[e+u]!==0){a[k[i[e+u]]++]=u}}if(t===to){D=j=a;x=19}else if(t===io){D=no;N-=257;j=ro;z-=257;x=256}else{D=so;j=ao;x=-1}m=0;u=0;f=l;L=s;w=d;b=0;I=-1;M=1<<d;p=M-1;if(t===io&&M>qa||t===eo&&M>$a){return 1}for(;;){S=f-b;if(a[u]<x){T=0;A=a[u]}else if(a[u]>x){T=j[z+a[u]];A=D[N+a[u]]}else{T=32+64;A=0}y=1<<f-b;v=1<<w;l=v;do{v-=y;r[L+(m>>b)+v]=S<<24|T<<16|A|0}while(v!==0);y=1<<f-1;while(m&y){y>>=1}if(y!==0){m&=y-1;m+=y}else{m=0}u++;if(--C[f]===0){if(f===h){break}f=i[e+a[u]]}if(f>d&&(m&p)!==I){if(b===0){b=d}L+=l;w=f-b;g=1<<w;while(w+b<h){g-=C[w+b];if(g<=0){break}w++;g<<=1}M+=1<<w;if(t===io&&M>qa||t===eo&&M>$a){return 1}I=m&p;r[I]=d<<24|w<<16|L-s|0}}if(m!==0){r[L+m]=f-b<<24|64<<16|0}o.bits=d;return 0}var co=0;var fo=1;var uo=2;var lo=4;var ho=5;var wo=6;var bo=0;var go=1;var Mo=2;var mo=-2;var yo=-3;var vo=-4;var Io=-5;var po=8;var Lo=1;var Do=2;var No=3;var xo=4;var Co=5;var ko=6;var jo=7;var zo=8;var So=9;var To=10;var Ao=11;var Eo=12;var Yo=13;var Oo=14;var Zo=15;var Ro=16;var Go=17;var Qo=18;var Wo=19;var Uo=20;var Po=21;var Fo=22;var Bo=23;var Jo=24;var Ho=25;var Xo=26;var Vo=27;var _o=28;var Ko=29;var qo=30;var $o=31;var tc=32;var ic=852;var ec=592;function nc(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function rc(){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 yr(320);this.work=new yr(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function sc(t){var i;if(!t||!t.state){return mo}i=t.state;t.total_in=t.total_out=i.total=0;t.msg="";if(i.wrap){t.adler=i.wrap&1}i.mode=Lo;i.last=0;i.havedict=0;i.dmax=32768;i.head=null;i.hold=0;i.bits=0;i.lencode=i.lendyn=new vr(ic);i.distcode=i.distdyn=new vr(ec);i.sane=1;i.back=-1;return bo}function ac(t){var i;if(!t||!t.state){return mo}i=t.state;i.wsize=0;i.whave=0;i.wnext=0;return sc(t)}function oc(t,i){var e;var n;if(!t||!t.state){return mo}n=t.state;if(i<0){e=0;i=-i}else{e=(i>>4)+1;if(i<48){i&=15}}if(i&&(i<8||i>15)){return mo}if(n.window!==null&&n.wbits!==i){n.window=null}n.wrap=e;n.wbits=i;return ac(t)}function cc(t,i){var e;var n;if(!t){return mo}n=new rc;t.state=n;n.window=null;e=oc(t,i);if(e!==bo){t.state=null}return e}var fc=true;var uc,lc;function hc(t){if(fc){var i;uc=new vr(512);lc=new vr(32);i=0;while(i<144){t.lens[i++]=8}while(i<256){t.lens[i++]=9}while(i<280){t.lens[i++]=7}while(i<288){t.lens[i++]=8}oo(fo,t.lens,0,288,uc,0,t.work,{bits:9});i=0;while(i<32){t.lens[i++]=5}oo(uo,t.lens,0,32,lc,0,t.work,{bits:5});fc=false}t.lencode=uc;t.lenbits=9;t.distcode=lc;t.distbits=5}function dc(t,i,e,n){var r;var s=t.state;if(s.window===null){s.wsize=1<<s.wbits;s.wnext=0;s.whave=0;s.window=new mr(s.wsize)}if(n>=s.wsize){Mr(s.window,i,e-s.wsize,s.wsize,0);s.wnext=0;s.whave=s.wsize}else{r=s.wsize-s.wnext;if(r>n){r=n}Mr(s.window,i,e-n,r,s.wnext);n-=r;if(n){Mr(s.window,i,e-n,n,0);s.wnext=n;s.whave=s.wsize}else{s.wnext+=r;if(s.wnext===s.wsize){s.wnext=0}if(s.whave<s.wsize){s.whave+=r}}}return 0}function wc(t,i){var e;var n,r;var s;var a;var o,c;var f;var u;var l,h;var d;var w;var b;var g=0;var M,m,y;var v,I,p;var L;var D;var N=new mr(4);var x;var C;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 mo}e=t.state;if(e.mode===Eo){e.mode=Yo}a=t.next_out;r=t.output;c=t.avail_out;s=t.next_in;n=t.input;o=t.avail_in;f=e.hold;u=e.bits;l=o;h=c;D=bo;t:for(;;){switch(e.mode){case Lo:if(e.wrap===0){e.mode=Yo;break}while(u<16){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(e.wrap&2&&f===35615){e.check=0;N[0]=f&255;N[1]=f>>>8&255;e.check=Os(e.check,N,2,0);f=0;u=0;e.mode=Do;break}e.flags=0;if(e.head){e.head.done=false}if(!(e.wrap&1)||(((f&255)<<8)+(f>>8))%31){t.msg="incorrect header check";e.mode=qo;break}if((f&15)!==po){t.msg="unknown compression method";e.mode=qo;break}f>>>=4;u-=4;L=(f&15)+8;if(e.wbits===0){e.wbits=L}else if(L>e.wbits){t.msg="invalid window size";e.mode=qo;break}e.dmax=1<<L;t.adler=e.check=1;e.mode=f&512?To:Eo;f=0;u=0;break;case Do:while(u<16){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.flags=f;if((e.flags&255)!==po){t.msg="unknown compression method";e.mode=qo;break}if(e.flags&57344){t.msg="unknown header flags set";e.mode=qo;break}if(e.head){e.head.text=f>>8&1}if(e.flags&512){N[0]=f&255;N[1]=f>>>8&255;e.check=Os(e.check,N,2,0)}f=0;u=0;e.mode=No;case No:while(u<32){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(e.head){e.head.time=f}if(e.flags&512){N[0]=f&255;N[1]=f>>>8&255;N[2]=f>>>16&255;N[3]=f>>>24&255;e.check=Os(e.check,N,4,0)}f=0;u=0;e.mode=xo;case xo:while(u<16){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(e.head){e.head.xflags=f&255;e.head.os=f>>8}if(e.flags&512){N[0]=f&255;N[1]=f>>>8&255;e.check=Os(e.check,N,2,0)}f=0;u=0;e.mode=Co;case Co:if(e.flags&1024){while(u<16){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.length=f;if(e.head){e.head.extra_len=f}if(e.flags&512){N[0]=f&255;N[1]=f>>>8&255;e.check=Os(e.check,N,2,0)}f=0;u=0}else if(e.head){e.head.extra=null}e.mode=ko;case ko:if(e.flags&1024){d=e.length;if(d>o){d=o}if(d){if(e.head){L=e.head.extra_len-e.length;if(!e.head.extra){e.head.extra=new Array(e.head.extra_len)}Mr(e.head.extra,n,s,d,L)}if(e.flags&512){e.check=Os(e.check,n,d,s)}o-=d;s+=d;e.length-=d}if(e.length){break t}}e.length=0;e.mode=jo;case jo:if(e.flags&2048){if(o===0){break t}d=0;do{L=n[s+d++];if(e.head&&L&&e.length<65536){e.head.name+=String.fromCharCode(L)}}while(L&&d<o);if(e.flags&512){e.check=Os(e.check,n,d,s)}o-=d;s+=d;if(L){break t}}else if(e.head){e.head.name=null}e.length=0;e.mode=zo;case zo:if(e.flags&4096){if(o===0){break t}d=0;do{L=n[s+d++];if(e.head&&L&&e.length<65536){e.head.comment+=String.fromCharCode(L)}}while(L&&d<o);if(e.flags&512){e.check=Os(e.check,n,d,s)}o-=d;s+=d;if(L){break t}}else if(e.head){e.head.comment=null}e.mode=So;case So:if(e.flags&512){while(u<16){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(f!==(e.check&65535)){t.msg="header crc mismatch";e.mode=qo;break}f=0;u=0}if(e.head){e.head.hcrc=e.flags>>9&1;e.head.done=true}t.adler=e.check=0;e.mode=Eo;break;case To:while(u<32){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}t.adler=e.check=nc(f);f=0;u=0;e.mode=Ao;case Ao:if(e.havedict===0){t.next_out=a;t.avail_out=c;t.next_in=s;t.avail_in=o;e.hold=f;e.bits=u;return Mo}t.adler=e.check=1;e.mode=Eo;case Eo:if(i===ho||i===wo){break t}case Yo:if(e.last){f>>>=u&7;u-=u&7;e.mode=Vo;break}while(u<3){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.last=f&1;f>>>=1;u-=1;switch(f&3){case 0:e.mode=Oo;break;case 1:hc(e);e.mode=Uo;if(i===wo){f>>>=2;u-=2;break t}break;case 2:e.mode=Go;break;case 3:t.msg="invalid block type";e.mode=qo}f>>>=2;u-=2;break;case Oo:f>>>=u&7;u-=u&7;while(u<32){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if((f&65535)!==(f>>>16^65535)){t.msg="invalid stored block lengths";e.mode=qo;break}e.length=f&65535;f=0;u=0;e.mode=Zo;if(i===wo){break t}case Zo:e.mode=Ro;case Ro:d=e.length;if(d){if(d>o){d=o}if(d>c){d=c}if(d===0){break t}Mr(r,n,s,d,a);o-=d;s+=d;c-=d;a+=d;e.length-=d;break}e.mode=Eo;break;case Go:while(u<14){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.nlen=(f&31)+257;f>>>=5;u-=5;e.ndist=(f&31)+1;f>>>=5;u-=5;e.ncode=(f&15)+4;f>>>=4;u-=4;if(e.nlen>286||e.ndist>30){t.msg="too many length or distance symbols";e.mode=qo;break}e.have=0;e.mode=Qo;case Qo:while(e.have<e.ncode){while(u<3){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.lens[k[e.have++]]=f&7;f>>>=3;u-=3}while(e.have<19){e.lens[k[e.have++]]=0}e.lencode=e.lendyn;e.lenbits=7;x={bits:e.lenbits};D=oo(co,e.lens,0,19,e.lencode,0,e.work,x);e.lenbits=x.bits;if(D){t.msg="invalid code lengths set";e.mode=qo;break}e.have=0;e.mode=Wo;case Wo:while(e.have<e.nlen+e.ndist){for(;;){g=e.lencode[f&(1<<e.lenbits)-1];M=g>>>24;m=g>>>16&255;y=g&65535;if(M<=u){break}if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(y<16){f>>>=M;u-=M;e.lens[e.have++]=y}else{if(y===16){C=M+2;while(u<C){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}f>>>=M;u-=M;if(e.have===0){t.msg="invalid bit length repeat";e.mode=qo;break}L=e.lens[e.have-1];d=3+(f&3);f>>>=2;u-=2}else if(y===17){C=M+3;while(u<C){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}f>>>=M;u-=M;L=0;d=3+(f&7);f>>>=3;u-=3}else{C=M+7;while(u<C){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}f>>>=M;u-=M;L=0;d=11+(f&127);f>>>=7;u-=7}if(e.have+d>e.nlen+e.ndist){t.msg="invalid bit length repeat";e.mode=qo;break}while(d--){e.lens[e.have++]=L}}}if(e.mode===qo){break}if(e.lens[256]===0){t.msg="invalid code -- missing end-of-block";e.mode=qo;break}e.lenbits=9;x={bits:e.lenbits};D=oo(fo,e.lens,0,e.nlen,e.lencode,0,e.work,x);e.lenbits=x.bits;if(D){t.msg="invalid literal/lengths set";e.mode=qo;break}e.distbits=6;e.distcode=e.distdyn;x={bits:e.distbits};D=oo(uo,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,x);e.distbits=x.bits;if(D){t.msg="invalid distances set";e.mode=qo;break}e.mode=Uo;if(i===wo){break t}case Uo:e.mode=Po;case Po:if(o>=6&&c>=258){t.next_out=a;t.avail_out=c;t.next_in=s;t.avail_in=o;e.hold=f;e.bits=u;_a(t,h);a=t.next_out;r=t.output;c=t.avail_out;s=t.next_in;n=t.input;o=t.avail_in;f=e.hold;u=e.bits;if(e.mode===Eo){e.back=-1}break}e.back=0;for(;;){g=e.lencode[f&(1<<e.lenbits)-1];M=g>>>24;m=g>>>16&255;y=g&65535;if(M<=u){break}if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(m&&(m&240)===0){v=M;I=m;p=y;for(;;){g=e.lencode[p+((f&(1<<v+I)-1)>>v)];M=g>>>24;m=g>>>16&255;y=g&65535;if(v+M<=u){break}if(o===0){break t}o--;f+=n[s++]<<u;u+=8}f>>>=v;u-=v;e.back+=v}f>>>=M;u-=M;e.back+=M;e.length=y;if(m===0){e.mode=Xo;break}if(m&32){e.back=-1;e.mode=Eo;break}if(m&64){t.msg="invalid literal/length code";e.mode=qo;break}e.extra=m&15;e.mode=Fo;case Fo:if(e.extra){C=e.extra;while(u<C){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.length+=f&(1<<e.extra)-1;f>>>=e.extra;u-=e.extra;e.back+=e.extra}e.was=e.length;e.mode=Bo;case Bo:for(;;){g=e.distcode[f&(1<<e.distbits)-1];M=g>>>24;m=g>>>16&255;y=g&65535;if(M<=u){break}if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if((m&240)===0){v=M;I=m;p=y;for(;;){g=e.distcode[p+((f&(1<<v+I)-1)>>v)];M=g>>>24;m=g>>>16&255;y=g&65535;if(v+M<=u){break}if(o===0){break t}o--;f+=n[s++]<<u;u+=8}f>>>=v;u-=v;e.back+=v}f>>>=M;u-=M;e.back+=M;if(m&64){t.msg="invalid distance code";e.mode=qo;break}e.offset=y;e.extra=m&15;e.mode=Jo;case Jo:if(e.extra){C=e.extra;while(u<C){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}e.offset+=f&(1<<e.extra)-1;f>>>=e.extra;u-=e.extra;e.back+=e.extra}if(e.offset>e.dmax){t.msg="invalid distance too far back";e.mode=qo;break}e.mode=Ho;case Ho:if(c===0){break t}d=h-c;if(e.offset>d){d=e.offset-d;if(d>e.whave){if(e.sane){t.msg="invalid distance too far back";e.mode=qo;break}}if(d>e.wnext){d-=e.wnext;w=e.wsize-d}else{w=e.wnext-d}if(d>e.length){d=e.length}b=e.window}else{b=r;w=a-e.offset;d=e.length}if(d>c){d=c}c-=d;e.length-=d;do{r[a++]=b[w++]}while(--d);if(e.length===0){e.mode=Po}break;case Xo:if(c===0){break t}r[a++]=e.length;c--;e.mode=Po;break;case Vo:if(e.wrap){while(u<32){if(o===0){break t}o--;f|=n[s++]<<u;u+=8}h-=c;t.total_out+=h;e.total+=h;if(h){t.adler=e.check=e.flags?Os(e.check,r,h,a-h):As(e.check,r,h,a-h)}h=c;if((e.flags?f:nc(f))!==e.check){t.msg="incorrect data check";e.mode=qo;break}f=0;u=0}e.mode=_o;case _o:if(e.wrap&&e.flags){while(u<32){if(o===0){break t}o--;f+=n[s++]<<u;u+=8}if(f!==(e.total&4294967295)){t.msg="incorrect length check";e.mode=qo;break}f=0;u=0}e.mode=Ko;case Ko:D=go;break t;case qo:D=yo;break t;case $o:return vo;case tc:default:return mo}}t.next_out=a;t.avail_out=c;t.next_in=s;t.avail_in=o;e.hold=f;e.bits=u;if(e.wsize||h!==t.avail_out&&e.mode<qo&&(e.mode<Vo||i!==lo)){if(dc(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;e.total+=h;if(e.wrap&&h){t.adler=e.check=e.flags?Os(e.check,r,h,t.next_out-h):As(e.check,r,h,t.next_out-h)}t.data_type=e.bits+(e.last?64:0)+(e.mode===Eo?128:0)+(e.mode===Uo||e.mode===Zo?256:0);if((l===0&&h===0||i===lo)&&D===bo){D=Io}return D}function bc(t){if(!t||!t.state){return mo}var i=t.state;if(i.window){i.window=null}t.state=null;return bo}var gc=0;var Mc=1;var mc=2;var yc=3;var vc=4;var Ic=5;var pc=6;var Lc=7;var Dc=0,Nc=1,xc=2,Cc=3,kc=4,jc=5,zc=6,Sc=0,Tc=1,Ac=2,Ec=-1,Yc=-2,Oc=-3,Zc=-5,Rc=0,Gc=1,Qc=9,Wc=-1,Uc=1,Pc=2,Fc=3,Bc=4,Jc=0,Hc=0,Xc=1,Vc=2,_c=8;function Kc(t){if(t<Mc||t>Lc)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}Kc.prototype.init=function(t,i,e,n,r){this.windowBits=t;this.level=i;this.memLevel=e;this.strategy=n;if(this.mode===yc||this.mode===vc)this.windowBits+=16;if(this.mode===Lc)this.windowBits+=32;if(this.mode===Ic||this.mode===pc)this.windowBits=-this.windowBits;this.strm=new gr;var s;switch(this.mode){case Mc:case yc:case Ic:s=Ba(this.strm,this.level,_c,this.windowBits,this.memLevel,this.strategy);break;case mc:case vc:case pc:case Lc:s=cc(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(s!==Sc){this._error(s);return}this.write_in_progress=false;this.init_done=true};Kc.prototype.params=function(){throw new Error("deflateParams Not supported")};Kc.prototype._writeCheck=function(){if(!this.init_done)throw new Error("write before init");if(this.mode===gc)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")};Kc.prototype.write=function(t,i,e,n,r,s,a){this._writeCheck();this.write_in_progress=true;var o=this;C.nextTick((function(){o.write_in_progress=false;var c=o._write(t,i,e,n,r,s,a);o.callback(c[0],c[1]);if(o.pending_close)o.close()}));return this};function qc(t,i){for(var e=0;e<t.length;e++){this[i+e]=t[e]}}Kc.prototype.writeSync=function(t,i,e,n,r,s,a){this._writeCheck();return this._write(t,i,e,n,r,s,a)};Kc.prototype._write=function(t,i,e,n,r,s,a){this.write_in_progress=true;if(t!==Dc&&t!==Nc&&t!==xc&&t!==Cc&&t!==kc&&t!==jc){throw new Error("Invalid flush value")}if(i==null){i=new k(0);n=0;e=0}if(r._set)r.set=r._set;else r.set=qc;var o=this.strm;o.avail_in=n;o.input=i;o.next_in=e;o.avail_out=a;o.output=r;o.next_out=s;var c;switch(this.mode){case Mc:case yc:case Ic:c=Ja(o,t);break;case Lc:case mc:case vc:case pc:c=wc(o,t);break;default:throw new Error("Unknown mode "+this.mode)}if(c!==Tc&&c!==Sc){this._error(c)}this.write_in_progress=false;return[o.avail_in,o.avail_out]};Kc.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;if(this.mode===Mc||this.mode===yc||this.mode===Ic){Ha(this.strm)}else{bc(this.strm)}this.mode=gc};var $c;Kc.prototype.reset=function(){switch(this.mode){case Mc:case Ic:$c=Fa(this.strm);break;case mc:case pc:$c=ac(this.strm);break}if($c!==Sc){this._error($c)}};Kc.prototype._error=function(t){this.onerror(br[t]+": "+this.strm.msg,t);this.write_in_progress=false;if(this.pending_close)this.close()};var tf=Object.freeze({__proto__:null,DEFLATE:Mc,DEFLATERAW:Ic,GUNZIP:vc,GZIP:yc,INFLATE:mc,INFLATERAW:pc,NONE:gc,UNZIP:Lc,Z_BEST_COMPRESSION:Qc,Z_BEST_SPEED:Gc,Z_BINARY:Hc,Z_BLOCK:jc,Z_BUF_ERROR:Zc,Z_DATA_ERROR:Oc,Z_DEFAULT_COMPRESSION:Wc,Z_DEFAULT_STRATEGY:Jc,Z_DEFLATED:_c,Z_ERRNO:Ec,Z_FILTERED:Uc,Z_FINISH:kc,Z_FIXED:Bc,Z_FULL_FLUSH:Cc,Z_HUFFMAN_ONLY:Pc,Z_NEED_DICT:Ac,Z_NO_COMPRESSION:Rc,Z_NO_FLUSH:Dc,Z_OK:Sc,Z_PARTIAL_FLUSH:Nc,Z_RLE:Fc,Z_STREAM_END:Tc,Z_STREAM_ERROR:Yc,Z_SYNC_FLUSH:xc,Z_TEXT:Xc,Z_TREES:zc,Z_UNKNOWN:Vc,Zlib:Kc});function ef(t,i){if(!t){throw new Error(i)}}var nf={};Object.keys(tf).forEach((function(t){nf[t]=tf[t]}));nf.Z_MIN_WINDOWBITS=8;nf.Z_MAX_WINDOWBITS=15;nf.Z_DEFAULT_WINDOWBITS=15;nf.Z_MIN_CHUNK=64;nf.Z_MAX_CHUNK=Infinity;nf.Z_DEFAULT_CHUNK=16*1024;nf.Z_MIN_MEMLEVEL=1;nf.Z_MAX_MEMLEVEL=9;nf.Z_DEFAULT_MEMLEVEL=8;nf.Z_MIN_LEVEL=-1;nf.Z_MAX_LEVEL=9;nf.Z_DEFAULT_LEVEL=nf.Z_DEFAULT_COMPRESSION;var rf={Z_OK:nf.Z_OK,Z_STREAM_END:nf.Z_STREAM_END,Z_NEED_DICT:nf.Z_NEED_DICT,Z_ERRNO:nf.Z_ERRNO,Z_STREAM_ERROR:nf.Z_STREAM_ERROR,Z_DATA_ERROR:nf.Z_DATA_ERROR,Z_MEM_ERROR:nf.Z_MEM_ERROR,Z_BUF_ERROR:nf.Z_BUF_ERROR,Z_VERSION_ERROR:nf.Z_VERSION_ERROR};Object.keys(rf).forEach((function(t){rf[rf[t]]=t}));function sf(t){return new kf(t)}function af(t){return new jf(t)}function of(t){return new Tf(t)}function cf(t){return new Af(t)}function ff(t){return new zf(t)}function uf(t){return new Sf(t)}function lf(t){return new Ef(t)}function hf(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new kf(i),t,e)}function df(t,i){return Cf(new kf(i),t)}function wf(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new zf(i),t,e)}function bf(t,i){return Cf(new zf(i),t)}function gf(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new Tf(i),t,e)}function Mf(t,i){return Cf(new Tf(i),t)}function mf(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new Ef(i),t,e)}function yf(t,i){return Cf(new Ef(i),t)}function vf(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new jf(i),t,e)}function If(t,i){return Cf(new jf(i),t)}function pf(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new Sf(i),t,e)}function Lf(t,i){return Cf(new Sf(i),t)}function Df(t,i,e){if(typeof i==="function"){e=i;i={}}return xf(new Af(i),t,e)}function Nf(t,i){return Cf(new Af(i),t)}function xf(t,i,e){var n=[];var r=0;t.on("error",a);t.on("end",o);t.end(i);s();function s(){var i;while(null!==(i=t.read())){n.push(i);r+=i.length}t.once("readable",s)}function a(i){t.removeListener("end",o);t.removeListener("readable",s);e(i)}function o(){var i=k.concat(n,r);n=[];e(null,i);t.close()}}function Cf(t,i){if(typeof i==="string")i=new k(i);if(!k.isBuffer(i))throw new TypeError("Not a string or buffer");var e=nf.Z_FINISH;return t._processChunk(i,e)}function kf(t){if(!(this instanceof kf))return new kf(t);Yf.call(this,t,nf.DEFLATE)}function jf(t){if(!(this instanceof jf))return new jf(t);Yf.call(this,t,nf.INFLATE)}function zf(t){if(!(this instanceof zf))return new zf(t);Yf.call(this,t,nf.GZIP)}function Sf(t){if(!(this instanceof Sf))return new Sf(t);Yf.call(this,t,nf.GUNZIP)}function Tf(t){if(!(this instanceof Tf))return new Tf(t);Yf.call(this,t,nf.DEFLATERAW)}function Af(t){if(!(this instanceof Af))return new Af(t);Yf.call(this,t,nf.INFLATERAW)}function Ef(t){if(!(this instanceof Ef))return new Ef(t);Yf.call(this,t,nf.UNZIP)}function Yf(t,i){this._opts=t=t||{};this._chunkSize=t.chunkSize||nf.Z_DEFAULT_CHUNK;cr.call(this,t);if(t.flush){if(t.flush!==nf.Z_NO_FLUSH&&t.flush!==nf.Z_PARTIAL_FLUSH&&t.flush!==nf.Z_SYNC_FLUSH&&t.flush!==nf.Z_FULL_FLUSH&&t.flush!==nf.Z_FINISH&&t.flush!==nf.Z_BLOCK){throw new Error("Invalid flush flag: "+t.flush)}}this._flushFlag=t.flush||nf.Z_NO_FLUSH;if(t.chunkSize){if(t.chunkSize<nf.Z_MIN_CHUNK||t.chunkSize>nf.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+t.chunkSize)}}if(t.windowBits){if(t.windowBits<nf.Z_MIN_WINDOWBITS||t.windowBits>nf.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+t.windowBits)}}if(t.level){if(t.level<nf.Z_MIN_LEVEL||t.level>nf.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+t.level)}}if(t.memLevel){if(t.memLevel<nf.Z_MIN_MEMLEVEL||t.memLevel>nf.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+t.memLevel)}}if(t.strategy){if(t.strategy!=nf.Z_FILTERED&&t.strategy!=nf.Z_HUFFMAN_ONLY&&t.strategy!=nf.Z_RLE&&t.strategy!=nf.Z_FIXED&&t.strategy!=nf.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+t.strategy)}}if(t.dictionary){if(!k.isBuffer(t.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._binding=new nf.Zlib(i);var e=this;this._hadError=false;this._binding.onerror=function(t,i){e._binding=null;e._hadError=true;var n=new Error(t);n.errno=i;n.code=nf.codes[i];e.emit("error",n)};var n=nf.Z_DEFAULT_COMPRESSION;if(typeof t.level==="number")n=t.level;var r=nf.Z_DEFAULT_STRATEGY;if(typeof t.strategy==="number")r=t.strategy;this._binding.init(t.windowBits||nf.Z_DEFAULT_WINDOWBITS,n,t.memLevel||nf.Z_DEFAULT_MEMLEVEL,r,t.dictionary);this._buffer=new k(this._chunkSize);this._offset=0;this._closed=false;this._level=n;this._strategy=r;this.once("end",this.close)}Bi(Yf,cr);Yf.prototype.params=function(t,i,e){if(t<nf.Z_MIN_LEVEL||t>nf.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+t)}if(i!=nf.Z_FILTERED&&i!=nf.Z_HUFFMAN_ONLY&&i!=nf.Z_RLE&&i!=nf.Z_FIXED&&i!=nf.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+i)}if(this._level!==t||this._strategy!==i){var n=this;this.flush(nf.Z_SYNC_FLUSH,(function(){n._binding.params(t,i);if(!n._hadError){n._level=t;n._strategy=i;if(e)e()}}))}else{C.nextTick(e)}};Yf.prototype.reset=function(){return this._binding.reset()};Yf.prototype._flush=function(t){this._transform(new k(0),"",t)};Yf.prototype.flush=function(t,i){var e=this._writableState;if(typeof t==="function"||t===void 0&&!i){i=t;t=nf.Z_FULL_FLUSH}if(e.ended){if(i)C.nextTick(i)}else if(e.ending){if(i)this.once("end",i)}else if(e.needDrain){var n=this;this.once("drain",(function(){n.flush(i)}))}else{this._flushFlag=t;this.write(new k(0),"",i)}};Yf.prototype.close=function(t){if(t)C.nextTick(t);if(this._closed)return;this._closed=true;this._binding.close();var i=this;C.nextTick((function(){i.emit("close")}))};Yf.prototype._transform=function(t,i,e){var n;var r=this._writableState;var s=r.ending||r.ended;var a=s&&(!t||r.length===t.length);if(!t===null&&!k.isBuffer(t))return e(new Error("invalid input"));if(a)n=nf.Z_FINISH;else{n=this._flushFlag;if(t.length>=r.length){this._flushFlag=this._opts.flush||nf.Z_NO_FLUSH}}this._processChunk(t,n,e)};Yf.prototype._processChunk=function(t,i,e){var n=t&&t.length;var r=this._chunkSize-this._offset;var s=0;var a=this;var o=typeof e==="function";if(!o){var c=[];var f=0;var u;this.on("error",(function(t){u=t}));do{var l=this._binding.writeSync(i,t,s,n,this._buffer,this._offset,r)}while(!this._hadError&&w(l[0],l[1]));if(this._hadError){throw u}var h=k.concat(c,f);this.close();return h}var d=this._binding.write(i,t,s,n,this._buffer,this._offset,r);d.buffer=t;d.callback=w;function w(u,l){if(a._hadError)return;var h=r-l;ef(h>=0,"have should not go down");if(h>0){var d=a._buffer.slice(a._offset,a._offset+h);a._offset+=h;if(o){a.push(d)}else{c.push(d);f+=d.length}}if(l===0||a._offset>=a._chunkSize){r=a._chunkSize;a._offset=0;a._buffer=new k(a._chunkSize)}if(l===0){s+=n-u;n=u;if(!o)return true;var b=a._binding.write(i,t,s,n,a._buffer,a._offset,a._chunkSize);b.callback=w;b.buffer=t;return}if(!o)return false;e()}};Bi(kf,Yf);Bi(jf,Yf);Bi(zf,Yf);Bi(Sf,Yf);Bi(Tf,Yf);Bi(Af,Yf);Bi(Ef,Yf);var Of={codes:rf,createDeflate:sf,createInflate:af,createDeflateRaw:of,createInflateRaw:cf,createGzip:ff,createGunzip:uf,createUnzip:lf,deflate:hf,deflateSync:df,gzip:wf,gzipSync:bf,deflateRaw:gf,deflateRawSync:Mf,unzip:mf,unzipSync:yf,inflate:vf,inflateSync:If,gunzip:pf,gunzipSync:Lf,inflateRaw:Df,inflateRawSync:Nf,Deflate:kf,Inflate:jf,Gzip:zf,Gunzip:Sf,DeflateRaw:Tf,InflateRaw:Af,Unzip:Ef,Zlib:Yf};var Zf=Object.freeze({__proto__:null,Deflate:kf,DeflateRaw:Tf,Gunzip:Sf,Gzip:zf,Inflate:jf,InflateRaw:Af,Unzip:Ef,Zlib:Yf,codes:rf,createDeflate:sf,createDeflateRaw:of,createGunzip:uf,createGzip:ff,createInflate:af,createInflateRaw:cf,createUnzip:lf,default:Of,deflate:hf,deflateRaw:gf,deflateRawSync:Mf,deflateSync:df,gunzip:pf,gunzipSync:Lf,gzip:wf,gzipSync:bf,inflate:vf,inflateRaw:Df,inflateRawSync:Nf,inflateSync:If,unzip:mf,unzipSync:yf});var Rf=l(Zf);var Gf={exports:{}};var Qf;function Wf(){if(Qf)return Gf.exports;Qf=1;let t=Te;let i=dr;let e=Gf.exports=function(){i.call(this);this._buffers=[];this._buffered=0;this._reads=[];this._paused=false;this._encoding="utf8";this.writable=true};t.inherits(e,i);e.prototype.read=function(t,i){this._reads.push({length:Math.abs(t),allowLess:t<0,func:i});C.nextTick(function(){this._process();if(this._paused&&this._reads&&this._reads.length>0){this._paused=false;this.emit("drain")}}.bind(this))};e.prototype.write=function(t,i){if(!this.writable){this.emit("error",new Error("Stream not writable"));return false}let e;if(k.isBuffer(t)){e=t}else{e=k.from(t,i||this._encoding)}this._buffers.push(e);this._buffered+=e.length;this._process();if(this._reads&&this._reads.length===0){this._paused=true}return this.writable&&!this._paused};e.prototype.end=function(t,i){if(t){this.write(t,i)}this.writable=false;if(!this._buffers){return}if(this._buffers.length===0){this._end()}else{this._buffers.push(null);this._process()}};e.prototype.destroySoon=e.prototype.end;e.prototype._end=function(){if(this._reads.length>0){this.emit("error",new Error("Unexpected end of input"))}this.destroy()};e.prototype.destroy=function(){if(!this._buffers){return}this.writable=false;this._reads=null;this._buffers=null;this.emit("close")};e.prototype._processReadAllowingLess=function(t){this._reads.shift();let i=this._buffers[0];if(i.length>t.length){this._buffered-=t.length;this._buffers[0]=i.slice(t.length);t.func.call(this,i.slice(0,t.length))}else{this._buffered-=i.length;this._buffers.shift();t.func.call(this,i)}};e.prototype._processRead=function(t){this._reads.shift();let i=0;let e=0;let n=k.alloc(t.length);while(i<t.length){let r=this._buffers[e++];let s=Math.min(r.length,t.length-i);r.copy(n,i,0,s);i+=s;if(s!==r.length){this._buffers[--e]=r.slice(s)}}if(e>0){this._buffers.splice(0,e)}this._buffered-=t.length;t.func.call(this,n)};e.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 Gf.exports}var Uf={exports:{}};var Pf={exports:{}};var Ff={};var Bf;function Jf(){if(Bf)return Ff;Bf=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]}];Ff.getImagePasses=function(i,e){let n=[];let r=i%8;let s=e%8;let a=(i-r)/8;let o=(e-s)/8;for(let i=0;i<t.length;i++){let e=t[i];let c=a*e.x.length;let f=o*e.y.length;for(let t=0;t<e.x.length;t++){if(e.x[t]<r){c++}else{break}}for(let t=0;t<e.y.length;t++){if(e.y[t]<s){f++}else{break}}if(c>0&&f>0){n.push({width:c,height:f,index:i})}}return n};Ff.getInterlaceIterator=function(i){return function(e,n,r){let s=e%t[r].x.length;let a=(e-s)/t[r].x.length*8+t[r].x[s];let o=n%t[r].y.length;let c=(n-o)/t[r].y.length*8+t[r].y[o];return a*4+c*i*4}};return Ff}var Hf;var Xf;function Vf(){if(Xf)return Hf;Xf=1;Hf=function t(i,e,n){let r=i+e-n;let s=Math.abs(r-i);let a=Math.abs(r-e);let o=Math.abs(r-n);if(s<=a&&s<=o){return i}if(a<=o){return e}return n};return Hf}var _f;function Kf(){if(_f)return Pf.exports;_f=1;let t=Jf();let i=Vf();function e(t,i,e){let n=t*i;if(e!==8){n=Math.ceil(n/(8/e))}return n}let n=Pf.exports=function(i,n){let r=i.width;let s=i.height;let a=i.interlace;let o=i.bpp;let c=i.depth;this.read=n.read;this.write=n.write;this.complete=n.complete;this._imageIndex=0;this._images=[];if(a){let i=t.getImagePasses(r,s);for(let t=0;t<i.length;t++){this._images.push({byteWidth:e(i[t].width,o,c),height:i[t].height,lineIndex:0})}}else{this._images.push({byteWidth:e(r,o,c),height:s,lineIndex:0})}if(c===8){this._xComparison=o}else if(c===16){this._xComparison=o*2}else{this._xComparison=1}};n.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))};n.prototype._unFilterType1=function(t,i,e){let n=this._xComparison;let r=n-1;for(let s=0;s<e;s++){let e=t[1+s];let a=s>r?i[s-n]:0;i[s]=e+a}};n.prototype._unFilterType2=function(t,i,e){let n=this._lastLine;for(let r=0;r<e;r++){let e=t[1+r];let s=n?n[r]:0;i[r]=e+s}};n.prototype._unFilterType3=function(t,i,e){let n=this._xComparison;let r=n-1;let s=this._lastLine;for(let a=0;a<e;a++){let e=t[1+a];let o=s?s[a]:0;let c=a>r?i[a-n]:0;let f=Math.floor((c+o)/2);i[a]=e+f}};n.prototype._unFilterType4=function(t,e,n){let r=this._xComparison;let s=r-1;let a=this._lastLine;for(let o=0;o<n;o++){let n=t[1+o];let c=a?a[o]:0;let f=o>s?e[o-r]:0;let u=o>s&&a?a[o-r]:0;let l=i(f,c,u);e[o]=n+l}};n.prototype._reverseFilterLine=function(t){let i=t[0];let e;let n=this._images[this._imageIndex];let r=n.byteWidth;if(i===0){e=t.slice(1,r+1)}else{e=k.alloc(r);switch(i){case 1:this._unFilterType1(t,e,r);break;case 2:this._unFilterType2(t,e,r);break;case 3:this._unFilterType3(t,e,r);break;case 4:this._unFilterType4(t,e,r);break;default:throw new Error("Unrecognised filter type - "+i)}}this.write(e);n.lineIndex++;if(n.lineIndex>=n.height){this._lastLine=null;this._imageIndex++;n=this._images[this._imageIndex]}else{this._lastLine=e}if(n){this.read(n.byteWidth+1,this._reverseFilterLine.bind(this))}else{this._lastLine=null;this.complete()}};return Pf.exports}var qf;function $f(){if(qf)return Uf.exports;qf=1;let t=Te;let i=Wf();let e=Kf();let n=Uf.exports=function(t){i.call(this);let n=[];let r=this;this._filter=new e(t,{read:this.read.bind(this),write:function(t){n.push(t)},complete:function(){r.emit("complete",k.concat(n))}});this._filter.start()};t.inherits(n,i);return Uf.exports}var tu={exports:{}};var iu;var eu;function nu(){if(eu)return iu;eu=1;iu={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 iu}var ru={exports:{}};var su;function au(){if(su)return ru.exports;su=1;let t=[];(function(){for(let i=0;i<256;i++){let e=i;for(let t=0;t<8;t++){if(e&1){e=3988292384^e>>>1}else{e=e>>>1}}t[i]=e}})();let i=ru.exports=function(){this._crc=-1};i.prototype.write=function(i){for(let e=0;e<i.length;e++){this._crc=t[(this._crc^i[e])&255]^this._crc>>>8}return true};i.prototype.crc32=function(){return this._crc^-1};i.crc32=function(i){let e=-1;for(let n=0;n<i.length;n++){e=t[(e^i[n])&255]^e>>>8}return e^-1};return ru.exports}var ou;function cu(){if(ou)return tu.exports;ou=1;let t=nu();let i=au();let e=tu.exports=function(i,e){this._options=i;i.checkCRC=i.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=e.read;this.error=e.error;this.metadata=e.metadata;this.gamma=e.gamma;this.transColor=e.transColor;this.palette=e.palette;this.parsed=e.parsed;this.inflateData=e.inflateData;this.finished=e.finished;this.simpleTransparency=e.simpleTransparency;this.headersFinished=e.headersFinished||function(){}};e.prototype.start=function(){this.read(t.PNG_SIGNATURE.length,this._parseSignature.bind(this))};e.prototype._parseSignature=function(i){let e=t.PNG_SIGNATURE;for(let t=0;t<e.length;t++){if(i[t]!==e[t]){this.error(new Error("Invalid file signature"));return}}this.read(8,this._parseChunkBegin.bind(this))};e.prototype._parseChunkBegin=function(e){let n=e.readUInt32BE(0);let r=e.readUInt32BE(4);let s="";for(let t=4;t<8;t++){s+=String.fromCharCode(e[t])}let a=Boolean(e[4]&32);if(!this._hasIHDR&&r!==t.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}this._crc=new i;this._crc.write(k.from(s));if(this._chunks[r]){return this._chunks[r](n)}if(!a){this.error(new Error("Unsupported critical chunk type "+s));return}this.read(n+4,this._skipChunk.bind(this))};e.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))};e.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))};e.prototype._parseChunkEnd=function(t){let i=t.readInt32BE(0);let e=this._crc.crc32();if(this._options.checkCRC&&e!==i){this.error(new Error("Crc error - "+i+" - "+e));return}if(!this._hasIEND){this.read(8,this._parseChunkBegin.bind(this))}};e.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))};e.prototype._parseIHDR=function(i){this._crc.write(i);let e=i.readUInt32BE(0);let n=i.readUInt32BE(4);let r=i[8];let s=i[9];let a=i[10];let o=i[11];let c=i[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(s in t.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(a!==0){this.error(new Error("Unsupported compression method"));return}if(o!==0){this.error(new Error("Unsupported filter method"));return}if(c!==0&&c!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=s;let f=t.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=true;this.metadata({width:e,height:n,depth:r,interlace:Boolean(c),palette:Boolean(s&t.COLORTYPE_PALETTE),color:Boolean(s&t.COLORTYPE_COLOR),alpha:Boolean(s&t.COLORTYPE_ALPHA),bpp:f,colorType:s});this._handleChunkEnd()};e.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))};e.prototype._parsePLTE=function(t){this._crc.write(t);let i=Math.floor(t.length/3);for(let e=0;e<i;e++){this._palette.push([t[e*3],t[e*3+1],t[e*3+2],255])}this.palette(this._palette);this._handleChunkEnd()};e.prototype._handleTRNS=function(t){this.simpleTransparency();this.read(t,this._parseTRNS.bind(this))};e.prototype._parseTRNS=function(i){this._crc.write(i);if(this._colorType===t.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(i.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let t=0;t<i.length;t++){this._palette[t][3]=i[t]}this.palette(this._palette)}if(this._colorType===t.COLORTYPE_GRAYSCALE){this.transColor([i.readUInt16BE(0)])}if(this._colorType===t.COLORTYPE_COLOR){this.transColor([i.readUInt16BE(0),i.readUInt16BE(2),i.readUInt16BE(4)])}this._handleChunkEnd()};e.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))};e.prototype._parseGAMA=function(i){this._crc.write(i);this.gamma(i.readUInt32BE(0)/t.GAMMA_DIVISION);this._handleChunkEnd()};e.prototype._handleIDAT=function(t){if(!this._emittedHeadersFinished){this._emittedHeadersFinished=true;this.headersFinished()}this.read(-t,this._parseIDAT.bind(this,t))};e.prototype._parseIDAT=function(i,e){this._crc.write(e);if(this._colorType===t.COLORTYPE_PALETTE_COLOR&&this._palette.length===0){throw new Error("Expected palette not found")}this.inflateData(e);let n=i-e.length;if(n>0){this._handleIDAT(n)}else{this._handleChunkEnd()}};e.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};e.prototype._parseIEND=function(t){this._crc.write(t);this._hasIEND=true;this._handleChunkEnd();if(this.finished){this.finished()}};return tu.exports}var fu={};var uu;function lu(){if(uu)return fu;uu=1;let t=Jf();let i=[function(){},function(t,i,e,n){if(n===i.length){throw new Error("Ran out of data")}let r=i[n];t[e]=r;t[e+1]=r;t[e+2]=r;t[e+3]=255},function(t,i,e,n){if(n+1>=i.length){throw new Error("Ran out of data")}let r=i[n];t[e]=r;t[e+1]=r;t[e+2]=r;t[e+3]=i[n+1]},function(t,i,e,n){if(n+2>=i.length){throw new Error("Ran out of data")}t[e]=i[n];t[e+1]=i[n+1];t[e+2]=i[n+2];t[e+3]=255},function(t,i,e,n){if(n+3>=i.length){throw new Error("Ran out of data")}t[e]=i[n];t[e+1]=i[n+1];t[e+2]=i[n+2];t[e+3]=i[n+3]}];let e=[function(){},function(t,i,e,n){let r=i[0];t[e]=r;t[e+1]=r;t[e+2]=r;t[e+3]=n},function(t,i,e){let n=i[0];t[e]=n;t[e+1]=n;t[e+2]=n;t[e+3]=i[1]},function(t,i,e,n){t[e]=i[0];t[e+1]=i[1];t[e+2]=i[2];t[e+3]=n},function(t,i,e){t[e]=i[0];t[e+1]=i[1];t[e+2]=i[2];t[e+3]=i[3]}];function n(t,i){let e=[];let n=0;function r(){if(n===t.length){throw new Error("Ran out of data")}let r=t[n];n++;let s,a,o,c,f,u,l,h;switch(i){default:throw new Error("unrecognised depth");case 16:l=t[n];n++;e.push((r<<8)+l);break;case 4:l=r&15;h=r>>4;e.push(h,l);break;case 2:f=r&3;u=r>>2&3;l=r>>4&3;h=r>>6&3;e.push(h,l,u,f);break;case 1:s=r&1;a=r>>1&1;o=r>>2&1;c=r>>3&1;f=r>>4&1;u=r>>5&1;l=r>>6&1;h=r>>7&1;e.push(h,l,u,f,c,o,a,s);break}}return{get:function(t){while(e.length<t){r()}let i=e.slice(0,t);e=e.slice(t);return i},resetAfterLine:function(){e.length=0},end:function(){if(n!==t.length){throw new Error("extra data found")}}}}function r(t,e,n,r,s,a){let o=t.width;let c=t.height;let f=t.index;for(let t=0;t<c;t++){for(let c=0;c<o;c++){let o=n(c,t,f);i[r](e,s,o,a);a+=r}}return a}function s(t,i,n,r,s,a){let o=t.width;let c=t.height;let f=t.index;for(let t=0;t<c;t++){for(let c=0;c<o;c++){let o=s.get(r);let u=n(c,t,f);e[r](i,o,u,a)}s.resetAfterLine()}}fu.dataToBitMap=function(i,e){let a=e.width;let o=e.height;let c=e.depth;let f=e.bpp;let u=e.interlace;let l;if(c!==8){l=n(i,c)}let h;if(c<=8){h=k.alloc(a*o*4)}else{h=new Uint16Array(a*o*4)}let d=Math.pow(2,c)-1;let w=0;let b;let g;if(u){b=t.getImagePasses(a,o);g=t.getInterlaceIterator(a,o)}else{let t=0;g=function(){let i=t;t+=4;return i};b=[{width:a,height:o}]}for(let t=0;t<b.length;t++){if(c===8){w=r(b[t],h,g,f,i,w)}else{s(b[t],h,g,f,l,d)}}if(c===8){if(w!==i.length){throw new Error("extra data found")}}else{l.end()}return h};return fu}var hu;var du;function wu(){if(du)return hu;du=1;function t(t,i,e,n,r){let s=0;for(let a=0;a<n;a++){for(let n=0;n<e;n++){let e=r[t[s]];if(!e){throw new Error("index "+t[s]+" not in palette")}for(let t=0;t<4;t++){i[s+t]=e[t]}s+=4}}}function i(t,i,e,n,r){let s=0;for(let a=0;a<n;a++){for(let n=0;n<e;n++){let e=false;if(r.length===1){if(r[0]===t[s]){e=true}}else if(r[0]===t[s]&&r[1]===t[s+1]&&r[2]===t[s+2]){e=true}if(e){for(let t=0;t<4;t++){i[s+t]=0}}s+=4}}}function e(t,i,e,n,r){let s=255;let a=Math.pow(2,r)-1;let o=0;for(let r=0;r<n;r++){for(let n=0;n<e;n++){for(let e=0;e<4;e++){i[o+e]=Math.floor(t[o+e]*s/a+.5)}o+=4}}}hu=function(n,r){let s=r.depth;let a=r.width;let o=r.height;let c=r.colorType;let f=r.transColor;let u=r.palette;let l=n;if(c===3){t(n,l,a,o,u)}else{if(f){i(n,l,a,o,f)}if(s!==8){if(s===16){l=k.alloc(a*o*4)}e(n,l,a,o,s)}}return l};return hu}var bu;function gu(){if(bu)return wr.exports;bu=1;let t=Te;let i=Rf;let e=Wf();let n=$f();let r=cu();let s=lu();let a=wu();let o=wr.exports=function(t){e.call(this);this._parser=new r(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(o,e);o.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};o.prototype._inflateData=function(t){if(!this._inflate){if(this._bitmapInfo.interlace){this._inflate=i.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 e=t*this._bitmapInfo.height;let n=Math.max(e,i.Z_MIN_CHUNK);this._inflate=i.createInflate({chunkSize:n});let r=e;let s=this.emit.bind(this,"error");this._inflate.on("error",(function(t){if(!r){return}s(t)}));this._filter.on("complete",this._complete.bind(this));let a=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){if(!r){return}if(t.length>r){t=t.slice(0,r)}r-=t.length;a(t)}));this._inflate.on("end",this._filter.end.bind(this._filter))}}this._inflate.write(t)};o.prototype._handleMetaData=function(t){this._metaData=t;this._bitmapInfo=Object.create(t);this._filter=new n(this._bitmapInfo)};o.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};o.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};o.prototype._simpleTransparency=function(){this._metaData.alpha=true};o.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};o.prototype._finished=function(){if(this.errord){return}if(!this._inflate){this.emit("error","No Inflate block")}else{this._inflate.end()}};o.prototype._complete=function(t){if(this.errord){return}let i;try{let e=s.dataToBitMap(t,this._bitmapInfo);i=a(e,this._bitmapInfo);e=null}catch(t){this._handleError(t);return}this.emit("parsed",i)};return wr.exports}var Mu={exports:{}};var mu={exports:{}};var yu;var vu;function Iu(){if(vu)return yu;vu=1;let t=nu();yu=function(i,e,n,r){let s=[t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let t=function(){let t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,true);return new Int16Array(t)[0]!==256}();if(r.bitDepth===8||r.bitDepth===16&&t){return i}}let a=r.bitDepth!==16?i:new Uint16Array(i.buffer);let o=255;let c=t.COLORTYPE_TO_BPP_MAP[r.inputColorType];if(c===4&&!r.inputHasAlpha){c=3}let f=t.COLORTYPE_TO_BPP_MAP[r.colorType];if(r.bitDepth===16){o=65535;f*=2}let u=k.alloc(e*n*f);let l=0;let h=0;let d=r.bgColor||{};if(d.red===undefined){d.red=o}if(d.green===undefined){d.green=o}if(d.blue===undefined){d.blue=o}function w(){let i;let e;let n;let c=o;switch(r.inputColorType){case t.COLORTYPE_COLOR_ALPHA:c=a[l+3];i=a[l];e=a[l+1];n=a[l+2];break;case t.COLORTYPE_COLOR:i=a[l];e=a[l+1];n=a[l+2];break;case t.COLORTYPE_ALPHA:c=a[l+1];i=a[l];e=i;n=i;break;case t.COLORTYPE_GRAYSCALE:i=a[l];e=i;n=i;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}if(r.inputHasAlpha){if(!s){c/=o;i=Math.min(Math.max(Math.round((1-c)*d.red+c*i),0),o);e=Math.min(Math.max(Math.round((1-c)*d.green+c*e),0),o);n=Math.min(Math.max(Math.round((1-c)*d.blue+c*n),0),o)}}return{red:i,green:e,blue:n,alpha:c}}for(let i=0;i<n;i++){for(let i=0;i<e;i++){let i=w();switch(r.colorType){case t.COLORTYPE_COLOR_ALPHA:case t.COLORTYPE_COLOR:if(r.bitDepth===8){u[h]=i.red;u[h+1]=i.green;u[h+2]=i.blue;if(s){u[h+3]=i.alpha}}else{u.writeUInt16BE(i.red,h);u.writeUInt16BE(i.green,h+2);u.writeUInt16BE(i.blue,h+4);if(s){u.writeUInt16BE(i.alpha,h+6)}}break;case t.COLORTYPE_ALPHA:case t.COLORTYPE_GRAYSCALE:{let t=(i.red+i.green+i.blue)/3;if(r.bitDepth===8){u[h]=t;if(s){u[h+1]=i.alpha}}else{u.writeUInt16BE(t,h);if(s){u.writeUInt16BE(i.alpha,h+2)}}break}default:throw new Error("unrecognised color Type "+r.colorType)}l+=c;h+=f}}return u};return yu}var pu;var Lu;function Du(){if(Lu)return pu;Lu=1;let t=Vf();function i(t,i,e,n,r){for(let s=0;s<e;s++){n[r+s]=t[i+s]}}function e(t,i,e){let n=0;let r=i+e;for(let e=i;e<r;e++){n+=Math.abs(t[e])}return n}function n(t,i,e,n,r,s){for(let a=0;a<e;a++){let e=a>=s?t[i+a-s]:0;let o=t[i+a]-e;n[r+a]=o}}function r(t,i,e,n){let r=0;for(let s=0;s<e;s++){let e=s>=n?t[i+s-n]:0;let a=t[i+s]-e;r+=Math.abs(a)}return r}function s(t,i,e,n,r){for(let s=0;s<e;s++){let a=i>0?t[i+s-e]:0;let o=t[i+s]-a;n[r+s]=o}}function a(t,i,e){let n=0;let r=i+e;for(let s=i;s<r;s++){let r=i>0?t[s-e]:0;let a=t[s]-r;n+=Math.abs(a)}return n}function o(t,i,e,n,r,s){for(let a=0;a<e;a++){let o=a>=s?t[i+a-s]:0;let c=i>0?t[i+a-e]:0;let f=t[i+a]-(o+c>>1);n[r+a]=f}}function c(t,i,e,n){let r=0;for(let s=0;s<e;s++){let a=s>=n?t[i+s-n]:0;let o=i>0?t[i+s-e]:0;let c=t[i+s]-(a+o>>1);r+=Math.abs(c)}return r}function f(i,e,n,r,s,a){for(let o=0;o<n;o++){let c=o>=a?i[e+o-a]:0;let f=e>0?i[e+o-n]:0;let u=e>0&&o>=a?i[e+o-(n+a)]:0;let l=i[e+o]-t(c,f,u);r[s+o]=l}}function u(i,e,n,r){let s=0;for(let a=0;a<n;a++){let o=a>=r?i[e+a-r]:0;let c=e>0?i[e+a-n]:0;let f=e>0&&a>=r?i[e+a-(n+r)]:0;let u=i[e+a]-t(o,c,f);s+=Math.abs(u)}return s}let l={0:i,1:n,2:s,3:o,4:f};let h={0:e,1:r,2:a,3:c,4:u};pu=function(t,i,e,n,r){let s;if(!("filterType"in n)||n.filterType===-1){s=[0,1,2,3,4]}else if(typeof n.filterType==="number"){s=[n.filterType]}else{throw new Error("unrecognised filter types")}if(n.bitDepth===16){r*=2}let a=i*r;let o=0;let c=0;let f=k.alloc((a+1)*e);let u=s[0];for(let i=0;i<e;i++){if(s.length>1){let i=Infinity;for(let e=0;e<s.length;e++){let n=h[s[e]](t,c,a,r);if(n<i){u=s[e];i=n}}}f[o]=u;o++;l[u](t,c,a,f,o,r);o+=a;c+=a}return f};return pu}var Nu;function xu(){if(Nu)return mu.exports;Nu=1;let t=nu();let i=au();let e=Iu();let n=Du();let r=Rf;let s=mu.exports=function(i){this._options=i;i.deflateChunkSize=i.deflateChunkSize||32*1024;i.deflateLevel=i.deflateLevel!=null?i.deflateLevel:9;i.deflateStrategy=i.deflateStrategy!=null?i.deflateStrategy:3;i.inputHasAlpha=i.inputHasAlpha!=null?i.inputHasAlpha:true;i.deflateFactory=i.deflateFactory||r.createDeflate;i.bitDepth=i.bitDepth||8;i.colorType=typeof i.colorType==="number"?i.colorType:t.COLORTYPE_COLOR_ALPHA;i.inputColorType=typeof i.inputColorType==="number"?i.inputColorType:t.COLORTYPE_COLOR_ALPHA;if([t.COLORTYPE_GRAYSCALE,t.COLORTYPE_COLOR,t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(i.colorType)===-1){throw new Error("option color type:"+i.colorType+" is not supported at present")}if([t.COLORTYPE_GRAYSCALE,t.COLORTYPE_COLOR,t.COLORTYPE_COLOR_ALPHA,t.COLORTYPE_ALPHA].indexOf(i.inputColorType)===-1){throw new Error("option input color type:"+i.inputColorType+" is not supported at present")}if(i.bitDepth!==8&&i.bitDepth!==16){throw new Error("option bit depth:"+i.bitDepth+" is not supported at present")}};s.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};s.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};s.prototype.filterData=function(i,r,s){let a=e(i,r,s,this._options);let o=t.COLORTYPE_TO_BPP_MAP[this._options.colorType];let c=n(a,r,s,this._options,o);return c};s.prototype._packChunk=function(t,e){let n=e?e.length:0;let r=k.alloc(n+12);r.writeUInt32BE(n,0);r.writeUInt32BE(t,4);if(e){e.copy(r,8)}r.writeInt32BE(i.crc32(r.slice(4,r.length-4)),r.length-4);return r};s.prototype.packGAMA=function(i){let e=k.alloc(4);e.writeUInt32BE(Math.floor(i*t.GAMMA_DIVISION),0);return this._packChunk(t.TYPE_gAMA,e)};s.prototype.packIHDR=function(i,e){let n=k.alloc(13);n.writeUInt32BE(i,0);n.writeUInt32BE(e,4);n[8]=this._options.bitDepth;n[9]=this._options.colorType;n[10]=0;n[11]=0;n[12]=0;return this._packChunk(t.TYPE_IHDR,n)};s.prototype.packIDAT=function(i){return this._packChunk(t.TYPE_IDAT,i)};s.prototype.packIEND=function(){return this._packChunk(t.TYPE_IEND,null)};return mu.exports}var Cu;function ku(){if(Cu)return Mu.exports;Cu=1;let t=Te;let i=dr;let e=nu();let n=xu();let r=Mu.exports=function(t){i.call(this);let e=t||{};this._packer=new n(e);this._deflate=this._packer.createDeflate();this.readable=true};t.inherits(r,i);r.prototype.pack=function(t,i,n,r){this.emit("data",k.from(e.PNG_SIGNATURE));this.emit("data",this._packer.packIHDR(i,n));if(r){this.emit("data",this._packer.packGAMA(r))}let s=this._packer.filterData(t,i,n);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(s)};return Mu.exports}var ju={};var zu={exports:{}};function Su(t,i){if(t===i){return 0}var e=t.length;var n=i.length;for(var r=0,s=Math.min(e,n);r<s;++r){if(t[r]!==i[r]){e=t[r];n=i[r];break}}if(e<n){return-1}if(n<e){return 1}return 0}var Tu=Object.prototype.hasOwnProperty;var Au=Object.keys||function(t){var i=[];for(var e in t){if(Tu.call(t,e))i.push(e)}return i};var Eu=Array.prototype.slice;var Yu;function Ou(){if(typeof Yu!=="undefined"){return Yu}return Yu=function(){return function t(){}.name==="foo"}()}function Zu(t){return Object.prototype.toString.call(t)}function Ru(t){if(T(t)){return false}if(typeof j.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 Gu(t,i){if(!t)Ju(t,true,i,"==",Hu)}var Qu=/\s*function\s+([^\(\s]*)\s*/;function Wu(t){if(!ve(t)){return}if(Ou()){return t.name}var i=t.toString();var e=i.match(Qu);return e&&e[1]}Gu.AssertionError=Uu;function Uu(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=Bu(this);this.generatedMessage=true}var i=t.stackStartFunction||Ju;if(Error.captureStackTrace){Error.captureStackTrace(this,i)}else{var e=new Error;if(e.stack){var n=e.stack;var r=Wu(i);var s=n.indexOf("\n"+r);if(s>=0){var a=n.indexOf("\n",s+1);n=n.substring(a+1)}this.stack=n}}}Bi(Uu,Error);function Pu(t,i){if(typeof t==="string"){return t.length<i?t:t.slice(0,i)}else{return t}}function Fu(t){if(Ou()||!ve(t)){return qi(t)}var i=Wu(t);var e=i?": "+i:"";return"[Function"+e+"]"}function Bu(t){return Pu(Fu(t.actual),128)+" "+t.operator+" "+Pu(Fu(t.expected),128)}function Ju(t,i,e,n,r){throw new Uu({message:e,actual:t,expected:i,operator:n,stackStartFunction:r})}Gu.fail=Ju;function Hu(t,i){if(!t)Ju(t,true,i,"==",Hu)}Gu.ok=Hu;Gu.equal=Xu;function Xu(t,i,e){if(t!=i)Ju(t,i,e,"==",Xu)}Gu.notEqual=Vu;function Vu(t,i,e){if(t==i){Ju(t,i,e,"!=",Vu)}}Gu.deepEqual=_u;function _u(t,i,e){if(!qu(t,i,false)){Ju(t,i,e,"deepEqual",_u)}}Gu.deepStrictEqual=Ku;function Ku(t,i,e){if(!qu(t,i,true)){Ju(t,i,e,"deepStrictEqual",Ku)}}function qu(t,i,e,n){if(t===i){return true}else if(T(t)&&T(i)){return Su(t,i)===0}else if(me(t)&&me(i)){return t.getTime()===i.getTime()}else if(ge(t)&&ge(i)){return t.source===i.source&&t.global===i.global&&t.multiline===i.multiline&&t.lastIndex===i.lastIndex&&t.ignoreCase===i.ignoreCase}else if((t===null||typeof t!=="object")&&(i===null||typeof i!=="object")){return e?t===i:t==i}else if(Ru(t)&&Ru(i)&&Zu(t)===Zu(i)&&!(t instanceof Float32Array||t instanceof Float64Array)){return Su(new Uint8Array(t.buffer),new Uint8Array(i.buffer))===0}else if(T(t)!==T(i)){return false}else{n=n||{actual:[],expected:[]};var r=n.actual.indexOf(t);if(r!==-1){if(r===n.expected.indexOf(i)){return true}}n.actual.push(t);n.expected.push(i);return tl(t,i,e,n)}}function $u(t){return Object.prototype.toString.call(t)=="[object Arguments]"}function tl(t,i,e,n){if(t===null||t===undefined||i===null||i===undefined)return false;if(Ie(t)||Ie(i))return t===i;if(e&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(i))return false;var r=$u(t);var s=$u(i);if(r&&!s||!r&&s)return false;if(r){t=Eu.call(t);i=Eu.call(i);return qu(t,i,e)}var a=Au(t);var o=Au(i);var c,f;if(a.length!==o.length)return false;a.sort();o.sort();for(f=a.length-1;f>=0;f--){if(a[f]!==o[f])return false}for(f=a.length-1;f>=0;f--){c=a[f];if(!qu(t[c],i[c],e,n))return false}return true}Gu.notDeepEqual=il;function il(t,i,e){if(qu(t,i,false)){Ju(t,i,e,"notDeepEqual",il)}}Gu.notDeepStrictEqual=el;function el(t,i,e){if(qu(t,i,true)){Ju(t,i,e,"notDeepStrictEqual",el)}}Gu.strictEqual=nl;function nl(t,i,e){if(t!==i){Ju(t,i,e,"===",nl)}}Gu.notStrictEqual=rl;function rl(t,i,e){if(t===i){Ju(t,i,e,"!==",rl)}}function sl(t,i){if(!t||!i){return false}if(Object.prototype.toString.call(i)=="[object RegExp]"){return i.test(t)}try{if(t instanceof i){return true}}catch(t){}if(Error.isPrototypeOf(i)){return false}return i.call({},t)===true}function al(t){var i;try{t()}catch(t){i=t}return i}function ol(t,i,e,n){var r;if(typeof i!=="function"){throw new TypeError('"block" argument must be a function')}if(typeof e==="string"){n=e;e=null}r=al(i);n=(e&&e.name?" ("+e.name+").":".")+(n?" "+n:".");if(t&&!r){Ju(r,e,"Missing expected exception"+n)}var s=typeof n==="string";var a=!t&&ye(r);var o=!t&&r&&!e;if(a&&s&&sl(r,e)||o){Ju(r,e,"Got unwanted exception"+n)}if(t&&r&&e&&!sl(r,e)||!t&&r){throw r}}Gu.throws=cl;function cl(t,i,e){ol(true,t,i,e)}Gu.doesNotThrow=fl;function fl(t,i,e){ol(false,t,i,e)}Gu.ifError=ul;function ul(t){if(t)throw t}var ll=Object.freeze({__proto__:null,AssertionError:Uu,assert:Hu,deepEqual:_u,deepStrictEqual:Ku,default:Gu,doesNotThrow:fl,equal:Xu,fail:Ju,ifError:ul,notDeepEqual:il,notDeepStrictEqual:el,notEqual:Vu,notStrictEqual:rl,ok:Hu,strictEqual:nl,throws:cl});var hl=l(ll);var dl;function wl(){if(dl)return zu.exports;dl=1;(function(t,i){let e=hl.ok;let n=Rf;let r=Te;let s=qe.kMaxLength;function a(t){if(!(this instanceof a)){return new a(t)}if(t&&t.chunkSize<n.Z_MIN_CHUNK){t.chunkSize=n.Z_MIN_CHUNK}n.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 o(t){return new a(t)}function c(t,i){if(!t._handle){return}t._handle.close();t._handle=null}a.prototype._processChunk=function(t,i,r){if(typeof r==="function"){return n.Inflate._processChunk.call(this,t,i,r)}let a=this;let o=t&&t.length;let f=this._chunkSize-this._offset;let u=this._maxLength;let l=0;let h=[];let d=0;let w;this.on("error",(function(t){w=t}));function b(t,i){if(a._hadError){return}let n=f-i;e(n>=0,"have should not go down");if(n>0){let t=a._buffer.slice(a._offset,a._offset+n);a._offset+=n;if(t.length>u){t=t.slice(0,u)}h.push(t);d+=t.length;u-=t.length;if(u===0){return false}}if(i===0||a._offset>=a._chunkSize){f=a._chunkSize;a._offset=0;a._buffer=k.allocUnsafe(a._chunkSize)}if(i===0){l+=o-t;o=t;return true}return false}e(this._handle,"zlib binding closed");let g;do{g=this._handle.writeSync(i,t,l,o,this._buffer,this._offset,f);g=g||this._writeState}while(!this._hadError&&b(g[0],g[1]));if(this._hadError){throw w}if(d>=s){c(this);throw new RangeError("Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes")}let M=k.concat(h,d);c(this);return M};r.inherits(a,n.Inflate);function f(t,i){if(typeof i==="string"){i=k.from(i)}if(!(i instanceof k)){throw new TypeError("Not a string or buffer")}let e=t._finishFlushFlag;if(e==null){e=n.Z_FINISH}return t._processChunk(i,e)}function u(t,i){return f(new a(i),t)}t.exports=i=u;i.Inflate=a;i.createInflate=o;i.inflateSync=u})(zu,zu.exports);return zu.exports}var bl={exports:{}};var gl;function Ml(){if(gl)return bl.exports;gl=1;let t=bl.exports=function(t){this._buffer=t;this._reads=[]};t.prototype.read=function(t,i){this._reads.push({length:Math.abs(t),allowLess:t<0,func:i})};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 i=this._buffer;this._buffer=i.slice(t.length);t.func.call(this,i.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 bl.exports}var ml={};var yl;function vl(){if(yl)return ml;yl=1;let t=Ml();let i=Kf();ml.process=function(e,n){let r=[];let s=new t(e);let a=new i(n,{read:s.read.bind(s),write:function(t){r.push(t)},complete:function(){}});a.start();s.process();return k.concat(r)};return ml}var Il;var pl;function Ll(){if(pl)return Il;pl=1;let t=true;let i=Rf;let e=wl();if(!i.deflateSync){t=false}let n=Ml();let r=vl();let s=cu();let a=lu();let o=wu();Il=function(c,f){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 u;function l(t){u=t}let h;function d(t){h=t}function w(t){h.transColor=t}function b(t){h.palette=t}function g(){h.alpha=true}let M;function m(t){M=t}let y=[];function v(t){y.push(t)}let I=new n(c);let p=new s(f,{read:I.read.bind(I),error:l,metadata:d,gamma:m,palette:b,transColor:w,inflateData:v,simpleTransparency:g});p.start();I.process();if(u){throw u}let L=k.concat(y);y.length=0;let D;if(h.interlace){D=i.inflateSync(L)}else{let t=(h.width*h.bpp*h.depth+7>>3)+1;let i=t*h.height;D=e(L,{chunkSize:i,maxLength:i})}L=null;if(!D||!D.length){throw new Error("bad png - invalid inflate data response")}let N=r.process(D,h);L=null;let x=a.dataToBitMap(N,h);N=null;let C=o(x,h);h.data=C;h.gamma=M||0;return h};return Il}var Dl;var Nl;function xl(){if(Nl)return Dl;Nl=1;let t=true;let i=Rf;if(!i.deflateSync){t=false}let e=nu();let n=xu();Dl=function(r,s){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 a=s||{};let o=new n(a);let c=[];c.push(k.from(e.PNG_SIGNATURE));c.push(o.packIHDR(r.width,r.height));if(r.gamma){c.push(o.packGAMA(r.gamma))}let f=o.filterData(r.data,r.width,r.height);let u=i.deflateSync(f,o.getDeflateOptions());f=null;if(!u||!u.length){throw new Error("bad png - invalid compressed data response")}c.push(o.packIDAT(u));c.push(o.packIEND());return k.concat(c)};return Dl}var Cl;function kl(){if(Cl)return ju;Cl=1;let t=Ll();let i=xl();ju.read=function(i,e){return t(i,e||{})};ju.write=function(t,e){return i(t,e)};return ju}var jl;function zl(){if(jl)return Fi;jl=1;let t=Te;let i=dr;let e=gu();let n=ku();let r=kl();let s=Fi.PNG=function(t){i.call(this);t=t||{};this.width=t.width|0;this.height=t.height|0;this.data=this.width>0&&this.height>0?k.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 e(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 n(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(s,i);s.sync=r;s.prototype.pack=function(){if(!this.data||!this.data.length){this.emit("error","No data provided");return this}C.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this));return this};s.prototype.parse=function(t,i){if(i){let t,e;t=function(t){this.removeListener("error",e);this.data=t;i(null,this)}.bind(this);e=function(e){this.removeListener("parsed",t);i(e,null)}.bind(this);this.once("parsed",t);this.once("error",e)}this.end(t);return this};s.prototype.write=function(t){this._parser.write(t);return true};s.prototype.end=function(t){this._parser.end(t)};s.prototype._metadata=function(t){this.width=t.width;this.height=t.height;this.emit("metadata",t)};s.prototype._gamma=function(t){this.gamma=t};s.prototype._handleClose=function(){if(!this._parser.writable&&!this._packer.readable){this.emit("close")}};s.bitblt=function(t,i,e,n,r,s,a,o){e|=0;n|=0;r|=0;s|=0;a|=0;o|=0;if(e>t.width||n>t.height||e+r>t.width||n+s>t.height){throw new Error("bitblt reading outside image")}if(a>i.width||o>i.height||a+r>i.width||o+s>i.height){throw new Error("bitblt writing outside image")}for(let c=0;c<s;c++){t.data.copy(i.data,(o+c)*i.width+a<<2,(n+c)*t.width+e<<2,(n+c)*t.width+e+r<<2)}};s.prototype.bitblt=function(t,i,e,n,r,a,o){s.bitblt(this,t,i,e,n,r,a,o);return this};s.adjustGamma=function(t){if(t.gamma){for(let i=0;i<t.height;i++){for(let e=0;e<t.width;e++){let n=t.width*i+e<<2;for(let i=0;i<3;i++){let e=t.data[n+i]/255;e=Math.pow(e,1/2.2/t.gamma);t.data[n+i]=Math.round(e*255)}}}t.gamma=0}};s.prototype.adjustGamma=function(){s.adjustGamma(this)};return Fi}var Sl={};var Tl;function Al(){if(Tl)return Sl;Tl=1;(function(t){function i(t){if(typeof t==="number"){t=t.toString()}if(typeof t!=="string"){throw new Error("Color should be defined as hex string")}let i=t.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8){throw new Error("Invalid hex color: "+t)}if(i.length===3||i.length===4){i=Array.prototype.concat.apply([],i.map((function(t){return[t,t]})))}if(i.length===6)i.push("F","F");const e=parseInt(i.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function t(e){if(!e)e={};if(!e.color)e.color={};const n=typeof e.margin==="undefined"||e.margin===null||e.margin<0?4:e.margin;const r=e.width&&e.width>=21?e.width:undefined;const s=e.scale||4;return{width:r,scale:r?4:s,margin:n,color:{dark:i(e.color.dark||"#000000ff"),light:i(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}};t.getScale=function t(i,e){return e.width&&e.width>=i+e.margin*2?e.width/(i+e.margin*2):e.scale};t.getImageWidth=function i(e,n){const r=t.getScale(e,n);return Math.floor((e+n.margin*2)*r)};t.qrToImageData=function i(e,n,r){const s=n.modules.size;const a=n.modules.data;const o=t.getScale(s,r);const c=Math.floor((s+r.margin*2)*o);const f=r.margin*o;const u=[r.color.light,r.color.dark];for(let t=0;t<c;t++){for(let i=0;i<c;i++){let n=(t*c+i)*4;let l=r.color.light;if(t>=f&&i>=f&&t<c-f&&i<c-f){const e=Math.floor((t-f)/o);const n=Math.floor((i-f)/o);l=u[a[e*s+n]?1:0]}e[n++]=l.r;e[n++]=l.g;e[n++]=l.b;e[n]=l.a}}}})(Sl);return Sl}var El;function Yl(){if(El)return Qi;El=1;(function(t){const i=Pi;const e=zl().PNG;const n=Al();t.render=function t(i,r){const s=n.getOptions(r);const a=s.rendererOpts;const o=n.getImageWidth(i.modules.size,s);a.width=o;a.height=o;const c=new e(a);n.qrToImageData(c.data,i,s);return c};t.renderToDataURL=function i(e,n,r){if(typeof r==="undefined"){r=n;n=undefined}t.renderToBuffer(e,n,(function(t,i){if(t)r(t);let e="data:image/png;base64,";e+=i.toString("base64");r(null,e)}))};t.renderToBuffer=function i(e,n,r){if(typeof r==="undefined"){r=n;n=undefined}const s=t.render(e,n);const a=[];s.on("error",r);s.on("data",(function(t){a.push(t)}));s.on("end",(function(){r(null,k.concat(a))}));s.pack()};t.renderToFile=function e(n,r,s,a){if(typeof a==="undefined"){a=s;s=undefined}let o=false;const c=(...t)=>{if(o)return;o=true;a.apply(null,t)};const f=i.createWriteStream(n);f.on("error",c);f.on("close",c);t.renderToFileStream(f,r,s)};t.renderToFileStream=function i(e,n,r){const s=t.render(n,r);s.pack().pipe(e)}})(Qi);return Qi}var Ol={};var Zl;function Rl(){if(Zl)return Ol;Zl=1;(function(t){const i=Al();const e={WW:" ",WB:"▄",BB:"█",BW:"▀"};const n={BB:" ",BW:"▄",WW:"█",WB:"▀"};function r(t,i,e){if(t&&i)return e.BB;if(t&&!i)return e.BW;if(!t&&i)return e.WB;return e.WW}t.render=function(t,s,a){const o=i.getOptions(s);let c=e;if(o.color.dark.hex==="#ffffff"||o.color.light.hex==="#000000"){c=n}const f=t.modules.size;const u=t.modules.data;let l="";let h=Array(f+o.margin*2+1).join(c.WW);h=Array(o.margin/2+1).join(h+"\n");const d=Array(o.margin+1).join(c.WW);l+=h;for(let t=0;t<f;t+=2){l+=d;for(let i=0;i<f;i++){const e=u[t*f+i];const n=u[(t+1)*f+i];l+=r(e,n,c)}l+=d+"\n"}l+=h.slice(0,-1);if(typeof a==="function"){a(null,l)}return l};t.renderToFile=function i(e,n,r,s){if(typeof s==="undefined"){s=r;r=undefined}const a=Pi;const o=t.render(n,r);a.writeFile(e,o,s)}})(Ol);return Ol}var Gl={};var Ql={};var Wl;function Ul(){if(Wl)return Ql;Wl=1;Ql.render=function(t,i,e){const n=t.modules.size;const r=t.modules.data;const s=" ";const a=" ";let o="";const c=Array(n+3).join(a);const f=Array(2).join(a);o+=c+"\n";for(let t=0;t<n;++t){o+=a;for(let i=0;i<n;i++){o+=r[t*n+i]?s:a}o+=f+"\n"}o+=c+"\n";if(typeof e==="function"){e(null,o)}return o};return Ql}var Pl={};var Fl;function Bl(){if(Fl)return Pl;Fl=1;const t="";const i="";const e="";const n="";const r="";const s=t+n;const a=i+e;const o=function(t,i,e){return{"00":r+" "+t,"01":r+i+"▄"+t,"02":r+e+"▄"+t,10:r+i+"▀"+t,11:" ",12:"▄",20:r+e+"▀"+t,21:"▀",22:"█"}};const c=function(t,i,e,n){const r=i+1;if(e>=r||n>=r||n<-1||e<-1)return"0";if(e>=i||n>=i||n<0||e<0)return"1";const s=n*i+e;return t[s]?"2":"1"};const f=function(t,i,e,n){return c(t,i,e,n)+c(t,i,e,n+1)};Pl.render=function(t,i,c){const u=t.modules.size;const l=t.modules.data;const h=!!(i&&i.inverse);const d=i&&i.inverse?a:s;const w=h?n:e;const b=h?e:n;const g=o(d,w,b);const M=r+"\n"+d;let m=d;for(let t=-1;t<u+1;t+=2){for(let i=-1;i<u;i++){m+=g[f(l,u,i,t)]}m+=g[f(l,u,u,t)]+M}m+=r;if(typeof c==="function"){c(null,m)}return m};return Pl}var Jl;function Hl(){if(Jl)return Gl;Jl=1;const t=Ul();const i=Bl();Gl.render=function(e,n,r){if(n&&n.small){return i.render(e,n,r)}return t.render(e,n,r)};return Gl}var Xl={};var Vl={};var _l;function Kl(){if(_l)return Vl;_l=1;const t=Al();function i(t,i){const e=t.a/255;const n=i+'="'+t.hex+'"';return e<1?n+" "+i+'-opacity="'+e.toFixed(2).slice(1)+'"':n}function e(t,i,e){let n=t+i;if(typeof e!=="undefined")n+=" "+e;return n}function n(t,i,n){let r="";let s=0;let a=false;let o=0;for(let c=0;c<t.length;c++){const f=Math.floor(c%i);const u=Math.floor(c/i);if(!f&&!a)a=true;if(t[c]){o++;if(!(c>0&&f>0&&t[c-1])){r+=a?e("M",f+n,.5+u+n):e("m",s,0);s=0;a=false}if(!(f+1<i&&t[c+1])){r+=e("h",o);o=0}}else{s++}}return r}Vl.render=function e(r,s,a){const o=t.getOptions(s);const c=r.modules.size;const f=r.modules.data;const u=c+o.margin*2;const l=!o.color.light.a?"":"<path "+i(o.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>';const h="<path "+i(o.color.dark,"stroke")+' d="'+n(f,c,o.margin)+'"/>';const d='viewBox="'+"0 0 "+u+" "+u+'"';const w=!o.width?"":'width="'+o.width+'" height="'+o.width+'" ';const b='<svg xmlns="http://www.w3.org/2000/svg" '+w+d+' shape-rendering="crispEdges">'+l+h+"</svg>\n";if(typeof a==="function"){a(null,b)}return b};return Vl}var ql;function $l(){if(ql)return Xl;ql=1;(function(t){const i=Kl();t.render=i.render;t.renderToFile=function i(e,n,r,s){if(typeof s==="undefined"){s=r;r=undefined}const a=Pi;const o=t.render(n,r);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">'+o;a.writeFile(e,c,s)}})(Xl);return Xl}var th={};var ih={};var eh;function nh(){if(eh)return ih;eh=1;(function(t){const i=Al();function e(t,i,e){t.clearRect(0,0,i.width,i.height);if(!i.style)i.style={};i.height=e;i.width=e;i.style.height=e+"px";i.style.width=e+"px"}function n(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}t.render=function t(r,s,a){let o=a;let c=s;if(typeof o==="undefined"&&(!s||!s.getContext)){o=s;s=undefined}if(!s){c=n()}o=i.getOptions(o);const f=i.getImageWidth(r.modules.size,o);const u=c.getContext("2d");const l=u.createImageData(f,f);i.qrToImageData(l.data,r,o);e(u,c,f);u.putImageData(l,0,0);return c};t.renderToDataURL=function i(e,n,r){let s=r;if(typeof s==="undefined"&&(!n||!n.getContext)){s=n;n=undefined}if(!s)s={};const a=t.render(e,n,s);const o=s.type||"image/png";const c=s.rendererOpts||{};return a.toDataURL(o,c.quality)}})(ih);return ih}var rh;function sh(){if(rh)return th;rh=1;const t=Dt();const i=Gi();const e=nh();const n=Kl();function r(e,n,r,s,a){const o=[].slice.call(arguments,1);const c=o.length;const f=typeof o[c-1]==="function";if(!f&&!t()){throw new Error("Callback required as last argument")}if(f){if(c<2){throw new Error("Too few arguments provided")}if(c===2){a=r;r=n;n=s=undefined}else if(c===3){if(n.getContext&&typeof a==="undefined"){a=s;s=undefined}else{a=s;s=r;r=n;n=undefined}}}else{if(c<1){throw new Error("Too few arguments provided")}if(c===1){r=n;n=s=undefined}else if(c===2&&!n.getContext){s=r;r=n;n=undefined}return new Promise((function(t,a){try{const a=i.create(r,s);t(e(a,n,s))}catch(t){a(t)}}))}try{const t=i.create(r,s);a(null,e(t,n,s))}catch(t){a(t)}}th.create=i.create;th.toCanvas=r.bind(null,e.render);th.toDataURL=r.bind(null,e.renderToDataURL);th.toString=r.bind(null,(function(t,i,e){return n.render(t,e)}));return th}var ah;function oh(){if(ah)return It;ah=1;const t=Dt();const i=Gi();const e=Yl();const n=Rl();const r=Hl();const s=$l();function a(i,e,n){if(typeof i==="undefined"){throw new Error("String required as first argument")}if(typeof n==="undefined"){n=e;e={}}if(typeof n!=="function"){if(!t()){throw new Error("Callback required as last argument")}else{e=n||{};n=null}}return{opts:e,cb:n}}function o(t){return t.slice((t.lastIndexOf(".")-1>>>0)+2).toLowerCase()}function c(t){switch(t){case"svg":return s;case"txt":case"utf8":return n;case"png":case"image/png":default:return e}}function f(t){switch(t){case"svg":return s;case"terminal":return r;case"utf8":default:return n}}function u(t,e,n){if(!n.cb){return new Promise((function(r,s){try{const a=i.create(e,n.opts);return t(a,n.opts,(function(t,i){return t?s(t):r(i)}))}catch(t){s(t)}}))}try{const r=i.create(e,n.opts);return t(r,n.opts,n.cb)}catch(t){n.cb(t)}}It.create=i.create;It.toCanvas=sh().toCanvas;It.toString=function t(i,e,n){const r=a(i,e,n);const s=r.opts?r.opts.type:undefined;const o=f(s);return u(o.render,i,r)};It.toDataURL=function t(i,e,n){const r=a(i,e,n);const s=c(r.opts.type);return u(s.renderToDataURL,i,r)};It.toBuffer=function t(i,e,n){const r=a(i,e,n);const s=c(r.opts.type);return u(s.renderToBuffer,i,r)};It.toFile=function i(e,n,r,s){if(typeof e!=="string"||!(typeof n==="string"||typeof n==="object")){throw new Error("Invalid argument")}if(arguments.length<3&&!t()){throw new Error("Too few arguments provided")}const f=a(n,r,s);const l=f.opts.type||o(e);const h=c(l);const d=h.renderToFile.bind(null,e);return u(d,n,f)};It.toFileStream=function t(i,e,n){if(arguments.length<2){throw new Error("Too few arguments provided")}const r=a(e,n,i.emit.bind(i,"error"));const s=c("png");const o=s.renderToFileStream.bind(null,i);u(o,e,r)};return It}var ch;var fh;function uh(){if(fh)return ch;fh=1;ch=oh();return ch}var lh=uh();var hh=h(lh);const dh=".qr-canvas{max-height:60vh;max-width:80vw;text-align:center}.qr-canvas>canvas{width:100%;height:100%}";const wh=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError");this.prefilledPhone=false;this.invalidValue=false;this.waitingMobile=false}async componentWillLoad(){w.flowStarted();this.translations=await s.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 i="";if(o.apiBaseUrl.includes("apimd")){i="https://onmd.id-kyc.com/"}else if(o.apiBaseUrl.includes("apiontrace")){i="https://ontrace.id-kyc.com/"}else{i="https://onro.id-kyc.com/"}this.redirectLink=new URL(t+"mobileredirect?redirectId="+o.redirectId,i).toString();if(o.phoneNumber&&o.phoneNumber!=""){this.contact=o.phoneNumber;this.prefilledPhone=true}var e=this;hh.toDataURL(this.redirectLink,{type:"image/png",errorCorrectionLevel:"M",scale:6},(function(t,i){if(t)console.error(t);e.qrCode=i}))}async componentDidLoad(){await d.initialize(r.MobileRedirect);await y(5e3);await this.checkStatus();while(this.orderStatus!=c.COMPLETE){await this.checkStatus();await y(5e3)}}async checkStatus(){this.orderStatus=await a.instance.GetStatusUi(o.requestId);if(this.orderStatus==null){this.apiErrorEvent.emit({message:"No order was started for this process."})}else if(this.orderStatus==c.ABORTED){this.waitingMobile=false;this.infoTextTop=this.translations.MobileRedirectValues.InfoAborted;w.flowAborted()}else if(this.orderStatus==c.COMPLETE){this.waitingMobile=false;o.flowStatus=c.COMPLETE}else if(this.orderStatus!=c.MOBILE){this.infoTextTop=this.translations.MobileRedirectValues.InfoWaiting;this.waitingMobile=true}}async disconnectedCallback(){await d.finalize(r.MobileRedirect)}async buttonClick(){if(this.contact==""||this.contact.length!=10){return}this.waitingMobile=true;this.infoTextTop=this.translations.MobileRedirectValues.InfoWaiting;try{await a.instance.SendLink(this.redirectLink,this.contact)}catch(t){this.apiErrorEvent.emit(t)}}handleChangeContact(t){let i=t.target?t.target.value:"";this.contact=i.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 e("div",{key:"5b47081845b95a7a51f7510aa47596c22eb95c26",class:"container flex center"},e("div",{key:"f1cedc864ab928d664c960b195fa223a0efdfe55",class:"px-2 w-100"},e("div",{key:"d04cdc9d523b8f40c3a990fc5e4bc044d36ecba3",hidden:this.waitingMobile},e("h1",{key:"89e22b02bb67ba945f2393bd608ef7b300dd7f49",class:"text-center px-2 mb-1"},this.infoTextTop),e("div",{key:"5d07da74606d13de4cb655e2661d4b4a60b9eec8",class:"flex center"},e("img",{key:"9ad61e0ba144576ca32de3af014f01f62975126f",src:this.qrCode})),e("h2",{key:"88fe54a2938056cdf4466d8b8aa782ecbf05bc4a",class:"text-center px-2 mb-2"},this.infoTextBottom),e("div",{key:"f8ebfb0fff6bdf0c54f6f3eee13434540bf0450b",class:"input-container mb-3 px-3"},e("label",{key:"3ad2e2aa743230554a7d64f982f85754d11285d0",class:"font-size-18 mb-1 color-red",hidden:this.invalidValue==false},e("b",{key:"d2b9d4aac3d8c1e7610e4230321863da131c7cdf"},this.translations.MobileRedirectValues.Validation)),e("input",{key:"8f2c69f68b2559f458d0a19706115d41dcf21aba",type:"text",id:"codeInput",class:"main-input",disabled:this.prefilledPhone,value:this.contact,onInput:t=>this.handleChangeContact(t)})),e("div",{key:"646ae12c618aa1803eb75d10a45e8c9ed55555f6",class:"px-3"},e("button",{key:"3376d06e2cb7c6ff26bec16a8d9f3accb1fd0fe5",class:"main-button",onClick:()=>this.buttonClick()},this.translations.MobileRedirectValues.Send))),e("div",{key:"89f1df34f1616e5eb2c1dfd6bec0251f9a27df35",hidden:this.waitingMobile==false},e("div",{key:"6e6e931c3f6150f12a43c993cdcb7b3a7e88144c",class:"text-center"},e("p",{key:"a156beb33da9e5a01fb533ce189e1518188d7598",class:"font-size-2"},this.infoTextTop))),e("div",{key:"72a1c2f5b057a6885f27c8b6831b5a4abe458b2c",class:"footer text-center"},e("img",{key:"94a2bbde130cc581ef5510e9d08ca639ba420a7f",src:b}))))}};wh.style=dh;var bh;(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"})(bh||(bh={}));const gh="";const Mh=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError");this.recordingResultCount=0;this.uploading=false;this.appInsights=N.getInstance()}componentWillLoad(){this.captureRetryCount=0;this.initFlow();this.appInsights.trackEvent("ProcessId | init",{requestId:o.requestId})}initFlow(){if(this.mode=="front"){this.currentStep=r.CiFront;this.flow={fileName:"idImage.png",recName:"idVideo.",photoType:bh.IdFront,recType:bh.IdFrontVideo,imageSize:0,videoSize:0}}else if(this.mode=="back"){this.currentStep=r.CiBack;this.flow={fileName:"idBackImage.png",recName:"idBackVideo.",photoType:bh.IdBack,recType:bh.IdBackVideo,imageSize:0,videoSize:0}}else if(this.mode=="tilt"){this.currentStep=r.CiTilt;this.flow={fileName:"idTiltImage.png",recName:"idTiltVideo.",photoType:bh.None,recType:bh.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 i=t.detail;if(i.size==0){if(o.debug)console.log("process-id | captureIdImage | Empty id photo");await a.instance.AddLog({message:"Empty id photo",blobData:i},await D());this.triggerErrorFlow();return}this.capture=new File([i],this.flow.fileName,{type:"image/png"});this.triggerSnapshotTaken()}async uploadCapture(){try{this.uploading=true;let i=await p(this.capture);this.flow.imageSize=A(i);if(o.debug)console.log("process-id | captureIdImage | uploadResult: "+t);var t=await a.instance.UploadFileForRequestB64(o.requestId,this.flow.photoType,i);if(t.isValid){o.flowStatus=c[t.state]}else{this.switchCamera();this.triggerErrorFlow()}this.capture=null;this.shapshotTaken=false;this.uploading=false}catch(t){this.apiErrorEvent.emit(t)}}async capturedIdRecording(t){if(o.debug)console.log("process-id | capturedIdRecording");let i=t.detail;if(i.size==0&&this.recordingResultCount==0){this.recordingResultCount++;return}if(i.size==0){if(o.debug)console.log("process-id | capturedIdRecording | Empty ID recording");await a.instance.AddLog({message:"Empty ID recording",blobData:i},await D());this.triggerErrorFlow();return}let e=i.type==M.mp4MimeType.type?M.mp4MimeType:M.webmMimeType;let n=new File([i],this.flow.recName+e.extension,{type:e.type});let r=await p(n);this.flow.videoSize=A(r);var s=await a.instance.UploadFileForRequestB64(o.requestId,this.flow.recType,r);if(o.debug)console.log("process-id | capturedIdRecording | uploadResult: "+s);if(s.saved){o.flowStatus=c[s.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 y(2e3);if(this.showInvalid||this.showTimeout)return}this.triggerUploadFailedFlow();if(o.debug)console.log("process-id | verificationFinished | waitingFinished ")}idCaptureConfirmation(){this.uploadCapture()}idCaptureRetry(){this.capture=null;this.shapshotTaken=false}triggerUploadFailedFlow(){this.errorReason="Upload Failed";this.showInvalid=true}async componentDidLoad(){if(o.debug)console.log("process-id | componentDidLoad");await d.initialize(this.currentStep)}triggerErrorFlow(){this.errorReason="Invalid";this.showInvalid=true}triggerSnapshotTaken(){this.shapshotTaken=true}async disconnectedCallback(){if(o.debug)console.log("process-id | disconnectedCallback");await d.finalize(this.currentStep)}switchCamera(){if(o.debug)console.log("process-id | switchCamera");if(this.captureRetryCount==1){v.switchCamera();this.captureRetryCount=0}else{this.captureRetryCount++}}render(){let t=e("capture-error",{type:"ID",reason:this.errorReason,error:`image: ${this.flow.imageSize}mb video: ${this.flow.videoSize}mb`});let i=e("id-auto-capture",null);let n=e("id-capture-confirm",{capture:this.capture});let r=e("uploading-data",{type:"id"});if(this.uploading)return r;if(this.showInvalid||this.showTimeout)return t;if(this.shapshotTaken)return n;return i}};Mh.style=gh;const mh=".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 yh=class{constructor(i){t(this,i);this.rand=[]}async componentWillLoad(){this.translations=await s.getValues();this.randomize()}randomInt(t,i){return Math.floor(Math.random()*(i-t+1)+t)}randomize(){this.rand=[];for(let i=0;i<9;i++){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,i){let e=i.currentTarget;if(this.choice==t){e.classList.add("success");await y(500);o.flowStatus=await a.instance.GetNextFlowState()}else{e.classList.add("error");await y(500);this.randomize()}e.classList=[]}render(){return e("div",{key:"887e66abe22b54d4251d9c00e5cab972048f0230",class:"container flex center"},e("div",{key:"dd8d7705e06e9b94622c3068cf957adc3938f710",class:"px-2 w-100"},e("h1",{key:"d18caea0cf13a0ae1fc3fbb163f9e007c8fae26a",class:"text-center px-1 mb-2",innerHTML:this.translations.RandomActionValues.Title+` ${this.rand[this.choice]}`}),e("div",{key:"ef84b3a8b553b5af3c973c035c7d442c54e25986",class:"grid"},this.rand.map(((t,i)=>e("div",{onClick:t=>this.click(i,t)},t)))),e("div",{key:"78d790364fe643b270c9930c2b718a16be4eb3d2",class:"footer text-center"},e("img",{key:"4f8c7d3591f862ba4157715a8b013f52203fa2bc",src:b}))))}};yh.style=mh;const vh="";const Ih=class{constructor(e){t(this,e);this.eventPhotoCapture=i(this,"photoSelfieCapture");this.apiErrorEvent=i(this,"apiError");this.eventTimeElapsed=i(this,"timeElapsed");this.captureTaken=false;this.verified=false;this.showDemo=false}eventVideoStarted(t){this.videoStarted=true;this.captureHeight=Math.round(window.screen.height/2);this.captureWidth=Math.round(this.captureHeight*9/16)}infoTimeElapsed(){this.titleMesage=this.translations.SelfieCaptureValues.TitleMore;this.titleStyle+=" pulsate"}async componentWillLoad(){this.translations=await s.getValues();if(!navigator.mediaDevices){this.apiErrorEvent.emit({message:"This browser does not support webRTC"})}this.titleStyle="text-center px-1 mb-2"}async componentDidLoad(){if(o.flowStatus==c.LIVENESS){this.verificationMode=g.Full;this.currentStep=r.SelfieCapture;this.mainStream=M.getNewInstance(this.verificationMode);this.titleMesage=this.translations.SelfieCaptureValues.Title}else if(o.flowStatus==c.LIVENESSGESTURE){this.verificationMode=g.Tilt;this.currentStep=r.SelfieTilt;this.mainStream=M.getNewInstance(this.verificationMode);this.titleMesage=this.translations.SelfieCaptureValues.FacePoseMapping[this.mainStream.facePose]}this.openCamera()}async openCamera(){const t=v.GetConstraints("",o.device,true);setTimeout((()=>{if(o.device.isAppleDevice){navigator.audioSession.type="play-and-record"}navigator.mediaDevices.getUserMedia(t).then((t=>{this.mainStream.initStream(t)})).catch((t=>{this.closeCamera();this.apiErrorEvent.emit(t)}))}),100)}closeCamera(){if(this.mainStream){this.mainStream.dropStream()}if(o.device.isAppleDevice){navigator.audioSession.type="playback"}}disconnectedCallback(){this.closeCamera();M.instance=null}async takePhoto(){if(this.captureTaken)return;this.captureTaken=true;if(this.mainStream){let t=await this.mainStream.takePhoto();this.eventPhotoCapture.emit(t)}else{this.eventTimeElapsed.emit()}await d.logStep(this.currentStep,u.Finalized)}async verificationFinished(){if(this.verified)return;this.verified=true;this.closeCamera()}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 e("div",{key:"133347b1d1c12b1743baca85a32152ab9f500060",class:"container flex center"},e("div",{key:"33553d18d1a84adf38c34b5d89ed81d745685040",class:"px-2 w-100"},e("h1",{key:"23a87aa8258b417e3ace871dbe29e8605eaa5939",class:this.titleStyle,innerHTML:this.titleMesage}),e("div",{key:"bc410a820ee20930df4d19d2f5168076c0a4def3",hidden:this.showDemo||this.verified},e("div",{key:"b3d7aa5f7e87f7cf0103d69b7fd5c3269271e620",style:t},e("camera-comp",{key:"d37cd13c6edd1a1ef271f2c67af0bfa8f3c614d5","capture-mode":"selfie"}))),e("div",{key:"437f0df402836d2a0b82854082698dcc8f4ad605",class:"footer text-center"},e("img",{key:"f64c578bb754639d8f43077d0e9e0d877c0c80cd",src:b}))))}get component(){return n(this)}};Ih.style=vh;const ph="";const Lh=class{constructor(e){t(this,e);this.apiErrorEvent=i(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 a.instance.CheckOTPCode(o.requestId,this.code);o.flowStatus=c[t.state];if(o.flowStatus==c.CODEERROR)this.hasError=true;this.sending=false;this.code=""}catch(t){this.apiErrorEvent.emit(t)}}async disconnectedCallback(){await d.finalize(r.OtpCheck)}async componentWillLoad(){if(o.flowStatus==c.CODEERROR)this.hasError=true}async componentWillRender(){this.translations=await s.getValues();this.title=this.translations.CodeValidationValues.Title;this.details=this.translations.CodeValidationValues.Description;this.buttonText=this.translations.CodeValidationValues.Button}async componentDidLoad(){await d.initialize(r.OtpCheck)}handleChangeCode(t){let i=t.target?t.target.value:"";this.code=i;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 e("div",{key:"03bd268071d1ff4977a45712ff3d9bc4e2fc6223",class:"container flex center"},e("div",{key:"d1531490900b7637659a707b4fa308290d74eb68",class:"px-1 w-100"},this.hasError?e("div",null,e("div",{class:"mb-1 ml-1 text-center"},e("img",{src:et,style:{width:"60px"}})),e("h1",{class:"text-center color-red px-1 mb-2"},this.translations.CodeValidationValues.Error)):e("div",null,e("div",{class:"mb-1 ml-1 text-center"},e("img",{src:mt,style:{width:"60px"}})),e("h1",{class:"text-center px-1 mb-2"},this.title)),e("p",{key:"aaab48243f182e85b14cae0f183ad6aeb0d2e010",class:"text-center mb-05"},this.details),e("div",{key:"dc623d2b1ee7a89a7e9f271fe4bfa24300ba44cb",class:"mb-2"},e("input",{key:"8b4992a343ce3f35241ff943f7749f5578e873c4",placeholder:"XXXX",type:"tel",id:"codeInput",class:"main-input",onInput:t=>this.handleChangeCode(t),value:this.code})),e("div",{key:"e1e4891fec4da87baeac406d228e53ac94cd8e68",class:"button flex mb-1 mx-3"},this.sending?e("div",{class:"img-loader rounded img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{key:"27f8c6f199132938cb3c37cbc337b3717a7d069d",id:"action",disabled:!this.canSend,class:"main-button",onClick:()=>this.doAction()},this.buttonText)),e("div",{key:"1adfb7502562c67fc5113017cff0e10a27180c83",class:"footer text-center"},e("img",{key:"37d609829c861b57ba3fb1b74f82f9df439c28ba",src:b}))))}};Lh.style=ph;const Dh="";const Nh=class{constructor(e){t(this,e);this.apiErrorEvent=i(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 a.instance.SendOTPCode(o.requestId,this.phoneNumber);if(t.sent===true){await this.setPhoneNumber();o.flowStatus=c[t.state]}}catch(t){this.apiErrorEvent.emit(t)}}async setPhoneNumber(){var t=await f.ectdata.get(o.requestId);t.phoneNumber=this.phoneNumber;await f.ectdata.put(t)}async disconnectedCallback(){await d.finalize(r.OtpSend)}async componentWillRender(){this.translations=await s.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 d.initialize(r.OtpSend)}handleChangePhone(t){let i=t.target?t.target.value:"";this.phoneNumber=i.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 e("div",{key:"5933c13aa4d18ea72f9b698051ab3cc6aeef98ed",class:"container flex center"},e("div",{key:"efdb721a806f56077b36473a94bc8f1b61ff039a",class:"px-1"},e("div",{key:"a366c28d15c6bec44a70647d1a08786f5f8d27a2",class:"mb-1 ml-1 text-center"},e("img",{key:"6829ca21c8f4fe2e414fb0e66b92375f0c36a39e",src:mt,style:{width:"60px"}})),e("h1",{key:"722d0db34c027f42f879a62454fa570c8e5ee404",class:"text-center px-1 mb-2"},this.title),e("p",{key:"dc52e6afd90e1bc9cc92bfa415a47160308e2a12",class:"text-center mb-05"},this.details),e("div",{key:"4d6dc0d3da27e7d74c4b4daad23283f1cf86a102",class:"mb-2"},e("input",{key:"840cd82997e21fcb16fe7bc85147c0f6af7b9c68",placeholder:this.translations.PhoneValidationValues.Label,type:"tel",id:"phoneInput",class:"main-input",disabled:this.prefilledPhone,onInput:t=>this.handleChangePhone(t),value:this.phoneNumber})),e("div",{key:"51db313911809b2209316c7575f88c2a27e7a078",class:"button flex mb-1 mx-3"},this.sending?e("div",{class:"img-loader rounded img-loader-button"},e("img",{class:"loading-image loading-image-button",src:U})):null,e("button",{key:"4d99fefe95a83c7086b7cccbe831e12f0a292cfc",id:"action",disabled:!this.canSend,class:"main-button",onClick:()=>this.doAction()},this.buttonText)),e("div",{key:"8e4ce016250f2000a26c91aab1a3dcb5d775be56",class:"footer text-center"},e("img",{key:"85ecc2e33d40f25a1ecadec3ab21e428645f66ea",src:b}))))}};Nh.style=Dh;const xh="";const Ch=class{constructor(i){t(this,i)}async componentWillLoad(){o.flowStatus=await a.instance.GetNextFlowState()}render(){return e("div",{key:"79cf990055898d9c6c2ee2de9445ec851dac45f1",class:"container"},e("div",{key:"d8f61f8b8c6e38b0505aab7f7cfe4efd4554c475",class:"row"},e("div",{key:"01e8721367c50abe87370874086357ded5389dd2",class:"div-ci align-center"},e("img",{key:"8de4b07fb964c366924143b197d0d8128aca1f30",src:U}))))}};Ch.style=xh;const kh=class{constructor(i){t(this,i)}async componentWillLoad(){this.translations=await s.getValues()}render(){return e("div",{key:"9596adf7f93175fc1e744eccd8cce30c58df1a03",class:"container flex center"},e("div",{key:"10484645e4d4886a536cab5e3a8c1771d06ab864",class:"px-2 w-100"},e("h1",{key:"0f0ca82b07ddc5a39987df98f53b8f641a278304",class:"text-center px-1 mb-2",innerHTML:this.type=="id"?this.translations.IdCaptureValues.Loading:this.translations.SelfieCaptureValues.Loading}),e("img",{key:"9bdb724009b57accc353a5803c1cc1741df660a3",class:"w-100",src:"https://ekyc.blob.core.windows.net/$web/"+(this.type=="id"?"uploading_id.gif":"uploading_selfie.gif")}),e("div",{key:"b4d082ee1dca9b7bf3daa1df20b3180696190f6e",class:"footer text-center"},e("img",{key:"5f19fdc2425736305f1a8f9ccb30bb47a2bb0aba",src:b}))))}};const jh="";const zh=class{constructor(e){t(this,e);this.apiErrorEvent=i(this,"apiError");this.uploading=false;this.recordingResultCount=0;this.recordingRetryCount=0;this.appInsights=N.getInstance()}async componentDidLoad(){}componentWillLoad(){this.appInsights.trackEvent("UserLiveness | init",{requestId:o.requestId});if(this.mode=="selfie"){this.currentStep=r.Selfie;this.flow={fileName:"selfie.png",recName:"selfieVideo.",photoType:bh.Selfie,recType:bh.SelfieVideo,imageSize:0,videoSize:0}}else if(this.mode=="selfieGesture"){this.currentStep=r.SelfieTilt;this.flow={fileName:"",recName:"selfieTiltVideo.",photoType:bh.None,recType:bh.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==c.LIVENESSGESTURE)return;let i=t.detail;if(i.size==0){await a.instance.AddLog({message:"Empty selfie",blobData:i},await D());this.triggerErrorFlow();return}try{var e=new File([i],this.flow.fileName,{type:"image/png"});let t=await p(e);this.flow.imageSize=A(t);this.uploading=true;let n=await a.instance.UploadFileForRequestB64(o.requestId,this.flow.photoType,t);if(n.isValid){o.flowStatus=c[n.state]}else{this.triggerErrorFlow()}this.uploading=false}catch(t){this.apiErrorEvent.emit(t)}}async capturedSelfieRecording(t){let i=t.detail;if(i.size==0&&this.recordingResultCount==0){this.recordingResultCount++;return}this.recordingResultCount=0;if(i.size==0){await a.instance.AddLog({message:"Empty recording",blobData:i},await D());this.triggerErrorFlow();return}let e=i.type==M.mp4MimeType.type?M.mp4MimeType:M.webmMimeType;try{let t=new File([i],this.flow.recName+e.extension,{type:e.type});let n=await p(t);this.flow.videoSize=A(n);let r=await a.instance.UploadFileForRequestB64(o.requestId,this.flow.recType,n);if(r.saved){o.flowStatus=c[r.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 y(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 d.finalize(this.currentStep)}triggerErrorFlow(){this.errorReason="Invalid";this.showError=true}render(){let t=e("selfie-capture",null);let i=e("capture-error",{type:"LIVENESS",reason:this.errorReason,error:`image: ${this.flow.imageSize}mb video: ${this.flow.videoSize}mb`});let n=e("uploading-data",{type:"id"});if(this.uploading)return n;if(this.showError||this.showTimeout)return i;return t}};zh.style=jh;export{O as agreement_info,R as agreement_view,W as camera_comp,H as camera_error,K as capture_error,$ as citizenship_selection,it as end_redirect,rt as error_end,at as how_to_info,ct as id_auto_capture,ft as id_capture_confirm,ht as id_selection,Mt as identification_component,vt as landing_validation,wh as mobile_redirect,Mh as process_id,yh as random_action,Ih as selfie_capture,Lh as sms_code_validation,Nh as sms_send,Ch as state_transition,kh as uploading_data,zh as user_liveness};
3
- //# sourceMappingURL=p-ba67e517.entry.js.map