From 0e31718d5cee5a0311b50c412ae0ac604c0367fd Mon Sep 17 00:00:00 2001 From: sondreb Date: Wed, 23 Oct 2024 18:54:23 +0000 Subject: [PATCH] Auto-generated commit Triggered by commit: https://github.com/block-core/ariton/commit/611a6c034867edf0862d66961b7ff9a4bba30279 --- 404.html | 2 +- index.html | 2 +- main.80135590eef31bbe.js => main.5594837ea6bb0865.js | 2 +- ngsw.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename main.80135590eef31bbe.js => main.5594837ea6bb0865.js (81%) diff --git a/404.html b/404.html index f37df4ff..00de1046 100644 --- a/404.html +++ b/404.html @@ -35,5 +35,5 @@ - + diff --git a/index.html b/index.html index f37df4ff..00de1046 100644 --- a/index.html +++ b/index.html @@ -35,5 +35,5 @@ - + diff --git a/main.80135590eef31bbe.js b/main.5594837ea6bb0865.js similarity index 81% rename from main.80135590eef31bbe.js rename to main.5594837ea6bb0865.js index 7d2ac8f0..1ec11c0c 100644 --- a/main.80135590eef31bbe.js +++ b/main.5594837ea6bb0865.js @@ -1,4 +1,4 @@ -(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8792],{44273:(Me,F,f)=>{"use strict";var i,c,x,B,m,S,g,_,R,T,E,j,M,k,K,W,V;f.r(F),f.d(F,{JSONPath:()=>uc}),(c={})[(i={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",c[i.EOF]="",c[i.Identifier]="Identifier",c[i.Keyword]="Keyword",c[i.NullLiteral]="Null",c[i.NumericLiteral]="Numeric",c[i.Punctuator]="Punctuator",c[i.StringLiteral]="String",c[i.RegularExpression]="RegularExpression",x=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];var Z={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"};function q(yt,kt){if(!yt)throw new Error("ASSERT: "+kt)}function ne(yt){return yt>=48&&yt<=57}function te(yt){return"0123456789abcdefABCDEF".indexOf(yt)>=0}function ie(yt){return"01234567".indexOf(yt)>=0}function ae(yt){return 32===yt||9===yt||11===yt||12===yt||160===yt||yt>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(yt)>=0}function me(yt){return 10===yt||13===yt||8232===yt||8233===yt}function ye(yt){return 64==yt||36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||92===yt||yt>=128&&S.NonAsciiIdentifierStart.test(String.fromCharCode(yt))}function ue(yt){return 36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||yt>=48&&yt<=57||92===yt||yt>=128&&S.NonAsciiIdentifierPart.test(String.fromCharCode(yt))}function o(yt){switch(yt){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function h(yt){return"eval"===yt||"arguments"===yt}function C(yt,kt,wr,Yt,hr){var Or;q("number"==typeof wr,"Comment must have valid position"),!(W.lastCommentStart>=wr)&&(W.lastCommentStart=wr,Or={type:yt,value:kt},V.range&&(Or.range=[wr,Yt]),V.loc&&(Or.loc=hr),V.comments.push(Or),V.attachComment&&(V.leadingComments.push(Or),V.trailingComments.push(Or)))}function O(yt){var kt,wr,Yt,hr;for(kt=T-yt,wr={start:{line:E,column:T-j-yt}};T=M&&Qe({},m.UnexpectedToken,"ILLEGAL");else if(42===wr){if(47===_.charCodeAt(T+1))return++T,++T,void(V.comments&&(Yt=_.slice(yt+2,T-2),kt.end={line:E,column:T-j},C("Block",Yt,yt,T,kt)));++T}else++T;Qe({},m.UnexpectedToken,"ILLEGAL")}function H(){var yt,kt;for(kt=0===T;T>>="===(pn=_.substr(T,4))?{type:i.Punctuator,value:pn,lineNumber:E,lineStart:j,start:yt,end:T+=4}:">>>"===(Or=pn.substr(0,3))||"<<="===Or||">>="===Or?{type:i.Punctuator,value:Or,lineNumber:E,lineStart:j,start:yt,end:T+=3}:Yt===(hr=Or.substr(0,2))[1]&&"+-<>&|".indexOf(Yt)>=0||"=>"===hr?{type:i.Punctuator,value:hr,lineNumber:E,lineStart:j,start:yt,end:T+=2}:"<>=!+-*%&|^/".indexOf(Yt)>=0?(++T,{type:i.Punctuator,value:Yt,lineNumber:E,lineStart:j,start:yt,end:T}):void Qe({},m.UnexpectedToken,"ILLEGAL")}function Ae(){var yt,kt,wr;if(q(ne((wr=_[T]).charCodeAt(0))||"."===wr,"Numeric literal must start with a decimal digit or a decimal point"),kt=T,yt="","."!==wr){if(yt=_[T++],wr=_[T],"0"===yt){if("x"===wr||"X"===wr)return++T,function se(yt){for(var kt="";T0&&(Yt=V.tokens[V.tokens.length-1]).range[0]===yt&&"Punctuator"===Yt.type&&("/"===Yt.value||"/="===Yt.value)&&V.tokens.pop(),V.tokens.push({type:"RegularExpression",value:wr.literal,range:[yt,T],loc:kt})),wr}function Ee(){var yt;return H(),T>=M?{type:i.EOF,lineNumber:E,lineStart:j,start:T,end:T}:ye(yt=_.charCodeAt(T))?function J(){var yt,kt,wr;return yt=T,kt=92===_.charCodeAt(T)?s():function p(){var yt,kt;for(yt=T++;T=0&&T=0?ee():Te()}return Te()}return"Keyword"===yt.type?Te():ee()}():ee()}function ve(){var yt,kt,Yt;return H(),yt={start:{line:E,column:T-j}},kt=Ee(),yt.end={line:E,column:T-j},kt.type!==i.EOF&&(Yt=_.slice(kt.start,kt.end),V.tokens.push({type:c[kt.type],value:Yt,range:[kt.start,kt.end],loc:yt})),kt}function De(){var yt;return T=(yt=K).end,E=yt.lineNumber,j=yt.lineStart,K=typeof V.tokens<"u"?ve():Ee(),T=yt.end,E=yt.lineNumber,j=yt.lineStart,yt}function Re(){var yt,kt,wr;yt=T,kt=E,wr=j,K=typeof V.tokens<"u"?ve():Ee(),T=yt,E=kt,j=wr}function Je(yt,kt){this.line=yt,this.column=kt}function $e(yt,kt,wr,Yt){this.start=new Je(yt,kt),this.end=new Je(wr,Yt)}function nt(){var yt,kt,wr,Yt;return yt=T,kt=E,wr=j,H(),Yt=E!==kt,T=yt,E=kt,j=wr,Yt}function Qe(yt,kt){for(var wr=[],Yt=2;Yt":case"<=":case">=":case"instanceof":wr=7;break;case"in":wr=kt?7:0;break;case"<<":case">>":case">>>":wr=8;break;case"+":case"-":wr=9;break;case"*":case"/":case"%":wr=11}return wr}function Ke(){var yt,kt,wr,Yt,hr;return yt=K,hr=K,Yt=kt=function Nr(){var yt,kt,wr,Yt,hr;return hr=K,yt=function jt(){var yt,kt,wr,Yt,hr,Or,pn,bn,_i,Xi;if(yt=K,_i=Pt(),0===(hr=Ct(Yt=K,W.allowIn)))return _i;for(Yt.prec=hr,De(),kt=[yt,K],Or=[_i,Yt,pn=Pt()];(hr=Ct(K,W.allowIn))>0;){for(;Or.length>2&&hr<=Or[Or.length-2].prec;)pn=Or.pop(),bn=Or.pop().value,_i=Or.pop(),wr=k.createBinaryExpression(bn,_i,pn),kt.pop(),k.markEnd(wr,yt=kt[kt.length-1]),Or.push(wr);(Yt=De()).prec=hr,Or.push(Yt),kt.push(K),wr=Pt(),Or.push(wr)}for(wr=Or[Xi=Or.length-1],kt.pop();Xi>1;)wr=k.createBinaryExpression(Or[Xi-1].value,Or[Xi-2],wr),Xi-=2,yt=kt.pop(),k.markEnd(wr,yt);return wr}(),re("?")&&(De(),kt=W.allowIn,W.allowIn=!0,wr=Ke(),W.allowIn=kt,ze(":"),Yt=Ke(),yt=k.createConditionalExpression(yt,wr,Yt),k.markEnd(yt,hr)),yt}(),function G(){var yt;return K.type===i.Punctuator&&("="===(yt=K.value)||"*="===yt||"/="===yt||"%="===yt||"+="===yt||"-="===yt||"<<="===yt||">>="===yt||">>>="===yt||"&="===yt||"^="===yt||"|="===yt)}()&&(_e(kt)||Tt({},m.InvalidLHSInAssignment),R&&kt.type===Z.Identifier&&h(kt.name)&&Tt(yt,m.StrictLHSAssignment),yt=De(),wr=Ke(),Yt=k.markEnd(k.createAssignmentExpression(yt.value,kt,wr),hr)),Yt}function Ze(){var yt,kt=K;if(yt=Ke(),re(",")){for(yt=k.createSequenceExpression([yt]);T"u"));)yt.push(kt);return yt}(),ze("}"),k.markEnd(k.createBlockStatement(yt),kt)}function mt(){var yt,kt;return kt=K,(yt=De()).type!==i.Identifier&&ct(yt),k.markEnd(k.createIdentifier(yt.value),kt)}function Xt(yt){var wr,Yt,kt=null;return Yt=K,wr=mt(),R&&h(wr.name)&&Tt({},m.StrictVarName),"const"===yt?(ze("="),kt=Ke()):re("=")&&(De(),kt=Ke()),k.markEnd(k.createVariableDeclarator(wr,kt),Yt)}function Et(yt){var kt=[];do{if(kt.push(Xt(yt)),!re(","))break;De()}while(T"u"&&ze(";")),typeof Yt>"u"&&(re(";")||(kt=Ze()),ze(";"),re(")")||(wr=Ze())),ze(")"),pn=W.inIteration,W.inIteration=!0,Or=ur(),W.inIteration=pn,typeof Yt>"u"?k.createForStatement(yt,kt,wr,Or):k.createForInStatement(Yt,hr,Or)}(),hr);case"function":return k.markEnd(mr(),hr);case"if":return k.markEnd(function mi(){var yt,kt,wr;return St("if"),ze("("),yt=Ze(),ze(")"),kt=ur(),X("else")?(De(),wr=ur()):wr=null,k.createIfStatement(yt,kt,wr)}(),hr);case"return":return k.markEnd(function xr(){var yt=null;return St("return"),W.inFunctionBody||Tt({},m.IllegalReturn),32===_.charCodeAt(T)&&ye(_.charCodeAt(T+1))?(yt=Ze(),he(),k.createReturnStatement(yt)):nt()?k.createReturnStatement(null):(re(";")||!re("}")&&K.type!==i.EOF&&(yt=Ze()),he(),k.createReturnStatement(yt))}(),hr);case"switch":return k.markEnd(function Xn(){var yt,kt,wr,Yt,hr;if(St("switch"),ze("("),yt=Ze(),ze(")"),ze("{"),kt=[],re("}"))return De(),k.createSwitchStatement(yt,kt);for(Yt=W.inSwitch,W.inSwitch=!0,hr=!1;T"u"));)kt.push(yt);return ze("}"),W.labelSet=Or,W.inIteration=pn,W.inSwitch=bn,W.inFunctionBody=_i,k.markEnd(k.createBlockStatement(kt),Xi)}function qt(yt){var kt,Yt,hr,Or,pn,bn,wr=[];if(ze("("),!re(")"))for(Or={};T0?1:0,j=0,M=_.length,K=null,W={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},V={},typeof kt<"u"&&(V.range="boolean"==typeof kt.range&&kt.range,V.loc="boolean"==typeof kt.loc&&kt.loc,V.attachComment="boolean"==typeof kt.attachComment&&kt.attachComment,V.loc&&null!=kt.source&&(V.source=Yt(kt.source)),"boolean"==typeof kt.tokens&&kt.tokens&&(V.tokens=[]),"boolean"==typeof kt.comment&&kt.comment&&(V.comments=[]),"boolean"==typeof kt.tolerant&&kt.tolerant&&(V.errors=[]),V.attachComment&&(V.range=!0,V.comments=[],V.bottomRightStack=[],V.trailingComments=[],V.leadingComments=[]));try{wr=function An(){var yt,kt;return H(),Re(),kt=K,R=!1,yt=function gn(){for(var yt,wr,hr,kt=[];T"u");)kt.push(yt);return kt}(),k.markEnd(k.createProgram(yt),kt)}(),typeof V.comments<"u"&&(wr.comments=V.comments),typeof V.tokens<"u"&&(function On(){var yt,kt,wr,Yt=[];for(yt=0;yt0?0:Or-1)),wr=hr(0===wr?0:wr||(Yt>0?Or:-1)),kt=Yt>0?Math.max(0,kt):Math.min(Or,kt),wr=Yt>0?Math.min(wr,Or):Math.max(-1,wr),Yt>0&&wr<=kt)return[];if(Yt<0&&kt<=wr)return[];for(var pn=[],bn=kt;bn!=wr&&!(Yt<0&&bn<=wr||Yt>0&&bn>=wr);bn+=Yt)pn.push(yt[bn]);return pn}B={Data:1,Get:2,Set:4},m={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},S={NonAsciiIdentifierStart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),NonAsciiIdentifierPart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]")},g={name:"SyntaxTree",processComment:function(yt){var kt,wr;if(!(yt.type===Z.Program&&yt.body.length>0)){for(V.trailingComments.length>0?V.trailingComments[0].range[0]>=yt.range[1]?(wr=V.trailingComments,V.trailingComments=[]):V.trailingComments.length=0:V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments[0].range[0]>=yt.range[1]&&(wr=V.bottomRightStack[V.bottomRightStack.length-1].trailingComments,delete V.bottomRightStack[V.bottomRightStack.length-1].trailingComments);V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].range[0]>=yt.range[0];)kt=V.bottomRightStack.pop();kt?kt.leadingComments&&kt.leadingComments[kt.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=kt.leadingComments,delete kt.leadingComments):V.leadingComments.length>0&&V.leadingComments[V.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=V.leadingComments,V.leadingComments=[]),wr&&(yt.trailingComments=wr),V.bottomRightStack.push(yt)}},markEnd:function(yt,kt){return V.range&&(yt.range=[kt.start,T]),V.loc&&(yt.loc=new $e(void 0===kt.startLineNumber?kt.lineNumber:kt.startLineNumber,kt.start-(void 0===kt.startLineStart?kt.lineStart:kt.startLineStart),E,T-j),this.postProcess(yt)),V.attachComment&&this.processComment(yt),yt},postProcess:function(yt){return V.source&&(yt.loc.source=V.source),yt},createArrayExpression:function(yt){return{type:Z.ArrayExpression,elements:yt}},createAssignmentExpression:function(yt,kt,wr){return{type:Z.AssignmentExpression,operator:yt,left:kt,right:wr}},createBinaryExpression:function(yt,kt,wr){return{type:"||"===yt||"&&"===yt?Z.LogicalExpression:Z.BinaryExpression,operator:yt,left:kt,right:wr}},createBlockStatement:function(yt){return{type:Z.BlockStatement,body:yt}},createBreakStatement:function(yt){return{type:Z.BreakStatement,label:yt}},createCallExpression:function(yt,kt){return{type:Z.CallExpression,callee:yt,arguments:kt}},createCatchClause:function(yt,kt){return{type:Z.CatchClause,param:yt,body:kt}},createConditionalExpression:function(yt,kt,wr){return{type:Z.ConditionalExpression,test:yt,consequent:kt,alternate:wr}},createContinueStatement:function(yt){return{type:Z.ContinueStatement,label:yt}},createDebuggerStatement:function(){return{type:Z.DebuggerStatement}},createDoWhileStatement:function(yt,kt){return{type:Z.DoWhileStatement,body:yt,test:kt}},createEmptyStatement:function(){return{type:Z.EmptyStatement}},createExpressionStatement:function(yt){return{type:Z.ExpressionStatement,expression:yt}},createForStatement:function(yt,kt,wr,Yt){return{type:Z.ForStatement,init:yt,test:kt,update:wr,body:Yt}},createForInStatement:function(yt,kt,wr){return{type:Z.ForInStatement,left:yt,right:kt,body:wr,each:!1}},createFunctionDeclaration:function(yt,kt,wr,Yt){return{type:Z.FunctionDeclaration,id:yt,params:kt,defaults:wr,body:Yt,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(yt,kt,wr,Yt){return{type:Z.FunctionExpression,id:yt,params:kt,defaults:wr,body:Yt,rest:null,generator:!1,expression:!1}},createIdentifier:function(yt){return{type:Z.Identifier,name:yt}},createIfStatement:function(yt,kt,wr){return{type:Z.IfStatement,test:yt,consequent:kt,alternate:wr}},createLabeledStatement:function(yt,kt){return{type:Z.LabeledStatement,label:yt,body:kt}},createLiteral:function(yt){return{type:Z.Literal,value:yt.value,raw:_.slice(yt.start,yt.end)}},createMemberExpression:function(yt,kt,wr){return{type:Z.MemberExpression,computed:"["===yt,object:kt,property:wr}},createNewExpression:function(yt,kt){return{type:Z.NewExpression,callee:yt,arguments:kt}},createObjectExpression:function(yt){return{type:Z.ObjectExpression,properties:yt}},createPostfixExpression:function(yt,kt){return{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!1}},createProgram:function(yt){return{type:Z.Program,body:yt}},createProperty:function(yt,kt,wr){return{type:Z.Property,key:kt,value:wr,kind:yt}},createReturnStatement:function(yt){return{type:Z.ReturnStatement,argument:yt}},createSequenceExpression:function(yt){return{type:Z.SequenceExpression,expressions:yt}},createSwitchCase:function(yt,kt){return{type:Z.SwitchCase,test:yt,consequent:kt}},createSwitchStatement:function(yt,kt){return{type:Z.SwitchStatement,discriminant:yt,cases:kt}},createThisExpression:function(){return{type:Z.ThisExpression}},createThrowStatement:function(yt){return{type:Z.ThrowStatement,argument:yt}},createTryStatement:function(yt,kt,wr,Yt){return{type:Z.TryStatement,block:yt,guardedHandlers:kt,handlers:wr,finalizer:Yt}},createUnaryExpression:function(yt,kt){return"++"===yt||"--"===yt?{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!0}:{type:Z.UnaryExpression,operator:yt,argument:kt,prefix:!0}},createVariableDeclaration:function(yt,kt){return{type:Z.VariableDeclaration,declarations:yt,kind:kt}},createVariableDeclarator:function(yt,kt){return{type:Z.VariableDeclarator,id:yt,init:kt}},createWhileStatement:function(yt,kt){return{type:Z.WhileStatement,test:yt,body:kt}},createWithStatement:function(yt,kt){return{type:Z.WithStatement,object:yt,body:kt}}};var no=f(18911),Zi=f.n(no);function Ao(yt){return function(kt,wr,Yt,hr){var Or=kt.value,pn=kt.path,bn=[],_i=function(Xi,Io){Jn(Xi)?(Xi.forEach(function(Mo,Ma){bn.length>=hr||Yt(Ma,Mo,wr)&&bn.push({path:Io.concat(Ma),value:Mo})}),Xi.forEach(function(Mo,Ma){bn.length>=hr||yt&&_i(Mo,Io.concat(Ma))})):function Qo(yt){return yt&&!(yt instanceof Array)&&yt instanceof Object}(Xi)&&(Object.keys(Xi).forEach(function(Mo){bn.length>=hr||Yt(Mo,Xi[Mo],wr)&&bn.push({path:Io.concat(Mo),value:Xi[Mo]})}),Object.keys(Xi).forEach(function(Mo){bn.length>=hr||yt&&_i(Xi[Mo],Io.concat(Mo))}))}.bind(this);return _i(Or,pn),bn}}function Fo(yt,kt){try{return Zi()(yt,kt)}catch{}}function Hi(yt){return function(kt,wr,Yt){return this.descend(wr,kt.expression.value,yt,Yt)}}function ro(yt){return function(kt,wr,Yt){return this.traverse(wr,kt.expression.value,yt,Yt)}}function uo(yt){return function ks(yt,kt){for(var wr=[],Yt=[],hr=0,Or=yt?.length;hr=Yt||kt.expression.value.forEach(function(_i){var Xi={operation:"subscript",scope:"child",expression:_i.expression},Mo=hr.resolve(Xi)(Xi,bn);Or=Or.concat(Mo)})}),uo(Or)},"subscript-child-filter_expression":function(kt,wr,Yt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.descend(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Yt)},"subscript-descendant-filter_expression":function(kt,wr,Yt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.traverse(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Yt)},"subscript-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$..value")}},this.initialize()}return yt.prototype.initialize=function(){this.traverse=Ao(!0),this.descend=Ao(),this._fns["subscript-child-string_literal"]=this._fns["member-child-identifier"],this._fns["member-descendant-numeric_literal"]=this._fns["subscript-descendant-string_literal"]=this._fns["member-descendant-identifier"]},yt.prototype.resolve=function(kt){var wr=[kt.operation,kt.scope,kt.expression.type].join("-"),Yt=this._fns[wr];if(!Yt)throw new Error("couldn't resolve key: "+wr);return Yt.bind(this)},yt.prototype.register=function(kt,wr){if(!(wr instanceof Function))throw new Error("handler must be a function");this._fns[kt]=wr},yt}(),ys=f(15320);function Ji(){var yt=new ys.iX,kt=yt.parseError;return yt.yy.parseError=function(){yt.yy.ast&&yt.yy.ast.initialize(),kt.apply(yt,arguments)},yt}var vs=function(){function yt(){}return yt.ok=function(kt,wr){if(!kt)throw new Error(wr)},yt.equal=function(kt,wr,Yt){if(kt!==wr)throw new Error(Yt)},yt}(),uc=function(){function yt(){}return yt.parse=function(kt){return vs.ok("string"==typeof kt,"we need a path"),(new Ji).parse(kt)},yt.parent=function(kt,wr){vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path");var Yt=this.nodes(kt,wr)[0];return Yt.path.pop(),this.value(kt,Yt.path)},yt.apply=function(kt,wr,Yt){vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),vs.equal(typeof Yt,"function","fn needs to be function");var hr=this.nodes(kt,wr).sort(function(Or,pn){return pn.path.length-Or.path.length});return hr.forEach(function(Or){var pn=Or.path.pop(),bn=this.value(kt,this.stringify(Or.path)),_i=Or.value=Yt.call(kt,bn[pn]);bn[pn]=_i},this),hr},yt.value=function(kt,wr,Yt){if(vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),void 0!==Yt){var hr=this.nodes(kt,wr).shift();if(!hr)return this._vivify(kt,wr,Yt);var Or=hr.path.slice(-1).shift();this.parent(kt,this.stringify(hr.path))[Or]=Yt}return this.query(kt,this.stringify(wr),1).shift()},yt._vivify=function(kt,wr,Yt){var hr=this;vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path");var Or=(new Ji).parse(wr).map(function(bn){return bn.expression.value}),pn=function(bn,_i){var Xi=bn.pop(),Io=hr.value(kt,bn);Io||(pn(bn.concat(),"string"==typeof Xi?{}:[]),Io=hr.value(kt,bn)),Io[Xi]=_i};return pn(Or,Yt),this.query(kt,wr)[0]},yt.query=function(kt,wr,Yt){return vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok("string"==typeof wr,"we need a path"),this.nodes(kt,wr,Yt).map(function(Or){return Or.value})},yt.paths=function(kt,wr,Yt){return vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),this.nodes(kt,wr,Yt).map(function(Or){return Or.path})},yt.nodes=function(kt,wr,Yt){if(vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),0===Yt)return[];var hr=(new Ji).parse(wr),Or=new As,pn=[{path:["$"],value:kt}],bn=[];return hr.length&&"root"==hr[0].expression.type&&hr.shift(),hr.length?(hr.forEach(function(_i,Xi){if(!(bn.length>=Yt)){var Io=Or.resolve(_i),Mo=[];pn.forEach(function(Ma){if(!(bn.length>=Yt)){var Rs=Io(_i,Ma,Yt);Xi==hr.length-1?bn=bn.concat(Rs||[]):Mo=Mo.concat(Rs||[])}}),pn=Mo}}),Yt?bn.slice(0,Yt):bn):pn},yt.stringify=function(kt){vs.ok(kt,"we need a path");var wr="$",Yt={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(kt=this._normalize(kt)).forEach(function(hr){if("root"!=hr.expression.type){var bn,Or=[hr.scope,hr.operation].join("-"),pn=Yt[Or];if(bn="string_literal"==hr.expression.type?JSON.stringify(hr.expression.value):hr.expression.value,!pn)throw new Error("couldn't find template "+Or);wr+=pn.replace(/{{value}}/,bn)}}),wr},yt._normalize=function(kt){if(vs.ok(kt,"we need a path"),"string"==typeof kt)return(new Ji).parse(kt);if(Array.isArray(kt)&&"string"==typeof kt[0]){var wr=[{expression:{type:"root",value:"$"}}];return kt.forEach(function(Yt,hr){"$"==Yt&&0===hr||("string"==typeof Yt&&Yt.match("^[a-zA-Z_]+[a-zA-Z0-9_]*$")?wr.push({operation:"member",scope:"child",expression:{value:Yt,type:"identifier"}}):wr.push({operation:"subscript",scope:"child",expression:{value:Yt,type:"number"==typeof Yt?"numeric_literal":"string_literal"}}))}),wr}if(Array.isArray(kt)&&"object"==typeof kt[0])return kt;throw new Error("couldn't understand path "+kt)},yt}()},15320:(Me,F)=>{var i=function(){var c=function(me,ye,ue,$){for(ue=ue||{},$=me.length;$--;ue[me[$]]=ye);return ue},x=[1,5],B=[1,6],m=[1,7],S=[1,8],g=[1,9],_=[1,18],R=[1,19],T=[1,20],E=[1,12,14,22],j=[1,29],M=[1,30],k=[1,33],K=[1,35],W=[1,31],V=[1,36],Z=[1,37],q=[24,28],ne={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(ye,ue,$,o,h,A,C){o.ast||(o.ast=te,te.initialize());var O=A.length-1;switch(h){case 1:return o.ast.set({expression:{type:"root",value:A[O]}}),o.ast.unshift(),o.ast.yield();case 2:return o.ast.set({expression:{type:"root",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 3:return o.ast.unshift(),o.ast.yield();case 4:return o.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:o.ast.set({operation:"member"}),o.ast.push();break;case 8:o.ast.set({operation:"subscript"}),o.ast.push();break;case 9:case 19:o.ast.set({scope:"child"});break;case 10:case 20:o.ast.set({scope:"descendant"});break;case 12:o.ast.set({scope:"child",operation:"member"});break;case 14:o.ast.set({expression:{type:"wildcard",value:A[O]}});break;case 15:o.ast.set({expression:{type:"identifier",value:A[O]}});break;case 16:o.ast.set({expression:{type:"script_expression",value:A[O]}});break;case 17:o.ast.set({expression:{type:"numeric_literal",value:parseInt(A[O])}});break;case 24:A[O].length>1?o.ast.set({expression:{type:"union",value:A[O]}}):this.$=A[O];break;case 25:this.$=[A[O]];break;case 26:this.$=A[O-2].concat(A[O]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(A[O])}},o.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:A[O]}},o.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:A[O]}},o.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:A[O]}},o.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:A[O]}},o.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:A[O]}},o.ast.set(this.$);break;case 33:case 34:this.$=A[O]}},table:[{3:1,4:[1,2],6:3,13:4,15:x,16:B,17:m,18:S,19:g},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},c(E,[2,12]),c(E,[2,14]),c(E,[2,15]),c(E,[2,16]),c(E,[2,17]),c(E,[2,18]),{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},c(E,[2,5]),c(E,[2,7]),c(E,[2,8]),c(E,[2,9]),c(E,[2,10]),c(E,[2,19]),c(E,[2,20]),{13:23,15:x,16:B,17:m,18:S,19:g},{13:24,15:x,16:B,17:m,18:S,19:g,22:[1,25]},{15:j,17:M,18:k,23:26,25:27,26:28,27:32,29:34,30:K,31:W,32:V,33:Z},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},c(E,[2,6]),c(E,[2,11]),c(E,[2,13]),{15:j,17:M,18:k,23:38,25:27,26:28,27:32,29:34,30:K,31:W,32:V,33:Z},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},c(q,[2,25]),c(q,[2,27]),c(q,[2,28]),c(q,[2,29]),c(q,[2,33]),c(q,[2,34]),{24:[1,41]},c(E,[2,21]),{18:k,27:42,29:34,30:K,32:V,33:Z},c(E,[2,22]),c(q,[2,26])],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(ye,ue){if(!ue.recoverable){var $=new Error(ye);throw $.hash=ue,$}this.trace(ye)},parse:function(ye){var $=[0],h=[null],A=[],C=this.table,O="",z=0,H=0,I=0,J=A.slice.call(arguments,1),ee=Object.create(this.lexer),se={yy:{}};for(var de in this.yy)Object.prototype.hasOwnProperty.call(this.yy,de)&&(se.yy[de]=this.yy[de]);ee.setInput(ye,se.yy),se.yy.lexer=ee,se.yy.parser=this,typeof ee.yylloc>"u"&&(ee.yylloc={});var Ae=ee.yylloc;A.push(Ae);var Qe,Ie=ee.options&&ee.options.ranges;this.parseError="function"==typeof se.yy.parseError?se.yy.parseError:Object.getPrototypeOf(this).parseError;for(var Ce,Xe,Te,ke,Ee,De,Re,$e,ve={};;){if(this.defaultActions[Te=$[$.length-1]]?ke=this.defaultActions[Te]:((null===Ce||typeof Ce>"u")&&(Qe=void 0,"number"!=typeof(Qe=ee.lex()||1)&&(Qe=this.symbols_[Qe]||Qe),Ce=Qe),ke=C[Te]&&C[Te][Ce]),typeof ke>"u"||!ke.length||!ke[0]){var nt;for(De in $e=[],C[Te])this.terminals_[De]&&De>2&&$e.push("'"+this.terminals_[De]+"'");nt=ee.showPosition?"Parse error on line "+(z+1)+":\n"+ee.showPosition()+"\nExpecting "+$e.join(", ")+", got '"+(this.terminals_[Ce]||Ce)+"'":"Parse error on line "+(z+1)+": Unexpected "+(1==Ce?"end of input":"'"+(this.terminals_[Ce]||Ce)+"'"),this.parseError(nt,{text:ee.match,token:this.terminals_[Ce]||Ce,line:ee.yylineno,loc:Ae,expected:$e})}if(ke[0]instanceof Array&&ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+Ce);switch(ke[0]){case 1:$.push(Ce),h.push(ee.yytext),A.push(ee.yylloc),$.push(ke[1]),Ce=null,Xe?(Ce=Xe,Xe=null):(H=ee.yyleng,O=ee.yytext,z=ee.yylineno,Ae=ee.yylloc,I>0&&I--);break;case 2:if(ve.$=h[h.length-(Re=this.productions_[ke[1]][1])],ve._$={first_line:A[A.length-(Re||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Re||1)].first_column,last_column:A[A.length-1].last_column},Ie&&(ve._$.range=[A[A.length-(Re||1)].range[0],A[A.length-1].range[1]]),typeof(Ee=this.performAction.apply(ve,[O,H,z,se.yy,ke[1],h,A].concat(J)))<"u")return Ee;Re&&($=$.slice(0,-1*Re*2),h=h.slice(0,-1*Re),A=A.slice(0,-1*Re)),$.push(this.productions_[ke[1]][0]),h.push(ve.$),A.push(ve._$),$.push(C[$[$.length-2]][$[$.length-1]]);break;case 3:return!0}}return!0}},te={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(me){for(var ye in me)this._node[ye]=me[ye];return this._node},node:function(me){return arguments.length&&(this._node=me),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var me=this._nodes;return this.initialize(),me}};function ae(){this.yy={}}return ne.lexer=function(){return{EOF:1,parseError:function(ue,$){if(!this.yy.parser)throw new Error(ue);this.yy.parser.parseError(ue,$)},setInput:function(ye,ue){return this.yy=ue||this.yy||{},this._input=ye,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ye=this._input[0];return this.yytext+=ye,this.yyleng++,this.offset++,this.match+=ye,this.matched+=ye,ye.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ye},unput:function(ye){var ue=ye.length,$=ye.split(/(?:\r\n?|\n)/g);this._input=ye+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ue),this.offset-=ue;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1&&(this.yylineno-=$.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===o.length?this.yylloc.first_column:0)+o[o.length-$.length].length-$[0].length:this.yylloc.first_column-ue},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-ue]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(ye){this.unput(this.match.slice(ye))},pastInput:function(){var ye=this.matched.substr(0,this.matched.length-this.match.length);return(ye.length>20?"...":"")+ye.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ye=this.match;return ye.length<20&&(ye+=this._input.substr(0,20-ye.length)),(ye.substr(0,20)+(ye.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ye=this.pastInput(),ue=new Array(ye.length+1).join("-");return ye+this.upcomingInput()+"\n"+ue+"^"},test_match:function(ye,ue){var $,o,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(o=ye[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ye[0].length},this.yytext+=ye[0],this.match+=ye[0],this.matches=ye,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ye[0].length),this.matched+=ye[0],$=this.performAction.call(this,this.yy,this,ue,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var A in h)this[A]=h[A];return!1}return!1},next:function(){if(this.done)return this.EOF;var ye,ue,$,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),A=0;Aue[0].length)){if(ue=$,o=A,this.options.backtrack_lexer){if(!1!==(ye=this.test_match($,h[A])))return ye;if(this._backtrack){ue=!1;continue}return!1}if(!this.options.flex)break}return ue?!1!==(ye=this.test_match(ue,h[o]))&&ye:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(ue){this.conditionStack.push(ue)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ue){return(ue=this.conditionStack.length-1-Math.abs(ue||0))>=0?this.conditionStack[ue]:"INITIAL"},pushState:function(ue){this.begin(ue)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(ue,$,o,h){switch(o){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return $.yytext=$.yytext.substr(1,$.yyleng-2),32;case 11:return $.yytext=$.yytext.substr(1,$.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}(),ae.prototype=ne,ne.Parser=ae,new ae}();F.iX=i.Parser},52191:(Me,F,f)=>{var i=f(40573);const c="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,x=()=>c.now(),m=g=>g===1/0||(g=>g&&g===Math.floor(g)&&g>0&&isFinite(g))(g);class S{constructor({max:_=1/0,ttl:R,updateAgeOnGet:T=!1,checkAgeOnGet:E=!1,noUpdateTTL:j=!1,dispose:M,noDisposeOnSet:k=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,void 0!==R&&!m(R))throw new TypeError("ttl must be positive integer or Infinity if set");if(!m(_))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=R,this.max=_,this.updateAgeOnGet=!!T,this.checkAgeOnGet=!!E,this.noUpdateTTL=!!j,this.noDisposeOnSet=!!k,void 0!==M){if("function"!=typeof M)throw new TypeError("dispose must be function if set");this.dispose=M}this.timer=void 0,this.timerExpiration=void 0}setTimer(_,R){if(this.timerExpiration<_)return;this.timer&&clearTimeout(this.timer);const T=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const E in this.expirations){this.setTimer(E,E-x());break}},R);T.unref&&T.unref(),this.timerExpiration=_,this.timer=T}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return i.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const _=this.dispose!==S.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[R,T]of _)this.dispose(T,R,"delete")}setTTL(_,R=this.ttl){const T=this.expirationMap.get(_);if(void 0!==T){const E=this.expirations[T];!E||E.length<=1?delete this.expirations[T]:this.expirations[T]=E.filter(j=>j!==_)}if(R!==1/0){const E=Math.floor(x()+R);this.expirationMap.set(_,E),this.expirations[E]||(this.expirations[E]=[],this.setTimer(E,R)),this.expirations[E].push(_)}else this.expirationMap.set(_,1/0)}set(_,R,{ttl:T=this.ttl,noUpdateTTL:E=this.noUpdateTTL,noDisposeOnSet:j=this.noDisposeOnSet}={}){if(!m(T))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(_)){E||this.setTTL(_,T);const M=this.data.get(_);M!==R&&(this.data.set(_,R),j||this.dispose(M,_,"set"))}else this.setTTL(_,T),this.data.set(_,R);for(;this.size>this.max;)this.purgeToCapacity();return this}has(_){return this.data.has(_)}getRemainingTTL(_){const R=this.expirationMap.get(_);return R===1/0?R:void 0!==R?Math.max(0,Math.ceil(R-x())):0}get(_,{updateAgeOnGet:R=this.updateAgeOnGet,ttl:T=this.ttl,checkAgeOnGet:E=this.checkAgeOnGet}={}){const j=this.data.get(_);if(!E||0!==this.getRemainingTTL(_))return R&&this.setTTL(_,T),j;this.delete(_)}dispose(_,R){}delete(_){const R=this.expirationMap.get(_);if(void 0!==R){const T=this.data.get(_);this.data.delete(_),this.expirationMap.delete(_);const E=this.expirations[R];return E&&(E.length<=1?delete this.expirations[R]:this.expirations[R]=E.filter(j=>j!==_)),this.dispose(T,_,"delete"),0===this.size&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const _ in this.expirations){const R=this.expirations[_];if(!(this.size-R.length>=this.max)){const T=this.size-this.max,E=[];for(const j of R.splice(0,T))E.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,M]of E)this.dispose(M,j,"evict");return}{delete this.expirations[_];const T=[];for(const E of R)T.push([E,this.data.get(E)]),this.data.delete(E),this.expirationMap.delete(E);for(const[E,j]of T)this.dispose(j,E,"evict")}}}get size(){return this.data.size}purgeStale(){const _=Math.ceil(x());for(const R in this.expirations){if("Infinity"===R||R>_)return;const T=[...this.expirations[R]||[]],E=[];delete this.expirations[R];for(const j of T)E.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,M]of E)this.dispose(M,j,"stale")}0===this.size&&this.cancelTimer()}*entries(){for(const _ in this.expirations)for(const R of this.expirations[_])yield[R,this.data.get(R)]}*keys(){for(const _ in this.expirations)for(const R of this.expirations[_])yield R}*values(){for(const _ in this.expirations)for(const R of this.expirations[_])yield this.data.get(R)}[Symbol.iterator](){return this.entries()}}Me.exports=S},33065:(Me,F,f)=>{"use strict";f.r(F),f.d(F,{RestoreComponent:()=>ue});var i=f(10467),c=f(54438),x=f(89417),B=f(88834),m=f(25596),S=f(99213),g=f(99631),_=f(5951),R=f(82798),T=f(34635),E=f(20180),j=f(52778),M=f(65571),k=f(12621),K=f(30046),W=f(80865),V=f(3902),Z=f(53719);const q=$=>["/account",$];function ne($,o){1&$&&(c.j41(0,"mat-error"),c.EFF(1,"Private key is "),c.j41(2,"strong"),c.EFF(3,"required"),c.k0s()())}function te($,o){if(1&$&&(c.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),c.EFF(3,"Private Key"),c.k0s(),c.j41(4,"mat-card-subtitle"),c.EFF(5,"Enter your Stellar private key (starts with 'S')"),c.k0s()(),c.j41(6,"mat-card-content"),c.nrm(7,"br"),c.j41(8,"mat-form-field",8)(9,"mat-label"),c.EFF(10,"Stellar Private Key"),c.k0s(),c.nrm(11,"textarea",9,0),c.DNE(13,ne,4,0,"mat-error"),c.k0s()(),c.j41(14,"mat-card-actions",10)(15,"button",11),c.EFF(16,"Restore"),c.k0s()()()),2&$){const h=c.XpG();c.R7$(13),c.vxM(h.addressForm.controls.recoveryPhrase.hasError("required")?13:-1),c.R7$(2),c.Y8G("disabled",h.app.loading())}}function ie($,o){if(1&$&&(c.j41(0,"a",14)(1,"mat-icon",15),c.EFF(2,"account_circle"),c.k0s(),c.j41(3,"span",16),c.EFF(4),c.k0s(),c.j41(5,"span",17),c.EFF(6),c.k0s()()),2&$){const h=o.$implicit;c.Y8G("routerLink",c.eq3(3,q,h.did.uri)),c.R7$(4),c.JRh(h.metadata.name),c.R7$(2),c.JRh(h.did.uri)}}function ae($,o){if(1&$&&(c.j41(0,"h1"),c.EFF(1,"Imported Accounts"),c.k0s(),c.j41(2,"mat-list"),c.Z7z(3,ie,7,5,"a",14,c.fX1),c.k0s()),2&$){const h=c.XpG(2);c.R7$(3),c.Dyx(h.importedIdentities)}}function me($,o){if(1&$){const h=c.RV6();c.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),c.EFF(3,"Portable DID"),c.k0s(),c.j41(4,"mat-card-subtitle"),c.EFF(5,"Choose your backup file (portableIdentity.json)"),c.k0s()(),c.j41(6,"mat-card-content"),c.nrm(7,"br"),c.j41(8,"button",12),c.bIt("click",function(){c.eBV(h);const C=c.XpG();return c.Njj(C.editFile({}))}),c.j41(9,"mat-icon"),c.EFF(10,"upload_file"),c.k0s(),c.j41(11,"span"),c.EFF(12,"Choose portable DID files"),c.k0s()(),c.j41(13,"input",13),c.bIt("change",function(C){c.eBV(h);const O=c.XpG();return c.Njj(O.onFileSelected(C))}),c.k0s()()(),c.DNE(14,ae,5,0)}if(2&$){const h=c.XpG();c.R7$(14),c.vxM(h.importedIdentities.length>0?14:-1)}}function ye($,o){1&$&&(c.j41(0,"mat-card",7)(1,"mat-card-content")(2,"p"),c.EFF(3,"Support for Nostr is coming in the future"),c.k0s()()())}let ue=(()=>{class ${constructor(){this.fb=(0,c.WQX)(x.ok),this.crypto=(0,c.WQX)(E.j),this.app=(0,c.WQX)(j.d),this.protocol=(0,c.WQX)(W.w),this.route=(0,c.WQX)(K.Ix),this.identity=(0,c.WQX)(T.K),this.importedIdentities=[],this.addressForm=this.fb.group({recoveryPhrase:[null,x.k0.required],importType:["ariton",x.k0.required]})}editFile(h){return(0,i.A)(function*(){document.getElementById("input")?.click()})()}query(){var h=this;return(0,i.A)(function*(){const A={message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",A),console.log(h.identity.web5.agent),console.log(h.identity.web5.dwn),console.log(h.identity.web5.dwn.records),console.log("Object above");var{records:O,status:z}=yield h.identity.web5.dwn.records.query(A);console.log("Status:",z),console.log(O);const C={from:h.identity.did,message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",C);var{records:O,status:z}=yield h.identity.web5.dwn.records.query(C);console.log("Status:",z),console.log(O)})()}onFileSelected(h){var A=this;return(0,i.A)(function*(){const C=h.target.files;if(C&&0!==C.length){console.log("Uploading number of files:",C.length);for(let O=0;O{console.error(`Error reading file ${z.name}:`,H.error)},H.readAsText(z)}}})()}onSubmit(){var h=this;return(0,i.A)(function*(){if(console.log(h.addressForm.controls.recoveryPhrase.value),h.addressForm.disable(),h.app.loading.set(!0),"stellar"===h.addressForm.controls.importType.value){const A=h.identity.activeAgent(),C=yield k.hX.fromPrivateKey({privateKey:h.addressForm.controls.recoveryPhrase.value});console.log("Bearer DID: ",C);const O=yield C.export(),z={portableDid:O,metadata:{name:"Stellar Identity",tenant:O.uri,uri:O.uri}};try{console.log("Portable Identity:",z),yield A.identity.import({portableIdentity:z})}catch(s){console.error(s)}h.identity.identities=yield A.identity.list();const H=yield h.identity.registerAccount(O.uri,h.app.account().password);console.log(`Register protocols for ${O.uri}`),yield h.protocol.register(H),h.app.account(),h.identity.changeAccount(O.uri),h.route.navigate(["/accounts"])}else{let A=yield h.crypto.createPassword();A="123"}h.app.initialized.set(!0),h.app.loading.set(!1)})()}static{this.\u0275fac=function(A){return new(A||$)}}static{this.\u0275cmp=c.VBU({type:$,selectors:[["app-restore"]],standalone:!0,features:[c.aNF],decls:16,vars:5,consts:[["recoveryPhrase",""],["novalidate","",3,"ngSubmit","formGroup"],["formControlName","importType"],["value","ariton"],["value","did:is",3,"disabled"],["value","stellar",3,"disabled"],["value","nostr",3,"disabled"],[1,"shipping-card"],[1,"full-width"],["matInput","","placeholder","Secret Recovery Phrase","formControlName","recoveryPhrase"],["align","end"],["mat-flat-button","","color","primary","type","submit",3,"disabled"],["type","button","mat-button","",3,"click"],["type","file","id","input",2,"display","none",3,"change"],["mat-list-item","",1,"selectable-list-item",3,"routerLink"],["matListItemIcon",""],["matListItemTitle",""],["matListItemLine",""]],template:function(A,C){1&A&&(c.j41(0,"h1"),c.EFF(1,"Restore your account"),c.k0s(),c.j41(2,"form",1),c.bIt("ngSubmit",function(){return C.onSubmit()}),c.j41(3,"p")(4,"mat-button-toggle-group",2)(5,"mat-button-toggle",3),c.EFF(6,"Ariton"),c.k0s(),c.j41(7,"mat-button-toggle",4),c.EFF(8,"FreeID"),c.k0s(),c.j41(9,"mat-button-toggle",5),c.EFF(10,"Stellar"),c.k0s(),c.j41(11,"mat-button-toggle",6),c.EFF(12,"Nostr"),c.k0s()()(),c.DNE(13,te,17,2,"mat-card",7)(14,me,15,1)(15,ye,4,0,"mat-card",7),c.k0s()),2&A&&(c.R7$(2),c.Y8G("formGroup",C.addressForm),c.R7$(5),c.Y8G("disabled",!0),c.R7$(2),c.Y8G("disabled",!0),c.R7$(2),c.Y8G("disabled",!0),c.R7$(2),c.vxM("stellar"==C.addressForm.controls.importType.value?13:"ariton"==C.addressForm.controls.importType.value?14:15))},dependencies:[g.fS,g.fg,Z.rl,Z.nJ,Z.TL,B.Hl,B.$z,M.Vg,M.ec,M.pc,R.Ve,S.m_,S.An,V.Fg,V.jt,V.YE,V.ZV,V.C_,V.yE,K.iI,K.Wk,_.Wk,m.Hu,m.RN,m.YY,m.m2,m.MM,m.Lc,m.dh,x.X1,x.qT,x.me,x.BC,x.cb,x.j4,x.JD],styles:[".shipping-card[_ngcontent-%COMP%]{min-width:120px;margin:20px auto}.mat-radio-button[_ngcontent-%COMP%]{display:block;margin:5px 0}.row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.col[_ngcontent-%COMP%]{flex:1;margin-right:20px}.col[_ngcontent-%COMP%]:last-child{margin-right:0}.link-input[_ngcontent-%COMP%]{display:flex;align-items:baseline}.link-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:.4em}.account-action-button[_ngcontent-%COMP%]{padding-top:1.2em}.example-action-buttons[_ngcontent-%COMP%]{padding-bottom:20px}.example-headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.example-headers-align[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] + .mat-mdc-form-field[_ngcontent-%COMP%]{margin-left:8px}.selectable-list-item[_ngcontent-%COMP%]{cursor:pointer}.selectable-list-item[_ngcontent-%COMP%]:hover{background-color:var(--mdc-list-list-item-leading-avatar-color)}"]})}}return $})()},52778:(Me,F,f)=>{"use strict";f.d(F,{d:()=>Z,f:()=>V});var i=f(10467),c=f(54438),x=f(31948),B=f(20180),m=f(34635),g=f.t(JSON.parse('{"name":"ariton","version":"0.0.2","scripts":{"ng":"ng","start":"ng serve --port 4201","start2":"ng serve --port 4210","build":"ng build","watch":"ng build --watch --configuration development","test":"ng test","deploy":"ng deploy app","i18n":"ng extract-i18n --format=json --output-path src/locale"},"repository":{"type":"git","url":"git+https://github.com/block-core/ariton.git"},"private":true,"dependencies":{"@angular-builders/custom-webpack":"^18.0.0","@angular/animations":"^18.2.8","@angular/cdk":"^18.2.8","@angular/common":"^18.2.8","@angular/compiler":"^18.2.8","@angular/core":"^18.2.8","@angular/forms":"^18.2.8","@angular/material":"^18.2.8","@angular/platform-browser":"^18.2.8","@angular/platform-browser-dynamic":"^18.2.8","@angular/router":"^18.2.8","@angular/service-worker":"^18.2.8","@scure/bip39":"^1.4.0","@web5/agent":"^0.8.1","@web5/api":"^0.12.0","@web5/credentials":"^1.1.3","@web5/crypto":"^1.0.6","@web5/dids":"^1.2.0","@web5/identity-agent":"^0.7.1","@zxing/ngx-scanner":"^18.0.1","base32.js":"^0.1.0","cropperjs":"^1.6.2","crypto-browserify":"^3.12.1","process":"^0.11.10","qrcode":"^1.5.4","rxjs":"~7.8.1","stream":"^0.0.3","stream-browserify":"^3.0.0","tslib":"^2.7.0","zone.js":"~0.15.0"},"devDependencies":{"@angular-devkit/build-angular":"^18.2.8","@angular/cli":"^18.2.8","@angular/compiler-cli":"^18.2.8","@angular/localize":"^18.2.8","@types/jasmine":"~5.1.4","@types/qrcode":"^1.5.5","angular-cli-ghpages":"^2.0.3","jasmine-core":"~5.3.0","karma":"~6.4.4","karma-chrome-launcher":"~3.2.0","karma-coverage":"~2.2.1","karma-jasmine":"~5.1.0","karma-jasmine-html-reporter":"~2.1.0","typescript":"~5.5.4"}}'),2),_=f(80865),R=f(39434),T=f(1005),E=f(95416),j=f(21093);let M=(()=>{class q{constructor(){this.connection=(0,c.WQX)(j.K)}start(){var te=this;return(0,i.A)(function*(){const ie=function(){var ae=(0,i.A)(function*(){try{console.log("Processing task..."),console.log("connections count:",te.connection.requests().length),console.log("CONNECTIONS:",te.connection.requests());const me=te.connection.requests().filter(ye=>"credential"===ye.record.tags.type);console.log("credentialRequests:",me);for(const ye of me){console.log("Processing connection:",ye);const ue=yield te.connection.acceptFriendRequest(ye);ye.data.recordId=ue?.id,ye.data.did=ye.record.creator,console.log("REQUEST DATA:",ye.data);const $=yield te.connection.create(ye,j.X.Friend);console.log("Connection Entry that was made: ",$),yield te.connection.deleteRequest(ye)}}catch(me){console.error("Error processing task:",me)}finally{setTimeout(ie,6e4)}});return function(){return ae.apply(this,arguments)}}();yield ie()})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=c.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();f(68530);let K=(()=>{class q{constructor(){this.connections=(0,c.WQX)(j.K),this.identity=(0,c.WQX)(m.K)}initialize(){return(0,i.A)(function*(){})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=c.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();var W=f(43794),V=function(q){return q[q.Initial=0]="Initial",q[q.NewUser=1]="NewUser",q[q.Locked=2]="Locked",q[q.Unlocked=3]="Unlocked",q[q.Error=4]="Error",q}(V||{});let Z=(()=>{class q{constructor(){var te=this;this.onboardingState=(0,c.vPA)(V.Initial),this.initialized=(0,c.vPA)(!1),this.loading=(0,c.vPA)(!1),this.localStorage=(0,c.WQX)(x.s),this.storage=(0,c.WQX)(W.n),this.hash=(0,c.WQX)(T.G),this.worker=(0,c.WQX)(M),this.crypto=(0,c.WQX)(B.j),this.identity=(0,c.WQX)(m.K),this.profile=(0,c.WQX)(R.p),this.connection=(0,c.WQX)(j.K),this.protocol=(0,c.WQX)(_.w),this.snackBar=(0,c.WQX)(E.UG),this.event=(0,c.WQX)(K),this.state=(0,c.vPA)({loginAction:"/dashboard",selectedIdentity:"",hidden:{}}),this.account=(0,c.vPA)({did:"",recoveryPhrase:"",password:"",passwordHash:"",bundleTimestamp:""}),this.identities=(0,c.vPA)([]),this.agent=(0,c.vPA)(null),this.activeIdentity=(0,c.vPA)(null),this.params=(0,c.vPA)({}),this.package=g,this.aritonDid="did:dht:mo7am9cz6qrjwoc4kapffeue9kjw6igdh9dmqd3ywdif6qa7ju4o",console.log(`Ariton v${this.package.version} (${this.hash.getTimestamp()})`),this.dependencies=Object.entries(this.package.dependencies).map(([ie,ae])=>({name:ie,version:ae})),(0,c.QZP)((0,i.A)(function*(){te.identity.locked()||(yield te.onUnlocked())}))}saveAgent(te){this.localStorage.save("agent",te)}saveIdentities(te){te&&0!=te.length?this.localStorage.save("identities",te):console.log("IDENTITIES ARE EMPTY!!!")}saveAccounts(te){this.localStorage.save("accounts",te)}saveState(te){this.localStorage.save("state",te)}hasStateBeenSet(){return!!this.localStorage.read("state")}createAccount(){var te=this;return(0,i.A)(function*(){te.localStorage.save("state",{selectedIdentity:"",hidden:{},loginAction:"/introduction"}),yield te.initialize()})()}openSnackBar(te,ie=2e3){this.snackBar.open(te,void 0,{duration:ie})}initialize(){var te=this;return(0,i.A)(function*(){te.loading.set(!0),console.log("Initializing Ariton...");let ie=te.localStorage.read("state");if(!ie)return te.onboardingState.set(V.NewUser),void te.loading.set(!1);let ye,ae=te.localStorage.read("identities"),me=te.localStorage.read("agent");if(console.log("IDENTITIES, AGENT from local:",ae,me),me){let ue;if(ie.selectedIdentity?(ue=ae.find($=>$.did===ie.selectedIdentity),console.log("!!! IDENTITIES: ",ae),console.log("!!! IDENTITY: ",ue),te.activeIdentity.set(ue),te.agent.set(me)):0===ae.length&&(ue=ae[0],te.activeIdentity.set(ue),console.log("!!! IDENTITY2: ",ue)),me.password){if(ye=yield te.identity.connect(ue.did,me.password),0===ae.length){const h=(yield(ye?.web5.agent).identity.list()).map(A=>({did:A.metadata.uri,bundleTimestamp:""}));te.saveIdentities(h),te.identities.set(h)}else te.saveIdentities(ae),te.identities.set(ae);ye?(te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES2",te.identities()),te.identity.locked.set(!1)):te.loading.set(!1)}else console.log("LOCKED TRUE, IDENTITIES3",te.identities()),te.identity.locked.set(!0),te.onboardingState.set(V.Locked)}else{console.log("No agent found");const ue=yield te.crypto.createPassword();if(ye=yield te.identity.initialConnect(ue),void 0===ye)return te.localStorage.remove("state"),te.onboardingState.set(V.Error),void te.loading.set(!1);console.log(ye),console.log("Initialize connect finished."),me={did:ye.web5.agent.agentDid.uri,recoveryPhrase:ye.recoveryPhrase,password:ue},te.saveAgent(me);const $={did:ye.did,bundleTimestamp:""};ae=[$],te.saveIdentities(ae),te.identities.set(ae),console.log("Identities saved:",ae),ie.selectedIdentity=ye.did,te.saveState(ie),te.agent.set(me),te.activeIdentity.set($),te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES1",te.identities()),te.identity.locked.set(!1)}te.state.set(ie)})()}onUnlocked(){var te=this;return(0,i.A)(function*(){try{yield te.profile.openCurrentUserProfile(te.activeIdentity().did)}catch(ie){console.error("Failed to load user profile:",ie)}yield te.loadAppData(),te.initialized.set(!0),te.loading.set(!1),te.worker.start(),yield te.event.initialize(),yield te.firstTimeInitialization()})()}loadAppData(){var te=this;return(0,i.A)(function*(){console.log("Loading app data..."),yield te.connection.initialize(),console.log("App data loaded.")})()}firstTimeInitialization(){var te=this;return(0,i.A)(function*(){console.log("First time initialization..."),console.log(te.identities()),console.log(te.activeIdentity()),null==te.hash.getTimestamp()||te.activeIdentity().bundleTimestamp!==te.hash.getTimestamp()?(console.log("Bundle hash is different from the previous one. Re-registering protocols..."),console.log(`Register protocols for ${te.identity.did}`),te.protocol.register(te.identity.web5),te.activeIdentity().bundleTimestamp=te.hash.getTimestamp(),te.saveIdentities(te.identities())):console.log("Bundle hash is the same as the previous one. No need to re-register protocols.")})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=c.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})()},21093:(Me,F,f)=>{"use strict";f.d(F,{K:()=>T,X:()=>R});var i=f(10467),c=f(54438),x=f(34635),B=f(68530),m=f(77494),S=f(26703),g=f(76336),_=f(22312),R=function(E){return E.Data="data",E.Friend="friend",E.Credential="credential",E}(R||{});let T=(()=>{class E{constructor(){this.identity=(0,c.WQX)(x.K),this.utility=(0,c.WQX)(S.Q),this.blocks=(0,c.vPA)([]),this.connections=(0,c.vPA)([]),this.friends=(0,c.EWP)(()=>this.connections().filter(M=>"friend"==M.record.tags.type)),this.friendRequests=(0,c.EWP)(()=>this.requests().filter(M=>"friend"==M.record.tags.type)),this.requests=(0,c.vPA)([]),this.loading=(0,c.vPA)(!1)}create(M,k){var K=this;return(0,i.A)(function*(){const W={type:k};let V=M.data;console.log("CONNECTION SERVICE ENTRY DATA:",V);const{record:Z,status:q}=yield K.identity.web5.dwn.records.create({data:V,message:{tags:W,recipient:M.record.creator,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema,dataFormat:B.Q.types.connection.dataFormats[0]}});console.log("Connection created:",q,Z);const ne={record:Z,data:V,id:Z.id};return K.connections.update(te=>[ne,...te]),K.utility.executeAsyncWithToast(M.record.send(K.identity.did)),ne})()}validateAndStoreCredential(M){var k=this;return(0,i.A)(function*(){const K=M.data.vc;if(!K)throw new Error("The incoming VC is missing.");try{yield g.l6.verify({vcJwt:K})}catch(ne){return void console.error("Error verifying VC:",ne)}const W=g.l6.parseJwt({vcJwt:K});console.log("PARSED INVCOMING VC:",W),console.log("vc.issuer === this.identity.did:",W.issuer===k.identity.did);const{record:Z}=yield k.identity.web5.dwn.records.create({data:K,message:{schema:_.eE.friendship,dataFormat:_.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",Z);const{status:q}=yield Z.send(k.identity.did);console.log("Record sent:",q,Z),yield M.record.delete(),M.record.send(k.identity.did),console.log("Friend request validated")})()}removeFriendship(M){return(0,i.A)(function*(){})()}acceptFriendRequest(M){var k=this;return(0,i.A)(function*(){const K=M.data.vc;if(!K)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",K),!K)return;try{yield g.l6.verify({vcJwt:K})}catch(te){return void console.error("Error verifying VC:",te)}const W=g.l6.parseJwt({vcJwt:K});if(W.subject!=k.identity.did)return void console.error("VC is not valid.");if(W.issuer!=M.record.creator)return void console.error("VC is not valid.");const Z=W.vcDataModel.credentialSubject.vc;console.log("INNER VC JWT:",Z);try{yield g.l6.verify({vcJwt:Z})}catch(te){return void console.error("Error verifying VC:",te)}const q=g.l6.parseJwt({vcJwt:Z});if(console.log("VC issuer: ",q.issuer),console.log("this.identity.did",k.identity.did),q.issuer!=k.identity.did)return void console.error("VC is not valid.");if(q.subject!=W.issuer)return void console.error("VC is not valid.");console.log("Friend request validated");const{record:ne}=yield k.identity.web5.dwn.records.create({data:K,message:{schema:_.eE.friendship,dataFormat:_.eE.format,published:!1}});return console.log("TWO WAY VC RECORD:",ne),ne.send(k.identity.did),ne})()}approveFriendRequest(M){var k=this;return(0,i.A)(function*(){const K=M.data.vc;if(!K)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",K),!K)return;try{yield g.l6.verify({vcJwt:K})}catch(Z){return void console.error("Error verifying VC:",Z)}const W=g.l6.parseJwt({vcJwt:K});if(W.subject!=k.identity.did)return void console.error("VC is not valid.");if(W.issuer!=M.record.creator)return void console.error("VC is not valid.");const{record:V}=yield k.identity.web5.dwn.records.create({data:K,message:{schema:_.eE.friendship,dataFormat:_.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",V),V.send(k.identity.did),yield k.deleteRequest(M)})()}initialize(){var M=this;return(0,i.A)(function*(){const k=yield M.loadBlocks();M.blocks.set(k);const K=yield M.loadConnections();M.connections.set(K),yield M.reloadRequests()})()}reloadRequests(){var M=this;return(0,i.A)(function*(){M.loading.set(!0);const k=yield M.loadRequests();M.requests.set(k),M.loading.set(!1)})()}request(M,k,K){var W=this;return(0,i.A)(function*(){const V=k,Z={type:K},{record:q,status:ne}=yield W.identity.web5.dwn.records.create({data:V,message:{tags:Z,recipient:M,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema,dataFormat:B.Q.types.request.dataFormats[0]}});console.log("Notification created:",ne,q);const te={record:q,data:V,id:q.id,direction:"out"};return W.requests.update(ie=>[te,...ie]),W.utility.executeAsyncWithToast(te.record.send(W.identity.did)),W.utility.executeAsyncWithToast(te.record.send(M)),te})()}deleteBlock(M){var k=this;return(0,i.A)(function*(){yield M.record.delete(),k.blocks.update(K=>[...K.filter(W=>W.id!==M.id)]),k.utility.executeAsyncWithToast(M.record.send(k.identity.did))})()}deleteConnection(M){var k=this;return(0,i.A)(function*(){yield M.record.delete(),k.connections.update(K=>[...K.filter(W=>W.id!==M.id)]),k.utility.executeAsyncWithToast(M.record.send(k.identity.did))})()}deleteRequest(M){var k=this;return(0,i.A)(function*(){const K=M.record.creator;console.log("Delete requested for this author:"+K),yield M.record.delete(),k.requests.update(W=>[...W.filter(V=>V.id!==M.id)]),k.utility.executeAsyncWithToast(M.record.send(k.identity.did)),k.utility.executeAsyncWithToast(M.record.send(K==k.identity.did?M.record.recipient:K))})()}deleteRequests(M){var k=this;return(0,i.A)(function*(){if(!M)return;const K=yield k.loadRequests(M);for(const W of K)console.log("DELETE THIS ENTRY:",W),yield k.deleteRequest(W)})()}deleteConnections(M){var k=this;return(0,i.A)(function*(){if(!M)return;const K=yield k.loadConnections(M);for(const W of K)yield W.record.delete(),yield W.record.send(k.identity.did),k.connections.update(V=>[...V.filter(Z=>Z.id!==W.id)])})()}block(M){var k=this;return(0,i.A)(function*(){if(console.log("BLOCKS THIS DID:",M),!M)return;const K={did:M};console.log("Delete all Requests and Connections before updating block list."),yield k.deleteRequests(M),yield k.deleteConnections(M);let W=k.blocks().find(V=>V.data.did==M);if(!W){const{records:V}=yield k.identity.web5.dwn.records.query({message:{filter:{recipient:M,protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]},dateSort:m.U0.CreatedAscending}});let Z;if(0==V.length){const{record:q}=yield k.identity.web5.dwn.records.create({data:{did:M},message:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]}});Z=q}else Z=V[0];W={record:Z,data:K,id:Z.id},k.blocks.update(q=>[...q,W])}return console.log("The Block record",W),W})()}loadRequests(M){var k=this;return(0,i.A)(function*(){const K=[],V={from:k.identity.did,message:{filter:{author:M||void 0,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema},dateSort:m.U0.CreatedAscending}};console.log("IDENTITY: ",k.identity),console.log("LOAD REQUESTS:",V);const{records:Z}=yield k.identity.web5.dwn.records.query(V);for(let q of Z){if(k.blocked(q.creator)){q.delete(),q.send(k.identity.did),q.send(q.creator);continue}const ne=yield q.data.json();let te={record:q,data:ne,id:q.id};q.creator==k.identity.did&&(te.direction="out"),K.push(te)}return console.log("REQUESTS: ",K),K})()}blocked(M){return void 0!==this.blocks().find(k=>k.data.did==M)}loadConnections(M){var k=this;return(0,i.A)(function*(){const K=[],W={recipient:M||void 0,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema},{records:V}=yield k.identity.web5.dwn.records.query({message:{filter:W,dateSort:m.U0.CreatedDescending}});for(let Z of V){const q=yield Z.data.json();K.push({record:Z,data:q,id:Z.id})}return K})()}loadBlocks(){var M=this;return(0,i.A)(function*(){const k=[],{records:K}=yield M.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema},dateSort:m.U0.CreatedAscending}});for(let W of K){const V=yield W.data.json();k.push({record:W,data:V,id:W.id})}return k})()}static{this.\u0275fac=function(k){return new(k||E)}}static{this.\u0275prov=c.jDH({token:E,factory:E.\u0275fac,providedIn:"root"})}}return E})()},20180:(Me,F,f)=>{"use strict";f.d(F,{j:()=>je});var i=f(10467),c=f(42512);function S(Ne,...ot){if(!function m(Ne){return Ne instanceof Uint8Array||null!=Ne&&"object"==typeof Ne&&"Uint8Array"===Ne.constructor.name}(Ne))throw new Error("Uint8Array expected");if(ot.length>0&&!ot.includes(Ne.length))throw new Error(`Uint8Array expected of length ${ot}, not of length=${Ne.length}`)}function _(Ne,ot=!0){if(Ne.destroyed)throw new Error("Hash instance has been destroyed");if(ot&&Ne.finished)throw new Error("Hash#digest() has already been called")}const j="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,W=Ne=>new DataView(Ne.buffer,Ne.byteOffset,Ne.byteLength),V=(Ne,ot)=>Ne<<32-ot|Ne>>>ot;function O(Ne){return"string"==typeof Ne&&(Ne=function C(Ne){if("string"!=typeof Ne)throw new Error("utf8ToBytes expected string, got "+typeof Ne);return new Uint8Array((new TextEncoder).encode(Ne))}(Ne)),S(Ne),Ne}new Uint8Array(new Uint32Array([287454020]).buffer);class H{clone(){return this._cloneInto()}}function p(Ne){const ot=wt=>Ne().update(O(wt)).digest(),Ft=Ne();return ot.outputLen=Ft.outputLen,ot.blockLen=Ft.blockLen,ot.create=()=>Ne(),ot}const Ae=(Ne,ot,Ft)=>Ne&ot^~Ne&Ft,Ie=(Ne,ot,Ft)=>Ne&ot^Ne&Ft^ot&Ft;class Le extends H{constructor(ot,Ft,wt,zt){super(),this.blockLen=ot,this.outputLen=Ft,this.padOffset=wt,this.isLE=zt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(ot),this.view=W(this.buffer)}update(ot){_(this);const{view:Ft,buffer:wt,blockLen:zt}=this,rr=(ot=O(ot)).length;for(let ar=0;arzt-ar&&(this.process(wt,0),ar=0);for(let Tr=ar;Tr>zt&rr),lr=Number(Ft&rr),Wr=wt?0:4;Ne.setUint32(ot+(wt?4:0),ar,wt),Ne.setUint32(ot+Wr,lr,wt)})(wt,zt-8,BigInt(8*this.length),rr),this.process(wt,0);const lr=W(ot),hn=this.outputLen;if(hn%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const Wr=hn/4,vr=this.get();if(Wr>vr.length)throw new Error("_sha2: outputLen bigger than state");for(let Tr=0;Tr>>3,Ct=V(lt,17)^V(lt,19)^lt>>>10;Xe[Tr]=Ct+Xe[Tr-7]+Pt+Xe[Tr-16]|0}let{A:wt,B:zt,C:rr,D:ar,E:lr,F:hn,G:Wr,H:vr}=this;for(let Tr=0;Tr<64;Tr++){const lt=vr+(V(lr,6)^V(lr,11)^V(lr,25))+Ae(lr,hn,Wr)+xe[Tr]+Xe[Tr]|0,Ct=(V(wt,2)^V(wt,13)^V(wt,22))+Ie(wt,zt,rr)|0;vr=Wr,Wr=hn,hn=lr,lr=ar+lt|0,ar=rr,rr=zt,zt=wt,wt=lt+Ct|0}wt=wt+this.A|0,zt=zt+this.B|0,rr=rr+this.C|0,ar=ar+this.D|0,lr=lr+this.E|0,hn=hn+this.F|0,Wr=Wr+this.G|0,vr=vr+this.H|0,this.set(wt,zt,rr,ar,lr,hn,Wr,vr)}roundClean(){Xe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=p(()=>new Te);var ve=f(53813);function nt(Ne,ot=128){if(function x(Ne){if(!Number.isSafeInteger(Ne)||Ne<0)throw new Error(`positive integer expected, not ${Ne}`)}(ot),ot%32!=0||ot>256)throw new TypeError("Invalid entropy");return function ze(Ne,ot){return function $e(Ne){S(Ne,16,20,24,28,32)}(Ne),function Tt(Ne){if(!Array.isArray(Ne)||2048!==Ne.length||"string"!=typeof Ne[0])throw new Error("Wordlist: expected array of 2048 strings");return Ne.forEach(ot=>{if("string"!=typeof ot)throw new Error(`Wordlist: non-string element: ${ot}`)}),ve.Wp.chain(ve.Wp.checksum(1,Qe),ve.Wp.radix2(11,!0),ve.Wp.alphabet(Ne))}(ot).encode(Ne).join((Ne=>"\u3042\u3044\u3053\u304f\u3057\u3093"===Ne[0])(ot)?"\u3000":" ")}(function se(Ne=32){if(j&&"function"==typeof j.getRandomValues)return j.getRandomValues(new Uint8Array(Ne));if(j&&"function"==typeof j.randomBytes)return j.randomBytes(Ne);throw new Error("crypto.getRandomValues must be defined")}(ot/8),Ne)}const Qe=Ne=>{const ot=8-Ne.length/4;return new Uint8Array([Se(Ne)[0]>>ot<{class Ne{constructor(){}createPassword(Ft=6,wt=128){return(0,i.A)(function*(){try{const zt=nt(he,wt).split(" "),rr=[];for(let ar=0;ar{"use strict";f.d(F,{G:()=>B});var i=f(10467),c=f(54438),x=f(21626);let B=(()=>{class m{constructor(g){this.http=g,this.timestamp=null}load(){var g=this;return(0,i.A)(function*(){const _=yield fetch("/ngsw.json");if(_.ok){const R=yield _.json();console.log("DATA FROM HASH",R),g.timestamp=R.timestamp}})()}getTimestamp(){return this.timestamp}static{this.\u0275fac=function(_){return new(_||m)(c.KVO(x.Qq))}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},34635:(Me,F,f)=>{"use strict";f.d(F,{K:()=>T});var i=f(10467),c=f(54438),x=f(25246),B=f(80785),m=f(20180),S=f(77494),g=f(80428),_=f(4080),R=f(12621);let T=(()=>{class E{constructor(M){this.cryptoService=M,this.syncInterval="15s",this.agents=(0,c.vPA)([]),this.identities=[],this.accounts={},this.crypto=(0,c.WQX)(m.j),this.activeAccount=(0,c.vPA)(void 0),this.activeIdentity=(0,c.vPA)(void 0),this.preinitialized=(0,c.vPA)(!1),this.initialized=(0,c.vPA)(!1),this.locked=(0,c.vPA)(!0)}initialConnect(M){var k=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const K=yield x.uW.connect({password:M,sync:k.syncInterval});return k.did=K.did,k.web5=K.web5,k.agent=K.web5.agent,console.log("Web5 Connected.",k.did),k.preinitialized.set(!0),k.initialized.set(!0),K}catch(K){console.error(K)}})()}get identity(){return this.identities.find(M=>M.metadata.uri===this.did)}connectWithIdentity(M){var k=this;return(0,i.A)(function*(){const K=yield k.crypto.createPassword(),W=new S.TX({keyDerivationWorkFactor:21e4,store:new _.cG({location:"DATA/AGENT/VAULT_STORE"})});let V;const Z=new S.Bq({didMethods:[B.ES,B.E6,R.hX],resolverCache:new S.Td({location:"DATA/AGENT/DID_RESOLVERCACHE"}),store:new S.QZ});k.store=new S.dk;const q=new S.yc({store:k.store});k.identityApi=q;const ne=yield g.s.create({didApi:Z,identityApi:q,agentVault:W}),ie=yield ne.firstLaunch();console.log("FIRST LAUNCH???",ie),ie&&(V=yield ne.initialize({password:K,recoveryPhrase:V,dwnEndpoints:["https://dwn.tbddev.org/beta"]}),console.log("USER AGENT RECOVERY PHRASE:",V)),yield ne.start({password:K});const ae=yield ne.identity.import({portableIdentity:M});console.log("IDENTITY MADE IN IMPORT:",ae),yield ne.sync.registerIdentity({did:ae.did.uri});const me=new x.uW({agent:ne,connectedDid:ae.did.uri});return console.log("WEB5:",me),{password:K,agentDid:me.agent.agentDid.uri,did:ae.did.uri,recoveryPhrase:V,web5:me}})()}connect(M,k){var K=this;return(0,i.A)(function*(){console.log("PASSWORD:",k);try{console.log("Connecting to Web5...");const W=yield x.uW.connect({connectedDid:M,password:k,sync:K.syncInterval});return K.accounts[M]=W.web5,W.did!=M&&console.error("Connected DID does not match the result DID:",M,W.did),K.did=W.did,K.web5=W.web5,K.agent=W.web5.agent,console.log("Web5 Connected."),K.preinitialized.set(!0),K.initialized.set(!0),K.loadAccounts(k),W}catch(W){console.error("Failed to initialize web5:",W),alert("Failed to initialize Web5:"+W)}})()}changeAccount(M){var k=this;return(0,i.A)(function*(){const K=k.accounts[M];console.log("Changing to this Account:",K),K&&(k.web5=K,k.agent=K.agent,k.did=M,k.activeAccount.set(k.web5))})()}loadAccounts(M){var k=this;return(0,i.A)(function*(){k.identities=yield k.agent.identity.list(),console.log("LIST OF ALL IDENTITIES: ",k.identities);for(const K of k.identities){const W=K?.metadata?.uri;yield k.registerAccount(W,M)}})()}registerEndpoints(M,k,K=[]){return(0,i.A)(function*(){try{for(const W of K){const V=yield M.rpc.getServerInfo(W);console.log("SERVER INFO: ",V),0!==V.registrationRequirements.length?(yield S.Vu.registerTenant(W,M.agentDid.uri),yield S.Vu.registerTenant(W,k.did.uri)):console.log("No registration requirements")}}catch(W){console.error("Failed to register DWN endpoints",W)}})()}registerAccount(M,k){var K=this;return(0,i.A)(function*(){const{web5:W}=yield x.uW.connect({connectedDid:M,password:k,sync:K.syncInterval});return K.accounts[M]=W,W})()}activeAgent(){return this.web5.agent}changePassword(M,k){var K=this;return(0,i.A)(function*(){yield K.web5.agent.vault.changePassword({oldPassword:M,newPassword:k})})()}lock(){var M=this;return(0,i.A)(function*(){console.log("Locking account..."),yield M.web5.agent.vault.lock(),console.log("Vault locked"),M.locked.set(!0)})()}unlock(M,k){var K=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const{did:W,web5:V}=yield x.uW.connect({connectedDid:M,sync:K.syncInterval,password:k});return K.did=W,K.web5=V,M!=W&&console.error("Connected DID does not match the result DID:",W,M),console.log("UNLOCK WAS CALLED!!"),K.initialized.set(!0),K.locked.set(!1),!0}catch(W){return console.error(W),console.log("Show unlock screen!"),K.locked.set(!0),!1}})()}static{this.\u0275fac=function(k){return new(k||E)(c.KVO(m.j))}}static{this.\u0275prov=c.jDH({token:E,factory:E.\u0275fac,providedIn:"root"})}}return E})()},36815:(Me,F,f)=>{"use strict";f.d(F,{Y:()=>B});var i=f(99327),c=f(54438),x=f(30046);let B=(()=>{class m{constructor(){this.search=(0,c.vPA)(!1),this.searchInput="",this.scrolling=(0,c.vPA)(!0),this.tray=(0,c.vPA)(!1),this.navigation=(0,c.vPA)(!1),this.margin=(0,c.vPA)(!0),this.custom=(0,c.vPA)(!1),this.actions=(0,c.vPA)([]),this.breakpointObserver=(0,c.WQX)(i.QP),this.router=(0,c.WQX)(x.Ix),this.small=(0,c.vPA)(!1),this.router.events.subscribe(_=>{_ instanceof x.Z?this.enableScrolling():_ instanceof x.wF&&(this.scrollToTop(),this.countChar("/",_.url)>1?this.enableNavigation():this.disableNavigation())}),this.breakpointObserver.observe(["(max-width: 959.98px)"]).subscribe(_=>{this.small.set(!!_.matches)}),(0,c.QZP)(()=>{const _=document.querySelector(".sidenav-scroll-wrapper");_&&(_.style.overflow=this.scrolling()?"auto":"hidden");const R=document.getElementById("sidenav-content");R&&(R.style.overflow=this.scrolling()?"auto":"hidden")})}countChar(g,_){return _.split(g).length-1}ngAfterContentInit(){}toggleSearch(){this.search.set(!this.search()),this.searchInput=""}setActions(g){this.actions.set(g)}addAction(g){this.actions.update(_=>[..._,g])}customOff(){this.custom.set(!1)}customOn(){this.custom.set(!0)}marginOff(){this.margin.set(!1)}marginOn(){this.margin.set(!0)}resetActions(){this.actions.set([])}enableScrolling(){this.scrolling.set(!0)}scrollToTop(){const g=document.querySelector(".sidenav-content");g&&(g.scrollTop=0)}disableScrolling(){this.scrolling.set(!1)}enableNavigation(){this.navigation.set(!0)}disableNavigation(){this.navigation.set(!1)}static{this.\u0275fac=function(_){return new(_||m)}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},31948:(Me,F,f)=>{"use strict";f.d(F,{s:()=>x});var i=f(54438),c=f(36815);let x=(()=>{class B{constructor(){this.prefix="ariton-",this.layout=(0,i.WQX)(c.Y),this.layout.resetActions()}save(S,g){localStorage.setItem(this.prefix+S,JSON.stringify(g))}read(S){const g=localStorage.getItem(this.prefix+S);return g?JSON.parse(g):null}remove(S){localStorage.removeItem(this.prefix+S)}clear(){Object.keys(localStorage).forEach(S=>{S.startsWith(this.prefix)&&localStorage.removeItem(S)})}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=i.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},55619:(Me,F,f)=>{"use strict";f.d(F,{o:()=>B});var i=f(30046),c=f(54438),x=f(60177);let B=(()=>{class m{constructor(g,_){this.router=g,this.location=_,this.history=[],this.router.events.subscribe(R=>{R instanceof i.wF&&this.history.push(R.urlAfterRedirects),R instanceof i.OY&&console.log("SCROLL EVENT",R)})}back(){this.history.pop(),this.history.length>0?this.location.back():this.router.navigateByUrl("/")}static{this.\u0275fac=function(_){return new(_||m)(c.KVO(i.Ix),c.KVO(x.aZ))}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},82546:(Me,F,f)=>{"use strict";f.d(F,{J:()=>S});var i=f(10467),c=f(54438),x=f(34635),B=f(5397),m=f(77494);let S=(()=>{class g{constructor(){this.identity=(0,c.WQX)(x.K)}create(R){var T=this;return(0,i.A)(function*(){const E=R,{record:j,status:M}=yield T.identity.web5.dwn.records.create({data:E,message:{protocol:B.Q.protocol,protocolPath:"event",schema:B.Q.types.event.schema,dataFormat:B.Q.types.event.dataFormats[0]}});return console.log("Notification created:",M,j),{record:j,data:E,id:j.id}})()}load(){var R=this;return(0,i.A)(function*(){const T=[],{records:E}=yield R.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,schema:B.Q.types.event.schema},dateSort:m.U0.CreatedAscending}});for(let j of E){const M=yield j.data.json();T.push({record:j,data:M,id:j.id})}return T})()}static{this.\u0275fac=function(T){return new(T||g)}}static{this.\u0275prov=c.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},63528:(Me,F,f)=>{"use strict";f.d(F,{x:()=>x});var i=f(10467),c=f(54438);let x=(()=>{class B{constructor(){this.title=(0,c.vPA)(""),this.timeUpdateEvent=new c.bkB,this.init()}init(){var S=this;navigator.mediaSession.setActionHandler("play",(0,i.A)(function*(){try{S.audio&&(yield S.audio.play())}catch(g){console.error(g.name,g.message)}})),navigator.mediaSession.setActionHandler("pause",()=>{this.audio&&this.audio.pause()})}previous(){}next(){}onTimeUpdate(S){this.timeUpdateEvent.subscribe(S)}createAudio(S){return this.audio||(this.audio=new Audio(S),this.audio.addEventListener("timeupdate",()=>{this.audio&&this.timeUpdateEvent.emit(this.audio.currentTime)})),this.audio}play(){var S=this;return(0,i.A)(function*(){const g="https://magazine.ariton.app/assets/creative-technology-showreel-241274.mp3";S.setTitle(g),S.audio||(S.audio=S.createAudio(g)),yield S.audio.play()})()}setTitle(S){const _=new URL(S).pathname,R=_.substring(_.lastIndexOf("/")+1);this.title=(0,c.vPA)(R),navigator.mediaSession.metadata=new MediaMetadata({title:R,artist:R,album:"Ariton",artwork:[{src:R}]}),navigator.mediaSession.playbackState="playing"}pause(){this.audio&&this.audio.pause(),navigator.mediaSession.playbackState="paused"}get paused(){return!this.audio||this.audio.paused}get time(){return this.audio?Math.floor(this.audio.currentTime):10}set time(S){this.audio&&(this.audio.currentTime=S)}get duration(){return this.audio?Math.floor(this.audio.duration):100}rate(){this.audio&&(console.log(this.audio.playbackRate),this.audio.playbackRate=2==this.audio.playbackRate?1:2)}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=c.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},39434:(Me,F,f)=>{"use strict";f.d(F,{p:()=>m});var i=f(10467),c=f(54438),x=f(34635),B=f(22312);let m=(()=>{class S{constructor(){var _=this;this.identity=(0,c.WQX)(x.K),this.current=(0,c.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.selected=(0,c.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.avatar=(0,c.vPA)(null),this.avatarSelected=(0,c.vPA)(null),(0,c.QZP)((0,i.A)(function*(){_.identity.initialized()&&_.identity.activeIdentity()&&(console.log("Active account found, loading profile...",_.identity.did),_.openCurrentUserProfile(_.identity.did))}))}loadProfile(_){var R=this;return(0,i.A)(function*(){const T=yield R.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});let E={},j=null;if(console.log("RESPONSE FOUND FOR PROFILE:",T),console.log("RECORDS FOUND FOR PROFILE1:",T.records),T.records&&T.records.length>0)for(const K of T.records)K.import(),console.log("IMPORTING PROFILE RECORD:",K),j=K,E={...yield K.data.json(),id:K.dataCid,did:K.creator,created:K.dateCreated},R.loadProfileRemote(_);else E=yield R.loadProfileRemote(_);var{avatar:M,avatarRecord:k}=yield R.loadAvatar(_);return{record:j,avatarRecord:k,avatar:M,profile:E,did:_}})()}loadAvatar(_){var R=this;return(0,i.A)(function*(){var T=null,E=null;const j=yield R.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(j.records&&j.records.length>0){const M=j.records[0];T=M,E=yield M.data.text(),R.loadAvatarRemote(_)}else{yield R.loadAvatarRemote(_)}return{avatar:E,avatarRecord:T}})()}loadAvatarRemote(_){var R=this;return(0,i.A)(function*(){var T=null,E=null;const j=yield R.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(j.records&&j.records.length>0){const M=j.records[0];M.import(),T=M,E=yield M.data.text()}return{avatar:E,avatarRecord:T}})()}loadProfileRemote(_){var R=this;return(0,i.A)(function*(){console.log("Loading remote profile:",_);const T=yield R.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});console.log("QUERY FOR PROFILE WORKS??");let E={},j=null;if(console.log("RESPONSE FOUND FOR PROFILE:",T),console.log("RECORDS FOUND FOR PROFILE2:",T.records),T.records)for(const M of T.records)M.import(),j=M,E={...yield M.data.json(),id:M.dataCid,did:M.creator,created:M.dateCreated};return E})()}openCurrentUserProfile(_){var R=this;return(0,i.A)(function*(){console.log("Open current user profile",_);const T=yield R.loadProfile(_);R.current.set(T.profile)})()}openProfile(_){var R=this;return(0,i.A)(function*(){console.log("Open profile",_);const T=yield R.loadProfile(_);R.avatarSelected.set(T.avatar),R.selected.set(T.profile),_==R.identity.did&&(R.avatar.set(T.avatar),R.current.set(T.profile))})()}static{this.\u0275fac=function(R){return new(R||S)}}static{this.\u0275prov=c.jDH({token:S,factory:S.\u0275fac,providedIn:"root"})}}return S})()},80865:(Me,F,f)=>{"use strict";f.d(F,{w:()=>ie});var i=f(10467),c=f(54438),x=f(4053),B=f(77949),m=f(45189),S=f(49245),g=f(62060),_=f(67136),R=f(1639),T=f(69371),E=f(2685),j=f(69314),M=f(97372),k=f(70669),K=f(50963),W=f(68530),V=f(5397),Z=f(29508),q=f(32794),ne=f(34635),te=f(95416);let ie=(()=>{class ae{constructor(){this.identityService=(0,c.WQX)(ne.K),this.snackBar=(0,c.WQX)(te.UG)}register(ye){var ue=this;return(0,i.A)(function*(){const $=[j.Q,x.Q,B.Q,m.Q,S.Q,g.Q,_.Q,R.Q,T.Q,E.Q,M.Q,k.Q,K.Q,W.Q,V.Q,Z.Q,q.Q];for(const o of $){const{protocol:h,status:A}=yield ye.dwn.protocols.configure({message:{definition:o}});202!==A.code&&(console.error("Failed to install protocol:",A,h),ue.snackBar.open(`Failed to install protocol. Code: ${A.code}, Protocol: ${o.protocol}`,"Close",{duration:1e3}));const C=yield h?.send(ue.identityService.did);console.log("Protocol send status: ",C?.status)}console.log("Protocols installed.")})()}static{this.\u0275fac=function(ue){return new(ue||ae)}}static{this.\u0275prov=c.jDH({token:ae,factory:ae.\u0275fac,providedIn:"root"})}}return ae})()},51889:(Me,F,f)=>{"use strict";f.d(F,{k:()=>B});var i=f(75351),c=f(68314),x=f(54438);let B=(()=>{class m{constructor(g){this.data=g}ngAfterViewInit(){const g=document.querySelector("canvas");c.mo(g,this.data.did,_=>{_&&console.error("Error generating QR code: ",_)})}static{this.\u0275fac=function(_){return new(_||m)(x.rXU(i.Vh))}}static{this.\u0275cmp=x.VBU({type:m,selectors:[["app-qrcode-dialog"]],standalone:!0,features:[x.aNF],decls:2,vars:0,consts:[["qrCanvas",""]],template:function(_,R){1&_&&x.nrm(0,"canvas",null,0)}})}}return m})()},98703:(Me,F,f)=>{"use strict";f.d(F,{g:()=>c});var i=f(54438);let c=(()=>{class x{transform(m,S){if(m){const g=Math.floor((+new Date-+new Date(m))/1e3);if(g<29)return"Just now";const _={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};let R;for(const T in _)if(R=Math.floor(g/_[T]),R>0)return 1===R?R+" "+T+" ago":R+" "+T+"s ago"}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"ago",type:x,pure:!0,standalone:!0})}}return x})()},33347:(Me,F,f)=>{"use strict";f.d(F,{k:()=>c});var i=f(54438);let c=(()=>{class x{transform(m,S){if(m){const g=m.lastIndexOf(":");if(-1!==g){const _=m.slice(0,g+1),R=m.slice(g+1);return _+R.slice(0,5)+"..."+R.slice(-5)}return m.slice(0,5)+"..."+m.slice(-5)}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"did",type:x,pure:!0,standalone:!0})}}return x})()},78013:(Me,F,f)=>{"use strict";f.d(F,{d:()=>x});var i=f(54438),c=f(345);let x=(()=>{class B{constructor(S){this.sanitizer=S}transform(S){return this.sanitizer.bypassSecurityTrustResourceUrl(S)}static{this.\u0275fac=function(g){return new(g||B)(i.rXU(c.up,16))}}static{this.\u0275pipe=i.EJ8({name:"safeResourceUrl",type:B,pure:!0,standalone:!0})}}return B})()},28741:(Me,F,f)=>{"use strict";f.d(F,{M:()=>c});var i=f(54438);let c=(()=>{class x{transform(m,S){if(null==m)return"";if(0===m)return"0 Bytes";const R=Math.floor(Math.log(m)/Math.log(1024));return parseFloat((m/Math.pow(1024,R)).toFixed(2))+" "+["Bytes","KB","MB","GB","TB","PB"][R]}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"size",type:x,pure:!0,standalone:!0})}}return x})()},43794:(Me,F,f)=>{"use strict";f.d(F,{n:()=>B});var i=f(10467),c=f(54438),x=f(34635);let B=(()=>{class m{constructor(){this.identity=(0,c.WQX)(x.K)}save(g,_,R){var T=this;return(0,i.A)(function*(){const{record:E,status:j}=yield T.identity.web5.dwn.records.create({data:_,message:{tags:R,protocol:g.protocol,protocolPath:g.protocolPath,schema:g.schema,dataFormat:g.dataFormat}});if(202!==j.code)throw new Error(`Failed to save data (${j.code}): ${j.detail}`);return{data:_,id:E.id,record:E}})()}load(g,_){var R=this;return(0,i.A)(function*(){var{records:T}=yield R.identity.web5.dwn.records.query({message:{filter:{tags:_,protocol:g.protocol,schema:g.schema,dataFormat:g.dataFormat}}});if(!T||0===T.length)return[];const E=[];for(const j of T){let M=yield j.data.json();E.push({record:j,data:M,id:j.id})}return E})()}get(g){var _=this;return(0,i.A)(function*(){var{record:R,status:T}=yield _.identity.web5.dwn.records.read({message:{filter:{recordId:g}}});if(200!==T.code)throw new Error(`Failed to get data (${T.code}): ${T.detail}`);return{data:yield R.data.json(),id:R.id,record:R}})()}update(g,_,R){return(0,i.A)(function*(){const{status:T}=yield g.update({data:_,tags:R});if(202!==T.code)throw new Error(`Failed to save data (${T.code}): ${T.detail}`);return{data:_,id:g.id,record:g}})()}delete(g){return(0,i.A)(function*(){const{status:_}=yield g.delete();if(202!==_.code)throw new Error(`Failed to delete data (${_.code}): ${_.detail}`)})()}static{this.\u0275fac=function(_){return new(_||m)}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},26703:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>B});var i=f(10467),c=f(54438),x=f(95416);let B=(()=>{class m{constructor(){this.snackBar=(0,c.WQX)(x.UG)}executeAsyncWithToast(g,_,R){var T=this;return(0,i.A)(function*(){try{yield g,_&&T.openSnackBar(_)}catch(E){T.openSnackBar(R||`Error: ${E}.`)}})()}openSnackBar(g){this.snackBar.open(g,void 0,{duration:2e3})}backupAccount({portableIdentity:g}={}){return(0,i.A)(function*(){if(g){const _=new Blob([JSON.stringify(g)],{type:"application/json"}),R=URL.createObjectURL(_),T=document.createElement("a");T.href=R,T.download="portableIdentity.json",document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(R)}})()}static{this.\u0275fac=function(_){return new(_||m)}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},12621:(Me,F,f)=>{"use strict";f.d(F,{hX:()=>Z});var i=f(10467),c=f(4080),x=f(42512),B=f(80785),m=f(70285),S=f(68989);const _={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16},R={G:"ed25519PublicKey",S:"ed25519SecretSeed",M:"med25519PublicKey",T:"preAuthTx",X:"sha256Hash",P:"signedPayload",C:"contract"};class T{static encodeEd25519PublicKey(te){return M("ed25519PublicKey",te)}static decodeEd25519PublicKey(te){return j("ed25519PublicKey",te)}static isValidEd25519PublicKey(te){return E("ed25519PublicKey",te)}static encodeEd25519SecretSeed(te){return M("ed25519SecretSeed",te)}static decodeEd25519SecretSeed(te){return j("ed25519SecretSeed",te)}static isValidEd25519SecretSeed(te){return E("ed25519SecretSeed",te)}static encodeMed25519PublicKey(te){return M("med25519PublicKey",te)}static decodeMed25519PublicKey(te){return j("med25519PublicKey",te)}static isValidMed25519PublicKey(te){return E("med25519PublicKey",te)}static encodePreAuthTx(te){return M("preAuthTx",te)}static decodePreAuthTx(te){return j("preAuthTx",te)}static encodeSha256Hash(te){return M("sha256Hash",te)}static decodeSha256Hash(te){return j("sha256Hash",te)}static encodeSignedPayload(te){return M("signedPayload",te)}static decodeSignedPayload(te){return j("signedPayload",te)}static isValidSignedPayload(te){return E("signedPayload",te)}static encodeContract(te){return M("contract",te)}static decodeContract(te){return j("contract",te)}static isValidContract(te){return E("contract",te)}static getVersionByteForPrefix(te){return R[te[0]]}}function E(ne,te){if("string"!=typeof te)return!1;switch(ne){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":if(56!==te.length)return!1;break;case"med25519PublicKey":if(69!==te.length)return!1;break;case"signedPayload":if(te.length<56||te.length>165)return!1;break;default:return!1}let ie="";try{ie=j(ne,te).toString()}catch{return!1}switch(ne){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===ie.length;case"med25519PublicKey":return 40===ie.length;case"signedPayload":return ie.length>=40&&ie.length<=100;default:return!1}}function j(ne,te){if("string"!=typeof te)throw new TypeError("encoded argument must be of type String");const ie=S.decode(te),ae=ie[0],me=ie.slice(0,-2),ye=me.slice(1),ue=ie.slice(-2);if(te!==S.encode(ie))throw new Error("invalid encoded string");const $=_[ne];if(void 0===$)throw new Error(`${ne} is not a valid version byte name. Expected one of ${Object.keys(_).join(", ")}`);if(ae!==$)throw new Error(`invalid version byte. expected ${$}, got ${ae}`);if(!function g(ne,te){if(ne.length!==te.length)return!1;if(0===ne.length)return!0;for(let ie=0;ie>8^ne[me]],ie&=65535;const ae=new Uint8Array(2);return ae[0]=255&ie,ae[1]=ie>>8&255,ae}const W={Ed25519VerificationKey2020:"https://w3id.org/security/suites/ed25519-2020/v1",JsonWebKey2020:"https://w3id.org/security/suites/jws-2020/v1",X25519KeyAgreementKey2020:"https://w3id.org/security/suites/x25519-2020/v1"};let Z=(()=>{class ne extends B.TI{static{this.methodName="stellar"}static create({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=yield ie.generateKey({algorithm:me}),ue=yield ie.getPublicKey({keyUri:ye}),$=yield x.Mc.publicKeyToBytes({publicKey:ue}),o=T.encodeEd25519PublicKey($),h=`did:${ne.methodName}:${o}`,C=(yield ne.resolve(h,ae)).didDocument;return new B.tW({uri:h,document:C,metadata:{},keyManager:ie})})()}static create2({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=ie,ue=yield ie.generateKey({algorithm:me}),o=(yield ie.getPublicKey({keyUri:ue}),yield ye.exportKey({keyUri:ue}));console.log("privateKey",o);const A="GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB",C=T.decodeEd25519SecretSeed("SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7"),O=yield x.Mc.bytesToPrivateKey({privateKeyBytes:C});console.log("privateKeyJwk",O);const z=yield x.Mc.getPublicKey({key:O});console.log("publicKeyJwk",z);const H=yield x.Mc.publicKeyToBytes({publicKey:z}),I=T.encodeEd25519PublicKey(H);O.kid=I;const s=yield ye.getKeyUri({key:O});s===(yield ye.getKeyUri({key:z}))&&console.log("Yipppppi!!");const J=yield ye.importKey({key:O});console.log("Import result: ",J),(yield ye.exportKey({keyUri:s})).d==O.d&&console.log("Yipppppi!! PRIVATE KEY SAME!"),A==I?console.log("CORRECT!!!!"):console.warn("NO!!!!!!"),O.kid=yield(0,x.BA)({jwk:o}),O.kid=I,console.log("IDENTIFIER3: ",I),A==I?console.log("CORRECT!!!!"):console.warn("NO!!!!!!");let se=yield q.keyConverter(o.crv).privateKeyToBytes({privateKey:o});console.log("privateKeyBytes",se),console.log("Secret: ",T.encodeEd25519SecretSeed(se));const de=`did:${ne.methodName}:${I}`,Ie=(yield ne.resolve(de,ae)).didDocument;return new B.tW({uri:de,document:Ie,metadata:{},keyManager:ie})})()}static fromPrivateKey({keyManager:ie=new x.eP,privateKey:ae}){return(0,i.A)(function*(){const me=T.decodeEd25519SecretSeed(ae),ye=yield x.Mc.bytesToPrivateKey({privateKeyBytes:me}),ue=yield ie.importKey({key:ye}),$=yield ie.getPublicKey({keyUri:ue}),o=yield x.Mc.publicKeyToBytes({publicKey:$}),h=T.encodeEd25519PublicKey(o),A=`did:${ne.methodName}:${h}`,C=yield ne.resolve(A,{});return console.log("didResolutionResult",C),new B.tW({uri:A,document:C.didDocument,metadata:{},keyManager:ie})})()}static getSigningMethod({didDocument:ie}){var ae=this;return(0,i.A)(function*(){const me=B.yR.parse(ie.id);if(me&&me.method!==ae.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${me.method}`);const[ye]=ie.assertionMethod||[],ue=ie.verificationMethod?.find($=>$.id===ye);if(!ue||!ue.publicKeyJwk)throw new B.WK(B.F8.InternalError,"A verification method intended for signing could not be determined from the DID Document");return ue})()}static import({portableDid:ie,keyManager:ae=new x.eP}){return(0,i.A)(function*(){if(B.yR.parse(ie.uri)?.method!==ne.methodName)throw new B.WK(B.F8.MethodNotSupported,"Method not supported");const ye=yield B.tW.import({portableDid:ie,keyManager:ae});if(1!==ye.document.verificationMethod.length)throw new B.WK(B.F8.InvalidDidDocument,"DID document must contain exactly one verification method");return ye})()}static resolve(ie,ae){return(0,i.A)(function*(){try{const me=yield ne.createDocument({didUri:ie,options:ae});return{...B.zh,didDocument:me}}catch(me){if(!(me instanceof B.WK))throw new Error(me);return{...B.zh,didResolutionMetadata:{error:me.code,...me.message&&{errorMessage:me.message}}}}})()}static createDocument({didUri:ie,options:ae={}}){return(0,i.A)(function*(){const{defaultContext:me="https://www.w3.org/ns/did/v1"}=ae,ye={id:ie},ue=B.yR.parse(ie);if(!ue)throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const o=T.decodeEd25519PublicKey(ue.id),h=yield x.Mc.bytesToPublicKey({publicKeyBytes:o});if(ue.method!==ne.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${ue.method}`);if(!ne.validateIdentifier(ue))throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const C={id:`${ye.id}#0`,type:"JsonWebKey",controller:ye.id,publicKeyJwk:h};ye.id=ue.uri,ye.verificationMethod=[C],ye.authentication=[C.id],ye.assertionMethod=[C.id],ye.capabilityInvocation=[C.id],ye.capabilityDelegation=[C.id],ye.keyAgreement=[C.id];const O=[me];return(0,m.getVerificationMethodTypes)({didDocument:ye}).forEach(H=>{O.push(W[H])}),ye["@context"]=O,ye.service=[{id:"dwn",type:"DecentralizedWebNode",serviceEndpoint:["https://dwn.tbddev.org/beta"]}],ye})()}static deriveEncryptionKey({multibaseValue:ie}){return(0,i.A)(function*(){let ae={keyBytes:new Uint8Array,multicodecCode:0};const{keyBytes:me,multicodecCode:ye}=(0,m.multibaseIdToKeyBytes)({multibaseKeyId:ie});if(237===ye){const ue=yield q.keyConverter("Ed25519").bytesToPublicKey({publicKeyBytes:me}),$=yield x.Mc.convertPublicKeyToX25519({publicKey:ue});ae={keyBytes:yield q.keyConverter("Ed25519").publicKeyToBytes({publicKey:$}),multicodecCode:236}}return ae})()}static validateIdentifier(ie){const{method:ae,id:me}=ie,[ye]=ie.uri.split(":",1);return"did"===ye&&"stellar"===ae&&Number("1")>0&&"String"===(0,c.fc)(me)&&me.startsWith("G")}}return ne})(),q=(()=>{class ne{static{this.JWK_TO_MULTICODEC={"Ed25519:public":"ed25519-pub","Ed25519:private":"ed25519-priv","secp256k1:public":"secp256k1-pub","secp256k1:private":"secp256k1-priv","X25519:public":"x25519-pub","X25519:private":"x25519-priv"}}static{this.MULTICODEC_PUBLIC_KEY_LENGTH={231:33,236:32,237:32}}static{this.MULTICODEC_TO_JWK={"ed25519-pub":{crv:"Ed25519",kty:"OKP",x:""},"ed25519-priv":{crv:"Ed25519",kty:"OKP",x:"",d:""},"secp256k1-pub":{crv:"secp256k1",kty:"EC",x:"",y:""},"secp256k1-priv":{crv:"secp256k1",kty:"EC",x:"",y:"",d:""},"x25519-pub":{crv:"X25519",kty:"OKP",x:""},"x25519-priv":{crv:"X25519",kty:"OKP",x:"",d:""}}}static keyCompressor(ie){const me={"P-256":x.iH.compressPublicKey,secp256k1:x.jg.compressPublicKey}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}static keyConverter(ie){const me={Ed25519:x.Mc,"P-256":x.iH,secp256k1:x.jg,X25519:x.Nx}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}}return ne})()},70236:(Me,F,f)=>{"use strict";var i=f(345),c=f(54438),x=f(30046),B=f(10467),m=f(52778),S=f(36815),g=f(34635),_=f(97372),R=f(60177),T=f(89417),E=f(88834),j=f(75351),M=f(99213),k=f(99631),K=f(59115),W=f(14823),V=f(53719);let Z=(()=>{class v{constructor(u,w){this.dialogRef=u,this.data=w,this.fb=(0,c.WQX)(T.ok),this.form=this.fb.group({name:[null,T.k0.required]})}ngAfterViewInit(){}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(j.CP),c.rXU(j.Vh))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-folder-dialog"]],standalone:!0,features:[c.aNF],decls:10,vars:2,consts:[["mat-dialog-title",""],["appearance","outline",1,"full-width"],["matInput","","required","true","placeholder","Name","maxlength","200",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(w,U){1&w&&(c.j41(0,"h2",0),c.EFF(1,"Folder name"),c.k0s(),c.j41(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"input",2),c.mxI("ngModelChange",function(le){return c.DH7(U.data.name,le)||(U.data.name=le),le}),c.k0s()()(),c.j41(5,"mat-dialog-actions",3)(6,"button",4),c.EFF(7,"Cancel"),c.k0s(),c.j41(8,"button",5),c.EFF(9,"Save"),c.k0s()()),2&w&&(c.R7$(4),c.R50("ngModel",U.data.name),c.R7$(4),c.Y8G("mat-dialog-close",!0))},dependencies:[R.MD,W.uc,K.Cn,M.m_,E.Hl,E.$z,k.fS,k.fg,V.rl,j.hM,j.tx,j.BI,j.E7,j.Yi,T.YN,T.me,T.BC,T.YS,T.tU,T.vS],styles:["form[_ngcontent-%COMP%]{display:inline}"]})}}return v})();var q=f(3902),ne=f(98703),te=f(5964);let ie=(()=>{class v{constructor(u,w){this.router=u,this.activatedRoute=w,this.breadcrumbs=[],this.router.events.pipe((0,te.p)(U=>U instanceof x.wF)).subscribe(()=>{this.breadcrumbs=this.createBreadcrumbs(this.activatedRoute.root)})}createBreadcrumbs(u,w="",U=[]){const Y=u.children;if(0===Y.length)return U;for(const le of Y){const ge=le.snapshot.url.map(Pe=>Pe.path).join("/");return""!==ge&&(w+=`/${ge}`),U.push({label:le.snapshot.data.breadcrumb,url:w}),this.createBreadcrumbs(le,w,U)}return U}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(x.Ix),c.KVO(x.nX))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})(),ae=(()=>{class v{constructor(){}registerActions(u){}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})();var me=f(28741),ye=f(77494),ue=f(2042),$=f(9159),o=f(25596);function h(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",18),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.up())}),c.j41(1,"mat-icon"),c.EFF(2,"arrow_upward"),c.k0s()()}}function A(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",18),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolder(null))}),c.j41(1,"mat-icon"),c.EFF(2,"create_new_folder"),c.k0s()()}}function C(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",20),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolder(null))}),c.j41(1,"mat-icon"),c.EFF(2,"create_new_folder"),c.k0s(),c.j41(3,"span"),c.EFF(4,"New folder"),c.k0s()()}}function O(v,a){if(1&v&&c.DNE(0,A,3,0,"button",1)(1,C,5,0,"button",19),2&v){const u=c.XpG();c.vxM(u.layout.small()?0:1)}}function z(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",21),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolderById(U.parentId))}),c.j41(1,"mat-icon"),c.EFF(2,"edit"),c.k0s()(),c.j41(3,"button",21),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.deleteFolder())}),c.j41(4,"mat-icon"),c.EFF(5,"delete_forever"),c.k0s()()}}function H(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",2),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolderById(U.parentId))}),c.j41(1,"mat-icon"),c.EFF(2,"edit"),c.k0s(),c.j41(3,"span"),c.EFF(4,"Rename folder"),c.k0s()(),c.j41(5,"button",2),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.deleteFolder())}),c.j41(6,"mat-icon"),c.EFF(7,"delete_forever"),c.k0s(),c.j41(8,"span"),c.EFF(9,"Delete folder"),c.k0s()()}}function I(v,a){if(1&v&&c.DNE(0,z,6,0)(1,H,10,0),2&v){const u=c.XpG();c.vxM(u.layout.small()?0:1)}}function s(v,a){1&v&&c.nrm(0,"th",22)}function p(v,a){if(1&v){const u=c.RV6();c.j41(0,"td",23),c.bIt("click",function(){const U=c.eBV(u).$implicit,Y=c.XpG();return c.Njj(Y.openEntry(U))}),c.j41(1,"mat-icon",24),c.EFF(2),c.k0s()()}if(2&v){const u=a.$implicit;c.R7$(2),c.JRh(u.icon)}}function J(v,a){1&v&&(c.j41(0,"th",25),c.EFF(1,"Name"),c.k0s())}function ee(v,a){if(1&v){const u=c.RV6();c.j41(0,"td",26),c.bIt("click",function(){const U=c.eBV(u).$implicit,Y=c.XpG();return c.Njj(Y.openEntry(U))}),c.EFF(1),c.k0s()}if(2&v){const u=a.$implicit;c.R7$(),c.JRh(u.name)}}function se(v,a){1&v&&(c.j41(0,"th",27),c.EFF(1,"Modified"),c.k0s())}function de(v,a){if(1&v&&(c.j41(0,"td",28),c.EFF(1),c.nI1(2,"ago"),c.k0s()),2&v){const u=a.$implicit;c.R7$(),c.SpI(" ",c.bMT(2,1,u.modified)," ")}}function Ae(v,a){1&v&&(c.j41(0,"th",29),c.EFF(1,"File size"),c.k0s())}function Ie(v,a){if(1&v&&(c.j41(0,"td",28),c.EFF(1),c.nI1(2,"size"),c.k0s()),2&v){const u=a.$implicit;c.R7$(),c.JRh(c.bMT(2,1,u.size))}}function Le(v,a){1&v&&c.nrm(0,"tr",30)}function xe(v,a){1&v&&c.nrm(0,"tr",31)}class Ce{constructor(a){this.icon="folder"==a.tags.entryType?"folder":"note",this.name=a.tags.name,this.modified="folder"===a.tags.entryType?a.dateModified:a.tags.lastModified,this.size=a.tags.size,this.type=a.tags.type,this.entryType=a.tags.entryType,this.record=a}}let Xe=(()=>{class v{constructor(){var u=this;this.entries=(0,c.vPA)([]),this.app=(0,c.WQX)(m.d),this.breadcrumb=(0,c.WQX)(ie),this.layout=(0,c.WQX)(S.Y),this.identity=(0,c.WQX)(g.K),this.dialog=(0,c.WQX)(j.bZ),this.router=(0,c.WQX)(x.Ix),this.route=(0,c.WQX)(x.nX),this.fileService=(0,c.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.protocolPath="entry",this.hasInitialized=!1,this.folderLevel=1,this.displayedColumns=["icon","name","modified","size"],this.dataSource=new $.I6([]),this.changeDetectorRefs=(0,c.WQX)(c.gRc),this.layout.resetActions(),(0,c.QZP)((0,B.A)(function*(){if(u.app.initialized()){if(u.hasInitialized)return;const w=u.getResolvedUrl(u.route.snapshot);yield u.processUrl(w)}}),{allowSignalWrites:!0}),(0,c.QZP)((0,B.A)(function*(){u.updateTable()})),this.routingSub=this.router.events.subscribe(function(){var w=(0,B.A)(function*(U){U instanceof x.wF&&(yield u.processUrl(U.urlAfterRedirects))});return function(U){return w.apply(this,arguments)}}()),this.layout.disableNavigation(),console.log("FOLDER COMPONENT INITIALIZED")}ngAfterViewInit(){this.dataSource.sort=this.sort}updateTable(){this.dataSource.data=this.entries().map(u=>new Ce(u))}up(){const w=this.router.url.split("/");if(w.length>1){w.pop();const U=w.join("/");this.router.navigate([U])}}sortData(u){}announceSortChange(u){}getValueAfterFolder(u){const w=u.match(/\/folder\/(.+)/);return w?w[1]:null}generateUrl(u){const w=[];for(let U=0;UY.url.map(le=>le.toString()).join("/")).join("/");const U=u.queryParamMap;return U.keys.length>0&&(w+="?"+U.keys.map(Y=>U.getAll(Y).map(le=>Y+"="+le).join("&")).join("&")),w}editFile(u){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}ngOnDestroy(){console.log("ON DESTROY!!!);"),this.routingSub.unsubscribe(),this.layout.resetActions()}onFileSelected(u){var w=this;return(0,B.A)(function*(){const U=u.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let Y=0;Y[..._t,dt])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var u=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield u.identity.web5.dwn.records.create({data:u.file,message:{schema:_.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}deleteFolder(){var u=this;return(0,B.A)(function*(){const{record:w}=yield u.identity.web5.dwn.records.read({message:{filter:{recordId:u.parentId}}});if(w){const{status:U}=yield w.delete({prune:!0});console.log("Delete status:",U);const Y=u.contextId.split("/").slice(0,-1);console.log("Parent path:",Y),u.router.navigate(["app","files","folder",...Y])}})()}editFolderById(u){var w=this;return(0,B.A)(function*(){const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:u}}});yield w.editFolder(U)})()}editFolder(u){var w=this;return(0,B.A)(function*(){let U={name:u?u.tags.name:"Untitled folder",entryType:"folder"};const Y=JSON.parse(JSON.stringify(U)),le=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return le.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),yield w.saveFolder(u,U)):U=Y});return function(Pe){return ge.apply(this,arguments)}}()),le.afterClosed()})()}saveFolder(u,w){var U=this;return(0,B.A)(function*(){if(u){const Y={name:w.name,entryType:w.entryType},{status:le}=yield u.update({tags:Y,data:{}});console.log("Record status:",le)}else{const Y={tags:{name:w.name,entryType:w.entryType},protocol:_.Q.protocol,protocolPath:U.protocolPath,parentContextId:U.contextId??=void 0,schema:_.Q.types.entry.schema};console.log("Create folder:",Y);const{record:le,status:ge}=yield U.identity.web5.dwn.records.create({data:{},message:Y});console.log("Record created:",le),console.log("Record status:",ge),le&&U.entries.update(Pe=>[...Pe,le])}})()}openEntry(u){var w=this;return(0,B.A)(function*(){console.log(u),w.router.navigate("folder"===u.entryType?["/app/files/folder/"+u.record.contextId]:["/app/files/file/"+u.record.id])})()}loadEntries(u){var w=this;return(0,B.A)(function*(){console.log("VALUE OF TAGS:",u),console.log("PARENT ID:",w.parentId),console.log("PARENT CONTEXT ID:",w.contextId);const U={filter:{protocolPath:w.protocolPath,protocol:_.Q.protocol,schema:_.Q.types.entry.schema},dateSort:ye.U0.CreatedDescending};w.parentId&&"root"!==w.parentId&&(U.filter.parentId=w.parentId),console.log(U);var{records:Y}=yield w.identity.web5.dwn.records.query({message:U});w.entries.set(Y??[]),console.log("All entries:",w.entries())})()}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-folder"]],viewQuery:function(w,U){if(1&w&&c.GBs(ue.B4,5),2&w){let Y;c.mGM(Y=c.lsd())&&(U.sort=Y.first)}},standalone:!0,features:[c.aNF],decls:26,vars:6,consts:[[1,"toolbar-actions","margin-bottom"],["mat-icon-button","",1,"toolbar-icon-button"],["type","button","mat-button","",3,"click"],["type","file","id","input","multiple","",2,"display","none",3,"change"],["mat-table","","matSort","",3,"matSortChange","dataSource"],["matColumnDef","icon"],["mat-header-cell","","mat-sort-header","","class","icon-column",4,"matHeaderCellDef"],["mat-cell","","class","clickable icon-column",3,"click",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name",4,"matHeaderCellDef"],["mat-cell","","class","clickable",3,"click",4,"matCellDef"],["matColumnDef","modified"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","size"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-button",""],["mat-button","",3,"click"],["type","button","mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-header-cell","","mat-sort-header","",1,"icon-column"],["mat-cell","",1,"clickable","icon-column",3,"click"],["matListItemIcon",""],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name"],["mat-cell","",1,"clickable",3,"click"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified"],["mat-cell",""],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size"],["mat-header-row",""],["mat-row",""]],template:function(w,U){1&w&&(c.j41(0,"mat-card",0)(1,"mat-card-content"),c.DNE(2,h,3,0,"button",1),c.j41(3,"button",2),c.bIt("click",function(){return U.editFile({})}),c.j41(4,"mat-icon"),c.EFF(5,"upload_file"),c.k0s(),c.j41(6,"span"),c.EFF(7,"Upload files"),c.k0s()(),c.DNE(8,O,2,1)(9,I,2,1),c.k0s()(),c.j41(10,"input",3),c.bIt("change",function(le){return U.onFileSelected(le)}),c.k0s(),c.j41(11,"table",4),c.bIt("matSortChange",function(le){return U.sortData(le)}),c.qex(12,5),c.DNE(13,s,1,0,"th",6)(14,p,3,1,"td",7),c.bVm(),c.qex(15,8),c.DNE(16,J,2,0,"th",9)(17,ee,2,1,"td",10),c.bVm(),c.qex(18,11),c.DNE(19,se,2,0,"th",12)(20,de,3,3,"td",13),c.bVm(),c.qex(21,14),c.DNE(22,Ae,2,0,"th",15)(23,Ie,3,3,"td",13),c.bVm(),c.DNE(24,Le,1,0,"tr",16)(25,xe,1,0,"tr",17),c.k0s()),2&w&&(c.R7$(2),c.vxM(U.folderLevel>1?2:-1),c.R7$(6),c.vxM(U.folderLevel<4?8:-1),c.R7$(),c.vxM(U.folderLevel>1?9:-1),c.R7$(2),c.Y8G("dataSource",U.dataSource),c.R7$(13),c.Y8G("matHeaderRowDef",U.displayedColumns),c.R7$(),c.Y8G("matRowDefColumns",U.displayedColumns))},dependencies:[o.Hu,o.RN,o.m2,E.Hl,E.$z,E.iY,$.tP,$.Zl,$.tL,$.ji,$.cC,$.YV,$.iL,$.KS,$.$R,$.YZ,$.NB,ue.NQ,ue.B4,ue.aE,me.M,R.MD,q.Fg,q.ZV,M.m_,M.An,ne.g],styles:["table[_ngcontent-%COMP%]{width:100%}.icon-column[_ngcontent-%COMP%]{width:36px;max-width:36px;min-width:36px}"]})}}return v})();var Te=function(v){return v.PDF="application/pdf",v.JPEG="image/jpeg",v.PNG="image/png",v.MP4="video/mp4",v.MP3="audio/mpeg",v}(Te||{});const ke=["*"],Se=v=>({transform:v});function Ee(v,a){if(1&v&&(c.j41(0,"div",1),c.nrm(1,"iframe",2),c.k0s()),2&v){const u=c.XpG();c.R7$(),c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")"))("src",u.src,c.f$h)}}function ve(v,a){if(1&v&&c.nrm(0,"iframe",2),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")"))("src",u.src,c.f$h)}}function De(v,a){if(1&v&&c.nrm(0,"iframe",2),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")"))("src",u.src,c.f$h)}}function Re(v,a){if(1&v&&(c.j41(0,"video",3),c.nrm(1,"source",5),c.EFF(2," Your browser does not support HTML5 video. "),c.k0s()),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")")),c.R7$(),c.Y8G("src",u.src,c.B4B)}}function Je(v,a){if(1&v&&(c.j41(0,"audio",4),c.nrm(1,"source",6),c.EFF(2," Your browser does not support the audio element. "),c.k0s()),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")")),c.R7$(),c.Y8G("src",u.src,c.B4B)}}function $e(v,a){1&v&&(c.j41(0,"span",null,0),c.SdG(2),c.k0s())}let nt=(()=>{class v{ngAfterViewInit(){const u=document.getElementById("frame");if(u&&u.contentDocument){const w=document.createElement("style");w.textContent="\n body {\n background-color: #f0f0f0;\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n ",u.contentDocument.head.appendChild(w)}}ngOnInit(){this.totalPages=this.getPdfTotalPages()}goToPage(){this.currentPage<1?this.currentPage=1:this.currentPage>this.totalPages&&(this.currentPage=this.totalPages)}constructor(){this.fileMimeType=Te,this.zoom=1,this.currentPage=1,this.totalPages=1,this.totalPages=this.getPdfTotalPages()}getPdfTotalPages(){return 10}goToPreviousPage(){this.currentPage>1&&this.currentPage--}goToNextPage(){this.currentPagef.e(4630).then(f.bind(f,64630)).then(v=>v.IntroductionComponent),title:"Introduction",data:{hide:!0,icon:"lightbulb"}},{path:"dashboard",loadComponent:()=>Promise.all([f.e(6195),f.e(2320)]).then(f.bind(f,62320)).then(v=>v.DashboardComponent),title:"Dashboard",data:{hide:!0,icon:"dashboard"}},{path:"communities",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(2076),f.e(6702)]).then(f.bind(f,6702)).then(v=>v.CommunitiesComponent),title:"Communities",data:{icon:"diversity_2"}},{path:"app/projects",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(8101)]).then(f.bind(f,18101)).then(v=>v.ProjectsComponent),title:"Projects",data:{hide:!0,icon:"diversity_1"}},{path:"communities/create",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(v=>v.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"communities/create/:id",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(v=>v.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"community/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3028)]).then(f.bind(f,73028)).then(v=>v.CommunityComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(v=>v.FriendsComponent),title:"Friends",data:{hide:!0,icon:"people"}},{path:"app/friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(v=>v.FriendsComponent),title:"Friends",data:{hide:!1,icon:"people"}},{path:"app/chat",redirectTo:"app/chat/home",pathMatch:"full"},{path:"app/chat/:id",loadComponent:()=>f.e(3446).then(f.bind(f,63446)).then(v=>v.ChatComponent),title:"Chat",data:{icon:"chat"}},{path:"app/voluntaryist-covenant",loadComponent:()=>Promise.all([f.e(6850),f.e(4885)]).then(f.bind(f,74885)).then(v=>v.VoluntaryistCovenantComponent),title:"Voluntaryist Covenant",data:{hide:!0,icon:"assured_workload"}},{path:"marketplace",loadComponent:()=>f.e(4392).then(f.bind(f,94392)).then(v=>v.MarketplaceComponent),title:"Marketplace",data:{icon:"storefront"}},{path:"apps",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(946)]).then(f.bind(f,50946)).then(v=>v.AppsComponent),title:"Apps",data:{icon:"apps"}},{path:"app/files",loadComponent:()=>f.e(6797).then(f.bind(f,46797)).then(v=>v.FilesComponent),title:"Files",data:{icon:"folder",breadcrumb:"Files"},children:[{path:"",pathMatch:"full",redirectTo:"folder/root"},{path:"file/:id",component:(()=>{class v{constructor(){var u=this;this.entries=(0,c.vPA)([]),this.app=(0,c.WQX)(m.d),this.breadcrumb=(0,c.WQX)(ie),this.layout=(0,c.WQX)(S.Y),this.identity=(0,c.WQX)(g.K),this.dialog=(0,c.WQX)(j.bZ),this.router=(0,c.WQX)(x.Ix),this.route=(0,c.WQX)(x.nX),this.fileService=(0,c.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.fileId=null,this.sanitizer=(0,c.WQX)(i.up),this.navigation=(0,c.WQX)(Tt.o),this.zoom=1,this.loading=!1,this.fullscreen=(0,c.vPA)(!1),this.canZoomIn=!1,this.canZoomOut=!0,this.fileMimeType=Te,this.pdfZoom=1,(0,c.QZP)((0,B.A)(function*(){u.app.initialized()&&(yield u.loadEntries())})),this.route.paramMap.subscribe(w=>{console.log("ROUTING!!!",w.get("id")),this.fileId=w.get("id")})}toggleFullscreen(){var u=document.getElementById("file-viewer");this.fullscreen()?(document.exitFullscreen(),this.fullscreen.set(!1)):(u.requestFullscreen(),this.fullscreen.set(!0))}updateZoomControls(){this.canZoomIn=this.zoom<1,this.canZoomOut=this.zoom>.1}zoomIn(){this.zoom=Math.min(1,this.zoom+.1),this.updateZoomControls()}zoomOut(){this.zoom=Math.max(.1,this.zoom-.1),this.updateZoomControls()}download(){const u=URL.createObjectURL(this.fileUrl),w=document.createElement("a");console.log("File URL"),console.log(u),w.href=u;const U=this.record?.tags.name;w.download=U,w.click(),URL.revokeObjectURL(u)}pdfZoomIn(){this.pdfZoom++}pdfZoomOut(){this.pdfZoom>1&&this.pdfZoom--}editFile(u){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}onFileSelected(u){var w=this;return(0,B.A)(function*(){const U=u.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let Y=0;Y[...Ht,{record:Ot,data:dt}])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var u=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield u.identity.web5.dwn.records.create({data:u.file,message:{schema:_.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}editFolder(u){var w=this;return(0,B.A)(function*(){let U={name:u.data.name,entryType:"folder"};const Y=JSON.parse(JSON.stringify(U)),le=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return le.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),u.data=U,yield w.saveFolder(u,U)):U=Y});return function(Pe){return ge.apply(this,arguments)}}()),le.afterClosed()})()}saveFolder(u,w){var U=this;return(0,B.A)(function*(){if(u.record){const{status:Y,record:le}=yield u.record.update({data:w});console.log("Record created:",le),console.log("Record status:",Y)}else{const{record:Y,status:le}=yield U.identity.web5.dwn.records.create({data:w,message:{tags:{entryType:w.entryType},protocol:_.Q.protocol,protocolPath:"entry",schema:_.Q.types.entry.schema}});console.log("Record created:",Y),console.log("Record status:",le),Y&&(u.record=Y,U.entries.update(ge=>[...ge,u]))}})()}openEntry(u){var w=this;return(0,B.A)(function*(){w.router.navigate("folder"===u.entryType?["/app/files/folder",u.record.id]:["/app/files/file",u.record.id])})()}deleteFile(){var u=this;return(0,B.A)(function*(){u.loading=!0;const{status:w}=yield u.record.delete(),{status:U}=yield u.record.send(u.identity.did);console.log("Delete status:",w),console.log("Delete send status:",U),u.record=void 0,u.src=void 0,u.navigation.back()})()}loadEntries(u){var w=this;return(0,B.A)(function*(){if(console.log("VALUE OF TAGS:",u),!w.fileId)return;const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:w.fileId}}});if(w.record=U,w.fileUrl=yield U.data.blob(),console.log(U),w.type=U.dataFormat,"application/pdf"===U.dataFormat){const Y=URL.createObjectURL(w.fileUrl)+"#toolbar=0&navpanes=0&scrollbar=0&view=FitH";w.src=w.sanitizer.bypassSecurityTrustResourceUrl(Y)}else{const Y=URL.createObjectURL(w.fileUrl);w.src=w.sanitizer.bypassSecurityTrustResourceUrl(Y)}})()}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-file"]],standalone:!0,features:[c.aNF],decls:3,vars:2,consts:[["id","file-viewer"],[3,"src","type","zoom"],["mat-icon-button","",3,"click","title","disabled"],["mat-icon-button","",3,"click","title"],[1,"ellipsis",3,"matTooltip"],[1,"toolbar-spacer"],["mat-icon-button","",3,"click","disabled"],["mat-icon-button","",3,"title"]],template:function(w,U){1&w&&(c.j41(0,"div",0),c.DNE(1,re,17,7,"mat-toolbar")(2,X,3,3,"app-file-viewer",1),c.k0s()),2&w&&(c.R7$(),c.vxM(U.record?1:-1),c.R7$(),c.vxM(U.src?2:-1))},dependencies:[nt,R.MD,q.Fg,M.m_,M.An,Qe.s5,Qe.KQ,E.Hl,E.iY,W.uc,W.oV]})}}return v})(),data:{breadcrumb:"Folder"}},{path:"**",component:Xe,data:{breadcrumb:"Folder"}}]},{path:"app/notes",loadComponent:()=>Promise.all([f.e(6471),f.e(8067),f.e(5832)]).then(f.bind(f,55832)).then(v=>v.NotesComponent),title:"Notes",data:{icon:"note"}},{path:"app/player",loadComponent:()=>f.e(2429).then(f.bind(f,22429)).then(v=>v.PlayerComponent),title:"Player",data:{icon:"play_circle"}},{path:"app/text",loadComponent:()=>Promise.all([f.e(6471),f.e(2765),f.e(8067),f.e(6406)]).then(f.bind(f,86406)).then(v=>v.TextComponent),title:"Text",data:{icon:"notes"}},{path:"app/tasks",redirectTo:"app/tasks/home",pathMatch:"full"},{path:"app/tasks/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(2765),f.e(1391),f.e(3907)]).then(f.bind(f,93907)).then(v=>v.TasksComponent),title:"Tasks",data:{icon:"task"}},{path:"registries",loadComponent:()=>Promise.all([f.e(6695),f.e(9466)]).then(f.bind(f,69466)).then(v=>v.RegistriesComponent),title:"Registries",data:{icon:"folder_shared"}},{path:"registry/bsn",loadComponent:()=>Promise.all([f.e(6850),f.e(6695),f.e(6471),f.e(2076),f.e(5026)]).then(f.bind(f,65026)).then(v=>v.RegistryComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/freeid",loadComponent:()=>f.e(7160).then(f.bind(f,47160)).then(v=>v.FreeIDComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/podcast",loadComponent:()=>f.e(60).then(f.bind(f,80060)).then(v=>v.PodcastComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/liberstad-land-registry",loadComponent:()=>f.e(8880).then(f.bind(f,68880)).then(v=>v.LiberstadLandComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/gaianet",loadComponent:()=>f.e(4388).then(f.bind(f,64388)).then(v=>v.GaianetComponent),title:"Gaianet",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(2084)]).then(f.bind(f,32084)).then(v=>v.LocalCompanyComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry/:id",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(9158)]).then(f.bind(f,89158)).then(v=>v.LocalCompanyViewComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"data/view/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3474)]).then(f.bind(f,53474)).then(v=>v.DataViewComponent),title:"Data View",data:{hide:!0,icon:"folder_shared"}},{path:"data",loadComponent:()=>Promise.all([f.e(6850),f.e(7358),f.e(9454),f.e(3287)]).then(f.bind(f,63287)).then(v=>v.DataComponent),title:"Data",data:{hide:!0,icon:"source"}},{path:"data/:source/:id",loadComponent:()=>Promise.all([f.e(2076),f.e(9533)]).then(f.bind(f,29533)).then(v=>v.DataEntryComponent),title:"Data Entry",data:{hide:!0,icon:"source"}},{path:"profile/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(6489)]).then(f.bind(f,96489)).then(v=>v.ProfileComponent),title:"Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/edit",loadComponent:()=>Promise.all([f.e(3475),f.e(7380)]).then(f.bind(f,37380)).then(v=>v.ProfileEditComponent),title:"Edit Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/posts/:postId",loadComponent:()=>f.e(5680).then(f.bind(f,45680)).then(v=>v.PostComponent),title:"Posts",data:{hide:!0,icon:"note"}},{path:"notifications",loadComponent:()=>f.e(2228).then(f.bind(f,92228)).then(v=>v.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"notifications"}},{path:"accounts",loadComponent:()=>Promise.all([f.e(6850),f.e(9454),f.e(6486)]).then(f.bind(f,96486)).then(v=>v.AccountsComponent),title:"Accounts",data:{hide:!0,icon:"account_circle"}},{path:"account/password",loadComponent:()=>f.e(8012).then(f.bind(f,88012)).then(v=>v.PasswordComponent),title:"Password",data:{hide:!0,icon:"account_circle"}},{path:"account/backup",loadComponent:()=>f.e(5962).then(f.bind(f,75962)).then(v=>v.BackupComponent),title:"Backup",data:{hide:!0,icon:"account_circle"}},{path:"account/create",loadComponent:()=>f.e(5806).then(f.bind(f,75806)).then(v=>v.CreateComponent),title:"Create Account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/new",loadComponent:()=>f.e(9613).then(f.bind(f,29613)).then(v=>v.NewComponent),title:"Create new account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/restore",loadComponent:()=>Promise.resolve().then(f.bind(f,33065)).then(v=>v.RestoreComponent),title:"Restore existing account",data:{hide:!0,icon:"account_circle"}},{path:"account/:id",loadComponent:()=>f.e(7880).then(f.bind(f,17880)).then(v=>v.AccountComponent),title:"Account",data:{hide:!0,icon:"account_circle"}},{path:"identity",loadComponent:()=>f.e(5854).then(f.bind(f,85854)).then(v=>v.IdentityComponent),title:"Identity",data:{hide:!0,icon:"account_circle"}},{path:"settings",loadComponent:()=>f.e(959).then(f.bind(f,60959)).then(v=>v.SettingsComponent),title:"Settings",data:{hide:!0,icon:"settings"}},{path:"settings/about",loadComponent:()=>f.e(5216).then(f.bind(f,85216)).then(v=>v.AboutComponent),title:"About",data:{hide:!0,icon:"settings"}},{path:"settings/licenses",loadComponent:()=>f.e(9727).then(f.bind(f,19727)).then(v=>v.LicensesComponent),title:"Licenses",data:{hide:!0,icon:"settings"}},{path:"settings/privacy",loadComponent:()=>f.e(9128).then(f.bind(f,99128)).then(v=>v.PrivacyComponent),title:"Privacy",data:{hide:!0,icon:"settings"}},{path:"settings/handler",loadComponent:()=>f.e(8552).then(f.bind(f,18552)).then(v=>v.HandlerComponent),title:"Protocol Handler",data:{hide:!0,icon:"search"}},{path:"settings/connections",loadComponent:()=>Promise.all([f.e(9996),f.e(2276)]).then(f.bind(f,62276)).then(v=>v.ConnectionsComponent),title:"Connections",data:{hide:!0,icon:"people"}},{path:"settings/blocks",loadComponent:()=>f.e(5874).then(f.bind(f,45874)).then(v=>v.BlocksComponent),title:"Blocks",data:{hide:!0,icon:"manage_accounts"}},{path:"settings/roles",loadComponent:()=>f.e(7660).then(f.bind(f,47660)).then(v=>v.RolesComponent),title:"Roles",data:{hide:!0,icon:"group"}},{path:"settings/notifications",loadComponent:()=>f.e(4500).then(f.bind(f,74500)).then(v=>v.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"settings"}},{path:"settings/debug",loadComponent:()=>f.e(3416).then(f.bind(f,13416)).then(v=>v.DebugComponent),title:"Debug",data:{hide:!0,icon:"bug_report"}},{path:"tree",loadComponent:()=>Promise.all([f.e(7358),f.e(9238)]).then(f.bind(f,9238)).then(v=>v.TreeComponent),title:"Tree",data:{hide:!0,icon:"folder"}},{path:"drag-drop",loadComponent:()=>Promise.all([f.e(1391),f.e(7988)]).then(f.bind(f,77988)).then(v=>v.DragDropComponent),title:"Drag-Drop",data:{hide:!0,icon:"folder"}},{path:"storage",loadComponent:()=>Promise.all([f.e(6471),f.e(7848)]).then(f.bind(f,17848)).then(v=>v.StorageComponent),title:"Storage",data:{icon:"cloud"}},{path:"management",loadComponent:()=>Promise.all([f.e(6850),f.e(8864)]).then(f.bind(f,48864)).then(v=>v.ManagementComponent),title:"Management",data:{hide:!0,icon:"manage_accounts"}}];let je=(()=>{class v{constructor(u,w,U,Y,le){this.doc=u,this.delegate=w,this.zone=U,this.animationType=Y,this.moduleImpl=le,this._rendererFactoryPromise=null,this.scheduler=(0,c.WQX)(c.An2,{optional:!0}),this.loadingSchedulerFn=(0,c.WQX)(ot,{optional:!0})}ngOnDestroy(){this._engine?.flush()}loadImpl(){const u=()=>this.moduleImpl??f.e(8008).then(f.bind(f,68008)).then(U=>U);let w;return w=this.loadingSchedulerFn?this.loadingSchedulerFn(u):u(),w.catch(U=>{throw new c.wOt(5300,!1)}).then(({\u0275createEngine:U,\u0275AnimationRendererFactory:Y})=>{this._engine=U(this.animationType,this.doc);const le=new Y(this.delegate,this._engine,this.zone);return this.delegate=le,le})}createRenderer(u,w){const U=this.delegate.createRenderer(u,w);if(0===U.\u0275type)return U;"boolean"==typeof U.throwOnSyntheticProps&&(U.throwOnSyntheticProps=!1);const Y=new Ne(U);return w?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(le=>{const ge=le.createRenderer(u,w);Y.use(ge),this.scheduler?.notify(10)}).catch(le=>{Y.use(U)}),Y}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}static{this.\u0275fac=function(w){c.QTQ()}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac})}}return v})();class Ne{constructor(a){this.delegate=a,this.replay=[],this.\u0275type=1}use(a){if(this.delegate=a,null!==this.replay){for(const u of this.replay)u(a);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(a,u){return this.delegate.createElement(a,u)}createComment(a){return this.delegate.createComment(a)}createText(a){return this.delegate.createText(a)}get destroyNode(){return this.delegate.destroyNode}appendChild(a,u){this.delegate.appendChild(a,u)}insertBefore(a,u,w,U){this.delegate.insertBefore(a,u,w,U)}removeChild(a,u,w){this.delegate.removeChild(a,u,w)}selectRootElement(a,u){return this.delegate.selectRootElement(a,u)}parentNode(a){return this.delegate.parentNode(a)}nextSibling(a){return this.delegate.nextSibling(a)}setAttribute(a,u,w,U){this.delegate.setAttribute(a,u,w,U)}removeAttribute(a,u,w){this.delegate.removeAttribute(a,u,w)}addClass(a,u){this.delegate.addClass(a,u)}removeClass(a,u){this.delegate.removeClass(a,u)}setStyle(a,u,w,U){this.delegate.setStyle(a,u,w,U)}removeStyle(a,u,w){this.delegate.removeStyle(a,u,w)}setProperty(a,u,w){this.shouldReplay(u)&&this.replay.push(U=>U.setProperty(a,u,w)),this.delegate.setProperty(a,u,w)}setValue(a,u){this.delegate.setValue(a,u)}listen(a,u,w){return this.shouldReplay(u)&&this.replay.push(U=>U.listen(a,u,w)),this.delegate.listen(a,u,w)}shouldReplay(a){return null!==this.replay&&a.startsWith("@")}}const ot=new c.nKC("");var wt=f(59030),zt=f(18810),rr=f(33726),ar=f(7673),lr=f(28793),hn=f(21413),Wr=f(71985),vr=f(85343);const Tr=new Wr.c(vr.l);var lt=f(57786),Pt=f(86648),Ct=f(96354),jt=f(25558),Nr=f(30017),Ke=f(98071),Ze=f(58750),gt=f(39974);const mt={connector:()=>new hn.B};function Xt(v,a=mt){const{connector:u}=a;return(0,gt.N)((w,U)=>{const Y=u();(0,Ze.Tg)(v(function st(v){return new Wr.c(a=>v.subscribe(a))}(Y))).subscribe(U),U.add(w.subscribe(Y))})}var Lr=f(96697),yr=f(88141),$r=f(91986);const mi="Service workers are disabled or not supported by this browser";class wn{constructor(a){if(this.serviceWorker=a,a){const w=(0,rr.R)(a,"controllerchange").pipe((0,Ct.T)(()=>a.controller)),U=(0,wt.v)(()=>(0,ar.of)(a.controller)),Y=(0,lr.x)(U,w);this.worker=Y.pipe((0,te.p)(dt=>!!dt)),this.registration=this.worker.pipe((0,jt.n)(()=>a.getRegistration()));const Ge=(0,rr.R)(a,"message").pipe((0,Ct.T)(dt=>dt.data)).pipe((0,te.p)(dt=>dt&&dt.type)).pipe(function Zt(v){return v?a=>Xt(v)(a):a=>function Et(v,a){const u=(0,Ke.T)(v)?v:()=>v;return(0,Ke.T)(a)?Xt(a,{connector:u}):w=>new Nr.G(w,u)}(new hn.B)(a)}());Ge.connect(),this.events=Ge}else this.worker=this.events=this.registration=function Vn(v){return(0,wt.v)(()=>(0,zt.$)(new Error(v)))}(mi)}postMessage(a,u){return this.worker.pipe((0,Lr.s)(1),(0,yr.M)(w=>{w.postMessage({action:a,...u})})).toPromise().then(()=>{})}postMessageWithOperation(a,u,w){const U=this.waitForOperationCompleted(w),Y=this.postMessage(a,u);return Promise.all([Y,U]).then(([,le])=>le)}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(a){let u;return u="string"==typeof a?w=>w.type===a:w=>a.includes(w.type),this.events.pipe((0,te.p)(u))}nextEventOfType(a){return this.eventsOfType(a).pipe((0,Lr.s)(1))}waitForOperationCompleted(a){return this.eventsOfType("OPERATION_COMPLETED").pipe((0,te.p)(u=>u.nonce===a),(0,Lr.s)(1),(0,Ct.T)(u=>{if(void 0!==u.result)return u.result;throw new Error(u.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}let Jt=(()=>{class v{get isEnabled(){return this.sw.isEnabled}constructor(u){if(this.sw=u,this.pushManager=null,this.subscriptionChanges=new hn.B,!u.isEnabled)return this.messages=Tr,this.notificationClicks=Tr,void(this.subscription=Tr);this.messages=this.sw.eventsOfType("PUSH").pipe((0,Ct.T)(U=>U.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe((0,Ct.T)(U=>U.data)),this.pushManager=this.sw.registration.pipe((0,Ct.T)(U=>U.pushManager));const w=this.pushManager.pipe((0,jt.n)(U=>U.getSubscription()));this.subscription=(0,lt.h)(w,this.subscriptionChanges)}requestSubscription(u){if(!this.sw.isEnabled||null===this.pushManager)return Promise.reject(new Error(mi));const w={userVisibleOnly:!0};let U=this.decodeBase64(u.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),Y=new Uint8Array(new ArrayBuffer(U.length));for(let le=0;lele.subscribe(w)),(0,Lr.s)(1)).toPromise().then(le=>(this.subscriptionChanges.next(le),le))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe((0,Lr.s)(1),(0,jt.n)(w=>{if(null===w)throw new Error("Not subscribed to push notifications.");return w.unsubscribe().then(U=>{if(!U)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(mi))}decodeBase64(u){return atob(u)}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(wn))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac})}}return v})(),Hr=(()=>{class v{get isEnabled(){return this.sw.isEnabled}constructor(u){if(this.sw=u,!u.isEnabled)return this.versionUpdates=Tr,void(this.unrecoverable=Tr);this.versionUpdates=this.sw.eventsOfType(["VERSION_DETECTED","VERSION_INSTALLATION_FAILED","VERSION_READY","NO_NEW_VERSION_DETECTED"]),this.unrecoverable=this.sw.eventsOfType("UNRECOVERABLE_STATE")}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const u=this.sw.generateNonce();return this.sw.postMessageWithOperation("CHECK_FOR_UPDATES",{nonce:u},u)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const u=this.sw.generateNonce();return this.sw.postMessageWithOperation("ACTIVATE_UPDATE",{nonce:u},u)}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(wn))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac})}}return v})();const Lt=new c.nKC("");function dr(v,a,u,w){return()=>{if(!(0,R.UE)(w)||!("serviceWorker"in navigator)||!1===u.enabled)return;const U=v.get(c.SKi),Y=v.get(c.o8S);let le;if(U.runOutsideAngular(()=>{const ge=navigator.serviceWorker,Pe=()=>ge.controller?.postMessage({action:"INITIALIZE"});ge.addEventListener("controllerchange",Pe),Y.onDestroy(()=>{ge.removeEventListener("controllerchange",Pe)})}),"function"==typeof u.registrationStrategy)le=u.registrationStrategy();else{const[ge,...Pe]=(u.registrationStrategy||"registerWhenStable:30000").split(":");switch(ge){case"registerImmediately":le=(0,ar.of)(null);break;case"registerWithDelay":le=xr(+Pe[0]||0);break;case"registerWhenStable":const Ge=(0,Pt.H)(v.get(c.o8S).whenStable());le=Pe[0]?(0,lt.h)(Ge,xr(+Pe[0])):Ge;break;default:throw new Error(`Unknown ServiceWorker registration strategy: ${u.registrationStrategy}`)}}U.runOutsideAngular(()=>le.pipe((0,Lr.s)(1)).subscribe(()=>navigator.serviceWorker.register(a,{scope:u.scope}).catch(ge=>console.error("Service worker registration failed with:",ge))))}}function xr(v){return(0,ar.of)(null).pipe((0,$r.c)(v))}function fn(v,a){return new wn((0,R.UE)(a)&&!1!==v.enabled?navigator.serviceWorker:void 0)}class Sn{}var li=f(21626),Kr=f(1005);const ur={providers:[(0,li.$R)(),(0,c.Jn2)({eventCoalescing:!0}),(0,x.lh)(he,(0,x.Sn)(x.Kp)),function Ft(v="animations"){return(0,c.ngT)("NgAsyncAnimations"),(0,c.EmA)([{provide:c._9s,useFactory:(a,u,w)=>new je(a,u,w,v),deps:[R.qQ,i.B7,c.SKi]},{provide:c.bc$,useValue:"noop"===v?"NoopAnimations":"BrowserAnimations"}])}(),function Xn(v,a={}){return(0,c.EmA)([Jt,Hr,{provide:Lt,useValue:v},{provide:Sn,useValue:a},{provide:wn,useFactory:fn,deps:[Sn,c.Agw]},{provide:c.hnV,useFactory:dr,deps:[c.zZn,Lt,Sn,c.Agw],multi:!0}])}("ngsw-worker.js",{enabled:!(0,c.naY)(),registrationStrategy:"registerWhenStable:30000"}),{provide:c.hnV,useFactory:function er(v){return()=>v.load()},deps:[Kr.G],multi:!0}]};var Fr=f(99327),qt=f(67333),mr=f(86600),_r=f(18617),Gr=f(28203),gn=f(14085),An=f(67336),On=f(36860),Un=f(73703),oi=f(56977),$i=f(23294),Fi=f(99172),no=f(70152),Zi=f(49969);const Ao=["*"],Fo=["content"],Hi=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],ro=["mat-drawer","mat-drawer-content","*"];function uo(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",1),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U._onBackdropClicked())}),c.k0s()}if(2&v){const u=c.XpG();c.AVh("mat-drawer-shown",u._isShowingBackdrop())}}function Oi(v,a){1&v&&(c.j41(0,"mat-drawer-content"),c.SdG(1,2),c.k0s())}const Jn=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],Qo=["mat-sidenav","mat-sidenav-content","*"];function Gs(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",1),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U._onBackdropClicked())}),c.k0s()}if(2&v){const u=c.XpG();c.AVh("mat-drawer-shown",u._isShowingBackdrop())}}function As(v,a){1&v&&(c.j41(0,"mat-sidenav-content"),c.SdG(1,2),c.k0s())}const Fa={transformDrawer:(0,Zi.hZ)("transform",[(0,Zi.wk)("open, open-instant",(0,Zi.iF)({transform:"none",visibility:"visible"})),(0,Zi.wk)("void",(0,Zi.iF)({"box-shadow":"none",visibility:"hidden"})),(0,Zi.kY)("void => open-instant",(0,Zi.i0)("0ms")),(0,Zi.kY)("void <=> open, open-instant => void",(0,Zi.i0)("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))])},Ji=new c.nKC("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:function uc(){return!1}}),vs=new c.nKC("MAT_DRAWER_CONTAINER");let yt=(()=>{class v extends qt.uv{constructor(u,w,U,Y,le){super(U,Y,le),this._changeDetectorRef=u,this._container=w}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.gRc),c.rXU((0,c.Rfq)(()=>wr)),c.rXU(c.aKT),c.rXU(qt.R),c.rXU(c.SKi))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:4,hostBindings:function(w,U){2&w&&c.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[c.Jv_([{provide:qt.uv,useExisting:v}]),c.Vt3,c.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(c.NAR(),c.SdG(0))},encapsulation:2,changeDetection:0})}}return v})(),kt=(()=>{class v{get position(){return this._position}set position(u){(u="end"===u?"end":"start")!==this._position&&(this._isAttached&&this._updatePositionInParent(u),this._position=u,this.onPositionChanged.emit())}get mode(){return this._mode}set mode(u){this._mode=u,this._updateFocusTrapState(),this._modeChanged.next()}get disableClose(){return this._disableClose}set disableClose(u){this._disableClose=(0,gn.he)(u)}get autoFocus(){return this._autoFocus??("side"===this.mode?"dialog":"first-tabbable")}set autoFocus(u){("true"===u||"false"===u||null==u)&&(u=(0,gn.he)(u)),this._autoFocus=u}get opened(){return this._opened}set opened(u){this.toggle((0,gn.he)(u))}constructor(u,w,U,Y,le,ge,Pe,Ge){this._elementRef=u,this._focusTrapFactory=w,this._focusMonitor=U,this._platform=Y,this._ngZone=le,this._interactivityChecker=ge,this._doc=Pe,this._container=Ge,this._focusTrap=null,this._elementFocusedBeforeDrawerWasOpened=null,this._enableAnimations=!1,this._position="start",this._mode="over",this._disableClose=!1,this._opened=!1,this._animationStarted=new hn.B,this._animationEnd=new hn.B,this._animationState="void",this.openedChange=new c.bkB(!0),this._openedStream=this.openedChange.pipe((0,te.p)(dt=>dt),(0,Ct.T)(()=>{})),this.openedStart=this._animationStarted.pipe((0,te.p)(dt=>dt.fromState!==dt.toState&&0===dt.toState.indexOf("open")),(0,Un.u)(void 0)),this._closedStream=this.openedChange.pipe((0,te.p)(dt=>!dt),(0,Ct.T)(()=>{})),this.closedStart=this._animationStarted.pipe((0,te.p)(dt=>dt.fromState!==dt.toState&&"void"===dt.toState),(0,Un.u)(void 0)),this._destroyed=new hn.B,this.onPositionChanged=new c.bkB,this._modeChanged=new hn.B,this._injector=(0,c.WQX)(c.zZn),this._changeDetectorRef=(0,c.WQX)(c.gRc),this.openedChange.pipe((0,oi.Q)(this._destroyed)).subscribe(dt=>{dt?(this._doc&&(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement),this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{(0,rr.R)(this._elementRef.nativeElement,"keydown").pipe((0,te.p)(dt=>dt.keyCode===An._f&&!this.disableClose&&!(0,An.rp)(dt)),(0,oi.Q)(this._destroyed)).subscribe(dt=>this._ngZone.run(()=>{this.close(),dt.stopPropagation(),dt.preventDefault()}))}),this._animationEnd.pipe((0,$i.F)((dt,_t)=>dt.fromState===_t.fromState&&dt.toState===_t.toState)).subscribe(dt=>{const{fromState:_t,toState:Ot}=dt;(0===Ot.indexOf("open")&&"void"===_t||"void"===Ot&&0===_t.indexOf("open"))&&this.openedChange.emit(this._opened)})}_forceFocus(u,w){this._interactivityChecker.isFocusable(u)||(u.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{const U=()=>{u.removeEventListener("blur",U),u.removeEventListener("mousedown",U),u.removeAttribute("tabindex")};u.addEventListener("blur",U),u.addEventListener("mousedown",U)})),u.focus(w)}_focusByCssSelector(u,w){let U=this._elementRef.nativeElement.querySelector(u);U&&this._forceFocus(U,w)}_takeFocus(){if(!this._focusTrap)return;const u=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":(0,c.mal)(()=>{!this._focusTrap.focusInitialElement()&&"function"==typeof u.focus&&u.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus)}}_restoreFocus(u){"dialog"!==this.autoFocus&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,u):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){const u=this._doc.activeElement;return!!u&&this._elementRef.nativeElement.contains(u)}ngAfterViewInit(){this._isAttached=!0,"end"===this._position&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngAfterContentChecked(){this._platform.isBrowser&&(this._enableAnimations=!0)}ngOnDestroy(){this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(u){return this.toggle(!0,u)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(u=!this.opened,w){u&&w&&(this._openedVia=w);const U=this._setOpen(u,!u&&this._isFocusWithinDrawer(),this._openedVia||"program");return u||(this._openedVia=null),U}_setOpen(u,w,U){return this._opened=u,u?this._animationState=this._enableAnimations?"open":"open-instant":(this._animationState="void",w&&this._restoreFocus(U)),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(Y=>{this.openedChange.pipe((0,Lr.s)(1)).subscribe(le=>Y(le?"open":"close"))})}_getWidth(){return this._elementRef.nativeElement&&this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(u){if(!this._platform.isBrowser)return;const w=this._elementRef.nativeElement,U=w.parentNode;"end"===u?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),U.insertBefore(this._anchor,w)),U.appendChild(w)):this._anchor&&this._anchor.parentNode.insertBefore(w,this._anchor)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.aKT),c.rXU(_r.GX),c.rXU(_r.FN),c.rXU(On.OD),c.rXU(c.SKi),c.rXU(_r.Z7),c.rXU(R.qQ,8),c.rXU(vs,8))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-drawer"]],viewQuery:function(w,U){if(1&w&&c.GBs(Fo,5),2&w){let Y;c.mGM(Y=c.lsd())&&(U._content=Y.first)}},hostAttrs:["tabIndex","-1",1,"mat-drawer"],hostVars:12,hostBindings:function(w,U){1&w&&c.Kam("@transform.start",function(le){return U._animationStarted.next(le)})("@transform.done",function(le){return U._animationEnd.next(le)}),2&w&&(c.zvX("@transform",U._animationState),c.BMQ("align",null),c.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],standalone:!0,features:[c.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(c.NAR(),c.j41(0,"div",1,0),c.SdG(2),c.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Fa.transformDrawer]},changeDetection:0})}}return v})(),wr=(()=>{class v{get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(u){this._autosize=(0,gn.he)(u)}get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(u){this._backdropOverride=null==u?null:(0,gn.he)(u)}get scrollable(){return this._userContent||this._content}constructor(u,w,U,Y,le,ge=!1,Pe){this._dir=u,this._element=w,this._ngZone=U,this._changeDetectorRef=Y,this._animationMode=Pe,this._drawers=new c.rOR,this.backdropClick=new c.bkB,this._destroyed=new hn.B,this._doCheckSubject=new hn.B,this._contentMargins={left:null,right:null},this._contentMarginChanges=new hn.B,this._injector=(0,c.WQX)(c.zZn),u&&u.change.pipe((0,oi.Q)(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),le.change().pipe((0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins()),this._autosize=ge}ngAfterContentInit(){this._allDrawers.changes.pipe((0,Fi.Z)(this._allDrawers),(0,oi.Q)(this._destroyed)).subscribe(u=>{this._drawers.reset(u.filter(w=>!w._container||w._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe((0,Fi.Z)(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(u=>{this._watchDrawerToggle(u),this._watchDrawerPosition(u),this._watchDrawerMode(u)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe((0,no.B)(10),(0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(u=>u.open())}close(){this._drawers.forEach(u=>u.close())}updateContentMargins(){let u=0,w=0;if(this._left&&this._left.opened)if("side"==this._left.mode)u+=this._left._getWidth();else if("push"==this._left.mode){const U=this._left._getWidth();u+=U,w-=U}if(this._right&&this._right.opened)if("side"==this._right.mode)w+=this._right._getWidth();else if("push"==this._right.mode){const U=this._right._getWidth();w+=U,u-=U}u=u||null,w=w||null,(u!==this._contentMargins.left||w!==this._contentMargins.right)&&(this._contentMargins={left:u,right:w},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(u){u._animationStarted.pipe((0,te.p)(w=>w.fromState!==w.toState),(0,oi.Q)(this._drawers.changes)).subscribe(w=>{"open-instant"!==w.toState&&"NoopAnimations"!==this._animationMode&&this._element.nativeElement.classList.add("mat-drawer-transition"),this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),"side"!==u.mode&&u.openedChange.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>this._setContainerClass(u.opened))}_watchDrawerPosition(u){u&&u.onPositionChanged.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>{(0,c.mal)(()=>{this._validateDrawers()},{injector:this._injector,phase:c.wjH.Read})})}_watchDrawerMode(u){u&&u._modeChanged.pipe((0,oi.Q)((0,lt.h)(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(u){const w=this._element.nativeElement.classList,U="mat-drawer-container-has-open";u?w.add(U):w.remove(U)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(u=>{"end"==u.position?this._end=u:this._start=u}),this._right=this._left=null,this._dir&&"rtl"===this._dir.value?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&"over"!=this._start.mode||this._isDrawerOpen(this._end)&&"over"!=this._end.mode}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(u=>u&&!u.disableClose&&this._drawerHasBackdrop(u)).forEach(u=>u._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(u){return null!=u&&u.opened}_drawerHasBackdrop(u){return null==this._backdropOverride?!!u&&"side"!==u.mode:this._backdropOverride}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(Gr.dS,8),c.rXU(c.aKT),c.rXU(c.SKi),c.rXU(c.gRc),c.rXU(qt.Xj),c.rXU(Ji),c.rXU(c.bc$,8))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-drawer-container"]],contentQueries:function(w,U,Y){if(1&w&&(c.wni(Y,yt,5),c.wni(Y,kt,5)),2&w){let le;c.mGM(le=c.lsd())&&(U._content=le.first),c.mGM(le=c.lsd())&&(U._allDrawers=le)}},viewQuery:function(w,U){if(1&w&&c.GBs(yt,5),2&w){let Y;c.mGM(Y=c.lsd())&&(U._userContent=Y.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(w,U){2&w&&c.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],standalone:!0,features:[c.Jv_([{provide:vs,useExisting:v}]),c.aNF],ngContentSelectors:ro,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(c.NAR(Hi),c.DNE(0,uo,1,2,"div",0),c.SdG(1),c.SdG(2,1),c.DNE(3,Oi,2,0,"mat-drawer-content")),2&w&&(c.vxM(U.hasBackdrop?0:-1),c.R7$(3),c.vxM(U._content?-1:3))},dependencies:[yt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return v})(),Yt=(()=>{class v extends yt{constructor(u,w,U,Y,le){super(u,w,U,Y,le)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.gRc),c.rXU((0,c.Rfq)(()=>Or)),c.rXU(c.aKT),c.rXU(qt.R),c.rXU(c.SKi))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],hostVars:4,hostBindings:function(w,U){2&w&&c.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[c.Jv_([{provide:qt.uv,useExisting:v}]),c.Vt3,c.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(c.NAR(),c.SdG(0))},encapsulation:2,changeDetection:0})}}return v})(),hr=(()=>{class v extends kt{constructor(){super(...arguments),this._fixedInViewport=!1,this._fixedTopGap=0,this._fixedBottomGap=0}get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(u){this._fixedInViewport=(0,gn.he)(u)}get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(u){this._fixedTopGap=(0,gn.OE)(u)}get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(u){this._fixedBottomGap=(0,gn.OE)(u)}static{this.\u0275fac=(()=>{let u;return function(U){return(u||(u=c.xGo(v)))(U||v)}})()}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-sidenav"]],hostAttrs:["tabIndex","-1",1,"mat-drawer","mat-sidenav"],hostVars:17,hostBindings:function(w,U){2&w&&(c.BMQ("align",null),c.xc7("top",U.fixedInViewport?U.fixedTopGap:null,"px")("bottom",U.fixedInViewport?U.fixedBottomGap:null,"px"),c.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened)("mat-sidenav-fixed",U.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],standalone:!0,features:[c.Vt3,c.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(c.NAR(),c.j41(0,"div",1,0),c.SdG(2),c.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Fa.transformDrawer]},changeDetection:0})}}return v})(),Or=(()=>{class v extends wr{constructor(){super(...arguments),this._allDrawers=void 0,this._content=void 0}static{this.\u0275fac=(()=>{let u;return function(U){return(u||(u=c.xGo(v)))(U||v)}})()}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-sidenav-container"]],contentQueries:function(w,U,Y){if(1&w&&(c.wni(Y,Yt,5),c.wni(Y,hr,5)),2&w){let le;c.mGM(le=c.lsd())&&(U._content=le.first),c.mGM(le=c.lsd())&&(U._allDrawers=le)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(w,U){2&w&&c.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},exportAs:["matSidenavContainer"],standalone:!0,features:[c.Jv_([{provide:vs,useExisting:v}]),c.Vt3,c.aNF],ngContentSelectors:Qo,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(c.NAR(Jn),c.DNE(0,Gs,1,2,"div",0),c.SdG(1),c.SdG(2,1),c.DNE(3,As,2,0,"mat-sidenav-content")),2&w&&(c.vxM(U.hasBackdrop?0:-1),c.R7$(3),c.vxM(U._content?-1:3))},dependencies:[Yt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return v})(),pn=(()=>{class v{static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275mod=c.$C({type:v})}static{this.\u0275inj=c.G2t({imports:[mr.yE,qt.Gj,qt.Gj,mr.yE]})}}return v})();var bn=f(44668),_i=f(31948),Xi=f(40605);let Io=(()=>{class v{constructor(u,w){this.swUpdate=u,this.zone=w,this.isNewVersionAvailable=!1,this.intervalSource=(0,Xi.Y)(9e5),this.checkForUpdateOnInterval(),this.checkForUpdateOnLoad()}applyUpdate(){this.swUpdate.activateUpdate().then(()=>document.location.reload()).catch(u=>console.error("Failed to apply updates:",u))}checkForUpdateOnInterval(){var u=this;this.intervalSubscription?.unsubscribe(),this.swUpdate.isEnabled&&this.zone.runOutsideAngular(()=>{this.intervalSubscription=this.intervalSource.subscribe((0,B.A)(function*(){if(u.isNewVersionAvailable)yield u.swUpdate.checkForUpdate();else try{u.isNewVersionAvailable=yield u.swUpdate.checkForUpdate(),console.log(u.isNewVersionAvailable?"A new version is available.":"Already on the latest version.")}catch(w){console.error("Failed to check for updates:",w)}}))})}checkForUpdateOnLoad(){this.newVersionSubscription?.unsubscribe(),this.swUpdate.isEnabled?(this.newVersionSubscription=this.swUpdate.versionUpdates.subscribe(u=>{switch(console.log("New version update event:"),console.log(u),u.type){case"VERSION_DETECTED":console.log(`Downloading new app version: ${u.version.hash}`);break;case"VERSION_READY":console.log(`Current app version: ${u.currentVersion.hash}`),console.log(`New app version ready for use: ${u.latestVersion.hash}`),this.isNewVersionAvailable=!0;break;case"VERSION_INSTALLATION_FAILED":console.log(`Failed to install app version '${u.version.hash}': ${u.error}`)}}),console.log("Subscribed to new version updates.")):console.log("Service worker updates are disabled for this app.")}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(Hr),c.KVO(c.SKi))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})();var Mo=f(33347),Ma=f(39434),Rs=f(78013);var oc=function(){var v=function(u,w){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,Y){U.__proto__=Y}||function(U,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(U[le]=Y[le])})(u,w)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Si=function(v){function a(u,w){var U=this.constructor,Y=v.call(this,u,w)||this;return Object.defineProperty(Y,"name",{value:U.name,enumerable:!1,configurable:!0}),function Ua(v,a){var u=Object.setPrototypeOf;u?u(v,a):v.__proto__=a}(Y,U.prototype),function ls(v,a){void 0===a&&(a=v.constructor);var u=Error.captureStackTrace;u&&u(v,a)}(Y),Y}return oc(a,v),a}(Error),is=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Us=function(v){function a(u){void 0===u&&(u=void 0);var w=v.call(this,u)||this;return w.message=u,w}return is(a,v),a.prototype.getKind=function(){return this.constructor.kind},a.kind="Exception",a}(Si);var Ec=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const bs=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ec(a,v),a.kind="ArgumentException",a}(Us);var Ds=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const ki=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ds(a,v),a.kind="IllegalArgumentException",a}(Us),jc=function(){function v(a){if(this.binarizer=a,null===a)throw new ki("Binarizer must be non-null.")}return v.prototype.getWidth=function(){return this.binarizer.getWidth()},v.prototype.getHeight=function(){return this.binarizer.getHeight()},v.prototype.getBlackRow=function(a,u){return this.binarizer.getBlackRow(a,u)},v.prototype.getBlackMatrix=function(){return null==this.matrix&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},v.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},v.prototype.crop=function(a,u,w,U){var Y=this.binarizer.getLuminanceSource().crop(a,u,w,U);return new v(this.binarizer.createBinarizer(Y))},v.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},v.prototype.rotateCounterClockwise=function(){var a=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new v(this.binarizer.createBinarizer(a))},v.prototype.rotateCounterClockwise45=function(){var a=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new v(this.binarizer.createBinarizer(a))},v.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},v}();var Ta=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const rs=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ta(a,v),a.getChecksumInstance=function(){return new a},a.kind="ChecksumException",a}(Us),Qt=function(){function v(a){this.source=a}return v.prototype.getLuminanceSource=function(){return this.source},v.prototype.getWidth=function(){return this.source.getWidth()},v.prototype.getHeight=function(){return this.source.getHeight()},v}(),Rt=function(){function v(){}return v.arraycopy=function(a,u,w,U,Y){for(;Y--;)w[U++]=a[u++]},v.currentTimeMillis=function(){return Date.now()},v}();var Pr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const qr=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Pr(a,v),a.kind="IndexOutOfBoundsException",a}(Us);var zn=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Zn=function(v){function a(u,w){void 0===u&&(u=void 0),void 0===w&&(w=void 0);var U=v.call(this,w)||this;return U.index=u,U.message=w,U}return zn(a,v),a.kind="ArrayIndexOutOfBoundsException",a}(qr),Vi=function(){function v(){}return v.fill=function(a,u){for(var w=0,U=a.length;ww)throw new ki("fromIndex("+u+") > toIndex("+w+")");if(u<0)throw new Zn(u);if(w>a)throw new Zn(w)},v.asList=function(){for(var a=[],u=0;u=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),le=Y.next();!le.done;le=Y.next())U=31*U+le.value}catch(Pe){u={error:Pe}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return U},v.fillUint8Array=function(a,u){for(var w=0;w!==a.length;w++)a[w]=u},v.copyOf=function(a,u){return a.slice(0,u)},v.copyOfUint8Array=function(a,u){if(a.length<=u){var w=new Uint8Array(u);return w.set(a),w}return a.slice(0,u)},v.copyOfRange=function(a,u,w){var U=w-u,Y=new Int32Array(U);return Rt.arraycopy(a,u,Y,0,U),Y},v.binarySearch=function(a,u,w){void 0===w&&(w=v.numberComparator);for(var U=0,Y=a.length-1;U<=Y;){var le=Y+U>>1,ge=w(u,a[le]);if(ge>0)U=le+1;else{if(!(ge<0))return le;Y=le-1}}return-U-1},v.numberComparator=function(a,u){return a-u},v}(),pi=function(){function v(){}return v.numberOfTrailingZeros=function(a){var u;if(0===a)return 32;var w=31;return 0!=(u=a<<16)&&(w-=16,a=u),0!=(u=a<<8)&&(w-=8,a=u),0!=(u=a<<4)&&(w-=4,a=u),0!=(u=a<<2)&&(w-=2,a=u),w-(a<<1>>>31)},v.numberOfLeadingZeros=function(a){if(0===a)return 32;var u=1;return a>>>16||(u+=16,a<<=16),a>>>24||(u+=8,a<<=8),a>>>28||(u+=4,a<<=4),a>>>30||(u+=2,a<<=2),u-(a>>>31)},v.toHexString=function(a){return a.toString(16)},v.toBinaryString=function(a){return String(parseInt(String(a),2))},v.bitCount=function(a){return a=(a=(858993459&(a-=a>>>1&1431655765))+(a>>>2&858993459))+(a>>>4)&252645135,63&(a+=a>>>8)+(a>>>16)},v.truncDivision=function(a,u){return Math.trunc(a/u)},v.parseInt=function(a,u){return void 0===u&&(u=void 0),parseInt(a,u)},v.MIN_VALUE_32_BITS=-2147483648,v.MAX_VALUE=Number.MAX_SAFE_INTEGER,v}(),bi=function(){function v(a,u){void 0===a?(this.size=0,this.bits=new Int32Array(1)):(this.size=a,this.bits=null==u?v.makeArray(a):u)}return v.prototype.getSize=function(){return this.size},v.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},v.prototype.ensureCapacity=function(a){if(a>32*this.bits.length){var u=v.makeArray(a);Rt.arraycopy(this.bits,0,u,0,this.bits.length),this.bits=u}},v.prototype.get=function(a){return!!(this.bits[Math.floor(a/32)]&1<<(31&a))},v.prototype.set=function(a){this.bits[Math.floor(a/32)]|=1<<(31&a)},v.prototype.flip=function(a){this.bits[Math.floor(a/32)]^=1<<(31&a)},v.prototype.getNextSet=function(a){var u=this.size;if(a>=u)return u;var w=this.bits,U=Math.floor(a/32),Y=w[U];Y&=~((1<<(31&a))-1);for(var le=w.length;0===Y;){if(++U===le)return u;Y=w[U]}var ge=32*U+pi.numberOfTrailingZeros(Y);return ge>u?u:ge},v.prototype.getNextUnset=function(a){var u=this.size;if(a>=u)return u;var w=this.bits,U=Math.floor(a/32),Y=~w[U];Y&=~((1<<(31&a))-1);for(var le=w.length;0===Y;){if(++U===le)return u;Y=~w[U]}var ge=32*U+pi.numberOfTrailingZeros(Y);return ge>u?u:ge},v.prototype.setBulk=function(a,u){this.bits[Math.floor(a/32)]=u},v.prototype.setRange=function(a,u){if(uthis.size)throw new ki;if(u!==a){u--;for(var w=Math.floor(a/32),U=Math.floor(u/32),Y=this.bits,le=w;le<=U;le++)Y[le]|=(2<<(lew?0:31&a))}},v.prototype.clear=function(){for(var a=this.bits.length,u=this.bits,w=0;wthis.size)throw new ki;if(u===a)return!0;u--;for(var U=Math.floor(a/32),Y=Math.floor(u/32),le=this.bits,ge=U;ge<=Y;ge++){var dt=(2<<(geU?0:31&a))&4294967295;if((le[ge]&dt)!==(w?dt:0))return!1}return!0},v.prototype.appendBit=function(a){this.ensureCapacity(this.size+1),a&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},v.prototype.appendBits=function(a,u){if(u<0||u>32)throw new ki("Num bits must be between 0 and 32");this.ensureCapacity(this.size+u);for(var w=u;w>0;w--)this.appendBit(1==(a>>w-1&1))},v.prototype.appendBitArray=function(a){var u=a.size;this.ensureCapacity(this.size+u);for(var w=0;w>1&1431655765|(1431655765&le)<<1)>>2&858993459|(858993459&le)<<2)>>4&252645135|(252645135&le)<<4)>>8&16711935|(16711935&le)<<8)>>16&65535|(65535&le)<<16}if(this.size!==32*w){var ge=32*w-this.size,Pe=a[0]>>>ge;for(Y=1;Y>>ge}a[w-1]=Pe}this.bits=a},v.makeArray=function(a){return new Int32Array(Math.floor((a+31)/32))},v.prototype.equals=function(a){return a instanceof v&&(this.size===a.size&&Vi.equals(this.bits,a.bits))},v.prototype.hashCode=function(){return 31*this.size+Vi.hashCode(this.bits)},v.prototype.toString=function(){for(var a="",u=0,w=this.size;u=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(le),Ht=Ot.next();!Ht.done;Ht=Ot.next())v.NAME_TO_ECI.set(Ht.value,this)}catch(Ur){U={error:Ur}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}}return v.prototype.getValueIdentifier=function(){return this.valueIdentifier},v.prototype.getName=function(){return this.name},v.prototype.getValue=function(){return this.values[0]},v.getCharacterSetECIByValue=function(a){if(a<0||a>=900)throw new Qn("incorect value");var u=v.VALUES_TO_ECI.get(a);if(void 0===u)throw new Qn("incorect value");return u},v.getCharacterSetECIByName=function(a){var u=v.NAME_TO_ECI.get(a);if(void 0===u)throw new Qn("incorect value");return u},v.prototype.equals=function(a){if(!(a instanceof v))return!1;var u=a;return this.getName()===u.getName()},v.VALUE_IDENTIFIER_TO_ECI=new Map,v.VALUES_TO_ECI=new Map,v.NAME_TO_ECI=new Map,v.Cp437=new v(Ti.Cp437,Int32Array.from([0,2]),"Cp437"),v.ISO8859_1=new v(Ti.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),v.ISO8859_2=new v(Ti.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),v.ISO8859_3=new v(Ti.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),v.ISO8859_4=new v(Ti.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),v.ISO8859_5=new v(Ti.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),v.ISO8859_6=new v(Ti.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),v.ISO8859_7=new v(Ti.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),v.ISO8859_8=new v(Ti.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),v.ISO8859_9=new v(Ti.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),v.ISO8859_10=new v(Ti.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),v.ISO8859_11=new v(Ti.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),v.ISO8859_13=new v(Ti.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),v.ISO8859_14=new v(Ti.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),v.ISO8859_15=new v(Ti.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),v.ISO8859_16=new v(Ti.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),v.SJIS=new v(Ti.SJIS,20,"SJIS","Shift_JIS"),v.Cp1250=new v(Ti.Cp1250,21,"Cp1250","windows-1250"),v.Cp1251=new v(Ti.Cp1251,22,"Cp1251","windows-1251"),v.Cp1252=new v(Ti.Cp1252,23,"Cp1252","windows-1252"),v.Cp1256=new v(Ti.Cp1256,24,"Cp1256","windows-1256"),v.UnicodeBigUnmarked=new v(Ti.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),v.UTF8=new v(Ti.UTF8,26,"UTF8","UTF-8"),v.ASCII=new v(Ti.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),v.Big5=new v(Ti.Big5,28,"Big5"),v.GB18030=new v(Ti.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),v.EUC_KR=new v(Ti.EUC_KR,30,"EUC_KR","EUC-KR"),v}();var na=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const ia=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return na(a,v),a.kind="UnsupportedOperationException",a}(Us),Wt=function(){function v(){}return v.decode=function(a,u){var w=this.encodingName(u);return this.customDecoder?this.customDecoder(a,w):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(w)?this.decodeFallback(a,w):new TextDecoder(w).decode(a)},v.shouldDecodeOnFallback=function(a){return!v.isBrowser()&&"ISO-8859-1"===a},v.encode=function(a,u){var w=this.encodingName(u);return this.customEncoder?this.customEncoder(a,w):typeof TextEncoder>"u"?this.encodeFallback(a):(new TextEncoder).encode(a)},v.isBrowser=function(){return typeof window<"u"&&"[object Window]"==={}.toString.call(window)},v.encodingName=function(a){return"string"==typeof a?a:a.getName()},v.encodingCharacterSet=function(a){return a instanceof Jo?a:Jo.getCharacterSetECIByName(a)},v.decodeFallback=function(a,u){var w=this.encodingCharacterSet(u);if(v.isDecodeFallbackSupported(w)){for(var U="",Y=0,le=a.length;Y3&&239===a[0]&&187===a[1]&&191===a[2],Tn=0;Tn0?128&Gn?ge--:le=!1:128&Gn&&(64&Gn?(ge++,32&Gn?(ge++,16&Gn?(ge++,8&Gn?le=!1:dt++):Ge++):Pe++):le=!1)),U&&(Gn>127&&Gn<160?U=!1:Gn>159&&(Gn<192||215===Gn||247===Gn)&&dn++),Y&&(_t>0?Gn<64||127===Gn||Gn>252?Y=!1:_t--:128===Gn||160===Gn||Gn>239?Y=!1:Gn>160&&Gn<224?(Ot++,Sr=0,++Ht>Ur&&(Ur=Ht)):Gn>127?(_t++,Ht=0,++Sr>Zr&&(Zr=Sr)):(Ht=0,Sr=0))}return le&&ge>0&&(le=!1),Y&&_t>0&&(Y=!1),le&&(ln||Pe+Ge+dt>0)?v.UTF8:Y&&(v.ASSUME_SHIFT_JIS||Ur>=3||Zr>=3)?v.SHIFT_JIS:U&&Y?2===Ur&&2===Ot||10*dn>=w?v.SHIFT_JIS:v.ISO88591:U?v.ISO88591:Y?v.SHIFT_JIS:le?v.UTF8:v.PLATFORM_DEFAULT_ENCODING},v.format=function(a){for(var u=[],w=1;wle){if(-1===ge)ge=Y-le;else if(Y-le!==ge)throw new ki("row lengths do not match");le=Y,Pe++}Ge++}else if(a.substring(Ge,Ge+u.length)===u)Ge+=u.length,U[Y]=!0,Y++;else{if(a.substring(Ge,Ge+w.length)!==w)throw new ki("illegal character encountered: "+a.substring(Ge));Ge+=w.length,U[Y]=!1,Y++}if(Y>le){if(-1===ge)ge=Y-le;else if(Y-le!==ge)throw new ki("row lengths do not match");Pe++}for(var dt=new v(ge,Pe),_t=0;_t>>(31&a)&1)},v.prototype.set=function(a,u){var w=u*this.rowSize+Math.floor(a/32);this.bits[w]|=1<<(31&a)&4294967295},v.prototype.unset=function(a,u){var w=u*this.rowSize+Math.floor(a/32);this.bits[w]&=~(1<<(31&a)&4294967295)},v.prototype.flip=function(a,u){var w=u*this.rowSize+Math.floor(a/32);this.bits[w]^=1<<(31&a)&4294967295},v.prototype.xor=function(a){if(this.width!==a.getWidth()||this.height!==a.getHeight()||this.rowSize!==a.getRowSize())throw new ki("input matrix dimensions do not match");for(var u=new bi(Math.floor(this.width/32)+1),w=this.rowSize,U=this.bits,Y=0,le=this.height;Ythis.height||Y>this.width)throw new ki("The region must fit inside the matrix");for(var ge=this.rowSize,Pe=this.bits,Ge=u;GePe&&(Pe=Ge),32*dtge){for(Ot=31;!(_t>>>Ot);)Ot--;32*dt+Ot>ge&&(ge=32*dt+Ot)}}}return ge=0&&0===u[w];)w--;if(w<0)return null;for(var U=Math.floor(w/a),Y=32*Math.floor(w%a),le=u[w],ge=31;!(le>>>ge);)ge--;return Int32Array.from([Y+=ge,U])},v.prototype.getWidth=function(){return this.width},v.prototype.getHeight=function(){return this.height},v.prototype.getRowSize=function(){return this.rowSize},v.prototype.equals=function(a){return a instanceof v&&(this.width===a.width&&this.height===a.height&&this.rowSize===a.rowSize&&Vi.equals(this.bits,a.bits))},v.prototype.hashCode=function(){var a=this.width;return 31*(a=31*(a=31*(a=31*a+this.width)+this.height)+this.rowSize)+Vi.hashCode(this.bits)},v.prototype.toString=function(a,u,w){return void 0===a&&(a="X "),void 0===u&&(u=" "),void 0===w&&(w="\n"),this.buildToString(a,u,w)},v.prototype.buildToString=function(a,u,w){for(var U=new jr,Y=0,le=this.height;Y>a.LUMINANCE_SHIFT]++;var Ge=a.estimateBlackPoint(ge);if(Y<3)for(Pe=0;Pe>a.LUMINANCE_SHIFT]++;var Ht=a.estimateBlackPoint(le),Sr=u.getMatrix();for(ge=0;gele&&(Y=ge,le=u[ge]),u[ge]>U&&(U=u[ge]);var Pe=0,Ge=0;for(ge=0;geGe&&(Pe=ge,Ge=_t)}if(Y>Pe){var Ot=Y;Y=Pe,Pe=Ot}if(Pe-Y<=w/16)throw new Wn;var Ht=Pe-1,Sr=-1;for(ge=Pe-1;ge>Y;ge--){var _t,Ur=ge-Y;(_t=Ur*Ur*(Pe-ge)*(U-u[ge]))>Sr&&(Ht=ge,Sr=_t)}return Ht<=a.MINIMUM_DIMENSION&&U>=a.MINIMUM_DIMENSION){var Y=u.getMatrix(),le=w>>a.BLOCK_SIZE_POWER;w&a.BLOCK_SIZE_MASK&&le++;var ge=U>>a.BLOCK_SIZE_POWER;U&a.BLOCK_SIZE_MASK&&ge++;var Pe=a.calculateBlackPoints(Y,le,ge,w,U),Ge=new Qi(w,U);a.calculateThresholdForBlock(Y,le,ge,w,U,Pe,Ge),this.matrix=Ge}else this.matrix=v.prototype.getBlackMatrix.call(this);return this.matrix},a.prototype.createBinarizer=function(u){return new a(u)},a.calculateThresholdForBlock=function(u,w,U,Y,le,ge,Pe){for(var Ge=le-a.BLOCK_SIZE,dt=Y-a.BLOCK_SIZE,_t=0;_tGe&&(Ot=Ge);for(var Ht=a.cap(_t,2,U-3),Sr=0;Srdt&&(Ur=dt);for(var Zr=a.cap(Sr,2,w-3),dn=0,ln=-2;ln<=2;ln++){var Tn=ge[Ht+ln];dn+=Tn[Zr-2]+Tn[Zr-1]+Tn[Zr]+Tn[Zr+1]+Tn[Zr+2]}a.thresholdBlock(u,Ur,Ot,dn/25,Y,Pe)}}},a.cap=function(u,w,U){return uU?U:u},a.thresholdBlock=function(u,w,U,Y,le,ge){for(var Pe=0,Ge=U*le+w;Pege&&(_t=ge);for(var Ot=0;OtPe&&(Ht=Pe);for(var Sr=0,Ur=255,Zr=0,dn=0,ln=_t*Y+Ht;dnZr&&(Zr=Gn)}if(Zr-Ur>a.MIN_DYNAMIC_RANGE)for(dn++,ln+=Y;dn>2*a.BLOCK_SIZE_POWER;if(Zr-Ur<=a.MIN_DYNAMIC_RANGE&&(yi=Ur/2,dt>0&&Ot>0)){var Bi=(Ge[dt-1][Ot]+2*Ge[dt][Ot-1]+Ge[dt-1][Ot-1])/4;Ur>10}else{le=0,ge=0;for(var Sr=u.length;le>10)}return Y},a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth(),Y=u*U;return null===w?w=this.buffer.slice(Y,Y+U):(w.length0&&Y[Y.length-1])&&(6===Ge[0]||2===Ge[0])){u=0;continue}if(3===Ge[0]&&(!Y||Ge[1]>Y[0]&&Ge[1]=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),U=w.next();!U.done;U=w.next())"videoinput"===(le="video"===(Y=U.value).kind?"videoinput":Y.kind)&&u.push({deviceId:Y.deviceId||Y.id,label:Y.label||"Video device "+(u.length+1),kind:le,groupId:Y.groupId})}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,u]}})})},v.prototype.getVideoInputDevices=function(){return Ka(this,void 0,void 0,function(){return sc(this,function(u){switch(u.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,u.sent().map(function(w){return new $s(w.deviceId,w.label)})]}})})},v.prototype.findDeviceById=function(a){return Ka(this,void 0,void 0,function(){var u;return sc(this,function(w){switch(w.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(u=w.sent())?[2,u.find(function(U){return U.deviceId===a})]:[2,null]}})})},v.prototype.decodeFromInputVideoDevice=function(a,u){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.decodeOnceFromVideoDevice(a,u)];case 1:return[2,w.sent()]}})})},v.prototype.decodeOnceFromVideoDevice=function(a,u){return Ka(this,void 0,void 0,function(){return sc(this,function(Y){switch(Y.label){case 0:return this.reset(),[4,this.decodeOnceFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u)];case 1:return[2,Y.sent()]}})})},v.prototype.decodeOnceFromConstraints=function(a,u){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return[4,navigator.mediaDevices.getUserMedia(a)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,u)];case 2:return[2,U.sent()]}})})},v.prototype.decodeOnceFromStream=function(a,u){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(Y){switch(Y.label){case 0:return this.reset(),[4,this.attachStreamToVideo(a,u)];case 1:return w=Y.sent(),[4,this.decodeOnce(w)];case 2:return[2,Y.sent()]}})})},v.prototype.decodeFromInputVideoDeviceContinuously=function(a,u,w){return Ka(this,void 0,void 0,function(){return sc(this,function(U){switch(U.label){case 0:return[4,this.decodeFromVideoDevice(a,u,w)];case 1:return[2,U.sent()]}})})},v.prototype.decodeFromVideoDevice=function(a,u,w){return Ka(this,void 0,void 0,function(){return sc(this,function(le){switch(le.label){case 0:return[4,this.decodeFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u,w)];case 1:return[2,le.sent()]}})})},v.prototype.decodeFromConstraints=function(a,u,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(Y){switch(Y.label){case 0:return[4,navigator.mediaDevices.getUserMedia(a)];case 1:return U=Y.sent(),[4,this.decodeFromStream(U,u,w)];case 2:return[2,Y.sent()]}})})},v.prototype.decodeFromStream=function(a,u,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(Y){switch(Y.label){case 0:return this.reset(),[4,this.attachStreamToVideo(a,u)];case 1:return U=Y.sent(),[4,this.decodeContinuously(U,w)];case 2:return[2,Y.sent()]}})})},v.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},v.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},v.prototype.attachStreamToVideo=function(a,u){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return w=this.prepareVideoElement(u),this.addVideoSource(w,a),this.videoElement=w,this.stream=a,[4,this.playVideoOnLoadAsync(w)];case 1:return U.sent(),[2,w]}})})},v.prototype.playVideoOnLoadAsync=function(a){var u=this;return new Promise(function(w,U){return u.playVideoOnLoad(a,function(){return w()})})},v.prototype.playVideoOnLoad=function(a,u){var w=this;this.videoEndedListener=function(){return w.stopStreams()},this.videoCanPlayListener=function(){return w.tryPlayVideo(a)},a.addEventListener("ended",this.videoEndedListener),a.addEventListener("canplay",this.videoCanPlayListener),a.addEventListener("playing",u),this.tryPlayVideo(a)},v.prototype.isVideoPlaying=function(a){return a.currentTime>0&&!a.paused&&!a.ended&&a.readyState>2},v.prototype.tryPlayVideo=function(a){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:if(this.isVideoPlaying(a))return console.warn("Trying to play video that is already playing."),[2];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,a.play()];case 2:return w.sent(),[3,4];case 3:return w.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},v.prototype.getMediaElement=function(a,u){var w=document.getElementById(a);if(!w)throw new bs("element with id '"+a+"' not found");if(w.nodeName.toLowerCase()!==u.toLowerCase())throw new bs("element with id '"+a+"' must be an "+u+" element");return w},v.prototype.decodeFromImage=function(a,u){if(!a&&!u)throw new bs("either imageElement with a src set or an url must be provided");return u&&!a?this.decodeFromImageUrl(u):this.decodeFromImageElement(a)},v.prototype.decodeFromVideo=function(a,u){if(!a&&!u)throw new bs("Either an element with a src set or an URL must be provided");return u&&!a?this.decodeFromVideoUrl(u):this.decodeFromVideoElement(a)},v.prototype.decodeFromVideoContinuously=function(a,u,w){if(void 0===a&&void 0===u)throw new bs("Either an element with a src set or an URL must be provided");return u&&!a?this.decodeFromVideoUrlContinuously(u,w):this.decodeFromVideoElementContinuously(a,w)},v.prototype.decodeFromImageElement=function(a){if(!a)throw new bs("An image element must be provided.");this.reset();var u=this.prepareImageElement(a);return this.imageElement=u,this.isImageLoaded(u)?this.decodeOnce(u,!1,!0):this._decodeOnLoadImage(u)},v.prototype.decodeFromVideoElement=function(a){var u=this._decodeFromVideoElementSetup(a);return this._decodeOnLoadVideo(u)},v.prototype.decodeFromVideoElementContinuously=function(a,u){var w=this._decodeFromVideoElementSetup(a);return this._decodeOnLoadVideoContinuously(w,u)},v.prototype._decodeFromVideoElementSetup=function(a){if(!a)throw new bs("A video element must be provided.");this.reset();var u=this.prepareVideoElement(a);return this.videoElement=u,u},v.prototype.decodeFromImageUrl=function(a){if(!a)throw new bs("An URL must be provided.");this.reset();var u=this.prepareImageElement();this.imageElement=u;var w=this._decodeOnLoadImage(u);return u.src=a,w},v.prototype.decodeFromVideoUrl=function(a){if(!a)throw new bs("An URL must be provided.");this.reset();var u=this.prepareVideoElement(),w=this.decodeFromVideoElement(u);return u.src=a,w},v.prototype.decodeFromVideoUrlContinuously=function(a,u){if(!a)throw new bs("An URL must be provided.");this.reset();var w=this.prepareVideoElement(),U=this.decodeFromVideoElementContinuously(w,u);return w.src=a,U},v.prototype._decodeOnLoadImage=function(a){var u=this;return new Promise(function(w,U){u.imageLoadedListener=function(){return u.decodeOnce(a,!1,!0).then(w,U)},a.addEventListener("load",u.imageLoadedListener)})},v.prototype._decodeOnLoadVideo=function(a){return Ka(this,void 0,void 0,function(){return sc(this,function(u){switch(u.label){case 0:return[4,this.playVideoOnLoadAsync(a)];case 1:return u.sent(),[4,this.decodeOnce(a)];case 2:return[2,u.sent()]}})})},v.prototype._decodeOnLoadVideoContinuously=function(a,u){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.playVideoOnLoadAsync(a)];case 1:return w.sent(),this.decodeContinuously(a,u),[2]}})})},v.prototype.isImageLoaded=function(a){return!(!a.complete||0===a.naturalWidth)},v.prototype.prepareImageElement=function(a){var u;return typeof a>"u"&&((u=document.createElement("img")).width=200,u.height=200),"string"==typeof a&&(u=this.getMediaElement(a,"img")),a instanceof HTMLImageElement&&(u=a),u},v.prototype.prepareVideoElement=function(a){var u;return!a&&typeof document<"u"&&((u=document.createElement("video")).width=200,u.height=200),"string"==typeof a&&(u=this.getMediaElement(a,"video")),a instanceof HTMLVideoElement&&(u=a),u.setAttribute("autoplay","true"),u.setAttribute("muted","true"),u.setAttribute("playsinline","true"),u},v.prototype.decodeOnce=function(a,u,w){var U=this;void 0===u&&(u=!0),void 0===w&&(w=!0),this._stopAsyncDecode=!1;var Y=function(le,ge){if(U._stopAsyncDecode)return ge(new Wn("Video stream has ended before any code could be detected.")),void(U._stopAsyncDecode=void 0);try{le(U.decode(a))}catch(Ot){if(u&&Ot instanceof Wn||(Ot instanceof rs||Ot instanceof Qn)&&w)return setTimeout(Y,U._timeBetweenDecodingAttempts,le,ge);ge(Ot)}};return new Promise(function(le,ge){return Y(le,ge)})},v.prototype.decodeContinuously=function(a,u){var w=this;this._stopContinuousDecode=!1;var U=function(){if(w._stopContinuousDecode)w._stopContinuousDecode=void 0;else try{var Y=w.decode(a);u(Y,null),setTimeout(U,w.timeBetweenScansMillis)}catch(Pe){u(null,Pe),(Pe instanceof rs||Pe instanceof Qn||Pe instanceof Wn)&&setTimeout(U,w._timeBetweenDecodingAttempts)}};U()},v.prototype.decode=function(a){var u=this.createBinaryBitmap(a);return this.decodeBitmap(u)},v.prototype.createBinaryBitmap=function(a){this.getCaptureCanvasContext(a),a instanceof HTMLVideoElement?this.drawFrameOnCanvas(a):this.drawImageOnCanvas(a);var w=this.getCaptureCanvas(a),U=new dc(w),Y=new mc(U);return new jc(Y)},v.prototype.getCaptureCanvasContext=function(a){if(!this.captureCanvasContext){var u=this.getCaptureCanvas(a),w=void 0;try{w=u.getContext("2d",{willReadFrequently:!0})}catch{w=u.getContext("2d")}this.captureCanvasContext=w}return this.captureCanvasContext},v.prototype.getCaptureCanvas=function(a){if(!this.captureCanvas){var u=this.createCaptureCanvas(a);this.captureCanvas=u}return this.captureCanvas},v.prototype.drawFrameOnCanvas=function(a,u,w){void 0===u&&(u={sx:0,sy:0,sWidth:a.videoWidth,sHeight:a.videoHeight,dx:0,dy:0,dWidth:a.videoWidth,dHeight:a.videoHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(a,u.sx,u.sy,u.sWidth,u.sHeight,u.dx,u.dy,u.dWidth,u.dHeight)},v.prototype.drawImageOnCanvas=function(a,u,w){void 0===u&&(u={sx:0,sy:0,sWidth:a.naturalWidth,sHeight:a.naturalHeight,dx:0,dy:0,dWidth:a.naturalWidth,dHeight:a.naturalHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(a,u.sx,u.sy,u.sWidth,u.sHeight,u.dx,u.dy,u.dWidth,u.dHeight)},v.prototype.decodeBitmap=function(a){return this.reader.decode(a,this._hints)},v.prototype.createCaptureCanvas=function(a){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var w,U,u=document.createElement("canvas");return typeof a<"u"&&(a instanceof HTMLVideoElement?(w=a.videoWidth,U=a.videoHeight):a instanceof HTMLImageElement&&(w=a.naturalWidth||a.width,U=a.naturalHeight||a.height)),u.style.width=w+"px",u.style.height=U+"px",u.width=w,u.height=U,u},v.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(a){return a.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},v.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},v.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},v.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},v.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},v.prototype.addVideoSource=function(a,u){try{a.srcObject=u}catch{a.src=URL.createObjectURL(u)}},v.prototype.cleanVideoSource=function(a){try{a.srcObject=null}catch{a.src=""}this.videoElement.removeAttribute("src")},v}();const Cs=function(){function v(a,u,w,U,Y,le){void 0===w&&(w=null==u?0:8*u.length),void 0===le&&(le=Rt.currentTimeMillis()),this.text=a,this.rawBytes=u,this.numBits=w,this.resultPoints=U,this.format=Y,this.timestamp=le,this.text=a,this.rawBytes=u,this.numBits=null==w?null==u?0:8*u.length:w,this.resultPoints=U,this.format=Y,this.resultMetadata=null,this.timestamp=null==le?Rt.currentTimeMillis():le}return v.prototype.getText=function(){return this.text},v.prototype.getRawBytes=function(){return this.rawBytes},v.prototype.getNumBits=function(){return this.numBits},v.prototype.getResultPoints=function(){return this.resultPoints},v.prototype.getBarcodeFormat=function(){return this.format},v.prototype.getResultMetadata=function(){return this.resultMetadata},v.prototype.putMetadata=function(a,u){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(a,u)},v.prototype.putAllMetadata=function(a){null!==a&&(this.resultMetadata=null===this.resultMetadata?a:new Map(a))},v.prototype.addResultPoints=function(a){var u=this.resultPoints;if(null===u)this.resultPoints=a;else if(null!==a&&a.length>0){var w=new Array(u.length+a.length);Rt.arraycopy(u,0,w,0,u.length),Rt.arraycopy(a,0,w,u.length,a.length),this.resultPoints=w}},v.prototype.getTimestamp=function(){return this.timestamp},v.prototype.toString=function(){return this.text},v}();var gf=function(v){return v[v.AZTEC=0]="AZTEC",v[v.CODABAR=1]="CODABAR",v[v.CODE_39=2]="CODE_39",v[v.CODE_93=3]="CODE_93",v[v.CODE_128=4]="CODE_128",v[v.DATA_MATRIX=5]="DATA_MATRIX",v[v.EAN_8=6]="EAN_8",v[v.EAN_13=7]="EAN_13",v[v.ITF=8]="ITF",v[v.MAXICODE=9]="MAXICODE",v[v.PDF_417=10]="PDF_417",v[v.QR_CODE=11]="QR_CODE",v[v.RSS_14=12]="RSS_14",v[v.RSS_EXPANDED=13]="RSS_EXPANDED",v[v.UPC_A=14]="UPC_A",v[v.UPC_E=15]="UPC_E",v[v.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION",v}(gf||{});const Do=gf;var gh=function(v){return v[v.OTHER=0]="OTHER",v[v.ORIENTATION=1]="ORIENTATION",v[v.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",v[v.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",v[v.ISSUE_NUMBER=4]="ISSUE_NUMBER",v[v.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",v[v.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",v[v.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",v[v.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",v[v.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",v[v.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY",v}(gh||{});const gc=gh,qu=function(){function v(a,u,w,U,Y,le){void 0===Y&&(Y=-1),void 0===le&&(le=-1),this.rawBytes=a,this.text=u,this.byteSegments=w,this.ecLevel=U,this.structuredAppendSequenceNumber=Y,this.structuredAppendParity=le,this.numBits=null==a?0:8*a.length}return v.prototype.getRawBytes=function(){return this.rawBytes},v.prototype.getNumBits=function(){return this.numBits},v.prototype.setNumBits=function(a){this.numBits=a},v.prototype.getText=function(){return this.text},v.prototype.getByteSegments=function(){return this.byteSegments},v.prototype.getECLevel=function(){return this.ecLevel},v.prototype.getErrorsCorrected=function(){return this.errorsCorrected},v.prototype.setErrorsCorrected=function(a){this.errorsCorrected=a},v.prototype.getErasures=function(){return this.erasures},v.prototype.setErasures=function(a){this.erasures=a},v.prototype.getOther=function(){return this.other},v.prototype.setOther=function(a){this.other=a},v.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},v.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},v.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},v}(),tl=function(){function v(){}return v.prototype.exp=function(a){return this.expTable[a]},v.prototype.log=function(a){if(0===a)throw new ki;return this.logTable[a]},v.addOrSubtract=function(a,u){return a^u},v}(),mu=function(){function v(a,u){if(0===u.length)throw new ki;this.field=a;var w=u.length;if(w>1&&0===u[0]){for(var U=1;Uw.length){var U=u;u=w,w=U}var Y=new Int32Array(w.length),le=w.length-u.length;Rt.arraycopy(w,0,Y,0,le);for(var ge=le;ge=a.getDegree()&&!U.isZero();){var ge=U.getDegree()-a.getDegree(),Pe=u.multiply(U.getCoefficient(U.getDegree()),le),Ge=a.multiplyByMonomial(ge,Pe),dt=u.buildMonomial(ge,Pe);w=w.addOrSubtract(dt),U=U.addOrSubtract(Ge)}return[w,U]},v.prototype.toString=function(){for(var a="",u=this.getDegree();u>=0;u--){var w=this.getCoefficient(u);if(0!==w){if(w<0?(a+=" - ",w=-w):a.length>0&&(a+=" + "),0===u||1!==w){var U=this.field.log(w);0===U?a+="1":1===U?a+="a":(a+="a^",a+=U)}0!==u&&(1===u?a+="x":(a+="x^",a+=u))}}return a},v}();var Ll=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Od=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ll(a,v),a.kind="ArithmeticException",a}(Us);var Lu=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Pa=function(v){function a(u,w,U){var Y=v.call(this)||this;Y.primitive=u,Y.size=w,Y.generatorBase=U;for(var le=new Int32Array(w),ge=1,Pe=0;Pe=w&&(ge^=u,ge&=w-1);Y.expTable=le;var Ge=new Int32Array(w);for(Pe=0;Pe=(w/2|0);){var dt=le,_t=Pe;if(Pe=Ge,(le=ge).isZero())throw new Hl("r_{i-1} was zero");ge=dt;for(var Ot=Y.getZero(),Ht=le.getCoefficient(le.getDegree()),Sr=Y.inverse(Ht);ge.getDegree()>=le.getDegree()&&!ge.isZero();){var Ur=ge.getDegree()-le.getDegree(),Zr=Y.multiply(ge.getCoefficient(ge.getDegree()),Sr);Ot=Ot.addOrSubtract(Y.buildMonomial(Ur,Zr)),ge=ge.addOrSubtract(le.multiplyByMonomial(Ur,Zr))}if(Ge=Ot.multiply(Pe).addOrSubtract(_t),ge.getDegree()>=le.getDegree())throw new ou("Division algorithm failed to reduce polynomial?")}var dn=Ge.getCoefficient(0);if(0===dn)throw new Hl("sigmaTilde(0) was zero");var ln=Y.inverse(dn);return[Ge.multiplyScalar(ln),ge.multiplyScalar(ln)]},v.prototype.findErrorLocations=function(a){var u=a.getDegree();if(1===u)return Int32Array.from([a.getCoefficient(1)]);for(var w=new Int32Array(u),U=0,Y=this.field,le=1;le1,Sr,Sr+w-1),Sr+=w-1;else for(var Ur=w-1;Ur>=0;--Ur)Ht[Sr++]=!!(Ot&1<=8?v.readCode(a,u,8):v.readCode(a,u,w)<<8-w},v.convertBoolArrayToByteArray=function(a){for(var u=new Uint8Array((a.length+7)/8),w=0;w","?","[","]","{","}","CTRL_UL"],v.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],v}(),Js=function(){function v(){}return v.round=function(a){return isNaN(a)?0:a<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:a>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:a+(a<0?-.5:.5)|0},v.distance=function(a,u,w,U){var Y=a-w,le=u-U;return Math.sqrt(Y*Y+le*le)},v.sum=function(a){for(var u=0,w=0,U=a.length;w!==U;w++)u+=a[w];return u},v}(),yc=function(){function v(){}return v.floatToIntBits=function(a){return a},v.MAX_VALUE=Number.MAX_SAFE_INTEGER,v}(),Eo=function(){function v(a,u){this.x=a,this.y=u}return v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.equals=function(a){return a instanceof v&&(this.x===a.x&&this.y===a.y)},v.prototype.hashCode=function(){return 31*yc.floatToIntBits(this.x)+yc.floatToIntBits(this.y)},v.prototype.toString=function(){return"("+this.x+","+this.y+")"},v.orderBestPatterns=function(a){var Y,le,ge,u=this.distance(a[0],a[1]),w=this.distance(a[1],a[2]),U=this.distance(a[0],a[2]);if(w>=u&&w>=U?(le=a[0],Y=a[1],ge=a[2]):U>=w&&U>=u?(le=a[1],Y=a[0],ge=a[2]):(le=a[2],Y=a[0],ge=a[1]),this.crossProductZ(Y,le,ge)<0){var Pe=Y;Y=ge,ge=Pe}a[0]=Y,a[1]=le,a[2]=ge},v.distance=function(a,u){return Js.distance(a.x,a.y,u.x,u.y)},v.crossProductZ=function(a,u,w){var U=u.x,Y=u.y;return(w.x-U)*(a.y-Y)-(w.y-Y)*(a.x-U)},v}(),cr=function(){function v(a,u){this.bits=a,this.points=u}return v.prototype.getBits=function(){return this.bits},v.prototype.getPoints=function(){return this.points},v}();var Mt=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Xr=function(v){function a(u,w,U,Y,le){var ge=v.call(this,u,w)||this;return ge.compact=U,ge.nbDatablocks=Y,ge.nbLayers=le,ge}return Mt(a,v),a.prototype.getNbLayers=function(){return this.nbLayers},a.prototype.getNbDatablocks=function(){return this.nbDatablocks},a.prototype.isCompact=function(){return this.compact},a}(cr),ri=function(){function v(a,u,w,U){this.image=a,this.height=a.getHeight(),this.width=a.getWidth(),null==u&&(u=v.INIT_SIZE),null==w&&(w=a.getWidth()/2|0),null==U&&(U=a.getHeight()/2|0);var Y=u/2|0;if(this.leftInit=w-Y,this.rightInit=w+Y,this.upInit=U-Y,this.downInit=U+Y,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Wn}return v.prototype.detect=function(){for(var a=this.leftInit,u=this.rightInit,w=this.upInit,U=this.downInit,Y=!1,le=!0,ge=!1,Pe=!1,Ge=!1,dt=!1,_t=!1,Ot=this.width,Ht=this.height;le;){le=!1;for(var Sr=!0;(Sr||!Pe)&&u=Ot){Y=!0;break}for(var Ur=!0;(Ur||!Ge)&&U=Ht){Y=!0;break}for(var Zr=!0;(Zr||!dt)&&a>=0;)(Zr=this.containsBlackPoint(w,U,a,!1))?(a--,le=!0,dt=!0):dt||a--;if(a<0){Y=!0;break}for(var dn=!0;(dn||!_t)&&w>=0;)(dn=this.containsBlackPoint(a,u,w,!0))?(w--,le=!0,_t=!0):_t||w--;if(w<0){Y=!0;break}le&&(ge=!0)}if(!Y&&ge){for(var ln=u-a,Tn=null,Gn=1;null===Tn&&Gnw||Pe<-1||Pe>U)throw new Wn;Y=!1,-1===ge?(u[le]=0,Y=!0):ge===w&&(u[le]=w-1,Y=!0),-1===Pe?(u[le+1]=0,Y=!0):Pe===U&&(u[le+1]=U-1,Y=!0)}for(Y=!0,le=u.length-2;le>=0&&Y;le-=2){if(ge=Math.floor(u[le]),Pe=Math.floor(u[le+1]),ge<-1||ge>w||Pe<-1||Pe>U)throw new Wn;Y=!1,-1===ge?(u[le]=0,Y=!0):ge===w&&(u[le]=w-1,Y=!0),-1===Pe?(u[le+1]=0,Y=!0):Pe===U&&(u[le+1]=U-1,Y=!0)}},v}(),Fs=function(){function v(a,u,w,U,Y,le,ge,Pe,Ge){this.a11=a,this.a21=u,this.a31=w,this.a12=U,this.a22=Y,this.a32=le,this.a13=ge,this.a23=Pe,this.a33=Ge}return v.quadrilateralToQuadrilateral=function(a,u,w,U,Y,le,ge,Pe,Ge,dt,_t,Ot,Ht,Sr,Ur,Zr){var dn=v.quadrilateralToSquare(a,u,w,U,Y,le,ge,Pe);return v.squareToQuadrilateral(Ge,dt,_t,Ot,Ht,Sr,Ur,Zr).times(dn)},v.prototype.transformPoints=function(a){for(var u=a.length,w=this.a11,U=this.a12,Y=this.a13,le=this.a21,ge=this.a22,Pe=this.a23,Ge=this.a31,dt=this.a32,_t=this.a33,Ot=0;Ot>1&127):(U<<=10,U+=(le>>2&992)+(le>>1&31))}var ge=this.getCorrectedParameterData(U,this.compact);this.compact?(this.nbLayers=1+(ge>>6),this.nbDataBlocks=1+(63&ge)):(this.nbLayers=1+(ge>>11),this.nbDataBlocks=1+(2047&ge))},v.prototype.getRotation=function(a,u){var w=0;a.forEach(function(Y,le,ge){w=(Y>>u-2<<1)+(1&Y)+(w<<3)}),w=((1&w)<<11)+(w>>1);for(var U=0;U<4;U++)if(pi.bitCount(w^this.EXPECTED_CORNER_BITS[U])<=2)return U;throw new Wn},v.prototype.getCorrectedParameterData=function(a,u){var w,U;u?(w=7,U=2):(w=10,U=4);for(var Y=w-U,le=new Int32Array(w),ge=w-1;ge>=0;--ge)le[ge]=15&a,a>>=4;try{new xc(Pa.AZTEC_PARAM).decode(le,Y)}catch{throw new Wn}var Ge=0;for(ge=0;ge2){var _t=this.distancePoint(dt,ge)*this.nbCenterLayers/(this.distancePoint(Y,u)*(this.nbCenterLayers+2));if(_t<.75||_t>1.25||!this.isWhiteOrBlackRectangle(ge,Pe,Ge,dt))break}u=ge,w=Pe,U=Ge,Y=dt,le=!le}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Wn;this.compact=5===this.nbCenterLayers;var Ot=new Eo(u.getX()+.5,u.getY()-.5),Ht=new Eo(w.getX()+.5,w.getY()+.5),Sr=new Eo(U.getX()-.5,U.getY()+.5),Ur=new Eo(Y.getX()-.5,Y.getY()-.5);return this.expandSquare([Ot,Ht,Sr,Ur],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},v.prototype.getMatrixCenter=function(){var a,u,w,U;try{a=(Y=new ri(this.image).detect())[0],u=Y[1],w=Y[2],U=Y[3]}catch{var le=this.image.getWidth()/2,ge=this.image.getHeight()/2;a=this.getFirstDifferent(new os(le+7,ge-7),!1,1,-1).toResultPoint(),u=this.getFirstDifferent(new os(le+7,ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new os(le-7,ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new os(le-7,ge-7),!1,-1,-1).toResultPoint()}var Pe=Js.round((a.getX()+U.getX()+u.getX()+w.getX())/4),Ge=Js.round((a.getY()+U.getY()+u.getY()+w.getY())/4);try{var Y;a=(Y=new ri(this.image,15,Pe,Ge).detect())[0],u=Y[1],w=Y[2],U=Y[3]}catch{a=this.getFirstDifferent(new os(Pe+7,Ge-7),!1,1,-1).toResultPoint(),u=this.getFirstDifferent(new os(Pe+7,Ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new os(Pe-7,Ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new os(Pe-7,Ge-7),!1,-1,-1).toResultPoint()}return Pe=Js.round((a.getX()+U.getX()+u.getX()+w.getX())/4),Ge=Js.round((a.getY()+U.getY()+u.getY()+w.getY())/4),new os(Pe,Ge)},v.prototype.getMatrixCornerPoints=function(a){return this.expandSquare(a,2*this.nbCenterLayers,this.getDimension())},v.prototype.sampleGrid=function(a,u,w,U,Y){var le=vo.getInstance(),ge=this.getDimension(),Pe=ge/2-this.nbCenterLayers,Ge=ge/2+this.nbCenterLayers;return le.sampleGrid(a,ge,ge,Pe,Pe,Ge,Pe,Ge,Ge,Pe,Ge,u.getX(),u.getY(),w.getX(),w.getY(),U.getX(),U.getY(),Y.getX(),Y.getY())},v.prototype.sampleLine=function(a,u,w){for(var U=0,Y=this.distanceResultPoint(a,u),le=Y/w,ge=a.getX(),Pe=a.getY(),Ge=le*(u.getX()-a.getX())/Y,dt=le*(u.getY()-a.getY())/Y,_t=0;_t.1&&Ot<.9?0:Ot<=.1===Ge?1:-1},v.prototype.getFirstDifferent=function(a,u,w,U){for(var Y=a.getX()+w,le=a.getY()+U;this.isValid(Y,le)&&this.image.get(Y,le)===u;)Y+=w,le+=U;for(Y-=w,le-=U;this.isValid(Y,le)&&this.image.get(Y,le)===u;)Y+=w;for(Y-=w;this.isValid(Y,le)&&this.image.get(Y,le)===u;)le+=U;return new os(Y,le-=U)},v.prototype.expandSquare=function(a,u,w){var U=w/(2*u),Y=a[0].getX()-a[2].getX(),le=a[0].getY()-a[2].getY(),ge=(a[0].getX()+a[2].getX())/2,Pe=(a[0].getY()+a[2].getY())/2,Ge=new Eo(ge+U*Y,Pe+U*le),dt=new Eo(ge-U*Y,Pe-U*le);return Y=a[1].getX()-a[3].getX(),le=a[1].getY()-a[3].getY(),ge=(a[1].getX()+a[3].getX())/2,Pe=(a[1].getY()+a[3].getY())/2,[Ge,new Eo(ge+U*Y,Pe+U*le),dt,new Eo(ge-U*Y,Pe-U*le)]},v.prototype.isValid=function(a,u){return a>=0&&a0&&u>(le?8:5));Pe=le?U:15;for(var Ge=Math.trunc(U/2),dt=0;dt=U)break;try{Y=a.getBlackRow(Ht,Y)}catch{continue}for(var Sr=function(ln){if(1===ln&&(Y.reverse(),u&&!0===u.get(Di.NEED_RESULT_POINT_CALLBACK))){var Tn=new Map;u.forEach(function(Bi,Ki){return Tn.set(Ki,Bi)}),Tn.delete(Di.NEED_RESULT_POINT_CALLBACK),u=Tn}try{var Gn=Ur.decodeRow(Ht,Y,u);if(1===ln){Gn.putMetadata(gc.ORIENTATION,180);var yi=Gn.getResultPoints();null!==yi&&(yi[0]=new Eo(w-yi[0].getX()-1,yi[0].getY()),yi[1]=new Eo(w-yi[1].getX()-1,yi[1].getY()))}return{value:Gn}}catch{}},Ur=this,Zr=0;Zr<2;Zr++){var dn=Sr(Zr);if("object"==typeof dn)return dn.value}}throw new Wn},v.recordPattern=function(a,u,w){for(var U=w.length,Y=0;Y=le)throw new Wn;for(var ge=!a.get(u),Pe=0,Ge=u;Ge0&&U>=0;)a.get(--u)!==Y&&(U--,Y=!Y);if(U>=0)throw new Wn;v.recordPattern(a,u+1,w)},v.patternMatchVariance=function(a,u,w){for(var U=a.length,Y=0,le=0,ge=0;geOt?_t-Ot:Ot-_t;if(Ht>w)return Number.POSITIVE_INFINITY;Ge+=Ht}return Ge/Y},v}();var gr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const tn=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return gr(a,v),a.findStartPattern=function(u){for(var w=u.getSize(),U=u.getNextSet(0),Y=0,le=Int32Array.from([0,0,0,0,0,0]),ge=U,Pe=!1,dt=U;dt=0&&u.isRange(Math.max(0,ge-(dt-ge)/2),ge,!1))return Int32Array.from([ge,dt,Ot]);ge+=le[0]+le[1],(le=le.slice(2,le.length))[Y-1]=0,le[Y]=0,Y--}else Y++;le[Y]=1,Pe=!Pe}throw new Wn},a.decodeCode=function(u,w,U){Ut.recordPattern(u,U,w);for(var Y=a.MAX_AVG_VARIANCE,le=-1,ge=0;ge=0)return le;throw new Wn},a.prototype.decodeRow=function(u,w,U){var dt,Y=U&&!0===U.get(Di.ASSUME_GS1),le=a.findStartPattern(w),ge=le[2],Pe=0,Ge=new Uint8Array(20);switch(Ge[Pe++]=ge,ge){case a.CODE_START_A:dt=a.CODE_CODE_A;break;case a.CODE_START_B:dt=a.CODE_CODE_B;break;case a.CODE_START_C:dt=a.CODE_CODE_C;break;default:throw new Qn}for(var _t=!1,Ot=!1,Ht="",Sr=le[0],Ur=le[1],Zr=Int32Array.from([0,0,0,0,0,0]),dn=0,ln=0,Tn=ge,Gn=0,yi=!0,Bi=!1,Ki=!1;!_t;){var po=Ot;switch(Ot=!1,dn=ln,ln=a.decodeCode(w,Zr,Ur),Ge[Pe++]=ln,ln!==a.CODE_STOP&&(yi=!0),ln!==a.CODE_STOP&&(Tn+=++Gn*ln),Sr=Ur,Ur+=Zr.reduce(function(Y1,Q1){return Y1+Q1},0),ln){case a.CODE_START_A:case a.CODE_START_B:case a.CODE_START_C:throw new Qn}switch(dt){case a.CODE_CODE_A:if(ln<64)Ht+=String.fromCharCode(Ki===Bi?32+ln:32+ln+128),Ki=!1;else if(ln<96)Ht+=String.fromCharCode(Ki===Bi?ln-64:ln+64),Ki=!1;else switch(ln!==a.CODE_STOP&&(yi=!1),ln){case a.CODE_FNC_1:Y&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case a.CODE_FNC_2:case a.CODE_FNC_3:break;case a.CODE_FNC_4_A:!Bi&&Ki?(Bi=!0,Ki=!1):Bi&&Ki?(Bi=!1,Ki=!1):Ki=!0;break;case a.CODE_SHIFT:Ot=!0,dt=a.CODE_CODE_B;break;case a.CODE_CODE_B:dt=a.CODE_CODE_B;break;case a.CODE_CODE_C:dt=a.CODE_CODE_C;break;case a.CODE_STOP:_t=!0}break;case a.CODE_CODE_B:if(ln<96)Ht+=String.fromCharCode(Ki===Bi?32+ln:32+ln+128),Ki=!1;else switch(ln!==a.CODE_STOP&&(yi=!1),ln){case a.CODE_FNC_1:Y&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case a.CODE_FNC_2:case a.CODE_FNC_3:break;case a.CODE_FNC_4_B:!Bi&&Ki?(Bi=!0,Ki=!1):Bi&&Ki?(Bi=!1,Ki=!1):Ki=!0;break;case a.CODE_SHIFT:Ot=!0,dt=a.CODE_CODE_A;break;case a.CODE_CODE_A:dt=a.CODE_CODE_A;break;case a.CODE_CODE_C:dt=a.CODE_CODE_C;break;case a.CODE_STOP:_t=!0}break;case a.CODE_CODE_C:if(ln<100)ln<10&&(Ht+="0"),Ht+=ln;else switch(ln!==a.CODE_STOP&&(yi=!1),ln){case a.CODE_FNC_1:Y&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case a.CODE_CODE_A:dt=a.CODE_CODE_A;break;case a.CODE_CODE_B:dt=a.CODE_CODE_B;break;case a.CODE_STOP:_t=!0}}po&&(dt=dt===a.CODE_CODE_A?a.CODE_CODE_B:a.CODE_CODE_A)}var gs=Ur-Sr;if(Ur=w.getNextUnset(Ur),!w.isRange(Ur,Math.min(w.getSize(),Ur+(Ur-Sr)/2),!1))throw new Wn;if((Tn-=Gn*dn)%103!==dn)throw new rs;var ns=Ht.length;if(0===ns)throw new Wn;ns>0&&yi&&(Ht=Ht.substring(0,dt===a.CODE_CODE_C?ns-2:ns-1));for(var _l=(le[1]+le[0])/2,ja=Sr+gs/2,Xc=Ge.length,bd=new Uint8Array(Xc),Th=0;Th=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ti=function(v){function a(u,w){void 0===u&&(u=!1),void 0===w&&(w=!1);var U=v.call(this)||this;return U.usingCheckDigit=u,U.extendedMode=w,U.decodeRowResult="",U.counters=new Int32Array(9),U}return En(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge,Pe,Ge=this.counters;Ge.fill(0),this.decodeRowResult="";var Ht,Sr,dt=a.findAsteriskPattern(w,Ge),_t=w.getNextSet(dt[1]),Ot=w.getSize();do{a.recordPattern(w,_t,Ge);var Ur=a.toNarrowWidePattern(Ge);if(Ur<0)throw new Wn;Ht=a.patternToChar(Ur),this.decodeRowResult+=Ht,Sr=_t;try{for(var Zr=(Y=void 0,_n(Ge)),dn=Zr.next();!dn.done;dn=Zr.next())_t+=dn.value}catch(Xc){Y={error:Xc}}finally{try{dn&&!dn.done&&(le=Zr.return)&&le.call(Zr)}finally{if(Y)throw Y.error}}_t=w.getNextSet(_t)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var ns,Tn=0;try{for(var Gn=_n(Ge),yi=Gn.next();!yi.done;yi=Gn.next())Tn+=yi.value}catch(Xc){ge={error:Xc}}finally{try{yi&&!yi.done&&(Pe=Gn.return)&&Pe.call(Gn)}finally{if(ge)throw ge.error}}if(_t!==Ot&&2*(_t-Sr-Tn)le&&(Pe=_t)}catch(Ur){w={error:Ur}}finally{try{dt&&!dt.done&&(U=Ge.return)&&U.call(Ge)}finally{if(w)throw w.error}}le=Pe,ge=0;for(var Ot=0,Ht=0,Sr=0;Srle&&(Ht|=1<0;Sr++){var _t;if((_t=u[Sr])>le&&(ge--,2*_t>=Ot))return-1}return Ht}}while(ge>3);return-1},a.patternToChar=function(u){for(var w=0;w="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"$":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"%":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if("X"!==ge&&"Y"!==ge&&"Z"!==ge)throw new Qn;Pe="\x7f"}break;case"/":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,Y++}else U+=le}return U},a.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",a.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],a.ASTERISK_ENCODING=148,a}(Ut);var So=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Vs=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const zs=function(v){function a(){var u=v.call(this)||this;return u.decodeRowResult="",u.counters=new Int32Array(6),u}return So(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge,Pe,Ht,Sr,Ge=this.findAsteriskPattern(w),dt=w.getNextSet(Ge[1]),_t=w.getSize(),Ot=this.counters;Ot.fill(0),this.decodeRowResult="";do{a.recordPattern(w,dt,Ot);var Ur=this.toPattern(Ot);if(Ur<0)throw new Wn;Ht=this.patternToChar(Ur),this.decodeRowResult+=Ht,Sr=dt;try{for(var Zr=(Y=void 0,Vs(Ot)),dn=Zr.next();!dn.done;dn=Zr.next())dt+=dn.value}catch(gs){Y={error:gs}}finally{try{dn&&!dn.done&&(le=Zr.return)&&le.call(Zr)}finally{if(Y)throw Y.error}}dt=w.getNextSet(dt)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var Tn=0;try{for(var Gn=Vs(Ot),yi=Gn.next();!yi.done;yi=Gn.next())Tn+=yi.value}catch(gs){ge={error:gs}}finally{try{yi&&!yi.done&&(Pe=Gn.return)&&Pe.call(Gn)}finally{if(ge)throw ge.error}}if(dt===_t||!w.get(dt))throw new Wn;if(this.decodeRowResult.length<2)throw new Wn;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var Bi=this.decodeExtended(this.decodeRowResult),po=Sr+Tn/2;return new Cs(Bi,null,0,[new Eo((Ge[1]+Ge[0])/2,u),new Eo(po,u)],Do.CODE_93,(new Date).getTime())},a.prototype.findAsteriskPattern=function(u){var w=u.getSize(),U=u.getNextSet(0);this.counters.fill(0);for(var Y=this.counters,le=U,ge=!1,Pe=Y.length,Ge=0,dt=U;dt4)return-1;if(1&_t)Ge<<=Ot;else for(var Ht=0;Ht="a"&&le<="d"){if(Y>=w-1)throw new Qn;var ge=u.charAt(Y+1),Pe="\0";switch(le){case"d":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"a":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"b":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if(!(ge>="X"&&ge<="Z"))throw new Qn;Pe="\x7f"}break;case"c":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,Y++}else U+=le}return U},a.prototype.checkChecksums=function(u){var w=u.length;this.checkOneChecksum(u,w-2,20),this.checkOneChecksum(u,w-1,15)},a.prototype.checkOneChecksum=function(u,w,U){for(var Y=1,le=0,ge=w-1;ge>=0;ge--)le+=Y*a.ALPHABET_STRING.indexOf(u.charAt(ge)),++Y>U&&(Y=1);if(u.charAt(w)!==a.ALPHABET_STRING[le%47])throw new rs},a.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",a.ASTERISK_ENCODING=(a.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350])[47],a}(Ut);var ea=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const us=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.narrowLineWidth=-1,u}return ea(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge=this.decodeStart(w),Pe=this.decodeEnd(w),Ge=new jr;a.decodeMiddle(w,ge[1],Pe[0],Ge);var dt=Ge.toString(),_t=null;null!=U&&(_t=U.get(Di.ALLOWED_LENGTHS)),null==_t&&(_t=a.DEFAULT_ALLOWED_LENGTHS);var Ot=dt.length,Ht=!1,Sr=0;try{for(var Ur=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(_t),Zr=Ur.next();!Zr.done;Zr=Ur.next()){var dn=Zr.value;if(Ot===dn){Ht=!0;break}dn>Sr&&(Sr=dn)}}catch(Gn){Y={error:Gn}}finally{try{Zr&&!Zr.done&&(le=Ur.return)&&le.call(Ur)}finally{if(Y)throw Y.error}}if(!Ht&&Ot>Sr&&(Ht=!0),!Ht)throw new Qn;var ln=[new Eo(ge[1],u),new Eo(Pe[0],u)];return new Cs(dt,null,0,ln,Do.ITF,(new Date).getTime())},a.decodeMiddle=function(u,w,U,Y){var le=new Int32Array(10),ge=new Int32Array(5),Pe=new Int32Array(5);for(le.fill(0),ge.fill(0),Pe.fill(0);w0&&Y>=0&&!u.get(Y);Y--)U--;if(0!==U)throw new Wn},a.skipWhiteSpace=function(u){var w=u.getSize(),U=u.getNextSet(0);if(U===w)throw new Wn;return U},a.prototype.decodeEnd=function(u){u.reverse();try{var w=a.skipWhiteSpace(u),U=void 0;try{U=a.findGuardPattern(u,w,a.END_PATTERN_REVERSED[0])}catch(le){le instanceof Wn&&(U=a.findGuardPattern(u,w,a.END_PATTERN_REVERSED[1]))}this.validateQuietZone(u,U[0]);var Y=U[0];return U[0]=u.getSize()-U[1],U[1]=u.getSize()-Y,U}finally{u.reverse()}},a.findGuardPattern=function(u,w,U){var Y=U.length,le=new Int32Array(Y),ge=u.getSize(),Pe=!1,Ge=0,dt=w;le.fill(0);for(var _t=w;_t=0)return U%10;throw new Wn},a.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],a.MAX_AVG_VARIANCE=.38,a.MAX_INDIVIDUAL_VARIANCE=.5,a.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],a.START_PATTERN=Int32Array.from([1,1,1,1]),a.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],a}(Ut);var ws=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const go=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.decodeRowStringBuffer="",u}return ws(a,v),a.findStartGuardPattern=function(u){for(var U,w=!1,Y=0,le=Int32Array.from([0,0,0]);!w;){le=Int32Array.from([0,0,0]);var ge=(U=a.findGuardPattern(u,Y,!1,this.START_END_PATTERN,le))[0],Pe=ge-((Y=U[1])-ge);Pe>=0&&(w=u.isRange(Pe,ge,!1))}return U},a.checkChecksum=function(u){return a.checkStandardUPCEANChecksum(u)},a.checkStandardUPCEANChecksum=function(u){var w=u.length;if(0===w)return!1;var U=parseInt(u.charAt(w-1),10);return a.getStandardUPCEANChecksum(u.substring(0,w-1))===U},a.getStandardUPCEANChecksum=function(u){for(var w=u.length,U=0,Y=w-1;Y>=0;Y-=2){if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}for(U*=3,Y=w-2;Y>=0;Y-=2){var le;if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}return(1e3-U)%10},a.decodeEnd=function(u,w){return a.findGuardPattern(u,w,!1,a.START_END_PATTERN,new Int32Array(a.START_END_PATTERN.length).fill(0))},a.findGuardPatternWithoutCounters=function(u,w,U,Y){return this.findGuardPattern(u,w,U,Y,new Int32Array(Y.length))},a.findGuardPattern=function(u,w,U,Y,le){for(var ge=u.getSize(),Pe=0,Ge=w=U?u.getNextUnset(w):u.getNextSet(w),dt=Y.length,_t=U,Ot=w;Ot=0)return ge;throw new Wn},a.MAX_AVG_VARIANCE=.48,a.MAX_INDIVIDUAL_VARIANCE=.7,a.START_END_PATTERN=Int32Array.from([1,1,1]),a.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),a.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),a.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],a}(Ut);var Ks=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ac=function(){function v(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return v.prototype.decodeRow=function(a,u,w){var U=this.decodeRowStringBuffer,Y=this.decodeMiddle(u,w,U),le=U.toString(),ge=v.parseExtensionString(le),Pe=[new Eo((w[0]+w[1])/2,a),new Eo(Y,a)],Ge=new Cs(le,null,0,Pe,Do.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},v.prototype.decodeMiddle=function(a,u,w){var U,Y,le=this.decodeMiddleCounters;le[0]=0,le[1]=0,le[2]=0,le[3]=0;for(var ge=a.getSize(),Pe=u[1],Ge=0,dt=0;dt<5&&Pe=10&&(Ge|=1<<4-dt),4!==dt&&(Pe=a.getNextSet(Pe),Pe=a.getNextUnset(Pe))}if(5!==w.length)throw new Wn;var Ur=this.determineCheckDigit(Ge);if(v.extensionChecksum(w.toString())!==Ur)throw new Wn;return Pe},v.extensionChecksum=function(a){for(var u=a.length,w=0,U=u-2;U>=0;U-=2)w+=a.charAt(U).charCodeAt(0)-48;for(w*=3,U=u-1;U>=0;U-=2)w+=a.charAt(U).charCodeAt(0)-48;return(w*=3)%10},v.prototype.determineCheckDigit=function(a){for(var u=0;u<10;u++)if(a===this.CHECK_DIGIT_ENCODINGS[u])return u;throw new Wn},v.parseExtensionString=function(a){if(5!==a.length)return null;var u=v.parseExtension5String(a);return null==u?null:new Map([[gc.SUGGESTED_PRICE,u]])},v.parseExtension5String=function(a){var u;switch(a.charAt(0)){case"0":u="\xa3";break;case"5":u="$";break;case"9":switch(a){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}u="";break;default:u=""}var w=parseInt(a.substring(1)),Y=w%100;return u+(w/100).toString()+"."+(Y<10?"0"+Y:Y.toString())},v}();var Na=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Fd=function(){function v(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return v.prototype.decodeRow=function(a,u,w){var U=this.decodeRowStringBuffer,Y=this.decodeMiddle(u,w,U),le=U.toString(),ge=v.parseExtensionString(le),Pe=[new Eo((w[0]+w[1])/2,a),new Eo(Y,a)],Ge=new Cs(le,null,0,Pe,Do.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},v.prototype.decodeMiddle=function(a,u,w){var U,Y,le=this.decodeMiddleCounters;le[0]=0,le[1]=0,le[2]=0,le[3]=0;for(var ge=a.getSize(),Pe=u[1],Ge=0,dt=0;dt<2&&Pe=10&&(Ge|=1<<1-dt),1!==dt&&(Pe=a.getNextSet(Pe),Pe=a.getNextUnset(Pe))}if(2!==w.length)throw new Wn;if(parseInt(w.toString())%4!==Ge)throw new Wn;return Pe},v.parseExtensionString=function(a){return 2!==a.length?null:new Map([[gc.ISSUE_NUMBER,parseInt(a)]])},v}(),yu=function(){function v(){}return v.decodeRow=function(a,u,w){var U=go.findGuardPattern(u,w,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ac).decodeRow(a,u,U)}catch{return(new Fd).decodeRow(a,u,U)}},v.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),v}();var vh=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const pl=function(v){function a(){var u=v.call(this)||this;u.decodeRowStringBuffer="",a.L_AND_G_PATTERNS=a.L_PATTERNS.map(function(ge){return Int32Array.from(ge)});for(var w=10;w<20;w++){for(var U=a.L_PATTERNS[w-10],Y=new Int32Array(U.length),le=0;le=w.getSize()||!w.isRange(Sr,Ur,!1))throw new Wn;var Zr=dt.toString();if(Zr.length<8)throw new Qn;if(!a.checkChecksum(Zr))throw new rs;var dn=(Y[1]+Y[0])/2,ln=(Ot[1]+Ot[0])/2,Tn=this.getBarcodeFormat(),Gn=[new Eo(dn,u),new Eo(ln,u)],yi=new Cs(Zr,null,0,Gn,Tn,(new Date).getTime()),Bi=0;try{var Ki=yu.decodeRow(u,w,Ot[1]);yi.putMetadata(gc.UPC_EAN_EXTENSION,Ki.getText()),yi.putAllMetadata(Ki.getResultMetadata()),yi.addResultPoints(Ki.getResultPoints()),Bi=Ki.getText().length}catch{}var po=null==U?null:U.get(Di.ALLOWED_EAN_EXTENSIONS);if(null!=po){var gs=!1;for(var ns in po)if(Bi.toString()===ns){gs=!0;break}if(!gs)throw new Wn}return yi},a.checkChecksum=function(u){return a.checkStandardUPCEANChecksum(u)},a.checkStandardUPCEANChecksum=function(u){var w=u.length;if(0===w)return!1;var U=parseInt(u.charAt(w-1),10);return a.getStandardUPCEANChecksum(u.substring(0,w-1))===U},a.getStandardUPCEANChecksum=function(u){for(var w=u.length,U=0,Y=w-1;Y>=0;Y-=2){if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}for(U*=3,Y=w-2;Y>=0;Y-=2){var le;if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}return(1e3-U)%10},a.decodeEnd=function(u,w){return a.findGuardPattern(u,w,!1,a.START_END_PATTERN,new Int32Array(a.START_END_PATTERN.length).fill(0))},a}(go);var Mp=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),zh=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Kh=function(v){function a(){var u=v.call(this)||this;return u.decodeMiddleCounters=Int32Array.from([0,0,0,0]),u}return Mp(a,v),a.prototype.decodeMiddle=function(u,w,U){var Y,le,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var dt=u.getSize(),_t=w[1],Ot=0,Ht=0;Ht<6&&_t=10&&(Ot|=1<<5-Ht)}for(U=a.determineFirstDigit(U,Ot),_t=pl.findGuardPattern(u,_t,!0,pl.MIDDLE_PATTERN,new Int32Array(pl.MIDDLE_PATTERN.length).fill(0))[1],Ht=0;Ht<6&&_t=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const zg=function(v){function a(){var u=v.call(this)||this;return u.decodeMiddleCounters=Int32Array.from([0,0,0,0]),u}return qv(a,v),a.prototype.decodeMiddle=function(u,w,U){var Y,le,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var dt=u.getSize(),_t=w[1],Ot=0;Ot<4&&_t=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Dr=function(v){function a(){var u=v.call(this)||this;return u.decodeMiddleCounters=new Int32Array(4),u}return at(a,v),a.prototype.decodeMiddle=function(u,w,U){var Y,le,ge=this.decodeMiddleCounters.map(function(Zr){return Zr});ge[0]=0,ge[1]=0,ge[2]=0,ge[3]=0;for(var Pe=u.getSize(),Ge=w[1],dt=0,_t=0;_t<6&&Ge=10&&(dt|=1<<5-_t)}return a.determineNumSysAndCheckDigit(new jr(U),dt),Ge},a.prototype.decodeEnd=function(u,w){return a.findGuardPatternWithoutCounters(u,w,!0,a.MIDDLE_END_PATTERN)},a.prototype.checkChecksum=function(u){return pl.checkChecksum(a.convertUPCEtoUPCA(u))},a.determineNumSysAndCheckDigit=function(u,w){for(var U=0;U<=1;U++)for(var Y=0;Y<10;Y++)if(w===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[U][Y])return u.insert(0,"0"+U),void u.append("0"+Y);throw Wn.getNotFoundInstance()},a.prototype.getBarcodeFormat=function(){return Do.UPC_E},a.convertUPCEtoUPCA=function(u){var w=u.slice(1,7).split("").map(function(le){return le.charCodeAt(0)}),U=new jr;U.append(u.charAt(0));var Y=w[5];switch(Y){case 0:case 1:case 2:U.appendChars(w,0,2),U.append(Y),U.append("0000"),U.appendChars(w,2,3);break;case 3:U.appendChars(w,0,3),U.append("00000"),U.appendChars(w,3,2);break;case 4:U.appendChars(w,0,4),U.append("00000"),U.append(w[4]);break;default:U.appendChars(w,0,5),U.append("0000"),U.append(Y)}return u.length>=8&&U.append(u.charAt(7)),U.toString()},a.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),a.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],a}(pl);var Jr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Kn=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Gi=function(v){function a(u){var w=v.call(this)||this,U=null==u?null:u.get(Di.POSSIBLE_FORMATS),Y=[];return null!=U&&(U.indexOf(Do.EAN_13)>-1&&Y.push(new Kh),U.indexOf(Do.UPC_A)>-1&&Y.push(new At),U.indexOf(Do.EAN_8)>-1&&Y.push(new zg),U.indexOf(Do.UPC_E)>-1&&Y.push(new Dr)),0===Y.length&&(Y.push(new Kh),Y.push(new At),Y.push(new zg),Y.push(new Dr)),w.readers=Y,w}return Jr(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le;try{for(var ge=Kn(this.readers),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;try{var dt=Ge.decodeRow(u,w,U),_t=dt.getBarcodeFormat()===Do.EAN_13&&"0"===dt.getText().charAt(0),Ot=null==U?null:U.get(Di.POSSIBLE_FORMATS),Ht=null==Ot||Ot.includes(Do.UPC_A);if(_t&&Ht){var Sr=dt.getRawBytes(),Ur=new Cs(dt.getText().substring(1),Sr,Sr?Sr.length:null,dt.getResultPoints(),Do.UPC_A);return Ur.putAllMetadata(dt.getResultMetadata()),Ur}return dt}catch{}}}catch(Zr){Y={error:Zr}}finally{try{Pe&&!Pe.done&&(le=ge.return)&&le.call(ge)}finally{if(Y)throw Y.error}}throw new Wn},a.prototype.reset=function(){var u,w;try{for(var U=Kn(this.readers),Y=U.next();!Y.done;Y=U.next())Y.value.reset()}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}},a}(Ut);var ss=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const vc=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},u}return ss(a,v),a.prototype.decodeRow=function(u,w,U){var Y=this.getValidRowData(w);if(!Y)throw new Wn;var le=this.codaBarDecodeRow(Y.row);if(!le)throw new Wn;return new Cs(le,null,0,[new Eo(Y.left,u),new Eo(Y.right,u)],Do.CODABAR,(new Date).getTime())},a.prototype.getValidRowData=function(u){var w=u.toArray(),U=w.indexOf(!0);if(-1===U)return null;var Y=w.lastIndexOf(!0);if(Y<=U)return null;for(var le=[],ge=(w=w.slice(U,Y+1))[0],Pe=1,Ge=1;Ge0;){var le=u.splice(0,8).splice(0,7).map(function(Pe){return PeY&&(Y=w[le],U=le);u[U]++},a.decrement=function(u,w){for(var U=0,Y=w[0],le=1;le=a.MIN_FINDER_PATTERN_RATIO&&ge<=a.MAX_FINDER_PATTERN_RATIO){var Pe=Number.MAX_SAFE_INTEGER,Ge=Number.MIN_SAFE_INTEGER;try{for(var dt=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;Ot>Ge&&(Ge=Ot),Ot=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),Pe=ge.next();!Pe.done;Pe=ge.next())le+=Pe.value}catch(ln){U={error:ln}}finally{try{Pe&&!Pe.done&&(Y=ge.return)&&Y.call(ge)}finally{if(U)throw U.error}}for(var dt=0,_t=0,Ot=a.length,Ht=0;Ht=Ot-Ht-1&&(Ur-=v.combins(le-Sr-(Ot-Ht),Ot-Ht-2)),Ot-Ht-1>1){for(var Zr=0,dn=le-Sr-(Ot-Ht-2);dn>u;dn--)Zr+=v.combins(le-Sr-dn-1,Ot-Ht-3);Ur-=Zr*(Ot-1-Ht)}else le-Sr>u&&Ur--;dt+=Ur}le-=Sr}return dt},v.combins=function(a,u){var w,U;a-u>u?(U=u,w=a-u):(U=a-u,w=u);for(var Y=1,le=1,ge=a;ge>w;ge--)Y*=ge,le<=U&&(Y/=le,le++);for(;le<=U;)Y/=le,le++;return Y},v}(),Hh=function(){function v(){}return v.buildBitArray=function(a){var u=2*a.length-1;null==a[a.length-1].getRightChar()&&(u-=1);for(var U=new bi(12*u),Y=0,ge=a[0].getRightChar().getValue(),Pe=11;Pe>=0;--Pe)ge&1<=0;--_t)dt&1<<_t&&U.set(Y),Y++;if(null!==Ge.getRightChar()){var Ot=Ge.getRightChar().getValue();for(_t=11;_t>=0;--_t)Ot&1<<_t&&U.set(Y),Y++}}return U},v}(),Qs=function(){function v(a,u){u?this.decodedInformation=null:(this.finished=a,this.decodedInformation=u)}return v.prototype.getDecodedInformation=function(){return this.decodedInformation},v.prototype.isFinished=function(){return this.finished},v}(),bh=function(){function v(a){this.newPosition=a}return v.prototype.getNewPosition=function(){return this.newPosition},v}();var su=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const vu=function(v){function a(u,w){var U=v.call(this,u)||this;return U.value=w,U}return su(a,v),a.prototype.getValue=function(){return this.value},a.prototype.isFNC1=function(){return this.value===a.FNC1},a.FNC1="$",a}(bh);var Fe=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Ye=function(v){function a(u,w,U){var Y=v.call(this,u)||this;return U?(Y.remaining=!0,Y.remainingValue=Y.remainingValue):(Y.remaining=!1,Y.remainingValue=0),Y.newString=w,Y}return Fe(a,v),a.prototype.getNewString=function(){return this.newString},a.prototype.isRemaining=function(){return this.remaining},a.prototype.getRemainingValue=function(){return this.remainingValue},a}(bh);var pr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Er=function(v){function a(u,w,U){var Y=v.call(this,u)||this;if(w<0||w>10||U<0||U>10)throw new Qn;return Y.firstDigit=w,Y.secondDigit=U,Y}return pr(a,v),a.prototype.getFirstDigit=function(){return this.firstDigit},a.prototype.getSecondDigit=function(){return this.secondDigit},a.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},a.prototype.isFirstDigitFNC1=function(){return this.firstDigit===a.FNC1},a.prototype.isSecondDigitFNC1=function(){return this.secondDigit===a.FNC1},a.prototype.isAnyFNC1=function(){return this.firstDigit===a.FNC1||this.secondDigit===a.FNC1},a.FNC1=10,a}(bh);var on=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Ri=function(){function v(){}return v.parseFieldsInGeneralPurpose=function(a){var u,w,U,Y,le,ge,Pe,Ge;if(!a)return null;if(a.length<2)throw new Wn;var dt=a.substring(0,2);try{for(var _t=on(v.TWO_DIGIT_DATA_LENGTH),Ot=_t.next();!Ot.done;Ot=_t.next())if((Ht=Ot.value)[0]===dt)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(2,Ht[2],a):v.processFixedAI(2,Ht[1],a)}catch(Bi){u={error:Bi}}finally{try{Ot&&!Ot.done&&(w=_t.return)&&w.call(_t)}finally{if(u)throw u.error}}if(a.length<3)throw new Wn;var Sr=a.substring(0,3);try{for(var Ur=on(v.THREE_DIGIT_DATA_LENGTH),Zr=Ur.next();!Zr.done;Zr=Ur.next())if((Ht=Zr.value)[0]===Sr)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(3,Ht[2],a):v.processFixedAI(3,Ht[1],a)}catch(Bi){U={error:Bi}}finally{try{Zr&&!Zr.done&&(Y=Ur.return)&&Y.call(Ur)}finally{if(U)throw U.error}}try{for(var dn=on(v.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),ln=dn.next();!ln.done;ln=dn.next())if((Ht=ln.value)[0]===Sr)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(4,Ht[2],a):v.processFixedAI(4,Ht[1],a)}catch(Bi){le={error:Bi}}finally{try{ln&&!ln.done&&(ge=dn.return)&&ge.call(dn)}finally{if(le)throw le.error}}if(a.length<4)throw new Wn;var Tn=a.substring(0,4);try{for(var Gn=on(v.FOUR_DIGIT_DATA_LENGTH),yi=Gn.next();!yi.done;yi=Gn.next()){var Ht;if((Ht=yi.value)[0]===Tn)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(4,Ht[2],a):v.processFixedAI(4,Ht[1],a)}}catch(Bi){Pe={error:Bi}}finally{try{yi&&!yi.done&&(Ge=Gn.return)&&Ge.call(Gn)}finally{if(Pe)throw Pe.error}}throw new Wn},v.processFixedAI=function(a,u,w){if(w.lengththis.information.getSize())return a+4<=this.information.getSize();for(var u=a;uthis.information.getSize()){var u=this.extractNumericValueFromBitArray(a,4);return new Er(this.information.getSize(),0===u?Er.FNC1:u-1,Er.FNC1)}var w=this.extractNumericValueFromBitArray(a,7);return new Er(a+7,(w-8)/11,(w-8)%11)},v.prototype.extractNumericValueFromBitArray=function(a,u){return v.extractNumericValueFromBitArray(this.information,a,u)},v.extractNumericValueFromBitArray=function(a,u,w){for(var U=0,Y=0;Ythis.information.getSize())return!1;var u=this.extractNumericValueFromBitArray(a,5);if(u>=5&&u<16)return!0;if(a+7>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(a,7);if(w>=64&&w<116)return!0;if(a+8>this.information.getSize())return!1;var U=this.extractNumericValueFromBitArray(a,8);return U>=232&&U<253},v.prototype.decodeIsoIec646=function(a){var u=this.extractNumericValueFromBitArray(a,5);if(15===u)return new vu(a+5,vu.FNC1);if(u>=5&&u<15)return new vu(a+5,"0"+(u-5));var Y,w=this.extractNumericValueFromBitArray(a,7);if(w>=64&&w<90)return new vu(a+7,""+(w+1));if(w>=90&&w<116)return new vu(a+7,""+(w+7));switch(this.extractNumericValueFromBitArray(a,8)){case 232:Y="!";break;case 233:Y='"';break;case 234:Y="%";break;case 235:Y="&";break;case 236:Y="'";break;case 237:Y="(";break;case 238:Y=")";break;case 239:Y="*";break;case 240:Y="+";break;case 241:Y=",";break;case 242:Y="-";break;case 243:Y=".";break;case 244:Y="/";break;case 245:Y=":";break;case 246:Y=";";break;case 247:Y="<";break;case 248:Y="=";break;case 249:Y=">";break;case 250:Y="?";break;case 251:Y="_";break;case 252:Y=" ";break;default:throw new Qn}return new vu(a+8,Y)},v.prototype.isStillAlpha=function(a){if(a+5>this.information.getSize())return!1;var u=this.extractNumericValueFromBitArray(a,5);if(u>=5&&u<16)return!0;if(a+6>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(a,6);return w>=16&&w<63},v.prototype.decodeAlphanumeric=function(a){var u=this.extractNumericValueFromBitArray(a,5);if(15===u)return new vu(a+5,vu.FNC1);if(u>=5&&u<15)return new vu(a+5,"0"+(u-5));var U,w=this.extractNumericValueFromBitArray(a,6);if(w>=32&&w<58)return new vu(a+6,""+(w+33));switch(w){case 58:U="*";break;case 59:U=",";break;case 60:U="-";break;case 61:U=".";break;case 62:U="/";break;default:throw new ou("Decoding invalid alphanumeric value: "+w)}return new vu(a+6,U)},v.prototype.isAlphaTo646ToAlphaLatch=function(a){if(a+1>this.information.getSize())return!1;for(var u=0;u<5&&u+athis.information.getSize())return!1;for(var u=a;uthis.information.getSize())return!1;for(var u=0;u<4&&u+a=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const jl=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.pairs=new Array(a.MAX_PAIRS),u.rows=new Array,u.startEnd=[2],u}return Uw(a,v),a.prototype.decodeRow=function(u,w,U){this.pairs.length=0,this.startFromEven=!1;try{return a.constructResult(this.decodeRow2pairs(u,w))}catch{}return this.pairs.length=0,this.startFromEven=!0,a.constructResult(this.decodeRow2pairs(u,w))},a.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},a.prototype.decodeRow2pairs=function(u,w){for(var U=!1;!U;)try{this.pairs.push(this.retrieveNextPair(w,this.pairs,u))}catch(ge){if(ge instanceof Wn){if(!this.pairs.length)throw new Wn;U=!0}}if(this.checkChecksum())return this.pairs;var Y;if(Y=!!this.rows.length,this.storeRow(u,!1),Y){var le=this.checkRowsBoolean(!1);if(null!=le||null!=(le=this.checkRowsBoolean(!0)))return le}throw new Wn},a.prototype.checkRowsBoolean=function(u){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,u&&(this.rows=this.rows.reverse());var w=null;try{w=this.checkRows(new Array,0)}catch(U){console.log(U)}return u&&(this.rows=this.rows.reverse()),w},a.prototype.checkRows=function(u,w){for(var U,Y,le=w;lege.length)){for(var Pe=!0,Ge=0;Geu){le=ge.isEquivalent(this.pairs);break}Y=ge.isEquivalent(this.pairs),U++}le||Y||a.isPartialRow(this.pairs,this.rows)||(this.rows.push(U,new Wh(this.pairs,u,w)),this.removePartialRows(this.pairs,this.rows))},a.prototype.removePartialRows=function(u,w){var U,Y,le,ge,Pe,Ge;try{for(var dt=Hc(w),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;if(Ot.getPairs().length!==u.length)try{for(var Sr=(le=void 0,Hc(Ot.getPairs())),Ur=Sr.next();!Ur.done;Ur=Sr.next()){var Zr=Ur.value;try{for(var ln=(Pe=void 0,Hc(u)),Tn=ln.next();!Tn.done;Tn=ln.next())if(Yf.equals(Zr,Tn.value)){!0;break}}catch(yi){Pe={error:yi}}finally{try{Tn&&!Tn.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}}}catch(yi){le={error:yi}}finally{try{Ur&&!Ur.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(le)throw le.error}}}}catch(yi){U={error:yi}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}},a.isPartialRow=function(u,w){var U,Y,le,ge,Pe,Ge;try{for(var dt=Hc(w),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value,Ht=!0;try{for(var Sr=(le=void 0,Hc(u)),Ur=Sr.next();!Ur.done;Ur=Sr.next()){var Zr=Ur.value,dn=!1;try{for(var ln=(Pe=void 0,Hc(Ot.getPairs())),Tn=ln.next();!Tn.done;Tn=ln.next())if(Zr.equals(Tn.value)){dn=!0;break}}catch(yi){Pe={error:yi}}finally{try{Tn&&!Tn.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}if(!dn){Ht=!1;break}}}catch(yi){le={error:yi}}finally{try{Ur&&!Ur.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(le)throw le.error}}if(Ht)return!0}}catch(yi){U={error:yi}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}return!1},a.prototype.getRows=function(){return this.rows},a.constructResult=function(u){var U=function YE(v){try{if(v.get(1))return new Xo(v);if(!v.get(2))return new Wa(v);switch(un.extractNumericValueFromBitArray(v,1,4)){case 4:return new qn(v);case 5:return new r1(v)}switch(un.extractNumericValueFromBitArray(v,1,5)){case 12:return new Gg(v);case 13:return new wh(v)}switch(un.extractNumericValueFromBitArray(v,1,7)){case 56:return new Pp(v,"310","11");case 57:return new Pp(v,"320","11");case 58:return new Pp(v,"310","13");case 59:return new Pp(v,"320","13");case 60:return new Pp(v,"310","15");case 61:return new Pp(v,"320","15");case 62:return new Pp(v,"310","17");case 63:return new Pp(v,"320","17")}}catch(U){throw console.log(U),new ou("unknown decoder: "+v)}}(Hh.buildBitArray(u)),Y=U.parseInformation(),le=u[0].getFinderPattern().getResultPoints(),ge=u[u.length-1].getFinderPattern().getResultPoints();return new Cs(Y,null,null,[le[0],le[1],ge[0],ge[1]],Do.RSS_EXPANDED,null)},a.prototype.checkChecksum=function(){var u=this.pairs.get(0),w=u.getLeftChar(),U=u.getRightChar();if(null===U)return!1;for(var Y=U.getChecksumPortion(),le=2,ge=1;ge=0?U:this.isEmptyPair(w)?0:w[w.length-1].getFinderPattern().getStartEnd()[1];var Ge=w.length%2!=0;this.startFromEven&&(Ge=!Ge);for(var dt=!1;ge=0&&!u.get(Pe);)Pe--;Pe++,Y=this.startEnd[0]-Pe,le=Pe,ge=this.startEnd[1]}else le=this.startEnd[0],Y=(ge=u.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var dt,Ge=this.getDecodeFinderCounters();Rt.arraycopy(Ge,0,Ge,1,Ge.length-1),Ge[0]=Y;try{dt=this.parseFinderValue(Ge,a.FINDER_PATTERNS)}catch{return null}return new Kg(dt,[le,ge],le,ge,w)},a.prototype.decodeDataCharacter=function(u,w,U,Y){for(var le=this.getDataCharacterCounters(),ge=0;ge.3)throw new Wn;var Sr=this.getOddCounts(),Ur=this.getEvenCounts(),Zr=this.getOddRoundingErrors(),dn=this.getEvenRoundingErrors();for(Pe=0;Pe8){if(ln>8.7)throw new Wn;Tn=8}var Gn=Pe/2;1&Pe?(Ur[Gn]=Tn,dn[Gn]=ln-Tn):(Sr[Gn]=Tn,Zr[Gn]=ln-Tn)}this.adjustOddEvenCounts(17);var yi=4*w.getValue()+(U?0:2)+(Y?0:1)-1,Bi=0,Ki=0;for(Pe=Sr.length-1;Pe>=0;Pe--)a.isNotA1left(w,U,Y)&&(Ki+=Sr[Pe]*a.WEIGHTS[yi][2*Pe]),Bi+=Sr[Pe];var gs=0;for(Pe=Ur.length-1;Pe>=0;Pe--)a.isNotA1left(w,U,Y)&&(gs+=Ur[Pe]*a.WEIGHTS[yi][2*Pe+1]);var ns=Ki+gs;if(1&Bi||Bi>13||Bi<4)throw new Wn;var _l=(13-Bi)/2,ja=a.SYMBOL_WIDEST[_l],Xc=9-ja,bd=af.getRSSvalue(Sr,ja,!0),Th=af.getRSSvalue(Ur,Xc,!1);return new Xf(bd*a.EVEN_TOTAL_SUBSET[_l]+Th+a.GSUM[_l],ns)},a.isNotA1left=function(u,w,U){return!(0===u.getValue()&&w&&U)},a.prototype.adjustOddEvenCounts=function(u){var w=Js.sum(new Int32Array(this.getOddCounts())),U=Js.sum(new Int32Array(this.getEvenCounts())),Y=!1,le=!1;w>13?le=!0:w<4&&(Y=!0);var ge=!1,Pe=!1;U>13?Pe=!0:U<4&&(ge=!0);var Ge=w+U-u,dt=!(1&~w),_t=!(1&U);if(1===Ge)if(dt){if(_t)throw new Wn;le=!0}else{if(!_t)throw new Wn;Pe=!0}else if(-1===Ge)if(dt){if(_t)throw new Wn;Y=!0}else{if(!_t)throw new Wn;ge=!0}else{if(0!==Ge)throw new Wn;if(dt){if(!_t)throw new Wn;w=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const wm=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.possibleLeftPairs=[],u.possibleRightPairs=[],u}return $w(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge,Pe,Ge=this.decodePair(w,!1,u,U);a.addOrTally(this.possibleLeftPairs,Ge),w.reverse();var dt=this.decodePair(w,!0,u,U);a.addOrTally(this.possibleRightPairs,dt),w.reverse();try{for(var _t=bm(this.possibleLeftPairs),Ot=_t.next();!Ot.done;Ot=_t.next()){var Ht=Ot.value;if(Ht.getCount()>1)try{for(var Sr=(ge=void 0,bm(this.possibleRightPairs)),Ur=Sr.next();!Ur.done;Ur=Sr.next()){var Zr=Ur.value;if(Zr.getCount()>1&&a.checkChecksum(Ht,Zr))return a.constructResult(Ht,Zr)}}catch(dn){ge={error:dn}}finally{try{Ur&&!Ur.done&&(Pe=Sr.return)&&Pe.call(Sr)}finally{if(ge)throw ge.error}}}}catch(dn){Y={error:dn}}finally{try{Ot&&!Ot.done&&(le=_t.return)&&le.call(_t)}finally{if(Y)throw Y.error}}throw new Wn},a.addOrTally=function(u,w){var U,Y;if(null!=w){var le=!1;try{for(var ge=bm(u),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(Ge.getValue()===w.getValue()){Ge.incrementCount(),le=!0;break}}}catch(dt){U={error:dt}}finally{try{Pe&&!Pe.done&&(Y=ge.return)&&Y.call(ge)}finally{if(U)throw U.error}}le||u.push(w)}},a.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},a.constructResult=function(u,w){for(var U=4537077*u.getValue()+w.getValue(),Y=new String(U).toString(),le=new jr,ge=13-Y.length;ge>0;ge--)le.append("0");le.append(Y);var Pe=0;for(ge=0;ge<13;ge++){var Ge=le.charAt(ge).charCodeAt(0)-48;Pe+=1&ge?Ge:3*Ge}10==(Pe=10-Pe%10)&&(Pe=0),le.append(Pe.toString());var dt=u.getFinderPattern().getResultPoints(),_t=w.getFinderPattern().getResultPoints();return new Cs(le.toString(),null,0,[dt[0],dt[1],_t[0],_t[1]],Do.RSS_14,(new Date).getTime())},a.checkChecksum=function(u,w){var U=(u.getChecksumPortion()+16*w.getChecksumPortion())%79,Y=9*u.getFinderPattern().getValue()+w.getFinderPattern().getValue();return Y>72&&Y--,Y>8&&Y--,U===Y},a.prototype.decodePair=function(u,w,U,Y){try{var le=this.findFinderPattern(u,w),ge=this.parseFoundFinderPattern(u,U,w,le),Pe=null==Y?null:Y.get(Di.NEED_RESULT_POINT_CALLBACK);if(null!=Pe){var Ge=(le[0]+le[1])/2;w&&(Ge=u.getSize()-1-Ge),Pe.foundPossibleResultPoint(new Eo(Ge,U))}var dt=this.decodeDataCharacter(u,ge,!0),_t=this.decodeDataCharacter(u,ge,!1);return new Qf(1597*dt.getValue()+_t.getValue(),dt.getChecksumPortion()+4*_t.getChecksumPortion(),ge)}catch{return null}},a.prototype.decodeDataCharacter=function(u,w,U){for(var Y=this.getDataCharacterCounters(),le=0;le8&&(dn=8);var ln=Math.floor(ge/2);1&ge?(Ht[ln]=dn,Ur[ln]=Zr-dn):(Ot[ln]=dn,Sr[ln]=Zr-dn)}this.adjustOddEvenCounts(U,dt);var Tn=0,Gn=0;for(ge=Ot.length-1;ge>=0;ge--)Gn*=9,Gn+=Ot[ge],Tn+=Ot[ge];var yi=0,Bi=0;for(ge=Ht.length-1;ge>=0;ge--)yi*=9,yi+=Ht[ge],Bi+=Ht[ge];var po,gs,Ki=Gn+3*yi;if(U){if(1&Tn||Tn>12||Tn<4)throw new Wn;var ns=9-(gs=a.OUTSIDE_ODD_WIDEST[po=(12-Tn)/2]),_l=af.getRSSvalue(Ot,gs,!1),ja=af.getRSSvalue(Ht,ns,!0);return new Xf(_l*a.OUTSIDE_EVEN_TOTAL_SUBSET[po]+ja+a.OUTSIDE_GSUM[po],Ki)}if(1&Bi||Bi>10||Bi<4)throw new Wn;return ns=9-(gs=a.INSIDE_ODD_WIDEST[po=(10-Bi)/2]),_l=af.getRSSvalue(Ot,gs,!0),ja=af.getRSSvalue(Ht,ns,!1),new Xf(ja*a.INSIDE_ODD_TOTAL_SUBSET[po]+_l+a.INSIDE_GSUM[po],Ki)},a.prototype.findFinderPattern=function(u,w){var U=this.getDecodeFinderCounters();U[0]=0,U[1]=0,U[2]=0,U[3]=0;for(var Y=u.getSize(),le=!1,ge=0;ge=0&&le!==u.get(ge);)ge--;ge++;var Pe=Y[0]-ge,Ge=this.getDecodeFinderCounters(),dt=new Int32Array(Ge.length);Rt.arraycopy(Ge,0,dt,1,Ge.length-1),dt[0]=Pe;var _t=this.parseFinderValue(dt,a.FINDER_PATTERNS),Ot=ge,Ht=Y[1];return U&&(Ot=u.getSize()-1-Ot,Ht=u.getSize()-1-Ht),new Kg(_t,[ge,Y[1]],Ot,Ht,w)},a.prototype.adjustOddEvenCounts=function(u,w){var U=Js.sum(new Int32Array(this.getOddCounts())),Y=Js.sum(new Int32Array(this.getEvenCounts())),le=!1,ge=!1,Pe=!1,Ge=!1;u?(U>12?ge=!0:U<4&&(le=!0),Y>12?Ge=!0:Y<4&&(Pe=!0)):(U>11?ge=!0:U<5&&(le=!0),Y>10?Ge=!0:Y<4&&(Pe=!0));var dt=U+Y-w,_t=(1&U)==(u?1:0),Ot=!(1&~Y);if(1===dt)if(_t){if(Ot)throw new Wn;ge=!0}else{if(!Ot)throw new Wn;Ge=!0}else if(-1===dt)if(_t){if(Ot)throw new Wn;le=!0}else{if(!Ot)throw new Wn;Pe=!0}else{if(0!==dt)throw new Wn;if(_t){if(!Ot)throw new Wn;U=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}),Ms=function(){function v(a,u,w){this.ecCodewords=a,this.ecBlocks=[u],w&&this.ecBlocks.push(w)}return v.prototype.getECCodewords=function(){return this.ecCodewords},v.prototype.getECBlocks=function(){return this.ecBlocks},v}(),Ja=function(){function v(a,u){this.count=a,this.dataCodewords=u}return v.prototype.getCount=function(){return this.count},v.prototype.getDataCodewords=function(){return this.dataCodewords},v}();const Gl=function(){function v(a,u,w,U,Y,le){var ge,Pe;this.versionNumber=a,this.symbolSizeRows=u,this.symbolSizeColumns=w,this.dataRegionSizeRows=U,this.dataRegionSizeColumns=Y,this.ecBlocks=le;var Ge=0,dt=le.getECCodewords(),_t=le.getECBlocks();try{for(var Ot=Xg(_t),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var Sr=Ht.value;Ge+=Sr.getCount()*(Sr.getDataCodewords()+dt)}}catch(Ur){ge={error:Ur}}finally{try{Ht&&!Ht.done&&(Pe=Ot.return)&&Pe.call(Ot)}finally{if(ge)throw ge.error}}this.totalCodewords=Ge}return v.prototype.getVersionNumber=function(){return this.versionNumber},v.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},v.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},v.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},v.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},v.prototype.getTotalCodewords=function(){return this.totalCodewords},v.prototype.getECBlocks=function(){return this.ecBlocks},v.getVersionForDimensions=function(a,u){var w,U;if(1&a||1&u)throw new Qn;try{for(var Y=Xg(v.VERSIONS),le=Y.next();!le.done;le=Y.next()){var ge=le.value;if(ge.symbolSizeRows===a&&ge.symbolSizeColumns===u)return ge}}catch(Pe){w={error:Pe}}finally{try{le&&!le.done&&(U=Y.return)&&U.call(Y)}finally{if(w)throw w.error}}throw new Qn},v.prototype.toString=function(){return""+this.versionNumber},v.buildVersions=function(){return[new v(1,10,10,8,8,new Ms(5,new Ja(1,3))),new v(2,12,12,10,10,new Ms(7,new Ja(1,5))),new v(3,14,14,12,12,new Ms(10,new Ja(1,8))),new v(4,16,16,14,14,new Ms(12,new Ja(1,12))),new v(5,18,18,16,16,new Ms(14,new Ja(1,18))),new v(6,20,20,18,18,new Ms(18,new Ja(1,22))),new v(7,22,22,20,20,new Ms(20,new Ja(1,30))),new v(8,24,24,22,22,new Ms(24,new Ja(1,36))),new v(9,26,26,24,24,new Ms(28,new Ja(1,44))),new v(10,32,32,14,14,new Ms(36,new Ja(1,62))),new v(11,36,36,16,16,new Ms(42,new Ja(1,86))),new v(12,40,40,18,18,new Ms(48,new Ja(1,114))),new v(13,44,44,20,20,new Ms(56,new Ja(1,144))),new v(14,48,48,22,22,new Ms(68,new Ja(1,174))),new v(15,52,52,24,24,new Ms(42,new Ja(2,102))),new v(16,64,64,14,14,new Ms(56,new Ja(2,140))),new v(17,72,72,16,16,new Ms(36,new Ja(4,92))),new v(18,80,80,18,18,new Ms(48,new Ja(4,114))),new v(19,88,88,20,20,new Ms(56,new Ja(4,144))),new v(20,96,96,22,22,new Ms(68,new Ja(4,174))),new v(21,104,104,24,24,new Ms(56,new Ja(6,136))),new v(22,120,120,18,18,new Ms(68,new Ja(6,175))),new v(23,132,132,20,20,new Ms(62,new Ja(8,163))),new v(24,144,144,22,22,new Ms(62,new Ja(8,156),new Ja(2,155))),new v(25,8,18,6,16,new Ms(7,new Ja(1,5))),new v(26,8,32,6,14,new Ms(11,new Ja(1,10))),new v(27,12,26,10,24,new Ms(14,new Ja(1,16))),new v(28,12,36,10,16,new Ms(18,new Ja(1,22))),new v(29,16,36,14,16,new Ms(24,new Ja(1,32))),new v(30,16,48,14,22,new Ms(28,new Ja(1,49)))]},v.VERSIONS=v.buildVersions(),v}(),Wc=function(){function v(a){var u=a.getHeight();if(u<8||u>144||1&u)throw new Qn;this.version=v.readVersion(a),this.mappingBitMatrix=this.extractDataRegion(a),this.readMappingMatrix=new Qi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return v.prototype.getVersion=function(){return this.version},v.readVersion=function(a){var u=a.getHeight(),w=a.getWidth();return Gl.getVersionForDimensions(u,w)},v.prototype.readCodewords=function(){var a=new Int8Array(this.version.getTotalCodewords()),u=0,w=4,U=0,Y=this.mappingBitMatrix.getHeight(),le=this.mappingBitMatrix.getWidth(),ge=!1,Pe=!1,Ge=!1,dt=!1;do{if(w!==Y||0!==U||ge)if(w===Y-2&&0===U&&3&le&&!Pe)a[u++]=255&this.readCorner2(Y,le),w-=2,U+=2,Pe=!0;else if(w!==Y+4||2!==U||7&le||Ge)if(w!==Y-2||0!==U||4!=(7&le)||dt){do{w=0&&!this.readMappingMatrix.get(U,w)&&(a[u++]=255&this.readUtah(w,U,Y,le)),w-=2,U+=2}while(w>=0&&U=0&&U=0);w+=3,U+=1}else a[u++]=255&this.readCorner4(Y,le),w-=2,U+=2,dt=!0;else a[u++]=255&this.readCorner3(Y,le),w-=2,U+=2,Ge=!0;else a[u++]=255&this.readCorner1(Y,le),w-=2,U+=2,ge=!0}while(w=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const wc=function(){function v(a,u){this.numDataCodewords=a,this.codewords=u}return v.getDataBlocks=function(a,u){var w,U,Y,le,ge=u.getECBlocks(),Pe=0,Ge=ge.getECBlocks();try{for(var dt=zw(Ge),_t=dt.next();!_t.done;_t=dt.next())Pe+=(Ot=_t.value).getCount()}catch(bd){w={error:bd}}finally{try{_t&&!_t.done&&(U=dt.return)&&U.call(dt)}finally{if(w)throw w.error}}var Ht=new Array(Pe),Sr=0;try{for(var Ur=zw(Ge),Zr=Ur.next();!Zr.done;Zr=Ur.next())for(var Ot=Zr.value,dn=0;dn7?dn-1:dn]=a[Ki++]}if(Ki!==a.length)throw new ki;return Ht},v.prototype.getNumDataCodewords=function(){return this.numDataCodewords},v.prototype.getCodewords=function(){return this.codewords},v}(),Zg=function(){function v(a){this.bytes=a,this.byteOffset=0,this.bitOffset=0}return v.prototype.getBitOffset=function(){return this.bitOffset},v.prototype.getByteOffset=function(){return this.byteOffset},v.prototype.readBits=function(a){if(a<1||a>32||a>this.available())throw new ki(""+a);var u=0,w=this.bitOffset,U=this.byteOffset,Y=this.bytes;if(w>0){var le=8-w,ge=a>8-ge<<(Pe=le-ge))>>Pe,a-=ge,8===(w+=ge)&&(w=0,U++)}if(a>0){for(;a>=8;)u=u<<8|255&Y[U],U++,a-=8;var Pe;a>0&&(u=u<>(Pe=8-a)<>Pe,w+=a)}return this.bitOffset=w,this.byteOffset=U,u},v.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},v}();var Ga=function(v){return v[v.PAD_ENCODE=0]="PAD_ENCODE",v[v.ASCII_ENCODE=1]="ASCII_ENCODE",v[v.C40_ENCODE=2]="C40_ENCODE",v[v.TEXT_ENCODE=3]="TEXT_ENCODE",v[v.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",v[v.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",v[v.BASE256_ENCODE=6]="BASE256_ENCODE",v}(Ga||{});const Eh=function(){function v(){}return v.decode=function(a){var u=new Zg(a),w=new jr,U=new jr,Y=new Array,le=Ga.ASCII_ENCODE;do{if(le===Ga.ASCII_ENCODE)le=this.decodeAsciiSegment(u,w,U);else{switch(le){case Ga.C40_ENCODE:this.decodeC40Segment(u,w);break;case Ga.TEXT_ENCODE:this.decodeTextSegment(u,w);break;case Ga.ANSIX12_ENCODE:this.decodeAnsiX12Segment(u,w);break;case Ga.EDIFACT_ENCODE:this.decodeEdifactSegment(u,w);break;case Ga.BASE256_ENCODE:this.decodeBase256Segment(u,w,Y);break;default:throw new Qn}le=Ga.ASCII_ENCODE}}while(le!==Ga.PAD_ENCODE&&u.available()>0);return U.length()>0&&w.append(U.toString()),new qu(a,w.toString(),0===Y.length?null:Y,null)},v.decodeAsciiSegment=function(a,u,w){var U=!1;do{var Y=a.readBits(8);if(0===Y)throw new Qn;if(Y<=128)return U&&(Y+=128),u.append(String.fromCharCode(Y-1)),Ga.ASCII_ENCODE;if(129===Y)return Ga.PAD_ENCODE;if(Y<=229){var le=Y-130;le<10&&u.append("0"),u.append(""+le)}else switch(Y){case 230:return Ga.C40_ENCODE;case 231:return Ga.BASE256_ENCODE;case 232:u.append("\x1d");break;case 233:case 234:case 241:break;case 235:U=!0;break;case 236:u.append("[)>\x1e05\x1d"),w.insert(0,"\x1e\x04");break;case 237:u.append("[)>\x1e06\x1d"),w.insert(0,"\x1e\x04");break;case 238:return Ga.ANSIX12_ENCODE;case 239:return Ga.TEXT_ENCODE;case 240:return Ga.EDIFACT_ENCODE;default:if(254!==Y||0!==a.available())throw new Qn}}while(a.available()>0);return Ga.ASCII_ENCODE},v.decodeC40Segment=function(a,u){var w=!1,U=[],Y=0;do{if(8===a.available())return;var le=a.readBits(8);if(254===le)return;this.parseTwoBytes(le,a.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(Y){case 0:if(Pe<3)Y=Pe+1;else{if(!(Pe0)},v.decodeTextSegment=function(a,u){var w=!1,U=[],Y=0;do{if(8===a.available())return;var le=a.readBits(8);if(254===le)return;this.parseTwoBytes(le,a.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(Y){case 0:if(Pe<3)Y=Pe+1;else{if(!(Pe0)},v.decodeAnsiX12Segment=function(a,u){var w=[];do{if(8===a.available())return;var U=a.readBits(8);if(254===U)return;this.parseTwoBytes(U,a.readBits(8),w);for(var Y=0;Y<3;Y++){var le=w[Y];switch(le){case 0:u.append("\r");break;case 1:u.append("*");break;case 2:u.append(">");break;case 3:u.append(" ");break;default:if(le<14)u.append(String.fromCharCode(le+44));else{if(!(le<40))throw new Qn;u.append(String.fromCharCode(le+51))}}}}while(a.available()>0)},v.parseTwoBytes=function(a,u,w){var U=(a<<8)+u-1,Y=Math.floor(U/1600);w[0]=Y,U-=1600*Y,Y=Math.floor(U/40),w[1]=Y,w[2]=U-40*Y},v.decodeEdifactSegment=function(a,u){do{if(a.available()<=16)return;for(var w=0;w<4;w++){var U=a.readBits(6);if(31===U){var Y=8-a.getBitOffset();return void(8!==Y&&a.readBits(Y))}32&U||(U|=64),u.append(String.fromCharCode(U))}}while(a.available()>0)},v.decodeBase256Segment=function(a,u,w){var le,U=1+a.getByteOffset(),Y=this.unrandomize255State(a.readBits(8),U++);if((le=0===Y?a.available()/8|0:Y<250?Y:250*(Y-249)+this.unrandomize255State(a.readBits(8),U++))<0)throw new Qn;for(var ge=new Uint8Array(le),Pe=0;Pe=0?U:U+256},v.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],v.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],v.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],v.TEXT_SHIFT2_SET_CHARS=v.C40_SHIFT2_SET_CHARS,v.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","\x7f"],v}(),Yg=function(){function v(){this.rsDecoder=new xc(Pa.DATA_MATRIX_FIELD_256)}return v.prototype.decode=function(a){var u,w,U=new Wc(a),Y=U.getVersion(),le=U.readCodewords(),ge=wc.getDataBlocks(le,Y),Pe=0;try{for(var Ge=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge),dt=Ge.next();!dt.done;dt=Ge.next())Pe+=dt.value.getNumDataCodewords()}catch(Tn){u={error:Tn}}finally{try{dt&&!dt.done&&(w=Ge.return)&&w.call(Ge)}finally{if(u)throw u.error}}for(var Ot=new Uint8Array(Pe),Ht=ge.length,Sr=0;Srge&&(dt=ge,_t[0]=u,_t[1]=w,_t[2]=U,_t[3]=Y),dt>Pe&&(dt=Pe,_t[0]=w,_t[1]=U,_t[2]=Y,_t[3]=u),dt>Ge&&(_t[0]=U,_t[1]=Y,_t[2]=u,_t[3]=w),_t},v.prototype.detectSolid2=function(a){var u=a[0],w=a[1],U=a[2],Y=a[3],le=this.transitionsBetween(u,Y),ge=v.shiftPoint(w,U,4*(le+1)),Pe=v.shiftPoint(U,w,4*(le+1));return this.transitionsBetween(ge,u)this.transitionsBetween(Pe,_t)+this.transitionsBetween(Ge,_t)?dt:_t:dt:this.isValid(_t)?_t:null},v.prototype.shiftToModuleCenter=function(a){var u=a[0],w=a[1],U=a[2],Y=a[3],le=this.transitionsBetween(u,Y)+1,ge=this.transitionsBetween(U,Y)+1,Pe=v.shiftPoint(u,w,4*ge),Ge=v.shiftPoint(U,w,4*le);!(1&~(le=this.transitionsBetween(Pe,Y)+1))&&(le+=1),!(1&~(ge=this.transitionsBetween(Ge,Y)+1))&&(ge+=1);var Ot,Ht,dt=(u.getX()+w.getX()+U.getX()+Y.getX())/4,_t=(u.getY()+w.getY()+U.getY()+Y.getY())/4;return u=v.moveAway(u,dt,_t),w=v.moveAway(w,dt,_t),U=v.moveAway(U,dt,_t),Y=v.moveAway(Y,dt,_t),Pe=v.shiftPoint(u,w,4*ge),Pe=v.shiftPoint(Pe,Y,4*le),Ot=v.shiftPoint(w,u,4*ge),Ot=v.shiftPoint(Ot,U,4*le),Ge=v.shiftPoint(U,Y,4*ge),Ge=v.shiftPoint(Ge,w,4*le),Ht=v.shiftPoint(Y,U,4*ge),[Pe,Ot,Ge,Ht=v.shiftPoint(Ht,u,4*le)]},v.prototype.isValid=function(a){return a.getX()>=0&&a.getX()0&&a.getY()Math.abs(Y-w);if(ge){var Pe=w;w=U,U=Pe,Pe=Y,Y=le,le=Pe}for(var Ge=Math.abs(Y-w),dt=Math.abs(le-U),_t=-Ge/2,Ot=U0){if(dn===le)break;dn+=Ot,_t-=Ge}}return Sr},v}(),y0=function(){function v(){this.decoder=new Yg}return v.prototype.decode=function(a,u){var w,U;if(void 0===u&&(u=null),null!=u&&u.has(Di.PURE_BARCODE)){var Y=v.extractPureBits(a.getBlackMatrix());w=this.decoder.decode(Y),U=v.NO_POINTS}else{var le=new Kw(a.getBlackMatrix()).detect();w=this.decoder.decode(le.getBits()),U=le.getPoints()}var ge=w.getRawBytes(),Pe=new Cs(w.getText(),ge,8*ge.length,U,Do.DATA_MATRIX,Rt.currentTimeMillis()),Ge=w.getByteSegments();null!=Ge&&Pe.putMetadata(gc.BYTE_SEGMENTS,Ge);var dt=w.getECLevel();return null!=dt&&Pe.putMetadata(gc.ERROR_CORRECTION_LEVEL,dt),Pe},v.prototype.reset=function(){},v.extractPureBits=function(a){var u=a.getTopLeftOnBit(),w=a.getBottomRightOnBit();if(null==u||null==w)throw new Wn;var U=this.moduleSize(u,a),Y=u[1],ge=u[0],Ge=(w[0]-ge+1)/U,dt=(w[1]-Y+1)/U;if(Ge<=0||dt<=0)throw new Wn;var _t=U/2;Y+=_t,ge+=_t;for(var Ot=new Qi(Ge,dt),Ht=0;Ht=v.FOR_BITS.size)throw new ki;return v.FOR_BITS.get(a)},v.FOR_BITS=new Map,v.FOR_VALUE=new Map,v.L=new v(xh.L,"L",1),v.M=new v(xh.M,"M",0),v.Q=new v(xh.Q,"Q",3),v.H=new v(xh.H,"H",2),v}(),Uc=function(){function v(a){this.errorCorrectionLevel=Al.forBits(a>>3&3),this.dataMask=7&a}return v.numBitsDiffering=function(a,u){return pi.bitCount(a^u)},v.decodeFormatInformation=function(a,u){var w=v.doDecodeFormatInformation(a,u);return null!==w?w:v.doDecodeFormatInformation(a^v.FORMAT_INFO_MASK_QR,u^v.FORMAT_INFO_MASK_QR)},v.doDecodeFormatInformation=function(a,u){var w,U,Y=Number.MAX_SAFE_INTEGER,le=0;try{for(var ge=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(v.FORMAT_INFO_DECODE_LOOKUP),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,dt=Ge[0];if(dt===a||dt===u)return new v(Ge[1]);var _t=v.numBitsDiffering(a,dt);_t=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),le=Y.next();!le.done;le=Y.next())w+=le.value.getCount()}catch(Pe){a={error:Pe}}finally{try{le&&!le.done&&(u=Y.return)&&u.call(Y)}finally{if(a)throw a.error}}return w},v.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},v.prototype.getECBlocks=function(){return this.ecBlocks},v}(),Vr=function(){function v(a,u){this.count=a,this.dataCodewords=u}return v.prototype.getCount=function(){return this.count},v.prototype.getDataCodewords=function(){return this.dataCodewords},v}(),Xh=function(){function v(a,u){for(var w,U,Y=[],le=2;le=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;ge+=Ot.getCount()*(Ot.getDataCodewords()+Pe)}}catch(Ht){w={error:Ht}}finally{try{_t&&!_t.done&&(U=dt.return)&&U.call(dt)}finally{if(w)throw w.error}}this.totalCodewords=ge}return v.prototype.getVersionNumber=function(){return this.versionNumber},v.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},v.prototype.getTotalCodewords=function(){return this.totalCodewords},v.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},v.prototype.getECBlocksForLevel=function(a){return this.ecBlocks[a.getValue()]},v.getProvisionalVersionForDimension=function(a){if(a%4!=1)throw new Qn;try{return this.getVersionForNumber((a-17)/4)}catch{throw new Qn}},v.getVersionForNumber=function(a){if(a<1||a>40)throw new ki;return v.VERSIONS[a-1]},v.decodeVersionInformation=function(a){for(var u=Number.MAX_SAFE_INTEGER,w=0,U=0;U6&&(u.setRegion(a-11,0,3,6),u.setRegion(0,a-11,6,3)),u},v.prototype.toString=function(){return""+this.versionNumber},v.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),v.VERSIONS=[new v(1,new Int32Array(0),new Mn(7,new Vr(1,19)),new Mn(10,new Vr(1,16)),new Mn(13,new Vr(1,13)),new Mn(17,new Vr(1,9))),new v(2,Int32Array.from([6,18]),new Mn(10,new Vr(1,34)),new Mn(16,new Vr(1,28)),new Mn(22,new Vr(1,22)),new Mn(28,new Vr(1,16))),new v(3,Int32Array.from([6,22]),new Mn(15,new Vr(1,55)),new Mn(26,new Vr(1,44)),new Mn(18,new Vr(2,17)),new Mn(22,new Vr(2,13))),new v(4,Int32Array.from([6,26]),new Mn(20,new Vr(1,80)),new Mn(18,new Vr(2,32)),new Mn(26,new Vr(2,24)),new Mn(16,new Vr(4,9))),new v(5,Int32Array.from([6,30]),new Mn(26,new Vr(1,108)),new Mn(24,new Vr(2,43)),new Mn(18,new Vr(2,15),new Vr(2,16)),new Mn(22,new Vr(2,11),new Vr(2,12))),new v(6,Int32Array.from([6,34]),new Mn(18,new Vr(2,68)),new Mn(16,new Vr(4,27)),new Mn(24,new Vr(4,19)),new Mn(28,new Vr(4,15))),new v(7,Int32Array.from([6,22,38]),new Mn(20,new Vr(2,78)),new Mn(18,new Vr(4,31)),new Mn(18,new Vr(2,14),new Vr(4,15)),new Mn(26,new Vr(4,13),new Vr(1,14))),new v(8,Int32Array.from([6,24,42]),new Mn(24,new Vr(2,97)),new Mn(22,new Vr(2,38),new Vr(2,39)),new Mn(22,new Vr(4,18),new Vr(2,19)),new Mn(26,new Vr(4,14),new Vr(2,15))),new v(9,Int32Array.from([6,26,46]),new Mn(30,new Vr(2,116)),new Mn(22,new Vr(3,36),new Vr(2,37)),new Mn(20,new Vr(4,16),new Vr(4,17)),new Mn(24,new Vr(4,12),new Vr(4,13))),new v(10,Int32Array.from([6,28,50]),new Mn(18,new Vr(2,68),new Vr(2,69)),new Mn(26,new Vr(4,43),new Vr(1,44)),new Mn(24,new Vr(6,19),new Vr(2,20)),new Mn(28,new Vr(6,15),new Vr(2,16))),new v(11,Int32Array.from([6,30,54]),new Mn(20,new Vr(4,81)),new Mn(30,new Vr(1,50),new Vr(4,51)),new Mn(28,new Vr(4,22),new Vr(4,23)),new Mn(24,new Vr(3,12),new Vr(8,13))),new v(12,Int32Array.from([6,32,58]),new Mn(24,new Vr(2,92),new Vr(2,93)),new Mn(22,new Vr(6,36),new Vr(2,37)),new Mn(26,new Vr(4,20),new Vr(6,21)),new Mn(28,new Vr(7,14),new Vr(4,15))),new v(13,Int32Array.from([6,34,62]),new Mn(26,new Vr(4,107)),new Mn(22,new Vr(8,37),new Vr(1,38)),new Mn(24,new Vr(8,20),new Vr(4,21)),new Mn(22,new Vr(12,11),new Vr(4,12))),new v(14,Int32Array.from([6,26,46,66]),new Mn(30,new Vr(3,115),new Vr(1,116)),new Mn(24,new Vr(4,40),new Vr(5,41)),new Mn(20,new Vr(11,16),new Vr(5,17)),new Mn(24,new Vr(11,12),new Vr(5,13))),new v(15,Int32Array.from([6,26,48,70]),new Mn(22,new Vr(5,87),new Vr(1,88)),new Mn(24,new Vr(5,41),new Vr(5,42)),new Mn(30,new Vr(5,24),new Vr(7,25)),new Mn(24,new Vr(11,12),new Vr(7,13))),new v(16,Int32Array.from([6,26,50,74]),new Mn(24,new Vr(5,98),new Vr(1,99)),new Mn(28,new Vr(7,45),new Vr(3,46)),new Mn(24,new Vr(15,19),new Vr(2,20)),new Mn(30,new Vr(3,15),new Vr(13,16))),new v(17,Int32Array.from([6,30,54,78]),new Mn(28,new Vr(1,107),new Vr(5,108)),new Mn(28,new Vr(10,46),new Vr(1,47)),new Mn(28,new Vr(1,22),new Vr(15,23)),new Mn(28,new Vr(2,14),new Vr(17,15))),new v(18,Int32Array.from([6,30,56,82]),new Mn(30,new Vr(5,120),new Vr(1,121)),new Mn(26,new Vr(9,43),new Vr(4,44)),new Mn(28,new Vr(17,22),new Vr(1,23)),new Mn(28,new Vr(2,14),new Vr(19,15))),new v(19,Int32Array.from([6,30,58,86]),new Mn(28,new Vr(3,113),new Vr(4,114)),new Mn(26,new Vr(3,44),new Vr(11,45)),new Mn(26,new Vr(17,21),new Vr(4,22)),new Mn(26,new Vr(9,13),new Vr(16,14))),new v(20,Int32Array.from([6,34,62,90]),new Mn(28,new Vr(3,107),new Vr(5,108)),new Mn(26,new Vr(3,41),new Vr(13,42)),new Mn(30,new Vr(15,24),new Vr(5,25)),new Mn(28,new Vr(15,15),new Vr(10,16))),new v(21,Int32Array.from([6,28,50,72,94]),new Mn(28,new Vr(4,116),new Vr(4,117)),new Mn(26,new Vr(17,42)),new Mn(28,new Vr(17,22),new Vr(6,23)),new Mn(30,new Vr(19,16),new Vr(6,17))),new v(22,Int32Array.from([6,26,50,74,98]),new Mn(28,new Vr(2,111),new Vr(7,112)),new Mn(28,new Vr(17,46)),new Mn(30,new Vr(7,24),new Vr(16,25)),new Mn(24,new Vr(34,13))),new v(23,Int32Array.from([6,30,54,78,102]),new Mn(30,new Vr(4,121),new Vr(5,122)),new Mn(28,new Vr(4,47),new Vr(14,48)),new Mn(30,new Vr(11,24),new Vr(14,25)),new Mn(30,new Vr(16,15),new Vr(14,16))),new v(24,Int32Array.from([6,28,54,80,106]),new Mn(30,new Vr(6,117),new Vr(4,118)),new Mn(28,new Vr(6,45),new Vr(14,46)),new Mn(30,new Vr(11,24),new Vr(16,25)),new Mn(30,new Vr(30,16),new Vr(2,17))),new v(25,Int32Array.from([6,32,58,84,110]),new Mn(26,new Vr(8,106),new Vr(4,107)),new Mn(28,new Vr(8,47),new Vr(13,48)),new Mn(30,new Vr(7,24),new Vr(22,25)),new Mn(30,new Vr(22,15),new Vr(13,16))),new v(26,Int32Array.from([6,30,58,86,114]),new Mn(28,new Vr(10,114),new Vr(2,115)),new Mn(28,new Vr(19,46),new Vr(4,47)),new Mn(28,new Vr(28,22),new Vr(6,23)),new Mn(30,new Vr(33,16),new Vr(4,17))),new v(27,Int32Array.from([6,34,62,90,118]),new Mn(30,new Vr(8,122),new Vr(4,123)),new Mn(28,new Vr(22,45),new Vr(3,46)),new Mn(30,new Vr(8,23),new Vr(26,24)),new Mn(30,new Vr(12,15),new Vr(28,16))),new v(28,Int32Array.from([6,26,50,74,98,122]),new Mn(30,new Vr(3,117),new Vr(10,118)),new Mn(28,new Vr(3,45),new Vr(23,46)),new Mn(30,new Vr(4,24),new Vr(31,25)),new Mn(30,new Vr(11,15),new Vr(31,16))),new v(29,Int32Array.from([6,30,54,78,102,126]),new Mn(30,new Vr(7,116),new Vr(7,117)),new Mn(28,new Vr(21,45),new Vr(7,46)),new Mn(30,new Vr(1,23),new Vr(37,24)),new Mn(30,new Vr(19,15),new Vr(26,16))),new v(30,Int32Array.from([6,26,52,78,104,130]),new Mn(30,new Vr(5,115),new Vr(10,116)),new Mn(28,new Vr(19,47),new Vr(10,48)),new Mn(30,new Vr(15,24),new Vr(25,25)),new Mn(30,new Vr(23,15),new Vr(25,16))),new v(31,Int32Array.from([6,30,56,82,108,134]),new Mn(30,new Vr(13,115),new Vr(3,116)),new Mn(28,new Vr(2,46),new Vr(29,47)),new Mn(30,new Vr(42,24),new Vr(1,25)),new Mn(30,new Vr(23,15),new Vr(28,16))),new v(32,Int32Array.from([6,34,60,86,112,138]),new Mn(30,new Vr(17,115)),new Mn(28,new Vr(10,46),new Vr(23,47)),new Mn(30,new Vr(10,24),new Vr(35,25)),new Mn(30,new Vr(19,15),new Vr(35,16))),new v(33,Int32Array.from([6,30,58,86,114,142]),new Mn(30,new Vr(17,115),new Vr(1,116)),new Mn(28,new Vr(14,46),new Vr(21,47)),new Mn(30,new Vr(29,24),new Vr(19,25)),new Mn(30,new Vr(11,15),new Vr(46,16))),new v(34,Int32Array.from([6,34,62,90,118,146]),new Mn(30,new Vr(13,115),new Vr(6,116)),new Mn(28,new Vr(14,46),new Vr(23,47)),new Mn(30,new Vr(44,24),new Vr(7,25)),new Mn(30,new Vr(59,16),new Vr(1,17))),new v(35,Int32Array.from([6,30,54,78,102,126,150]),new Mn(30,new Vr(12,121),new Vr(7,122)),new Mn(28,new Vr(12,47),new Vr(26,48)),new Mn(30,new Vr(39,24),new Vr(14,25)),new Mn(30,new Vr(22,15),new Vr(41,16))),new v(36,Int32Array.from([6,24,50,76,102,128,154]),new Mn(30,new Vr(6,121),new Vr(14,122)),new Mn(28,new Vr(6,47),new Vr(34,48)),new Mn(30,new Vr(46,24),new Vr(10,25)),new Mn(30,new Vr(2,15),new Vr(64,16))),new v(37,Int32Array.from([6,28,54,80,106,132,158]),new Mn(30,new Vr(17,122),new Vr(4,123)),new Mn(28,new Vr(29,46),new Vr(14,47)),new Mn(30,new Vr(49,24),new Vr(10,25)),new Mn(30,new Vr(24,15),new Vr(46,16))),new v(38,Int32Array.from([6,32,58,84,110,136,162]),new Mn(30,new Vr(4,122),new Vr(18,123)),new Mn(28,new Vr(13,46),new Vr(32,47)),new Mn(30,new Vr(48,24),new Vr(14,25)),new Mn(30,new Vr(42,15),new Vr(32,16))),new v(39,Int32Array.from([6,26,54,82,110,138,166]),new Mn(30,new Vr(20,117),new Vr(4,118)),new Mn(28,new Vr(40,47),new Vr(7,48)),new Mn(30,new Vr(43,24),new Vr(22,25)),new Mn(30,new Vr(10,15),new Vr(67,16))),new v(40,Int32Array.from([6,30,58,86,114,142,170]),new Mn(30,new Vr(19,118),new Vr(6,119)),new Mn(28,new Vr(18,47),new Vr(31,48)),new Mn(30,new Vr(34,24),new Vr(34,25)),new Mn(30,new Vr(20,15),new Vr(61,16)))],v}();var Oa=function(v){return v[v.DATA_MASK_000=0]="DATA_MASK_000",v[v.DATA_MASK_001=1]="DATA_MASK_001",v[v.DATA_MASK_010=2]="DATA_MASK_010",v[v.DATA_MASK_011=3]="DATA_MASK_011",v[v.DATA_MASK_100=4]="DATA_MASK_100",v[v.DATA_MASK_101=5]="DATA_MASK_101",v[v.DATA_MASK_110=6]="DATA_MASK_110",v[v.DATA_MASK_111=7]="DATA_MASK_111",v}(Oa||{});const au=function(){function v(a,u){this.value=a,this.isMasked=u}return v.prototype.unmaskBitMatrix=function(a,u){for(var w=0;w=0;w--)a=this.copyBit(8,w,a);var U=this.bitMatrix.getHeight(),Y=0,le=U-7;for(w=U-1;w>=le;w--)Y=this.copyBit(8,w,Y);for(u=U-8;u=0;Y--)for(var le=a-9;le>=U;le--)w=this.copyBit(le,Y,w);var ge=Xh.decodeVersionInformation(w);if(null!==ge&&ge.getDimensionForVersion()===a)return this.parsedVersion=ge,ge;for(w=0,le=5;le>=0;le--)for(Y=a-9;Y>=U;Y--)w=this.copyBit(le,Y,w);if(null!==(ge=Xh.decodeVersionInformation(w))&&ge.getDimensionForVersion()===a)return this.parsedVersion=ge,ge;throw new Qn},v.prototype.copyBit=function(a,u,w){return(this.isMirror?this.bitMatrix.get(u,a):this.bitMatrix.get(a,u))?w<<1|1:w<<1},v.prototype.readCodewords=function(){var a=this.readFormatInformation(),u=this.readVersion(),w=au.values.get(a.getDataMask()),U=this.bitMatrix.getHeight();w.unmaskBitMatrix(this.bitMatrix,U);for(var Y=u.buildFunctionPattern(),le=!0,ge=new Uint8Array(u.getTotalCodewords()),Pe=0,Ge=0,dt=0,_t=U-1;_t>0;_t-=2){6===_t&&_t--;for(var Ot=0;Ot=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Gw=function(){function v(a,u){this.numDataCodewords=a,this.codewords=u}return v.getDataBlocks=function(a,u,w){var U,Y,le,ge;if(a.length!==u.getTotalCodewords())throw new ki;var Pe=u.getECBlocksForLevel(w),Ge=0,dt=Pe.getECBlocks();try{for(var _t=s1(dt),Ot=_t.next();!Ot.done;Ot=_t.next())Ge+=(Ht=Ot.value).getCount()}catch(Xc){U={error:Xc}}finally{try{Ot&&!Ot.done&&(Y=_t.return)&&Y.call(_t)}finally{if(U)throw U.error}}var Sr=new Array(Ge),Ur=0;try{for(var Zr=s1(dt),dn=Zr.next();!dn.done;dn=Zr.next())for(var Ht=dn.value,ln=0;ln=0&&Sr[Bi].codewords.length!==yi;)Bi--;Bi++;var po=yi-Pe.getECCodewordsPerBlock(),gs=0;for(ln=0;lna.available())throw new Qn;for(var U=new Uint8Array(2*w),Y=0;w>0;){var le=a.readBits(13),ge=le/96<<8&4294967295|le%96;U[Y]=(ge+=ge<959?41377:42657)>>8&255,U[Y+1]=255&ge,Y+=2,w--}try{u.append(Wt.decode(U,bt.GB2312))}catch(Pe){throw new Qn(Pe)}},v.decodeKanjiSegment=function(a,u,w){if(13*w>a.available())throw new Qn;for(var U=new Uint8Array(2*w),Y=0;w>0;){var le=a.readBits(13),ge=le/192<<8&4294967295|le%192;U[Y]=(ge+=ge<7936?33088:49472)>>8,U[Y+1]=ge,Y+=2,w--}try{u.append(Wt.decode(U,bt.SHIFT_JIS))}catch(Pe){throw new Qn(Pe)}},v.decodeByteSegment=function(a,u,w,U,Y,le){if(8*w>a.available())throw new Qn;for(var ge=new Uint8Array(w),Pe=0;Pe=v.ALPHANUMERIC_CHARS.length)throw new Qn;return v.ALPHANUMERIC_CHARS[a]},v.decodeAlphanumericSegment=function(a,u,w,U){for(var Y=u.length();w>1;){if(a.available()<11)throw new Qn;var le=a.readBits(11);u.append(v.toAlphaNumericChar(Math.floor(le/45))),u.append(v.toAlphaNumericChar(le%45)),w-=2}if(1===w){if(a.available()<6)throw new Qn;u.append(v.toAlphaNumericChar(a.readBits(6)))}if(U)for(var ge=Y;ge=3;){if(a.available()<10)throw new Qn;var U=a.readBits(10);if(U>=1e3)throw new Qn;u.append(v.toAlphaNumericChar(Math.floor(U/100))),u.append(v.toAlphaNumericChar(Math.floor(U/10)%10)),u.append(v.toAlphaNumericChar(U%10)),w-=3}if(2===w){if(a.available()<7)throw new Qn;var Y=a.readBits(7);if(Y>=100)throw new Qn;u.append(v.toAlphaNumericChar(Math.floor(Y/10))),u.append(v.toAlphaNumericChar(Y%10))}else if(1===w){if(a.available()<4)throw new Qn;var le=a.readBits(4);if(le>=10)throw new Qn;u.append(v.toAlphaNumericChar(le))}},v.parseECIValue=function(a){var u=a.readBits(8);if(!(128&u))return 127&u;if(128==(192&u))return(63&u)<<8&4294967295|a.readBits(8);if(192==(224&u))return(31&u)<<16&4294967295|a.readBits(16);throw new Qn},v.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",v.GB2312_SUBSET=1,v}(),c1=function(){function v(a){this.mirrored=a}return v.prototype.isMirrored=function(){return this.mirrored},v.prototype.applyMirroredCorrection=function(a){if(this.mirrored&&null!==a&&!(a.length<3)){var u=a[0];a[0]=a[2],a[2]=u}},v}();var cx=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ux=function(){function v(){this.rsDecoder=new xc(Pa.QR_CODE_FIELD_256)}return v.prototype.decodeBooleanArray=function(a,u){return this.decodeBitMatrix(Qi.parseFromBooleanArray(a),u)},v.prototype.decodeBitMatrix=function(a,u){var w=new Sh(a),U=null;try{return this.decodeBitMatrixParser(w,u)}catch(le){U=le}try{w.remask(),w.setMirror(!0),w.readVersion(),w.readFormatInformation(),w.mirror();var Y=this.decodeBitMatrixParser(w,u);return Y.setOther(new c1(!0)),Y}catch(le){throw null!==U?U:le}},v.prototype.decodeBitMatrixParser=function(a,u){var w,U,Y,le,ge=a.readVersion(),Pe=a.readFormatInformation().getErrorCorrectionLevel(),Ge=a.readCodewords(),dt=Gw.getDataBlocks(Ge,ge,Pe),_t=0;try{for(var Ot=cx(dt),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t+=(Sr=Ht.value).getNumDataCodewords()}catch(Bi){w={error:Bi}}finally{try{Ht&&!Ht.done&&(U=Ot.return)&&U.call(Ot)}finally{if(w)throw w.error}}var Ur=new Uint8Array(_t),Zr=0;try{for(var dn=cx(dt),ln=dn.next();!ln.done;ln=dn.next()){var Sr,Tn=(Sr=ln.value).getCodewords(),Gn=Sr.getNumDataCodewords();this.correctErrors(Tn,Gn);for(var yi=0;yi=w)return!1;return!0},v.prototype.crossCheckVertical=function(a,u,w,U){var Y=this.image,le=Y.getHeight(),ge=this.crossCheckStateCount;ge[0]=0,ge[1]=0,ge[2]=0;for(var Pe=a;Pe>=0&&Y.get(u,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&!Y.get(u,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=a+1;Pew)return NaN;for(;Pew||5*Math.abs(ge[0]+ge[1]+ge[2]-U)>=2*U?NaN:this.foundPatternCross(ge)?v.centerFromEnd(ge,Pe):NaN},v.prototype.handlePossibleCenter=function(a,u,w){var U,Y,le=a[0]+a[1]+a[2],ge=v.centerFromEnd(a,w),Pe=this.crossCheckVertical(u,ge,2*a[1],le);if(!isNaN(Pe)){var Ge=(a[0]+a[1]+a[2])/3;try{for(var dt=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;if(Ot.aboutEquals(Ge,Pe,ge))return Ot.combineEstimate(Pe,ge,Ge)}}catch(Sr){U={error:Sr}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}var Ht=new $u(ge,Pe,Ge);this.possibleCenters.push(Ht),null!=this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(Ht)}return null},v}();var gd=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const w0=function(v){function a(u,w,U,Y){var le=v.call(this,u,w)||this;return le.estimatedModuleSize=U,le.count=Y,void 0===Y&&(le.count=1),le}return gd(a,v),a.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},a.prototype.getCount=function(){return this.count},a.prototype.aboutEquals=function(u,w,U){if(Math.abs(w-this.getY())<=u&&Math.abs(U-this.getX())<=u){var Y=Math.abs(u-this.estimatedModuleSize);return Y<=1||Y<=this.estimatedModuleSize}return!1},a.prototype.combineEstimate=function(u,w,U){var Y=this.count+1;return new a((this.count*this.getX()+w)/Y,(this.count*this.getY()+u)/Y,(this.count*this.estimatedModuleSize+U)/Y,Y)},a}(Eo),Jl=function(){function v(a){this.bottomLeft=a[0],this.topLeft=a[1],this.topRight=a[2]}return v.prototype.getBottomLeft=function(){return this.bottomLeft},v.prototype.getTopLeft=function(){return this.topLeft},v.prototype.getTopRight=function(){return this.topRight},v}();var ty=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const l1=function(){function v(a,u){this.image=a,this.resultPointCallback=u,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=u}return v.prototype.getImage=function(){return this.image},v.prototype.getPossibleCenters=function(){return this.possibleCenters},v.prototype.find=function(a){var u=null!=a&&void 0!==a.get(Di.TRY_HARDER),w=null!=a&&void 0!==a.get(Di.PURE_BARCODE),U=this.image,Y=U.getHeight(),le=U.getWidth(),ge=Math.floor(3*Y/(4*v.MAX_MODULES));(geGe[2]&&(dt+=Sr-Ge[2]-ge,Ot=le-1)}_t=0,Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0,Ge[4]=0}else Ge[0]=Ge[2],Ge[1]=Ge[3],Ge[2]=Ge[4],Ge[3]=1,Ge[4]=0,_t=3;else Ge[++_t]++;v.foundPatternCross(Ge)&&!0===this.handlePossibleCenter(Ge,dt,le,w)&&(ge=Ge[0],this.hasSkipped&&(Pe=this.haveMultiplyConfirmedCenters()))}var Ur=this.selectBestPatterns();return Eo.orderBestPatterns(Ur),new Jl(Ur)},v.centerFromEnd=function(a,u){return u-a[4]-a[3]-a[2]/2},v.foundPatternCross=function(a){for(var u=0,w=0;w<5;w++){var U=a[w];if(0===U)return!1;u+=U}if(u<7)return!1;var Y=u/7,le=Y/2;return Math.abs(Y-a[0])=le&&u>=le&&ge.get(u-le,a-le);)Y[2]++,le++;if(a=le&&u>=le&&!ge.get(u-le,a-le)&&Y[1]<=w;)Y[1]++,le++;if(aw)return!1;for(;a>=le&&u>=le&&ge.get(u-le,a-le)&&Y[0]<=w;)Y[0]++,le++;if(Y[0]>w)return!1;var Pe=ge.getHeight(),Ge=ge.getWidth();for(le=1;a+le=Pe||u+le>=Ge)return!1;for(;a+le=Pe||u+le>=Ge||Y[3]>=w)return!1;for(;a+le=w)&&Math.abs(Y[0]+Y[1]+Y[2]+Y[3]+Y[4]-U)<2*U&&v.foundPatternCross(Y)},v.prototype.crossCheckVertical=function(a,u,w,U){for(var Y=this.image,le=Y.getHeight(),ge=this.getCrossCheckStateCount(),Pe=a;Pe>=0&&Y.get(u,Pe);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!Y.get(u,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&Y.get(u,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=a+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=2*U?NaN:v.foundPatternCross(ge)?v.centerFromEnd(ge,Pe):NaN},v.prototype.crossCheckHorizontal=function(a,u,w,U){for(var Y=this.image,le=Y.getWidth(),ge=this.getCrossCheckStateCount(),Pe=a;Pe>=0&&Y.get(Pe,u);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!Y.get(Pe,u)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&Y.get(Pe,u)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=a+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=U?NaN:v.foundPatternCross(ge)?v.centerFromEnd(ge,Pe):NaN},v.prototype.handlePossibleCenter=function(a,u,w,U){var Y=a[0]+a[1]+a[2]+a[3]+a[4],le=v.centerFromEnd(a,w),ge=this.crossCheckVertical(u,Math.floor(le),a[2],Y);if(!isNaN(ge)&&(le=this.crossCheckHorizontal(Math.floor(le),Math.floor(ge),a[2],Y),!isNaN(le)&&(!U||this.crossCheckDiagonal(Math.floor(ge),Math.floor(le),a[2],Y)))){for(var Pe=Y/7,Ge=!1,dt=this.possibleCenters,_t=0,Ot=dt.length;_t=v.CENTER_QUORUM){if(null!=U)return this.hasSkipped=!0,Math.floor((Math.abs(U.getX()-ge.getX())-Math.abs(U.getY()-ge.getY()))/2);U=ge}}}catch(Pe){a={error:Pe}}finally{try{le&&!le.done&&(u=Y.return)&&u.call(Y)}finally{if(a)throw a.error}}return 0},v.prototype.haveMultiplyConfirmedCenters=function(){var a,u,w,U,Y=0,le=0,ge=this.possibleCenters.length;try{for(var Pe=ty(this.possibleCenters),Ge=Pe.next();!Ge.done;Ge=Pe.next())(dt=Ge.value).getCount()>=v.CENTER_QUORUM&&(Y++,le+=dt.getEstimatedModuleSize())}catch(Ur){a={error:Ur}}finally{try{Ge&&!Ge.done&&(u=Pe.return)&&u.call(Pe)}finally{if(a)throw a.error}}if(Y<3)return!1;var _t=le/ge,Ot=0;try{for(var Ht=ty(this.possibleCenters),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var dt=Sr.value;Ot+=Math.abs(dt.getEstimatedModuleSize()-_t)}}catch(Ur){w={error:Ur}}finally{try{Sr&&!Sr.done&&(U=Ht.return)&&U.call(Ht)}finally{if(w)throw w.error}}return Ot<=.05*le},v.prototype.selectBestPatterns=function(){var a,u,w,U,Y=this.possibleCenters.length;if(Y<3)throw new Wn;var ge,le=this.possibleCenters;if(Y>3){var Pe=0,Ge=0;try{for(var dt=ty(this.possibleCenters),_t=dt.next();!_t.done;_t=dt.next()){var Ht=_t.value.getEstimatedModuleSize();Pe+=Ht,Ge+=Ht*Ht}}catch(yi){a={error:yi}}finally{try{_t&&!_t.done&&(u=dt.return)&&u.call(dt)}finally{if(a)throw a.error}}ge=Pe/Y;var Sr=Math.sqrt(Ge/Y-ge*ge);le.sort(function(yi,Bi){var Ki=Math.abs(Bi.getEstimatedModuleSize()-ge),po=Math.abs(yi.getEstimatedModuleSize()-ge);return Kipo?1:0});for(var Ur=Math.max(.2*ge,Sr),Zr=0;Zr3;Zr++)Math.abs(le[Zr].getEstimatedModuleSize()-ge)>Ur&&(le.splice(Zr,1),Zr--)}if(le.length>3){Pe=0;try{for(var ln=ty(le),Tn=ln.next();!Tn.done;Tn=ln.next())Pe+=Tn.value.getEstimatedModuleSize()}catch(Bi){w={error:Bi}}finally{try{Tn&&!Tn.done&&(U=ln.return)&&U.call(ln)}finally{if(w)throw w.error}}ge=Pe/le.length,le.sort(function(Bi,Ki){if(Ki.getCount()===Bi.getCount()){var po=Math.abs(Ki.getEstimatedModuleSize()-ge),gs=Math.abs(Bi.getEstimatedModuleSize()-ge);return pogs?-1:0}return Ki.getCount()-Bi.getCount()}),le.splice(3)}return[le[0],le[1],le[2]]},v.CENTER_QUORUM=2,v.MIN_SKIP=3,v.MAX_MODULES=57,v}(),Sm=function(){function v(a){this.image=a}return v.prototype.getImage=function(){return this.image},v.prototype.getResultPointCallback=function(){return this.resultPointCallback},v.prototype.detect=function(a){this.resultPointCallback=null==a?null:a.get(Di.NEED_RESULT_POINT_CALLBACK);var w=new l1(this.image,this.resultPointCallback).find(a);return this.processFinderPatternInfo(w)},v.prototype.processFinderPatternInfo=function(a){var u=a.getTopLeft(),w=a.getTopRight(),U=a.getBottomLeft(),Y=this.calculateModuleSize(u,w,U);if(Y<1)throw new Wn("No pattern found in proccess finder.");var le=v.computeDimension(u,w,U,Y),ge=Xh.getProvisionalVersionForDimension(le),Pe=ge.getDimensionForVersion()-7,Ge=null;if(ge.getAlignmentPatternCenters().length>0)for(var dt=w.getX()-u.getX()+U.getX(),_t=w.getY()-u.getY()+U.getY(),Ot=1-3/Pe,Ht=Math.floor(u.getX()+Ot*(dt-u.getX())),Sr=Math.floor(u.getY()+Ot*(_t-u.getY())),Ur=4;Ur<=16;Ur<<=1)try{Ge=this.findAlignmentInRegion(Y,Ht,Sr,Ur);break}catch(Tn){if(!(Tn instanceof Wn))throw Tn}var Zr=v.createTransform(u,w,U,Ge,le),dn=v.sampleGrid(this.image,Zr,le);return new cr(dn,null===Ge?[U,u,w]:[U,u,w,Ge])},v.createTransform=function(a,u,w,U,Y){var ge,Pe,Ge,dt,le=Y-3.5;return null!==U?(ge=U.getX(),Pe=U.getY(),dt=Ge=le-3):(ge=u.getX()-a.getX()+w.getX(),Pe=u.getY()-a.getY()+w.getY(),Ge=le,dt=le),Fs.quadrilateralToQuadrilateral(3.5,3.5,le,3.5,Ge,dt,3.5,le,a.getX(),a.getY(),u.getX(),u.getY(),ge,Pe,w.getX(),w.getY())},v.sampleGrid=function(a,u,w){return vo.getInstance().sampleGridWithTransform(a,w,w,u)},v.computeDimension=function(a,u,w,U){var Y=Js.round(Eo.distance(a,u)/U),le=Js.round(Eo.distance(a,w)/U),ge=Math.floor((Y+le)/2)+7;switch(3&ge){case 0:ge++;break;case 2:ge--;break;case 3:throw new Wn("Dimensions could be not found.")}return ge},v.prototype.calculateModuleSize=function(a,u,w){return(this.calculateModuleSizeOneWay(a,u)+this.calculateModuleSizeOneWay(a,w))/2},v.prototype.calculateModuleSizeOneWay=function(a,u){var w=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(a.getX()),Math.floor(a.getY()),Math.floor(u.getX()),Math.floor(u.getY())),U=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(u.getX()),Math.floor(u.getY()),Math.floor(a.getX()),Math.floor(a.getY()));return isNaN(w)?U/7:isNaN(U)?w/7:(w+U)/14},v.prototype.sizeOfBlackWhiteBlackRunBothWays=function(a,u,w,U){var Y=this.sizeOfBlackWhiteBlackRun(a,u,w,U),le=1,ge=a-(w-a);ge<0?(le=a/(a-ge),ge=0):ge>=this.image.getWidth()&&(le=(this.image.getWidth()-1-a)/(ge-a),ge=this.image.getWidth()-1);var Pe=Math.floor(u-(U-u)*le);return le=1,Pe<0?(le=u/(u-Pe),Pe=0):Pe>=this.image.getHeight()&&(le=(this.image.getHeight()-1-u)/(Pe-u),Pe=this.image.getHeight()-1),ge=Math.floor(a+(ge-a)*le),(Y+=this.sizeOfBlackWhiteBlackRun(a,u,ge,Pe))-1},v.prototype.sizeOfBlackWhiteBlackRun=function(a,u,w,U){var Y=Math.abs(U-u)>Math.abs(w-a);if(Y){var le=a;a=u,u=le,le=w,w=U,U=le}for(var ge=Math.abs(w-a),Pe=Math.abs(U-u),Ge=-ge/2,dt=a0){if(Ur===U)break;Ur+=_t,Ge-=ge}}return 2===Ot?Js.distance(w+dt,U,a,u):NaN},v.prototype.findAlignmentInRegion=function(a,u,w,U){var Y=Math.floor(U*a),le=Math.max(0,u-Y),ge=Math.min(this.image.getWidth()-1,u+Y);if(ge-le<3*a)throw new Wn("Alignment top exceeds estimated module size.");var Pe=Math.max(0,w-Y),Ge=Math.min(this.image.getHeight()-1,w+Y);if(Ge-Pe<3*a)throw new Wn("Alignment bottom exceeds estimated module size.");return new Rp(this.image,le,Pe,ge-le,Ge-Pe,a,this.resultPointCallback).find()},v}(),u1=function(){function v(){this.decoder=new ux}return v.prototype.getDecoder=function(){return this.decoder},v.prototype.decode=function(a,u){var w,U;if(null!=u&&void 0!==u.get(Di.PURE_BARCODE)){var Y=v.extractPureBits(a.getBlackMatrix());w=this.decoder.decodeBitMatrix(Y,u),U=v.NO_POINTS}else{var le=new Sm(a.getBlackMatrix()).detect(u);w=this.decoder.decodeBitMatrix(le.getBits(),u),U=le.getPoints()}w.getOther()instanceof c1&&w.getOther().applyMirroredCorrection(U);var ge=new Cs(w.getText(),w.getRawBytes(),void 0,U,Do.QR_CODE,void 0),Pe=w.getByteSegments();null!==Pe&&ge.putMetadata(gc.BYTE_SEGMENTS,Pe);var Ge=w.getECLevel();return null!==Ge&&ge.putMetadata(gc.ERROR_CORRECTION_LEVEL,Ge),w.hasStructuredAppend()&&(ge.putMetadata(gc.STRUCTURED_APPEND_SEQUENCE,w.getStructuredAppendSequenceNumber()),ge.putMetadata(gc.STRUCTURED_APPEND_PARITY,w.getStructuredAppendParity())),ge},v.prototype.reset=function(){},v.extractPureBits=function(a){var u=a.getTopLeftOnBit(),w=a.getBottomRightOnBit();if(null===u||null===w)throw new Wn;var U=this.moduleSize(u,a),Y=u[1],le=w[1],ge=u[0],Pe=w[0];if(ge>=Pe||Y>=le)throw new Wn;if(le-Y!=Pe-ge&&(Pe=ge+(le-Y))>=a.getWidth())throw new Wn;var Ge=Math.round((Pe-ge+1)/U),dt=Math.round((le-Y+1)/U);if(Ge<=0||dt<=0)throw new Wn;if(dt!==Ge)throw new Wn;var _t=Math.floor(U/2);Y+=_t;var Ot=(ge+=_t)+Math.floor((Ge-1)*U)-Pe;if(Ot>0){if(Ot>_t)throw new Wn;ge-=Ot}var Ht=Y+Math.floor((dt-1)*U)-le;if(Ht>0){if(Ht>_t)throw new Wn;Y-=Ht}for(var Sr=new Qi(Ge,dt),Ur=0;Ur=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),ge=le.next();!ge.done;ge=le.next())U[Y++]=ge.value}catch(Ge){u={error:Ge}}finally{try{ge&&!ge.done&&(w=le.return)&&w.call(le)}finally{if(u)throw u.error}}return U},v.getCodeword=function(a){var u=Vi.binarySearch(v.SYMBOL_TABLE,262143&a);return u<0?-1:(v.CODEWORD_TABLE[u]-1)%v.NUMBER_OF_CODEWORDS},v.MAX_CODEWORDS_IN_BARCODE=(v.NUMBER_OF_CODEWORDS=929)-1,v.MIN_ROWS_IN_BARCODE=3,v.MAX_ROWS_IN_BARCODE=90,v.MODULES_IN_CODEWORD=17,v.MODULES_IN_STOP_PATTERN=18,v.BARS_IN_MODULE=8,v.EMPTY_INT_ARRAY=new Int32Array([]),v.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),v.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),v}(),fx=function(){function v(a,u){this.bits=a,this.points=u}return v.prototype.getBits=function(){return this.bits},v.prototype.getPoints=function(){return this.points},v}();var Yw=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ya=function(){function v(){}return v.detectMultiple=function(a,u,w){var U=a.getBlackMatrix(),Y=v.detect(w,U);return Y.length||((U=U.clone()).rotate180(),Y=v.detect(w,U)),new fx(U,Y)},v.detect=function(a,u){for(var w,U,Y=new Array,le=0,ge=0,Pe=!1;le0;){if(null==(_t=v.findGuardPattern(a,Y,--U,w,!1,le,Ge))){U++;break}dt=_t}ge[0]=new Eo(dt[0],U),ge[1]=new Eo(dt[1],U),Pe=!0;break}var Ot=U+1;if(Pe){for(var Ht=0,_t=Int32Array.from([Math.trunc(ge[0].getX()),Math.trunc(ge[1].getX())]);Otv.SKIPPED_ROW_COUNT_MAX)break;Ht++}}ge[2]=new Eo(_t[0],Ot-=Ht+1),ge[3]=new Eo(_t[1],Ot)}return Ot-U0&&Ge++Ot?_t-Ot:Ot-_t;if(Ht>w)return 1/0;Ge+=Ht}return Ge/Y},v.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),v.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),v.MAX_AVG_VARIANCE=.42,v.MAX_INDIVIDUAL_VARIANCE=.8,v.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),v.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),v.MAX_PIXEL_DRIFT=3,v.MAX_PATTERN_DRIFT=5,v.SKIPPED_ROW_COUNT_MAX=25,v.ROW_STEP=5,v.BARCODE_MIN_HEIGHT=10,v}(),kp=function(){function v(a,u){if(0===u.length)throw new ki;this.field=a;var w=u.length;if(w>1&&0===u[0]){for(var U=1;U=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),le=Y.next();!le.done;le=Y.next())U=this.field.add(U,le.value)}catch(_t){u={error:_t}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return U}for(var Pe=this.coefficients[0],Ge=this.coefficients.length,dt=1;dtw.length){var U=u;u=w,w=U}var Y=new Int32Array(w.length),le=w.length-u.length;Rt.arraycopy(w,0,Y,0,le);for(var ge=le;ge=0;u--){var w=this.getCoefficient(u);0!==w&&(w<0?(a.append(" - "),w=-w):a.length()>0&&a.append(" + "),(0===u||1!==w)&&a.append(w),0!==u&&(1===u?a.append("x"):(a.append("x^"),a.append(u))))}return a.toString()},v}(),ed=function(){function v(){}return v.prototype.add=function(a,u){return(a+u)%this.modulus},v.prototype.subtract=function(a,u){return(this.modulus+a-u)%this.modulus},v.prototype.exp=function(a){return this.expTable[a]},v.prototype.log=function(a){if(0===a)throw new ki;return this.logTable[a]},v.prototype.inverse=function(a){if(0===a)throw new Od;return this.expTable[this.modulus-this.logTable[a]-1]},v.prototype.multiply=function(a,u){return 0===a||0===u?0:this.expTable[(this.logTable[a]+this.logTable[u])%(this.modulus-1)]},v.prototype.getSize=function(){return this.modulus},v.prototype.equals=function(a){return a===this},v}();var e_=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Sa=function(v){function a(u,w){var U=v.call(this)||this;U.modulus=u,U.expTable=new Int32Array(u),U.logTable=new Int32Array(u);for(var Y=1,le=0;le0;Ge--){var dt=le.evaluateAt(this.field.exp(Ge));ge[u-Ge]=dt,0!==dt&&(Pe=!0)}if(!Pe)return 0;var _t=this.field.getOne();if(null!=w)try{for(var Ot=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(w),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var Ur=this.field.exp(a.length-1-Ht.value),Zr=new kp(this.field,new Int32Array([this.field.subtract(0,Ur),1]));_t=_t.multiply(Zr)}}catch(po){U={error:po}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}var dn=new kp(this.field,ge),ln=this.runEuclideanAlgorithm(this.field.buildMonomial(u,1),dn,u),Tn=ln[0],Gn=ln[1],yi=this.findErrorLocations(Tn),Bi=this.findErrorMagnitudes(Gn,Tn,yi);for(Ge=0;Ge=Math.round(w/2);){var Ge=Y,dt=ge;if(ge=Pe,(Y=le).isZero())throw rs.getChecksumInstance();le=Ge;for(var _t=this.field.getZero(),Ot=Y.getCoefficient(Y.getDegree()),Ht=this.field.inverse(Ot);le.getDegree()>=Y.getDegree()&&!le.isZero();){var Sr=le.getDegree()-Y.getDegree(),Ur=this.field.multiply(le.getCoefficient(le.getDegree()),Ht);_t=_t.add(this.field.buildMonomial(Sr,Ur)),le=le.subtract(Y.multiplyByMonomial(Sr,Ur))}Pe=_t.multiply(ge).subtract(dt).negative()}var Zr=Pe.getCoefficient(0);if(0===Zr)throw rs.getChecksumInstance();var dn=this.field.inverse(Zr);return[Pe.multiply(dn),le.multiply(dn)]},v.prototype.findErrorLocations=function(a){for(var u=a.getDegree(),w=new Int32Array(u),U=0,Y=1;Y0){var Pe=w?this.topLeft:this.topRight,Ge=Math.trunc(Pe.getY()-a);Ge<0&&(Ge=0);var dt=new Eo(Pe.getX(),Ge);w?U=dt:le=dt}if(u>0){var _t=w?this.bottomLeft:this.bottomRight,Ot=Math.trunc(_t.getY()+u);Ot>=this.image.getHeight()&&(Ot=this.image.getHeight()-1);var Ht=new Eo(_t.getX(),Ot);w?Y=Ht:ge=Ht}return new v(this.image,U,Y,le,ge)},v.prototype.getMinX=function(){return this.minX},v.prototype.getMaxX=function(){return this.maxX},v.prototype.getMinY=function(){return this.minY},v.prototype.getMaxY=function(){return this.maxY},v.prototype.getTopLeft=function(){return this.topLeft},v.prototype.getTopRight=function(){return this.topRight},v.prototype.getBottomLeft=function(){return this.bottomLeft},v.prototype.getBottomRight=function(){return this.bottomRight},v}(),hx=function(){function v(a,u,w,U){this.columnCount=a,this.errorCorrectionLevel=U,this.rowCountUpperPart=u,this.rowCountLowerPart=w,this.rowCount=u+w}return v.prototype.getColumnCount=function(){return this.columnCount},v.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},v.prototype.getRowCount=function(){return this.rowCount},v.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},v.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},v}(),m1=function(){function v(){this.buffer=""}return v.form=function(a,u){var w=-1;return a.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function U(le,ge,Pe,Ge,dt,_t){if("%%"===le)return"%";if(void 0!==u[++w]){le=Ge?parseInt(Ge.substr(1)):void 0;var Ht,Ot=dt?parseInt(dt.substr(1)):void 0;switch(_t){case"s":Ht=u[w];break;case"c":Ht=u[w][0];break;case"f":Ht=parseFloat(u[w]).toFixed(le);break;case"p":Ht=parseFloat(u[w]).toPrecision(le);break;case"e":Ht=parseFloat(u[w]).toExponential(le);break;case"x":Ht=parseInt(u[w]).toString(Ot||16);break;case"d":Ht=parseFloat(parseInt(u[w],Ot||10).toPrecision(le)).toFixed(0)}Ht="object"==typeof Ht?JSON.stringify(Ht):(+Ht).toString(Ot);for(var Sr=parseInt(Pe),Ur=Pe&&Pe[0]+""=="0"?"0":" ";Ht.length=0&&null!=(u=this.codewords[U])||(U=this.imageRowToCodewordIndex(a)+w)=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),le=Y.next();!le.done;le=Y.next()){var ge=le.value;null!=ge?w.format("%3d: %3d|%3d%n",U++,ge.getRowNumber(),ge.getValue()):w.format("%3d: | %n",U++)}}catch(Pe){a={error:Pe}}finally{try{le&&!le.done&&(u=Y.return)&&u.call(Y)}finally{if(a)throw a.error}}return w.toString()},v.MAX_NEARBY_DISTANCE=5,v}();var id=function(v,a){var u="function"==typeof Symbol&&v[Symbol.iterator];if(!u)return v;var U,le,w=u.call(v),Y=[];try{for(;(void 0===a||a-- >0)&&!(U=w.next()).done;)Y.push(U.value)}catch(ge){le={error:ge}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(le)throw le.error}}return Y};const Vu=function(){function v(){this.values=new Map}return v.prototype.setValue=function(a){a=Math.trunc(a);var u=this.values.get(a);null==u&&(u=0),u++,this.values.set(a,u)},v.prototype.getValue=function(){var a,u,w=-1,U=new Array,Y=function(_t,Ot){var Ht_getKey=function(){return _t},Ht_getValue=function(){return Ot};Ht_getValue()>w?(w=Ht_getValue(),(U=[]).push(Ht_getKey())):Ht_getValue()===w&&U.push(Ht_getKey())};try{for(var le=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),ge=le.next();!ge.done;ge=le.next()){var Pe=id(ge.value,2);Y(Pe[0],Pe[1])}}catch(_t){a={error:_t}}finally{try{ge&&!ge.done&&(u=le.return)&&u.call(le)}finally{if(a)throw a.error}}return xa.toIntArray(U)},v.prototype.getConfidence=function(a){return this.values.get(a)},v}();var i_=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),o_=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const _0=function(v){function a(u,w){var U=v.call(this,u)||this;return U._isLeft=w,U}return i_(a,v),a.prototype.setRowNumbers=function(){var u,w;try{for(var U=o_(this.getCodewords()),Y=U.next();!Y.done;Y=U.next()){var le=Y.value;le?.setRowNumberAsRowIndicatorColumn()}}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}},a.prototype.adjustCompleteIndicatorColumnRowNumbers=function(u){var w=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(w,u);for(var U=this.getBoundingBox(),Y=this._isLeft?U.getTopLeft():U.getTopRight(),le=this._isLeft?U.getBottomLeft():U.getBottomRight(),ge=this.imageRowToCodewordIndex(Math.trunc(Y.getY())),Pe=this.imageRowToCodewordIndex(Math.trunc(le.getY())),Ge=-1,dt=1,_t=0,Ot=ge;Ot=u.getRowCount()||Sr>Ot)w[Ot]=null;else{for(var Ur,Zr=(Ur=dt>2?(dt-2)*Sr:Sr)>=Ot,dn=1;dn<=Ur&&!Zr;dn++)Zr=null!=w[Ot-dn];Zr?w[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}}},a.prototype.getRowHeights=function(){var u,w,U=this.getBarcodeMetadata();if(null==U)return null;this.adjustIncompleteIndicatorColumnRowNumbers(U);var Y=new Int32Array(U.getRowCount());try{for(var le=o_(this.getCodewords()),ge=le.next();!ge.done;ge=le.next()){var Pe=ge.value;if(null!=Pe){var Ge=Pe.getRowNumber();if(Ge>=Y.length)continue;Y[Ge]++}}}catch(dt){u={error:dt}}finally{try{ge&&!ge.done&&(w=le.return)&&w.call(le)}finally{if(u)throw u.error}}return Y},a.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(u){for(var w=this.getBoundingBox(),U=this._isLeft?w.getTopLeft():w.getTopRight(),Y=this._isLeft?w.getBottomLeft():w.getBottomRight(),le=this.imageRowToCodewordIndex(Math.trunc(U.getY())),ge=this.imageRowToCodewordIndex(Math.trunc(Y.getY())),Pe=this.getCodewords(),Ge=-1,dt=1,_t=0,Ot=le;Ot=u.getRowCount()?Pe[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}},a.prototype.getBarcodeMetadata=function(){var u,w,U=this.getCodewords(),Y=new Vu,le=new Vu,ge=new Vu,Pe=new Vu;try{for(var Ge=o_(U),dt=Ge.next();!dt.done;dt=Ge.next()){var _t=dt.value;if(null!=_t){_t.setRowNumberAsRowIndicatorColumn();var Ot=_t.getValue()%30,Ht=_t.getRowNumber();switch(this._isLeft||(Ht+=2),Ht%3){case 0:le.setValue(3*Ot+1);break;case 1:Pe.setValue(Ot/3),ge.setValue(Ot%3);break;case 2:Y.setValue(Ot+1)}}}}catch(Ur){u={error:Ur}}finally{try{dt&&!dt.done&&(w=Ge.return)&&w.call(Ge)}finally{if(u)throw u.error}}if(0===Y.getValue().length||0===le.getValue().length||0===ge.getValue().length||0===Pe.getValue().length||Y.getValue()[0]<1||le.getValue()[0]+ge.getValue()[0]xa.MAX_ROWS_IN_BARCODE)return null;var Sr=new hx(Y.getValue()[0],le.getValue()[0],ge.getValue()[0],Pe.getValue()[0]);return this.removeIncorrectCodewords(U,Sr),Sr},a.prototype.removeIncorrectCodewords=function(u,w){for(var U=0;Uw.getRowCount()){u[U]=null;continue}switch(this._isLeft||(ge+=2),ge%3){case 0:3*le+1!==w.getRowCountUpperPart()&&(u[U]=null);break;case 1:(Math.trunc(le/3)!==w.getErrorCorrectionLevel()||le%3!==w.getRowCountLowerPart())&&(u[U]=null);break;case 2:le+1!==w.getColumnCount()&&(u[U]=null)}}}},a.prototype.isLeft=function(){return this._isLeft},a.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+v.prototype.toString.call(this)},a}(px),Yo=function(){function v(a,u){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=a,this.barcodeColumnCount=a.getColumnCount(),this.boundingBox=u,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return v.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var u,a=xa.MAX_CODEWORDS_IN_BARCODE;do{u=a,a=this.adjustRowNumbersAndGetCount()}while(a>0&&a0&&Y0&&(Ge[0]=w[u-1],Ge[4]=ge[u-1],Ge[5]=Pe[u-1]),u>1&&(Ge[8]=w[u-2],Ge[10]=ge[u-2],Ge[11]=Pe[u-2]),u=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=dt.next();!_t.done;_t=dt.next())if(v.adjustRowNumber(le,_t.value))return}catch(Ht){U={error:Ht}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}}},v.adjustRowNumber=function(a,u){return!(null==u||!u.hasValidRowNumber()||u.getBucket()!==a.getBucket()||(a.setRowNumber(u.getRowNumber()),0))},v.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},v.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},v.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},v.prototype.setBoundingBox=function(a){this.boundingBox=a},v.prototype.getBoundingBox=function(){return this.boundingBox},v.prototype.setDetectionResultColumn=function(a,u){this.detectionResultColumns[a]=u},v.prototype.getDetectionResultColumn=function(a){return this.detectionResultColumns[a]},v.prototype.toString=function(){var a=this.detectionResultColumns[0];null==a&&(a=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var u=new m1,w=0;w>=1;w=1&u,v.RATIOS_TABLE[a]||(v.RATIOS_TABLE[a]=new Array(xa.BARS_IN_MODULE)),v.RATIOS_TABLE[a][xa.BARS_IN_MODULE-U-1]=Math.fround(Y/xa.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},v.getDecodedValue=function(a){var u=v.getDecodedCodewordValue(v.sampleBitCounts(a));return-1!==u?u:v.getClosestDecodedValue(a)},v.sampleBitCounts=function(a){for(var u=Js.sum(a),w=new Int32Array(xa.BARS_IN_MODULE),U=0,Y=0,le=0;le1)for(var U=0;U=Y)break}Pea.length||w<0||u+w>a.length||u+w<0)throw new qr;if(0!==w)for(var U=0;U0&&this.grow(u)},a.prototype.grow=function(u){var U=this.buf.length<<1;if(U-u<0&&(U=u),U<0){if(u<0)throw new wx;U=pi.MAX_VALUE}this.buf=Vi.copyOfUint8Array(this.buf,U)},a.prototype.write=function(u){this.ensureCapacity(this.count+1),this.buf[this.count]=u,this.count+=1},a.prototype.writeBytesOffset=function(u,w,U){if(w<0||w>u.length||U<0||w+U-u.length>0)throw new qr;this.ensureCapacity(this.count+U),Rt.arraycopy(u,w,this.buf,this.count,U),this.count+=U},a.prototype.writeTo=function(u){u.writeBytesOffset(this.buf,0,this.count)},a.prototype.reset=function(){this.count=0},a.prototype.toByteArray=function(){return Vi.copyOfUint8Array(this.buf,this.count)},a.prototype.size=function(){return this.count},a.prototype.toString=function(u){return u?"string"==typeof u?this.toString_string(u):this.toString_number(u):this.toString_void()},a.prototype.toString_void=function(){return new String(this.buf).toString()},a.prototype.toString_string=function(u){return new String(this.buf).toString()},a.prototype.toString_number=function(u){return new String(this.buf).toString()},a.prototype.close=function(){},a}(iC);var qs,Oc=function(v){return v[v.ALPHA=0]="ALPHA",v[v.LOWER=1]="LOWER",v[v.MIXED=2]="MIXED",v[v.PUNCT=3]="PUNCT",v[v.ALPHA_SHIFT=4]="ALPHA_SHIFT",v[v.PUNCT_SHIFT=5]="PUNCT_SHIFT",v}(Oc||{});function qh(){if(typeof window<"u")return window.BigInt||null;if(typeof globalThis<"u")return globalThis.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function eh(v){if(typeof qs>"u"&&(qs=qh()),null===qs)throw new Error("BigInt is not supported!");return qs(v)}const Cl=function(){function v(){}return v.decode=function(a,u){var w=new jr(""),U=Jo.ISO8859_1;w.enableDecoding(U);for(var Y=1,le=a[Y++],ge=new s_;Ya[0])throw Qn.getFormatInstance();for(var U=new Int32Array(v.NUMBER_OF_SEQUENCE_CODEWORDS),Y=0;Y0){for(var Ot=0;Ot<6;++Ot)le.write(Number(eh(Pe)>>eh(8*(5-Ot))));Pe=0,ge=0}}U===u[0]&&_t0){for(Ot=0;Ot<6;++Ot)le.write(Number(eh(Pe)>>eh(8*(5-Ot))));Pe=0,ge=0}}}return Y.append(Wt.decode(le.toByteArray(),w)),U},v.numericCompaction=function(a,u,w){for(var U=0,Y=!1,le=new Int32Array(v.MAX_NUMERIC_CODEWORDS);u0&&(w.append(v.decodeBase900toBase10(le,U)),U=0)}return u},v.decodeBase900toBase10=function(a,u){for(var w=eh(0),U=0;U@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",v.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",v.EXP900=qh()?function E0(){var v=[];v[0]=eh(1);var a=eh(900);v[1]=a;for(var u=2;u<16;u++)v[u]=v[u-1]*a;return v}():[],v.NUMBER_OF_SEQUENCE_CODEWORDS=2,v}();var _f=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ep=function(){function v(){}return v.decode=function(a,u,w,U,Y,le,ge){for(var _t,Pe=new n_(a,u,w,U,Y),Ge=null,dt=null,Ot=!0;;Ot=!1){if(null!=u&&(Ge=v.getRowIndicatorColumn(a,Pe,u,!0,le,ge)),null!=U&&(dt=v.getRowIndicatorColumn(a,Pe,U,!1,le,ge)),null==(_t=v.merge(Ge,dt)))throw Wn.getNotFoundInstance();var Ht=_t.getBoundingBox();if(!Ot||null==Ht||!(Ht.getMinY()Pe.getMaxY()))break;Pe=Ht}_t.setBoundingBox(Pe);var Sr=_t.getBarcodeColumnCount()+1;_t.setDetectionResultColumn(0,Ge),_t.setDetectionResultColumn(Sr,dt);for(var Ur=null!=Ge,Zr=1;Zr<=Sr;Zr++){var dn=Ur?Zr:Sr-Zr;if(void 0===_t.getDetectionResultColumn(dn)){var ln=void 0;ln=0===dn||dn===Sr?new _0(Pe,0===dn):new px(Pe),_t.setDetectionResultColumn(dn,ln);for(var Tn=-1,Gn=Tn,yi=Pe.getMinY();yi<=Pe.getMaxY();yi++){if((Tn=v.getStartColumn(_t,dn,yi,Ur))<0||Tn>Pe.getMaxX()){if(-1===Gn)continue;Tn=Gn}var Bi=v.detectCodeword(a,Pe.getMinX(),Pe.getMaxX(),Ur,Tn,yi,le,ge);null!=Bi&&(ln.setCodeword(yi,Bi),Gn=Tn,le=Math.min(le,Bi.getWidth()),ge=Math.max(ge,Bi.getWidth()))}}}return v.createDecoderResult(_t)},v.merge=function(a,u){if(null==a&&null==u)return null;var w=v.getBarcodeMetadata(a,u);if(null==w)return null;var U=n_.merge(v.adjustBoundingBox(a),v.adjustBoundingBox(u));return new Yo(w,U)},v.adjustBoundingBox=function(a){var u,w;if(null==a)return null;var U=a.getRowHeights();if(null==U)return null;var Y=v.getMax(U),le=0;try{for(var ge=_f(U),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(le+=Y-Ge,Ge>0)break}}catch(Ht){u={error:Ht}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(u)throw u.error}}for(var dt=a.getCodewords(),_t=0;le>0&&null==dt[_t];_t++)le--;var Ot=0;for(_t=U.length-1;_t>=0&&(Ot+=Y-U[_t],!(U[_t]>0));_t--);for(_t=dt.length-1;Ot>0&&null==dt[_t];_t--)Ot--;return a.getBoundingBox().addMissingRows(le,Ot,a.isLeft())},v.getMax=function(a){var u,w,U=-1;try{for(var Y=_f(a),le=Y.next();!le.done;le=Y.next())U=Math.max(U,le.value)}catch(Pe){u={error:Pe}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return U},v.getBarcodeMetadata=function(a,u){var w,U;return null==a||null==(w=a.getBarcodeMetadata())?null==u?null:u.getBarcodeMetadata():null==u||null==(U=u.getBarcodeMetadata())?w:w.getColumnCount()!==U.getColumnCount()&&w.getErrorCorrectionLevel()!==U.getErrorCorrectionLevel()&&w.getRowCount()!==U.getRowCount()?null:w},v.getRowIndicatorColumn=function(a,u,w,U,Y,le){for(var ge=new _0(u,U),Pe=0;Pe<2;Pe++)for(var Ge=0===Pe?1:-1,dt=Math.trunc(Math.trunc(w.getX())),_t=Math.trunc(Math.trunc(w.getY()));_t<=u.getMaxY()&&_t>=u.getMinY();_t+=Ge){var Ot=v.detectCodeword(a,0,a.getWidth(),U,dt,_t,Y,le);null!=Ot&&(ge.setCodeword(_t,Ot),dt=U?Ot.getStartX():Ot.getEndX())}return ge},v.adjustCodewordCount=function(a,u){var w=u[0][1],U=w.getValue(),Y=a.getBarcodeColumnCount()*a.getBarcodeRowCount()-v.getNumberOfECCodeWords(a.getBarcodeECLevel());if(0===U.length){if(Y<1||Y>xa.MAX_CODEWORDS_IN_BARCODE)throw Wn.getNotFoundInstance();w.setValue(Y)}else U[0]!==Y&&w.setValue(Y)},v.createDecoderResult=function(a){var u=v.createBarcodeMatrix(a);v.adjustCodewordCount(a,u);for(var w=new Array,U=new Int32Array(a.getBarcodeRowCount()*a.getBarcodeColumnCount()),Y=[],le=new Array,ge=0;ge0;){for(var Pe=0;Pe=0){if(Zr>=le.length)continue;le[Zr][Ge].setValue(Ur.getValue())}}}}catch(dn){U={error:dn}}finally{try{Sr&&!Sr.done&&(Y=Ht.return)&&Y.call(Ht)}finally{if(U)throw U.error}}Ge++}}catch(dn){u={error:dn}}finally{try{_t&&!_t.done&&(w=dt.return)&&w.call(dt)}finally{if(u)throw u.error}}return le},v.isValidBarcodeColumn=function(a,u){return u>=0&&u<=a.getBarcodeColumnCount()+1},v.getStartColumn=function(a,u,w,U){var Y,le,ge=U?1:-1,Pe=null;if(v.isValidBarcodeColumn(a,u-ge)&&(Pe=a.getDetectionResultColumn(u-ge).getCodeword(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();if(null!=(Pe=a.getDetectionResultColumn(u).getCodewordNearby(w)))return U?Pe.getStartX():Pe.getEndX();if(v.isValidBarcodeColumn(a,u-ge)&&(Pe=a.getDetectionResultColumn(u-ge).getCodewordNearby(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();for(var Ge=0;v.isValidBarcodeColumn(a,u-ge);){u-=ge;try{for(var dt=(Y=void 0,_f(a.getDetectionResultColumn(u).getCodewords())),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;if(null!=Ot)return(U?Ot.getEndX():Ot.getStartX())+ge*Ge*(Ot.getEndX()-Ot.getStartX())}}catch(Ht){Y={error:Ht}}finally{try{_t&&!_t.done&&(le=dt.return)&&le.call(dt)}finally{if(Y)throw Y.error}}Ge++}return U?a.getBoundingBox().getMinX():a.getBoundingBox().getMaxX()},v.detectCodeword=function(a,u,w,U,Y,le,ge,Pe){Y=v.adjustCodewordStartColumn(a,u,w,U,Y,le);var Ge=v.getModuleBitCount(a,u,w,U,Y,le);if(null==Ge)return null;var dt,_t=Js.sum(Ge);if(U)dt=Y+_t;else{for(var Ot=0;Ot=u)&&Ge=u:gev.CODEWORD_SKEW_SIZE)return Y;ge+=Pe}Pe=-Pe,U=!U}return ge},v.checkCodewordSkew=function(a,u,w){return u-v.CODEWORD_SKEW_SIZE<=a&&a<=w+v.CODEWORD_SKEW_SIZE},v.decodeCodewords=function(a,u,w){if(0===a.length)throw Qn.getFormatInstance();var U=1<w/2+v.MAX_ERRORS||w<0||w>v.MAX_EC_CODEWORDS)throw rs.getChecksumInstance();return v.errorCorrection.decode(a,w,u)},v.verifyCodewordCount=function(a,u){if(a.length<4)throw Qn.getFormatInstance();var w=a[0];if(w>a.length)throw Qn.getFormatInstance();if(0===w){if(!(u>=1;return u},v.getCodewordBucketNumber=function(a){return a instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(a):this.getCodewordBucketNumber_number(a)},v.getCodewordBucketNumber_number=function(a){return v.getCodewordBucketNumber(v.getBitCountForCodeword(a))},v.getCodewordBucketNumber_Int32Array=function(a){return(a[0]-a[2]+a[4]-a[6]+9)%9},v.toString=function(a){for(var u=new m1,w=0;w=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge.getPoints()),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var dt=Ge.value,_t=ep.decode(ge.getBits(),dt[4],dt[5],dt[6],dt[7],v.getMinCodewordWidth(dt),v.getMaxCodewordWidth(dt)),Ot=new Cs(_t.getText(),_t.getRawBytes(),void 0,dt,Do.PDF_417);Ot.putMetadata(gc.ERROR_CORRECTION_LEVEL,_t.getECLevel());var Ht=_t.getOther();null!=Ht&&Ot.putMetadata(gc.PDF417_EXTRA_METADATA,Ht),le.push(Ot)}}catch(Sr){U={error:Sr}}finally{try{Ge&&!Ge.done&&(Y=Pe.return)&&Y.call(Pe)}finally{if(U)throw U.error}}return le.map(function(Sr){return Sr})},v.getMaxWidth=function(a,u){return null==a||null==u?0:Math.trunc(Math.abs(a.getX()-u.getX()))},v.getMinWidth=function(a,u){return null==a||null==u?pi.MAX_VALUE:Math.trunc(Math.abs(a.getX()-u.getX()))},v.getMaxCodewordWidth=function(a){return Math.floor(Math.max(Math.max(v.getMaxWidth(a[0],a[4]),v.getMaxWidth(a[6],a[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.max(v.getMaxWidth(a[1],a[5]),v.getMaxWidth(a[7],a[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},v.getMinCodewordWidth=function(a){return Math.floor(Math.min(Math.min(v.getMinWidth(a[0],a[4]),v.getMinWidth(a[6],a[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.min(v.getMinWidth(a[1],a[5]),v.getMinWidth(a[7],a[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},v.prototype.reset=function(){},v}();var _1=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const tp=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return _1(a,v),a.kind="ReaderException",a}(Us);var Ud=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ny=function(){function v(){}return v.prototype.decode=function(a,u){return this.setHints(u),this.decodeInternal(a)},v.prototype.decodeWithState=function(a){return null==this.readers&&this.setHints(null),this.decodeInternal(a)},v.prototype.setHints=function(a){this.hints=a;var u=null!=a&&void 0!==a.get(Di.TRY_HARDER),w=null==a?null:a.get(Di.POSSIBLE_FORMATS),U=new Array;if(null!=w){var Y=w.some(function(le){return le===Do.UPC_A||le===Do.UPC_E||le===Do.EAN_13||le===Do.EAN_8||le===Do.CODABAR||le===Do.CODE_39||le===Do.CODE_93||le===Do.CODE_128||le===Do.ITF||le===Do.RSS_14||le===Do.RSS_EXPANDED});Y&&!u&&U.push(new Ac(a)),w.includes(Do.QR_CODE)&&U.push(new u1),w.includes(Do.DATA_MATRIX)&&U.push(new y0),w.includes(Do.AZTEC)&&U.push(new We),w.includes(Do.PDF_417)&&U.push(new S0),Y&&u&&U.push(new Ac(a))}0===U.length&&(u||U.push(new Ac(a)),U.push(new u1),U.push(new y0),U.push(new We),U.push(new S0),u&&U.push(new Ac(a))),this.readers=U},v.prototype.reset=function(){var a,u;if(null!==this.readers)try{for(var w=Ud(this.readers),U=w.next();!U.done;U=w.next())U.value.reset()}catch(le){a={error:le}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(a)throw a.error}}},v.prototype.decodeInternal=function(a){var u,w;if(null===this.readers)throw new tp("No readers where selected, nothing can be read.");try{for(var U=Ud(this.readers),Y=U.next();!Y.done;Y=U.next()){var le=Y.value;try{return le.decode(a,this.hints)}catch(ge){if(ge instanceof tp)continue}}}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}throw new Wn("No MultiFormat Readers were able to detect the code.")},v}();var xx=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),iy=(function(v){function a(u,w){void 0===u&&(u=null),void 0===w&&(w=500);var Y=new ny;return Y.setHints(u),v.call(this,Y,w)||this}xx(a,v),a.prototype.decodeBitmap=function(u){return this.reader.decodeWithState(u)}}(Qu),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Cm=(function(v){iy(function a(u){return void 0===u&&(u=500),v.call(this,new S0,u)||this},v)}(Qu),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Ax=(function(v){Cm(function a(u){return void 0===u&&(u=500),v.call(this,new u1,u)||this},v)}(Qu),function(v){return v[v.ERROR_CORRECTION=0]="ERROR_CORRECTION",v[v.CHARACTER_SET=1]="CHARACTER_SET",v[v.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",v[v.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",v[v.MIN_SIZE=4]="MIN_SIZE",v[v.MAX_SIZE=5]="MAX_SIZE",v[v.MARGIN=6]="MARGIN",v[v.PDF417_COMPACT=7]="PDF417_COMPACT",v[v.PDF417_COMPACTION=8]="PDF417_COMPACTION",v[v.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",v[v.AZTEC_LAYERS=10]="AZTEC_LAYERS",v[v.QR_VERSION=11]="QR_VERSION",v[v.GS1_FORMAT=12]="GS1_FORMAT",v[v.FORCE_C40=13]="FORCE_C40",v}(Ax||{}));const as=Ax,x1=function(){function v(a){this.field=a,this.cachedGenerators=[],this.cachedGenerators.push(new mu(a,Int32Array.from([1])))}return v.prototype.buildGenerator=function(a){var u=this.cachedGenerators;if(a>=u.length)for(var w=u[u.length-1],U=this.field,Y=u.length;Y<=a;Y++){var le=w.multiply(new mu(U,Int32Array.from([1,U.exp(Y-1+U.getGeneratorBase())])));u.push(le),w=le}return u[a]},v.prototype.encode=function(a,u){if(0===u)throw new ki("No error correction bytes");var w=a.length-u;if(w<=0)throw new ki("No data bytes provided");var U=this.buildGenerator(u),Y=new Int32Array(w);Rt.arraycopy(a,0,Y,0,w);for(var le=new mu(this.field,Y),Pe=(le=le.multiplyByMonomial(u,1)).divide(U)[1].getCoefficients(),Ge=u-Pe.length,dt=0;dt=5&&(w+=v.N1+(Pe-5)),Pe=1,Ge=_t)}Pe>=5&&(w+=v.N1+(Pe-5))}return w},v.N1=3,v.N2=3,v.N3=40,v.N4=10,v}(),Bp=function(){function v(a,u){this.width=a,this.height=u;for(var w=new Array(u),U=0;U!==u;U++)w[U]=new Uint8Array(a);this.bytes=w}return v.prototype.getHeight=function(){return this.height},v.prototype.getWidth=function(){return this.width},v.prototype.get=function(a,u){return this.bytes[u][a]},v.prototype.getArray=function(){return this.bytes},v.prototype.setNumber=function(a,u,w){this.bytes[u][a]=w},v.prototype.setBoolean=function(a,u,w){this.bytes[u][a]=w?1:0},v.prototype.clear=function(a){var u,w;try{for(var U=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.bytes),Y=U.next();!Y.done;Y=U.next())Vi.fill(Y.value,a)}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}},v.prototype.equals=function(a){if(!(a instanceof v))return!1;var u=a;if(this.width!==u.width||this.height!==u.height)return!1;for(var w=0,U=this.height;w>\n"),a.toString()},v.prototype.setMode=function(a){this.mode=a},v.prototype.setECLevel=function(a){this.ecLevel=a},v.prototype.setVersion=function(a){this.version=a},v.prototype.setMaskPattern=function(a){this.maskPattern=a},v.prototype.setMatrix=function(a){this.matrix=a},v.isValidMaskPattern=function(a){return a>=0&&a0;){for(6===le&&(le-=1);ge>=0&&ge=w;)a^=u<=0)for(var Pe=0;Pe!==le;Pe++){var Ge=U[Pe];Ge>=0&&v.isEmpty(u.get(Ge,ge))&&v.embedPositionAdjustmentPattern(Ge-2,ge-2,u)}}},v.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),v.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),v.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),v.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),v.VERSION_INFO_POLY=7973,v.TYPE_INFO_POLY=1335,v.TYPE_INFO_MASK_PATTERN=21522,v}(),f_=function(){function v(a,u){this.dataBytes=a,this.errorCorrectionBytes=u}return v.prototype.getDataBytes=function(){return this.dataBytes},v.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},v}();var D0=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const C0=function(){function v(){}return v.calculateMaskPenalty=function(a){return rp.applyMaskPenaltyRule1(a)+rp.applyMaskPenaltyRule2(a)+rp.applyMaskPenaltyRule3(a)+rp.applyMaskPenaltyRule4(a)},v.encode=function(a,u,w){void 0===w&&(w=null);var U=v.DEFAULT_BYTE_MODE_ENCODING,Y=null!==w&&void 0!==w.get(as.CHARACTER_SET);Y&&(U=w.get(as.CHARACTER_SET).toString());var le=this.chooseMode(a,U),ge=new bi;if(le===Pc.BYTE&&(Y||v.DEFAULT_BYTE_MODE_ENCODING!==U)){var Pe=Jo.getCharacterSetECIByName(U);void 0!==Pe&&this.appendECI(Pe,ge)}this.appendModeInfo(le,ge);var dt,Ge=new bi;if(this.appendBytes(a,le,Ge,U),null!==w&&void 0!==w.get(as.QR_VERSION)){var _t=Number.parseInt(w.get(as.QR_VERSION).toString(),10);dt=Xh.getVersionForNumber(_t);var Ot=this.calculateBitsNeeded(le,ge,Ge,dt);if(!this.willFit(Ot,dt,u))throw new Gc("Data too big for requested version")}else dt=this.recommendVersion(u,le,ge,Ge);var Ht=new bi;Ht.appendBitArray(ge);var Sr=le===Pc.BYTE?Ge.getSizeInBytes():a.length;this.appendLengthInfo(Sr,dt,le,Ht),Ht.appendBitArray(Ge);var Ur=dt.getECBlocksForLevel(u),Zr=dt.getTotalCodewords()-Ur.getTotalECCodewords();this.terminateBits(Zr,Ht);var dn=this.interleaveWithECBytes(Ht,dt.getTotalCodewords(),Zr,Ur.getNumBlocks()),ln=new oy;ln.setECLevel(u),ln.setMode(le),ln.setVersion(dt);var Tn=dt.getDimensionForVersion(),Gn=new Bp(Tn,Tn),yi=this.chooseMaskPattern(dn,u,dt,Gn);return ln.setMaskPattern(yi),np.buildMatrix(dn,u,dt,yi,Gn),ln.setMatrix(Gn),ln},v.recommendVersion=function(a,u,w,U){var Y=this.calculateBitsNeeded(u,w,U,Xh.getVersionForNumber(1)),le=this.chooseVersion(Y,a),ge=this.calculateBitsNeeded(u,w,U,le);return this.chooseVersion(ge,a)},v.calculateBitsNeeded=function(a,u,w,U){return u.getSize()+a.getCharacterCountBits(U)+w.getSize()},v.getAlphanumericCode=function(a){return a159)&&(Y<224||Y>235))return!1}return!0},v.chooseMaskPattern=function(a,u,w,U){for(var Y=Number.MAX_SAFE_INTEGER,le=-1,ge=0;ge=(a+7)/8},v.terminateBits=function(a,u){var w=8*a;if(u.getSize()>w)throw new Gc("data bits cannot fit in the QR Code"+u.getSize()+" > "+w);for(var U=0;U<4&&u.getSize()0)for(U=Y;U<8;U++)u.appendBit(!1);var le=a-u.getSizeInBytes();for(U=0;U=w)throw new Gc("Block ID too large");var ge=a%w,Pe=w-ge,Ge=Math.floor(a/w),dt=Ge+1,_t=Math.floor(u/w),Ot=_t+1,Ht=Ge-_t,Sr=dt-Ot;if(Ht!==Sr)throw new Gc("EC bytes mismatch");if(w!==Pe+ge)throw new Gc("RS blocks mismatch");if(a!==(_t+Ht)*Pe+(Ot+Sr)*ge)throw new Gc("Total bytes mismatch");U=1<=0&&u<=9},v.appendNumericBytes=function(a,u){for(var w=a.length,U=0;U=33088&&Pe<=40956?Ge=Pe-33088:Pe>=57408&&Pe<=60351&&(Ge=Pe-49472),-1===Ge)throw new Gc("Invalid byte sequence");u.appendBits(192*(Ge>>8)+(255&Ge),13)}},v.appendECI=function(a,u){u.appendBits(Pc.ECI.getBits(),4),u.appendBits(a.getValue(),8)},v.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),v.DEFAULT_BYTE_MODE_ENCODING=Jo.UTF8.getName(),v}();!function(){function v(){}v.prototype.write=function(a,u,w,U){if(void 0===U&&(U=null),0===a.length)throw new ki("Found empty contents");if(u<0||w<0)throw new ki("Requested dimensions are too small: "+u+"x"+w);var Y=Al.L,le=v.QUIET_ZONE_SIZE;null!==U&&(void 0!==U.get(as.ERROR_CORRECTION)&&(Y=Al.fromString(U.get(as.ERROR_CORRECTION).toString())),void 0!==U.get(as.MARGIN)&&(le=Number.parseInt(U.get(as.MARGIN).toString(),10)));var ge=C0.encode(a,Y,U);return this.renderResult(ge,u,w,le)},v.prototype.writeToDom=function(a,u,w,U,Y){void 0===Y&&(Y=null),"string"==typeof a&&(a=document.querySelector(a));var le=this.write(u,w,U,Y);a&&a.appendChild(le)},v.prototype.renderResult=function(a,u,w,U){var Y=a.getMatrix();if(null===Y)throw new ou;for(var le=Y.getWidth(),ge=Y.getHeight(),Pe=le+2*U,Ge=ge+2*U,dt=Math.max(u,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(dt/Pe),Math.floor(_t/Ge)),Ht=Math.floor((dt-le*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),Ur=this.createSVGElement(dt,_t),Zr=0,dn=Sr;Zrw||le+Pe>U)throw new ki("Crop rectangle does not fit within image data.");return Ge&&dt.reverseHorizontal(ge,Pe),dt}Ox(a,v),a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth();return(null==w||w.length>16&255)+(Ht>>7&510)+(255&Ht))/4&255}Ge.luminances=_t}else Ge.luminances=u;if(void 0===Y&&(Ge.dataWidth=w),void 0===le&&(Ge.dataHeight=U),void 0===ge&&(Ge.left=0),void 0===Pe&&(Ge.top=0),Ge.left+w>Ge.dataWidth||Ge.top+U>Ge.dataHeight)throw new ki("Crop rectangle does not fit within image data.");return Ge}p_(a,v),a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth();return(null==w||w.length=0&&this.noBit(w,u)&&this.utah(u,w,a++),u-=2,w+=2}while(u>=0&&w=0&&w=0);u+=3,w++}while(u=256&&(u^=301);return{LOG:v,ALOG:a}}([],[])).LOG,g_=A1.ALOG,lf="[)>\x1e05\x1d",eo="[)>\x1e06\x1d";const sp=function(){function v(){}return v.encodeECC200=function(a,u){if(a.length!==u.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var w=new jr;w.append(a);var U=u.getInterleavedBlockCount();if(1===U){var Y=this.createECCBlock(a,u.getErrorCodewords());w.append(Y)}else{for(var le=[],ge=[],Pe=0;Pe0;Pe--)le[Pe]=0!==ge&&0!==Y[Pe]?le[Pe-1]^g_[(dy[ge]+dy[Y[Pe]])%255]:le[Pe-1];le[0]=0!==ge&&0!==Y[0]?g_[(dy[ge]+dy[Y[0]])%255]:0}var Ge=[];for(U=0;U=2)a.writeCodeword(this.encodeASCIIDigits(a.getMessage().charCodeAt(a.pos),a.getMessage().charCodeAt(a.pos+1))),a.pos+=2;else{var w=a.getCurrentChar(),U=Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode());if(U!==this.getEncodingMode())switch(U){case 5:return a.writeCodeword(231),void a.signalEncoderChange(5);case 1:return a.writeCodeword(230),void a.signalEncoderChange(1);case 3:a.writeCodeword(238),a.signalEncoderChange(3);break;case 2:a.writeCodeword(239),a.signalEncoderChange(2);break;case 4:a.writeCodeword(240),a.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+U)}else Aa.isExtendedASCII(w)?(a.writeCodeword(235),a.writeCodeword(w-128+1),a.pos++):(a.writeCodeword(w+1),a.pos++)}},v.prototype.encodeASCIIDigits=function(a,u){if(Aa.isDigit(a)&&Aa.isDigit(u))return 10*(a-48)+(u-48)+130;throw new Error("not digits: "+a+u)},v}(),T1=function(){function v(){}return v.prototype.getEncodingMode=function(){return 5},v.prototype.encode=function(a){var u=new jr;for(u.append(0);a.hasMoreCharacters();){var w=a.getCurrentChar();if(u.append(w),a.pos++,Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode())!==this.getEncodingMode()){a.signalEncoderChange(0);break}}var Y=u.length()-1,ge=a.getCodewordCount()+Y+1;a.updateSymbolInfo(ge);var Pe=a.getSymbolInfo().getDataCapacity()-ge>0;if(a.hasMoreCharacters()||Pe)if(Y<=249)u.setCharAt(0,bt.getCharAt(Y));else{if(!(Y<=1555))throw new Error("Message length not in valid ranges: "+Y);u.setCharAt(0,bt.getCharAt(Math.floor(Y/250)+249)),u.insert(1,bt.getCharAt(Y%250))}var Ge=0;for(w=u.length();Ge3||1!==Ge))&&(a.pos=U)}u.length()>0&&a.writeCodeword(230),this.handleEOD(a,u)},v.prototype.encode=function(a){for(var u=new jr;a.hasMoreCharacters();){var w=a.getCurrentChar();a.pos++;var U=this.encodeChar(w,u),Y=2*Math.floor(u.length()/3),le=a.getCodewordCount()+Y;a.updateSymbolInfo(le);var ge=a.getSymbolInfo().getDataCapacity()-le;if(!a.hasMoreCharacters()){var Pe=new jr;for(u.length()%3==2&&2!==ge&&(U=this.backtrackOneCharacter(a,u,Pe,U));u.length()%3==1&&(U>3||1!==ge);)U=this.backtrackOneCharacter(a,u,Pe,U);break}if(u.length()%3==0&&Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode())!==this.getEncodingMode()){a.signalEncoderChange(0);break}}this.handleEOD(a,u)},v.prototype.backtrackOneCharacter=function(a,u,w,U){var Y=u.length(),le=u.toString().substring(0,Y-U);u.setLengthToZero(),u.append(le),a.pos--;var ge=a.getCurrentChar();return U=this.encodeChar(ge,w),a.resetSymbolInfo(),U},v.prototype.writeNextTriplet=function(a,u){a.writeCodewords(this.encodeToCodewords(u.toString()));var w=u.toString().substring(3);u.setLengthToZero(),u.append(w)},v.prototype.handleEOD=function(a,u){var w=Math.floor(u.length()/3*2),U=u.length()%3,Y=a.getCodewordCount()+w;a.updateSymbolInfo(Y);var le=a.getSymbolInfo().getDataCapacity()-Y;if(2===U){for(u.append("\0");u.length()>=3;)this.writeNextTriplet(a,u);a.hasMoreCharacters()&&a.writeCodeword(254)}else if(1===le&&1===U){for(;u.length()>=3;)this.writeNextTriplet(a,u);a.hasMoreCharacters()&&a.writeCodeword(254),a.pos--}else{if(0!==U)throw new Error("Unexpected case. Please report!");for(;u.length()>=3;)this.writeNextTriplet(a,u);(le>0||a.hasMoreCharacters())&&a.writeCodeword(254)}a.signalEncoderChange(0)},v.prototype.encodeChar=function(a,u){return 32===a?(u.append(3),1):a>=48&&a<=57?(u.append(a-48+4),1):a>=65&&a<=90?(u.append(a-65+14),1):a<32?(u.append(0),u.append(a),2):a<=47?(u.append(1),u.append(a-33),2):a<=64?(u.append(1),u.append(a-58+15),2):a<=95?(u.append(1),u.append(a-91+22),2):a<=127?(u.append(2),u.append(a-96),2):(u.append("1\x1e"),2+this.encodeChar(a-128,u))},v.prototype.encodeToCodewords=function(a){var u=1600*a.charCodeAt(0)+40*a.charCodeAt(1)+a.charCodeAt(2)+1,w=u/256,U=u%256,Y=new jr;return Y.append(w),Y.append(U),Y.toString()},v}(),v_=function(){function v(){}return v.prototype.getEncodingMode=function(){return 4},v.prototype.encode=function(a){for(var u=new jr;a.hasMoreCharacters();){var w=a.getCurrentChar();if(this.encodeChar(w,u),a.pos++,u.length()>=4){a.writeCodewords(this.encodeToCodewords(u.toString()));var Y=u.toString().substring(4);if(u.setLengthToZero(),u.append(Y),Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode())!==this.getEncodingMode()){a.signalEncoderChange(0);break}}}u.append(bt.getCharAt(31)),this.handleEOD(a,u)},v.prototype.handleEOD=function(a,u){try{var w=u.length();if(0===w)return;if(1===w){a.updateSymbolInfo();var U=a.getSymbolInfo().getDataCapacity()-a.getCodewordCount(),Y=a.getRemainingCharacters();if(Y>U&&(a.updateSymbolInfo(a.getCodewordCount()+1),U=a.getSymbolInfo().getDataCapacity()-a.getCodewordCount()),Y<=U&&U<=2)return}if(w>4)throw new Error("Count must not exceed 4");var le=w-1,ge=this.encodeToCodewords(u.toString()),Ge=!a.hasMoreCharacters()&&le<=2;le<=2&&(a.updateSymbolInfo(a.getCodewordCount()+le),(U=a.getSymbolInfo().getDataCapacity()-a.getCodewordCount())>=3&&(Ge=!1,a.updateSymbolInfo(a.getCodewordCount()+ge.length))),Ge?(a.resetSymbolInfo(),a.pos-=le):a.writeCodewords(ge)}finally{a.signalEncoderChange(0)}},v.prototype.encodeChar=function(a,u){a>=32&&a<=63?u.append(a):a>=64&&a<=94?u.append(bt.getCharAt(a-64)):Aa.illegalCharacter(bt.getCharAt(a))},v.prototype.encodeToCodewords=function(a){var u=a.length;if(0===u)throw new Error("StringBuilder must not be empty");var ge=(a.charAt(0).charCodeAt(0)<<18)+((u>=2?a.charAt(1).charCodeAt(0):0)<<12)+((u>=3?a.charAt(2).charCodeAt(0):0)<<6)+(u>=4?a.charAt(3).charCodeAt(0):0),Pe=ge>>16&255,Ge=ge>>8&255,dt=255&ge,_t=new jr;return _t.append(Pe),u>=2&&_t.append(Ge),u>=3&&_t.append(dt),_t.toString()},v}(),Fx=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),nc=function(){function v(a,u,w,U,Y,le,ge,Pe){void 0===ge&&(ge=0),void 0===Pe&&(Pe=0),this.rectangular=a,this.dataCapacity=u,this.errorCodewords=w,this.matrixWidth=U,this.matrixHeight=Y,this.dataRegions=le,this.rsBlockData=ge,this.rsBlockError=Pe}return v.lookup=function(a,u,w,U,Y){var le,ge;void 0===u&&(u=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===Y&&(Y=!0);try{for(var Pe=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(P1),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var dt=Ge.value;if((1!==u||!dt.rectangular)&&(2!==u||dt.rectangular)&&(null==w||!(dt.getSymbolWidth()U.getWidth()||dt.getSymbolHeight()>U.getHeight()))&&a<=dt.dataCapacity)return dt}}catch(_t){le={error:_t}}finally{try{Ge&&!Ge.done&&(ge=Pe.return)&&ge.call(Pe)}finally{if(le)throw le.error}}if(Y)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+a);return null},v.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},v.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},v.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},v.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},v.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},v.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},v.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},v.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},v.prototype.getDataCapacity=function(){return this.dataCapacity},v.prototype.getErrorCodewords=function(){return this.errorCodewords},v.prototype.getDataLengthForInterleavedBlock=function(a){return this.rsBlockData},v.prototype.getErrorLengthForInterleavedBlock=function(a){return this.rsBlockError},v}();const my=nc;var T0=function(v){function a(){return v.call(this,!1,1558,620,22,22,36,-1,62)||this}return Fx(a,v),a.prototype.getInterleavedBlockCount=function(){return 10},a.prototype.getDataLengthForInterleavedBlock=function(u){return u<=8?156:155},a}(nc),P1=[new nc(!1,3,5,8,8,1),new nc(!1,5,7,10,10,1),new nc(!0,5,7,16,6,1),new nc(!1,8,10,12,12,1),new nc(!0,10,11,14,6,2),new nc(!1,12,12,14,14,1),new nc(!0,16,14,24,10,1),new nc(!1,18,14,16,16,1),new nc(!1,22,18,18,18,1),new nc(!0,22,18,16,10,2),new nc(!1,30,20,20,20,1),new nc(!0,32,24,16,14,2),new nc(!1,36,24,22,22,1),new nc(!1,44,28,24,24,1),new nc(!0,49,28,22,14,2),new nc(!1,62,36,14,14,4),new nc(!1,86,42,16,16,4),new nc(!1,114,48,18,18,4),new nc(!1,144,56,20,20,4),new nc(!1,174,68,22,22,4),new nc(!1,204,84,24,24,4,102,42),new nc(!1,280,112,14,14,16,140,56),new nc(!1,368,144,16,16,16,92,36),new nc(!1,456,192,18,18,16,114,48),new nc(!1,576,224,20,20,16,144,56),new nc(!1,696,272,22,22,16,174,68),new nc(!1,816,336,24,24,16,136,56),new nc(!1,1050,408,18,18,36,175,68),new nc(!1,1304,496,20,20,36,163,62),new T0],dC=function(){function v(a){this.msg=a,this.pos=0,this.skipAtEnd=0;for(var u=a.split("").map(function(ge){return ge.charCodeAt(0)}),w=new jr,U=0,Y=u.length;Uthis.symbolInfo.getDataCapacity())&&(this.symbolInfo=my.lookup(a,this.shape,this.minSize,this.maxSize,!0))},v.prototype.resetSymbolInfo=function(){this.symbolInfo=null},v}(),P0=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),O0=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return P0(a,v),a.prototype.getEncodingMode=function(){return 3},a.prototype.encode=function(u){for(var w=new jr;u.hasMoreCharacters();){var U=u.getCurrentChar();if(u.pos++,this.encodeChar(U,w),w.length()%3==0&&(this.writeNextTriplet(u,w),Aa.lookAheadTest(u.getMessage(),u.pos,this.getEncodingMode())!==this.getEncodingMode())){u.signalEncoderChange(0);break}}this.handleEOD(u,w)},a.prototype.encodeChar=function(u,w){switch(u){case 13:w.append(0);break;case 42:w.append(1);break;case 62:w.append(2);break;case 32:w.append(3);break;default:u>=48&&u<=57?w.append(u-48+4):u>=65&&u<=90?w.append(u-65+14):Aa.illegalCharacter(bt.getCharAt(u))}return 1},a.prototype.handleEOD=function(u,w){u.updateSymbolInfo();var U=u.getSymbolInfo().getDataCapacity()-u.getCodewordCount(),Y=w.length();u.pos-=Y,(u.getRemainingCharacters()>1||U>1||u.getRemainingCharacters()!==U)&&u.writeCodeword(254),u.getNewEncoding()<0&&u.signalEncoderChange(0)},a}(py),gy=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),O1=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return gy(a,v),a.prototype.getEncodingMode=function(){return 2},a.prototype.encodeChar=function(u,w){return 32===u?(w.append(3),1):u>=48&&u<=57?(w.append(u-48+4),1):u>=97&&u<=122?(w.append(u-97+14),1):u<32?(w.append(0),w.append(u),2):u<=47?(w.append(1),w.append(u-33),2):u<=64?(w.append(1),w.append(u-58+15),2):u>=91&&u<=95?(w.append(1),w.append(u-91+22),2):96===u?(w.append(2),w.append(0),2):u<=90?(w.append(2),w.append(u-65+1),2):u<=127?(w.append(2),w.append(u-123+27),2):(w.append("1\x1e"),2+this.encodeChar(u-128,w))},a}(py);const Aa=function(){function v(){}return v.randomize253State=function(a){var w=149*a%253+1+129;return w<=254?w:w-254},v.encodeHighLevel=function(a,u,w,U,Y){void 0===u&&(u=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===Y&&(Y=!1);var le=new py,ge=[new hy,le,new O1,new O0,new v_,new T1],Pe=new dC(a);Pe.setSymbolShape(u),Pe.setSizeConstraints(w,U),a.startsWith(lf)&&a.endsWith("\x1e\x04")?(Pe.writeCodeword(236),Pe.setSkipAtEnd(2),Pe.pos+=7):a.startsWith(eo)&&a.endsWith("\x1e\x04")&&(Pe.writeCodeword(237),Pe.setSkipAtEnd(2),Pe.pos+=7);var Ge=0;for(Y&&(le.encodeMaximal(Pe),Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());Pe.hasMoreCharacters();)ge[Ge].encode(Pe),Pe.getNewEncoding()>=0&&(Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());var dt=Pe.getCodewordCount();Pe.updateSymbolInfo();var _t=Pe.getSymbolInfo().getDataCapacity();dt<_t&&0!==Ge&&5!==Ge&&4!==Ge&&Pe.writeCodeword("\xfe");var Ot=Pe.getCodewords();for(Ot.length()<_t&&Ot.append(129);Ot.length()<_t;)Ot.append(this.randomize253State(Ot.length()+1));return Pe.getCodewords().toString()},v.lookAheadTest=function(a,u,w){var U=this.lookAheadTestIntern(a,u,w);if(3===w&&3===U){for(var Y=Math.min(u+3,a.length),le=u;le=a.length)return w;var U;0===w?U=[0,1,1,1,1,1.25]:(U=[1,2,2,2,2,2.25])[w]=0;for(var Y=0,le=new Uint8Array(6),ge=[];;){if(u+Y===a.length){Vi.fill(le,0),Vi.fill(ge,0);var Pe=this.findMinimums(U,ge,pi.MAX_VALUE,le),Ge=this.getMinimumCount(le);if(ge[0]===Pe)return 0;if(1===Ge){if(le[5]>0)return 5;if(le[4]>0)return 4;if(le[2]>0)return 2;if(le[3]>0)return 3}return 1}var dt=a.charCodeAt(u+Y);if(Y++,this.isDigit(dt)?U[0]+=.5:this.isExtendedASCII(dt)?(U[0]=Math.ceil(U[0]),U[0]+=2):(U[0]=Math.ceil(U[0]),U[0]++),this.isNativeC40(dt)?U[1]+=2/3:this.isExtendedASCII(dt)?U[1]+=8/3:U[1]+=4/3,this.isNativeText(dt)?U[2]+=2/3:this.isExtendedASCII(dt)?U[2]+=8/3:U[2]+=4/3,this.isNativeX12(dt)?U[3]+=2/3:this.isExtendedASCII(dt)?U[3]+=13/3:U[3]+=10/3,this.isNativeEDIFACT(dt)?U[4]+=3/4:this.isExtendedASCII(dt)?U[4]+=4.25:U[4]+=3.25,this.isSpecialB256(dt)?U[5]+=4:U[5]++,Y>=4){if(Vi.fill(le,0),Vi.fill(ge,0),this.findMinimums(U,ge,pi.MAX_VALUE,le),ge[0]le&&(w=le,Vi.fill(U,0)),w===le&&(U[Y]=U[Y]+1)}return w},v.getMinimumCount=function(a){for(var u=0,w=0;w<6;w++)u+=a[w];return u||0},v.isDigit=function(a){return a>=48&&a<=57},v.isExtendedASCII=function(a){return a>=128&&a<=255},v.isNativeC40=function(a){return 32===a||a>=48&&a<=57||a>=65&&a<=90},v.isNativeText=function(a){return 32===a||a>=48&&a<=57||a>=97&&a<=122},v.isNativeX12=function(a){return this.isX12TermSep(a)||32===a||a>=48&&a<=57||a>=65&&a<=90},v.isX12TermSep=function(a){return 13===a||42===a||62===a},v.isNativeEDIFACT=function(a){return a>=32&&a<=94},v.isSpecialB256=function(a){return!1},v.determineConsecutiveDigitCount=function(a,u){void 0===u&&(u=0);for(var w=a.length,U=u;U=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},vy=function(){function v(a){this.charset=a,this.name=a.name}return v.prototype.canEncode=function(a){try{return null!=Wt.encode(a,this.charset)}catch{return!1}},v}(),Nx=function(){function v(a,u,w){var U,Y,le,ge,Pe,Ge;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(gs){return new vy(ay.forName(gs))}),this.encoders=[];var dt=[];dt.push(new vy(cy.ISO_8859_1));for(var _t=null!=u&&u.name.startsWith("UTF"),Ot=0;Ot=this.bytes.length)return!1;for(var w=0;w=this.length())throw new Error(""+a);if(this.isECI(a))throw new Error("value at "+a+" is not a character but an ECI");return this.isFNC1(a)?this.fnc1:this.bytes[a]},v.prototype.subSequence=function(a,u){if(a<0||a>u||u>this.length())throw new Error(""+a);for(var w=new jr,U=a;U=this.length())throw new Error(""+a);return this.bytes[a]>255&&this.bytes[a]<=999},v.prototype.isFNC1=function(a){if(a<0||a>=this.length())throw new Error(""+a);return 1e3===this.bytes[a]},v.prototype.getECIValue=function(a){if(a<0||a>=this.length())throw new Error(""+a);if(!this.isECI(a))throw new Error("value at "+a+" is not an ECI but a character");return this.bytes[a]-256},v.prototype.addEdge=function(a,u,w){(null==a[u][w.encoderIndex]||a[u][w.encoderIndex].cachedTotalSize>w.cachedTotalSize)&&(a[u][w.encoderIndex]=w)},v.prototype.addEdges=function(a,u,w,U,Y,le){var ge=a.charAt(U).charCodeAt(0),Pe=0,Ge=u.length();u.getPriorityEncoderIndex()>=0&&(ge===le||u.canEncode(ge,u.getPriorityEncoderIndex()))&&(Ge=(Pe=u.getPriorityEncoderIndex())+1);for(var dt=Pe;dt=0;le--)_t.unshift(255&Ht[le])}(null===Ot.previous?0:Ot.previous.encoderIndex)!==Ot.encoderIndex&&_t.unshift(256+u.getECIValue(Ot.encoderIndex)),Ot=Ot.previous}var Ur=[];for(le=0;le=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},jx=function(v,a){var u="function"==typeof Symbol&&v[Symbol.iterator];if(!u)return v;var U,le,w=u.call(v),Y=[];try{for(;(void 0===a||a-- >0)&&!(U=w.next()).done;)Y.push(U.value)}catch(ge){le={error:ge}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(le)throw le.error}}return Y},ao=function(v){return v[v.ASCII=0]="ASCII",v[v.C40=1]="C40",v[v.TEXT=2]="TEXT",v[v.X12=3]="X12",v[v.EDF=4]="EDF",v[v.B256=5]="B256",v}(ao||{}),by=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],_u=function(){function v(){}return v.isExtendedASCII=function(a,u){return a!==u&&a>=128&&a<=255},v.isInC40Shift1Set=function(a){return a<=31},v.isInC40Shift2Set=function(a,u){var w,U;try{for(var Y=R0(by),le=Y.next();!le.done;le=Y.next())if(le.value.charCodeAt(0)===a)return!0}catch(Pe){w={error:Pe}}finally{try{le&&!le.done&&(U=Y.return)&&U.call(Y)}finally{if(w)throw w.error}}return a===u},v.isInTextShift1Set=function(a){return this.isInC40Shift1Set(a)},v.isInTextShift2Set=function(a,u){return this.isInC40Shift2Set(a,u)},v.encodeHighLevel=function(a,u,w,U){void 0===u&&(u=null),void 0===w&&(w=-1),void 0===U&&(U=0);var Y=0;return a.startsWith(lf)&&a.endsWith("\x1e\x04")?(Y=5,a=a.substring(7,a.length-2)):a.startsWith(eo)&&a.endsWith("\x1e\x04")&&(Y=6,a=a.substring(7,a.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,function(){for(var v=[],a=0;au.cachedTotalSize)&&(a[w][u.getEndMode()]=u)},v.getNumberOfC40Words=function(a,u,w,U){for(var Y=0,le=u;le=128&&(w&&Aa.isNativeC40(Pe-128)||!w&&Aa.isNativeText(Pe-128))?Y+=3:Y+=4}else Y+=2;if(Y%3==0||(Y-2)%3==0&&le+1===a.length())return U[0]=le-u+1,Math.ceil(Y/3)}return U[0]=0,0},v.addEdges=function(a,u,w,U){var Y,le;if(a.isECI(w))this.addEdge(u,new $d(a,ao.ASCII,w,1,U));else{var Ht,ge=a.charAt(w);if(null===U||U.getEndMode()!==ao.EDF){Aa.isDigit(ge)&&a.haveNCharacters(w,2)&&Aa.isDigit(a.charAt(w+1))?this.addEdge(u,new $d(a,ao.ASCII,w,2,U)):this.addEdge(u,new $d(a,ao.ASCII,w,1,U));var Pe=[ao.C40,ao.TEXT];try{for(var Ge=R0(Pe),dt=Ge.next();!dt.done;dt=Ge.next()){var _t=dt.value,Ot=[];v.getNumberOfC40Words(a,w,_t===ao.C40,Ot)>0&&this.addEdge(u,new $d(a,_t,w,Ot[0],U))}}catch(Ur){Y={error:Ur}}finally{try{dt&&!dt.done&&(le=Ge.return)&&le.call(Ge)}finally{if(Y)throw Y.error}}a.haveNCharacters(w,3)&&Aa.isNativeX12(a.charAt(w))&&Aa.isNativeX12(a.charAt(w+1))&&Aa.isNativeX12(a.charAt(w+2))&&this.addEdge(u,new $d(a,ao.X12,w,3,U)),this.addEdge(u,new $d(a,ao.B256,w,1,U))}for(Ht=0;Ht<3;Ht++){var Sr=w+Ht;if(!a.haveNCharacters(Sr,1)||!Aa.isNativeEDIFACT(a.charAt(Sr)))break;this.addEdge(u,new $d(a,ao.EDF,w,Ht+1,U))}3===Ht&&a.haveNCharacters(w,4)&&Aa.isNativeEDIFACT(a.charAt(w+3))&&this.addEdge(u,new $d(a,ao.EDF,w,4,U))}},v.encodeMinimally=function(a){var u=a.length(),w=Array(u+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(a,w,0,null);for(var U=1;U<=u;U++){for(var Y=0;Y<6;Y++)null!==w[U][Y]&&U=1&&Y<=3?Pe.cachedTotalSize+1:Pe.cachedTotalSize;Ge0&&(w+=this.prepend($d.getBytes(232),U));for(var Pe=0;Pe=0;w--)u.unshift(a[w]);return a.length},v.prototype.randomize253State=function(a){var w=149*a%253+1+129;return w<=254?w:w-254},v.prototype.applyRandomPattern=function(a,u,w){for(var U=0;U0&&this.getCodewordsRemaining(this.cachedTotalSize+a)<=2-a)return ao.ASCII}if(this.mode===ao.C40||this.mode===ao.TEXT||this.mode===ao.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return ao.ASCII;var a;if(1===(a=this.getLastASCII())&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return ao.ASCII}return this.mode},v.prototype.getMode=function(){return this.mode},v.prototype.getLastASCII=function(){var a=this.input.length(),u=this.fromPosition+this.characterLength;return a-u>4||u>=a?0:a-u==1?_u.isExtendedASCII(this.input.charAt(u),this.input.getFNC1Character())?0:1:a-u==2?_u.isExtendedASCII(this.input.charAt(u),this.input.getFNC1Character())||_u.isExtendedASCII(this.input.charAt(u+1),this.input.getFNC1Character())?0:Aa.isDigit(this.input.charAt(u))&&Aa.isDigit(this.input.charAt(u+1))?1:2:a-u==3?Aa.isDigit(this.input.charAt(u))&&Aa.isDigit(this.input.charAt(u+1))&&!_u.isExtendedASCII(this.input.charAt(u+2),this.input.getFNC1Character())||Aa.isDigit(this.input.charAt(u+1))&&Aa.isDigit(this.input.charAt(u+2))&&!_u.isExtendedASCII(this.input.charAt(u),this.input.getFNC1Character())?2:0:Aa.isDigit(this.input.charAt(u))&&Aa.isDigit(this.input.charAt(u+1))&&Aa.isDigit(this.input.charAt(u+2))&&Aa.isDigit(this.input.charAt(u+3))?2:0},v.prototype.getMinSymbolSize=function(a){var u,w,U,Y,le,ge;switch(this.input.getShapeHint()){case 1:try{for(var Pe=R0(this.squareCodewordCapacities),Ge=Pe.next();!Ge.done;Ge=Pe.next())if((dt=Ge.value)>=a)return dt}catch(Ur){u={error:Ur}}finally{try{Ge&&!Ge.done&&(w=Pe.return)&&w.call(Pe)}finally{if(u)throw u.error}}break;case 2:try{for(var _t=R0(this.rectangularCodewordCapacities),Ot=_t.next();!Ot.done;Ot=_t.next())if((dt=Ot.value)>=a)return dt}catch(Ur){U={error:Ur}}finally{try{Ot&&!Ot.done&&(Y=_t.return)&&Y.call(_t)}finally{if(U)throw U.error}}}try{for(var Ht=R0(this.allCodewordCapacities),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var dt;if((dt=Sr.value)>=a)return dt}}catch(Ur){le={error:Ur}}finally{try{Sr&&!Sr.done&&(ge=Ht.return)&&ge.call(Ht)}finally{if(le)throw le.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},v.prototype.getCodewordsRemaining=function(a){return this.getMinSymbolSize(a)-a},v.getBytes=function(a,u){var w=new Uint8Array(u?2:1);return w[0]=a,u&&(w[1]=u),w},v.prototype.setC40Word=function(a,u,w,U,Y){var le=1600*(255&w)+40*(255&U)+(255&Y)+1;a[u]=le/256,a[u+1]=le%256},v.prototype.getX12Value=function(a){return 13===a?0:42===a?1:62===a?2:32===a?3:a>=48&&a<=57?a-44:a>=65&&a<=90?a-51:a},v.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var a=new Uint8Array(this.characterLength/3*2),u=0;u=33&&w<=47?w-33:w>=48&&w<=57?w-44:w>=58&&w<=64?w-43:w>=65&&w<=90?w-64:w>=91&&w<=95?w-69:96===w?0:w>=97&&w<=122?w-83:w>=123&&w<=127?w-96:w},v.prototype.getC40Words=function(a,u){for(var w=[],U=0;U>16&255,u[Y+1]=Pe>>8&255,u[Y+2]=255&Pe}return u},v.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case ao.ASCII:case ao.B256:switch(this.mode){case ao.B256:return v.getBytes(231);case ao.C40:return v.getBytes(230);case ao.TEXT:return v.getBytes(239);case ao.X12:return v.getBytes(238);case ao.EDF:return v.getBytes(240)}break;case ao.C40:case ao.TEXT:case ao.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case ao.ASCII:return v.getBytes(254);case ao.B256:return v.getBytes(254,231);case ao.C40:return v.getBytes(254,230);case ao.TEXT:return v.getBytes(254,239);case ao.X12:return v.getBytes(254,238);case ao.EDF:return v.getBytes(254,240)}break;case ao.EDF:if(this.mode!==ao.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},v.prototype.getDataBytes=function(){switch(this.mode){case ao.ASCII:return this.input.isECI(this.fromPosition)?v.getBytes(241,this.input.getECIValue(this.fromPosition)+1):_u.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?v.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?v.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?v.getBytes(232):v.getBytes(this.input.charAt(this.fromPosition)+1);case ao.B256:return v.getBytes(this.input.charAt(this.fromPosition));case ao.C40:return this.getC40Words(!0,this.input.getFNC1Character());case ao.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case ao.X12:return this.getX12Words();case ao.EDF:return this.getEDFBytes()}},v}(),__=function(v){function a(u,w,U,Y,le){var ge=v.call(this,u,w,U)||this;return ge.shape=Y,ge.macroId=le,ge}return Lx(a,v),a.prototype.getMacroId=function(){return this.macroId},a.prototype.getShapeHint=function(){return this.shape},a}(w_);!function(){function v(){}v.prototype.encode=function(a,u,w,U,Y){if(void 0===Y&&(Y=null),""===a.trim())throw new Error("Found empty contents");if(u!==Do.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+u);if(w<0||U<0)throw new Error("Requested dimensions can't be negative: "+w+"x"+U);var Ot,le=0,ge=null,Pe=null;if(null!=Y){var Ge=Y.get(as.DATA_MATRIX_SHAPE);null!=Ge&&(le=Ge);var dt=Y.get(as.MIN_SIZE);null!=dt&&(ge=dt);var _t=Y.get(as.MAX_SIZE);null!=_t&&(Pe=_t)}if(null!=Y&&Y.has(as.DATA_MATRIX_COMPACT)&&Y.get(as.DATA_MATRIX_COMPACT).toString()){var Sr=Y.has(as.GS1_FORMAT)&&!!Y.get(as.GS1_FORMAT).toString(),Ur=null;Y.has(as.CHARACTER_SET)&&(Ur=ay.forName(Y.get(as.CHARACTER_SET).toString())),Ot=_u.encodeHighLevel(a,Ur,Sr?29:-1,le)}else{var dn=null!=Y&&Y.has(as.FORCE_C40)&&!!Y.get(as.FORCE_C40).toString();Ot=Aa.encodeHighLevel(a,le,ge,Pe,dn)}var ln=my.lookup(Ot.length,le,ge,Pe,!0),Tn=sp.encodeECC200(Ot,ln),Gn=new ly(Tn,ln.getSymbolDataWidth(),ln.getSymbolDataHeight());return Gn.place(),this.encodeLowLevel(Gn,ln,w,U)},v.prototype.encodeLowLevel=function(a,u,w,U){for(var Y=u.getSymbolDataWidth(),le=u.getSymbolDataHeight(),ge=new Bp(u.getSymbolWidth(),u.getSymbolHeight()),Pe=0,Ge=0;Ge"},a}(fC);var mC=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const B0=function(v){function a(u,w,U){var Y=v.call(this,u,0,0)||this;return Y.binaryShiftStart=w,Y.binaryShiftByteCount=U,Y}return mC(a,v),a.prototype.appendTo=function(u,w){for(var U=0;U62?u.appendBits(this.binaryShiftByteCount-31,16):u.appendBits(0===U?Math.min(this.binaryShiftByteCount,31):this.binaryShiftByteCount-31,5)),u.appendBits(w[this.binaryShiftStart+U],8)},a.prototype.addBinaryShift=function(u,w){return new a(this,u,w)},a.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},a}(x_);function km(v,a,u){return new x_(v,a,u)}var Vx=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],S_=new x_(null,0,0),F0=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],rh=function _y(v){var a,u;try{for(var w=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),U=w.next();!U.done;U=w.next())Vi.fill(U.value,-1)}catch(le){a={error:le}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(a)throw a.error}}return v[0][4]=0,v[1][4]=0,v[1][0]=28,v[3][4]=0,v[2][4]=0,v[2][0]=15,v}(Vi.createInt32Array(6,6));const D_=function(){function v(a,u,w,U){this.token=a,this.mode=u,this.binaryShiftByteCount=w,this.bitCount=U}return v.prototype.getMode=function(){return this.mode},v.prototype.getToken=function(){return this.token},v.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},v.prototype.getBitCount=function(){return this.bitCount},v.prototype.latchAndAppend=function(a,u){var w=this.bitCount,U=this.token;if(a!==this.mode){var Y=F0[this.mode][a];U=km(U,65535&Y,Y>>16),w+=Y>>16}var le=2===a?4:5;return new v(U=km(U,u,le),a,0,w+le)},v.prototype.shiftAndAppend=function(a,u){var w=this.token,U=2===this.mode?4:5;return w=km(w,rh[this.mode][a],U),new v(w=km(w,u,5),this.mode,0,this.bitCount+U+5)},v.prototype.addBinaryShiftChar=function(a){var u=this.token,w=this.mode,U=this.bitCount;if(4===this.mode||2===this.mode){var Y=F0[w][0];u=km(u,65535&Y,Y>>16),U+=Y>>16,w=0}var ge=new v(u,w,this.binaryShiftByteCount+1,U+(0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8));return 2078===ge.binaryShiftByteCount&&(ge=ge.endBinaryShift(a+1)),ge},v.prototype.endBinaryShift=function(a){if(0===this.binaryShiftByteCount)return this;var u=this.token;return u=function $x(v,a,u){return new B0(v,a,u)}(u,a-this.binaryShiftByteCount,this.binaryShiftByteCount),new v(u,this.mode,0,this.bitCount)},v.prototype.isBetterThanOrEqualTo=function(a){var u=this.bitCount+(F0[this.mode][a.mode]>>16);return this.binaryShiftByteCounta.binaryShiftByteCount&&a.binaryShiftByteCount>0&&(u+=10),u<=a.bitCount},v.prototype.toBitArray=function(a){for(var u,w,U=[],Y=this.endBinaryShift(a.length).token;null!==Y;Y=Y.getPrevious())U.unshift(Y);var le=new bi;try{for(var ge=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),Pe=ge.next();!Pe.done;Pe=ge.next())Pe.value.appendTo(le,a)}catch(dt){u={error:dt}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(u)throw u.error}}return le},v.prototype.toString=function(){return bt.format("%s bits=%d bytes=%d",Vx[this.mode],this.bitCount,this.binaryShiftByteCount)},v.calculateBinaryShiftCost=function(a){return a.binaryShiftByteCount>62?21:a.binaryShiftByteCount>31?20:a.binaryShiftByteCount>0?10:0},v.INITIAL_STATE=new v(S_,0,0,0),v}();var I_=function C_(v){var a=bt.getCharCode(" "),u=bt.getCharCode("."),w=bt.getCharCode(",");v[0][a]=1;for(var U=bt.getCharCode("Z"),Y=bt.getCharCode("A"),le=Y;le<=U;le++)v[0][le]=le-Y+2;v[1][a]=1;var ge=bt.getCharCode("z"),Pe=bt.getCharCode("a");for(le=Pe;le<=ge;le++)v[1][le]=le-Pe+2;v[2][a]=1;var Ge=bt.getCharCode("9"),dt=bt.getCharCode("0");for(le=dt;le<=Ge;le++)v[2][le]=le-dt+2;v[2][w]=12,v[2][u]=13;for(var _t=["\0"," ","\x01","\x02","\x03","\x04","\x05","\x06","\x07","\b","\t","\n","\v","\f","\r","\x1b","\x1c","\x1d","\x1e","\x1f","@","\\","^","_","`","|","~","\x7f"],Ot=0;Ot<_t.length;Ot++)v[3][bt.getCharCode(_t[Ot])]=Ot;var Ht=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(Ot=0;Ot0&&(v[4][bt.getCharCode(Ht[Ot])]=Ot);return v}(Vi.createInt32Array(5,256)),F1=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const N1=function(){function v(a){this.text=a}return v.prototype.encode=function(){for(var a=bt.getCharCode(" "),u=bt.getCharCode("\n"),w=E_.singletonList(D_.INITIAL_STATE),U=0;U0?(w=v.updateStateListForPair(w,U,Y),U++):w=this.updateStateListForChar(w,U)}return E_.min(w,function(Pe,Ge){return Pe.getBitCount()-Ge.getBitCount()}).toBitArray(this.text)},v.prototype.updateStateListForChar=function(a,u){var w,U,Y=[];try{for(var le=F1(a),ge=le.next();!ge.done;ge=le.next())this.updateStateForChar(ge.value,u,Y)}catch(Ge){w={error:Ge}}finally{try{ge&&!ge.done&&(U=le.return)&&U.call(le)}finally{if(w)throw w.error}}return v.simplifyStates(Y)},v.prototype.updateStateForChar=function(a,u,w){for(var U=255&this.text[u],Y=I_[a.getMode()][U]>0,le=null,ge=0;ge<=4;ge++){var Pe=I_[ge][U];if(Pe>0){if(null==le&&(le=a.endBinaryShift(u)),!Y||ge===a.getMode()||2===ge){var Ge=le.latchAndAppend(ge,Pe);w.push(Ge)}if(!Y&&rh[a.getMode()][ge]>=0){var dt=le.shiftAndAppend(ge,Pe);w.push(dt)}}}if(a.getBinaryShiftByteCount()>0||0===I_[a.getMode()][U]){var _t=a.addBinaryShiftChar(u);w.push(_t)}},v.updateStateListForPair=function(a,u,w){var U,Y,le=[];try{for(var ge=F1(a),Pe=ge.next();!Pe.done;Pe=ge.next())this.updateStateForPair(Pe.value,u,w,le)}catch(dt){U={error:dt}}finally{try{Pe&&!Pe.done&&(Y=ge.return)&&Y.call(ge)}finally{if(U)throw U.error}}return this.simplifyStates(le)},v.updateStateForPair=function(a,u,w,U){var Y=a.endBinaryShift(u);if(U.push(Y.latchAndAppend(4,w)),4!==a.getMode()&&U.push(Y.shiftAndAppend(4,w)),3===w||4===w){var le=Y.latchAndAppend(2,16-w).latchAndAppend(2,1);U.push(le)}if(a.getBinaryShiftByteCount()>0){var ge=a.addBinaryShiftChar(u).addBinaryShiftChar(u+1);U.push(ge)}},v.simplifyStates=function(a){var u,w,U,Y,le=[];try{for(var ge=F1(a),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,dt=!0,_t=function(Zr){if(Zr.isBetterThanOrEqualTo(Ge))return dt=!1,"break";Ge.isBetterThanOrEqualTo(Zr)&&(le=le.filter(function(dn){return dn!==Zr}))};try{for(var Ot=(U=void 0,F1(le)),Ht=Ot.next();!Ht.done&&"break"!==_t(Ht.value);Ht=Ot.next());}catch(Zr){U={error:Zr}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}dt&&le.push(Ge)}}catch(Zr){u={error:Zr}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(u)throw u.error}}return le},v}(),Ey=function(){function v(){}return v.encodeBytes=function(a){return v.encode(a,v.DEFAULT_EC_PERCENT,v.DEFAULT_AZTEC_LAYERS)},v.encode=function(a,u,w){var ge,Pe,Ge,dt,_t,U=new N1(a).encode(),Y=pi.truncDivision(U.getSize()*u,100)+11,le=U.getSize()+Y;if(w!==v.DEFAULT_AZTEC_LAYERS){if(ge=w<0,(Pe=Math.abs(w))>(ge?v.MAX_NB_BITS_COMPACT:v.MAX_NB_BITS))throw new ki(bt.format("Illegal value %s for layers",w));var Ot=(Ge=v.totalBitsInLayer(Pe,ge))-Ge%(dt=v.WORD_SIZE[Pe]);if((_t=v.stuffBits(U,dt)).getSize()+Y>Ot)throw new ki("Data to large for user specified layer");if(ge&&_t.getSize()>64*dt)throw new ki("Data to large for user specified layer")}else{dt=0,_t=null;for(var Ht=0;;Ht++){if(Ht>v.MAX_NB_BITS)throw new ki("Data too large for an Aztec code");if(!(le>(Ge=v.totalBitsInLayer(Pe=(ge=Ht<=3)?Ht+1:Ht,ge)))&&((null==_t||dt!==v.WORD_SIZE[Pe])&&(_t=v.stuffBits(U,dt=v.WORD_SIZE[Pe])),Ot=Ge-Ge%dt,!(ge&&_t.getSize()>64*dt)&&_t.getSize()+Y<=Ot))break}}var Tn,Sr=v.generateCheckWords(_t,Ge,dt),Ur=_t.getSize()/dt,Zr=v.generateModeMessage(ge,Pe,Ur),dn=(ge?11:14)+4*Pe,ln=new Int32Array(dn);if(ge)for(Tn=dn,Ht=0;Ht=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(Array.from(Ge)),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t.appendBits(Ht.value,w)}catch(Ur){U={error:Ur}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}return _t},v.bitsToWords=function(a,u,w){var Y,le,U=new Int32Array(w);for(Y=0,le=a.getSize()/u;Y=U||a.get(le+Pe))&&(ge|=1<>10}return Y},a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth(),Y=u*U;return null===w?w=this.buffer.slice(Y,Y+U):(w.length0&&Y[Y.length-1])&&(6===Ge[0]||2===Ge[0])){u=0;continue}if(3===Ge[0]&&(!Y||Ge[1]>Y[0]&&Ge[1]=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},wl={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},uf=function(){function v(a,u,w){void 0===u&&(u=new Map),void 0===w&&(w={}),this.reader=a,this.hints=u,this.options=Bm(Bm({},wl),w)}return Object.defineProperty(v.prototype,"possibleFormats",{set:function(a){this.hints.set(Di.POSSIBLE_FORMATS,a)},enumerable:!1,configurable:!0}),v.addVideoSource=function(a,u){try{a.srcObject=u}catch{console.error("got interrupted by new loading request")}},v.mediaStreamSetTorch=function(a,u){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return[4,a.applyConstraints({advanced:[{fillLightMode:u?"flash":"off",torch:!!u}]})];case 1:return w.sent(),[2]}})})},v.mediaStreamIsTorchCompatible=function(a){var u,w,U=a.getVideoTracks();try{for(var Y=Fm(U),le=Y.next();!le.done;le=Y.next())if(v.mediaStreamIsTorchCompatibleTrack(le.value))return!0}catch(Pe){u={error:Pe}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return!1},v.mediaStreamIsTorchCompatibleTrack=function(a){try{return"torch"in a.getCapabilities()}catch(w){return console.error(w),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},v.isVideoPlaying=function(a){return a.currentTime>0&&!a.paused&&a.readyState>2},v.getMediaElement=function(a,u){var w=document.getElementById(a);if(!w)throw new bs("element with id '".concat(a,"' not found"));if(w.nodeName.toLowerCase()!==u.toLowerCase())throw new bs("element with id '".concat(a,"' must be an ").concat(u," element"));return w},v.createVideoElement=function(a){if(a instanceof HTMLVideoElement)return a;if("string"==typeof a)return v.getMediaElement(a,"video");if(!a&&typeof document<"u"){var u=document.createElement("video");return u.width=200,u.height=200,u}throw new Error("Couldn't get videoElement from videoSource!")},v.prepareImageElement=function(a){if(a instanceof HTMLImageElement)return a;if("string"==typeof a)return v.getMediaElement(a,"img");if(typeof a>"u"){var u=document.createElement("img");return u.width=200,u.height=200,u}throw new Error("Couldn't get imageElement from imageSource!")},v.prepareVideoElement=function(a){var u=v.createVideoElement(a);return u.setAttribute("autoplay","true"),u.setAttribute("muted","true"),u.setAttribute("playsinline","true"),u},v.isImageLoaded=function(a){return!(!a.complete||0===a.naturalWidth)},v.createBinaryBitmapFromCanvas=function(a){var u=new Hx(a),w=new mc(u);return new jc(w)},v.drawImageOnCanvas=function(a,u){a.drawImage(u,0,0)},v.getMediaElementDimensions=function(a){if(a instanceof HTMLVideoElement)return{height:a.videoHeight,width:a.videoWidth};if(a instanceof HTMLImageElement)return{height:a.naturalHeight||a.height,width:a.naturalWidth||a.width};throw new Error("Couldn't find the Source's dimensions!")},v.createCaptureCanvas=function(a){if(!a)throw new bs("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var u=document.createElement("canvas"),w=v.getMediaElementDimensions(a),U=w.width,Y=w.height;return u.style.width=U+"px",u.style.height=Y+"px",u.width=U,u.height=Y,u},v.tryPlayVideo=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:if(a?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(v.isVideoPlaying(a))return console.warn("Trying to play video that is already playing."),[2,!0];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,a.play()];case 2:return w.sent(),[2,!0];case 3:return u=w.sent(),console.warn("It was not possible to play the video.",u),[2,!1];case 4:return[2]}})})},v.createCanvasFromMediaElement=function(a){var u=v.createCaptureCanvas(a),w=u.getContext("2d");if(!w)throw new Error("Couldn't find Canvas 2D Context.");return v.drawImageOnCanvas(w,a),u},v.createBinaryBitmapFromMediaElem=function(a){var u=v.createCanvasFromMediaElement(a);return v.createBinaryBitmapFromCanvas(u)},v.destroyImageElement=function(a){a.src="",a.removeAttribute("src"),a=void 0},v.listVideoInputDevices=function(){return bl(this,void 0,void 0,function(){var a,u,w,U,Y,le,ge,Pe,_t,Ot;return nl(this,function(Ht){switch(Ht.label){case 0:if(!M_())throw new Error("Can't enumerate devices, navigator is not present.");if(!function Sy(){return!(!function $1(){return M_()&&!!navigator.mediaDevices}()||!navigator.mediaDevices.enumerateDevices)}())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:a=Ht.sent(),u=[];try{for(w=Fm(a),U=w.next();!U.done;U=w.next())"videoinput"===(le="video"===(Y=U.value).kind?"videoinput":Y.kind)&&(ge=Y.deviceId||Y.id,Pe=Y.label||"Video device ".concat(u.length+1),u.push({deviceId:ge,label:Pe,kind:le,groupId:Y.groupId}))}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,u]}})})},v.findDeviceById=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:return[4,v.listVideoInputDevices()];case 1:return(u=w.sent())?[2,u.find(function(U){return U.deviceId===a})]:[2]}})})},v.cleanVideoSource=function(a){if(a){try{a.srcObject=null}catch{a.src=""}a&&a.removeAttribute("src")}},v.releaseAllStreams=function(){0!==v.streamTracker.length&&v.streamTracker.forEach(function(a){a.getTracks().forEach(function(u){return u.stop()})}),v.streamTracker=[]},v.playVideoOnLoadAsync=function(a,u){return bl(this,void 0,void 0,function(){return nl(this,function(U){switch(U.label){case 0:return[4,v.tryPlayVideo(a)];case 1:return U.sent()?[2,!0]:[2,new Promise(function(Y,le){var ge=setTimeout(function(){v.isVideoPlaying(a)||(le(!1),a.removeEventListener("canplay",Pe))},u),Pe=function(){v.tryPlayVideo(a).then(function(Ge){clearTimeout(ge),a.removeEventListener("canplay",Pe),Y(Ge)})};a.addEventListener("canplay",Pe)})]}})})},v.attachStreamToVideo=function(a,u,w){return void 0===w&&(w=5e3),bl(this,void 0,void 0,function(){var U;return nl(this,function(Y){switch(Y.label){case 0:return U=v.prepareVideoElement(u),v.addVideoSource(U,a),[4,v.playVideoOnLoadAsync(U,w)];case 1:return Y.sent(),[2,U]}})})},v._waitImageLoad=function(a){return new Promise(function(u,w){var Y=setTimeout(function(){v.isImageLoaded(a)||(a.removeEventListener("load",le),w())},1e4),le=function(){clearTimeout(Y),a.removeEventListener("load",le),u()};a.addEventListener("load",le)})},v.checkCallbackFnOrThrow=function(a){if(!a)throw new bs("`callbackFn` is a required parameter, you cannot capture results without it.")},v.disposeMediaStream=function(a){a.getVideoTracks().forEach(function(u){return u.stop()}),a=void 0},v.prototype.decode=function(a){var u=v.createCanvasFromMediaElement(a);return this.decodeFromCanvas(u)},v.prototype.decodeBitmap=function(a){return this.reader.decode(a,this.hints)},v.prototype.decodeFromCanvas=function(a){var u=v.createBinaryBitmapFromCanvas(a);return this.decodeBitmap(u)},v.prototype.decodeFromImageElement=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:if(!a)throw new bs("An image element must be provided.");return u=v.prepareImageElement(a),[4,this._decodeOnLoadImage(u)];case 1:return[2,w.sent()]}})})},v.prototype.decodeFromImageUrl=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:if(!a)throw new bs("An URL must be provided.");(u=v.prepareImageElement()).src=a,w.label=1;case 1:return w.trys.push([1,,3,4]),[4,this.decodeFromImageElement(u)];case 2:return[2,w.sent()];case 3:return v.destroyImageElement(u),[7];case 4:return[2]}})})},v.prototype.decodeFromConstraints=function(a,u,w){return bl(this,void 0,void 0,function(){var U,Y;return nl(this,function(le){switch(le.label){case 0:return v.checkCallbackFnOrThrow(w),[4,this.getUserMedia(a)];case 1:U=le.sent(),le.label=2;case 2:return le.trys.push([2,4,,5]),[4,this.decodeFromStream(U,u,w)];case 3:return[2,le.sent()];case 4:throw Y=le.sent(),v.disposeMediaStream(U),Y;case 5:return[2]}})})},v.prototype.decodeFromStream=function(a,u,w){return bl(this,void 0,void 0,function(){var Y,ge,Pe,Ge,_t,Ot,Ht=this;return nl(this,function(Sr){switch(Sr.label){case 0:return v.checkCallbackFnOrThrow(w),[4,v.attachStreamToVideo(a,u,this.options.tryPlayVideoTimeout)];case 1:return Y=Sr.sent(),ge=this.scan(Y,w,function(){v.disposeMediaStream(a),v.cleanVideoSource(Y)}),Pe=a.getVideoTracks(),Ge=Bm(Bm({},ge),{stop:function(){ge.stop()},streamVideoConstraintsApply:function(Ur,Zr){return bl(this,void 0,void 0,function(){var dn,ln,Tn,yi,Bi,Ki;return nl(this,function(po){switch(po.label){case 0:dn=Zr?Pe.filter(Zr):Pe,po.label=1;case 1:po.trys.push([1,6,7,8]),ln=Fm(dn),Tn=ln.next(),po.label=2;case 2:return Tn.done?[3,5]:[4,Tn.value.applyConstraints(Ur)];case 3:po.sent(),po.label=4;case 4:return Tn=ln.next(),[3,2];case 5:return[3,8];case 6:return yi=po.sent(),Bi={error:yi},[3,8];case 7:try{Tn&&!Tn.done&&(Ki=ln.return)&&Ki.call(ln)}finally{if(Bi)throw Bi.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(Ur){return Pe.find(Ur).getConstraints()},streamVideoSettingsGet:function(Ur){return Pe.find(Ur).getSettings()},streamVideoCapabilitiesGet:function(Ur){return Pe.find(Ur).getCapabilities()}}),v.mediaStreamIsTorchCompatible(a)&&(_t=Pe?.find(function(Ur){return v.mediaStreamIsTorchCompatibleTrack(Ur)}),Ge.switchTorch=Ot=function(Ur){return bl(Ht,void 0,void 0,function(){return nl(this,function(Zr){switch(Zr.label){case 0:return[4,v.mediaStreamSetTorch(_t,Ur)];case 1:return Zr.sent(),[2]}})})},Ge.stop=function(){return bl(Ht,void 0,void 0,function(){return nl(this,function(Ur){switch(Ur.label){case 0:return ge.stop(),[4,Ot(!1)];case 1:return Ur.sent(),[2]}})})}),[2,Ge]}})})},v.prototype.decodeFromVideoDevice=function(a,u,w){return bl(this,void 0,void 0,function(){return nl(this,function(le){switch(le.label){case 0:return v.checkCallbackFnOrThrow(w),[4,this.decodeFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u,w)];case 1:return[2,le.sent()]}})})},v.prototype.decodeFromVideoElement=function(a,u){return bl(this,void 0,void 0,function(){var w;return nl(this,function(Y){switch(Y.label){case 0:if(v.checkCallbackFnOrThrow(u),!a)throw new bs("A video element must be provided.");return w=v.prepareVideoElement(a),[4,v.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return Y.sent(),[2,this.scan(w,u)]}})})},v.prototype.decodeFromVideoUrl=function(a,u){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(ge){switch(ge.label){case 0:if(v.checkCallbackFnOrThrow(u),!a)throw new bs("An URL must be provided.");return(w=v.prepareVideoElement()).src=a,U=function(){v.cleanVideoSource(w)},[4,v.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return ge.sent(),[2,this.scan(w,u,U)]}})})},v.prototype.decodeOnceFromConstraints=function(a,u){return bl(this,void 0,void 0,function(){var w;return nl(this,function(U){switch(U.label){case 0:return[4,this.getUserMedia(a)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,u)];case 2:return[2,U.sent()]}})})},v.prototype.decodeOnceFromStream=function(a,u){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(le){switch(le.label){case 0:return w=!!u,[4,v.attachStreamToVideo(a,u)];case 1:U=le.sent(),le.label=2;case 2:return le.trys.push([2,,4,5]),[4,this.scanOneResult(U)];case 3:return[2,le.sent()];case 4:return w||v.cleanVideoSource(U),[7];case 5:return[2]}})})},v.prototype.decodeOnceFromVideoDevice=function(a,u){return bl(this,void 0,void 0,function(){return nl(this,function(Y){switch(Y.label){case 0:return[4,this.decodeOnceFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u)];case 1:return[2,Y.sent()]}})})},v.prototype.decodeOnceFromVideoElement=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(U){switch(U.label){case 0:if(!a)throw new bs("A video element must be provided.");return u=v.prepareVideoElement(a),[4,v.playVideoOnLoadAsync(u,this.options.tryPlayVideoTimeout)];case 1:return U.sent(),[4,this.scanOneResult(u)];case 2:return[2,U.sent()]}})})},v.prototype.decodeOnceFromVideoUrl=function(a){return bl(this,void 0,void 0,function(){var u,w;return nl(this,function(U){switch(U.label){case 0:if(!a)throw new bs("An URL must be provided.");(u=v.prepareVideoElement()).src=a,w=this.decodeOnceFromVideoElement(u),U.label=1;case 1:return U.trys.push([1,,3,4]),[4,w];case 2:return[2,U.sent()];case 3:return v.cleanVideoSource(u),[7];case 4:return[2]}})})},v.prototype.scanOneResult=function(a,u,w,U){var Y=this;return void 0===u&&(u=!0),void 0===w&&(w=!0),void 0===U&&(U=!0),new Promise(function(le,ge){Y.scan(a,function(Pe,Ge,dt){if(Pe)return le(Pe),void dt.stop();if(Ge){if(Ge instanceof Wn&&u||Ge instanceof rs&&w||Ge instanceof Qn&&U)return;dt.stop(),ge(Ge)}})})},v.prototype.scan=function(a,u,w){var U=this;v.checkCallbackFnOrThrow(u);var le,Y=v.createCaptureCanvas(a);try{le=Y.getContext("2d",{willReadFrequently:!0})}catch{le=Y.getContext("2d")}if(!le)throw new Error("Couldn't create canvas for visual element scan.");var Ge,ge=function(){le=void 0,Y=void 0},Pe=!1,_t={stop:function(){Pe=!0,clearTimeout(Ge),ge(),w&&w()}},Ot=function(){if(!Pe)try{v.drawImageOnCanvas(le,a);var Ht=U.decodeFromCanvas(Y);u(Ht,void 0,_t),Ge=setTimeout(Ot,U.options.delayBetweenScanSuccess)}catch(dn){if(u(void 0,dn,_t),dn instanceof rs||dn instanceof Qn||dn instanceof Wn)return void(Ge=setTimeout(Ot,U.options.delayBetweenScanAttempts));ge(),w&&w(dn)}};return Ot(),_t},v.prototype._decodeOnLoadImage=function(a){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return v.isImageLoaded(a)?[3,2]:[4,v._waitImageLoad(a)];case 1:w.sent(),w.label=2;case 2:return[2,this.decode(a)]}})})},v.prototype.getUserMedia=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:return[4,navigator.mediaDevices.getUserMedia(a)];case 1:return u=w.sent(),v.streamTracker.push(u),[2,u]}})})},v.streamTracker=[],v}(),V1=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Af=(function(v){V1(function a(u,w){return v.call(this,new We,u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),T_=(function(v){Af(function a(u,w){return v.call(this,new Ac(u),u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Ay=(function(v){T_(function a(u,w){return v.call(this,new y0,u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Gx=function(v){function a(u,w){var U=this,Y=new ny;return Y.setHints(u),(U=v.call(this,Y,u,w)||this).reader=Y,U}return Ay(a,v),Object.defineProperty(a.prototype,"possibleFormats",{set:function(u){this.hints.set(Di.POSSIBLE_FORMATS,u),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),a.prototype.decodeBitmap=function(u){return this.reader.decodeWithState(u)},a.prototype.setHints=function(u){this.hints=u,this.reader.setHints(this.hints)},a}(uf),Xx=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Jx=(function(v){Xx(function a(u,w){return v.call(this,new S0,u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Ih=(function(v){Jx(function a(u,w){return v.call(this,new u1,u,w)||this},v)}(uf),"http://www.w3.org/2000/svg"),Mh=(function(){function v(a){if("string"==typeof a){var u=document.getElementById(a);if(!u)throw new Error("Could not find a Container element with '".concat(a,"'."));this.containerElement=u}else this.containerElement=a}v.prototype.write=function(a,u,w,U){if(0===a.length)throw new ki("Found empty contents");if(u<0||w<0)throw new ki("Requested dimensions are too small: "+u+"x"+w);var Y=U&&void 0!==U.get(as.MARGIN)?Number.parseInt(U.get(as.MARGIN).toString(),10):v.QUIET_ZONE_SIZE,le=this.encode(U,a);return this.renderResult(le,u,w,Y)},v.prototype.createSVGElement=function(a,u){var w=document.createElementNS(v.SVG_NS,"svg");return w.setAttributeNS(Ih,"width",u.toString()),w.setAttributeNS(Ih,"height",a.toString()),w},v.prototype.createSvgPathPlaceholderElement=function(a,u){var w=document.createElementNS(v.SVG_NS,"path");return w.setAttributeNS(Ih,"d","M0 0h".concat(a,"v").concat(u,"H0z")),w.setAttributeNS(Ih,"fill","none"),w},v.prototype.createSvgRectElement=function(a,u,w,U){var Y=document.createElementNS(v.SVG_NS,"rect");return Y.setAttributeNS(Ih,"x",a.toString()),Y.setAttributeNS(Ih,"y",u.toString()),Y.setAttributeNS(Ih,"height",w.toString()),Y.setAttributeNS(Ih,"width",U.toString()),Y.setAttributeNS(Ih,"fill","#000000"),Y},v.prototype.encode=function(a,u){var w=Al.L;if(a&&void 0!==a.get(as.ERROR_CORRECTION)){var U=a.get(as.ERROR_CORRECTION).toString();w=Al.fromString(U)}return C0.encode(u,w,a)},v.prototype.renderResult=function(a,u,w,U){var Y=a.getMatrix();if(null===Y)throw new ou;var le=Y.getWidth(),ge=Y.getHeight(),Pe=le+2*U,Ge=ge+2*U,dt=Math.max(u,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(dt/Pe),Math.floor(_t/Ge)),Ht=Math.floor((dt-le*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),Ur=this.createSVGElement(dt,_t),Zr=this.createSvgPathPlaceholderElement(u,w);Ur.appendChild(Zr),this.containerElement.appendChild(Ur);for(var dn=0,ln=Sr;dn{if(!ge)return void U.next({result:le});const Pe=ge.name;Pe===Wn.name||Pe===rs.name||Pe===Qn.name||ge.message.includes("No MultiFormat Readers were able to detect the code.")?U.next({error:ge}):(U.error(ge),w.scannerControls.stop(),w.scannerControls=void 0)}),w.scannerControls={...Y,stop(){Y.stop(),U.complete()}}}catch(le){U.error(le),w.scannerControls?.stop(),w.scannerControls=void 0}return U.asObservable()})()}}let Dy=(()=>{class v{get codeReader(){return this._codeReader}set device(u){this._ready?this.isAutostarting?console.warn("Avoid setting a device during auto-start."):this.isCurrentDevice(u)?console.warn("Setting the same device is not allowed."):this.hasPermission?this.setDevice(u):console.warn("Permissions not set yet, waiting for them to be set to apply device change."):this._devicePreStart=u}get device(){return this._device}get formats(){return this.hints.get(Di.POSSIBLE_FORMATS)}set formats(u){if("string"==typeof u)throw new Error("Invalid formats, make sure the [formats] input is a binding.");const w=u.map(Y=>this.getBarcodeFormatOrFail(Y)),U=this.hints;U.set(Di.POSSIBLE_FORMATS,w),this.hints=U}get hints(){return this._hints}set hints(u){this._hints=u,this.codeReader?.setHints(this._hints)}set videoConstraints(u){const w=this.codeReader?.getScannerControls();w&&w?.streamVideoConstraintsApply(u)}set isAutostarting(u){this._isAutostarting=u,this.autostarting.next(u)}get isAutostarting(){return this._isAutostarting}set torch(u){try{this.getCodeReader().getScannerControls().switchTorch(u)}catch{}}set enable(u){this._enabled!==!!u&&(this._enabled=!!u,this._enabled?this.device?this.scanFromDevice(this.device.deviceId):this.init():(this.reset(),z1.releaseAllStreams()))}get enabled(){return this._enabled}get tryHarder(){return this.hints.get(Di.TRY_HARDER)}set tryHarder(u){const w=this.hints;u?w.set(Di.TRY_HARDER,!0):w.delete(Di.TRY_HARDER),this.hints=w}constructor(){this.timeBetweenScans=500,this.delayBetweenScanSuccess=500,this.previewFitMode="cover",this.poster="",this._ready=!1,this.autostarted=new c.bkB,this.autostarting=new c.bkB,this.torchCompatible=new c.bkB(!1),this.scanSuccess=new c.bkB,this.scanFailure=new c.bkB,this.scanError=new c.bkB,this.scanComplete=new c.bkB,this.camerasFound=new c.bkB,this.camerasNotFound=new c.bkB,this.permissionResponse=new c.bkB(!0),this.hasDevices=new c.bkB,this.deviceChange=new c.bkB,this._enabled=!0,this._hints=new Map,this.autofocusEnabled=!0,this.autostart=!0,this.formats=[Do.QR_CODE],this.hasNavigator=typeof navigator<"u",this.isMediaDevicesSupported=this.hasNavigator&&!!navigator.mediaDevices}askForPermission(){var u=this;return(0,B.A)(function*(){if(!u.hasNavigator)return console.error("@zxing/ngx-scanner","Can't ask permission, navigator is not present."),u.setPermission(null),u.hasPermission;if(!u.isMediaDevicesSupported)return console.error("@zxing/ngx-scanner","Can't get user media, this is not supported."),u.setPermission(null),u.hasPermission;let w,U;try{w=yield u.getAnyVideoDevice(),U=!!w}catch(Y){return u.handlePermissionException(Y)}finally{u.terminateStream(w)}return u.setPermission(U),U})()}getAnyVideoDevice(){return navigator.mediaDevices.getUserMedia({video:!0})}terminateStream(u){u&&u.getTracks().forEach(w=>w.stop()),u=void 0}init(){var u=this;return(0,B.A)(function*(){if(!u.autostart)return console.warn("Feature 'autostart' disabled. Permissions and devices recovery has to be run manually."),u.initAutostartOff(),void(u._ready=!0);yield u.initAutostartOn(),u._ready=!0})()}initAutostartOff(){this.isAutostarting=!1,this.updateVideoInputDevices(),this._device&&this._devicePreStart&&this.setDevice(this._devicePreStart)}initAutostartOn(){var u=this;return(0,B.A)(function*(){let w;u.isAutostarting=!0;try{w=yield u.askForPermission()}catch(U){return void console.error("Exception occurred while asking for permission:",U)}if(w){const U=yield u.updateVideoInputDevices();yield u.autostartScanner([...U])}u.isAutostarting=!1,u.autostarted.next()})()}isCurrentDevice(u){return u?.deviceId===this._device?.deviceId}ngOnDestroy(){this.reset(),uf.cleanVideoSource(this.previewElemRef.nativeElement),z1.releaseAllStreams()}ngOnInit(){this.init()}scanStop(){this._scanSubscription&&(this.codeReader?.getScannerControls().stop(),this._scanSubscription?.unsubscribe(),this._scanSubscription=void 0)}scanStart(){if(this._scanSubscription)throw new Error("There is already a scan process running.");if(!this._device)throw new Error("No device defined, cannot start scan, please define a device.");this.scanFromDevice(this._device.deviceId)}restart(){this._codeReader=void 0;const u=this._reset();u&&(this.device=u)}updateVideoInputDevices(){var u=this;return(0,B.A)(function*(){const w=(yield uf.listVideoInputDevices())||[],U=w&&w.length>0;return u.hasDevices.next(U),u.camerasFound.next([...w]),U||u.camerasNotFound.next(null),w})()}autostartScanner(u){var w=this;return(0,B.A)(function*(){const Y=u.find(({label:le})=>/back|tr\xe1s|rear|traseira|environment|ambiente/gi.test(le))||u.pop();if(!Y)throw new Error("Impossible to autostart, no input devices available.");yield w.setDevice(Y),w.deviceChange.next(Y)})()}dispatchScanSuccess(u){this.scanSuccess.next(u.getText())}dispatchScanFailure(u){this.scanFailure.next(u)}dispatchScanError(u){this.scanError.observed||(console.error(`zxing scanner component: ${u.name}`,u),console.warn("Use the `(scanError)` property to handle errors like this!")),this.scanError.next(u)}dispatchScanComplete(u){this.scanComplete.next(u)}handlePermissionException(u){let w;switch(console.error("@zxing/ngx-scanner","Error when asking for permission.",u),u.name){case"NotSupportedError":console.warn("@zxing/ngx-scanner",u.message),w=null,this.hasDevices.next(null);break;case"NotAllowedError":console.warn("@zxing/ngx-scanner",u.message),w=!1,this.hasDevices.next(!0);break;case"NotFoundError":console.warn("@zxing/ngx-scanner",u.message),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(u);break;case"NotReadableError":console.warn("@zxing/ngx-scanner","Couldn't read the device(s)'s stream, it's probably in use by another app."),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(u);break;default:console.warn("@zxing/ngx-scanner","I was not able to define if I have permissions for camera or not.",u),w=null}return this.setPermission(w),this.permissionResponse.error(u),w}getBarcodeFormatOrFail(u){return"string"==typeof u?Do[u.trim().toUpperCase()]:u}getCodeReader(){return this._codeReader||(this._codeReader=new z1(this.hints,{delayBetweenScanAttempts:this.timeBetweenScans,delayBetweenScanSuccess:this.delayBetweenScanSuccess})),this._codeReader}scanFromDevice(u){var w=this;return(0,B.A)(function*(){const U=w.previewElemRef.nativeElement,Y=w.getCodeReader(),le=yield Y.scanFromDeviceObservable(u,U);if(!le)throw new Error("Undefined decoding stream, aborting.");if(w._scanSubscription=le.subscribe(Ot=>w._onDecodeResult(Ot.result,Ot.error),Ot=>w._onDecodeError(Ot),()=>{}),w._scanSubscription.closed)return;const _t=typeof Y.getScannerControls().switchTorch<"u";w.torchCompatible.next(_t)})()}_onDecodeError(u){this.dispatchScanError(u)}_onDecodeResult(u,w){u?this.dispatchScanSuccess(u):this.dispatchScanFailure(w),this.dispatchScanComplete(u)}_reset(){if(!this._codeReader)return;this.scanStop();try{uf.cleanVideoSource(this.previewElemRef.nativeElement)}catch{}try{uf.releaseAllStreams()}catch{}this._codeReader=void 0;const u=this._device;return this.device=void 0,u}reset(){this._reset(),this.deviceChange.emit(null)}setDevice(u){var w=this;return(0,B.A)(function*(){w.scanStop(),w._device=u||void 0,w._device||uf.cleanVideoSource(w.previewElemRef.nativeElement),w._enabled&&u&&(yield w.scanFromDevice(u.deviceId))})()}setPermission(u){this.hasPermission=u,this.permissionResponse.next(u)}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["zxing-scanner"]],viewQuery:function(w,U){if(1&w&&c.GBs(cp,7),2&w){let Y;c.mGM(Y=c.lsd())&&(U.previewElemRef=Y.first)}},inputs:{autofocusEnabled:"autofocusEnabled",timeBetweenScans:"timeBetweenScans",delayBetweenScanSuccess:"delayBetweenScanSuccess",autostart:"autostart",previewFitMode:"previewFitMode",poster:"poster",device:"device",formats:"formats",videoConstraints:"videoConstraints",torch:"torch",enable:"enable",tryHarder:"tryHarder"},outputs:{autostarted:"autostarted",autostarting:"autostarting",torchCompatible:"torchCompatible",scanSuccess:"scanSuccess",scanFailure:"scanFailure",scanError:"scanError",scanComplete:"scanComplete",camerasFound:"camerasFound",camerasNotFound:"camerasNotFound",permissionResponse:"permissionResponse",hasDevices:"hasDevices",deviceChange:"deviceChange"},decls:6,vars:3,consts:[["preview",""],[3,"poster"]],template:function(w,U){1&w&&(c.j41(0,"video",1,0)(2,"p"),c.EFF(3," Your browser does not support this feature, please try to upgrade it. "),c.k0s(),c.j41(4,"p"),c.EFF(5," Seu navegador n\xe3o suporta este recurso, por favor tente atualiz\xe1-lo. "),c.k0s()()),2&w&&(c.xc7("object-fit",U.previewFitMode),c.Y8G("poster",U.poster,c.B4B))},styles:["[_nghost-%COMP%]{display:block}video[_ngcontent-%COMP%]{width:100%;height:auto;object-fit:contain}"],changeDetection:0})}}return v})(),Qx=(()=>{class v{static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275mod=c.$C({type:v})}static{this.\u0275inj=c.G2t({imports:[R.MD,T.YN]})}}return v})(),bC=(()=>{class v{constructor(u,w){this.data=u,this.dialogRef=w}ngAfterViewInit(){}scanSuccessHandler(u){console.log("Scan success:",u),this.dialogRef.close(u)}scanErrorHandler(u){console.log("Scan success:",u)}scanFailureHandler(u){console.log("Scan success:",u)}scanCompleteHandler(u){console.log("Scan success:",u)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(j.Vh),c.rXU(j.CP))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-qrcode-scan-dialog"]],standalone:!0,features:[c.aNF],decls:9,vars:1,consts:[["mat-dialog-title",""],[1,"qr-scanner",3,"scanSuccess","scanError","scanFailure","scanComplete"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(w,U){1&w&&(c.j41(0,"h2",0),c.EFF(1,"Scan QR Code"),c.k0s(),c.j41(2,"mat-dialog-content")(3,"zxing-scanner",1),c.bIt("scanSuccess",function(le){return U.scanSuccessHandler(le)})("scanError",function(le){return U.scanErrorHandler(le)})("scanFailure",function(le){return U.scanFailureHandler(le)})("scanComplete",function(le){return U.scanCompleteHandler(le)}),c.k0s()(),c.j41(4,"mat-dialog-actions")(5,"button",2),c.EFF(6,"Cancel"),c.k0s(),c.j41(7,"button",3),c.EFF(8,"Ok"),c.k0s()()),2&w&&(c.R7$(7),c.Y8G("mat-dialog-close",!0))},dependencies:[Qx,Dy,j.hM,j.tx,j.BI,j.E7,j.Yi,E.Hl,E.$z],styles:["[_nghost-%COMP%]{width:100vw;height:100vh}[_nghost-%COMP%] zxing-scanner[_ngcontent-%COMP%] {object-fit:contain}"]})}}return v})();var wC=f(82546),_C=f(63528),R_=f(43881);let K1=(()=>{class v{constructor(){}transform(u,...w){return u?v.time(u):"00:00:00"}static time(u){var w=Math.floor(u/60/60),U=Math.floor(u/60)-60*w,Y=u%60;return w.toString().padStart(2,"0")+":"+U.toString().padStart(2,"0")+":"+Y.toString().padStart(2,"0")}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275pipe=c.EJ8({name:"time",type:v,pure:!0,standalone:!0})}}return v})();const _M=v=>({miniplayer:v});function EM(v,a){if(1&v&&(c.j41(0,"div",1),c.EFF(1),c.k0s()),2&v){const u=c.XpG();c.R7$(),c.JRh(u.player.title())}}function L0(v,a){if(1&v){const u=c.RV6();c.j41(0,"div")(1,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.player.play())}),c.j41(2,"mat-icon"),c.EFF(3,"play_arrow"),c.k0s()()()}}function xM(v,a){if(1&v){const u=c.RV6();c.j41(0,"div")(1,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.player.pause())}),c.j41(2,"mat-icon"),c.EFF(3,"pause"),c.k0s()()()}}function SM(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",6)(1,"div",8),c.EFF(2),c.nI1(3,"time"),c.k0s(),c.j41(4,"div",9)(5,"mat-slider",10)(6,"input",11),c.mxI("ngModelChange",function(U){c.eBV(u);const Y=c.XpG();return c.DH7(Y.player.time,U)||(Y.player.time=U),c.Njj(U)}),c.k0s()()(),c.j41(7,"div",12),c.EFF(8),c.nI1(9,"time"),c.k0s()()}if(2&v){const u=c.XpG();c.R7$(2),c.JRh(c.bMT(3,7,u.player.time)),c.R7$(3),c.Y8G("displayWith",u.formatLabel)("max",u.player.duration)("min",0)("step",1),c.R7$(),c.R50("ngModel",u.player.time),c.R7$(2),c.JRh(c.bMT(9,9,u.player.duration))}}function qx(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",7)(1,"div")(2,"button",13)(3,"mat-icon"),c.EFF(4,"queue"),c.k0s()()(),c.j41(5,"div")(6,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.closeTray())}),c.j41(7,"mat-icon"),c.EFF(8,"close"),c.k0s()()()()}}let k_=(()=>{class v{constructor(u,w){this.renderer=u,this.el=w,this.miniplayer=!1,this.layout=(0,c.WQX)(S.Y),this.player=(0,c.WQX)(_C.x)}formatLabel(u){return K1.time(u)}closeTray(){this.layout.tray.set(!1)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.sFG),c.rXU(c.aKT))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-player-controls"]],inputs:{miniplayer:"miniplayer"},standalone:!0,features:[c.aNF],decls:16,vars:7,consts:[[1,"player",3,"ngClass"],[1,"player-media"],[1,"player-controls"],[1,"player-controls-top"],["mat-icon-button","",1,"nodrag",3,"click"],["mat-icon-button","",3,"click"],[1,"player-controls-bottom"],[1,"player-actions"],[1,"media-timeline-1","hide-small2"],[1,"media-timeline-2"],["discrete","",1,"media-slider",3,"displayWith","max","min","step"],["matSliderThumb","",3,"ngModelChange","ngModel"],[1,"media-timeline-3","hide-small2"],["mat-icon-button",""]],template:function(w,U){1&w&&(c.j41(0,"div",0),c.DNE(1,EM,2,1,"div",1),c.j41(2,"div",2)(3,"div",3)(4,"div")(5,"button",4),c.bIt("click",function(){return U.player.previous()}),c.j41(6,"mat-icon"),c.EFF(7,"skip_previous"),c.k0s()()(),c.DNE(8,L0,4,0,"div")(9,xM,4,0,"div"),c.j41(10,"div")(11,"button",5),c.bIt("click",function(){return U.player.next()}),c.j41(12,"mat-icon"),c.EFF(13,"skip_next"),c.k0s()()()(),c.DNE(14,SM,10,11,"div",6),c.k0s(),c.DNE(15,qx,9,0,"div",7),c.k0s()),2&w&&(c.Y8G("ngClass",c.eq3(5,_M,U.miniplayer)),c.R7$(),c.vxM(U.miniplayer?-1:1),c.R7$(7),c.vxM(U.player.paused?8:9),c.R7$(6),c.vxM(U.miniplayer?-1:14),c.R7$(),c.vxM(U.miniplayer?-1:15))},dependencies:[K1,E.Hl,E.iY,M.m_,M.An,R.MD,R.YU,R_.Ez,R_.IV,R_.OU,k.fS,T.YN,T.me,T.BC,T.vS],styles:[".player[_ngcontent-%COMP%]{display:flex;flex-direction:row;padding:1em}.miniplayer[_ngcontent-%COMP%]{padding:0;margin:-4px;-webkit-app-region:drag}.player-media[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;align-items:center}.player-controls[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 50%;justify-content:center}.player-actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;justify-content:flex-end;align-items:center}.smaller[_ngcontent-%COMP%]{font-size:.8em}.player-controls-top[_ngcontent-%COMP%]{display:flex;justify-content:center}.player-controls-bottom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;font-size:.8em}"]})}}return v})();var va=f(51889),eS=f(43794),Cy=f(71997);const Iy=["*"],Nm=v=>({"title-bar-collapsed":v}),B_=v=>({"sidenav-collapsed":v}),H1=()=>["/introduction"],F_=()=>["/settings","notifications"],lp=v=>["/profile",v],j0=v=>["/profile",v,"edit"],il=()=>["/notifications"],Hu=()=>["/settings"],vd=()=>["/accounts"],My=()=>["/account/create"],jo=v=>({"sidenav-scroll-wrapper-tray":v}),Qa=(v,a,u)=>({"sidenav-content":v,"sidenav-content-marginless":a,"sidenav-content-custom":u});function Ty(v,a){1&v&&c.nrm(0,"img",15)}function Da(v,a){if(1&v&&c.EFF(0),2&v){const u=c.XpG().$implicit;c.SpI(" ",u.title," ")}}function U0(v,a){if(1&v&&(c.j41(0,"a",16,5)(2,"mat-icon",18),c.EFF(3),c.k0s(),c.DNE(4,Da,1,1),c.k0s()),2&v){const u=a.$implicit,w=c.sdS(1),U=c.XpG();c.Y8G("routerLink",u.path)("activated",w.isActive),c.R7$(3),c.JRh(u.data.icon),c.R7$(),c.vxM(U.collapsed()?-1:4)}}function $0(v,a){1&v&&(c.j41(0,"mat-icon",18),c.EFF(1,"chevron_right"),c.k0s())}function EC(v,a){1&v&&(c.j41(0,"mat-icon",18),c.EFF(1,"chevron_left"),c.k0s())}function Py(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",44),c.bIt("click",function(){c.eBV(u),c.XpG();const U=c.sdS(5);return c.Njj(U.toggle())}),c.j41(1,"mat-icon",45),c.EFF(2,"menu"),c.k0s()()}}function Oy(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",26),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.navigateBack())}),c.j41(1,"mat-icon"),c.EFF(2,"arrow_back"),c.k0s()()}}function Ry(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",46),c.bIt("click",function(){const U=c.eBV(u).$implicit;return c.Njj(U.action())}),c.j41(1,"mat-icon"),c.EFF(2),c.k0s()()}if(2&v){const u=a.$implicit;c.Y8G("title",u.name),c.R7$(2),c.JRh(u.icon)}}function W1(v,a){if(1&v){const u=c.RV6();c.j41(0,"input",47),c.mxI("ngModelChange",function(U){c.eBV(u);const Y=c.XpG();return c.DH7(Y.layout.searchInput,U)||(Y.layout.searchInput=U),c.Njj(U)}),c.bIt("input",function(U){c.eBV(u);const Y=c.XpG();return c.Njj(Y.onSearchInput(U))}),c.k0s()}if(2&v){const u=c.XpG();c.R50("ngModel",u.layout.searchInput)}}function V0(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",26),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.qrScan())}),c.j41(1,"mat-icon"),c.EFF(2,"qr_code_scanner"),c.k0s()()}}function z0(v,a){1&v&&(c.j41(0,"mat-icon"),c.EFF(1,"close"),c.k0s())}function N_(v,a){1&v&&(c.j41(0,"mat-icon"),c.EFF(1,"search"),c.k0s())}function ky(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",48),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.applyUpdate())}),c.j41(1,"mat-icon"),c.EFF(2,"get_app"),c.k0s()()}}function K0(v,a){if(1&v&&(c.j41(0,"button",30)(1,"mat-icon"),c.EFF(2),c.k0s(),c.j41(3,"span"),c.EFF(4),c.k0s(),c.j41(5,"div",49),c.EFF(6),c.nI1(7,"ago"),c.k0s()()),2&v){const u=a.$implicit;c.Y8G("routerLink",c.lJ4(7,il)),c.R7$(2),c.JRh(u.data.icon),c.R7$(2),c.JRh(u.data.title),c.R7$(2),c.Lme("",u.data.app," (",c.bMT(7,5,"2024-08-22 12:00"),")")}}function By(v,a){if(1&v&&(c.EFF(0),c.nrm(1,"br")),2&v){const u=c.XpG();c.SpI(" ",u.identity.identity.metadata.name,"")}}function Lp(v,a){if(1&v&&(c.j41(0,"strong"),c.EFF(1),c.k0s()),2&v){const u=c.XpG().$implicit;c.R7$(),c.SpI("",u.metadata.name," *")}}function L_(v,a){if(1&v&&(c.j41(0,"span"),c.EFF(1),c.k0s()),2&v){const u=c.XpG().$implicit;c.R7$(),c.JRh(u.metadata.name)}}function tS(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",29),c.bIt("click",function(){const U=c.eBV(u).$implicit,Y=c.XpG();return c.Njj(Y.changeAccount(U.did.uri))}),c.j41(1,"mat-icon"),c.EFF(2,"account_circle"),c.k0s(),c.DNE(3,Lp,2,1,"strong")(4,L_,2,1,"span"),c.k0s()}if(2&v){const u=a.$implicit,w=c.XpG();c.R7$(3),c.vxM(u.did.uri===w.identity.did?3:4)}}function rS(v,a){1&v&&(c.j41(0,"div",43),c.nrm(1,"app-player-controls"),c.k0s())}let nS=(()=>{class v{constructor(){var u=this;this.breakpointObserver=(0,c.WQX)(Fr.QP),this.localStorage=(0,c.WQX)(_i.s),this.storage=(0,c.WQX)(eS.n),this.identity=(0,c.WQX)(g.K),this.updateService=(0,c.WQX)(Io),this.profileService=(0,c.WQX)(Ma.p),this.app=(0,c.WQX)(m.d),this.layout=(0,c.WQX)(S.Y),this.navigation=(0,c.WQX)(Tt.o),this.notification=(0,c.WQX)(wC.J),this.dialog=(0,c.WQX)(j.bZ),this.router=(0,c.WQX)(x.Ix),this.rootRoutes=he.filter(w=>w.path).filter(w=>w.data&&1!=w.data.hide),this.isHandset$=this.breakpointObserver.observe("(max-width: 700px)").pipe((0,Ct.T)(w=>w.matches),(0,bn.t)()),this.notifications=(0,c.vPA)([]),this.collapsed=(0,c.vPA)(!1),(0,c.QZP)((0,B.A)(function*(){u.app.initialized()&&(yield u.loadNotifications())}))}changeAccount(u){var w=this;return(0,B.A)(function*(){w.identity.changeAccount(u),w.router.navigate(["/introduction"])})()}loadNotifications(){var u=this;return(0,B.A)(function*(){const w=yield u.notification.load();u.notifications.set(w)})()}copyDID(u){var w=this;return(0,B.A)(function*(){try{yield navigator.clipboard.writeText(u),w.app.openSnackBar("Your DID copied to clipboard")}catch(U){console.error("Failed to copy: ",U)}})()}qrScan(){this.dialog.open(bC,{data:{did:""},width:"100vw",height:"100vh"}).afterClosed().subscribe(w=>{console.log("The dialog was closed",w),this.router.navigate(["/profile",w])})}onSearchInput(u){null!==u.target.value?(clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{console.log("Handle search called!"),this.handleSearch(u.target.value)},750)):clearTimeout(this.debounceTimer)}handleSearch(u){u&&(u.includes(":")?this.router.navigate(["/profile",u]):this.router.navigate(["/search"],{queryParams:{query:u}}))}showQR(u){this.dialog.open(va.k,{data:{did:u}})}wipe(){var u=this;return(0,B.A)(function*(){u.localStorage.clear(),console.log("Local storage data has been wiped!"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DID_RESOLVERCACHE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_DATASTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_EVENTLOG"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGEINDEX"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGESTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/VAULT_STORE"),console.log("Data has been wiped!"),window.location.reload()})()}applyUpdate(){this.updateService.applyUpdate()}lock(){this.identity.lock()}navigateBack(){this.navigation.back()}collapseToggle(){this.collapsed.set(!this.collapsed())}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-layout"]],standalone:!0,features:[c.aNF],ngContentSelectors:Iy,decls:151,vars:68,consts:[["drawer",""],["menuNotifications","matMenu"],["menu","matMenu"],["menuAccounts","matMenu"],["menuLanguages","matMenu"],["link","routerLinkActive"],["id","title-bar",1,"title-bar",3,"ngClass"],["height","24","width","24","src","ariton-icon-dark.svg",1,"logo-icon-title-bar"],[3,"miniplayer"],["autosize","",1,"sidenav-container"],["fixedInViewport","",1,"sidenav",3,"ngClass","mode","opened"],[1,"toolbar-logo-container"],["src","ariton-icon-dark.svg",1,"toolbar-logo",3,"routerLink"],[1,"toolbar-text"],["srcset","ariton-text-light.svg","media","(prefers-color-scheme: dark)"],["src","ariton-text-dark.svg"],["mat-list-item","","routerLinkActive","",3,"routerLink","activated"],[3,"click"],["matListItemIcon",""],[1,"main-toolbar"],["type","button","aria-label","Toggle sidenav","mat-icon-button",""],["mat-icon-button",""],["mat-icon-button","",3,"title"],[1,"toolbar-spacer"],["type","search",1,"search-input",3,"ngModel"],[1,"toolbar-items"],["mat-icon-button","",3,"click"],["matTooltip","Update available. Click to update now.","mat-icon-button",""],["mat-icon-button","",1,"notification-toolbar",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"account-menu-profile",3,"routerLink"],["onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"account-menu-profile-icon",3,"src"],["mat-menu-item","",1,"account-menu-item",3,"routerLink"],["mat-menu-item","",1,"account-menu-item",3,"click"],["mat-menu-item","",3,"matMenuTriggerFor"],["mat-menu-item","",1,"notification-menu",3,"routerLink"],["href","https://help.ariton.app","target","_blank","mat-menu-item",""],["mat-menu-item",""],["mat-menu-item","",3,"disabled"],[1,"sidenav-scroll-wrapper",3,"ngClass"],["id","sidenav-content",3,"ngClass"],[1,"player"],["type","button","aria-label","Toggle sidenav","mat-icon-button","",3,"click"],["aria-label","Side nav toggle icon"],["mat-icon-button","",3,"click","title"],["type","search",1,"search-input",3,"ngModelChange","input","ngModel"],["matTooltip","Update available. Click to update now.","mat-icon-button","",3,"click"],[1,"notification-details","dimmed"]],template:function(w,U){if(1&w){const Y=c.RV6();c.NAR(),c.j41(0,"div",6),c.nrm(1,"img",7)(2,"app-player-controls",8),c.k0s(),c.j41(3,"mat-sidenav-container",9)(4,"mat-sidenav",10,0),c.nI1(6,"async"),c.nI1(7,"async"),c.nI1(8,"async"),c.j41(9,"mat-toolbar",11),c.nrm(10,"img",12),c.j41(11,"picture",13),c.nrm(12,"source",14),c.DNE(13,Ty,1,0,"img",15),c.k0s()(),c.j41(14,"mat-nav-list"),c.Z7z(15,U0,5,4,"a",16,c.Vm6),c.j41(17,"mat-list-item",17),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.collapseToggle())}),c.DNE(18,$0,2,0,"mat-icon",18)(19,EC,2,0,"mat-icon",18),c.k0s()()(),c.j41(20,"mat-sidenav-content")(21,"mat-toolbar",19),c.DNE(22,Py,3,0,"button",20),c.nI1(23,"async"),c.DNE(24,Oy,3,0,"button",21),c.Z7z(25,Ry,3,2,"button",22,c.fX1),c.j41(27,"span",23),c.DNE(28,W1,1,1,"input",24),c.k0s(),c.j41(29,"span",25),c.DNE(30,V0,3,0,"button",21),c.j41(31,"button",26),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.layout.toggleSearch())}),c.DNE(32,z0,2,0,"mat-icon")(33,N_,2,0,"mat-icon"),c.k0s(),c.DNE(34,ky,3,0,"button",27),c.j41(35,"button",28)(36,"mat-icon"),c.EFF(37,"notifications"),c.k0s()(),c.j41(38,"mat-menu",null,1)(40,"button",29),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.wipe())}),c.j41(41,"mat-icon"),c.EFF(42,"delete"),c.k0s(),c.j41(43,"span"),c.EFF(44,"Reset All Data (Wipe)"),c.k0s()(),c.nrm(45,"mat-divider"),c.j41(46,"button",30)(47,"mat-icon"),c.EFF(48,"settings"),c.k0s(),c.j41(49,"span"),c.EFF(50,"Notification Settings"),c.k0s()(),c.nrm(51,"mat-divider"),c.Z7z(52,K0,8,8,"button",30,c.fX1),c.k0s(),c.j41(54,"button",31)(55,"mat-icon"),c.EFF(56,"account_circle"),c.k0s()(),c.j41(57,"mat-menu",null,2)(59,"div",32),c.nrm(60,"img",33),c.nI1(61,"safeResourceUrl"),c.j41(62,"div")(63,"h2"),c.EFF(64),c.k0s(),c.EFF(65),c.nrm(66,"br"),c.EFF(67),c.nI1(68,"did"),c.nrm(69,"br"),c.DNE(70,By,2,1,"br"),c.k0s()(),c.j41(71,"button",34)(72,"mat-icon"),c.EFF(73,"account_circle"),c.k0s(),c.j41(74,"span"),c.EFF(75,"Edit Profile"),c.k0s()(),c.j41(76,"button",35),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.copyDID(U.identity.did))}),c.j41(77,"mat-icon"),c.EFF(78,"content_copy"),c.k0s(),c.j41(79,"span"),c.EFF(80,"Copy DID"),c.k0s()(),c.j41(81,"button",29),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.showQR(U.identity.did))}),c.j41(82,"mat-icon"),c.EFF(83,"qr_code"),c.k0s(),c.j41(84,"span"),c.EFF(85,"Show QR"),c.k0s()(),c.nrm(86,"mat-divider"),c.j41(87,"button",36)(88,"mat-icon"),c.EFF(89,"switch_account"),c.k0s(),c.j41(90,"span"),c.EFF(91,"Accounts"),c.k0s()(),c.j41(92,"button",29),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.lock())}),c.j41(93,"mat-icon"),c.EFF(94,"lock"),c.k0s(),c.j41(95,"span"),c.EFF(96,"Lock account"),c.k0s()(),c.nrm(97,"mat-divider"),c.j41(98,"button",36)(99,"mat-icon"),c.EFF(100,"translate"),c.k0s(),c.j41(101,"span"),c.EFF(102,"Language: English"),c.k0s()(),c.nrm(103,"mat-divider"),c.j41(104,"button",37)(105,"mat-icon"),c.EFF(106,"notifications"),c.k0s(),c.j41(107,"span"),c.EFF(108,"Notifications"),c.k0s()(),c.j41(109,"button",30)(110,"mat-icon"),c.EFF(111,"settings"),c.k0s(),c.j41(112,"span"),c.EFF(113,"Settings"),c.k0s()(),c.nrm(114,"mat-divider"),c.j41(115,"a",38)(116,"mat-icon"),c.EFF(117,"help"),c.k0s(),c.j41(118,"span"),c.EFF(119,"Help"),c.k0s()()(),c.j41(120,"mat-menu",null,3)(122,"button",30)(123,"mat-icon"),c.EFF(124,"manage_accounts"),c.k0s(),c.j41(125,"span"),c.EFF(126,"Manage Accounts"),c.k0s()(),c.nrm(127,"mat-divider"),c.Z7z(128,tS,5,1,"button",39,c.fX1),c.nrm(130,"mat-divider"),c.j41(131,"button",30)(132,"mat-icon"),c.EFF(133,"person_add"),c.k0s(),c.j41(134,"span"),c.EFF(135,"Add account"),c.k0s()()(),c.j41(136,"mat-menu",null,4)(138,"button",39)(139,"span"),c.EFF(140,"English"),c.k0s()(),c.j41(141,"button",40)(142,"span"),c.EFF(143,"Norwegian"),c.k0s()(),c.j41(144,"button",40)(145,"span"),c.EFF(146,"Serbian"),c.k0s()()()()(),c.j41(147,"div",41)(148,"div",42),c.SdG(149),c.k0s()(),c.DNE(150,rS,2,0,"div",43),c.k0s()()}if(2&w){const Y=c.sdS(39),le=c.sdS(58),ge=c.sdS(121),Pe=c.sdS(137);c.Y8G("ngClass",c.eq3(48,Nm,U.collapsed())),c.R7$(2),c.Y8G("miniplayer",!0),c.R7$(2),c.Y8G("ngClass",c.eq3(50,B_,U.collapsed()))("mode",c.bMT(6,36,U.isHandset$)?"over":"side")("opened",!1===c.bMT(7,38,U.isHandset$)),c.BMQ("role",c.bMT(8,40,U.isHandset$)?"dialog":"navigation"),c.R7$(6),c.Y8G("routerLink",c.lJ4(52,H1)),c.R7$(3),c.vxM(U.collapsed()?-1:13),c.R7$(2),c.Dyx(U.rootRoutes),c.R7$(3),c.vxM(U.collapsed()?18:19),c.R7$(4),c.vxM(c.bMT(23,42,U.isHandset$)?22:-1),c.R7$(2),c.vxM(U.layout.navigation()?24:-1),c.R7$(),c.Dyx(U.layout.actions()),c.R7$(3),c.vxM(U.layout.search()?28:-1),c.R7$(2),c.vxM(U.layout.search()?30:-1),c.R7$(2),c.vxM(U.layout.search()?32:33),c.R7$(2),c.vxM(U.updateService.isNewVersionAvailable?34:-1),c.R7$(),c.Y8G("matMenuTriggerFor",Y),c.R7$(11),c.Y8G("routerLink",c.lJ4(53,F_)),c.R7$(6),c.Dyx(U.notifications()),c.R7$(2),c.Y8G("matMenuTriggerFor",le),c.R7$(5),c.Y8G("routerLink",c.eq3(54,lp,U.identity.did)),c.R7$(),c.Y8G("src",c.bMT(61,44,U.profileService.avatar()),c.B4B),c.R7$(4),c.JRh(U.profileService.current().name),c.R7$(),c.SpI(" ",U.profileService.current().title,""),c.R7$(2),c.SpI(" ",c.bMT(68,46,U.identity.did),""),c.R7$(3),c.vxM(U.identity.identity?70:-1),c.R7$(),c.Y8G("routerLink",c.eq3(56,j0,U.identity.did)),c.R7$(16),c.Y8G("matMenuTriggerFor",ge),c.R7$(11),c.Y8G("matMenuTriggerFor",Pe),c.R7$(6),c.Y8G("routerLink",c.lJ4(58,il)),c.R7$(5),c.Y8G("routerLink",c.lJ4(59,Hu)),c.R7$(13),c.Y8G("routerLink",c.lJ4(60,vd)),c.R7$(6),c.Dyx(U.identity.identities),c.R7$(3),c.Y8G("routerLink",c.lJ4(61,My)),c.R7$(10),c.Y8G("disabled",!0),c.R7$(3),c.Y8G("disabled",!0),c.R7$(3),c.Y8G("ngClass",c.eq3(62,jo,U.layout.tray())),c.R7$(),c.Y8G("ngClass",c.sMw(64,Qa,U.layout.margin(),!U.layout.margin(),U.layout.custom())),c.R7$(2),c.vxM(U.layout.tray()?150:-1)}},dependencies:[j.hM,Qx,T.YN,T.me,T.BC,T.vS,V.RG,k.fS,R.MD,R.YU,R.Jj,Rs.d,Qe.s5,Qe.KQ,E.Hl,E.iY,pn,hr,Or,Yt,q.Fg,q._L,q.YE,q.ZV,Cy.q,M.m_,M.An,K.Cn,K.kk,K.fb,K.Cp,x.Wk,x.wQ,W.uc,W.oV,Mo.k,ne.g,k_],styles:[".toolbar-logo[_ngcontent-%COMP%]{max-height:40px;max-width:40px;width:100%;cursor:pointer}.player[_ngcontent-%COMP%]{height:96px}.account-menu-profile[_ngcontent-%COMP%]{color:var(--mat-menu-item-label-text-color);display:flex;gap:8px;margin:8px;align-items:center;cursor:pointer}.account-menu-profile[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;padding:0}.account-menu-profile-icon[_ngcontent-%COMP%]{width:64px;border-radius:50%}.account-menu-profile[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex-grow:2}.toolbar-text[_ngcontent-%COMP%]{margin-left:.3em;margin-top:.5em;width:100px;height:32px}.sidenav-container[_ngcontent-%COMP%]{height:100%}.mat-toolbar.mat-primary[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1}.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 80px - env(titlebar-area-height,0px));overflow:auto;border-radius:16px;box-sizing:border-box}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 192px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%], .sidenav-content-marginless[_ngcontent-%COMP%]{max-height:100%;overflow-y:auto;padding:16px;box-sizing:border-box}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}.sidenav-content-custom[_ngcontent-%COMP%]{height:100%;overflow:hidden!important}.column-content[_ngcontent-%COMP%]{overflow-y:scroll;box-sizing:border-box}.sidenav[_ngcontent-%COMP%]{width:200px;padding:0 8px;box-sizing:border-box}.sidenav-collapsed[_ngcontent-%COMP%]{width:72px}@media (max-width: 959.98px){.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 64px - env(titlebar-area-height,0px))}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 160px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%]{padding:8px}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}}.notification-menu[_ngcontent-%COMP%]{display:none}@media (max-width: 420px){.notification-toolbar[_ngcontent-%COMP%]{display:none}.notification-menu[_ngcontent-%COMP%]{display:block}}.title-bar[_ngcontent-%COMP%]{display:none}@media (display-mode: window-controls-overlay){.title-bar[_ngcontent-%COMP%]{-webkit-app-region:drag;flex:0 0 33px;display:flex;flex-direction:row;position:fixed;left:210px;top:env(titlebar-area-y,0);height:env(titlebar-area-height,33px);width:env(titlebar-area-width,100%);width:calc(env(titlebar-area-width,100%) - 210px);z-index:10000}mat-sidenav-content[_ngcontent-%COMP%]{padding-top:env(titlebar-area-height,0px)}}.title-bar-collapsed[_ngcontent-%COMP%]{left:80px!important;width:calc(env(titlebar-area-width,100%) - 80px)}.toolbar-logo-container[_ngcontent-%COMP%]{-webkit-app-region:drag}.logo-icon[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin-right:.4em}.logo-icon-title-bar[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin:4px 2em 4px 4px;display:none;flex:0 0 24px}@media screen and (max-height: 100px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}.logo-icon[_ngcontent-%COMP%]{display:none}.title-bar[_ngcontent-%COMP%]{left:0!important}.sidenav[_ngcontent-%COMP%], .main-toolbar[_ngcontent-%COMP%], mat-sidenav-content[_ngcontent-%COMP%]{display:none!important}}@media screen and (max-width: 599px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}}"]})}}return v})();var H0=f(9183);function W0(v,a){1&v&&c.nrm(0,"mat-spinner",4)}function Lm(v,a){1&v&&(c.j41(0,"span"),c.EFF(1,"Unlock"),c.k0s())}function j_(v,a){1&v&&(c.j41(0,"mat-error"),c.EFF(1,"Password is "),c.j41(2,"strong"),c.EFF(3,"invalid"),c.k0s()())}let xC=(()=>{class v{constructor(u){this.identityService=u,this.passwordInput=new T.MJ("",T.k0.required),this.unlocking=(0,c.vPA)(!1),this.invalidPassword=(0,c.vPA)(!1)}onSubmit(){var u=this;return(0,B.A)(function*(){u.unlocking.set(!0),(yield u.identityService.unlock(u.identityService.did,u.passwordInput.value))?(console.log("Vault unlocked"),u.invalidPassword.set(!1)):(console.log("Failed to unlock vault"),u.invalidPassword.set(!0)),u.unlocking.set(!1)})()}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(g.K))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-unlock"]],standalone:!0,features:[c.aNF],decls:18,vars:4,consts:[["src","ariton-icon-dark.svg",1,"unlock-logo"],[3,"ngSubmit"],["matInput","","type","password",3,"formControl"],["mat-flat-button","","type","submit","color","primary",3,"disabled"],["diameter","20"]],template:function(w,U){1&w&&(c.nrm(0,"img",0),c.j41(1,"h1"),c.EFF(2,"Unlock your account"),c.k0s(),c.j41(3,"p"),c.EFF(4,"You have configured your Ariton account with a secure personal password."),c.nrm(5,"br"),c.EFF(6,"Enter password to unlock your account."),c.k0s(),c.j41(7,"form",1),c.bIt("ngSubmit",function(){return U.onSubmit()}),c.j41(8,"mat-form-field")(9,"mat-label"),c.EFF(10,"Enter your password"),c.k0s(),c.nrm(11,"input",2),c.k0s(),c.EFF(12," \xa0 "),c.j41(13,"button",3),c.DNE(14,W0,1,0,"mat-spinner",4)(15,Lm,2,0,"span"),c.k0s(),c.j41(16,"p"),c.DNE(17,j_,4,0,"mat-error"),c.k0s()()),2&w&&(c.R7$(11),c.Y8G("formControl",U.passwordInput),c.R7$(2),c.Y8G("disabled",!(U.passwordInput.valid&&!U.unlocking())),c.R7$(),c.vxM(U.unlocking()?14:15),c.R7$(3),c.vxM(U.invalidPassword()?17:-1))},dependencies:[T.YN,T.qT,T.me,T.BC,T.cb,T.cV,H0.D6,H0.LG,T.X1,T.l_,V.RG,V.rl,V.nJ,V.TL,k.fS,k.fg,E.Hl,E.$z,M.m_],styles:["button[_ngcontent-%COMP%]{width:100px}.unlock-logo[_ngcontent-%COMP%]{max-width:200px}"]})}}return v})();var SC=f(33065);function G1(v,a){1&v&&(c.j41(0,"p"),c.EFF(1,"Starting Ariton..."),c.k0s())}function U_(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",7),c.bIt("click",function(){c.eBV(u);const U=c.XpG(3);return c.Njj(U.back())}),c.EFF(1,"Back"),c.k0s()}if(2&v){const u=c.XpG(3);c.Y8G("disabled",u.appService.loading())}}function jp(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",8),c.bIt("click",function(){c.eBV(u);const U=c.XpG(3);return c.Njj(U.createAccount())}),c.EFF(1,"Create a new account"),c.k0s(),c.j41(2,"button",7),c.bIt("click",function(){c.eBV(u);const U=c.XpG(3);return c.Njj(U.restoreAccount())}),c.EFF(3,"Restore existing account"),c.k0s()}if(2&v){const u=c.XpG(3);c.Y8G("disabled",u.appService.loading()),c.R7$(2),c.Y8G("disabled",u.appService.loading())}}function $_(v,a){1&v&&c.nrm(0,"app-restore")}function V_(v,a){if(1&v&&(c.j41(0,"div",2),c.DNE(1,U_,2,1,"button",6)(2,jp,4,2)(3,$_,1,0,"app-restore"),c.k0s()),2&v){const u=c.XpG(2);c.R7$(),c.vxM(u.restore()?1:2),c.R7$(2),c.vxM(u.restore()?3:-1)}}function X1(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",3),c.nrm(1,"app-unlock"),c.j41(2,"p"),c.EFF(3,"Issues? "),c.j41(4,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.forceClose())}),c.EFF(5,"Close loading sceen"),c.k0s()()()}}function iS(v,a){1&v&&(c.j41(0,"p"),c.EFF(1,"Starting Ariton..."),c.k0s())}function Z1(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",4)(1,"h1"),c.EFF(2,"Error during initialization. Offline?"),c.k0s(),c.j41(3,"p"),c.EFF(4,"You must be online to create your account."),c.nrm(5,"br"),c.EFF(6,"Please verify network connection and try again."),c.k0s(),c.j41(7,"p")(8,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.reload())}),c.EFF(9,"Reload"),c.k0s()()()}}function z_(v,a){1&v&&c.nrm(0,"mat-spinner")}function J1(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",0),c.nrm(1,"img",1),c.DNE(2,G1,2,0,"p")(3,V_,4,2,"div",2)(4,X1,6,0,"div",3)(5,iS,2,0,"p")(6,Z1,10,0,"div",4)(7,z_,1,0,"mat-spinner"),c.j41(8,"p"),c.EFF(9,"Issues? "),c.j41(10,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.forceClose())}),c.EFF(11,"Close loading sceen"),c.k0s()()()}if(2&v){let u;const w=c.XpG();c.R7$(2),c.vxM(0===(u=w.appService.onboardingState())?2:1===u?3:2===u?4:3===u?5:4===u?6:-1),c.R7$(5),c.vxM(w.appService.loading()?7:-1)}}(0,i.B8)((()=>{class v{constructor(u,w,U){this.router=u,this.layout=w,this.identityService=U,this.title="app",this.appService=(0,c.WQX)(m.d),this.previousUrl="",this.restore=(0,c.vPA)(!1);const Y=globalThis.location.search;if(Y){const le=Object.fromEntries(new URLSearchParams(Y));this.appService.params=le}console.log("queryParam:",Y),console.log("this.appService.params:",this.appService.params),(0,c.QZP)(()=>{this.appService.initialized()&&console.log("App has been initialized!!!!")})}forceClose(){this.appService.onboardingState.set(m.f.Unlocked),this.appService.initialized.set(!0)}restoreAccount(){var u=this;return(0,B.A)(function*(){u.restore.set(!0)})()}back(){this.restore.set(!1)}createAccount(){var u=this;return(0,B.A)(function*(){console.log("Creating new account..."),yield u.appService.createAccount(),u.router.navigate([u.appService.state().loginAction])})()}reload(){document.location=document.location}ngOnInit(){var u=this;return(0,B.A)(function*(){yield u.appService.initialize()})()}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(x.Ix),c.rXU(S.Y),c.rXU(g.K))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-root"]],standalone:!0,features:[c.Jv_([{provide:V.U$,useValue:{appearance:"outline"}}]),c.aNF],decls:3,vars:1,consts:[[1,"loading-container"],["src","ariton-icon-dark.svg",1,"loading-logo"],[1,"new-user-actions"],[1,"unlock-container"],[1,"loading-error"],["mat-button","",3,"click"],["mat-button","",3,"disabled"],["mat-button","",3,"click","disabled"],["mat-flat-button","",3,"click","disabled"]],template:function(w,U){1&w&&(c.DNE(0,J1,12,2,"div",0),c.j41(1,"app-layout"),c.nrm(2,"router-outlet"),c.k0s()),2&w&&c.vxM(U.appService.initialized()?-1:0)},dependencies:[SC.RestoreComponent,E.Hl,E.$z,H0.D6,H0.LG,x.n3,nS,xC],styles:[".unlock-container[_ngcontent-%COMP%]{background-color:var(--mat-app-background-color);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1000;display:flex;justify-content:center;align-items:center;align-content:center;text-align:center}.loading-container[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1001;display:flex;flex-direction:column;align-items:center;justify-content:center}.loading-logo[_ngcontent-%COMP%]{max-width:96px;position:absolute;right:1em;bottom:1em}mat-spinner[_ngcontent-%COMP%]{margin:2em}.new-user-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-right:1em;margin-bottom:1em}"]})}}return v})(),ur).catch(v=>console.error(v))},49245:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://anyone-collaborate-protocol.xyz",published:!0,types:{doc:{}},structure:{doc:{$actions:[{who:"anyone",can:["read","co-update","co-delete"]}]}}}},62060:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/chat",published:!0,types:{message:{schema:"https://schema.ariton.app/chat/message",dataFormats:["application/json"]}},structure:{message:{$actions:[{who:"anyone",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]}}}},77949:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/community",published:!0,types:{community:{schema:"https://schema.ariton.app/community/schema/community",dataFormats:["application/json"]},album:{schema:"https://schema.ariton.app/community/schema/album",dataFormats:["text/plain"]},photo:{schema:"https://schema.ariton.app/community/schema/photo",dataFormats:["text/plain"]},friend:{schema:"https://schema.ariton.app/community/schema/friend",dataFormats:["text/plain"]},participant:{schema:"https://schema.ariton.app/community/schema/participant",dataFormats:["text/plain"]},updater:{schema:"https://schema.ariton.app/community/schema/updater",dataFormats:["text/plain"]},globalAdmin:{schema:"https://schema.ariton.app/community/schema/globalAdmin",dataFormats:["application/json"]},admin:{schema:"https://schema.ariton.app/community/schema/admin",dataFormats:["application/json"]}},structure:{globalAdmin:{$role:!0},friend:{$role:!0},community:{$actions:[{role:"globalAdmin",can:["create","update"]}],admin:{$role:!0,$actions:[{role:"globalAdmin",can:["create","update"]}]}}}}},68530:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/connections",published:!0,types:{request:{schema:"https://schema.ariton.app/connections/schema/request",dataFormats:["application/json"]},connection:{schema:"https://schema.ariton.app/connections/schema/connection",dataFormats:["application/json"]},block:{schema:"https://schema.ariton.app/connect/schema/block",dataFormats:["application/json"]}},structure:{block:{},connection:{},request:{$size:{max:3e3},$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},32794:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/data",published:!0,types:{data:{schema:"https://schema.ariton.app/data/schema/data",dataFormats:["application/json"]}},structure:{data:{}}}},97372:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/file",published:!0,types:{entry:{schema:"https://schema.ariton.app/file/schema/entry"},collaborator:{schema:"https://schema.ariton.app/file/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},67136:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://free-for-all-protocol.xyz",published:!0,types:{post:{schema:"eph",dataFormats:["application/json"]},attachment:{}},structure:{post:{$actions:[{who:"anyone",can:["create","update","delete","prune","read","co-delete","co-prune"]}],attachment:{$actions:[{who:"anyone",can:["create","update","delete","read","co-delete"]}]}}}}},22312:(Me,F,f)=>{"use strict";f.d(F,{Aq:()=>T,ME:()=>g,eE:()=>S,iU:()=>E,u5:()=>R});var i=f(4053),c=f(77949),B=(f(45189),f(2685)),m=f(69371);const S={format:"application/vc+jwt",friendship:"FriendshipCredential"},g={uri:i.Q.protocol,definition:i.Q},R={uri:B.Q.protocol,definition:B.Q},T={uri:c.Q.protocol,definition:c.Q},E={uri:m.Q.protocol,definition:m.Q}},69371:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/message",published:!0,types:{message:{schema:"https://schema.ariton.app/message/schema/message",dataFormats:["application/json"]},writer:{schema:"https://schema.ariton.app/message/schema/writer",dataFormats:["application/json"]},request:{schema:"https://schema.ariton.app/message/schema/request",dataFormats:["application/json"]},credential:{schema:"https://schema.ariton.app/message/schema/credential",dataFormats:["application/json"]}},structure:{writer:{$role:!0},message:{$actions:[{role:"writer",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]},request:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]},credential:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},1639:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://minimal.xyz",published:!1,types:{foo:{}},structure:{foo:{}}}},69314:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/note",published:!0,types:{note:{schema:"https://schema.ariton.app/note/schema/note",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/note/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},note:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}},5397:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/notification",published:!0,types:{event:{schema:"https://schema.ariton.app/notification/schema/event",dataFormats:["application/json"]}},structure:{event:{}}}},29508:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/post",published:!0,types:{post:{schema:"https://schema.ariton.app/post/schema/post",dataFormats:["application/json"]}},structure:{post:{}}}},4053:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/profile",types:{profile:{schema:"https://schema.ariton.app/profile/schema/profile",dataFormats:["application/json"]},bio:{dataFormats:["application/json"]},status:{dataFormats:["application/json"]},location:{dataFormats:["application/json"]},birthDate:{dataFormats:["application/json"]},social:{dataFormats:["application/json"]},messaging:{dataFormats:["application/json"]},phone:{dataFormats:["application/json"]},address:{dataFormats:["application/json"]},career:{dataFormats:["application/json"]},payment:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]}},structure:{profile:{$actions:[{who:"anyone",can:["read"]}]},bio:{},status:{},location:{},birthDate:{},social:{},career:{},avatar:{$actions:[{who:"anyone",can:["read"]}]},hero:{$actions:[{who:"anyone",can:["read"]}]},messaging:{},address:{},phone:{},payment:{}}}},2685:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/registry/entry",types:{profile:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]}},structure:{profile:{},avatar:{},hero:{}}}},45189:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://social-media.xyz",published:!0,types:{post:{schema:"https://social-media.xyz/schemas/postSchema",dataFormats:["text/plain"]},reply:{schema:"https://social-media.xyz/schemas/replySchema",dataFormats:["text/plain"]},image:{dataFormats:["image/jpeg"]},caption:{schema:"https://social-media.xyz/schemas/captionSchema",dataFormats:["text/plain"]}},structure:{post:{$actions:[{who:"anyone",can:["create","read"]}],reply:{$actions:[{who:"recipient",of:"post",can:["create"]},{who:"author",of:"post",can:["create"]}]}},image:{$actions:[{who:"anyone",can:["create","read"]}],caption:{$actions:[{who:"anyone",can:["read"]},{who:"author",of:"image",can:["create"]}]},reply:{$actions:[{who:"author",of:"image",can:["read"]},{who:"recipient",of:"image",can:["create"]}]}}}}},50963:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/task",published:!0,types:{list:{schema:"https://schema.ariton.app/task/list",dataFormats:["application/json"]},task:{schema:"https://schema.ariton.app/task/task",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/task/collaborator",dataFormats:["application/json"]}},structure:{list:{collaborator:{$role:!0},$actions:[{role:"list/collaborator",can:["read","query","subscribe"]}],task:{$actions:[{role:"list/collaborator",can:["create","read","update","query","subscribe","co-update","co-delete"]}]}}}}},70669:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/text",published:!0,types:{entry:{schema:"https://schema.ariton.app/text/schema/entry",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/text/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},4521:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createCurve=F.getHash=void 0;const i=f(44882),c=f(96492),x=f(73040);function B(S){return{hash:S,hmac:(g,..._)=>(0,i.hmac)(S,g,(0,c.concatBytes)(..._)),randomBytes:c.randomBytes}}F.getHash=B,F.createCurve=function m(S,g){const _=R=>(0,x.weierstrass)({...S,...B(R)});return Object.freeze({..._(g),create:_})}},25299:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateBasic=F.wNAF=void 0;const i=f(63834),c=f(84097),x=BigInt(0),B=BigInt(1);F.wNAF=function m(g,_){const R=(E,j)=>{const M=j.negate();return E?M:j},T=E=>({windows:Math.ceil(_/E)+1,windowSize:2**(E-1)});return{constTimeNegate:R,unsafeLadder(E,j){let M=g.ZERO,k=E;for(;j>x;)j&B&&(M=M.add(k)),k=k.double(),j>>=B;return M},precomputeWindow(E,j){const{windows:M,windowSize:k}=T(j),K=[];let W=E,V=W;for(let Z=0;Z>=ne,ae>K&&(ae-=q,M+=B);const me=ie,ye=ie+Math.abs(ae)-1,$=ae<0;0===ae?V=V.add(R(te%2!=0,j[me])):W=W.add(R($,j[ye]))}return{p:W,f:V}},wNAFCached(E,j,M,k){const K=E._WINDOW_SIZE||1;let W=j.get(E);return W||(W=this.precomputeWindow(E,K),1!==K&&j.set(E,k(W))),this.wNAF(K,W,M)}}},F.validateBasic=function S(g){return(0,i.validateField)(g.Fp),(0,c.validateObject)(g,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,i.nLength)(g.n,g.nBitLength),...g,p:g.Fp.ORDER})}},45068:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.twistedEdwards=void 0;const i=f(63834),c=f(84097),x=f(84097),B=f(25299),m=BigInt(0),S=BigInt(1),g=BigInt(2),_=BigInt(8),R={zip215:!0};F.twistedEdwards=function E(j){const M=function T(j){const M=(0,B.validateBasic)(j);return c.validateObject(j,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...M})}(j),{Fp:k,n:K,prehash:W,hash:V,randomBytes:Z,nByteLength:q,h:ne}=M,te=g<{try{return{isValid:!0,value:k.sqrt(Ce*k.inv(Xe))}}catch{return{isValid:!1,value:m}}}),me=M.adjustScalarBytes||(Ce=>Ce),ye=M.domain||((Ce,Xe,Te)=>{if(Xe.length||Te)throw new Error("Contexts/pre-hash are not supported");return Ce}),ue=Ce=>"bigint"==typeof Ce&&mue(Ce)&&ue(Xe)&&CeCe===m||$(Ce,te);function h(Ce,Xe){if($(Ce,Xe))return Ce;throw new Error(`Expected valid scalar < ${Xe}, got ${typeof Ce} ${Ce}`)}function A(Ce){return Ce===m?Ce:h(Ce,K)}const C=new Map;function O(Ce){if(!(Ce instanceof z))throw new Error("ExtendedPoint expected")}class z{constructor(Xe,Te,ke,Se){if(this.ex=Xe,this.ey=Te,this.ez=ke,this.et=Se,!o(Xe))throw new Error("x required");if(!o(Te))throw new Error("y required");if(!o(ke))throw new Error("z required");if(!o(Se))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Xe){if(Xe instanceof z)throw new Error("extended point not allowed");const{x:Te,y:ke}=Xe||{};if(!o(Te)||!o(ke))throw new Error("invalid affine point");return new z(Te,ke,S,ie(Te*ke))}static normalizeZ(Xe){const Te=k.invertBatch(Xe.map(ke=>ke.ez));return Xe.map((ke,Se)=>ke.toAffine(Te[Se])).map(z.fromAffine)}_setWindowSize(Xe){this._WINDOW_SIZE=Xe,C.delete(this)}assertValidity(){const{a:Xe,d:Te}=M;if(this.is0())throw new Error("bad point: ZERO");const{ex:ke,ey:Se,ez:Ee,et:ve}=this,De=ie(ke*ke),Re=ie(Se*Se),Je=ie(Ee*Ee),$e=ie(Je*Je),nt=ie(De*Xe);if(ie(Je*ie(nt+Re))!==ie($e+ie(Te*ie(De*Re))))throw new Error("bad point: equation left != right (1)");if(ie(ke*Se)!==ie(Ee*ve))throw new Error("bad point: equation left != right (2)")}equals(Xe){O(Xe);const{ex:Te,ey:ke,ez:Se}=this,{ex:Ee,ey:ve,ez:De}=Xe,Re=ie(Te*De),Je=ie(Ee*Se),$e=ie(ke*De),nt=ie(ve*Se);return Re===Je&&$e===nt}is0(){return this.equals(z.ZERO)}negate(){return new z(ie(-this.ex),this.ey,this.ez,ie(-this.et))}double(){const{a:Xe}=M,{ex:Te,ey:ke,ez:Se}=this,Ee=ie(Te*Te),ve=ie(ke*ke),De=ie(g*ie(Se*Se)),Re=ie(Xe*Ee),Je=Te+ke,$e=ie(ie(Je*Je)-Ee-ve),nt=Re+ve,Qe=nt-De,Tt=Re-ve,ct=ie($e*Qe),ze=ie(nt*Tt),St=ie($e*Tt),re=ie(Qe*nt);return new z(ct,ze,re,St)}add(Xe){O(Xe);const{a:Te,d:ke}=M,{ex:Se,ey:Ee,ez:ve,et:De}=this,{ex:Re,ey:Je,ez:$e,et:nt}=Xe;if(Te===BigInt(-1)){const ot=ie((Ee-Se)*(Je+Re)),Ft=ie((Ee+Se)*(Je-Re)),wt=ie(Ft-ot);if(wt===m)return this.double();const zt=ie(ve*g*nt),rr=ie(De*g*$e),ar=rr+zt,lr=Ft+ot,hn=rr-zt,Wr=ie(ar*wt),vr=ie(lr*hn),Tr=ie(ar*hn),Ve=ie(wt*lr);return new z(Wr,vr,Ve,Tr)}const Qe=ie(Se*Re),Tt=ie(Ee*Je),ct=ie(De*ke*nt),ze=ie(ve*$e),St=ie((Se+Ee)*(Re+Je)-Qe-Tt),re=ze-ct,X=ze+ct,G=ie(Tt-Te*Qe),he=ie(St*re),_e=ie(X*G),je=ie(St*G),Ne=ie(re*X);return new z(he,_e,Ne,je)}subtract(Xe){return this.add(Xe.negate())}wNAF(Xe){return s.wNAFCached(this,C,Xe,z.normalizeZ)}multiply(Xe){const{p:Te,f:ke}=this.wNAF(h(Xe,K));return z.normalizeZ([Te,ke])[0]}multiplyUnsafe(Xe){let Te=A(Xe);return Te===m?I:this.equals(I)||Te===S?this:this.equals(H)?this.wNAF(Te).p:s.unsafeLadder(this,Te)}isSmallOrder(){return this.multiplyUnsafe(ne).is0()}isTorsionFree(){return s.unsafeLadder(this,K).is0()}toAffine(Xe){const{ex:Te,ey:ke,ez:Se}=this,Ee=this.is0();null==Xe&&(Xe=Ee?_:k.inv(Se));const ve=ie(Te*Xe),De=ie(ke*Xe),Re=ie(Se*Xe);if(Ee)return{x:m,y:S};if(Re!==S)throw new Error("invZ was invalid");return{x:ve,y:De}}clearCofactor(){const{h:Xe}=M;return Xe===S?this:this.multiplyUnsafe(Xe)}static fromHex(Xe,Te=!1){const{d:ke,a:Se}=M,Ee=k.BYTES,ve=(Xe=(0,x.ensureBytes)("pointHex",Xe,Ee)).slice(),De=Xe[Ee-1];ve[Ee-1]=-129&De;const Re=c.bytesToNumberLE(ve);Re===m||h(Re,Te?te:k.ORDER);const Je=ie(Re*Re),$e=ie(Je-S),nt=ie(ke*Je-Se);let{isValid:Qe,value:Tt}=ae($e,nt);if(!Qe)throw new Error("Point.fromHex: invalid y coordinate");const ct=(Tt&S)===S,ze=!!(128&De);if(!Te&&Tt===m&&ze)throw new Error("Point.fromHex: x=0 and x_0=1");return ze!==ct&&(Tt=ie(-Tt)),z.fromAffine({x:Tt,y:Re})}static fromPrivateKey(Xe){return ee(Xe).point}toRawBytes(){const{x:Xe,y:Te}=this.toAffine(),ke=c.numberToBytesLE(Te,k.BYTES);return ke[ke.length-1]|=Xe&S?128:0,ke}toHex(){return c.bytesToHex(this.toRawBytes())}}z.BASE=new z(M.Gx,M.Gy,S,ie(M.Gx*M.Gy)),z.ZERO=new z(m,S,S,m);const{BASE:H,ZERO:I}=z,s=(0,B.wNAF)(z,8*q);function p(Ce){return(0,i.mod)(Ce,K)}function J(Ce){return p(c.bytesToNumberLE(Ce))}function ee(Ce){const Xe=q;Ce=(0,x.ensureBytes)("private key",Ce,Xe);const Te=(0,x.ensureBytes)("hashed private key",V(Ce),2*Xe),ke=me(Te.slice(0,Xe)),Se=Te.slice(Xe,2*Xe),Ee=J(ke),ve=H.multiply(Ee),De=ve.toRawBytes();return{head:ke,prefix:Se,scalar:Ee,point:ve,pointBytes:De}}function de(Ce=new Uint8Array,...Xe){const Te=c.concatBytes(...Xe);return J(V(ye(Te,(0,x.ensureBytes)("context",Ce),!!W)))}const Ie=R;return H._setWindowSize(8),{CURVE:M,getPublicKey:function se(Ce){return ee(Ce).pointBytes},sign:function Ae(Ce,Xe,Te={}){Ce=(0,x.ensureBytes)("message",Ce),W&&(Ce=W(Ce));const{prefix:ke,scalar:Se,pointBytes:Ee}=ee(Xe),ve=de(Te.context,ke,Ce),De=H.multiply(ve).toRawBytes(),Je=p(ve+de(Te.context,De,Ee,Ce)*Se);A(Je);const $e=c.concatBytes(De,c.numberToBytesLE(Je,k.BYTES));return(0,x.ensureBytes)("result",$e,2*q)},verify:function Le(Ce,Xe,Te,ke=Ie){const{context:Se,zip215:Ee}=ke,ve=k.BYTES;Ce=(0,x.ensureBytes)("signature",Ce,2*ve),Xe=(0,x.ensureBytes)("message",Xe),W&&(Xe=W(Xe));const De=c.bytesToNumberLE(Ce.slice(ve,2*ve));let Re,Je,$e;try{Re=z.fromHex(Te,Ee),Je=z.fromHex(Ce.slice(0,ve),Ee),$e=H.multiplyUnsafe(De)}catch{return!1}if(!Ee&&Re.isSmallOrder())return!1;const nt=de(Se,Je.toRawBytes(),Re.toRawBytes(),Xe);return Je.add(Re.multiplyUnsafe(nt)).subtract($e).clearCofactor().equals(z.ZERO)},ExtendedPoint:z,utils:{getExtendedPublicKey:ee,randomPrivateKey:()=>Z(k.BYTES),precompute:(Ce=8,Xe=z.BASE)=>(Xe._setWindowSize(Ce),Xe.multiply(BigInt(3)),Xe)}}}},75752:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createHasher=F.isogenyMap=F.hash_to_field=F.expand_message_xof=F.expand_message_xmd=void 0;const i=f(63834),c=f(84097),B=c.bytesToNumberBE;function m(k,K){if(k<0||k>=1<<8*K)throw new Error(`bad I2OSP call: value=${k} length=${K}`);const W=Array.from({length:K}).fill(0);for(let V=K-1;V>=0;V--)W[V]=255&k,k>>>=8;return new Uint8Array(W)}function S(k,K){const W=new Uint8Array(k.length);for(let V=0;V255&&(K=V((0,c.concatBytes)((0,c.utf8ToBytes)("H2C-OVERSIZE-DST-"),K)));const{outputLen:Z,blockLen:q}=V,ne=Math.ceil(W/Z);if(ne>255)throw new Error("Invalid xmd length");const te=(0,c.concatBytes)(K,m(K.length,1)),ie=m(0,q),ae=m(W,2),me=new Array(ne),ye=V((0,c.concatBytes)(ie,k,ae,m(0,1),te));me[0]=V((0,c.concatBytes)(ye,m(1,1),te));for(let $=1;$<=ne;$++){const o=[S(ye,me[$-1]),m($+1,1),te];me[$]=V((0,c.concatBytes)(...o))}return(0,c.concatBytes)(...me).slice(0,W)}function T(k,K,W,V,Z){if(g(k),g(K),_(W),K.length>255){const q=Math.ceil(2*V/8);K=Z.create({dkLen:q}).update((0,c.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(K).digest()}if(W>65535||K.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return Z.create({dkLen:W}).update(k).update(m(W,2)).update(K).update(m(K.length,1)).digest()}function E(k,K,W){(0,c.validateObject)(W,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:V,k:Z,m:q,hash:ne,expand:te,DST:ie}=W;g(k),_(K);const ae=function x(k){if((0,c.isBytes)(k))return k;if("string"==typeof k)return(0,c.utf8ToBytes)(k);throw new Error("DST must be Uint8Array or string")}(ie),me=V.toString(2).length,ye=Math.ceil((me+Z)/8),ue=K*q*ye;let $;if("xmd"===te)$=R(k,ae,ue,ne);else if("xof"===te)$=T(k,ae,ue,Z,ne);else{if("_internal_pass"!==te)throw new Error('expand must be "xmd" or "xof"');$=k}const o=new Array(K);for(let h=0;hArray.from(V).reverse());return(V,Z)=>{const[q,ne,te,ie]=W.map(ae=>ae.reduce((me,ye)=>k.add(k.mul(me,V),ye)));return V=k.div(q,ne),Z=k.mul(Z,k.div(te,ie)),{x:V,y:Z}}},F.createHasher=function M(k,K,W){if("function"!=typeof K)throw new Error("mapToCurve() must be defined");return{hashToCurve(V,Z){const q=E(V,2,{...W,DST:W.DST,...Z}),ne=k.fromAffine(K(q[0])),te=k.fromAffine(K(q[1])),ie=ne.add(te).clearCofactor();return ie.assertValidity(),ie},encodeToCurve(V,Z){const q=E(V,1,{...W,DST:W.encodeDST,...Z}),ne=k.fromAffine(K(q[0])).clearCofactor();return ne.assertValidity(),ne}}}},63834:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapHashToField=F.getMinHashLength=F.getFieldBytesLength=F.hashToPrivateScalar=F.FpSqrtEven=F.FpSqrtOdd=F.Field=F.nLength=F.FpIsSquare=F.FpDiv=F.FpInvertBatch=F.FpPow=F.validateField=F.isNegativeLE=F.FpSqrt=F.tonelliShanks=F.invert=F.pow2=F.pow=F.mod=void 0;const i=f(84097),c=BigInt(0),x=BigInt(1),B=BigInt(2),m=BigInt(3),S=BigInt(4),g=BigInt(5),_=BigInt(8);function E(O,z){const H=O%z;return H>=c?H:z+H}function j(O,z,H){if(H<=c||z 0");if(H===x)return c;let I=x;for(;z>c;)z&x&&(I=I*O%H),O=O*O%H,z>>=x;return I}function k(O,z){if(O===c||z<=c)throw new Error(`invert: expected positive integers, got n=${O} mod=${z}`);let H=E(O,z),I=z,s=c,p=x,J=x,ee=c;for(;H!==c;){const de=I/H,Ae=I%H,Ie=s-J*de,Le=p-ee*de;I=H,H=Ae,s=J,p=ee,J=Ie,ee=Le}if(I!==x)throw new Error("invert: does not exist");return E(s,z)}function K(O){const z=(O-x)/B;let H,I,s;for(H=O-x,I=0;H%B===c;H/=B,I++);for(s=B;sc;)I*=I,I%=H;return I},F.invert=k,F.tonelliShanks=K,F.FpSqrt=W,F.isNegativeLE=(O,z)=>(E(O,z)&x)===x;const Z=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ne(O,z,H){if(H 0");if(H===c)return O.ONE;if(H===x)return z;let I=O.ONE,s=z;for(;H>c;)H&x&&(I=O.mul(I,s)),s=O.sqr(s),H>>=x;return I}function te(O,z){const H=new Array(z.length),I=z.reduce((p,J,ee)=>O.is0(J)?p:(H[ee]=p,O.mul(p,J)),O.ONE),s=O.inv(I);return z.reduceRight((p,J,ee)=>O.is0(J)?p:(H[ee]=O.mul(p,H[ee]),O.mul(p,J)),s),H}function me(O,z){const H=void 0!==z?z:O.toString(2).length;return{nBitLength:H,nByteLength:Math.ceil(H/8)}}function h(O){if("bigint"!=typeof O)throw new Error("field order must be bigint");const z=O.toString(2).length;return Math.ceil(z/8)}function A(O){const z=h(O);return z+Math.ceil(z/2)}F.validateField=function q(O){const H=Z.reduce((I,s)=>(I[s]="function",I),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.validateObject)(O,H)},F.FpPow=ne,F.FpInvertBatch=te,F.FpDiv=function ie(O,z,H){return O.mul(z,"bigint"==typeof H?k(H,O.ORDER):O.inv(H))},F.FpIsSquare=function ae(O){const z=(O.ORDER-x)/B;return H=>{const I=O.pow(H,z);return O.eql(I,O.ZERO)||O.eql(I,O.ONE)}},F.nLength=me,F.Field=function ye(O,z,H=!1,I={}){if(O<=c)throw new Error(`Expected Field ORDER > 0, got ${O}`);const{nBitLength:s,nByteLength:p}=me(O,z);if(p>2048)throw new Error("Field lengths over 2048 bytes are not supported");const J=W(O),ee=Object.freeze({ORDER:O,BITS:s,BYTES:p,MASK:(0,i.bitMask)(s),ZERO:c,ONE:x,create:se=>E(se,O),isValid:se=>{if("bigint"!=typeof se)throw new Error("Invalid field element: expected bigint, got "+typeof se);return c<=se&&sese===c,isOdd:se=>(se&x)===x,neg:se=>E(-se,O),eql:(se,de)=>se===de,sqr:se=>E(se*se,O),add:(se,de)=>E(se+de,O),sub:(se,de)=>E(se-de,O),mul:(se,de)=>E(se*de,O),pow:(se,de)=>ne(ee,se,de),div:(se,de)=>E(se*k(de,O),O),sqrN:se=>se*se,addN:(se,de)=>se+de,subN:(se,de)=>se-de,mulN:(se,de)=>se*de,inv:se=>k(se,O),sqrt:I.sqrt||(se=>J(ee,se)),invertBatch:se=>te(ee,se),cmov:(se,de,Ae)=>Ae?de:se,toBytes:se=>H?(0,i.numberToBytesLE)(se,p):(0,i.numberToBytesBE)(se,p),fromBytes:se=>{if(se.length!==p)throw new Error(`Fp.fromBytes: expected ${p}, got ${se.length}`);return H?(0,i.bytesToNumberLE)(se):(0,i.bytesToNumberBE)(se)}});return Object.freeze(ee)},F.FpSqrtOdd=function ue(O,z){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt(z);return O.isOdd(H)?H:O.neg(H)},F.FpSqrtEven=function $(O,z){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt(z);return O.isOdd(H)?O.neg(H):H},F.hashToPrivateScalar=function o(O,z,H=!1){const I=(O=(0,i.ensureBytes)("privateHash",O)).length,s=me(z).nByteLength+8;if(s<24||I1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${I}`);return E(H?(0,i.bytesToNumberLE)(O):(0,i.bytesToNumberBE)(O),z-x)+x},F.getFieldBytesLength=h,F.getMinHashLength=A,F.mapHashToField=function C(O,z,H=!1){const I=O.length,s=h(z),p=A(z);if(I<16||I1024)throw new Error(`expected ${p}-1024 bytes of input, got ${I}`);const ee=E(H?(0,i.bytesToNumberBE)(O):(0,i.bytesToNumberLE)(O),z-x)+x;return H?(0,i.numberToBytesLE)(ee,s):(0,i.numberToBytesBE)(ee,s)}},27661:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.montgomery=void 0;const i=f(63834),c=f(84097),x=BigInt(0),B=BigInt(1);F.montgomery=function S(g){const _=function m(g){return(0,c.validateObject)(g,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...g})}(g),{P:R}=_,T=ue=>(0,i.mod)(ue,R),E=_.montgomeryBits,j=Math.ceil(E/8),M=_.nByteLength,k=_.adjustScalarBytes||(ue=>ue),K=_.powPminus2||(ue=>(0,i.pow)(ue,R-BigInt(2),R));function W(ue,$,o){const h=T(ue*($-o));return[$=T($-h),o=T(o+h)]}function V(ue){if("bigint"==typeof ue&&x<=ue&&ue=x;J--){const ee=h>>J&B;I^=ee,s=W(I,C,z),C=s[0],z=s[1],s=W(I,O,H),O=s[0],H=s[1],I=ee;const se=C+O,de=T(se*se),Ae=C-O,Ie=T(Ae*Ae),Le=de-Ie,xe=z+H,Xe=T((z-H)*se),Te=T(xe*Ae),ke=Xe+Te,Se=Xe-Te;z=T(ke*ke),H=T(A*T(Se*Se)),C=T(de*Ie),O=T(Le*(de+T(Z*Le)))}s=W(I,C,z),C=s[0],z=s[1],s=W(I,O,H),O=s[0],H=s[1];const p=K(O);return T(C*p)}(o,h);if(A===x)throw new Error("Invalid private or public key received");return ne(A)}const me=ne(_.Gu);function ye(ue){return ae(ue,me)}return{scalarMult:ae,scalarMultBase:ye,getSharedSecret:(ue,$)=>ae(ue,$),getPublicKey:ue=>ye(ue),utils:{randomPrivateKey:()=>_.randomBytes(_.nByteLength)},GuBytes:me}}},84097:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateObject=F.createHmacDrbg=F.bitMask=F.bitSet=F.bitGet=F.bitLen=F.utf8ToBytes=F.equalBytes=F.concatBytes=F.ensureBytes=F.numberToVarBytesBE=F.numberToBytesLE=F.numberToBytesBE=F.bytesToNumberLE=F.bytesToNumberBE=F.hexToBytes=F.hexToNumber=F.numberToHexUnpadded=F.bytesToHex=F.isBytes=void 0;const f=BigInt(0),i=BigInt(1),c=BigInt(2);function x(h){return h instanceof Uint8Array||null!=h&&"object"==typeof h&&"Uint8Array"===h.constructor.name}F.isBytes=x;const B=Array.from({length:256},(h,A)=>A.toString(16).padStart(2,"0"));function m(h){if(!x(h))throw new Error("Uint8Array expected");let A="";for(let C=0;C=_._0&&h<=_._9?h-_._0:h>=_._A&&h<=_._F?h-(_._A-10):h>=_._a&&h<=_._f?h-(_._a-10):void 0}function T(h){if("string"!=typeof h)throw new Error("hex string expected, got "+typeof h);const A=h.length,C=A/2;if(A%2)throw new Error("padded hex string expected, got unpadded hex of length "+A);const O=new Uint8Array(C);for(let z=0,H=0;zf;h>>=i,A+=1);return A},F.bitGet=function te(h,A){return h>>BigInt(A)&i},F.bitSet=(h,A,C)=>h|(C?i:f)<(c<new Uint8Array(h),ye=h=>Uint8Array.from(h);F.createHmacDrbg=function ue(h,A,C){if("number"!=typeof h||h<2)throw new Error("hashLen must be a number");if("number"!=typeof A||A<2)throw new Error("qByteLen must be a number");if("function"!=typeof C)throw new Error("hmacFn must be a function");let O=me(h),z=me(h),H=0;const I=()=>{O.fill(1),z.fill(0),H=0},s=(...se)=>C(z,O,...se),p=(se=me())=>{z=s(ye([0]),se),O=s(),0!==se.length&&(z=s(ye([1]),se),O=s())},J=()=>{if(H++>=1e3)throw new Error("drbg: tried 1000 values");let se=0;const de=[];for(;se{let Ae;for(I(),p(se);!(Ae=de(J()));)p();return I(),Ae}};const $={bigint:h=>"bigint"==typeof h,function:h=>"function"==typeof h,boolean:h=>"boolean"==typeof h,string:h=>"string"==typeof h,stringOrUint8Array:h=>"string"==typeof h||x(h),isSafeInteger:h=>Number.isSafeInteger(h),array:h=>Array.isArray(h),field:(h,A)=>A.Fp.isValid(h),hash:h=>"function"==typeof h&&Number.isSafeInteger(h.outputLen)};F.validateObject=function o(h,A,C={}){const O=(z,H,I)=>{const s=$[H];if("function"!=typeof s)throw new Error(`Invalid validator "${H}", expected function`);const p=h[z];if(!(I&&void 0===p||s(p,h)))throw new Error(`Invalid param ${String(z)}=${p} (${typeof p}), expected ${H}`)};for(const[z,H]of Object.entries(A))O(z,H,!1);for(const[z,H]of Object.entries(C))O(z,H,!0);return h}},73040:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapToCurveSimpleSWU=F.SWUFpSqrtRatio=F.weierstrass=F.weierstrassPoints=F.DER=void 0;const i=f(63834),c=f(84097),x=f(84097),B=f(25299),{bytesToNumberBE:S,hexToBytes:g}=c;F.DER={Err:class extends Error{constructor(q=""){super(q)}},_parseInt(Z){const{Err:q}=F.DER;if(Z.length<2||2!==Z[0])throw new q("Invalid signature integer tag");const ne=Z[1],te=Z.subarray(2,ne+2);if(!ne||te.length!==ne)throw new q("Invalid signature integer: wrong length");if(128&te[0])throw new q("Invalid signature integer: negative");if(0===te[0]&&!(128&te[1]))throw new q("Invalid signature integer: unnecessary leading zero");return{d:S(te),l:Z.subarray(ne+2)}},toSig(Z){const{Err:q}=F.DER,ne="string"==typeof Z?g(Z):Z;if(!c.isBytes(ne))throw new Error("ui8a expected");let te=ne.length;if(te<2||48!=ne[0])throw new q("Invalid signature tag");if(ne[1]!==te-2)throw new q("Invalid signature: incorrect length");const{d:ie,l:ae}=F.DER._parseInt(ne.subarray(2)),{d:me,l:ye}=F.DER._parseInt(ae);if(ye.length)throw new q("Invalid signature: left bytes after parsing");return{r:ie,s:me}},hexFromSig(Z){const q=$=>8&Number.parseInt($[0],16)?"00"+$:$,ne=$=>{const o=$.toString(16);return 1&o.length?`0${o}`:o},te=q(ne(Z.s)),ie=q(ne(Z.r)),ae=te.length/2,me=ie.length/2,ye=ne(ae),ue=ne(me);return`30${ne(me+ae+4)}02${ue}${ie}02${ye}${te}`}};const _=BigInt(0),R=BigInt(1),T=BigInt(2),E=BigInt(3),j=BigInt(4);function M(Z){const q=function m(Z){const q=(0,B.validateBasic)(Z);c.validateObject(q,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:ne,Fp:te,a:ie}=q;if(ne){if(!te.eql(ie,te.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof ne||"bigint"!=typeof ne.beta||"function"!=typeof ne.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...q})}(Z),{Fp:ne}=q,te=q.toBytes||((O,z,H)=>{const I=z.toAffine();return c.concatBytes(Uint8Array.from([4]),ne.toBytes(I.x),ne.toBytes(I.y))}),ie=q.fromBytes||(O=>{const z=O.subarray(1);return{x:ne.fromBytes(z.subarray(0,ne.BYTES)),y:ne.fromBytes(z.subarray(ne.BYTES,2*ne.BYTES))}});function ae(O){const{a:z,b:H}=q,I=ne.sqr(O),s=ne.mul(I,O);return ne.add(ne.add(s,ne.mul(O,z)),H)}if(!ne.eql(ne.sqr(q.Gy),ae(q.Gx)))throw new Error("bad generator point: equation left != right");function me(O){return"bigint"==typeof O&&_ne.eql(p,ne.ZERO);return s(H)&&s(I)?h.ZERO:new h(H,I,ne.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(z){const H=ne.invertBatch(z.map(I=>I.pz));return z.map((I,s)=>I.toAffine(H[s])).map(h.fromAffine)}static fromHex(z){const H=h.fromAffine(ie((0,x.ensureBytes)("pointHex",z)));return H.assertValidity(),H}static fromPrivateKey(z){return h.BASE.multiply(ue(z))}_setWindowSize(z){this._WINDOW_SIZE=z,$.delete(this)}assertValidity(){if(this.is0()){if(q.allowInfinityPoint&&!ne.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:z,y:H}=this.toAffine();if(!ne.isValid(z)||!ne.isValid(H))throw new Error("bad point: x or y not FE");const I=ne.sqr(H),s=ae(z);if(!ne.eql(I,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:z}=this.toAffine();if(ne.isOdd)return!ne.isOdd(z);throw new Error("Field doesn't support isOdd")}equals(z){o(z);const{px:H,py:I,pz:s}=this,{px:p,py:J,pz:ee}=z,se=ne.eql(ne.mul(H,ee),ne.mul(p,s)),de=ne.eql(ne.mul(I,ee),ne.mul(J,s));return se&&de}negate(){return new h(this.px,ne.neg(this.py),this.pz)}double(){const{a:z,b:H}=q,I=ne.mul(H,E),{px:s,py:p,pz:J}=this;let ee=ne.ZERO,se=ne.ZERO,de=ne.ZERO,Ae=ne.mul(s,s),Ie=ne.mul(p,p),Le=ne.mul(J,J),xe=ne.mul(s,p);return xe=ne.add(xe,xe),de=ne.mul(s,J),de=ne.add(de,de),ee=ne.mul(z,de),se=ne.mul(I,Le),se=ne.add(ee,se),ee=ne.sub(Ie,se),se=ne.add(Ie,se),se=ne.mul(ee,se),ee=ne.mul(xe,ee),de=ne.mul(I,de),Le=ne.mul(z,Le),xe=ne.sub(Ae,Le),xe=ne.mul(z,xe),xe=ne.add(xe,de),de=ne.add(Ae,Ae),Ae=ne.add(de,Ae),Ae=ne.add(Ae,Le),Ae=ne.mul(Ae,xe),se=ne.add(se,Ae),Le=ne.mul(p,J),Le=ne.add(Le,Le),Ae=ne.mul(Le,xe),ee=ne.sub(ee,Ae),de=ne.mul(Le,Ie),de=ne.add(de,de),de=ne.add(de,de),new h(ee,se,de)}add(z){o(z);const{px:H,py:I,pz:s}=this,{px:p,py:J,pz:ee}=z;let se=ne.ZERO,de=ne.ZERO,Ae=ne.ZERO;const Ie=q.a,Le=ne.mul(q.b,E);let xe=ne.mul(H,p),Ce=ne.mul(I,J),Xe=ne.mul(s,ee),Te=ne.add(H,I),ke=ne.add(p,J);Te=ne.mul(Te,ke),ke=ne.add(xe,Ce),Te=ne.sub(Te,ke),ke=ne.add(H,s);let Se=ne.add(p,ee);return ke=ne.mul(ke,Se),Se=ne.add(xe,Xe),ke=ne.sub(ke,Se),Se=ne.add(I,s),se=ne.add(J,ee),Se=ne.mul(Se,se),se=ne.add(Ce,Xe),Se=ne.sub(Se,se),Ae=ne.mul(Ie,ke),se=ne.mul(Le,Xe),Ae=ne.add(se,Ae),se=ne.sub(Ce,Ae),Ae=ne.add(Ce,Ae),de=ne.mul(se,Ae),Ce=ne.add(xe,xe),Ce=ne.add(Ce,xe),Xe=ne.mul(Ie,Xe),ke=ne.mul(Le,ke),Ce=ne.add(Ce,Xe),Xe=ne.sub(xe,Xe),Xe=ne.mul(Ie,Xe),ke=ne.add(ke,Xe),xe=ne.mul(Ce,ke),de=ne.add(de,xe),xe=ne.mul(Se,ke),se=ne.mul(Te,se),se=ne.sub(se,xe),xe=ne.mul(Te,Ce),Ae=ne.mul(Se,Ae),Ae=ne.add(Ae,xe),new h(se,de,Ae)}subtract(z){return this.add(z.negate())}is0(){return this.equals(h.ZERO)}wNAF(z){return C.wNAFCached(this,$,z,H=>{const I=ne.invertBatch(H.map(s=>s.pz));return H.map((s,p)=>s.toAffine(I[p])).map(h.fromAffine)})}multiplyUnsafe(z){const H=h.ZERO;if(z===_)return H;if(ye(z),z===R)return this;const{endo:I}=q;if(!I)return C.unsafeLadder(this,z);let{k1neg:s,k1:p,k2neg:J,k2:ee}=I.splitScalar(z),se=H,de=H,Ae=this;for(;p>_||ee>_;)p&R&&(se=se.add(Ae)),ee&R&&(de=de.add(Ae)),Ae=Ae.double(),p>>=R,ee>>=R;return s&&(se=se.negate()),J&&(de=de.negate()),de=new h(ne.mul(de.px,I.beta),de.py,de.pz),se.add(de)}multiply(z){ye(z);let I,s,H=z;const{endo:p}=q;if(p){const{k1neg:J,k1:ee,k2neg:se,k2:de}=p.splitScalar(H);let{p:Ae,f:Ie}=this.wNAF(ee),{p:Le,f:xe}=this.wNAF(de);Ae=C.constTimeNegate(J,Ae),Le=C.constTimeNegate(se,Le),Le=new h(ne.mul(Le.px,p.beta),Le.py,Le.pz),I=Ae.add(Le),s=Ie.add(xe)}else{const{p:J,f:ee}=this.wNAF(H);I=J,s=ee}return h.normalizeZ([I,s])[0]}multiplyAndAddUnsafe(z,H,I){const s=h.BASE,p=(ee,se)=>se!==_&&se!==R&&ee.equals(s)?ee.multiply(se):ee.multiplyUnsafe(se),J=p(this,H).add(p(z,I));return J.is0()?void 0:J}toAffine(z){const{px:H,py:I,pz:s}=this,p=this.is0();null==z&&(z=p?ne.ONE:ne.inv(s));const J=ne.mul(H,z),ee=ne.mul(I,z),se=ne.mul(s,z);if(p)return{x:ne.ZERO,y:ne.ZERO};if(!ne.eql(se,ne.ONE))throw new Error("invZ was invalid");return{x:J,y:ee}}isTorsionFree(){const{h:z,isTorsionFree:H}=q;if(z===R)return!0;if(H)return H(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:z,clearCofactor:H}=q;return z===R?this:H?H(h,this):this.multiplyUnsafe(q.h)}toRawBytes(z=!0){return this.assertValidity(),te(h,this,z)}toHex(z=!0){return c.bytesToHex(this.toRawBytes(z))}}h.BASE=new h(q.Gx,q.Gy,ne.ONE),h.ZERO=new h(ne.ZERO,ne.ONE,ne.ZERO);const A=q.nBitLength,C=(0,B.wNAF)(h,q.endo?Math.ceil(A/2):A);return{CURVE:q,ProjectivePoint:h,normPrivateKeyToScalar:ue,weierstrassEquation:ae,isWithinCurveOrder:me}}function W(Z,q){const ne=Z.ORDER;let te=_;for(let O=ne-R;O%T===_;O/=T)te+=R;const ie=te,ae=T<{let H=h,I=Z.pow(z,$),s=Z.sqr(I);s=Z.mul(s,z);let p=Z.mul(O,s);p=Z.pow(p,ue),p=Z.mul(p,I),I=Z.mul(p,z),s=Z.mul(p,O);let J=Z.mul(s,I);p=Z.pow(J,o);let ee=Z.eql(p,Z.ONE);I=Z.mul(s,A),p=Z.mul(J,H),s=Z.cmov(I,s,ee),J=Z.cmov(p,J,ee);for(let se=ie;se>R;se--){let de=se-T;de=T<{let s=Z.sqr(I);const p=Z.mul(H,I);s=Z.mul(s,p);let J=Z.pow(s,O);J=Z.mul(J,p);const ee=Z.mul(J,z),se=Z.mul(Z.sqr(J),I),de=Z.eql(se,H);return{isValid:de,value:Z.cmov(ee,J,de)}}}return C}F.weierstrassPoints=M,F.weierstrass=function K(Z){const q=function k(Z){const q=(0,B.validateBasic)(Z);return c.validateObject(q,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...q})}(Z),{Fp:ne,n:te}=q,ie=ne.BYTES+1,ae=2*ne.BYTES+1;function ye(ke){return i.mod(ke,te)}function ue(ke){return i.invert(ke,te)}const{ProjectivePoint:$,normPrivateKeyToScalar:o,weierstrassEquation:h,isWithinCurveOrder:A}=M({...q,toBytes(ke,Se,Ee){const ve=Se.toAffine(),De=ne.toBytes(ve.x),Re=c.concatBytes;return Ee?Re(Uint8Array.from([Se.hasEvenY()?2:3]),De):Re(Uint8Array.from([4]),De,ne.toBytes(ve.y))},fromBytes(ke){const Se=ke.length,Ee=ke[0],ve=ke.subarray(1);if(Se!==ie||2!==Ee&&3!==Ee){if(Se===ae&&4===Ee)return{x:ne.fromBytes(ve.subarray(0,ne.BYTES)),y:ne.fromBytes(ve.subarray(ne.BYTES,2*ne.BYTES))};throw new Error(`Point of length ${Se} was invalid. Expected ${ie} compressed bytes or ${ae} uncompressed bytes`)}{const De=c.bytesToNumberBE(ve);if(!function me(ke){return _c.bytesToHex(c.numberToBytesBE(ke,q.nByteLength));function O(ke){return ke>te>>R}const H=(ke,Se,Ee)=>c.bytesToNumberBE(ke.slice(Se,Ee));class I{constructor(Se,Ee,ve){this.r=Se,this.s=Ee,this.recovery=ve,this.assertValidity()}static fromCompact(Se){const Ee=q.nByteLength;return Se=(0,x.ensureBytes)("compactSignature",Se,2*Ee),new I(H(Se,0,Ee),H(Se,Ee,2*Ee))}static fromDER(Se){const{r:Ee,s:ve}=F.DER.toSig((0,x.ensureBytes)("DER",Se));return new I(Ee,ve)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Se){return new I(this.r,this.s,Se)}recoverPublicKey(Se){const{r:Ee,s:ve,recovery:De}=this,Re=de((0,x.ensureBytes)("msgHash",Se));if(null==De||![0,1,2,3].includes(De))throw new Error("recovery id invalid");const Je=2===De||3===De?Ee+q.n:Ee;if(Je>=ne.ORDER)throw new Error("recovery id 2 or 3 invalid");const nt=$.fromHex((1&De?"03":"02")+C(Je)),Qe=ue(Je),Tt=ye(-Re*Qe),ct=ye(ve*Qe),ze=$.BASE.multiplyAndAddUnsafe(nt,Tt,ct);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return O(this.s)}normalizeS(){return this.hasHighS()?new I(this.r,ye(-this.s),this.recovery):this}toDERRawBytes(){return c.hexToBytes(this.toDERHex())}toDERHex(){return F.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return c.hexToBytes(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}const s={isValidPrivateKey(ke){try{return o(ke),!0}catch{return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const ke=i.getMinHashLength(q.n);return i.mapHashToField(q.randomBytes(ke),q.n)},precompute:(ke=8,Se=$.BASE)=>(Se._setWindowSize(ke),Se.multiply(BigInt(3)),Se)};function J(ke){const Se=c.isBytes(ke),Ee="string"==typeof ke,ve=(Se||Ee)&&ke.length;return Se?ve===ie||ve===ae:Ee?ve===2*ie||ve===2*ae:ke instanceof $}const se=q.bits2int||function(ke){const Se=c.bytesToNumberBE(ke),Ee=8*ke.length-q.nBitLength;return Ee>0?Se>>BigInt(Ee):Se},de=q.bits2int_modN||function(ke){return ye(se(ke))},Ae=c.bitMask(q.nBitLength);function Ie(ke){if("bigint"!=typeof ke)throw new Error("bigint expected");if(!(_<=ke&&kere in Ee))throw new Error("sign() legacy options not supported");const{hash:ve,randomBytes:De}=q;let{lowS:Re,prehash:Je,extraEntropy:$e}=Ee;null==Re&&(Re=!0),ke=(0,x.ensureBytes)("msgHash",ke),Je&&(ke=(0,x.ensureBytes)("prehashed msgHash",ve(ke)));const nt=de(ke),Qe=o(Se),Tt=[Ie(Qe),Ie(nt)];if(null!=$e){const re=!0===$e?De(ne.BYTES):$e;Tt.push((0,x.ensureBytes)("extraEntropy",re))}const ct=c.concatBytes(...Tt),ze=nt;return{seed:ct,k2sig:function St(re){const X=se(re);if(!A(X))return;const G=ue(X),he=$.BASE.multiply(X).toAffine(),_e=ye(he.x);if(_e===_)return;const je=ye(G*ye(ze+_e*Qe));if(je===_)return;let Ne=(he.x===_e?0:2)|Number(he.y&R),ot=je;return Re&&O(je)&&(ot=function z(ke){return O(ke)?ye(-ke):ke}(je),Ne^=1),new I(_e,ot,Ne)}}}(ke,Se,Ee);return c.createHmacDrbg(q.hash.outputLen,q.nByteLength,q.hmac)(ve,De)},verify:function Te(ke,Se,Ee,ve=Ce){const De=ke;if(Se=(0,x.ensureBytes)("msgHash",Se),Ee=(0,x.ensureBytes)("publicKey",Ee),"strict"in ve)throw new Error("options.strict was renamed to lowS");const{lowS:Re,prehash:Je}=ve;let $e,nt;try{if("string"==typeof De||c.isBytes(De))try{$e=I.fromDER(De)}catch(he){if(!(he instanceof F.DER.Err))throw he;$e=I.fromCompact(De)}else{if("object"!=typeof De||"bigint"!=typeof De.r||"bigint"!=typeof De.s)throw new Error("PARSE");{const{r:he,s:_e}=De;$e=new I(he,_e)}}nt=$.fromHex(Ee)}catch(he){if("PARSE"===he.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Re&&$e.hasHighS())return!1;Je&&(Se=q.hash(Se));const{r:Qe,s:Tt}=$e,ct=de(Se),ze=ue(Tt),St=ye(ct*ze),re=ye(Qe*ze),X=$.BASE.multiplyAndAddUnsafe(nt,St,re)?.toAffine();return!!X&&ye(X.x)===Qe},ProjectivePoint:$,Signature:I,utils:s}},F.SWUFpSqrtRatio=W,F.mapToCurveSimpleSWU=function V(Z,q){if(i.validateField(Z),!Z.isValid(q.A)||!Z.isValid(q.B)||!Z.isValid(q.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const ne=W(Z,q.Z);if(!Z.isOdd)throw new Error("Fp.isOdd is not implemented!");return te=>{let ie,ae,me,ye,ue,$,o,h;ie=Z.sqr(te),ie=Z.mul(ie,q.Z),ae=Z.sqr(ie),ae=Z.add(ae,ie),me=Z.add(ae,Z.ONE),me=Z.mul(me,q.B),ye=Z.cmov(q.Z,Z.neg(ae),!Z.eql(ae,Z.ZERO)),ye=Z.mul(ye,q.A),ae=Z.sqr(me),$=Z.sqr(ye),ue=Z.mul($,q.A),ae=Z.add(ae,ue),ae=Z.mul(ae,me),$=Z.mul($,ye),ue=Z.mul($,q.B),ae=Z.add(ae,ue),o=Z.mul(ie,me);const{isValid:A,value:C}=ne(ae,$);h=Z.mul(ie,te),h=Z.mul(h,C),o=Z.cmov(o,me,A),h=Z.cmov(h,C,A);const O=Z.isOdd(te)===Z.isOdd(h);return h=Z.cmov(Z.neg(h),h,O),o=Z.div(o,ye),{x:o,y:h}}}},57340:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hash_to_ristretto255=F.hashToRistretto255=F.RistrettoPoint=F.encodeToCurve=F.hashToCurve=F.edwardsToMontgomeryPriv=F.edwardsToMontgomery=F.edwardsToMontgomeryPub=F.x25519=F.ed25519ph=F.ed25519ctx=F.ed25519=F.ED25519_TORSION_SUBGROUP=void 0;const i=f(44207),c=f(96492),x=f(45068),B=f(27661),m=f(63834),S=f(84097),g=f(75752),_=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),R=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),T=BigInt(0),E=BigInt(1),j=BigInt(2),M=BigInt(5),k=BigInt(10),K=BigInt(20),W=BigInt(40),V=BigInt(80);function Z(Xe){const Te=_,Se=Xe*Xe%Te*Xe%Te,Ee=(0,m.pow2)(Se,j,Te)*Se%Te,ve=(0,m.pow2)(Ee,E,Te)*Xe%Te,De=(0,m.pow2)(ve,M,Te)*ve%Te,Re=(0,m.pow2)(De,k,Te)*De%Te,Je=(0,m.pow2)(Re,K,Te)*Re%Te,$e=(0,m.pow2)(Je,W,Te)*Je%Te,nt=(0,m.pow2)($e,V,Te)*$e%Te,Qe=(0,m.pow2)(nt,V,Te)*$e%Te,Tt=(0,m.pow2)(Qe,k,Te)*De%Te;return{pow_p_5_8:(0,m.pow2)(Tt,j,Te)*Xe%Te,b2:Se}}function q(Xe){return Xe[0]&=248,Xe[31]&=127,Xe[31]|=64,Xe}function ne(Xe,Te){const ke=_,Se=(0,m.mod)(Te*Te*Te,ke),ve=Z(Xe*(0,m.mod)(Se*Se*Te,ke)).pow_p_5_8;let De=(0,m.mod)(Xe*Se*ve,ke);const Re=(0,m.mod)(Te*De*De,ke),Je=De,$e=(0,m.mod)(De*R,ke),nt=Re===Xe,Qe=Re===(0,m.mod)(-Xe,ke),Tt=Re===(0,m.mod)(-Xe*R,ke);return nt&&(De=Je),(Qe||Tt)&&(De=$e),(0,m.isNegativeLE)(De,ke)&&(De=(0,m.mod)(-De,ke)),{isValid:nt||Qe,value:De}}F.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const te=(0,m.Field)(_,void 0,!0),ie={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:te,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:i.sha512,randomBytes:c.randomBytes,adjustScalarBytes:q,uvRatio:ne};function ae(Xe,Te,ke){if(Te.length>255)throw new Error("Context is too big");return(0,c.concatBytes)((0,c.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([ke?1:0,Te.length]),Te,Xe)}function me(Xe){const{y:Te}=F.ed25519.ExtendedPoint.fromHex(Xe),ke=BigInt(1);return te.toBytes(te.create((ke+Te)*te.inv(ke-Te)))}F.ed25519=(0,x.twistedEdwards)(ie),F.ed25519ctx=(0,x.twistedEdwards)({...ie,domain:ae}),F.ed25519ph=(0,x.twistedEdwards)({...ie,domain:ae,prehash:i.sha512}),F.x25519=(0,B.montgomery)({P:_,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:Xe=>{const Te=_,{pow_p_5_8:ke,b2:Se}=Z(Xe);return(0,m.mod)((0,m.pow2)(ke,BigInt(3),Te)*Se,Te)},adjustScalarBytes:q,randomBytes:c.randomBytes}),F.edwardsToMontgomeryPub=me,F.edwardsToMontgomery=me,F.edwardsToMontgomeryPriv=function ye(Xe){const Te=ie.hash(Xe.subarray(0,32));return ie.adjustScalarBytes(Te).subarray(0,32)};const ue=(te.ORDER+BigInt(3))/BigInt(8),$=te.pow(j,ue),o=te.sqrt(te.neg(te.ONE)),h=(te.ORDER-BigInt(5))/BigInt(8),A=BigInt(486662),O=(0,m.FpSqrtEven)(te,te.neg(BigInt(486664)));const H=(0,g.createHasher)(F.ed25519.ExtendedPoint,Xe=>function z(Xe){const{xMn:Te,xMd:ke,yMn:Se,yMd:Ee}=function C(Xe){let Te=te.sqr(Xe);Te=te.mul(Te,j);let ke=te.add(Te,te.ONE),Se=te.neg(A),Ee=te.sqr(ke),ve=te.mul(Ee,ke),De=te.mul(Te,A);De=te.mul(De,Se),De=te.add(De,Ee),De=te.mul(De,Se);let Re=te.sqr(ve);Ee=te.sqr(Re),Re=te.mul(Re,ve),Re=te.mul(Re,De),Ee=te.mul(Ee,Re);let Je=te.pow(Ee,h);Je=te.mul(Je,Re);let $e=te.mul(Je,o);Ee=te.sqr(Je),Ee=te.mul(Ee,ve);let nt=te.eql(Ee,De),Qe=te.cmov($e,Je,nt),Tt=te.mul(Se,Te),ct=te.mul(Je,Xe);ct=te.mul(ct,$);let ze=te.mul(ct,o),St=te.mul(De,Te);Ee=te.sqr(ct),Ee=te.mul(Ee,ve);let re=te.eql(Ee,St),X=te.cmov(ze,ct,re);Ee=te.sqr(Qe),Ee=te.mul(Ee,ve);let G=te.eql(Ee,De),he=te.cmov(Tt,Se,G),_e=te.cmov(X,Qe,G),je=te.isOdd(_e);return _e=te.cmov(_e,te.neg(_e),G!==je),{xMn:he,xMd:ke,yMn:_e,yMd:E}}(Xe);let ve=te.mul(Te,Ee);ve=te.mul(ve,O);let De=te.mul(ke,Se),Re=te.sub(Te,ke),Je=te.add(Te,ke),$e=te.mul(De,Je),nt=te.eql($e,te.ZERO);ve=te.cmov(ve,te.ZERO,nt),De=te.cmov(De,te.ONE,nt),Re=te.cmov(Re,te.ONE,nt),Je=te.cmov(Je,te.ONE,nt);const Qe=te.invertBatch([De,Je]);return{x:te.mul(ve,Qe[0]),y:te.mul(Re,Qe[1])}}(Xe[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:te.ORDER,m:1,k:128,expand:"xmd",hash:i.sha512});function I(Xe){if(!(Xe instanceof xe))throw new Error("RistrettoPoint expected")}F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve;const s=R,p=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),J=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ee=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),se=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),de=Xe=>ne(E,Xe),Ae=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ie=Xe=>F.ed25519.CURVE.Fp.create((0,S.bytesToNumberLE)(Xe)&Ae);function Le(Xe){const{d:Te}=F.ed25519.CURVE,ke=F.ed25519.CURVE.Fp.ORDER,Se=F.ed25519.CURVE.Fp.create,Ee=Se(s*Xe*Xe),ve=Se((Ee+E)*ee);let De=BigInt(-1);const Re=Se((De-Te*Ee)*Se(Ee+Te));let{isValid:Je,value:$e}=ne(ve,Re),nt=Se($e*Xe);(0,m.isNegativeLE)(nt,ke)||(nt=Se(-nt)),Je||($e=nt),Je||(De=Ee);const Qe=Se(De*(Ee-E)*se-Re),Tt=$e*$e,ct=Se(($e+$e)*Re),ze=Se(Qe*p),St=Se(E-Tt),re=Se(E+Tt);return new F.ed25519.ExtendedPoint(Se(ct*re),Se(St*ze),Se(ze*re),Se(ct*St))}class xe{constructor(Te){this.ep=Te}static fromAffine(Te){return new xe(F.ed25519.ExtendedPoint.fromAffine(Te))}static hashToCurve(Te){Te=(0,S.ensureBytes)("ristrettoHash",Te,64);const Se=Le(Ie(Te.slice(0,32))),ve=Le(Ie(Te.slice(32,64)));return new xe(Se.add(ve))}static fromHex(Te){Te=(0,S.ensureBytes)("ristrettoHex",Te,32);const{a:ke,d:Se}=F.ed25519.CURVE,Ee=F.ed25519.CURVE.Fp.ORDER,ve=F.ed25519.CURVE.Fp.create,De="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",Re=Ie(Te);if(!(0,S.equalBytes)((0,S.numberToBytesLE)(Re,32),Te)||(0,m.isNegativeLE)(Re,Ee))throw new Error(De);const Je=ve(Re*Re),$e=ve(E+ke*Je),nt=ve(E-ke*Je),Qe=ve($e*$e),Tt=ve(nt*nt),ct=ve(ke*Se*Qe-Tt),{isValid:ze,value:St}=de(ve(ct*Tt)),re=ve(St*nt),X=ve(St*re*ct);let G=ve((Re+Re)*re);(0,m.isNegativeLE)(G,Ee)&&(G=ve(-G));const he=ve($e*X),_e=ve(G*he);if(!ze||(0,m.isNegativeLE)(_e,Ee)||he===T)throw new Error(De);return new xe(new F.ed25519.ExtendedPoint(G,he,E,_e))}toRawBytes(){let{ex:Te,ey:ke,ez:Se,et:Ee}=this.ep;const ve=F.ed25519.CURVE.Fp.ORDER,De=F.ed25519.CURVE.Fp.create,Re=De(De(Se+ke)*De(Se-ke)),Je=De(Te*ke),$e=De(Je*Je),{value:nt}=de(De(Re*$e)),Qe=De(nt*Re),Tt=De(nt*Je),ct=De(Qe*Tt*Ee);let ze;if((0,m.isNegativeLE)(Ee*ct,ve)){let re=De(ke*s),X=De(Te*s);Te=re,ke=X,ze=De(Qe*J)}else ze=Tt;(0,m.isNegativeLE)(Te*ct,ve)&&(ke=De(-ke));let St=De((Se-ke)*ze);return(0,m.isNegativeLE)(St,ve)&&(St=De(-St)),(0,S.numberToBytesLE)(St,32)}toHex(){return(0,S.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(Te){I(Te);const{ex:ke,ey:Se}=this.ep,{ex:Ee,ey:ve}=Te.ep,De=F.ed25519.CURVE.Fp.create,Re=De(ke*ve)===De(Se*Ee),Je=De(Se*ve)===De(ke*Ee);return Re||Je}add(Te){return I(Te),new xe(this.ep.add(Te.ep))}subtract(Te){return I(Te),new xe(this.ep.subtract(Te.ep))}multiply(Te){return new xe(this.ep.multiply(Te))}multiplyUnsafe(Te){return new xe(this.ep.multiplyUnsafe(Te))}double(){return new xe(this.ep.double())}negate(){return new xe(this.ep.negate())}}F.RistrettoPoint=(xe.BASE||(xe.BASE=new xe(F.ed25519.ExtendedPoint.BASE)),xe.ZERO||(xe.ZERO=new xe(F.ed25519.ExtendedPoint.ZERO)),xe),F.hashToRistretto255=(Xe,Te)=>{const ke=Te.DST,Se="string"==typeof ke?(0,c.utf8ToBytes)(ke):ke,Ee=(0,g.expand_message_xmd)(Xe,Se,64,i.sha512);return xe.hashToCurve(Ee)},F.hash_to_ristretto255=F.hashToRistretto255},91717:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.encodeToCurve=F.hashToCurve=F.schnorr=F.secp256k1=void 0;const i=f(1806),c=f(96492),x=f(63834),B=f(73040),m=f(84097),S=f(75752),g=f(4521),_=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),R=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),T=BigInt(1),E=BigInt(2),j=(I,s)=>(I+s/E)/s;function M(I){const s=_,p=BigInt(3),J=BigInt(6),ee=BigInt(11),se=BigInt(22),de=BigInt(23),Ae=BigInt(44),Ie=BigInt(88),Le=I*I*I%s,xe=Le*Le*I%s,Ce=(0,x.pow2)(xe,p,s)*xe%s,Xe=(0,x.pow2)(Ce,p,s)*xe%s,Te=(0,x.pow2)(Xe,E,s)*Le%s,ke=(0,x.pow2)(Te,ee,s)*Te%s,Se=(0,x.pow2)(ke,se,s)*ke%s,Ee=(0,x.pow2)(Se,Ae,s)*Se%s,ve=(0,x.pow2)(Ee,Ie,s)*Ee%s,De=(0,x.pow2)(ve,Ae,s)*Se%s,Re=(0,x.pow2)(De,p,s)*xe%s,Je=(0,x.pow2)(Re,de,s)*ke%s,$e=(0,x.pow2)(Je,J,s)*Le%s,nt=(0,x.pow2)($e,E,s);if(!k.eql(k.sqr(nt),I))throw new Error("Cannot find square root");return nt}const k=(0,x.Field)(_,void 0,void 0,{sqrt:M});F.secp256k1=(0,g.createCurve)({a:BigInt(0),b:BigInt(7),Fp:k,n:R,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:I=>{const s=R,p=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),J=-T*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ee=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),se=p,de=BigInt("0x100000000000000000000000000000000"),Ae=j(se*I,s),Ie=j(-J*I,s);let Le=(0,x.mod)(I-Ae*p-Ie*ee,s),xe=(0,x.mod)(-Ae*J-Ie*se,s);const Ce=Le>de,Xe=xe>de;if(Ce&&(Le=s-Le),Xe&&(xe=s-xe),Le>de||xe>de)throw new Error("splitScalar: Endomorphism failed, k="+I);return{k1neg:Ce,k1:Le,k2neg:Xe,k2:xe}}}},i.sha256);const K=BigInt(0),W=I=>"bigint"==typeof I&&Kee.charCodeAt(0)));p=(0,m.concatBytes)(J,J),Z[I]=p}return(0,i.sha256)((0,m.concatBytes)(p,...s))}const ne=I=>I.toRawBytes(!0).slice(1),te=I=>(0,m.numberToBytesBE)(I,32),ie=I=>(0,x.mod)(I,_),ae=I=>(0,x.mod)(I,R),me=F.secp256k1.ProjectivePoint;function ue(I){let s=F.secp256k1.utils.normPrivateKeyToScalar(I),p=me.fromPrivateKey(s);return{scalar:p.hasEvenY()?s:ae(-s),bytes:ne(p)}}function $(I){if(!W(I))throw new Error("bad x: need 0 < x < p");const s=ie(I*I);let J=M(ie(s*I+BigInt(7)));J%E!==K&&(J=ie(-J));const ee=new me(I,J,T);return ee.assertValidity(),ee}function o(...I){return ae((0,m.bytesToNumberBE)(q("BIP0340/challenge",...I)))}function C(I,s,p){const J=(0,m.ensureBytes)("signature",I,64),ee=(0,m.ensureBytes)("message",s),se=(0,m.ensureBytes)("publicKey",p,32);try{const de=$((0,m.bytesToNumberBE)(se)),Ae=(0,m.bytesToNumberBE)(J.subarray(0,32));if(!W(Ae))return!1;const Ie=(0,m.bytesToNumberBE)(J.subarray(32,64));if(!(I=>"bigint"==typeof I&&Kme.BASE.multiplyAndAddUnsafe(I,s,p))(de,Ie,ae(-Le));return!(!xe||!xe.hasEvenY()||xe.toAffine().x!==Ae)}catch{return!1}}F.schnorr={getPublicKey:function h(I){return ue(I).bytes},sign:function A(I,s,p=(0,c.randomBytes)(32)){const J=(0,m.ensureBytes)("message",I),{bytes:ee,scalar:se}=ue(s),de=(0,m.ensureBytes)("auxRand",p,32),Ae=te(se^(0,m.bytesToNumberBE)(q("BIP0340/aux",de))),Ie=q("BIP0340/nonce",Ae,ee,J),Le=ae((0,m.bytesToNumberBE)(Ie));if(Le===K)throw new Error("sign failed: k is zero");const{bytes:xe,scalar:Ce}=ue(Le),Xe=o(xe,ee,J),Te=new Uint8Array(64);if(Te.set(xe,0),Te.set(te(ae(Ce+Xe*se)),32),!C(Te,J,ee))throw new Error("sign: Invalid signature produced");return Te},verify:C,utils:{randomPrivateKey:F.secp256k1.utils.randomPrivateKey,lift_x:$,pointToBytes:ne,numberToBytesBE:m.numberToBytesBE,bytesToNumberBE:m.bytesToNumberBE,taggedHash:q,mod:x.mod}};const O=(0,S.isogenyMap)(k,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(I=>I.map(s=>BigInt(s)))),z=(0,B.mapToCurveSimpleSWU)(k,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:k.create(BigInt("-11"))}),H=(0,S.createHasher)(F.secp256k1.ProjectivePoint,I=>{const{x:s,y:p}=z(k.create(I[0]));return O(s,p)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:k.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256});F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve},68578:(Me,F)=>{"use strict";function f(_){if(!Number.isSafeInteger(_)||_<0)throw new Error(`Wrong positive integer: ${_}`)}function i(_){if("boolean"!=typeof _)throw new Error(`Expected boolean, not ${_}`)}function x(_,...R){if(!function c(_){return _ instanceof Uint8Array||null!=_&&"object"==typeof _&&"Uint8Array"===_.constructor.name}(_))throw new Error("Expected Uint8Array");if(R.length>0&&!R.includes(_.length))throw new Error(`Expected Uint8Array of length ${R}, not of length=${_.length}`)}function B(_){if("function"!=typeof _||"function"!=typeof _.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");f(_.outputLen),f(_.blockLen)}function m(_,R=!0){if(_.destroyed)throw new Error("Hash instance has been destroyed");if(R&&_.finished)throw new Error("Hash#digest() has already been called")}function S(_,R){x(_);const T=R.outputLen;if(_.length{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SHA2=void 0;const i=f(68578),c=f(96492);F.SHA2=class B extends c.Hash{constructor(S,g,_,R){super(),this.blockLen=S,this.outputLen=g,this.padOffset=_,this.isLE=R,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(S),this.view=(0,c.createView)(this.buffer)}update(S){(0,i.exists)(this);const{view:g,buffer:_,blockLen:R}=this,T=(S=(0,c.toBytes)(S)).length;for(let E=0;ER-E&&(this.process(_,0),E=0);for(let W=E;W>R&T),j=Number(g&T),k=_?0:4;m.setUint32(S+(_?4:0),E,_),m.setUint32(S+k,j,_)})(_,R-8,BigInt(8*this.length),T),this.process(_,0);const j=(0,c.createView)(S),M=this.outputLen;if(M%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const k=M/4,K=this.get();if(k>K.length)throw new Error("_sha2: outputLen bigger than state");for(let W=0;W{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.add5L=F.add5H=F.add4H=F.add4L=F.add3H=F.add3L=F.add=F.rotlBL=F.rotlBH=F.rotlSL=F.rotlSH=F.rotr32L=F.rotr32H=F.rotrBL=F.rotrBH=F.rotrSL=F.rotrSH=F.shrSL=F.shrSH=F.toBig=F.split=F.fromBig=void 0;const f=BigInt(2**32-1),i=BigInt(32);function c(ye,ue=!1){return ue?{h:Number(ye&f),l:Number(ye>>i&f)}:{h:0|Number(ye>>i&f),l:0|Number(ye&f)}}function x(ye,ue=!1){let $=new Uint32Array(ye.length),o=new Uint32Array(ye.length);for(let h=0;hBigInt(ye>>>0)<>>0);F.toBig=B;const m=(ye,ue,$)=>ye>>>$;F.shrSH=m;const S=(ye,ue,$)=>ye<<32-$|ue>>>$;F.shrSL=S;const g=(ye,ue,$)=>ye>>>$|ue<<32-$;F.rotrSH=g;const _=(ye,ue,$)=>ye<<32-$|ue>>>$;F.rotrSL=_;const R=(ye,ue,$)=>ye<<64-$|ue>>>$-32;F.rotrBH=R;const T=(ye,ue,$)=>ye>>>$-32|ue<<64-$;F.rotrBL=T;const E=(ye,ue)=>ue;F.rotr32H=E;const j=(ye,ue)=>ye;F.rotr32L=j;const M=(ye,ue,$)=>ye<<$|ue>>>32-$;F.rotlSH=M;const k=(ye,ue,$)=>ue<<$|ye>>>32-$;F.rotlSL=k;const K=(ye,ue,$)=>ue<<$-32|ye>>>64-$;F.rotlBH=K;const W=(ye,ue,$)=>ye<<$-32|ue>>>64-$;function V(ye,ue,$,o){const h=(ue>>>0)+(o>>>0);return{h:ye+$+(h/2**32|0)|0,l:0|h}}F.rotlBL=W,F.add=V;const Z=(ye,ue,$)=>(ye>>>0)+(ue>>>0)+($>>>0);F.add3L=Z;const q=(ye,ue,$,o)=>ue+$+o+(ye/2**32|0)|0;F.add3H=q;const ne=(ye,ue,$,o)=>(ye>>>0)+(ue>>>0)+($>>>0)+(o>>>0);F.add4L=ne;const te=(ye,ue,$,o,h)=>ue+$+o+h+(ye/2**32|0)|0;F.add4H=te;const ie=(ye,ue,$,o,h)=>(ye>>>0)+(ue>>>0)+($>>>0)+(o>>>0)+(h>>>0);F.add5L=ie;const ae=(ye,ue,$,o,h,A)=>ue+$+o+h+A+(ye/2**32|0)|0;F.add5H=ae,F.default={fromBig:c,split:x,toBig:B,shrSH:m,shrSL:S,rotrSH:g,rotrSL:_,rotrBH:R,rotrBL:T,rotr32H:E,rotr32L:j,rotlSH:M,rotlSL:k,rotlBH:K,rotlBL:W,add:V,add3L:Z,add3H:q,add4L:ne,add4H:te,add5H:ae,add5L:ie}},89948:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.crypto=void 0,F.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},57334:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hkdf=F.expand=F.extract=void 0;const i=f(68578),c=f(96492),x=f(44882);function B(R,T,E){return(0,i.hash)(R),void 0===E&&(E=new Uint8Array(R.outputLen)),(0,x.hmac)(R,(0,c.toBytes)(E),(0,c.toBytes)(T))}F.extract=B;const m=new Uint8Array([0]),S=new Uint8Array;function g(R,T,E,j=32){if((0,i.hash)(R),(0,i.number)(j),j>255*R.outputLen)throw new Error("Length should be <= 255*HashLen");const M=Math.ceil(j/R.outputLen);void 0===E&&(E=S);const k=new Uint8Array(M*R.outputLen),K=x.hmac.create(R,T),W=K._cloneInto(),V=new Uint8Array(K.outputLen);for(let Z=0;Zg(R,B(R,T,E),j,M)},44882:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hmac=F.HMAC=void 0;const i=f(68578),c=f(96492);class x extends c.Hash{constructor(S,g){super(),this.finished=!1,this.destroyed=!1,(0,i.hash)(S);const _=(0,c.toBytes)(g);if(this.iHash=S.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const R=this.blockLen,T=new Uint8Array(R);T.set(_.length>R?S.create().update(_).digest():_);for(let E=0;Enew x(m,S).update(g).digest(),F.hmac.create=(m,S)=>new x(m,S)},1806:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha224=F.sha256=void 0;const i=f(25724),c=f(96492),x=(T,E,j)=>T&E^~T&j,B=(T,E,j)=>T&E^T&j^E&j,m=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),S=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g=new Uint32Array(64);class _ extends i.SHA2{constructor(){super(64,32,8,!1),this.A=0|S[0],this.B=0|S[1],this.C=0|S[2],this.D=0|S[3],this.E=0|S[4],this.F=0|S[5],this.G=0|S[6],this.H=0|S[7]}get(){const{A:E,B:j,C:M,D:k,E:K,F:W,G:V,H:Z}=this;return[E,j,M,k,K,W,V,Z]}set(E,j,M,k,K,W,V,Z){this.A=0|E,this.B=0|j,this.C=0|M,this.D=0|k,this.E=0|K,this.F=0|W,this.G=0|V,this.H=0|Z}process(E,j){for(let te=0;te<16;te++,j+=4)g[te]=E.getUint32(j,!1);for(let te=16;te<64;te++){const ie=g[te-15],ae=g[te-2],me=(0,c.rotr)(ie,7)^(0,c.rotr)(ie,18)^ie>>>3,ye=(0,c.rotr)(ae,17)^(0,c.rotr)(ae,19)^ae>>>10;g[te]=ye+g[te-7]+me+g[te-16]|0}let{A:M,B:k,C:K,D:W,E:V,F:Z,G:q,H:ne}=this;for(let te=0;te<64;te++){const ae=ne+((0,c.rotr)(V,6)^(0,c.rotr)(V,11)^(0,c.rotr)(V,25))+x(V,Z,q)+m[te]+g[te]|0,ye=((0,c.rotr)(M,2)^(0,c.rotr)(M,13)^(0,c.rotr)(M,22))+B(M,k,K)|0;ne=q,q=Z,Z=V,V=W+ae|0,W=K,K=k,k=M,M=ae+ye|0}M=M+this.A|0,k=k+this.B|0,K=K+this.C|0,W=W+this.D|0,V=V+this.E|0,Z=Z+this.F|0,q=q+this.G|0,ne=ne+this.H|0,this.set(M,k,K,W,V,Z,q,ne)}roundClean(){g.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class R extends _{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}F.sha256=(0,c.wrapConstructor)(()=>new _),F.sha224=(0,c.wrapConstructor)(()=>new R)},44207:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha384=F.sha512_256=F.sha512_224=F.sha512=F.SHA512=void 0;const i=f(25724),c=f(35059),x=f(96492),[B,m]=c.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(j=>BigInt(j))),S=new Uint32Array(80),g=new Uint32Array(80);class _ extends i.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:M,Al:k,Bh:K,Bl:W,Ch:V,Cl:Z,Dh:q,Dl:ne,Eh:te,El:ie,Fh:ae,Fl:me,Gh:ye,Gl:ue,Hh:$,Hl:o}=this;return[M,k,K,W,V,Z,q,ne,te,ie,ae,me,ye,ue,$,o]}set(M,k,K,W,V,Z,q,ne,te,ie,ae,me,ye,ue,$,o){this.Ah=0|M,this.Al=0|k,this.Bh=0|K,this.Bl=0|W,this.Ch=0|V,this.Cl=0|Z,this.Dh=0|q,this.Dl=0|ne,this.Eh=0|te,this.El=0|ie,this.Fh=0|ae,this.Fl=0|me,this.Gh=0|ye,this.Gl=0|ue,this.Hh=0|$,this.Hl=0|o}process(M,k){for(let C=0;C<16;C++,k+=4)S[C]=M.getUint32(k),g[C]=M.getUint32(k+=4);for(let C=16;C<80;C++){const O=0|S[C-15],z=0|g[C-15],H=c.default.rotrSH(O,z,1)^c.default.rotrSH(O,z,8)^c.default.shrSH(O,z,7),I=c.default.rotrSL(O,z,1)^c.default.rotrSL(O,z,8)^c.default.shrSL(O,z,7),s=0|S[C-2],p=0|g[C-2],J=c.default.rotrSH(s,p,19)^c.default.rotrBH(s,p,61)^c.default.shrSH(s,p,6),ee=c.default.rotrSL(s,p,19)^c.default.rotrBL(s,p,61)^c.default.shrSL(s,p,6),se=c.default.add4L(I,ee,g[C-7],g[C-16]),de=c.default.add4H(se,H,J,S[C-7],S[C-16]);S[C]=0|de,g[C]=0|se}let{Ah:K,Al:W,Bh:V,Bl:Z,Ch:q,Cl:ne,Dh:te,Dl:ie,Eh:ae,El:me,Fh:ye,Fl:ue,Gh:$,Gl:o,Hh:h,Hl:A}=this;for(let C=0;C<80;C++){const O=c.default.rotrSH(ae,me,14)^c.default.rotrSH(ae,me,18)^c.default.rotrBH(ae,me,41),z=c.default.rotrSL(ae,me,14)^c.default.rotrSL(ae,me,18)^c.default.rotrBL(ae,me,41),H=ae&ye^~ae&$,s=c.default.add5L(A,z,me&ue^~me&o,m[C],g[C]),p=c.default.add5H(s,h,O,H,B[C],S[C]),J=0|s,ee=c.default.rotrSH(K,W,28)^c.default.rotrBH(K,W,34)^c.default.rotrBH(K,W,39),se=c.default.rotrSL(K,W,28)^c.default.rotrBL(K,W,34)^c.default.rotrBL(K,W,39),de=K&V^K&q^V&q,Ae=W&Z^W&ne^Z≠h=0|$,A=0|o,$=0|ye,o=0|ue,ye=0|ae,ue=0|me,({h:ae,l:me}=c.default.add(0|te,0|ie,0|p,0|J)),te=0|q,ie=0|ne,q=0|V,ne=0|Z,V=0|K,Z=0|W;const Ie=c.default.add3L(J,se,Ae);K=c.default.add3H(Ie,p,ee,de),W=0|Ie}({h:K,l:W}=c.default.add(0|this.Ah,0|this.Al,0|K,0|W)),({h:V,l:Z}=c.default.add(0|this.Bh,0|this.Bl,0|V,0|Z)),({h:q,l:ne}=c.default.add(0|this.Ch,0|this.Cl,0|q,0|ne)),({h:te,l:ie}=c.default.add(0|this.Dh,0|this.Dl,0|te,0|ie)),({h:ae,l:me}=c.default.add(0|this.Eh,0|this.El,0|ae,0|me)),({h:ye,l:ue}=c.default.add(0|this.Fh,0|this.Fl,0|ye,0|ue)),({h:$,l:o}=c.default.add(0|this.Gh,0|this.Gl,0|$,0|o)),({h,l:A}=c.default.add(0|this.Hh,0|this.Hl,0|h,0|A)),this.set(K,W,V,Z,q,ne,te,ie,ae,me,ye,ue,$,o,h,A)}roundClean(){S.fill(0),g.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}F.SHA512=_;class R extends _{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class T extends _{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class E extends _{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}F.sha512=(0,x.wrapConstructor)(()=>new _),F.sha512_224=(0,x.wrapConstructor)(()=>new R),F.sha512_256=(0,x.wrapConstructor)(()=>new T),F.sha384=(0,x.wrapConstructor)(()=>new E)},96492:(Me,F,f)=>{"use strict";var i=f(29293).default;Object.defineProperty(F,"__esModule",{value:!0}),F.randomBytes=F.wrapXOFConstructorWithOpts=F.wrapConstructorWithOpts=F.wrapConstructor=F.checkOpts=F.Hash=F.concatBytes=F.toBytes=F.utf8ToBytes=F.asyncLoop=F.nextTick=F.hexToBytes=F.bytesToHex=F.isLE=F.rotr=F.createView=F.u32=F.u8=void 0;const c=f(89948);function m(ue){return ue instanceof Uint8Array||null!=ue&&"object"==typeof ue&&"Uint8Array"===ue.constructor.name}if(F.u8=ue=>new Uint8Array(ue.buffer,ue.byteOffset,ue.byteLength),F.u32=ue=>new Uint32Array(ue.buffer,ue.byteOffset,Math.floor(ue.byteLength/4)),F.createView=ue=>new DataView(ue.buffer,ue.byteOffset,ue.byteLength),F.rotr=(ue,$)=>ue<<32-$|ue>>>$,F.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!F.isLE)throw new Error("Non little-endian hardware is not supported");const _=Array.from({length:256},(ue,$)=>$.toString(16).padStart(2,"0"));F.bytesToHex=function R(ue){if(!m(ue))throw new Error("Uint8Array expected");let $="";for(let o=0;o=T__0&&ue<=T__9?ue-T__0:ue>=T__A&&ue<=T__F?ue-(T__A-10):ue>=T__a&&ue<=T__f?ue-(T__a-10):void 0}function K(){return(K=i(function*(ue,$,o){let h=Date.now();for(let A=0;A=0&&C<$||(yield(0,F.nextTick)(),h+=C)}})).apply(this,arguments)}function W(ue){if("string"!=typeof ue)throw new Error("utf8ToBytes expected string, got "+typeof ue);return new Uint8Array((new TextEncoder).encode(ue))}function V(ue){if("string"==typeof ue&&(ue=W(ue)),!m(ue))throw new Error("expected Uint8Array, got "+typeof ue);return ue}F.hexToBytes=function j(ue){if("string"!=typeof ue)throw new Error("hex string expected, got "+typeof ue);const $=ue.length,o=$/2;if($%2)throw new Error("padded hex string expected, got unpadded hex of length "+$);const h=new Uint8Array(o);for(let A=0,C=0;Aue().update(V(h)).digest(),o=ue();return $.outputLen=o.outputLen,$.blockLen=o.blockLen,$.create=()=>ue(),$},F.wrapConstructorWithOpts=function ae(ue){const $=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return $.outputLen=o.outputLen,$.blockLen=o.blockLen,$.create=h=>ue(h),$},F.wrapXOFConstructorWithOpts=function me(ue){const $=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return $.outputLen=o.outputLen,$.blockLen=o.blockLen,$.create=h=>ue(h),$},F.randomBytes=function ye(ue=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(ue));throw new Error("crypto.getRandomValues must be defined")}},15315:(Me,F,f)=>{"use strict";var o,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,g=(o,h)=>{var A={};for(var C in o)m.call(o,C)&&h.indexOf(C)<0&&(A[C]=o[C]);if(null!=o&&B)for(var C of B(o))h.indexOf(C)<0&&S.call(o,C)&&(A[C]=o[C]);return A},E=(o,h,A)=>new Promise((C,O)=>{var z=s=>{try{I(A.next(s))}catch(p){O(p)}},H=s=>{try{I(A.throw(s))}catch(p){O(p)}},I=s=>s.done?C(s.value):Promise.resolve(s.value).then(z,H);I((A=A.apply(o,h)).next())}),j={};((o,h)=>{for(var A in h)i(o,A,{get:h[A],enumerable:!0})})(j,{createHashMapping:()=>ae,createHashMappingSync:()=>me,decodeJwt:()=>K,decodeSdJwt:()=>V,decodeSdJwtSync:()=>Z,getClaims:()=>q,getClaimsSync:()=>ne,getSDAlgAndPayload:()=>ye,splitSdJwt:()=>W,unpack:()=>ue,unpackArray:()=>te,unpackObj:()=>ie,unpackSync:()=>$}),Me.exports=(o=j,((o,h,A,C)=>{if(h&&"object"==typeof h||"function"==typeof h)for(let O of x(h))!m.call(o,O)&&undefined!==O&&i(o,O,{get:()=>h[O],enumerable:!(C=c(h,O))||C.enumerable});return o})(i({},"__esModule",{value:!0}),o));var M=f(47862),k=f(29994),K=o=>{const{0:h,1:A,2:C,length:O}=o.split(".");if(3!==O)throw new M.SDJWTException("Invalid JWT as input");return{header:JSON.parse((0,M.base64urlDecode)(h)),payload:JSON.parse((0,M.base64urlDecode)(A)),signature:C}},W=o=>{const[h,...A]=o.split(k.SD_SEPARATOR);if(0===A.length)return{jwt:h,disclosures:[]};const C=A.pop();return{jwt:h,disclosures:A,kbJwt:C||void 0}},V=(o,h)=>E(void 0,null,function*(){const[A,...C]=o.split(k.SD_SEPARATOR),O=K(A);if(0===C.length)return{jwt:O,disclosures:[]};const z=C.pop(),H=z?K(z):void 0,{_sd_alg:I}=ye(O.payload);return{jwt:O,disclosures:yield Promise.all(C.map(p=>M.Disclosure.fromEncode(p,{alg:I,hasher:h}))),kbJwt:H}}),Z=(o,h)=>{const[A,...C]=o.split(k.SD_SEPARATOR),O=K(A);if(0===C.length)return{jwt:O,disclosures:[]};const z=C.pop(),H=z?K(z):void 0,{_sd_alg:I}=ye(O.payload);return{jwt:O,disclosures:C.map(p=>M.Disclosure.fromEncodeSync(p,{alg:I,hasher:h})),kbJwt:H}},q=(o,h,A)=>E(void 0,null,function*(){const{unpackedObj:C}=yield ue(o,h,A);return C}),ne=(o,h,A)=>{const{unpackedObj:C}=$(o,h,A);return C},te=(o,h,A="")=>{const C={},O=[];return o.forEach((z,H)=>{if("object"==typeof z&&null!==z){const I=z[k.SD_LIST_KEY];if(I){const s=h[I];if(s){const p=A?`${A}.${H}`:`${H}`;C[p]=I;const{unpackedObj:J,disclosureKeymap:ee}=ie(s.value,h,p);O.push(J),Object.assign(C,ee)}}else{const s=A?`${A}.${H}`:`${H}`,{unpackedObj:p,disclosureKeymap:J}=ie(z,h,s);O.push(p),Object.assign(C,J)}}else O.push(z)}),{unpackedObj:O,disclosureKeymap:C}},ie=(o,h,A="")=>{const C={};if("object"==typeof o&&null!==o){if(Array.isArray(o))return te(o,h,A);for(const p in o)if(p!==k.SD_DIGEST&&p!==k.SD_LIST_KEY&&"object"==typeof o[p]){const J=A?`${A}.${p}`:p,{unpackedObj:ee,disclosureKeymap:se}=ie(o[p],h,J);o[p]=ee,Object.assign(C,se)}const O=o,{_sd:z}=O,H=g(O,["_sd"]),I={};if(z)for(const p of z){const J=h[p];if(J?.key){const ee=A?`${A}.${J.key}`:J.key;C[ee]=p;const{unpackedObj:se,disclosureKeymap:de}=ie(J.value,h,ee);I[J.key]=se,Object.assign(C,de)}}return{unpackedObj:Object.assign(H,I),disclosureKeymap:C}}return{unpackedObj:o,disclosureKeymap:C}},ae=(o,h)=>E(void 0,null,function*(){const A={};for(let C=0;C{const A={};for(let C=0;C{const h=o,{_sd_alg:A}=h,C=g(h,["_sd_alg"]);return"string"!=typeof A?{_sd_alg:"sha-256",payload:C}:{_sd_alg:A,payload:C}},ue=(o,h,A)=>E(void 0,null,function*(){const{_sd_alg:C,payload:O}=ye(o),H=yield ae(h,{hasher:A,alg:C});return ie(O,H)}),$=(o,h,A)=>{const{_sd_alg:C,payload:O}=ye(o),H=me(h,{hasher:A,alg:C});return ie(O,H)}},22084:(Me,F,f)=>{"use strict";var ne,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,_=(ne,te,ie)=>new Promise((ae,me)=>{var ye=o=>{try{$(ie.next(o))}catch(h){me(h)}},ue=o=>{try{$(ie.throw(o))}catch(h){me(h)}},$=o=>o.done?ae(o.value):Promise.resolve(o.value).then(ye,ue);$((ie=ie.apply(ne,te)).next())}),R={};((ne,te)=>{for(var ie in te)i(ne,ie,{get:te[ie],enumerable:!0})})(R,{createHashMappingForSerializedDisclosure:()=>Z,present:()=>K,presentSync:()=>W,presentableKeys:()=>M,presentableKeysSync:()=>k,selectDisclosures:()=>q,transformPresentationFrame:()=>V}),Me.exports=(ne=R,((ne,te,ie,ae)=>{if(te&&"object"==typeof te||"function"==typeof te)for(let me of x(te))!B.call(ne,me)&&undefined!==me&&i(ne,me,{get:()=>te[me],enumerable:!(ae=c(te,me))||ae.enumerable});return ne})(i({},"__esModule",{value:!0}),ne));var T=f(29994),E=f(47862),j=f(15315),M=(ne,te,ie)=>_(void 0,null,function*(){const{disclosureKeymap:ae}=yield(0,j.unpack)(ne,te,ie);return Object.keys(ae).sort()}),k=(ne,te,ie)=>{const{disclosureKeymap:ae}=(0,j.unpackSync)(ne,te,ie);return Object.keys(ae).sort()},K=(ne,te,ie)=>_(void 0,null,function*(){const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(ne),{jwt:{payload:ye},disclosures:ue}=yield(0,j.decodeSdJwt)(ne,ie),{_sd_alg:$}=(0,j.getSDAlgAndPayload)(ye),o={alg:$,hasher:ie},h=V(te),A=yield(0,j.createHashMapping)(ue,o),{disclosureKeymap:C}=yield(0,j.unpack)(ye,ue,ie);return[ae,...h.map(z=>A[C[z]]).filter(z=>void 0!==z).map(z=>z.encode()),me??""].join(T.SD_SEPARATOR)}),W=(ne,te,ie)=>{const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(ne),{jwt:{payload:ye},disclosures:ue}=(0,j.decodeSdJwtSync)(ne,ie),{_sd_alg:$}=(0,j.getSDAlgAndPayload)(ye),o={alg:$,hasher:ie},h=V(te),A=(0,j.createHashMappingSync)(ue,o),{disclosureKeymap:C}=(0,j.unpackSync)(ye,ue,ie);return[ae,...h.map(z=>A[C[z]]).filter(z=>void 0!==z).map(z=>z.encode()),me??""].join(T.SD_SEPARATOR)},V=(ne,te="")=>Object.entries(ne).reduce((ie,[ae,me])=>{const ye=te?`${te}.${ae}`:ae;return"boolean"==typeof me?me&&ie.push(ye):ie.push(ye,...V(me,ye)),ie},[]),Z=ne=>{const te={};for(let ie=0;ie{if(0===te.length)return[];const ae=Z(te),{disclosureKeymap:me}=(0,j.unpackObj)(ne,ae);return V(ie).map(o=>ae[me[o]]).filter(o=>void 0!==o).map(o=>{const{salt:h,key:A,value:C,_digest:O}=o;if(!O)throw new E.SDJWTException("Implementation error: _digest is not defined");return{digest:O,encoded:o.encode(),salt:h,key:A,value:C}})}},29994:Me=>{"use strict";var j,F=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,S={};((j,M)=>{for(var k in M)F(j,k,{get:M[k],enumerable:!0})})(S,{KB_JWT_TYP:()=>E,SD_DECOY:()=>T,SD_DIGEST:()=>R,SD_LIST_KEY:()=>_,SD_SEPARATOR:()=>g}),Me.exports=(j=S,((j,M,k,K)=>{if(M&&"object"==typeof M||"function"==typeof M)for(let W of i(M))!c.call(j,W)&&undefined!==W&&F(j,W,{get:()=>M[W],enumerable:!(K=f(M,W))||K.enumerable});return j})(F({},"__esModule",{value:!0}),j));var g="~",_="...",R="_sd",T="_sd_decoy",E="kb+jwt"},47862:(Me,F,f)=>{"use strict";var W,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,_=(W,V,Z)=>new Promise((q,ne)=>{var te=me=>{try{ae(Z.next(me))}catch(ye){ne(ye)}},ie=me=>{try{ae(Z.throw(me))}catch(ye){ne(ye)}},ae=me=>me.done?q(me.value):Promise.resolve(me.value).then(te,ie);ae((Z=Z.apply(W,V)).next())}),R={};((W,V)=>{for(var Z in V)i(W,Z,{get:V[Z],enumerable:!0})})(R,{Disclosure:()=>K,SDJWTException:()=>k,base64urlDecode:()=>j,base64urlEncode:()=>E,uint8ArrayToBase64Url:()=>M}),Me.exports=(W=R,((W,V,Z,q)=>{if(V&&"object"==typeof V||"function"==typeof V)for(let ne of x(V))!B.call(W,ne)&&undefined!==ne&&i(W,ne,{get:()=>V[ne],enumerable:!(q=c(V,ne))||q.enumerable});return W})(i({},"__esModule",{value:!0}),W));var T=f(12398),E=T.Base64.encodeURI,j=T.Base64.decode,M=W=>T.Base64.fromUint8Array(W,!0),k=class hO extends Error{constructor(V,Z){super(V),Object.setPrototypeOf(this,hO.prototype),this.name="SDJWTException",this.details=Z}getFullMessage(){return`${this.name}: ${this.message} ${this.details?`- ${JSON.stringify(this.details)}`:""}`}},K=class yM{constructor(V,Z){if(this._digest=Z?.digest,this._encoded=Z?.encoded,2===V.length)return this.salt=V[0],void(this.value=V[1]);if(3===V.length)return this.salt=V[0],this.key=V[1],void(this.value=V[2]);throw new k("Invalid disclosure data")}static fromEncode(V,Z){return _(this,null,function*(){const{hasher:q,alg:ne}=Z,te=yield q(V,ne),ie=M(te),ae=JSON.parse(j(V));return yM.fromArray(ae,{digest:ie,encoded:V})})}static fromEncodeSync(V,Z){const{hasher:q,alg:ne}=Z,te=q(V,ne),ie=M(te),ae=JSON.parse(j(V));return yM.fromArray(ae,{digest:ie,encoded:V})}static fromArray(V,Z){return new yM(V,Z)}encode(){return this._encoded||(this._encoded=E(JSON.stringify(this.decode()))),this._encoded}decode(){return this.key?[this.salt,this.key,this.value]:[this.salt,this.value]}digest(V){return _(this,null,function*(){const{hasher:Z,alg:q}=V;if(!this._digest){const ne=yield Z(this.encode(),q);this._digest=M(ne)}return this._digest})}digestSync(V){const{hasher:Z,alg:q}=V;if(!this._digest){const ne=Z(this.encode(),q);this._digest=M(ne)}return this._digest}}},47636:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(83858),F)},66091:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25515:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},18414:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},95517:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},37728:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39762:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Directives=void 0,F.Directives={Required:"required",Allowed:"allowed",Disallowed:"disallowed"}},891:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ExchangeStatus=void 0,F.ExchangeStatus={Created:"CREATED",Submitted:"SUBMITTED",HolderDeclined:"HOLDER_DECLINED",Expired:"EXPIRED",Accepted:"ACCEPTED",VerifierDeclined:"VERIFIER_DECLINED"}},67847:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},40826:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},56911:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},17954:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79506:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},23843:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39711:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},5179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},68020:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},54078:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},81755:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},73725:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},87260:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},75873:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83858:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(66091),F),c(f(80723),F),c(f(25515),F),c(f(18414),F),c(f(95517),F),c(f(37728),F),c(f(39762),F),c(f(891),F),c(f(67847),F),c(f(40826),F),c(f(56911),F),c(f(17954),F),c(f(79506),F),c(f(23843),F),c(f(39711),F),c(f(5179),F),c(f(68020),F),c(f(54078),F),c(f(81755),F),c(f(83947),F),c(f(73725),F),c(f(87260),F),c(f(75873),F),c(f(99959),F),c(f(41787),F),c(f(25526),F),c(f(8946),F),c(f(62704),F),c(f(13065),F),c(f(42834),F),c(f(32206),F),c(f(35723),F),c(f(31748),F),c(f(80125),F),c(f(9668),F),c(f(57669),F),c(f(56179),F),c(f(79369),F),c(f(6982),F),c(f(46521),F),c(f(28858),F),c(f(78029),F),c(f(3296),F)},99959:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},41787:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25526:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Optionality=void 0,F.Optionality={Required:"required",Preferred:"preferred"}},8946:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},62704:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},13065:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},42834:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},32206:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},35723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},31748:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80125:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},9668:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},57669:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Rules=void 0,F.Rules={All:"all",Pick:"pick"}},56179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79369:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},6982:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Status=void 0,F.Status={Success:"SUCCESS",Warn:"WARN",Error:"ERROR"}},46521:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},28858:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},78029:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},3296:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30720:(Me,F,f)=>{"use strict";F.E8=void 0;const c=f(2700);Object.defineProperty(F,"E8",{enumerable:!0,get:function(){return c.PEX}})},55776:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hasErrors=F.Checked=F.Status=void 0,F.Status={INFO:"info",WARN:"warn",ERROR:"error"},F.Checked=class{constructor(c,x,B){this.tag=c,this.status=x,this.message=B}},F.hasErrors=c=>c.filter(B=>function x(B){return B.status===F.Status.ERROR}(B)).length>0},97889:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(T,E,j,M){return new(j||(j=Promise))(function(K,W){function V(ne){try{q(M.next(ne))}catch(te){W(te)}}function Z(ne){try{q(M.throw(ne))}catch(te){W(te)}}function q(ne){ne.done?K(ne.value):function k(K){return K instanceof j?K:new j(function(W){W(K)})}(ne.value).then(V,Z)}q((M=M.apply(T,E||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.PEX=void 0;const c=f(11151),x=f(55776),B=f(70143),m=f(64864),S=f(99938),g=f(13486),_=f(80930);class R{constructor(E){this._evaluationClientWrapper=new B.EvaluationClientWrapper,this.options=E}evaluatePresentation(E,j,M){var k,K,W;const V=void 0!==M?.generatePresentationSubmission?M.generatePresentationSubmission:void 0===M?.presentationSubmission,Z=S.SSITypesBuilder.toInternalPresentationDefinition(E),q=JSON.parse(JSON.stringify(j)),ne=S.SSITypesBuilder.mapExternalVerifiablePresentationToWrappedVP(q,null===(k=this.options)||void 0===k?void 0:k.hasher),te=null!==(K=M?.presentationSubmission)&&void 0!==K?K:ne.decoded.presentation_submission;if(!te&&!V)throw Error("Either a presentation submission as part of the VP or provided separately was expected");const ie=c.CredentialMapper.isW3cPresentation(ne.presentation)&&ne.presentation.holder?[ne.presentation.holder]:[],ae=Object.assign(Object.assign({},M),{holderDIDs:ie,presentationSubmission:te,generatePresentationSubmission:V}),me=this._evaluationClientWrapper.evaluate(Z,ne.vcs,ae);return!(null===(W=me.value)||void 0===W)&&W.descriptor_map.length&&(new B.EvaluationClientWrapper).selectFrom(Z,ne.vcs,ae).areRequiredCredentialsPresent!==x.Status.ERROR&&(me.errors=[]),me}evaluateCredentials(E,j,M){var k;const K=S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher);this._evaluationClientWrapper=new B.EvaluationClientWrapper;const W=S.SSITypesBuilder.toInternalPresentationDefinition(E),V=this._evaluationClientWrapper.evaluate(W,K,M);if(V.value&&V.value.descriptor_map.length){const q=(new B.EvaluationClientWrapper).selectFrom(W,K,M);V.areRequiredCredentialsPresent=q.areRequiredCredentialsPresent,V.errors=q.errors}else V.areRequiredCredentialsPresent=x.Status.ERROR;return V}selectFrom(E,j,M){var k;const K=JSON.parse(JSON.stringify(j)),W=S.SSITypesBuilder.toInternalPresentationDefinition(E);return this._evaluationClientWrapper=new B.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(W,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(K,null===(k=this.options)||void 0===k?void 0:k.hasher),M)}presentationSubmissionFrom(E,j,M){var k;const K=S.SSITypesBuilder.toInternalPresentationDefinition(E);return this._evaluationClientWrapper.submissionFrom(K,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher),M)}presentationFrom(E,j,M){var k,K;const W=this.presentationSubmissionFrom(E,j,M),V=j.some(ne=>c.CredentialMapper.isSdJwtDecodedCredential(ne)||c.CredentialMapper.isSdJwtEncoded(ne));if(M?.presentationSubmissionLocation===m.PresentationSubmissionLocation.PRESENTATION&&V)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const Z=null!==(k=M?.presentationSubmissionLocation)&&void 0!==k?k:V?m.PresentationSubmissionLocation.EXTERNAL:m.PresentationSubmissionLocation.PRESENTATION;return{presentation:R.constructPresentation(j,Object.assign(Object.assign({},M),{presentationSubmission:Z===m.PresentationSubmissionLocation.PRESENTATION?W:void 0,hasher:null===(K=this.options)||void 0===K?void 0:K.hasher})),presentationSubmissionLocation:Z,presentationSubmission:W}}static constructPresentation(E,j){var M,k,K,W;const V=Array.isArray(E)?E:[E];if(V.some(Z=>c.CredentialMapper.isSdJwtDecodedCredential(Z)||c.CredentialMapper.isSdJwtEncoded(Z))){if(V.length>1)throw new Error("Only a single credential is supported when creating a presentation with an SD-JWT VC");if(j?.presentationSubmission)throw new Error("Presentation submission cannot be included in the presentation when creating a presentation with an SD-JWT VC");if(j?.basePresentationPayload)throw new Error("Base presentation payload cannot be when creating a presentation from an SD-JWT VC");const Z=c.CredentialMapper.isSdJwtEncoded(V[0])?c.CredentialMapper.decodeVerifiableCredential(V[0],j?.hasher):V[0];if(!j?.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const q=null!==(M=Z.signedPayload._sd_alg)&&void 0!==M?M:"sha-256",ne=(0,g.calculateSdHash)(Z.compactSdJwtVc,q,j.hasher),te={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),_sd_hash:ne}};return Object.assign(Object.assign({},Z),{kbJwt:te})}{if(!E)throw Error("At least a verifiable credential needs to be passed in to create a presentation");const Z=Array.isArray(E)?E:[E],q=Z.map(me=>c.CredentialMapper.toWrappedVerifiableCredential(me)),ne=Array.from(new Set(q.flatMap(me=>(0,g.getSubjectIdsAsString)(me.credential))));1!==ne.length&&!j?.holderDID&&console.log(`We deduced ${ne.length} subject from ${q.length} Verifiable Credentials, and no holder property was given. This might lead to undesired results`);const te=null!==(k=j?.holderDID)&&void 0!==k?k:1===ne.length?ne[0]:void 0,ie=null!==(K=j?.basePresentationPayload)&&void 0!==K&&K.type?Array.isArray(j.basePresentationPayload.type)?j.basePresentationPayload.type:[j.basePresentationPayload.type]:[];ie.includes("VerifiablePresentation")||ie.push("VerifiablePresentation");const ae=null!==(W=j?.basePresentationPayload)&&void 0!==W&&W["@context"]?Array.isArray(j.basePresentationPayload["@context"])?j.basePresentationPayload["@context"]:[j.basePresentationPayload["@context"]]:[];return ae.includes("https://www.w3.org/2018/credentials/v1")||ae.push("https://www.w3.org/2018/credentials/v1"),j?.presentationSubmission&&(ie.includes("PresentationSubmission")||ie.push("PresentationSubmission"),ae.includes("https://identity.foundation/presentation-exchange/submission/v1")||ae.push("https://identity.foundation/presentation-exchange/submission/v1")),Object.assign(Object.assign(Object.assign(Object.assign({},j?.basePresentationPayload),{"@context":ae,type:ie,holder:te}),!!j?.presentationSubmission&&{presentation_submission:j.presentationSubmission}),{verifiableCredential:Z})}}static validateDefinition(E){const j=(0,g.definitionVersionDiscovery)(E);if(j.error)throw new Error(j.error);const M=[];return M.push(j.version===S.PEVersion.v1?{bundler:new _.PresentationDefinitionV1VB("root"),target:S.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(E)}:{bundler:new _.PresentationDefinitionV2VB("root"),target:S.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(E)}),(new _.ValidationEngine).validate(M)}static validateSubmission(E){return(new _.ValidationEngine).validate([{bundler:new _.PresentationSubmissionVB("root"),target:E}])}verifiablePresentationFrom(E,j,M,k){return i(this,void 0,void 0,function*(){var K,W;const{holderDID:V,signatureOptions:Z,proofOptions:q}=k,te=V?[V]:[],ie=function ne(){let A=[];if(q?.typeSupportsSelectiveDisclosure){if(!q?.type)throw Error("Please provide a proof type if you enable selective disclosure");A=[q.type]}return A}(),ae=this.evaluateCredentials(E,j,{holderDIDs:te,limitDisclosureSignatureSuites:ie}),me=this.presentationFrom(E,ae.verifiableCredential,k),ye=this.evaluatePresentation(E,me.presentation,Object.assign({limitDisclosureSignatureSuites:ie},me.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&{presentationSubmission:me.presentationSubmission}));if(!ye.value)throw new Error("Could not get evaluation results from presentationResult");const ue={type:q?.type,verificationMethod:Z?.verificationMethod,created:q?.created?q.created:(new Date).toISOString(),proofPurpose:q?.proofPurpose,proofValue:Z?.proofValue,jws:Z?.jws,challenge:q?.challenge,nonce:q?.nonce,domain:q?.domain};let $=me.presentation;if(c.CredentialMapper.isSdJwtDecodedCredential(me.presentation)){if(null===(K=this.options)||void 0===K||!K.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const A=null!==(W=me.presentation.signedPayload._sd_alg)&&void 0!==W?W:"sha-256",C=(0,g.calculateSdHash)(me.presentation.compactSdJwtVc,A,this.options.hasher),O={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),nonce:q?.nonce,_sd_hash:C}};$=Object.assign(Object.assign({},$),{kbJwt:O})}const o={options:Object.assign(Object.assign({},k),{presentationSubmissionLocation:me.presentationSubmissionLocation}),presentation:$,presentationDefinition:E,selectedCredentials:j,proof:ue,presentationSubmission:ye.value,evaluationResults:ye};return{verifiablePresentation:yield M(o),presentationSubmissionLocation:me.presentationSubmissionLocation,presentationSubmission:ye.value}})}static definitionVersionDiscovery(E){return(0,g.definitionVersionDiscovery)(E)}}F.PEX=R},38992:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv1=void 0;const i=f(11151),c=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv1=class g extends c.PEX{evaluatePresentation(R,T,E){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluatePresentation(R,T,E)}evaluateCredentials(R,T,E){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluateCredentials(R,T,E)}selectFrom(R,T,E){const j=JSON.parse(JSON.stringify(T));return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j),E)}presentationFrom(R,T,E){var j;const M=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(T),E),k=T.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(E?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const K=null!==(j=E?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:c.PEX.constructPresentation(T,Object.assign(Object.assign({},E),{presentationSubmission:K===B.PresentationSubmissionLocation.PRESENTATION?M:void 0})),presentationSubmissionLocation:K,presentationSubmission:M}}static validateDefinition(R){const T=m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV1VB("root"),target:T}])}static validateSubmission(R){return c.PEX.validateSubmission(R)}}},71945:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=void 0;const i=f(11151),c=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv2=class g extends c.PEX{evaluatePresentation(R,T,E){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluatePresentation(R,T,E)}evaluateCredentials(R,T,E){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluateCredentials(R,T,E)}selectFrom(R,T,E){return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(T),E)}presentationFrom(R,T,E){var j;const M=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(T),E),k=T.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(E?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const K=null!==(j=E?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:c.PEX.constructPresentation(T,Object.assign(Object.assign({},E),{presentationSubmission:K===B.PresentationSubmissionLocation.PRESENTATION?M:void 0})),presentationSubmissionLocation:K,presentationSubmission:M}}static validateDefinition(R){const T=m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV2VB("root"),target:T}])}static validateSubmission(R){return c.PEX.validateSubmission(R)}}},38947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},45994:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=void 0,F.HandlerCheckResult=class{constructor(i,c,x,B,m,S){this.input_descriptor_path=i,this.verifiable_credential_path=c,this.evaluator=x,this.status=B,this.message=m,this.payload=S}}},92127:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(38947),F),c(f(45994),F),c(f(83565),F),c(f(21235),F)},83565:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},21235:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50950:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClient=void 0;const c=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(71001),g=[c.IProofType.BbsBlsSignatureProof2020,"DataIntegrityProof.anoncreds-2023"];F.EvaluationClient=class _{constructor(){this.failed_catched={tag:"root",status:x.Status.ERROR,message:B.default.UNKNOWN_EXCEPTION,stacktrace:""},this._results=[],this._wrappedVcs=[],this._presentationSubmission={},this._dids=[],this._limitDisclosureSignatureSuites=g,this._restrictToDIDMethods=[],this._generatePresentationSubmission=!0}evaluate(T,E,j){this._restrictToDIDMethods=j?.restrictToDIDMethods?(0,m.uniformDIDMethods)(j?.restrictToDIDMethods):[],this._dids=j?.holderDIDs?(0,m.filterToRestrictedDIDs)(j.holderDIDs,this._restrictToDIDMethods):[],this._limitDisclosureSignatureSuites=j?.limitDisclosureSignatureSuites,this._restrictToFormats=j?.restrictToFormats,this._generatePresentationSubmission=void 0===j?.generatePresentationSubmission||j.generatePresentationSubmission,j?.presentationSubmission&&(this._presentationSubmission=j.presentationSubmission);let M=this.initEvaluationHandlers();for(M?.handle(T,E);M?.hasNext();){M=M.getNext();try{M?.handle(T,E)}catch(k){throw this.failed_catched.message+=k.message,this.failed_catched.stacktrace=k,this.failed_catched}}}get results(){return this._results}get dids(){return this._dids}set dids(T){this._dids=T}assertPresentationSubmission(){if("string"==typeof this._presentationSubmission&&(console.log("Presentation submission present, but as string not object. External calls did not follow contract. Correcting"),this._presentationSubmission=JSON.parse(this._presentationSubmission)),!(this.generatePresentationSubmission||this.presentationSubmission&&0!==Object.keys(this.presentationSubmission).length))throw Error("No presentation submission present, but required option was set")}get generatePresentationSubmission(){return this._generatePresentationSubmission}set generatePresentationSubmission(T){this._generatePresentationSubmission=T}get presentationSubmission(){return this._presentationSubmission}set presentationSubmission(T){this._presentationSubmission=T}get wrappedVcs(){return this._wrappedVcs}set wrappedVcs(T){this._wrappedVcs=T}get limitDisclosureSignatureSuites(){return this._limitDisclosureSignatureSuites||g}set limitDisclosureSignatureSuites(T){this._limitDisclosureSignatureSuites=T}get restrictToDIDMethods(){return this._restrictToDIDMethods}set restrictToDIDMethods(T){this._restrictToDIDMethods=(0,m.uniformDIDMethods)(T)}hasRestrictToDIDMethods(){return this.restrictToDIDMethods&&this.restrictToDIDMethods.length>0}get restrictToFormats(){return this._restrictToFormats}set restrictToFormats(T){this._restrictToFormats=T}initEvaluationHandlers(){const T=new S.UriEvaluationHandler(this);return T.setNext(new S.DIDRestrictionEvaluationHandler(this)).setNext(new S.FormatRestrictionEvaluationHandler(this)).setNext(new S.InputDescriptorFilterEvaluationHandler(this)).setNext(new S.PredicateRelatedFieldEvaluationHandler(this)).setNext(new S.LimitDisclosureEvaluationHandler(this)).setNext(new S.SubjectIsIssuerEvaluationHandler(this)).setNext(new S.SubjectIsHolderEvaluationHandler(this)).setNext(new S.SameSubjectEvaluationHandler(this)).setNext(new S.MarkForSubmissionEvaluationHandler(this)),T}}},78995:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClientWrapper=void 0;const i=f(44273),c=f(47636),x=f(11151),B=f(55776),m=f(64864),S=f(13486),g=f(50950);F.EvaluationClientWrapper=class _{constructor(){this._client=new g.EvaluationClient}getEvaluationClient(){return this._client}selectFrom(T,E,j){var M;let k;this._client.evaluate(T,E,j);const K=[...this.formatNotInfo(B.Status.WARN)],W=[...this.formatNotInfo(B.Status.ERROR)];if(T.submission_requirements){const V=this._client.results.filter(ae=>"MarkForSubmissionEvaluation"===ae.evaluator&&ae.payload.group&&ae.status!==B.Status.ERROR),Z=Array.from(new Set(V));let q;try{q=this.matchSubmissionRequirements(T,T.submission_requirements,Z)}catch(ae){const me={status:B.Status.ERROR,message:JSON.stringify(ae),tag:"matchSubmissionRequirements"};return{errors:W?[...W,me]:[me],warnings:K,areRequiredCredentialsPresent:B.Status.ERROR}}const te=this.extractMatches(q).map(ae=>i.JSONPath.nodes(this._client.wrappedVcs.map(me=>me.original),ae)[0].value),ie=this.determineAreRequiredCredentialsPresent(T,q);k={errors:ie===B.Status.INFO?[]:W,matches:[...q],areRequiredCredentialsPresent:ie,verifiableCredential:te,warnings:K}}else{const V=this._client.results.filter(q=>"MarkForSubmissionEvaluation"===q.evaluator&&q.status!==B.Status.ERROR);if(this.checkWithoutSubmissionRequirements(V,T).length)return{errors:W,matches:[],areRequiredCredentialsPresent:B.Status.ERROR,verifiableCredential:E.map(q=>q.original),warnings:K};{const q=this.matchWithoutSubmissionRequirements(V,T),te=this.extractMatches(q).map(ie=>i.JSONPath.nodes(this._client.wrappedVcs.map(ae=>ae.original),ie)[0].value);k={errors:[],matches:[...q],areRequiredCredentialsPresent:B.Status.INFO,verifiableCredential:te,warnings:K}}}return this.fillSelectableCredentialsToVerifiableCredentialsMapping(k,E),k.areRequiredCredentialsPresent=this.determineAreRequiredCredentialsPresent(T,k?.matches),this.remapMatches(E.map(V=>V.original),k.matches,k?.verifiableCredential),null===(M=k.matches)||void 0===M||M.forEach(V=>{this.updateSubmissionRequirementMatchPathToAlias(V,"verifiableCredential")}),k.areRequiredCredentialsPresent===B.Status.INFO?k.errors=[]:(k.errors=W,k.warnings=K,k.verifiableCredential=E.map(V=>V.original)),k}remapMatches(T,E,j){E?.forEach(M=>{M.from_nested?this.remapMatches(T,M.from_nested,j):M.vc_path.forEach((k,K,W)=>{const V=i.JSONPath.query(T,k)[0],Z=j?.findIndex(q=>JSON.stringify(q)===JSON.stringify(V));if(-1===Z)throw new Error(`The index of the VerifiableCredential in your current call can't be found in your previously submitted credentials. Are you trying to send a new Credential?\nverifiableCredential: ${V}`);W[K]=`$[${Z}]`})})}extractMatches(T){const E=[];return T.forEach(j=>{E.push(...j.vc_path),j.from_nested&&E.push(...this.extractMatches(j.from_nested))}),Array.from(new Set(E))}checkWithoutSubmissionRequirements(T,E){const j=[];if(!E.input_descriptors)return[];if(!T.length)return[{input_descriptor_path:"",evaluator:"checkWithoutSubmissionRequirement",verifiable_credential_path:"",status:B.Status.ERROR,payload:"Not all the InputDescriptors are addressed"}];const M=E.input_descriptors,k=S.ObjectUtils.getDistinctFieldInObject(T,"input_descriptor_path");if(k.length!==M.length){const K=k.map(W=>S.JsonPathUtils.extractInputField(E,[W])[0].value).map(W=>W.id);for(let W=0;WZ.original)};if(V.warnings=this.formatNotInfo(B.Status.WARN),V.errors=this.formatNotInfo(B.Status.ERROR),this._client.assertPresentationSubmission(),null!==(M=this._client.presentationSubmission)&&void 0!==M&&M.descriptor_map.length){const Z=null===(k=this._client.presentationSubmission)||void 0===k?void 0:k.descriptor_map.length;for(let q=0;qZ.original),V.areRequiredCredentialsPresent=null!==(W=null===(K=V.value)||void 0===K?void 0:K.descriptor_map)&&void 0!==W&&W.length?B.Status.INFO:B.Status.ERROR,V}formatNotInfo(T){return this._client.results.filter(E=>E.status===T).map(E=>{const j=E.verifiable_credential_path.substring(1);return{tag:E.evaluator,status:E.status,message:`${E.message}: ${E.input_descriptor_path}: $.verifiableCredential${j}`}})}submissionFrom(T,E,j){if(!this._client.results.length)throw Error("You need to call evaluate() before pex.presentationFrom()");if(!this._client.generatePresentationSubmission)return this._client.presentationSubmission;if(T.submission_requirements){const K=this._client.results.filter(te=>"MarkForSubmissionEvaluation"===te.evaluator&&te.payload.group&&te.status!==B.Status.ERROR),[W,V]=this.matchUserSelectedVcs(K,E),Z=new Map;"input_descriptors"in T&&T.input_descriptors.forEach(te=>{te.group&&te.group.forEach(ie=>{Z.has(ie)?Z.set(ie,Z.get(ie)+1):Z.set(ie,1)})});const q=this.evaluateRequirements(T.submission_requirements,W,Z,0),ne=V.filter(te=>q[1].find(ie=>ie.verifiable_credential_path===te[1]));return this.updatePresentationSubmission(ne),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}const M=this._client.results.filter(K=>"MarkForSubmissionEvaluation"===K.evaluator&&K.status!==B.Status.ERROR),k=this.matchUserSelectedVcs(M,E);return this.updatePresentationSubmission(k[1]),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}updatePresentationSubmission(T){this._client.generatePresentationSubmission&&(this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.filter(E=>T.find(j=>j[0]===E.path)).map(E=>{const j=T.find(M=>M[0]===E.path);return j&&(E.path=j[1]),E}))}updatePresentationSubmissionToExternal(){this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.map(E=>{if(E.path_nested)return E;if("vc+sd-jwt"===E.format)return E;const j=E.format,M=Object.assign({},E);return M.path_nested=Object.assign({},E),M.path="$",j.startsWith("ldp_")?M.format="ldp_vp":j.startsWith("di_")?M.format="di_vp":"jwt_vc"===j?(M.format="jwt_vp",M.path_nested.path=M.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")):"jwt_vc_json"===j&&(M.format="jwt_vp_json",M.path_nested.path=M.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")),M})}matchUserSelectedVcs(T,E){const j=E.map((K,W)=>[W,JSON.stringify(K.original)]),M=this._client.wrappedVcs.map((K,W)=>[W,JSON.stringify(K.original)]),k=[];return j.forEach((K,W)=>{M.forEach((V,Z)=>{V[1]===K[1]&&k.push([`$[${Z}]`,`$[${W}]`])})}),[T=T.filter(K=>k.find(W=>W[0]===K.verifiable_credential_path)).map(K=>{const W=k.find(V=>V[0]===K.verifiable_credential_path);return W&&(K.verifiable_credential_path=W[1]),K}),k]}evaluateRequirements(T,E,j,M){let k=0;const K=[];for(const W of T)if(W.from){if(W.rule===c.Rules.All){const[V,Z]=this.countMatchingInputDescriptors(W,E);if(V!==(j.get(W.from)||0))throw Error(`Not all input descriptors are members of group ${W.from}`);k++,K.push(...Z)}else if(W.rule===c.Rules.Pick){const[V,Z]=this.countMatchingInputDescriptors(W,E);try{this.handleCount(W,V,M),k++}catch(q){if(0===M)throw q}K.push(...Z)}}else if(W.from_nested){const[V,Z]=this.evaluateRequirements(W.from_nested,E,j,++M);k+=V,K.push(...Z),this.handleCount(W,V,M)}return[k,K]}countMatchingInputDescriptors(T,E){let j=0;const M=[];for(const k of E)k.payload.group.includes(T.from)&&(M.push(k),j++);return[j,M]}handleCount(T,E,j){if(T.count&&E!==T.count)throw Error(`Count: expected: ${T.count} actual: ${E} at level: ${j}`);if(T.min&&ET.max)throw Error(`Max: expected: ${T.max} actual: ${E} at level: ${j}`)}removeDuplicateSubmissionRequirementMatches(T){return T.filter((E,j)=>{const M=JSON.stringify(E);return j===T.findIndex(k=>JSON.stringify(k)===M)})}fillSelectableCredentialsToVerifiableCredentialsMapping(T,E){var j;T&&(null===(j=T.verifiableCredential)||void 0===j||j.forEach(M=>{var k;const K=E.findIndex(W=>x.CredentialMapper.areOriginalVerifiableCredentialsEqual(W.original,M));if(-1===K)throw new Error("index is not right");null===(k=T.vcIndexes)||void 0===k||k.push(K)}))}determineAreRequiredCredentialsPresent(T,E,j){if(!E||!E.length)return B.Status.ERROR;const M=E.map(k=>this.determineSubmissionRequirementStatus(T,k));if(!j)return M.includes(B.Status.ERROR)?B.Status.ERROR:M.includes(B.Status.WARN)?B.Status.WARN:B.Status.INFO;{if(j.rule===c.Rules.All&&M.includes(B.Status.ERROR))return B.Status.ERROR;const k=M.filter(K=>K!==B.Status.ERROR).length;if(j.count)return j.count>k?B.Status.ERROR:j.countk)return B.Status.ERROR;if(j.max&&j.maxT.count?B.Status.WARN:B.Status.ERROR:T.min&&T.vc_path.lengthT.max?B.Status.WARN:B.Status.INFO}updateSubmissionRequirementMatchPathToAlias(T,E){const j=[];T.vc_path.forEach(M=>{j.push(M.replace("$","$."+E))}),T.vc_path=j,T.from_nested&&T.from_nested.forEach(M=>{this.updateSubmissionRequirementMatchPathToAlias(M,E)})}updatePresentationSubmissionPathToVpPath(T){const E=T?T.descriptor_map:this._client.generatePresentationSubmission?this._client.presentationSubmission.descriptor_map:void 0;E?.forEach(j=>{"vc+sd-jwt"===j.format?j.path="$":this.replacePathWithAlias(j,"verifiableCredential")})}replacePathWithAlias(T,E){T.path=T.path.replace("$[",`$.${E}[`),T.path_nested&&this.replacePathWithAlias(T.path_nested,E)}createIdToVcMap(T){const E=new Map,j=new Map;for(let M=0;M{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.AbstractEvaluationHandler=void 0;const i=f(44273),c=f(55776);F.AbstractEvaluationHandler=class x{constructor(m){this._client=m}setNext(m){return this.nextHandler=m,m}getNext(){return this.nextHandler}hasNext(){return null!=this.nextHandler}get client(){return this._client}get wrappedVcs(){return this._client.wrappedVcs}set wrappedVcs(m){this._client.wrappedVcs=m}get presentationSubmission(){return this._client.presentationSubmission}set presentationSubmission(m){this._client.presentationSubmission=m}getResults(){return this._client.results}updatePresentationSubmission(m){this._client.assertPresentationSubmission(),this.presentationSubmission.descriptor_map.forEach((S,g,_)=>{let R;this.getResults().filter(E=>E.status===c.Status.ERROR&&E.evaluator===this.getName()).find(E=>(R=i.JSONPath.query(m,E.input_descriptor_path)[0],E.verifiable_credential_path===S.path&&R?.id===S.id))&&delete _[g]})}removeDuplicate(m){return m.reduce((S,g)=>S.find(R=>R.input_descriptor_path===g.input_descriptor_path&&R.verifiable_credential_path===g.verifiable_credential_path)?S:S.concat([g]),[])}}},4028:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(F,"__esModule",{value:!0}),F.DIDRestrictionEvaluationHandler=void 0;const c=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(32893);F.DIDRestrictionEvaluationHandler=class g extends S.AbstractEvaluationHandler{constructor(R){super(R)}getName(){return"DIDRestrictionEvaluation"}handle(R,T){R.input_descriptors.forEach((E,j)=>{T.forEach((M,k)=>{const K=this.getIssuerIdFromWrappedVerifiableCredential(M);this.client.hasRestrictToDIDMethods()&&K&&!(0,m.isRestrictedDID)(K,this.client.restrictToDIDMethods)&&K.toLowerCase().startsWith("did:")?this.getResults().push(this.generateErrorResult(j,`$[${k}]`,M)):this.getResults().push(this.generateSuccessResult(j,`$[${k}]`,M,`${K} is allowed`))})}),this.updatePresentationSubmission(R)}getIssuerIdFromWrappedVerifiableCredential(R){if(c.CredentialMapper.isW3cCredential(R.credential))return"object"==typeof R.credential.issuer?R.credential.issuer.id:R.credential.issuer;if(c.CredentialMapper.isSdJwtDecodedCredential(R.credential))return R.credential.decodedPayload.iss;throw new Error("Unsupported credential type")}generateErrorResult(R,T,E){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.ERROR,message:B.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:T,payload:{format:E.format}}}generateSuccessResult(R,T,E,j){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.INFO,message:j??B.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:T,payload:{format:E.format}}}}},19819:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30614:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(F,"__esModule",{value:!0}),F.FormatRestrictionEvaluationHandler=void 0;const c=f(55776),x=i(f(24080)),B=f(32893);F.FormatRestrictionEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g)}getName(){return"FormatRestrictionEvaluation"}handle(g,_){const R=this.client.restrictToFormats?Object.keys(this.client.restrictToFormats):void 0;g.input_descriptors.forEach((T,E)=>{_.forEach((j,M)=>{const k="format"in T&&T.format?Object.keys(T.format):[j.format];let K=R??k;"format"in T&&T.format&&void 0!==R&&(K=Object.keys(T.format).filter(W=>R.includes(W))),K.includes(j.format)?this.getResults().push(this.generateSuccessResult(E,`$[${M}]`,j,`${j.format} is allowed from ${JSON.stringify(K)}`)):this.getResults().push(this.generateErrorResult(E,`$[${M}]`,j))})}),this.updatePresentationSubmission(g)}generateErrorResult(g,_,R){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:c.Status.ERROR,message:x.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:_,payload:{format:R.format}}}generateSuccessResult(g,_,R,T){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:c.Status.INFO,message:T??x.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:_,payload:{format:R.format}}}}},71001:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(32893),F),c(f(19819),F),c(f(298),F),c(f(19477),F),c(f(77918),F),c(f(60019),F),c(f(1599),F),c(f(4257),F),c(f(67966),F),c(f(63217),F),c(f(30614),F),c(f(4028),F)},298:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorFilterEvaluationHandler=void 0;const c=f(44273),x=i(f(39208)),B=i(f(21953)),m=f(55776),S=i(f(24080)),g=f(13486),_=f(32893),R=new x.default({verbose:!1,code:{source:!1,lines:!0,esm:!1},allowUnionTypes:!0,allErrors:!0,strict:!1});(0,B.default)(R);class T extends _.AbstractEvaluationHandler{constructor(j){super(j),T.keepCacheSizeInCheck()}getName(){return"FilterEvaluation"}handle(j,M){const k=c.JSONPath.nodes(j,"$..fields[*]");M.forEach((K,W)=>{this.createNoFieldResults(j,W,K),k.forEach(V=>{let Z=[];V.value.path&&(Z=g.JsonPathUtils.extractInputField(K.decoded,V.value.path));let q=!1;for(const ne of Z)if(this.evaluateFilter(ne,V.value)){q=!0;const te={result:Object.assign({},Z[0]),valid:!0,format:K.format};this.getResults().push(Object.assign({},this.createResultObject(c.JSONPath.stringify(V.path.slice(0,3)),W,te)))}if(!q)if(Z.length){const ne={result:Object.assign({},Z[0]),valid:!1,format:K.format};this.createResponse(V,W,ne,S.default.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION)}else this.createResponse(V,W,{valid:!1,format:K.format},S.default.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY)})}),this.updatePresentationSubmission(j)}createNoFieldResults(j,M,k){j.input_descriptors.map((W,V)=>({index:V,inDesc:W})).filter(W=>{var V,Z,q;return void 0===(null===(V=W.inDesc.constraints)||void 0===V?void 0:V.fields)||0===(null===(q=null===(Z=W.inDesc.constraints)||void 0===Z?void 0:Z.fields)||void 0===q?void 0:q.length)}).forEach(W=>{const V={result:[],valid:!0,format:k.format};this.getResults().push(Object.assign({},this.createResultObject(`$.input_descriptors[${W.index}]`,M,V)))})}createResponse(j,M,k,K){this.getResults().push(Object.assign(Object.assign({},this.createResultObject(c.JSONPath.stringify(j.path.slice(0,3)),M,k)),{status:m.Status.ERROR,message:K}))}createResultObject(j,M,k){return{input_descriptor_path:j,verifiable_credential_path:`$[${M}]`,evaluator:this.getName(),status:m.Status.INFO,message:S.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:k}}evaluateFilter(j,M){var k,K;null!==(k=M.filter)&&void 0!==k&&k.format&&"date"===M.filter.format&&this.transformDateFormat(j);let W=!0;if(M.filter){const V=JSON.stringify({filter:M.filter,value:j.value}),Z=Date.now();W=null===(K=T.FILTER_CACHE.get(V))||void 0===K?void 0:K.value,void 0===W&&(T.keepCacheSizeInCheck(),W=R.validate(M.filter,j.value),T.FILTER_CACHE.set(V,{value:W,ts:Z+T.DEFAULT_FILTER_CACHE_TTL}))}return W}transformDateFormat(j){const M=new Date(j.value);let k=M.getUTCMonth()+1+"";1===k.length&&(k="0"+k);let K=M.getUTCDate()+"";1===K.length&&(K="0"+K),j.value=M.getUTCFullYear()+"-"+k+"-"+K,j.value=M.toISOString().substring(0,M.toISOString().indexOf("T"))}static keepCacheSizeInCheck(j){var M,k,K;const W=null!==(M=j?.ttl)&&void 0!==M?M:T.DEFAULT_FILTER_CACHE_TTL,V=null!==(k=j?.maxCacheSize)&&void 0!==k?k:T.DEFAULT_MAX_FILTER_CACHE_SIZE,Z=null!==(K=j?.resetCacheSize)&&void 0!==K?K:T.DEFAULT_RESET_CACHE_SIZE,q=Date.now();for(const[te,ie]of T.FILTER_CACHE)ie.ts+WV){const te=T.FILTER_CACHE.keys();for(let ie=0;ie{var k,K,W;null!==(k=j.constraints)&&void 0!==k&&k.fields&&((null===(K=j.constraints)||void 0===K?void 0:K.limit_disclosure)===c.Optionality.Required||(null===(W=j.constraints)||void 0===W?void 0:W.limit_disclosure)===c.Optionality.Preferred)&&this.evaluateLimitDisclosure(E,j.constraints,M)})}isLimitDisclosureSupported(T,E,j,M){if("vc+sd-jwt"===T.format)return!0;const k=this.client.limitDisclosureSignatureSuites,K=T.decoded.proof;if(!K||Array.isArray(K)||!K.type)return!1;const W=K.cryptosuite?`${K.type}.${K.cryptosuite}`:K.type;return!!k?.includes(W)||(M==c.Optionality.Required&&this.createLimitDisclosureNotSupportedResult(j,E),!1)}evaluateLimitDisclosure(T,E,j){const M=E?.fields,k=E.limit_disclosure;T.forEach((K,W)=>{k&&this.isLimitDisclosureSupported(K,W,j,k)&&this.enforceLimitDisclosure(K,M,j,W,T,k)})}enforceLimitDisclosure(T,E,j,M,k,K){if(x.CredentialMapper.isWrappedSdJwtVerifiableCredential(T)){const W=this.createSdJwtPresentationFrame(T.credential,E,j,M);W&&((0,S.applySdJwtLimitDisclosure)(T.credential,W),T.decoded=T.credential.decodedPayload,T.original=x.CredentialMapper.isSdJwtDecodedCredential(T.original)?T.credential:T.credential.compactSdJwtVc,this.createSuccessResult(j,`$[${M}]`,K))}else{if(!x.CredentialMapper.isW3cCredential(T.credential))throw new Error(`Unsupported format for selective disclosure ${T.format}`);{const W=this.createVcWithRequiredFields(T.credential,E,j,M);W&&(k[M].credential=W,this.createSuccessResult(j,`$[${M}]`,K))}}}createSdJwtPresentationFrame(T,E,j,M){const k={};for(const K of E)if(K.path){const W=S.JsonPathUtils.extractInputField(T.decodedPayload,K.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,M,K.path);S.JsonPathUtils.setValue(k,W[0].path,!0)}return k}createVcWithRequiredFields(T,E,j,M){let k={};k=Object.assign(k,T),k.credentialSubject={};for(const K of E)if(K.path){const W=S.JsonPathUtils.extractInputField(T,K.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,M,K.path);k=this.copyResultPathToDestinationCredential(W[0],T,k)}return k}copyResultPathToDestinationCredential(T,E,j){let M=Object.assign({},E.credentialSubject);return T.path.forEach(k=>{M[k]&&(M={[k]:M[k]})}),j.credentialSubject=Object.assign(Object.assign({},j.credentialSubject),M),j}createSuccessResult(T,E,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${T}]`,verifiable_credential_path:`${E}`,evaluator:this.getName(),status:j===c.Optionality.Required?B.Status.INFO:B.Status.WARN,message:m.default.LIMIT_DISCLOSURE_APPLIED,payload:void 0})}createMandatoryFieldNotFoundResult(T,E,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${T}]`,verifiable_credential_path:`$[${E}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT,payload:j})}createLimitDisclosureNotSupportedResult(T,E){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${T}]`,verifiable_credential_path:`$[${E}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.LIMIT_DISCLOSURE_NOT_SUPPORTED})}}},60019:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.MarkForSubmissionEvaluationHandler=void 0;const c=f(44273),x=f(55776),B=i(f(24080)),m=f(32893);F.MarkForSubmissionEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(_){super(_)}getName(){return"MarkForSubmissionEvaluation"}handle(_,R){const T=[...this.getResults()],E=T.filter(M=>M.status===x.Status.ERROR),j=this.retrieveNoErrorStatus(T,E);this.client.wrappedVcs=R,this.produceErrorResults(E),this.produceSuccessResults(j,_)}retrieveNoErrorStatus(_,R){return _.filter(E=>E.status!==x.Status.ERROR).filter(E=>!R.find(j=>E.input_descriptor_path===j.input_descriptor_path&&E.verifiable_credential_path===j.verifiable_credential_path))}produceSuccessResults(_,R){this.removeDuplicate(_).forEach(T=>{const j=c.JSONPath.nodes(R,T.input_descriptor_path)[0].value.group;this.getResults().push({input_descriptor_path:T.input_descriptor_path,verifiable_credential_path:T.verifiable_credential_path,evaluator:this.getName(),status:x.Status.INFO,payload:{group:j},message:B.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION})})}produceErrorResults(_){this.removeDuplicate(_).forEach(R=>{const T=Object.assign({},R.payload);T.evaluator=R.evaluator,this.getResults().push(Object.assign(Object.assign({},R),{evaluator:this.getName(),message:B.default.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:T}))})}}},1599:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.PredicateRelatedFieldEvaluationHandler=void 0;const c=f(47636),x=f(55776),B=i(f(24080)),m=f(32893);F.PredicateRelatedFieldEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(_){super(_)}getName(){return"PredicateRelatedFieldEvaluation"}handle(_){_.input_descriptors.forEach((R,T)=>{R.constraints&&this.examinePredicateRelatedField(T,R.constraints)})}examinePredicateRelatedField(_,R){if(R?.fields)for(let T=0;T{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SameSubjectEvaluationHandler=void 0;const i=f(44273),c=f(47636),x=f(55776),B=f(32893);F.SameSubjectEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIds=[],this.sameSubject=[],this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the same subject to belong to same subject"),this.messages.set(x.Status.WARN,"The field ids preferring the same subject to belong to same subject"),this.messages.set(x.Status.ERROR,"The fields ids not belong to the same subject")}getName(){return"SameSubjectEvaluation"}handle(g,_){const R=this.mapSameSubjectFieldIdsToInputDescriptors(g),T=this.mapCredentialsToResultObjecs(_,R),E=this.countSameSubjectOccurrences(R,T);this.generateErrorResults(E,T),this.updatePresentationSubmission(g)}mapSameSubjectFieldIdsToInputDescriptors(g){this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.sameSubject.push(...i.JSONPath.nodes(g,"$..same_subject[*]"));const _=[];return this.fieldIds.forEach(R=>{const T=this.sameSubject.find(E=>E.value.field_id.includes(R.value));T&&_.push([R,T])}),_}generateErrorResults(g,_){g.forEach((R,T)=>{const E=_.filter(j=>T===j.payload.fieldIdSet).map(j=>j.payload.credentialSubject.id);(E.length!==R||1!==new Set(E).size)&&_.forEach((j,M,k)=>{j.payload.fieldIdSet===T&&(j.status=x.Status.ERROR,j.message=this.messages.get(x.Status.ERROR),k[M]=j)})}),this.client.results.push(..._)}countSameSubjectOccurrences(g,_){const R=new Map;return g.forEach(T=>{_.filter(j=>T[1].value.field_id===j.payload.fieldIdSet)&&(R.has(T[1].value.field_id)&&R.get(T[1].value.field_id)?R.set(T[1].value.field_id,R.get(T[1].value.field_id)+1):R.set(T[1].value.field_id,1))}),R}mapCredentialsToResultObjecs(g,_){const R=[...i.JSONPath.nodes(g.map(E=>E.credential),"$..credentialSubject")],T=[];return R.forEach(E=>{const j=_.find(M=>0!==i.JSONPath.query(E.value,`$..${M[0].value}`).length);j&&j[1].value.directive===c.Optionality.Required?T.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.INFO,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:E.value},message:this.messages.get(x.Status.INFO),verifiable_credential_path:i.JSONPath.stringify(E.path.slice(0,2))}):j&&j[1].value.directive===c.Optionality.Preferred&&T.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.WARN,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:E.value},message:this.messages.get(x.Status.WARN),verifiable_credential_path:i.JSONPath.stringify(E.path.slice(0,2))})}),T}}},19477:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsHolderEvaluationHandler=void 0;const i=f(44273),c=f(47636),x=f(55776),B=f(32893);F.SubjectIsHolderEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIdzInputDescriptorsSameSubjectRequired=new Map,this.fieldIdzInputDescriptorsSameSubjectPreferred=new Map,this.isHolder=[],this.fieldIds=[],this.credentialsSubjectsByPath=new Map,this.credentialsByPath=new Map,this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the subject to be the holder"),this.messages.set(x.Status.WARN,"The field ids preferring the subject to be the holder"),this.messages.set(x.Status.ERROR,"The field id missing")}getName(){return"IsHolderEvaluation"}handle(g,_){this.findIsHolderFieldIdsToInputDescriptorsSets(g),this.findAllCredentialSubjects(_),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectRequired,x.Status.INFO,c.Optionality.Required),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectPreferred,x.Status.WARN,c.Optionality.Preferred),this.updatePresentationSubmission(g)}findIsHolderFieldIdsToInputDescriptorsSets(g){var _;this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.isHolder.push(...i.JSONPath.nodes(g,"$..is_holder[*]"));const R=null===(_=this.fieldIds)||void 0===_?void 0:_.map(E=>E.value),T=[];T.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectPreferred,this.isHolder,R,c.Optionality.Preferred)),T.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectRequired,this.isHolder,R,c.Optionality.Required)),T.forEach(E=>this.getResults().push(this.createResult(E[1],E[0],["",{}],x.Status.ERROR,void 0)))}evaluateFields(g,_,R,T){const E=[];return _.filter(j=>j.value.directive===T).filter(j=>j.value.field_id.every(M=>R.includes(M))).forEach(j=>g.set(i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id)),_.filter(j=>j.value.directive===T).filter(j=>!j.value.field_id.every(M=>R.includes(M))).forEach(j=>E.push([i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id])),E}findAllCredentialSubjects(g){const _=i.JSONPath.nodes(g.map(R=>R.credential),"$..credentialSubject");for(let R=0;R<_.length;R++){const T=_[R],E=i.JSONPath.stringify(T.path.slice(0,2));this.credentialsSubjectsByPath.set(E,T.value),this.credentialsByPath.set(E,g[R])}}confirmAllFieldSetHasSameSubject(g,_,R){const T=Array.from(g).flatMap(k=>Array.from(this.credentialsSubjectsByPath).filter(K=>k[1].find(W=>Object.keys(K[1]).includes(W)))),E=this.mapCredentialPathsToInputDescriptors(R),j=Array.from(T).flatMap(k=>Object.keys(k[1]).filter(K=>"id"!==K)),M=Array.from(g.values()).flatMap(k=>k.every(K=>j.includes(K)))[0];T.forEach(k=>{const K=E.get(k[0]);M&&k[1].id&&this.client.dids.includes(k[1].id)?this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),K,k,_,this.credentialsByPath.get(k[0]))):this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),K,k,x.Status.ERROR,this.credentialsByPath.get(k[0])))})}mapCredentialPathsToInputDescriptors(g){var _;const R=new Map;return null===(_=this.fieldIds)||void 0===_||_.forEach(T=>{const E=i.JSONPath.stringify(T.path.slice(0,3));this.credentialsSubjectsByPath.forEach((j,M)=>{const k=this.isHolder.find(K=>i.JSONPath.stringify(K.path.slice(0,3))===E);Object.keys(j).includes(T.value)&&k?.value.directive===g&&R.set(M,E)})}),R}createResult(g,_,R,T,E,j){return{input_descriptor_path:_,verifiable_credential_path:R[0],evaluator:this.getName(),status:T,payload:Object.assign({fieldIdSet:g,credentialSubject:R[1]},E?{format:E.format}:{}),message:j??this.messages.get(T)}}}},67966:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsIssuerEvaluationHandler=void 0;const c=f(47636),x=f(11151),B=f(55776),m=i(f(24080)),S=f(13486),g=f(32893);F.SubjectIsIssuerEvaluationHandler=class _ extends g.AbstractEvaluationHandler{constructor(T){super(T)}getName(){return"SubjectIsIssuerEvaluation"}handle(T,E){T.input_descriptors.forEach((j,M)=>{const k=j.constraints;k?.subject_is_issuer===c.Optionality.Required?this.checkSubjectIsIssuer(j.id,E,M):this.getResults().push(...E.map((K,W)=>this.generateSuccessResult(M,`$[${W}]`,K,"not applicable")))}),this.updatePresentationSubmission(T)}checkSubjectIsIssuer(T,E,j){this.client.presentationSubmission.descriptor_map.forEach(M=>{if(M.id===T){const k=S.JsonPathUtils.extractInputField(E.map(K=>K.credential),[M.path]);for(const K of k){const W=(0,S.getIssuerString)(K.value);K&&K.value&&(0,S.getSubjectIdsAsString)(K.value).every(V=>V===W)?this.getResults().push(this.generateSuccessResult(j,M.path,x.CredentialMapper.toWrappedVerifiableCredential(K.value))):this.getResults().push(this.generateErrorResult(j,M.path,x.CredentialMapper.toWrappedVerifiableCredential(K.value)))}}})}generateErrorResult(T,E,j){return{input_descriptor_path:`$.input_descriptors[${T}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.SUBJECT_IS_NOT_ISSUER,verifiable_credential_path:E,payload:{format:j.format}}}generateSuccessResult(T,E,j,M){return{input_descriptor_path:`$.input_descriptors[${T}]`,evaluator:this.getName(),status:B.Status.INFO,message:M??m.default.SUBJECT_IS_ISSUER,verifiable_credential_path:E,payload:{format:j.format}}}}},63217:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(F,"__esModule",{value:!0}),F.UriEvaluationHandler=void 0;const c=f(44273),x=f(11151),B=f(35975),m=f(55776),S=f(99938),g=i(f(24080)),_=f(32893);class R extends _.AbstractEvaluationHandler{constructor(E){super(E)}getName(){return"UriEvaluation"}handle(E,j){var M,k,K;E.input_descriptors.forEach((Z,q)=>{const ne=E.getVersion()!==S.PEVersion.v2?Z.schema.map(te=>te.uri):[];j.forEach((te,ie)=>{const ae=R.buildVcContextAndSchemaUris(te.credential,E.getVersion());this.evaluateUris(te,ae,ne,q,ie,E.getVersion())})});const W=(null===(M=E.format)||void 0===M?void 0:M.di)||(null===(k=E.format)||void 0===k?void 0:k.di_vc)||(null===(K=E.format)||void 0===K?void 0:K.di_vp),V=this.getResults().filter(Z=>Z.status===m.Status.INFO).map(Z=>{var q,ne,te,ie;let ae=null===(q=Z.payload)||void 0===q?void 0:q.format;if(W&&("ldp_vc"===ae||"ldp"===ae)){const $=c.JSONPath.nodes(j,Z.verifiable_credential_path).map(A=>A.value).map(A=>A.type===x.OriginalType.JSONLD&&A.credential.proof?(Array.isArray(A.credential.proof)?A.credential.proof:[A.credential.proof]).filter(z=>"DataIntegrityProof"===z.type&&void 0!==z.cryptosuite):[]).reduce((A,C)=>A.filter(O=>C.includes(O))),o=c.JSONPath.nodes(E,Z.input_descriptor_path)[0].value,h=!o.format||(null===(ne=o?.format)||void 0===ne?void 0:ne.di)||(null===(te=o?.format)||void 0===te?void 0:te.di_vc)||(null===(ie=o?.format)||void 0===ie?void 0:ie.di_vp);$.length>0&&h&&(ae="di_vc")}return{id:c.JSONPath.nodes(E,Z.input_descriptor_path)[0].value.id,format:ae,path:Z.verifiable_credential_path}});this.client.generatePresentationSubmission&&(!this.presentationSubmission||0===Object.keys(this.presentationSubmission).length)&&(this.presentationSubmission={id:(0,B.nanoid)(),definition_id:E.id,descriptor_map:V})}evaluateUris(E,j,M,k,K,W){let V=!1;if(W===S.PEVersion.v1){for(let Z=0;Zq===j[Z])&&(V=!0)}else V=!0;V?this.getResults().push(this.createSuccessResultObject(E,M,k,K)):this.getResults().push(this.createErrorResultObject(E,M,k,K))}static buildVcContextAndSchemaUris(E,j){const M=[];return x.CredentialMapper.isW3cCredential(E)&&(Array.isArray(E["@context"])?E["@context"].forEach(k=>M.push(k)):M.push(E["@context"]),Array.isArray(E.credentialSchema)&&E.credentialSchema.length>0?E.credentialSchema.forEach(k=>M.push(k.id)):E.credentialSchema&&M.push(E.credentialSchema.id),j===S.PEVersion.v1&&(Array.isArray(E.type)?E.type.forEach(k=>M.push(k)):E.type&&M.push(E.type))),x.CredentialMapper.isSdJwtDecodedCredential(E)&&j===S.PEVersion.v1&&M.push(E.decodedPayload.vct),M}createSuccessResultObject(E,j,M,k){const K=this.createResult(M,k);return K.status=m.Status.INFO,K.message=g.default.URI_EVALUATION_PASSED,K.payload={format:E.format,vcContext:x.CredentialMapper.isW3cCredential(E.credential)?E.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(E.credential)?E.credential.credentialSchema:void 0,inputDescriptorsUris:j},K}createErrorResultObject(E,j,M,k){const K=this.createResult(M,k);return K.status=m.Status.ERROR,K.message=g.default.URI_EVALUATION_DIDNT_PASS,K.payload={format:E.format,vcContext:x.CredentialMapper.isW3cCredential(E.credential)?E.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(E.credential)?E.credential.credentialSchema:void 0,inputDescriptorsUris:j},K}createWarnResultObject(E,j){const M=this.createResult(E,j);return M.status=m.Status.WARN,M.message=g.default.URI_EVALUATION_DIDNT_PASS,M.payload=g.default.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED,M}createResult(E,j){return{input_descriptor_path:`$.input_descriptors[${E}]`,verifiable_credential_path:`$[${j}]`,evaluator:this.getName(),status:m.Status.INFO,message:void 0}}static containsHashlink(E){return!(this.matchAll(E,R.HASHLINK_QUERY_URL_REGEX).next().done&&this.matchAll(E,R.HASHLINK_URL_ENCODED_REGEX).next().done)}}F.UriEvaluationHandler=R,R.matchAll=f(72373),R.HASHLINK_URL_ENCODED_REGEX=/hl:[a-zA-Z0-9]+:[a-zA-Z0-9]+/g,R.HASHLINK_QUERY_URL_REGEX=/https*?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(hl=[a-zA-Z0-9]+)/g},70143:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=F.EvaluationClientWrapper=F.EvaluationClient=void 0;const i=f(92127);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return i.HandlerCheckResult}});const c=f(50950);Object.defineProperty(F,"EvaluationClient",{enumerable:!0,get:function(){return c.EvaluationClient}});var x=f(78995);Object.defineProperty(F,"EvaluationClientWrapper",{enumerable:!0,get:function(){return x.EvaluationClientWrapper}})},2700:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(T,E,j,M){void 0===M&&(M=j);var k=Object.getOwnPropertyDescriptor(E,j);(!k||("get"in k?!E.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return E[j]}}),Object.defineProperty(T,M,k)}:function(T,E,j,M){void 0===M&&(M=j),T[M]=E[j]}),c=this&&this.__exportStar||function(T,E){for(var j in T)"default"!==j&&!Object.prototype.hasOwnProperty.call(E,j)&&i(E,T,j)};Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=F.PEXv1=F.PEX=F.Status=F.Checked=F.PEVersion=F.ValidationEngine=F.HandlerCheckResult=void 0;const x=f(55776);Object.defineProperty(F,"Checked",{enumerable:!0,get:function(){return x.Checked}}),Object.defineProperty(F,"Status",{enumerable:!0,get:function(){return x.Status}});const B=f(97889);Object.defineProperty(F,"PEX",{enumerable:!0,get:function(){return B.PEX}});const m=f(38992);Object.defineProperty(F,"PEXv1",{enumerable:!0,get:function(){return m.PEXv1}});const S=f(71945);Object.defineProperty(F,"PEXv2",{enumerable:!0,get:function(){return S.PEXv2}});const g=f(70143);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return g.HandlerCheckResult}});const _=f(99938);Object.defineProperty(F,"PEVersion",{enumerable:!0,get:function(){return _.PEVersion}});const R=f(80930);Object.defineProperty(F,"ValidationEngine",{enumerable:!0,get:function(){return R.ValidationEngine}}),c(f(64864),F)},64864:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(34277),F)},34277:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.KeyEncoding=F.PresentationSubmissionLocation=void 0;var f=function(c){return c[c.EXTERNAL=0]="EXTERNAL",c[c.PRESENTATION=1]="PRESENTATION",c}(f||(F.PresentationSubmissionLocation=f={})),i=function(c){return c.Jwk="Jwk",c.Base58="Base58",c.Hex="Hex",c.Multibase="Multibase",c}(i||(F.KeyEncoding=i={}))},99358:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEVersion=F.InternalPresentationDefinitionV2=F.InternalPresentationDefinitionV1=void 0,F.InternalPresentationDefinitionV1=class f{constructor(B,m,S,g,_,R){this.id=B,this.input_descriptors=m,this.format=S,this.name=g,this.purpose=_,this.submission_requirements=R}getVersion(){return c.v1}},F.InternalPresentationDefinitionV2=class i{constructor(B,m,S,g,_,R,T){this.format=S,this.frame=g,this.id=B,this.input_descriptors=m,this.name=_,this.purpose=R,this.submission_requirements=T}getVersion(){return c.v2}};var c=function(x){return x.v1="v1",x.v2="v2",x}(c||(F.PEVersion=c={}))},24080:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var f=function(i){return i.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY="Input candidate does not contain property",i.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION="Input candidate failed filter evaluation",i.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is eligible for submission",i.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is not eligible for submission",i.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED="Input descriptor contains hashlink. This version doesn't support hashlink verification.",i.LIMIT_DISCLOSURE_APPLIED="added variable in the limit_disclosure to the verifiableCredential",i.LIMIT_DISCLOSURE_NOT_SUPPORTED="Limit disclosure not supported",i.SUBJECT_IS_NOT_ISSUER="subject is not issuer",i.SUBJECT_IS_ISSUER="subject is issuer",i.FORMAT_RESTRICTION_PASSED="the Credential format of the candidate inputs matches the required formats",i.FORMAT_RESTRICTION_DIDNT_PASS="the Credential format of the candidate inputs didn't match the required formats",i.URI_EVALUATION_PASSED="@context URI(s) for the schema of the candidate input is equal to one of the input_descriptors object uri values.",i.URI_EVALUATION_DIDNT_PASS="@context URI for the of the candidate input MUST be equal to one of the input_descriptors object uri values exactly.",i.UNKNOWN_EXCEPTION="unknown exception occurred: ",i.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT="mandatory field not present in the verifiableCredential",i}(f||{});F.default=f},88819:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SSITypesBuilder=void 0;const i=f(11151),c=f(13486),x=f(99358);class B{static modelEntityToInternalPresentationDefinitionV1(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV1(g.id,g.input_descriptors,g.format,g.name,g.purpose,g.submission_requirements)}static modelEntityInternalPresentationDefinitionV2(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV2(g.id,g.input_descriptors,g.format,g.frame,g.name,g.purpose,g.submission_requirements)}static createCopyAndModifyPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S));return c.JsonPathUtils.changePropertyNameRecursively(g,"_const","const"),c.JsonPathUtils.changePropertyNameRecursively(g,"_enum","enum"),c.JsonPathUtils.changeSpecialPathsRecursively(g),g}static mapExternalVerifiablePresentationToWrappedVP(S,g){return i.CredentialMapper.toWrappedVerifiablePresentation(S,{hasher:g})}static mapExternalVerifiableCredentialsToWrappedVcs(S,g){return i.CredentialMapper.toWrappedVerifiableCredentials(Array.isArray(S)?S:[S],{hasher:g})}static toInternalPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S)),_=(0,c.definitionVersionDiscovery)(g);if(_.error)throw _.error;return _.version==x.PEVersion.v1?B.modelEntityToInternalPresentationDefinitionV1(g):B.modelEntityInternalPresentationDefinitionV2(g)}}F.SSITypesBuilder=B},99938:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(24080),F),c(f(99358),F),c(f(88819),F)},27426:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(c){return Array.isArray(c)?c:[c]}static isObject(c){return"[object Object]"===Object.prototype.toString.call(c)}static isUrlAbsolute(c){f.isString(c)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(c)}static isString(c){return"string"==typeof c||"[object String]"===Object.prototype.toString.call(c)}static getDistinctFieldInObject(c,x){const B=c.map(m=>m[x]);return Array.from(new Set(B))}static cloneDeep(c){return JSON.parse(JSON.stringify(c))}}F.ObjectUtils=f},18471:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectValidationUtils=void 0,F.ObjectValidationUtils=class f{static optionalNonEmptyString(c){return null==c||c.length>0}static nonEmptyString(c){return null!=c&&c.length>0}static isValidDIDURI(c){return new RegExp("^did:([a-z0-9]+)(:([a-zA-Z0-9\\.\\-_]|%[0-9a-fA-F]{2})+)+(/([a-zA-Z-\\._~]|%[0-9a-fA-F]{2}|[!$&'()*+,;=:@])*)?").test(c)}}},79446:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(F,"__esModule",{value:!0}),F.filterToRestrictedDIDs=F.isRestrictedDID=F.uniformDIDMethods=F.definitionVersionDiscovery=F.getIssuerString=F.getSubjectIdsAsString=void 0;const c=f(99938),x=i(f(86515)),B=i(f(93046)),m=f(27426),S=f(45408);function T(M,k){var K;let W=null!==(K=M?.map(V=>V.toLowerCase()).map(V=>V.startsWith("did:")?V:`did:${V}`))&&void 0!==K?K:[];if(k?.removePrefix){const V=k.removePrefix.endsWith(":")?k.removePrefix.length:k.removePrefix.length+1;W=W.map(Z=>Z.startsWith(k.removePrefix)?Z.substring(V):Z)}return W.includes("did")?[]:W}F.getSubjectIdsAsString=function g(M){return(Array.isArray(M.credentialSubject)?M.credentialSubject:[M.credentialSubject]).filter(K=>!!K.id).map(K=>K.id)},F.getIssuerString=function _(M){return m.ObjectUtils.isString(M.issuer)?M.issuer:M.issuer.id},F.definitionVersionDiscovery=function R(M){const k=JSON.parse(JSON.stringify(M));S.JsonPathUtils.changePropertyNameRecursively(k,"_const","const"),S.JsonPathUtils.changePropertyNameRecursively(k,"_enum","enum");const K={presentation_definition:k};let W=(0,B.default)(K);return W?{version:c.PEVersion.v2}:(W=(0,x.default)(K),W?{version:c.PEVersion.v1}:{error:"This is not a valid PresentationDefinition"})},F.uniformDIDMethods=T,F.isRestrictedDID=function E(M,k){const K=T(k);return 0===K.length||K.some(W=>M.toLowerCase().startsWith(W))},F.filterToRestrictedDIDs=function j(M,k){const K=T(k);return 0===K.length?M:K.flatMap(W=>M.filter(V=>V.toLowerCase().startsWith(W)))}},13486:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(45408),F),c(f(27426),F),c(f(18471),F),c(f(79446),F),c(f(58870),F)},45408:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JsonPathUtils=void 0;const i=f(44273);class c{static extractInputField(B,m){let S=[];if(m)for(const g of m)if(S=i.JSONPath.nodes(B,g),S.length)break;return S}static changePropertyNameRecursively(B,m,S){const g=c.extractInputField(B,["$.."+m]);for(const _ of g)this.copyResultPathToDestinationDefinition(_.path,B,S)}static setValue(B,m,S){const g="string"==typeof m?m:i.JSONPath.stringify(m);return i.JSONPath.value(B,g,S),B}static copyResultPathToDestinationDefinition(B,m,S){let g=m;for(let _=1;_1&&"['"!==m.substring(_-2,_)&&'["'!==m.substring(_-2,_))if(".."===m.substring(_-2,_)){m=m.substring(0,_-2)+"..['"+S.value[0]+"']"+m.substring(_+S.value[0].length),g=!0;const R=this.matchAll(m,this.REGEX_PATH);this.modifyPathRecursive(R,m)}else"."===m.charAt(_-1)&&(m=m.substring(0,_-1)+"['"+S.value[0]+"']"+m.substring(_+S.value[0].length),g=!0,this.modifyPathRecursive(B,m));S=B.next()}return m}}F.JsonPathUtils=c,c.matchAll=f(72373),c.REGEX_PATH=/@\w+/g},58870:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(T,E,j,M){void 0===M&&(M=j);var k=Object.getOwnPropertyDescriptor(E,j);(!k||("get"in k?!E.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return E[j]}}),Object.defineProperty(T,M,k)}:function(T,E,j,M){void 0===M&&(M=j),T[M]=E[j]}),c=this&&this.__setModuleDefault||(Object.create?function(T,E){Object.defineProperty(T,"default",{enumerable:!0,value:E})}:function(T,E){T.default=E}),x=this&&this.__importStar||function(T){if(T&&T.__esModule)return T;var E={};if(null!=T)for(var j in T)"default"!==j&&Object.prototype.hasOwnProperty.call(T,j)&&i(E,T,j);return c(E,T),E};Object.defineProperty(F,"__esModule",{value:!0}),F.applySdJwtLimitDisclosure=F.calculateSdHash=void 0;const B=f(15315),m=f(22084),S=x(f(75324)),g=f(27426);F.calculateSdHash=function _(T,E,j){const M=j(T,E);return S.toString(M,"base64url")},F.applySdJwtLimitDisclosure=function R(T,E){const j=T.disclosures.map(q=>({digest:q.digest,encoded:q.encoded,salt:q.decoded[0],value:3===q.decoded.length?q.decoded[2]:q.decoded[1],key:3===q.decoded.length?q.decoded[1]:void 0})),M=(0,m.selectDisclosures)(g.ObjectUtils.cloneDeep(T.signedPayload),j,E);T.disclosures=M.map(q=>({encoded:q.encoded,decoded:q.key?[q.salt,q.key,q.value]:[q.salt,q.value],digest:q.digest}));const k=T.disclosures.map(q=>q.encoded),K=T.compactSdJwtVc.split("~");T.compactSdJwtVc=K.filter((q,ne)=>0===ne||ne===K.length-1||k.includes(q)).join("~");const{payload:W}=(0,B.getSDAlgAndPayload)(g.ObjectUtils.cloneDeep(T.signedPayload)),V=(0,m.createHashMappingForSerializedDisclosure)(M),{unpackedObj:Z}=(0,B.unpackObj)(W,V);T.decodedPayload=Z}},38612:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ConstraintsVB=void 0;const i=f(47636),c=f(30387),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"constraints"),this.disclosureLimitShouldHaveKnownValueMsg="limit_disclosure should have known value",this.statusShouldHaveKnownValueMsg="Unknown status property",this.statusDirectiveShouldHaveKnownValueMsg="status directive should have known value",this.subjectIsIssuerShouldBeKnownValueMsg="subject_is_issuer should be known value",this.fieldIdIsMandatoryMsg="field_id property is mandatory",this.fieldIdMustBeArrayOfStringsMsg="field_id property must be an array of strings",this.fieldIdMustCorrespondToFieldIdMsg="field_id must correspond to a present field object id property",this.directivePropertyIsMandatoryMsg="directive property is mandatory",this.oneOfTheKnownDirectivePropertiesMandatoryMsg="directive property must be one of [required, preferred]"}getValidations(S){let g=[];return S&&(g=[{tag:this.getTag(),target:S,predicate:_=>B.disclosureLimitShouldHaveKnownValue(_.limit_disclosure),message:this.disclosureLimitShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:_=>B.statusShouldHaveKnownValue(_.statuses),message:this.statusShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:B.statusDirectiveShouldHaveKnownValue(),message:this.statusDirectiveShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:_=>B.shouldBeKnownOption(_.is_holder),message:this.subjectIsIssuerShouldBeKnownValueMsg},{tag:this.getTag(),target:S,predicate:_=>this.fieldIdInSubjectMustCorrespondToFieldId(_,_.is_holder),message:this.fieldIdMustCorrespondToFieldIdMsg},{tag:this.getTag(),target:S,predicate:_=>this.fieldIdInSubjectMustCorrespondToFieldId(_,_.same_subject),message:this.fieldIdMustCorrespondToFieldIdMsg},...this.getSubjectsValidations(S?.is_holder),...this.getSubjectsValidations(S?.same_subject),...this.getFieldsValidations(S)]),g}getFieldsValidations(S){var g;return null!==(g=S?.fields)&&void 0!==g&&g.length?new c.FieldsVB(this.getTag()).getValidations(S.fields):[]}static disclosureLimitShouldHaveKnownValue(S){return!S||S===i.Optionality.Preferred||S===i.Optionality.Required}static statusShouldHaveKnownValue(S){return null==S||null!=S.active||null!=S.revoked||null!=S.suspended}static statusDirectiveShouldHaveKnownValue(){return S=>{var g,_,R;return this.pdStatusShouldBeKnown(null===(g=S?.statuses)||void 0===g?void 0:g.active)&&this.pdStatusShouldBeKnown(null===(_=S?.statuses)||void 0===_?void 0:_.revoked)&&this.pdStatusShouldBeKnown(null===(R=S?.statuses)||void 0===R?void 0:R.suspended)}}static pdStatusShouldBeKnown(S){return!S||S.directive===i.Directives.Allowed||S.directive===i.Directives.Disallowed||S.directive===i.Directives.Required}static shouldBeKnownOption(S){return!S||0===S.filter(g=>g.directive!==i.Optionality.Preferred&&g.directive!==i.Optionality.Required).length}getSubjectsValidations(S){if(S){let g=[];for(let _=0;_Array.isArray(R.field_id),message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>!!R.field_id,message:this.fieldIdIsMandatoryMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>R.field_id.length===R.field_id.filter(T=>"string"==typeof T).length,message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>void 0!==R.directive,message:this.directivePropertyIsMandatoryMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>R.directive===i.Optionality.Preferred||R.directive===i.Optionality.Required,message:this.oneOfTheKnownDirectivePropertiesMandatoryMsg}];return g}return[]}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}fieldIdInSubjectMustCorrespondToFieldId(S,g){if(g)for(const _ of g)for(const R of _.field_id)if(!B.isValidFieldId(S,R))return!1;return!0}static isValidFieldId(S,g){return!!S?.fields&&S.fields.map(_=>_.id).includes(g)}}F.ConstraintsVB=B},30387:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(F,"__esModule",{value:!0}),F.FieldsVB=void 0;const c=f(44273),x=f(47636),B=i(f(94217)),m=i(f(61264)),S=f(10767);class g extends S.ValidationBundler{constructor(R){super(R,"fields"),this.mustHaveValidJsonPathsMsg='field object "path" property must contain array of valid json paths',this.pathObjMustHaveValidJsonPathMsg='field object "path" property must contain valid json paths.',this.filterMustBeValidJsonSchemaMsg='field object "filter" property must be valid json schema',this.filterIsMustInPresenceOfPredicateMsg='field object must have a "filter" property if "predicate" is present',this.filterIsNotValidJsonSchemaDescriptorMsg='could not parse "filter" object as a valid json schema descriptor.',this.purposeShouldBeANonEmptyStringMsg="purpose should be a non empty string",this.shouldBeKnownOptionMsg="Unknown predicate property"}getValidations(R){let T=[];if(R)for(let E=0;Eg.optionalNonEmptyString(E?.purpose),message:this.purposeShouldBeANonEmptyStringMsg},{tag:this.getMyTag(T),target:R,predicate:E=>g.shouldBeKnownOption(E?.predicate),message:this.shouldBeKnownOptionMsg}]}getMyTag(R){return this.parentTag+"."+this.myTag+"["+R+"]"}mustHaveValidJsonPaths(){return R=>null!=R.path&&R.path.length>0&&this._validateJsonPaths(R.path)}_validateJsonPaths(R){const T=[];if(R.forEach(E=>{try{c.JSONPath.parse(E)}catch{T.push(E)}}),T.length>0)throw this.toChecked(this.pathObjMustHaveValidJsonPathMsg+" Got: "+JSON.stringify(T));return!0}filterMustBeValidJsonSchema(){return R=>this._validateFilter(R.filter)}_validateFilter(R){if(null==R)return!0;let T=!1;try{T=(0,m.default)(R),T||(T=(0,B.default)(R))}catch{throw this.toChecked(this.filterIsNotValidJsonSchemaDescriptorMsg+" Got "+JSON.stringify(R))}return T}filterIsMustInPresenceOfPredicate(){return R=>!(null!=R.predicate&&null==R.filter)}static optionalNonEmptyString(R){return null==R||R.length>0}static shouldBeKnownOption(R){return null==R||R==x.Optionality.Required||R==x.Optionality.Preferred}}F.FieldsVB=g},79241:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.FrameVB=void 0;const i=f(13486),c=f(10767);class x extends c.ValidationBundler{constructor(m){super(m,"frame"),this.frameIsValidMsg="frame value is not valid"}getValidations(m){let S=[];return S=[...S,...this.getMyValidations(m)],S}getMyValidations(m){return[{tag:this.getMyTag(),target:m,predicate:x.frameIsValid,message:this.frameIsValidMsg}]}getMyTag(){return this.parentTag+"."+this.myTag}static frameIsValid(m){if(!m||Array.isArray(m)||"object"!=typeof m)return!1;const S=m;if(S&&S["@id"])for(const g of i.ObjectUtils.asArray(m["@id"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;if(S["@types"])for(const g of i.ObjectUtils.asArray(m["@types"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;return!0}}F.FrameVB=x},75056:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(30387),F),c(f(853),F),c(f(74840),F),c(f(27506),F),c(f(12915),F),c(f(3170),F),c(f(97091),F),c(f(10767),F),c(f(38612),F)},853:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV1VB=void 0;const i=f(13486),c=f(38612),x=f(10767);F.InputDescriptorsV1VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string",this.shouldHaveValidSchemaURIMsg="schema should have valid URI"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueIds(_),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueFieldsIds(_),message:"fields id must be unique"}),S.forEach((_,R)=>{g=[...g,...this.getValidationFor(_,R),...this.constraintsValidations(_,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.nonEmptyString(_?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:this.isValidSchema(),message:this.shouldHaveValidSchemaURIMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],_=new Set,R=[];return S.map(T=>{var E;return null===(E=T.constraints)||void 0===E?void 0:E.fields}).forEach(T=>{T&&R.push(...T)}),R.forEach(T=>{T.id&&g.push(T.id)}),g.forEach(T=>_.add(T)),g.length===_.size}shouldHaveUniqueIds(S){const g=[],_=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>_.add(R)),g.length===_.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}isValidSchema(){return S=>S.schema.filter(g=>this.isAValidURI(g.uri)&&(null==g.required||"boolean"==typeof g.required)).length>0}isAValidURI(S){if(!S)return!1;if(!i.ObjectValidationUtils.nonEmptyString(S))return!1;if(S.startsWith("http://")||S.startsWith("https://"))try{new URL(S)}catch{return i.ObjectValidationUtils.isValidDIDURI(S)}return!0}constraintsValidations(S,g){return S.constraints?new c.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}}},74840:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV2VB=void 0;const i=f(13486),c=f(38612),x=f(10767);F.InputDescriptorsV2VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:_=>this.shouldNotHaveSchema(_),message:"input descriptor should not have schema property"},{tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueIds(_),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueFieldsIds(_),message:"fields id must be unique"}),S.forEach((_,R)=>{g=[...g,...this.getValidationFor(_,R),...this.constraintsValidations(_,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.nonEmptyString(_?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],_=new Set,R=[];return S.map(T=>{var E;return null===(E=T.constraints)||void 0===E?void 0:E.fields}).forEach(T=>{T&&R.push(...T)}),R.forEach(T=>{T.id&&g.push(T.id)}),g.forEach(T=>_.add(T)),g.length===_.size}shouldHaveUniqueIds(S){const g=[],_=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>_.add(R)),g.length===_.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}constraintsValidations(S,g){return S.constraints?new c.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}shouldNotHaveSchema(S){let g=!1;return S.forEach(_=>{_.schema&&(g=!0)}),!g}}},27506:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV1VB=void 0;const c=f(92209),x=f(83851),B=i(f(86515)),m=f(853),S=f(97091),g=f(10767);class _ extends g.ValidationBundler{constructor(T){super(T,"presentation_definition")}getValidations(T){return T.submission_requirements?[...this.myValidations(T),...new m.InputDescriptorsV1VB(this.myTag).getValidations(T.input_descriptors),...new S.SubmissionRequirementVB(this.myTag).getValidations(T.submission_requirements)]:[...this.myValidations(T),...new m.InputDescriptorsV1VB(this.myTag).getValidations(T.input_descriptors)]}myValidations(T){return[{tag:this.getTag(),target:T,predicate:E=>null!=E,message:"presentation_definition should be non null."},{tag:this.getTag(),target:T,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:T,predicate:E=>_.nonEmptyString(E?.id),message:"id should not be empty"},{tag:this.getTag(),target:T,predicate:E=>_.optionalNonEmptyString(E?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:T,predicate:E=>_.optionalNonEmptyString(E?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:T,predicate:E=>_.formatValuesShouldNotBeEmpty(E?.format),message:"formats values should not empty"},{tag:this.getTag(),target:T,predicate:E=>_.formatValuesShouldBeAmongKnownValues(E?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:T,predicate:E=>_.groupShouldMatchSubmissionRequirements(E),message:"input descriptor group should match the from in submission requirements."},{tag:this.getTag(),target:T,predicate:E=>_.shouldNotHaveFrameProperty(E),message:"input descriptor should not have frame property."}]}static optionalNonEmptyString(T){return null==T||T.length>0}static nonEmptyString(T){return null!=T&&T.length>0}static formatValuesShouldNotBeEmpty(T){var E,j,M,k,K,W,V,Z,q,ne,te;let ie=!0;return null!=T?.jwt&&(ie=ie&&(null===(E=T.jwt.alg)||void 0===E?void 0:E.length)>0),null!=T?.jwt_vc&&(ie=ie&&(null===(j=T.jwt_vc.alg)||void 0===j?void 0:j.length)>0),null!=T?.jwt_vc_json&&(ie=ie&&(null===(M=T.jwt_vc_json.alg)||void 0===M?void 0:M.length)>0),null!=T?.jwt_vp&&(ie=ie&&(null===(k=T.jwt_vp.alg)||void 0===k?void 0:k.length)>0),null!=T?.jwt_vp_json&&(ie=ie&&(null===(K=T.jwt_vp_json.alg)||void 0===K?void 0:K.length)>0),null!=T?.ldp&&(ie=ie&&(null===(W=T.ldp.proof_type)||void 0===W?void 0:W.length)>0),null!=T?.ldp_vc&&(ie=ie&&(null===(V=T.ldp_vc.proof_type)||void 0===V?void 0:V.length)>0),null!=T?.ldp_vp&&(ie=ie&&(null===(Z=T.ldp_vp.proof_type)||void 0===Z?void 0:Z.length)>0),null!=T?.di&&(ie=ie&&(null===(q=T.di.proof_type)||void 0===q?void 0:q.length)>0),null!=T?.di_vc&&(ie=ie&&(null===(ne=T.di_vc.proof_type)||void 0===ne?void 0:ne.length)>0),null!=T?.di_vp&&(ie=ie&&(null===(te=T.di_vp.proof_type)||void 0===te?void 0:te.length)>0),ie}static formatValuesShouldBeAmongKnownValues(T){let E=[];if(T){const j=c.JwtAlgos.getJwtAlgos(),M=x.LdpTypes.getLdpTypes();E=[];for(const[k,K]of Object.entries(T))k.startsWith("jwt")?E.push(..._.isJWTAlgoKnown(K,j)):E.push(..._.isLDPProofKnown(K,M))}return 0===E.length}static isJWTAlgoKnown(T,E){const j=[];if(null!=T&&null!=T.alg)for(const M of T.alg)E.includes(M)||j.push(M);return j}static isLDPProofKnown(T,E){const j=[];if(null!=T&&null!=T.proof_type)for(const M of T.proof_type)E.includes(M)||j.push(M);return j}static groupShouldMatchSubmissionRequirements(T){if(null!=T.submission_requirements&&T.submission_requirements.length>0){const E=[];T.input_descriptors.forEach(W=>{W.group&&E.push(...W.group)});const j=new Set(E),M=[];_.flatten(T.submission_requirements).forEach(W=>{W.from&&(Array.isArray(W.from)?M.push(...W.from):M.push(W.from))});const k=new Set(M);return 0===new Set([...k].filter(W=>null!=W&&W.length>0&&!j.has(W))).size}return!0}static flatten(T){return T?.reduce((E,j)=>E.concat(Array.isArray(j.from_nested)?this.flatten(j.from_nested):j),[])}shouldBeAsPerJsonSchema(){return T=>(0,B.default)({presentation_definition:T})}static shouldNotHaveFrameProperty(T){return!T.frame}}F.PresentationDefinitionV1VB=_},12915:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV2VB=void 0;const c=f(92209),x=f(83851),B=i(f(93046)),m=f(79241),S=f(74840),g=f(97091),_=f(10767);class R extends _.ValidationBundler{constructor(E){super(E,"presentation_definition")}getValidations(E){let j=[];return j=E.submission_requirements?[...this.myValidations(E),...new S.InputDescriptorsV2VB(this.myTag).getValidations(E.input_descriptors),...new g.SubmissionRequirementVB(this.myTag).getValidations(E.submission_requirements)]:[...this.myValidations(E),...new S.InputDescriptorsV2VB(this.myTag).getValidations(E.input_descriptors)],E.frame&&j.push(...new m.FrameVB(this.myTag).getValidations(E.frame)),j}myValidations(E){return[{tag:this.getTag(),target:E,predicate:j=>null!=j,message:"presentation_definition should be non null."},{tag:this.getTag(),target:E,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:E,predicate:j=>R.nonEmptyString(j?.id),message:"id should not be empty"},{tag:this.getTag(),target:E,predicate:j=>R.optionalNonEmptyString(j?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:E,predicate:j=>R.optionalNonEmptyString(j?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:E,predicate:j=>R.formatValuesShouldNotBeEmpty(j?.format),message:"formats values should not empty"},{tag:this.getTag(),target:E,predicate:j=>R.formatValuesShouldBeAmongKnownValues(j?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:E,predicate:j=>R.groupShouldMatchSubmissionRequirements(j),message:"input descriptor group should match the from in submission requirements."}]}static optionalNonEmptyString(E){return null==E||E.length>0}static nonEmptyString(E){return null!=E&&E.length>0}static formatValuesShouldNotBeEmpty(E){var j,M,k,K,W,V,Z,q,ne,te,ie;let ae=!0;return null!=E?.jwt&&(ae=ae&&(null===(j=E.jwt.alg)||void 0===j?void 0:j.length)>0),null!=E?.jwt_vc&&(ae=ae&&(null===(M=E.jwt_vc.alg)||void 0===M?void 0:M.length)>0),null!=E?.jwt_vc_json&&(ae=ae&&(null===(k=E.jwt_vc_json.alg)||void 0===k?void 0:k.length)>0),null!=E?.jwt_vp&&(ae=ae&&(null===(K=E.jwt_vp.alg)||void 0===K?void 0:K.length)>0),null!=E?.jwt_vp_json&&(ae=ae&&(null===(W=E.jwt_vp_json.alg)||void 0===W?void 0:W.length)>0),null!=E?.ldp&&(ae=ae&&(null===(V=E.ldp.proof_type)||void 0===V?void 0:V.length)>0),null!=E?.ldp_vc&&(ae=ae&&(null===(Z=E.ldp_vc.proof_type)||void 0===Z?void 0:Z.length)>0),null!=E?.ldp_vp&&(ae=ae&&(null===(q=E.ldp_vp.proof_type)||void 0===q?void 0:q.length)>0),null!=E?.di&&(ae=ae&&(null===(ne=E.di.proof_type)||void 0===ne?void 0:ne.length)>0),null!=E?.di_vc&&(ae=ae&&(null===(te=E.di_vc.proof_type)||void 0===te?void 0:te.length)>0),null!=E?.di_vp&&(ae=ae&&(null===(ie=E.di_vp.proof_type)||void 0===ie?void 0:ie.length)>0),ae}static formatValuesShouldBeAmongKnownValues(E){let j=[];if(E){const M=c.JwtAlgos.getJwtAlgos(),k=x.LdpTypes.getLdpTypes();j=[];for(const[K,W]of Object.entries(E))K.startsWith("jwt")?j.push(...R.isJWTAlgoKnown(W,M)):j.push(...R.isLDPProofKnown(W,k))}return 0===j.length}static isJWTAlgoKnown(E,j){const M=[];if(null!=E&&null!=E.alg)for(const k of E.alg)j.includes(k)||M.push(k);return M}static isLDPProofKnown(E,j){const M=[];if(null!=E&&null!=E.proof_type)for(const k of E.proof_type)j.includes(k)||M.push(k);return M}static groupShouldMatchSubmissionRequirements(E){if(null!=E.submission_requirements&&E.submission_requirements.length>0){const j=[];E.input_descriptors.forEach(V=>{V.group&&j.push(...V.group)});const M=new Set(j),k=[];R.flatten(E.submission_requirements).forEach(V=>{V.from&&k.push(V.from)});const K=new Set(k);return 0===new Set([...K].filter(V=>null!=V&&V.length>0&&!M.has(V))).size}return!0}static flatten(E){return E?.reduce((j,M)=>j.concat(Array.isArray(M.from_nested)?this.flatten(M.from_nested):M),[])}shouldBeAsPerJsonSchema(){return E=>(0,B.default)({presentation_definition:E})}}F.PresentationDefinitionV2VB=R},3170:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationSubmissionVB=void 0;const i=f(44273),c=f(55776),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"presentation_submission")}getValidations(S){return[{tag:this.getTag(),target:S,predicate:g=>null!=g,message:"presentation_submission should be non null."},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.id),message:"id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.definition_id),message:"presentation_definition_id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.descriptorMapMustBePresent(g?.descriptor_map),message:"descriptor_map should be a non-empty list"},{tag:this.getTag(),target:S,predicate:g=>B.idMustBeSameForEachLevelOfNesting(g?.descriptor_map),message:"each descriptor should have a one id in it, on all levels"},{tag:this.getTag(),target:S,predicate:g=>B.formatsShouldBeKnown(g?.descriptor_map),message:"each format should be one of the known format"},{tag:this.getTag(),target:S,predicate:g=>B.pathsShouldBeValidJsonPaths(g?.descriptor_map),message:"each path should be a valid jsonPath"}]}static nonEmptyString(S){return null!=S&&S.length>0}static descriptorMapMustBePresent(S){return null!=S&&S.length>0}static idMustBeSameForEachLevelOfNesting(S){let g=!0;if(null!=S)for(let _=0;_0)throw new c.Checked("",c.Status.ERROR,"These were not parsable json paths: "+JSON.stringify(g));return!0}}F.PresentationSubmissionVB=B},97091:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubmissionRequirementVB=void 0;const i=f(10767);class c extends i.ValidationBundler{constructor(B){super(B,"submission_requirements"),this.ruleIsMandatoryMsg="rule is a mandatory field",this.needsOneFromOrFromNestedMsg="needs exactly one of from or from_nested",this.fromNestedShouldBeArrayMsg="The value of the from_nested property MUST be an array",this.isCountPositiveIntMsg="count must be a practical positive number",this.isMinPositiveIntMsg="min must be a practical positive number",this.isMaxPositiveIntMsg="max must be a practical positive number",this.ruleShouldBePickOrAllMsg="rule should be either pick or all"}getValidations(B){let m=[];if(null!=B&&B.length>0)for(let S=0;S{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationBundler=void 0;const i=f(55776);F.ValidationBundler=class c{constructor(B,m){this.parentTag=B,this.myTag=m}getTag(){return null!=this.parentTag?this.parentTag+"."+this.myTag:this.myTag}toChecked(B){return new i.Checked(this.getTag(),i.Status.ERROR,B)}}},80320:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(51130),F),c(f(93398),F),c(f(50903),F)},92209:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JwtAlgos=void 0,F.JwtAlgos=class f{static getJwtAlgos(){return["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","PS256","PS384","PS512","none","RSA1_5","RSA-OAEP","RSA-OAEP-256","A128KW","A192KW","A256KW","dir","ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"]}}},83851:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.LdpTypes=void 0,F.LdpTypes=class f{static getLdpTypes(){return["Ed25519VerificationKey2018","Ed25519Signature2018","RsaSignature2018","EcdsaSecp256k1Signature2019","EcdsaSecp256k1RecoverySignature2020","JsonWebSignature2020","GpgSignature2020","JcsEd25519Signature2020","BbsBlsSignature2020","Bls12381G2Key2020","DataIntegrityProof"]}}},93398:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50903:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationEngine=void 0;const i=f(80320);F.ValidationEngine=class c{validate(B){let m=[];for(const S of B)m=m.concat(S.bundler.getValidations(S.target));return(0,i.validate)(m)}}},51130:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validate=void 0;const i=f(55776);F.validate=x=>{function m(T){return new i.Checked(T.tag,i.Status.ERROR,T.message)}function S(T){return new i.Checked(T,i.Status.INFO,"ok")}const R=x.map(T=>function g(T){let E;try{E=T.predicate(T.target)?S(T.tag):m(T)}catch{E=m(T)}return E}(T)).reduce((T,E)=>(E.status!==i.Status.INFO&&T.push(E),T),[]);return(0,i.hasErrors)(R)?R:[S("root")]}},80930:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(75056),F),c(f(80320),F)},94217:Me=>{"use strict";Me.exports=g,Me.exports.default=g;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},i=Object.prototype.hasOwnProperty,c={type:["number","string","boolean"]};function x(_,{instancePath:R="",rootData:j=_}={}){let M=null,k=0;if("number"!=typeof _&&"string"!=typeof _&&"boolean"!=typeof _){const K={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:c.type},message:"must be number,string,boolean",schema:c.type,parentSchema:c,data:_};null===M?M=[K]:M.push(K),k++}return x.errors=M,0===k}const B={type:["number","string"]};function m(_,{instancePath:R="",rootData:j=_}={}){let M=null,k=0;if("number"!=typeof _&&"string"!=typeof _){const K={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:_};null===M?M=[K]:M.push(K),k++}return m.errors=M,0===k}function S(_,{instancePath:R="",rootData:j=_}={}){let M=null,k=0;if(_&&"object"==typeof _&&!Array.isArray(_)){if(void 0===_.type){const K={instancePath:R,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'",schema:f.required,parentSchema:f,data:_};null===M?M=[K]:M.push(K),k++}for(const K in _)if(!i.call(f.properties,K)){const W={instancePath:R,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:K},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:_};null===M?M=[W]:M.push(W),k++}if(void 0!==_.const&&(x(_.const,{instancePath:R+"/const",parentData:_,parentDataProperty:"const",rootData:j})||(M=null===M?x.errors:M.concat(x.errors),k=M.length)),void 0!==_.enum){let K=_.enum;if(Array.isArray(K)){const W=K.length;for(let V=0;V{"use strict";Me.exports=_,Me.exports.default=_;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},contains:{$ref:"#/definitions/FilterV2"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},formatExclusiveMaximum:{type:"string"},formatExclusiveMinimum:{type:"string"},formatMaximum:{type:"string"},formatMinimum:{type:"string"},items:{anyOf:[{$ref:"#/definitions/FilterV2"},{items:{$ref:"#/definitions/FilterV2"},minItems:1,type:"array"}]},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},type:"object"},i=Object.prototype.hasOwnProperty,c={type:["number","string","boolean"]};function x(R,{instancePath:T="",rootData:M=R}={}){let k=null,K=0;if("number"!=typeof R&&"string"!=typeof R&&"boolean"!=typeof R){const W={instancePath:T,schemaPath:"#/type",keyword:"type",params:{type:c.type},message:"must be number,string,boolean",schema:c.type,parentSchema:c,data:R};null===k?k=[W]:k.push(W),K++}return x.errors=k,0===K}const B={type:["number","string"]};function m(R,{instancePath:T="",rootData:M=R}={}){let k=null,K=0;if("number"!=typeof R&&"string"!=typeof R){const W={instancePath:T,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:R};null===k?k=[W]:k.push(W),K++}return m.errors=k,0===K}const S={validate:g};function g(R,{instancePath:T="",rootData:M=R}={}){let k=null,K=0;if(R&&"object"==typeof R&&!Array.isArray(R)){for(const V in R)if(!i.call(f.properties,V)){const Z={instancePath:T,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:R};null===k?k=[Z]:k.push(Z),K++}if(void 0!==R.const&&(x(R.const,{instancePath:T+"/const",parentData:R,parentDataProperty:"const",rootData:M})||(k=null===k?x.errors:k.concat(x.errors),K=k.length)),void 0!==R.contains&&(S.validate(R.contains,{instancePath:T+"/contains",parentData:R,parentDataProperty:"contains",rootData:M})||(k=null===k?S.validate.errors:k.concat(S.validate.errors),K=k.length)),void 0!==R.enum){let V=R.enum;if(Array.isArray(V)){const Z=V.length;for(let q=0;q{"use strict";Me.exports=ne,Me.exports.default=ne;const F={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{schema:{type:"object",properties:{uri:{type:"string"},required:{type:"boolean"}},required:["uri"],additionalProperties:!1},issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},filter:{type:"object",properties:{type:{type:"string"},format:{type:"string"},pattern:{type:"string"},minimum:{type:["number","string"]},minLength:{type:"integer"},maxLength:{type:"integer"},exclusiveMinimum:{type:["number","string"]},exclusiveMaximum:{type:["number","string"]},maximum:{type:["number","string"]},const:{type:["number","string"]},enum:{type:"array",items:{type:["number","string"]}},not:{type:"object",minProperties:1}},required:["type"],additionalProperties:!1},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},group:{type:"array",items:{type:"string"}},schema:{type:"array",items:{$ref:"#/definitions/schema"}},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id","schema"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"},predicate:{type:"string",enum:["required","preferred"]}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},f={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},i=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$","u"),c=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),x=new RegExp("^di_vc$|^di_vp$|^di$","u"),B=new RegExp("additionalProperties","u");function m(te,{instancePath:ie="",rootData:ye=te}={}){let ue=null,$=0;if(te&&"object"==typeof te&&!Array.isArray(te)){for(const o in te)if(!("vc+sd-jwt"===o||i.test(o)||c.test(o)||x.test(o)||B.test(o))){const h={instancePath:ie,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:o},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:te};null===ue?ue=[h]:ue.push(h),$++}if(void 0!==te["vc+sd-jwt"]){let o=te["vc+sd-jwt"];if(o&&"object"==typeof o&&!Array.isArray(o)){for(const h in o)if("sd-jwt_alg_values"!==h&&"kb-jwt_alg_values"!==h){const A={instancePath:ie+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties",schema:!1,parentSchema:f.properties["vc+sd-jwt"],data:o};null===ue?ue=[A]:ue.push(A),$++}if(void 0!==o["sd-jwt_alg_values"]){let h=o["sd-jwt_alg_values"];if(Array.isArray(h)){if(h.length<1){const C={instancePath:ie+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:f.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:h};null===ue?ue=[C]:ue.push(C),$++}const A=h.length;for(let C=0;C=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[0].properties.count,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.min.type,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.max.type,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.from){let H=te.from;if("string"!=typeof H){const I={instancePath:ie+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[0].properties.from.type,parentSchema:S.oneOf[0].properties.from,data:H};null===ue?ue=[I]:ue.push(I),$++}}}C===$&&(h=!0,A=0);const O=$;if(te&&"object"==typeof te&&!Array.isArray(te)){if(void 0===te.rule){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),$++}if(void 0===te.from_nested){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),$++}for(const H in te)if("name"!==H&&"purpose"!==H&&"rule"!==H&&"count"!==H&&"min"!==H&&"max"!==H&&"from_nested"!==H){const I={instancePath:ie,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:H},message:"must NOT have additional properties",schema:!1,parentSchema:S.oneOf[1],data:te};null===ue?ue=[I]:ue.push(I),$++}if(void 0!==te.name){let H=te.name;if("string"!=typeof H){const I={instancePath:ie+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.name.type,parentSchema:S.oneOf[1].properties.name,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.purpose){let H=te.purpose;if("string"!=typeof H){const I={instancePath:ie+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.purpose.type,parentSchema:S.oneOf[1].properties.purpose,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.rule){let H=te.rule;if("string"!=typeof H){const I={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.rule.type,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[I]:ue.push(I),$++}if("all"!==H&&"pick"!==H){const I={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:S.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:S.oneOf[1].properties.rule.enum,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.count){let H=te.count;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.count.type,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<1||isNaN(H))){const I={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.min.type,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.max.type,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.from_nested){let H=te.from_nested;if(Array.isArray(H)){if(H.length<1){const s={instancePath:ie+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:S.oneOf[1].properties.from_nested,data:H};null===ue?ue=[s]:ue.push(s),$++}const I=H.length;for(let s=0;s{"use strict";Me.exports=C,Me.exports.default=C;const i={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},group:{type:"array",items:{type:"string"}},format:{$ref:"#/definitions/format"},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},name:{type:"string"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},predicate:{type:"string",enum:["required","preferred"]},name:{type:"string"}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},frame:{type:"object",additionalProperties:!0},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},c={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},x=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$","u"),B=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),m=new RegExp("^di_vc$|^di_vp$|^di$","u"),S=new RegExp("additionalProperties","u");function g(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if(O&&"object"==typeof O&&!Array.isArray(O)){for(const ee in O)if(!("vc+sd-jwt"===ee||x.test(ee)||B.test(ee)||m.test(ee)||S.test(ee))){const se={instancePath:z,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ee},message:"must NOT have additional properties",schema:!1,parentSchema:c,data:O};null===p?p=[se]:p.push(se),J++}if(void 0!==O["vc+sd-jwt"]){let ee=O["vc+sd-jwt"];if(ee&&"object"==typeof ee&&!Array.isArray(ee)){for(const se in ee)if("sd-jwt_alg_values"!==se&&"kb-jwt_alg_values"!==se){const de={instancePath:z+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:se},message:"must NOT have additional properties",schema:!1,parentSchema:c.properties["vc+sd-jwt"],data:ee};null===p?p=[de]:p.push(de),J++}if(void 0!==ee["sd-jwt_alg_values"]){let se=ee["sd-jwt_alg_values"];if(Array.isArray(se)){if(se.length<1){const Ae={instancePath:z+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:c.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:se};null===p?p=[Ae]:p.push(Ae),J++}const de=se.length;for(let Ae=0;Ae=",limit:1},message:"must be >= 1",schema:1,parentSchema:_.oneOf[0].properties.count,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[0].properties.min.type,parentSchema:_.oneOf[0].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[0].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[0].properties.max.type,parentSchema:_.oneOf[0].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[0].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.from){let xe=O.from;if("string"!=typeof xe){const Ce={instancePath:z+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[0].properties.from.type,parentSchema:_.oneOf[0].properties.from,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}}Ae===J&&(se=!0,de=0);const Ie=J;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.rule){const xe={instancePath:z,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:_.oneOf[1].required,parentSchema:_.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),J++}if(void 0===O.from_nested){const xe={instancePath:z,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:_.oneOf[1].required,parentSchema:_.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),J++}for(const xe in O)if("name"!==xe&&"purpose"!==xe&&"rule"!==xe&&"count"!==xe&&"min"!==xe&&"max"!==xe&&"from_nested"!==xe){const Ce={instancePath:z,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:_.oneOf[1],data:O};null===p?p=[Ce]:p.push(Ce),J++}if(void 0!==O.name){let xe=O.name;if("string"!=typeof xe){const Ce={instancePath:z+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[1].properties.name.type,parentSchema:_.oneOf[1].properties.name,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.purpose){let xe=O.purpose;if("string"!=typeof xe){const Ce={instancePath:z+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[1].properties.purpose.type,parentSchema:_.oneOf[1].properties.purpose,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.rule){let xe=O.rule;if("string"!=typeof xe){const Ce={instancePath:z+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[1].properties.rule.type,parentSchema:_.oneOf[1].properties.rule,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("all"!==xe&&"pick"!==xe){const Ce={instancePath:z+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:_.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:_.oneOf[1].properties.rule.enum,parentSchema:_.oneOf[1].properties.rule,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.count){let xe=O.count;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[1].properties.count.type,parentSchema:_.oneOf[1].properties.count,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<1||isNaN(xe))){const Ce={instancePath:z+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:_.oneOf[1].properties.count,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[1].properties.min.type,parentSchema:_.oneOf[1].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[1].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[1].properties.max.type,parentSchema:_.oneOf[1].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[1].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.from_nested){let xe=O.from_nested;if(Array.isArray(xe)){if(xe.length<1){const Xe={instancePath:z+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:_.oneOf[1].properties.from_nested,data:xe};null===p?p=[Xe]:p.push(Xe),J++}const Ce=xe.length;for(let Xe=0;Xe=",limit:0},message:"must be >= 0",schema:0,parentSchema:W,data:O};null===p?p=[ee]:p.push(ee),J++}return V.errors=p,0===J}function q(O,{instancePath:z="",parentData:H,parentDataProperty:I,rootData:s=O}={}){let p=null,J=0;return V(O,{instancePath:z,parentData:H,parentDataProperty:I,rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length),q.errors=p,0===J}const ne={type:"array",minItems:1,items:{$ref:"#"}},te={validate:o};function ie(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if(Array.isArray(O)){if(O.length<1){const se={instancePath:z,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:ne,data:O};null===p?p=[se]:p.push(se),J++}const ee=O.length;for(let se=0;se1){const Ae={};for(;se--;){let Ie=O[se];if("string"==typeof Ie){if("number"==typeof Ae[Ie]){de=Ae[Ie];const Le={instancePath:z,schemaPath:"#/uniqueItems",keyword:"uniqueItems",params:{i:se,j:de},message:"must NOT have duplicate items (items ## "+de+" and "+se+" are identical)",schema:!0,parentSchema:ae,data:O};null===p?p=[Le]:p.push(Le),J++;break}Ae[Ie]=se}}}}else{const ee={instancePath:z,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ae.type,parentSchema:ae,data:O};null===p?p=[ee]:p.push(ee),J++}return me.errors=p,0===J}const ye={enum:["array","boolean","integer","null","number","object","string"]};function ue(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if("array"!==O&&"boolean"!==O&&"integer"!==O&&"null"!==O&&"number"!==O&&"object"!==O&&"string"!==O){const ee={instancePath:z,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:ye.enum},message:"must be equal to one of the allowed values",schema:ye.enum,parentSchema:ye,data:O};null===p?p=[ee]:p.push(ee),J++}return ue.errors=p,0===J}const $=f(54195).default;function o(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if((!O||"object"!=typeof O||Array.isArray(O))&&"boolean"!=typeof O){const Ie={instancePath:z,schemaPath:"#/type",keyword:"type",params:{type:K.type},message:"must be object,boolean",schema:K.type,parentSchema:K,data:O};null===p?p=[Ie]:p.push(Ie),J++}if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0!==O.$id){let Ie=O.$id;if("string"!=typeof Ie){const Le={instancePath:z+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$id.type,parentSchema:K.properties.$id,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.$schema){let Ie=O.$schema;if("string"!=typeof Ie){const Le={instancePath:z+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$schema.type,parentSchema:K.properties.$schema,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.$ref){let Ie=O.$ref;if("string"!=typeof Ie){const Le={instancePath:z+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$ref.type,parentSchema:K.properties.$ref,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.$comment){let Ie=O.$comment;if("string"!=typeof Ie){const Le={instancePath:z+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$comment.type,parentSchema:K.properties.$comment,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.title){let Ie=O.title;if("string"!=typeof Ie){const Le={instancePath:z+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.title.type,parentSchema:K.properties.title,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.description){let Ie=O.description;if("string"!=typeof Ie){const Le={instancePath:z+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.description.type,parentSchema:K.properties.description,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.readOnly){let Ie=O.readOnly;if("boolean"!=typeof Ie){const Le={instancePath:z+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:K.properties.readOnly.type,parentSchema:K.properties.readOnly,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.examples){let Ie=O.examples;if(!Array.isArray(Ie)){const Le={instancePath:z+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array",schema:K.properties.examples.type,parentSchema:K.properties.examples,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.multipleOf){let Ie=O.multipleOf;if("number"==typeof Ie){if(Ie<=0||isNaN(Ie)){const Le={instancePath:z+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:K.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),J++}}else{const Le={instancePath:z+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.multipleOf.type,parentSchema:K.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.maximum){let Ie=O.maximum;if("number"!=typeof Ie){const Le={instancePath:z+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.maximum.type,parentSchema:K.properties.maximum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.exclusiveMaximum){let Ie=O.exclusiveMaximum;if("number"!=typeof Ie){const Le={instancePath:z+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.exclusiveMaximum.type,parentSchema:K.properties.exclusiveMaximum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.minimum){let Ie=O.minimum;if("number"!=typeof Ie){const Le={instancePath:z+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.minimum.type,parentSchema:K.properties.minimum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.exclusiveMinimum){let Ie=O.exclusiveMinimum;if("number"!=typeof Ie){const Le={instancePath:z+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.exclusiveMinimum.type,parentSchema:K.properties.exclusiveMinimum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.maxLength&&(V(O.maxLength,{instancePath:z+"/maxLength",parentData:O,parentDataProperty:"maxLength",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length)),void 0!==O.minLength&&(q(O.minLength,{instancePath:z+"/minLength",parentData:O,parentDataProperty:"minLength",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),J=p.length)),void 0!==O.pattern){let Ie=O.pattern;if("string"!=typeof Ie){const Le={instancePath:z+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.pattern.type,parentSchema:K.properties.pattern,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.additionalItems&&(o(O.additionalItems,{instancePath:z+"/additionalItems",parentData:O,parentDataProperty:"additionalItems",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.items){let Ie=O.items;const Le=J;let xe=!1;const Ce=J;o(Ie,{instancePath:z+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);var ee=Ce===J;if(xe=xe||ee,!xe){const Xe=J;ie(Ie,{instancePath:z+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length),ee=Xe===J,xe=xe||ee}if(xe)J=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:z+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:K.properties.items.anyOf,parentSchema:K.properties.items,data:Ie};null===p?p=[Xe]:p.push(Xe),J++}}if(void 0!==O.maxItems&&(V(O.maxItems,{instancePath:z+"/maxItems",parentData:O,parentDataProperty:"maxItems",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length)),void 0!==O.minItems&&(q(O.minItems,{instancePath:z+"/minItems",parentData:O,parentDataProperty:"minItems",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),J=p.length)),void 0!==O.uniqueItems){let Ie=O.uniqueItems;if("boolean"!=typeof Ie){const Le={instancePath:z+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:K.properties.uniqueItems.type,parentSchema:K.properties.uniqueItems,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.contains&&(o(O.contains,{instancePath:z+"/contains",parentData:O,parentDataProperty:"contains",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.maxProperties&&(V(O.maxProperties,{instancePath:z+"/maxProperties",parentData:O,parentDataProperty:"maxProperties",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length)),void 0!==O.minProperties&&(q(O.minProperties,{instancePath:z+"/minProperties",parentData:O,parentDataProperty:"minProperties",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),J=p.length)),void 0!==O.required&&(me(O.required,{instancePath:z+"/required",parentData:O,parentDataProperty:"required",rootData:s})||(p=null===p?me.errors:p.concat(me.errors),J=p.length)),void 0!==O.additionalProperties&&(o(O.additionalProperties,{instancePath:z+"/additionalProperties",parentData:O,parentDataProperty:"additionalProperties",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.definitions){let Ie=O.definitions;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:z+"/definitions/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);else{const Le={instancePath:z+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.definitions.type,parentSchema:K.properties.definitions,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.properties){let Ie=O.properties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:z+"/properties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);else{const Le={instancePath:z+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.properties.type,parentSchema:K.properties.properties,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.patternProperties){let Ie=O.patternProperties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie)){for(const Le in Ie)if(J!=J){const Ce={instancePath:z+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:Le},message:"property name must be valid",schema:K.properties.patternProperties.propertyNames,parentSchema:K.properties.patternProperties,data:Ie};null===p?p=[Ce]:p.push(Ce),J++}for(const Le in Ie)o(Ie[Le],{instancePath:z+"/patternProperties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)}else{const Le={instancePath:z+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.patternProperties.type,parentSchema:K.properties.patternProperties,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.dependencies){let Ie=O.dependencies;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie){let xe=Ie[Le];const Ce=J;let Xe=!1;const Te=J;o(xe,{instancePath:z+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);var de=Te===J;if(Xe=Xe||de,!Xe){const ke=J;me(xe,{instancePath:z+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?me.errors:p.concat(me.errors),J=p.length),de=ke===J,Xe=Xe||de}if(Xe)J=Ce,null!==p&&(Ce?p.length=Ce:p=null);else{const ke={instancePath:z+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:K.properties.dependencies.additionalProperties.anyOf,parentSchema:K.properties.dependencies.additionalProperties,data:xe};null===p?p=[ke]:p.push(ke),J++}}else{const Le={instancePath:z+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.dependencies.type,parentSchema:K.properties.dependencies,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.propertyNames&&(o(O.propertyNames,{instancePath:z+"/propertyNames",parentData:O,parentDataProperty:"propertyNames",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.enum){let Ie=O.enum;if(Array.isArray(Ie)){if(Ie.length<1){const Ce={instancePath:z+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:K.properties.enum,data:Ie};null===p?p=[Ce]:p.push(Ce),J++}let xe,Le=Ie.length;if(Le>1)e:for(;Le--;)for(xe=Le;xe--;)if($(Ie[Le],Ie[xe])){const Ce={instancePath:z+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:Le,j:xe},message:"must NOT have duplicate items (items ## "+xe+" and "+Le+" are identical)",schema:!0,parentSchema:K.properties.enum,data:Ie};null===p?p=[Ce]:p.push(Ce),J++;break e}}else{const Le={instancePath:z+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array",schema:K.properties.enum.type,parentSchema:K.properties.enum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.type){let Ie=O.type;const Le=J;let xe=!1;const Ce=J;ue(Ie,{instancePath:z+"/type",parentData:O,parentDataProperty:"type",rootData:s})||(p=null===p?ue.errors:p.concat(ue.errors),J=p.length);var Ae=Ce===J;if(xe=xe||Ae,!xe){const Xe=J;if(Array.isArray(Ie)){if(Ie.length<1){const ve={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:K.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),J++}const ke=Ie.length;for(let ve=0;ve1)e:for(;Se--;)for(Ee=Se;Ee--;)if($(Ie[Se],Ie[Ee])){const ve={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:Se,j:Ee},message:"must NOT have duplicate items (items ## "+Ee+" and "+Se+" are identical)",schema:!0,parentSchema:K.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),J++;break e}}else{const ke={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:K.properties.type.anyOf[1].type,parentSchema:K.properties.type.anyOf[1],data:Ie};null===p?p=[ke]:p.push(ke),J++}Ae=Xe===J,xe=xe||Ae}if(xe)J=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:K.properties.type.anyOf,parentSchema:K.properties.type,data:Ie};null===p?p=[Xe]:p.push(Xe),J++}}if(void 0!==O.format){let Ie=O.format;if("string"!=typeof Ie){const Le={instancePath:z+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.format.type,parentSchema:K.properties.format,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.contentMediaType){let Ie=O.contentMediaType;if("string"!=typeof Ie){const Le={instancePath:z+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.contentMediaType.type,parentSchema:K.properties.contentMediaType,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.contentEncoding){let Ie=O.contentEncoding;if("string"!=typeof Ie){const Le={instancePath:z+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.contentEncoding.type,parentSchema:K.properties.contentEncoding,data:Ie};null===p?p=[Le]:p.push(Le),J++}}void 0!==O.if&&(o(O.if,{instancePath:z+"/if",parentData:O,parentDataProperty:"if",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.then&&(o(O.then,{instancePath:z+"/then",parentData:O,parentDataProperty:"then",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.else&&(o(O.else,{instancePath:z+"/else",parentData:O,parentDataProperty:"else",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.allOf&&(ie(O.allOf,{instancePath:z+"/allOf",parentData:O,parentDataProperty:"allOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length)),void 0!==O.anyOf&&(ie(O.anyOf,{instancePath:z+"/anyOf",parentData:O,parentDataProperty:"anyOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length)),void 0!==O.oneOf&&(ie(O.oneOf,{instancePath:z+"/oneOf",parentData:O,parentDataProperty:"oneOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length)),void 0!==O.not&&(o(O.not,{instancePath:z+"/not",parentData:O,parentDataProperty:"not",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length))}return o.errors=p,0===J}function h(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if(!O||"object"!=typeof O||Array.isArray(O)){const xe={instancePath:z,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:k.type,parentSchema:k,data:O};null===p?p=[xe]:p.push(xe),J++}const ee=J;let se=!1,de=null;const Ae=J;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.path){const xe={instancePath:z,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"path"},message:"must have required property 'path'",schema:k.oneOf[0].required,parentSchema:k.oneOf[0],data:O};null===p?p=[xe]:p.push(xe),J++}for(const xe in O)if("id"!==xe&&"path"!==xe&&"purpose"!==xe&&"intent_to_retain"!==xe&&"filter"!==xe&&"name"!==xe){const Ce={instancePath:z,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:k.oneOf[0],data:O};null===p?p=[Ce]:p.push(Ce),J++}if(void 0!==O.id){let xe=O.id;if("string"!=typeof xe){const Ce={instancePath:z+"/id",schemaPath:"#/oneOf/0/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:k.oneOf[0].properties.id.type,parentSchema:k.oneOf[0].properties.id,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.path){let xe=O.path;if(Array.isArray(xe)){const Ce=xe.length;for(let Xe=0;Xe{"use strict";function f(me,ye){return{validate:me,compare:ye}}Object.defineProperty(F,"__esModule",{value:!0}),F.formatNames=F.fastFormats=F.fullFormats=void 0,F.fullFormats={date:f(B,m),time:f(g,_),"date-time":f(function T(me){const ye=me.split(R);return 2===ye.length&&B(ye[0])&&g(ye[1],!0)},E),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function k(me){return j.test(me)&&M.test(me)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function ae(me){if(ie.test(me))return!1;try{return new RegExp(me),!0}catch{return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function W(me){return K.lastIndex=0,K.test(me)},int32:{type:"number",validate:function q(me){return Number.isInteger(me)&&me<=Z&&me>=V}},int64:{type:"number",validate:function ne(me){return Number.isInteger(me)}},float:{type:"number",validate:te},double:{type:"number",validate:te},password:!0,binary:!0},F.fastFormats={...F.fullFormats,date:f(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,m),time:f(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"date-time":f(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,E),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},F.formatNames=Object.keys(F.fullFormats);const c=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,x=[0,31,28,31,30,31,30,31,31,30,31,30,31];function B(me){const ye=c.exec(me);if(!ye)return!1;const $=+ye[2],o=+ye[3];return $>=1&&$<=12&&o>=1&&o<=(2===$&&function i(me){return me%4==0&&(me%100!=0||me%400==0)}(+ye[1])?29:x[$])}function m(me,ye){if(me&&ye)return me>ye?1:me(ye=$[1]+$[2]+$[3]+($[4]||""))?1:me{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(3993),c=f(10122),x=f(85432),B=new x.Name("fullFormats"),m=new x.Name("fastFormats"),S=(_,R={keywords:!0})=>{if(Array.isArray(R))return g(_,R,i.fullFormats,B),_;const[T,E]="fast"===R.mode?[i.fastFormats,m]:[i.fullFormats,B];return g(_,R.formats||i.formatNames,T,E),R.keywords&&c.default(_),_};function g(_,R,T,E){var j,M;null!==(j=(M=_.opts.code).formats)&&void 0!==j||(M.formats=x._`require("ajv-formats/dist/formats").${E}`);for(const k of R)_.addFormat(k,T[k])}S.get=(_,R="full")=>{const E=("fast"===R?i.fastFormats:i.fullFormats)[_];if(!E)throw new Error(`Unknown format "${_}"`);return E},Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S},10122:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.formatLimitDefinition=void 0;const i=f(39208),c=f(85432),x=c.operators,B={formatMaximum:{okStr:"<=",ok:x.LTE,fail:x.GT},formatMinimum:{okStr:">=",ok:x.GTE,fail:x.LT},formatExclusiveMaximum:{okStr:"<",ok:x.LT,fail:x.GTE},formatExclusiveMinimum:{okStr:">",ok:x.GT,fail:x.LTE}},m={message:({keyword:g,schemaCode:_})=>c.str`should be ${B[g].okStr} ${_}`,params:({keyword:g,schemaCode:_})=>c._`{comparison: ${B[g].okStr}, limit: ${_}}`};F.formatLimitDefinition={keyword:Object.keys(B),type:"string",schemaType:"string",$data:!0,error:m,code(g){const{gen:_,data:R,schemaCode:T,keyword:E,it:j}=g,{opts:M,self:k}=j;if(!M.validateFormats)return;const K=new i.KeywordCxt(j,k.RULES.all.format.definition,"format");function Z(q){return c._`${q}.compare(${R}, ${T}) ${B[E].fail} 0`}K.$data?function W(){const q=_.scopeValue("formats",{ref:k.formats,code:M.code.formats}),ne=_.const("fmt",c._`${q}[${K.schemaCode}]`);g.fail$data(c.or(c._`typeof ${ne} != "object"`,c._`${ne} instanceof RegExp`,c._`typeof ${ne}.compare != "function"`,Z(ne)))}():function V(){const q=K.schema,ne=k.formats[q];if(!ne||!0===ne)return;if("object"!=typeof ne||ne instanceof RegExp||"function"!=typeof ne.compare)throw new Error(`"${E}": format "${q}" does not define "compare" function`);const te=_.scopeValue("formats",{key:q,ref:ne,code:M.code.formats?c._`${M.code.formats}${c.getProperty(q)}`:void 0});g.fail$data(Z(te))}()},dependencies:["format"]},F.default=g=>(g.addKeyword(F.formatLimitDefinition),g)},11151:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(76533),F),c(f(59433),F),c(f(54065),F)},51236:function(Me,F,f){"use strict";var i=this&&this.__rest||function(g,_){var R={};for(var T in g)Object.prototype.hasOwnProperty.call(g,T)&&_.indexOf(T)<0&&(R[T]=g[T]);if(null!=g&&"function"==typeof Object.getOwnPropertySymbols){var E=0;for(T=Object.getOwnPropertySymbols(g);ES.toWrappedVerifiableCredential(T,R))}static toWrappedVerifiableCredential(_,R){var T;if(S.isSdJwtDecodedCredential(_)||S.isSdJwtEncoded(_)){let q;if(S.isSdJwtEncoded(_)){if(!R?.hasher)throw new Error("Hasher implementation is required to decode SD-JWT");q=(0,B.decodeSdJwtVc)(_,R.hasher)}else q=_;return{type:S.isSdJwtDecodedCredential(_)?B.OriginalType.SD_JWT_VC_DECODED:B.OriginalType.SD_JWT_VC_ENCODED,format:"vc+sd-jwt",original:_,credential:q,decoded:q.decodedPayload}}const E=S.getFirstProof(_),j=S.hasJWTProofType(_)&&E&&null!==(T=E.jwt)&&void 0!==T?T:_;if(!j)throw Error("Could not determine original credential, probably it was a converted JWT credential, that is now missing the JWT value in the proof");const M=S.decodeVerifiableCredential(j),k=S.isJwtEncoded(j),K=S.isJwtDecodedCredential(j);return{original:j,decoded:M,format:k||K?"jwt_vc":"ldp_vc",type:k?B.OriginalType.JWT_ENCODED:K?B.OriginalType.JWT_DECODED:B.OriginalType.JSONLD,credential:k||K?S.jwtDecodedCredentialToUniformCredential(M,R):M}}static isJwtEncoded(_){return m.ObjectUtils.isString(_)&&_.startsWith("ey")&&!_.includes("~")}static isSdJwtEncoded(_){return m.ObjectUtils.isString(_)&&_.startsWith("ey")&&_.includes("~")}static isW3cCredential(_){var R;return"@context"in _&&((null===(R=_.type)||void 0===R?void 0:R.includes("VerifiableCredential"))||!1)}static isCredential(_){try{if(S.isJwtEncoded(_)){const R=S.toUniformCredential(_);return S.isW3cCredential(R)}return!!S.isSdJwtEncoded(_)||S.isW3cCredential(_)||S.isSdJwtDecodedCredentialPayload(_)||S.isJwtDecodedCredential(_)||S.isSdJwtDecodedCredential(_)}catch{return!1}}static isPresentation(_){try{if(S.isJwtEncoded(_)){const R=S.toUniformPresentation(_);return S.isW3cPresentation(R)}return!S.isSdJwtEncoded(_)&&(S.isW3cPresentation(_)||S.isSdJwtDecodedCredentialPayload(_)||S.isJwtDecodedPresentation(_)||S.isSdJwtDecodedCredential(_))}catch{return!1}}static hasProof(_){try{return!!(S.isJwtEncoded(_)||S.isJwtDecodedCredential(_)||S.isSdJwtEncoded(_)||S.isSdJwtDecodedCredential(_)||"vc"in _&&_.vc.proof||"vp"in _&&_.vp.proof)||!!_.proof}catch{return!1}}static isW3cPresentation(_){var R;return"@context"in _&&((null===(R=_.type)||void 0===R?void 0:R.includes("VerifiablePresentation"))||!1)}static isSdJwtDecodedCredentialPayload(_){return"vct"in _}static areOriginalVerifiableCredentialsEqual(_,R){return"string"==typeof _||"string"==typeof R?_===R:S.isSdJwtDecodedCredential(_)||S.isSdJwtDecodedCredential(R)?_.compactSdJwtVc===R.compactSdJwtVc:JSON.stringify(R.proof)===JSON.stringify(_.proof)}static isJsonLdAsString(_){return m.ObjectUtils.isString(_)&&_.includes("@context")}static isSdJwtDecodedCredential(_){return void 0!==_.compactSdJwtVc}static isJwtDecodedCredential(_){return void 0!==_.vc&&void 0!==_.iss}static isJwtDecodedPresentation(_){return void 0!==_.vp&&void 0!==_.iss}static jwtEncodedPresentationToUniformPresentation(_,R=!0,T){return S.jwtDecodedPresentationToUniformPresentation((0,x.default)(_),R,T)}static jwtDecodedPresentationToUniformPresentation(_,R=!0,T){const{iss:E,aud:j,jti:M,vp:k}=_,K=i(_,["iss","aud","jti","vp"]),W=Object.assign(Object.assign({},K),k);if(R){if(!k.verifiableCredential)throw Error("Verifiable Presentation should have a verifiable credential at this point");W.verifiableCredential=k.verifiableCredential.map(V=>S.toUniformCredential(V,T))}if(E){const V=W.holder;if(V&&V!==E)throw new Error(`Inconsistent holders between JWT claim (${E}) and VC value (${V})`);W.holder=E}if(j){const V=W.verifier;if(V&&V!==j)throw new Error(`Inconsistent holders between JWT claim (${j}) and VC value (${V})`);W.verifier=j}if(M){const V=W.id;if(V&&V!==M)throw new Error(`Inconsistent VP ids between JWT claim (${M}) and VP value (${V})`);W.id=M}return W}static toUniformCredential(_,R){var T;if(S.isSdJwtDecodedCredential(_))throw new Error("Converting SD-JWT VC to uniform VC is not supported.");const E="string"!=typeof _&&S.hasJWTProofType(_)?null===(T=S.getFirstProof(_))||void 0===T?void 0:T.jwt:_;if(!E)throw Error("Could not determine original credential from passed in credential. Probably because a JWT proof type was present, but now is not available anymore");const j=S.decodeVerifiableCredential(E),M=S.isJwtEncoded(E);return S.isJwtDecodedCredential(E)||M?S.jwtDecodedCredentialToUniformCredential(j,R):j}static toUniformPresentation(_,R){var T;if(S.isSdJwtDecodedCredential(_))throw new Error("Converting SD-JWT VC to uniform VP is not supported.");const E=S.getFirstProof(_),j="string"!=typeof _&&S.hasJWTProofType(_)?E?.jwt:_;if(!j)throw Error("Could not determine original presentation, probably it was a converted JWT presentation, that is now missing the JWT value in the proof");const M=S.decodeVerifiablePresentation(j),k=S.isJwtEncoded(j),K=S.isJwtDecodedPresentation(j),W=k||K?S.jwtDecodedPresentationToUniformPresentation(M,!1):M;return R?.addContextIfMissing&&!W["@context"]&&(W["@context"]=["https://www.w3.org/2018/credentials/v1"]),W.verifiableCredential=null===(T=W.verifiableCredential)||void 0===T?void 0:T.map(V=>S.toUniformCredential(V,R)),W}static jwtEncodedCredentialToUniformCredential(_,R){return S.jwtDecodedCredentialToUniformCredential((0,x.default)(_),R)}static jwtDecodedCredentialToUniformCredential(_,R){var T;const{exp:E,nbf:j,iss:M,vc:k,sub:K,jti:W}=_,V=i(_,["exp","nbf","iss","vc","sub","jti"]),Z=Object.assign(Object.assign({},V),k),q=null!==(T=R?.maxTimeSkewInMS)&&void 0!==T?T:1500;if(E){const ne=Z.expirationDate,te=parseInt(E.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(ne&&ne!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(ne).getTime());if(!q||ae>q)throw new Error(`Inconsistent expiration dates between JWT claim (${ie}) and VC value (${ne})`)}Z.expirationDate=ie}if(j){const ne=Z.issuanceDate,te=parseInt(j.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(ne&&ne!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(ne).getTime());if(!q||ae>q)throw new Error(`Inconsistent issuance dates between JWT claim (${ie}) and VC value (${ne})`)}Z.issuanceDate=ie}if(M){const ne=Z.issuer;if(ne){if("string"==typeof ne){if(ne!==M)throw new Error(`Inconsistent issuers between JWT claim (${M}) and VC value (${ne})`)}else if(!ne.id&&Object.keys(ne).length>0&&(ne.id=M),ne.id!==M)throw new Error(`Inconsistent issuers between JWT claim (${M}) and VC value (${ne.id})`)}else Z.issuer=M}if(K){const ne=Array.isArray(Z.credentialSubject)?Z.credentialSubject:[Z.credentialSubject];for(let te=0;te{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapLanguageValues=F.mapLanguageValue=F.toLanguageValueObjects=F.toLanguageValueObject=F.isLanguageValueObjects=F.isLanguageValueObject=void 0;const i=f(59433);F.isLanguageValueObject=_=>!(!_||!i.ObjectUtils.isObject(_)||Array.isArray(_)||2!==Object.keys(_).length||!("language"in _)||!_.language||!("value"in _)||!_.value),F.isLanguageValueObjects=_=>!(!_||!Array.isArray(_))&&_.every(R=>(0,F.isLanguageValueObject)(R)),F.toLanguageValueObject=_=>(0,F.isLanguageValueObject)(_)?_:void 0,F.toLanguageValueObjects=_=>(0,F.isLanguageValueObject)(_)?i.ObjectUtils.asArray((0,F.toLanguageValueObject)(_)):(0,F.isLanguageValueObjects)(_)?_:void 0,F.mapLanguageValue=(_,R)=>{const T=(0,F.toLanguageValueObjects)(_);if(Array.isArray(T)){if(0===T.length)return _;const E=T.filter(M=>!R?.language||M.language.toLowerCase().includes(R.language.toLowerCase()));let j;if(E.length>0)j=E[0];else{if(!1===R?.fallbackToFirstObject)return _;j=T[0]}return j.value}return _},F.mapLanguageValues=(_,R)=>{const T=R?.noDeepClone?_:JSON.parse(JSON.stringify(_));return Object.keys(_).forEach(E=>{T[E]=(0,F.mapLanguageValue)(T[E],R),(i.ObjectUtils.isObject(T[E])||Array.isArray(T[E]))&&(T[E]=(0,F.mapLanguageValues)(T[E],Object.assign(Object.assign({},R),{noDeepClone:!0})))}),T}},40528:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.parseDid=F.IProofType=F.IProofPurpose=void 0;var f=function(B){return B.verificationMethod="verificationMethod",B.assertionMethod="assertionMethod",B.authentication="authentication",B.keyAgreement="keyAgreement",B.contractAgreement="contactAgreement",B.capabilityInvocation="capabilityInvocation",B.capabilityDelegation="capabilityDelegation",B}(f||(F.IProofPurpose=f={})),i=function(B){return B.Ed25519Signature2018="Ed25519Signature2018",B.Ed25519Signature2020="Ed25519Signature2020",B.EcdsaSecp256k1Signature2019="EcdsaSecp256k1Signature2019",B.EcdsaSecp256k1RecoverySignature2020="EcdsaSecp256k1RecoverySignature2020",B.JsonWebSignature2020="JsonWebSignature2020",B.RsaSignature2018="RsaSignature2018",B.GpgSignature2020="GpgSignature2020",B.JcsEd25519Signature2020="JcsEd25519Signature2020",B.BbsBlsSignatureProof2020="BbsBlsSignatureProof2020",B.BbsBlsBoundSignatureProof2020="BbsBlsBoundSignatureProof2020",B.JwtProof2020="JwtProof2020",B}(i||(F.IProofType=i={}));F.parseDid=B=>{const m=x(B);if(null===m)throw new Error("invalid did");return m};const x=B=>{const S="(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))",R="[a-zA-Z0-9_.:%-]",K=new RegExp(`^did:([a-z0-9]+):((?:${S}*:)*(${S}+))((;${R}+=${R}*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$`);if(""===B||!B)return null;const W=B.match(K);if(W){const V={did:`did:${W[1]}:${W[2]}`,method:W[1],id:W[2],didUrl:B};if(W[4]){const Z=W[4].slice(1).split(";");V.params={};for(const q of Z){const ne=q.split("=");V.params[ne[0]]=ne[1]}}return W[6]&&(V.path=W[6]),W[7]&&(V.query=W[7].slice(1)),W[8]&&(V.fragment=W[8].slice(1)),V}return null}},5940:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},76533:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(40528),F),c(f(30988),F),c(f(69922),F),c(f(5940),F),c(f(86548),F),c(f(66996),F)},30988:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},86548:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(g,_,R,T){return new(R||(R=Promise))(function(j,M){function k(V){try{W(T.next(V))}catch(Z){M(Z)}}function K(V){try{W(T.throw(V))}catch(Z){M(Z)}}function W(V){V.done?j(V.value):function E(j){return j instanceof R?j:new R(function(M){M(j)})}(V.value).then(k,K)}W((T=T.apply(g,_||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.decodeSdJwtVcAsync=F.decodeSdJwtVc=F.isWrappedSdJwtVerifiablePresentation=F.isWrappedSdJwtVerifiableCredential=void 0;const c=f(15315);F.isWrappedSdJwtVerifiableCredential=function x(g){return"vc+sd-jwt"===g.format},F.isWrappedSdJwtVerifiablePresentation=function B(g){return"vc+sd-jwt"===g.format},F.decodeSdJwtVc=function m(g,_){const{jwt:R,disclosures:T}=(0,c.decodeSdJwtSync)(g,_),E=R.payload;return{compactSdJwtVc:g,decodedPayload:(0,c.getClaimsSync)(E,T,_),disclosures:T.map(M=>{const k=M.key?[M.salt,M.key,M.value]:[M.salt,M.value];if(!M._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:M._digest,encoded:M.encode()}}),signedPayload:E}},F.decodeSdJwtVcAsync=function S(g,_){return i(this,void 0,void 0,function*(){const{jwt:R,disclosures:T}=yield(0,c.decodeSdJwt)(g,_),E=R.payload,j=yield(0,c.getClaims)(E,T,_);return{compactSdJwtVc:g,decodedPayload:j,disclosures:T.map(M=>{const k=M.key?[M.salt,M.key,M.value]:[M.salt,M.value];if(!M._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:M._digest,encoded:M.encode()}}),signedPayload:E}})}},69922:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.DocumentFormat=F.OriginalType=void 0;var f=function(c){return c.JSONLD="json-ld",c.JWT_ENCODED="jwt-encoded",c.JWT_DECODED="jwt-decoded",c.SD_JWT_VC_ENCODED="sd-jwt-vc-encoded",c.SD_JWT_VC_DECODED="sd-jwt-vc-decoded",c}(f||(F.OriginalType=f={})),i=function(c){return c[c.JWT=0]="JWT",c[c.JSONLD=1]="JSONLD",c[c.SD_JWT_VC=2]="SD_JWT_VC",c[c.EIP712=3]="EIP712",c}(i||(F.DocumentFormat=i={}))},66996:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.isWrappedW3CVerifiablePresentation=F.isWrappedW3CVerifiableCredential=F.StatusListDriverType=F.StatusListCredentialIdMode=F.StatusListType=F.JWT_PROOF_TYPE_2020=void 0,F.JWT_PROOF_TYPE_2020="JwtProof2020";var f=function(m){return m.StatusList2021="StatusList2021",m}(f||(F.StatusListType=f={})),i=function(m){return m.ISSUANCE="ISSUANCE",m.PERSISTENCE="PERSISTENCE",m.NEVER="NEVER",m}(i||(F.StatusListCredentialIdMode=i={})),c=function(m){return m.AGENT_TYPEORM="agent_typeorm",m.AGENT_KV_STORE="agent_kv_store",m.GITHUB="github",m.AGENT_FILESYSTEM="agent_filesystem",m}(c||(F.StatusListDriverType=c={}));F.isWrappedW3CVerifiableCredential=function x(m){return"jwt_vc"===m.format||"ldp_vc"===m.format},F.isWrappedW3CVerifiablePresentation=function B(m){return"jwt_vp"===m.format||"ldp_vp"===m.format}},59433:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(24418),F)},24418:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(c){return Array.isArray(c)?c:[c]}static isObject(c){return"object"==typeof c||"[object Object]"===Object.prototype.toString.call(c)}static isUrlAbsolute(c){f.isString(c)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(c)}static isString(c){return"string"==typeof c||"[object String]"===Object.prototype.toString.call(c)}}F.ObjectUtils=f},20844:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.MissingRefError=F.ValidationError=F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;const i=f(35419),c=f(98496),x=f(86980),B=f(87577),m="https://json-schema.org/draft/2020-12/schema";class S extends i.default{constructor(j={}){super({...j,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),c.default.forEach(j=>this.addVocabulary(j)),this.opts.discriminator&&this.addKeyword(x.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:j,meta:M}=this.opts;M&&(B.default.call(this,j),this.refs["http://json-schema.org/schema"]=m)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(m)?m:void 0)}}Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S;var g=f(40339);Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var _=f(1038);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(F,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var R=f(42467);Object.defineProperty(F,"ValidationError",{enumerable:!0,get:function(){return R.default}});var T=f(26288);Object.defineProperty(F,"MissingRefError",{enumerable:!0,get:function(){return T.default}})},33337:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.regexpCode=F.getEsmExportName=F.getProperty=F.safeStringify=F.stringify=F.strConcat=F.addCodeArg=F.str=F._=F.nil=F._Code=F.Name=F.IDENTIFIER=F._CodeOrName=void 0;class f{}F._CodeOrName=f,F.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends f{constructor(V){if(super(),!F.IDENTIFIER.test(V))throw new Error("CodeGen: name must be a valid identifier");this.str=V}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}F.Name=i;class c extends f{constructor(V){super(),this._items="string"==typeof V?[V]:V}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const V=this._items[0];return""===V||'""'===V}get str(){var V;return null!==(V=this._str)&&void 0!==V?V:this._str=this._items.reduce((Z,q)=>`${Z}${q}`,"")}get names(){var V;return null!==(V=this._names)&&void 0!==V?V:this._names=this._items.reduce((Z,q)=>(q instanceof i&&(Z[q.str]=(Z[q.str]||0)+1),Z),{})}}function x(W,...V){const Z=[W[0]];let q=0;for(;q{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.or=F.and=F.not=F.CodeGen=F.operators=F.varKinds=F.ValueScopeName=F.ValueScope=F.Scope=F.Name=F.regexpCode=F.stringify=F.getProperty=F.nil=F.strConcat=F.str=F._=void 0;const i=f(33337),c=f(85934);var x=f(33337);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return x._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return x.str}}),Object.defineProperty(F,"strConcat",{enumerable:!0,get:function(){return x.strConcat}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return x.nil}}),Object.defineProperty(F,"getProperty",{enumerable:!0,get:function(){return x.getProperty}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return x.stringify}}),Object.defineProperty(F,"regexpCode",{enumerable:!0,get:function(){return x.regexpCode}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return x.Name}});var B=f(85934);Object.defineProperty(F,"Scope",{enumerable:!0,get:function(){return B.Scope}}),Object.defineProperty(F,"ValueScope",{enumerable:!0,get:function(){return B.ValueScope}}),Object.defineProperty(F,"ValueScopeName",{enumerable:!0,get:function(){return B.ValueScopeName}}),Object.defineProperty(F,"varKinds",{enumerable:!0,get:function(){return B.varKinds}}),F.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class m{optimizeNodes(){return this}optimizeNames(se,de){return this}}class S extends m{constructor(se,de,Ae){super(),this.varKind=se,this.name=de,this.rhs=Ae}render({es5:se,_n:de}){return`${se?c.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+de}optimizeNames(se,de){if(se[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,se,de)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class g extends m{constructor(se,de,Ae){super(),this.lhs=se,this.rhs=de,this.sideEffects=Ae}render({_n:se}){return`${this.lhs} = ${this.rhs};`+se}optimizeNames(se,de){if(!(this.lhs instanceof i.Name)||se[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,se,de),this}get names(){return h(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class _ extends g{constructor(se,de,Ae,Ie){super(se,Ae,Ie),this.op=de}render({_n:se}){return`${this.lhs} ${this.op}= ${this.rhs};`+se}}class R extends m{constructor(se){super(),this.label=se,this.names={}}render({_n:se}){return`${this.label}:`+se}}class T extends m{constructor(se){super(),this.label=se,this.names={}}render({_n:se}){return`break${this.label?` ${this.label}`:""};`+se}}class E extends m{constructor(se){super(),this.error=se}render({_n:se}){return`throw ${this.error};`+se}get names(){return this.error.names}}class j extends m{constructor(se){super(),this.code=se}render({_n:se}){return`${this.code};`+se}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(se,de){return this.code=A(this.code,se,de),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class M extends m{constructor(se=[]){super(),this.nodes=se}render(se){return this.nodes.reduce((de,Ae)=>de+Ae.render(se),"")}optimizeNodes(){const{nodes:se}=this;let de=se.length;for(;de--;){const Ae=se[de].optimizeNodes();Array.isArray(Ae)?se.splice(de,1,...Ae):Ae?se[de]=Ae:se.splice(de,1)}return se.length>0?this:void 0}optimizeNames(se,de){const{nodes:Ae}=this;let Ie=Ae.length;for(;Ie--;){const Le=Ae[Ie];Le.optimizeNames(se,de)||(C(se,Le.names),Ae.splice(Ie,1))}return Ae.length>0?this:void 0}get names(){return this.nodes.reduce((se,de)=>o(se,de.names),{})}}class k extends M{render(se){return"{"+se._n+super.render(se)+"}"+se._n}}class K extends M{}let W=(()=>{class ee extends k{}return ee.kind="else",ee})(),V=(()=>{class ee extends k{constructor(de,Ae){super(Ae),this.condition=de}render(de){let Ae=`if(${this.condition})`+super.render(de);return this.else&&(Ae+="else "+this.else.render(de)),Ae}optimizeNodes(){super.optimizeNodes();const de=this.condition;if(!0===de)return this.nodes;let Ae=this.else;if(Ae){const Ie=Ae.optimizeNodes();Ae=this.else=Array.isArray(Ie)?new W(Ie):Ie}return Ae?!1===de?Ae instanceof ee?Ae:Ae.nodes:this.nodes.length?this:new ee(O(de),Ae instanceof ee?[Ae]:Ae.nodes):!1!==de&&this.nodes.length?this:void 0}optimizeNames(de,Ae){var Ie;if(this.else=null===(Ie=this.else)||void 0===Ie?void 0:Ie.optimizeNames(de,Ae),super.optimizeNames(de,Ae)||this.else)return this.condition=A(this.condition,de,Ae),this}get names(){const de=super.names;return h(de,this.condition),this.else&&o(de,this.else.names),de}}return ee.kind="if",ee})(),Z=(()=>{class ee extends k{}return ee.kind="for",ee})();class q extends Z{constructor(se){super(),this.iteration=se}render(se){return`for(${this.iteration})`+super.render(se)}optimizeNames(se,de){if(super.optimizeNames(se,de))return this.iteration=A(this.iteration,se,de),this}get names(){return o(super.names,this.iteration.names)}}class ne extends Z{constructor(se,de,Ae,Ie){super(),this.varKind=se,this.name=de,this.from=Ae,this.to=Ie}render(se){const de=se.es5?c.varKinds.var:this.varKind,{name:Ae,from:Ie,to:Le}=this;return`for(${de} ${Ae}=${Ie}; ${Ae}<${Le}; ${Ae}++)`+super.render(se)}get names(){const se=h(super.names,this.from);return h(se,this.to)}}class te extends Z{constructor(se,de,Ae,Ie){super(),this.loop=se,this.varKind=de,this.name=Ae,this.iterable=Ie}render(se){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(se)}optimizeNames(se,de){if(super.optimizeNames(se,de))return this.iterable=A(this.iterable,se,de),this}get names(){return o(super.names,this.iterable.names)}}let ie=(()=>{class ee extends k{constructor(de,Ae,Ie){super(),this.name=de,this.args=Ae,this.async=Ie}render(de){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(de)}}return ee.kind="func",ee})(),ae=(()=>{class ee extends M{render(de){return"return "+super.render(de)}}return ee.kind="return",ee})();class me extends k{render(se){let de="try"+super.render(se);return this.catch&&(de+=this.catch.render(se)),this.finally&&(de+=this.finally.render(se)),de}optimizeNodes(){var se,de;return super.optimizeNodes(),null===(se=this.catch)||void 0===se||se.optimizeNodes(),null===(de=this.finally)||void 0===de||de.optimizeNodes(),this}optimizeNames(se,de){var Ae,Ie;return super.optimizeNames(se,de),null===(Ae=this.catch)||void 0===Ae||Ae.optimizeNames(se,de),null===(Ie=this.finally)||void 0===Ie||Ie.optimizeNames(se,de),this}get names(){const se=super.names;return this.catch&&o(se,this.catch.names),this.finally&&o(se,this.finally.names),se}}let ye=(()=>{class ee extends k{constructor(de){super(),this.error=de}render(de){return`catch(${this.error})`+super.render(de)}}return ee.kind="catch",ee})(),ue=(()=>{class ee extends k{render(de){return"finally"+super.render(de)}}return ee.kind="finally",ee})();function o(ee,se){for(const de in se)ee[de]=(ee[de]||0)+(se[de]||0);return ee}function h(ee,se){return se instanceof i._CodeOrName?o(ee,se.names):ee}function A(ee,se,de){return ee instanceof i.Name?Ae(ee):function Ie(Le){return Le instanceof i._Code&&Le._items.some(xe=>xe instanceof i.Name&&1===se[xe.str]&&void 0!==de[xe.str])}(ee)?new i._Code(ee._items.reduce((Le,xe)=>(xe instanceof i.Name&&(xe=Ae(xe)),xe instanceof i._Code?Le.push(...xe._items):Le.push(xe),Le),[])):ee;function Ae(Le){const xe=de[Le.str];return void 0===xe||1!==se[Le.str]?Le:(delete se[Le.str],xe)}}function C(ee,se){for(const de in se)ee[de]=(ee[de]||0)-(se[de]||0)}function O(ee){return"boolean"==typeof ee||"number"==typeof ee||null===ee?!ee:i._`!${J(ee)}`}F.CodeGen=class ${constructor(se,de={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...de,_n:de.lines?"\n":""},this._extScope=se,this._scope=new c.Scope({parent:se}),this._nodes=[new K]}toString(){return this._root.render(this.opts)}name(se){return this._scope.name(se)}scopeName(se){return this._extScope.name(se)}scopeValue(se,de){const Ae=this._extScope.value(se,de);return(this._values[Ae.prefix]||(this._values[Ae.prefix]=new Set)).add(Ae),Ae}getScopeValue(se,de){return this._extScope.getValue(se,de)}scopeRefs(se){return this._extScope.scopeRefs(se,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(se,de,Ae,Ie){const Le=this._scope.toName(de);return void 0!==Ae&&Ie&&(this._constants[Le.str]=Ae),this._leafNode(new S(se,Le,Ae)),Le}const(se,de,Ae){return this._def(c.varKinds.const,se,de,Ae)}let(se,de,Ae){return this._def(c.varKinds.let,se,de,Ae)}var(se,de,Ae){return this._def(c.varKinds.var,se,de,Ae)}assign(se,de,Ae){return this._leafNode(new g(se,de,Ae))}add(se,de){return this._leafNode(new _(se,F.operators.ADD,de))}code(se){return"function"==typeof se?se():se!==i.nil&&this._leafNode(new j(se)),this}object(...se){const de=["{"];for(const[Ae,Ie]of se)de.length>1&&de.push(","),de.push(Ae),(Ae!==Ie||this.opts.es5)&&(de.push(":"),(0,i.addCodeArg)(de,Ie));return de.push("}"),new i._Code(de)}if(se,de,Ae){if(this._blockNode(new V(se)),de&&Ae)this.code(de).else().code(Ae).endIf();else if(de)this.code(de).endIf();else if(Ae)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(se){return this._elseNode(new V(se))}else(){return this._elseNode(new W)}endIf(){return this._endBlockNode(V,W)}_for(se,de){return this._blockNode(se),de&&this.code(de).endFor(),this}for(se,de){return this._for(new q(se),de)}forRange(se,de,Ae,Ie,Le=(this.opts.es5?c.varKinds.var:c.varKinds.let)){const xe=this._scope.toName(se);return this._for(new ne(Le,xe,de,Ae),()=>Ie(xe))}forOf(se,de,Ae,Ie=c.varKinds.const){const Le=this._scope.toName(se);if(this.opts.es5){const xe=de instanceof i.Name?de:this.var("_arr",de);return this.forRange("_i",0,i._`${xe}.length`,Ce=>{this.var(Le,i._`${xe}[${Ce}]`),Ae(Le)})}return this._for(new te("of",Ie,Le,de),()=>Ae(Le))}forIn(se,de,Ae,Ie=(this.opts.es5?c.varKinds.var:c.varKinds.const)){if(this.opts.ownProperties)return this.forOf(se,i._`Object.keys(${de})`,Ae);const Le=this._scope.toName(se);return this._for(new te("in",Ie,Le,de),()=>Ae(Le))}endFor(){return this._endBlockNode(Z)}label(se){return this._leafNode(new R(se))}break(se){return this._leafNode(new T(se))}return(se){const de=new ae;if(this._blockNode(de),this.code(se),1!==de.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ae)}try(se,de,Ae){if(!de&&!Ae)throw new Error('CodeGen: "try" without "catch" and "finally"');const Ie=new me;if(this._blockNode(Ie),this.code(se),de){const Le=this.name("e");this._currNode=Ie.catch=new ye(Le),de(Le)}return Ae&&(this._currNode=Ie.finally=new ue,this.code(Ae)),this._endBlockNode(ye,ue)}throw(se){return this._leafNode(new E(se))}block(se,de){return this._blockStarts.push(this._nodes.length),se&&this.code(se).endBlock(de),this}endBlock(se){const de=this._blockStarts.pop();if(void 0===de)throw new Error("CodeGen: not in self-balancing block");const Ae=this._nodes.length-de;if(Ae<0||void 0!==se&&Ae!==se)throw new Error(`CodeGen: wrong number of nodes: ${Ae} vs ${se} expected`);return this._nodes.length=de,this}func(se,de=i.nil,Ae,Ie){return this._blockNode(new ie(se,de,Ae)),Ie&&this.code(Ie).endFunc(),this}endFunc(){return this._endBlockNode(ie)}optimize(se=1){for(;se-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(se){return this._currNode.nodes.push(se),this}_blockNode(se){this._currNode.nodes.push(se),this._nodes.push(se)}_endBlockNode(se,de){const Ae=this._currNode;if(Ae instanceof se||de&&Ae instanceof de)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${de?`${se.kind}/${de.kind}`:se.kind}"`)}_elseNode(se){const de=this._currNode;if(!(de instanceof V))throw new Error('CodeGen: "else" without "if"');return this._currNode=de.else=se,this}get _root(){return this._nodes[0]}get _currNode(){const se=this._nodes;return se[se.length-1]}set _currNode(se){const de=this._nodes;de[de.length-1]=se}},F.not=O;const z=p(F.operators.AND);F.and=function H(...ee){return ee.reduce(z)};const I=p(F.operators.OR);function p(ee){return(se,de)=>se===i.nil?de:de===i.nil?se:i._`${J(se)} ${ee} ${J(de)}`}function J(ee){return ee instanceof i.Name?ee:i._`(${ee})`}F.or=function s(...ee){return ee.reduce(I)}},85934:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValueScope=F.ValueScopeName=F.Scope=F.varKinds=F.UsedValueState=void 0;const i=f(33337);class c extends Error{constructor(R){super(`CodeGen: "code" for ${R} not defined`),this.value=R.value}}var x,_;(_=x=F.UsedValueState||(F.UsedValueState={}))[_.Started=0]="Started",_[_.Completed=1]="Completed",F.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class B{constructor({prefixes:R,parent:T}={}){this._names={},this._prefixes=R,this._parent=T}toName(R){return R instanceof i.Name?R:this.name(R)}name(R){return new i.Name(this._newName(R))}_newName(R){return`${R}${(this._names[R]||this._nameGroup(R)).index++}`}_nameGroup(R){var T,E;if(null!==(E=null===(T=this._parent)||void 0===T?void 0:T._prefixes)&&void 0!==E&&E.has(R)||this._prefixes&&!this._prefixes.has(R))throw new Error(`CodeGen: prefix "${R}" is not allowed in this scope`);return this._names[R]={prefix:R,index:0}}}F.Scope=B;class m extends i.Name{constructor(R,T){super(T),this.prefix=R}setValue(R,{property:T,itemIndex:E}){this.value=R,this.scopePath=i._`.${new i.Name(T)}[${E}]`}}F.ValueScopeName=m;const S=i._`\n`;F.ValueScope=class g extends B{constructor(R){super(R),this._values={},this._scope=R.scope,this.opts={...R,_n:R.lines?S:i.nil}}get(){return this._scope}name(R){return new m(R,this._newName(R))}value(R,T){var E;if(void 0===T.ref)throw new Error("CodeGen: ref must be passed in value");const j=this.toName(R),{prefix:M}=j,k=null!==(E=T.key)&&void 0!==E?E:T.ref;let K=this._values[M];if(K){const Z=K.get(k);if(Z)return Z}else K=this._values[M]=new Map;K.set(k,j);const W=this._scope[M]||(this._scope[M]=[]),V=W.length;return W[V]=T.ref,j.setValue(T,{property:M,itemIndex:V}),j}getValue(R,T){const E=this._values[R];if(E)return E.get(T)}scopeRefs(R,T=this._values){return this._reduceValues(T,E=>{if(void 0===E.scopePath)throw new Error(`CodeGen: name "${E}" has no value`);return i._`${R}${E.scopePath}`})}scopeCode(R=this._values,T,E){return this._reduceValues(R,j=>{if(void 0===j.value)throw new Error(`CodeGen: name "${j}" has no value`);return j.value.code},T,E)}_reduceValues(R,T,E={},j){let M=i.nil;for(const k in R){const K=R[k];if(!K)continue;const W=E[k]=E[k]||new Map;K.forEach(V=>{if(W.has(V))return;W.set(V,x.Started);let Z=T(V);if(Z)M=i._`${M}${this.opts.es5?F.varKinds.var:F.varKinds.const} ${V} = ${Z};${this.opts._n}`;else{if(!(Z=j?.(V)))throw new c(V);M=i._`${M}${Z}${this.opts._n}`}W.set(V,x.Completed)})}return M}}},53421:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.extendErrors=F.resetErrorsCount=F.reportExtraError=F.reportError=F.keyword$DataError=F.keywordError=void 0;const i=f(1038),c=f(27006),x=f(23432);function _(W,V){const Z=W.const("err",V);W.if(i._`${x.default.vErrors} === null`,()=>W.assign(x.default.vErrors,i._`[${Z}]`),i._`${x.default.vErrors}.push(${Z})`),W.code(i._`${x.default.errors}++`)}function R(W,V){const{gen:Z,validateName:q,schemaEnv:ne}=W;ne.$async?Z.throw(i._`new ${W.ValidationError}(${V})`):(Z.assign(i._`${q}.errors`,V),Z.return(!1))}F.keywordError={message:({keyword:W})=>i.str`must pass "${W}" keyword validation`},F.keyword$DataError={message:({keyword:W,schemaType:V})=>V?i.str`"${W}" keyword must be ${V} ($data)`:i.str`"${W}" keyword is invalid ($data)`},F.reportError=function B(W,V=F.keywordError,Z,q){const{it:ne}=W,{gen:te,compositeRule:ie,allErrors:ae}=ne,me=E(W,V,Z);q??(ie||ae)?_(te,me):R(ne,i._`[${me}]`)},F.reportExtraError=function m(W,V=F.keywordError,Z){const{it:q}=W,{gen:ne,compositeRule:te,allErrors:ie}=q;_(ne,E(W,V,Z)),te||ie||R(q,x.default.vErrors)},F.resetErrorsCount=function S(W,V){W.assign(x.default.errors,V),W.if(i._`${x.default.vErrors} !== null`,()=>W.if(V,()=>W.assign(i._`${x.default.vErrors}.length`,V),()=>W.assign(x.default.vErrors,null)))},F.extendErrors=function g({gen:W,keyword:V,schemaValue:Z,data:q,errsCount:ne,it:te}){if(void 0===ne)throw new Error("ajv implementation error");const ie=W.name("err");W.forRange("i",ne,x.default.errors,ae=>{W.const(ie,i._`${x.default.vErrors}[${ae}]`),W.if(i._`${ie}.instancePath === undefined`,()=>W.assign(i._`${ie}.instancePath`,(0,i.strConcat)(x.default.instancePath,te.errorPath))),W.assign(i._`${ie}.schemaPath`,i.str`${te.errSchemaPath}/${V}`),te.opts.verbose&&(W.assign(i._`${ie}.schema`,Z),W.assign(i._`${ie}.data`,q))})};const T={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function E(W,V,Z){const{createErrors:q}=W.it;return!1===q?i._`{}`:function j(W,V,Z={}){const{gen:q,it:ne}=W,te=[M(ne,Z),k(W,Z)];return function K(W,{params:V,message:Z},q){const{keyword:ne,data:te,schemaValue:ie,it:ae}=W,{opts:me,propertyName:ye,topSchemaRef:ue,schemaPath:$}=ae;q.push([T.keyword,ne],[T.params,"function"==typeof V?V(W):V||i._`{}`]),me.messages&&q.push([T.message,"function"==typeof Z?Z(W):Z]),me.verbose&&q.push([T.schema,ie],[T.parentSchema,i._`${ue}${$}`],[x.default.data,te]),ye&&q.push([T.propertyName,ye])}(W,V,te),q.object(...te)}(W,V,Z)}function M({errorPath:W},{instancePath:V}){const Z=V?i.str`${W}${(0,c.getErrorPath)(V,c.Type.Str)}`:W;return[x.default.instancePath,(0,i.strConcat)(x.default.instancePath,Z)]}function k({keyword:W,it:{errSchemaPath:V}},{schemaPath:Z,parentSchema:q}){let ne=q?V:i.str`${V}/${W}`;return Z&&(ne=i.str`${ne}${(0,c.getErrorPath)(Z,c.Type.Str)}`),[T.schemaPath,ne]}},97692:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.resolveSchema=F.getCompilingSchema=F.resolveRef=F.compileSchema=F.SchemaEnv=void 0;const i=f(1038),c=f(42467),x=f(23432),B=f(77172),m=f(27006),S=f(40339);class g{constructor(Z){var q;let ne;this.refs={},this.dynamicAnchors={},"object"==typeof Z.schema&&(ne=Z.schema),this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=null!==(q=Z.baseId)&&void 0!==q?q:(0,B.normalizeId)(ne?.[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=ne?.$async,this.refs={}}}function _(V){const Z=E.call(this,V);if(Z)return Z;const q=(0,B.getFullPath)(this.opts.uriResolver,V.root.baseId),{es5:ne,lines:te}=this.opts.code,{ownProperties:ie}=this.opts,ae=new i.CodeGen(this.scope,{es5:ne,lines:te,ownProperties:ie});let me;V.$async&&(me=ae.scopeValue("Error",{ref:c.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const ye=ae.scopeName("validate");V.validateName=ye;const ue={gen:ae,allErrors:this.opts.allErrors,data:x.default.data,parentData:x.default.parentData,parentDataProperty:x.default.parentDataProperty,dataNames:[x.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:ae.scopeValue("schema",!0===this.opts.code.source?{ref:V.schema,code:(0,i.stringify)(V.schema)}:{ref:V.schema}),validateName:ye,ValidationError:me,schema:V.schema,schemaEnv:V,rootId:q,baseId:V.baseId||q,schemaPath:i.nil,errSchemaPath:V.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let $;try{this._compilations.add(V),(0,S.validateFunctionCode)(ue),ae.optimize(this.opts.code.optimize);const o=ae.toString();$=`${ae.scopeRefs(x.default.scope)}return ${o}`,this.opts.code.process&&($=this.opts.code.process($,V));const A=new Function(`${x.default.self}`,`${x.default.scope}`,$)(this,this.scope.get());if(this.scope.value(ye,{ref:A}),A.errors=null,A.schema=V.schema,A.schemaEnv=V,V.$async&&(A.$async=!0),!0===this.opts.code.source&&(A.source={validateName:ye,validateCode:o,scopeValues:ae._values}),this.opts.unevaluated){const{props:C,items:O}=ue;A.evaluated={props:C instanceof i.Name?void 0:C,items:O instanceof i.Name?void 0:O,dynamicProps:C instanceof i.Name,dynamicItems:O instanceof i.Name},A.source&&(A.source.evaluated=(0,i.stringify)(A.evaluated))}return V.validate=A,V}catch(o){throw delete V.validate,delete V.validateName,$&&this.logger.error("Error compiling schema, function code:",$),o}finally{this._compilations.delete(V)}}function T(V){return(0,B.inlineRef)(V.schema,this.opts.inlineRefs)?V.schema:V.validate?V:_.call(this,V)}function E(V){for(const Z of this._compilations)if(j(Z,V))return Z}function j(V,Z){return V.schema===Z.schema&&V.root===Z.root&&V.baseId===Z.baseId}function M(V,Z){let q;for(;"string"==typeof(q=this.refs[Z]);)Z=q;return q||this.schemas[Z]||k.call(this,V,Z)}function k(V,Z){const q=this.opts.uriResolver.parse(Z),ne=(0,B._getFullPath)(this.opts.uriResolver,q);let te=(0,B.getFullPath)(this.opts.uriResolver,V.baseId,void 0);if(Object.keys(V.schema).length>0&&ne===te)return W.call(this,q,V);const ie=(0,B.normalizeId)(ne),ae=this.refs[ie]||this.schemas[ie];if("string"==typeof ae){const me=k.call(this,V,ae);return"object"!=typeof me?.schema?void 0:W.call(this,q,me)}if("object"==typeof ae?.schema){if(ae.validate||_.call(this,ae),ie===(0,B.normalizeId)(Z)){const{schema:me}=ae,{schemaId:ye}=this.opts,ue=me[ye];return ue&&(te=(0,B.resolveUrl)(this.opts.uriResolver,te,ue)),new g({schema:me,schemaId:ye,root:V,baseId:te})}return W.call(this,q,ae)}}F.SchemaEnv=g,F.compileSchema=_,F.resolveRef=function R(V,Z,q){var ne;q=(0,B.resolveUrl)(this.opts.uriResolver,Z,q);const te=V.refs[q];if(te)return te;let ie=M.call(this,V,q);if(void 0===ie){const ae=null===(ne=V.localRefs)||void 0===ne?void 0:ne[q],{schemaId:me}=this.opts;ae&&(ie=new g({schema:ae,schemaId:me,root:V,baseId:Z}))}return void 0!==ie?V.refs[q]=T.call(this,ie):void 0},F.getCompilingSchema=E,F.resolveSchema=k;const K=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function W(V,{baseId:Z,schema:q,root:ne}){var te;if("/"!==(null===(te=V.fragment)||void 0===te?void 0:te[0]))return;for(const me of V.fragment.slice(1).split("/")){if("boolean"==typeof q)return;const ye=q[(0,m.unescapeFragment)(me)];if(void 0===ye)return;const ue="object"==typeof(q=ye)&&q[this.opts.schemaId];!K.has(me)&&ue&&(Z=(0,B.resolveUrl)(this.opts.uriResolver,Z,ue))}let ie;if("boolean"!=typeof q&&q.$ref&&!(0,m.schemaHasRulesButRef)(q,this.RULES)){const me=(0,B.resolveUrl)(this.opts.uriResolver,Z,q.$ref);ie=k.call(this,ne,me)}const{schemaId:ae}=this.opts;return ie=ie||new g({schema:q,schemaId:ae,root:ne,baseId:Z}),ie.schema!==ie.root.schema?ie:void 0}},23432:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(1038),c={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};F.default=c},26288:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(77172);class c extends Error{constructor(B,m,S,g){super(g||`can't resolve reference ${S} from id ${m}`),this.missingRef=(0,i.resolveUrl)(B,m,S),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(B,this.missingRef))}}F.default=c},77172:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getSchemaRefs=F.resolveUrl=F.normalizeId=F._getFullPath=F.getFullPath=F.inlineRef=void 0;const i=f(27006),c=f(40362),x=f(44331),B=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);F.inlineRef=function m(W,V=!0){return"boolean"==typeof W||(!0===V?!g(W):!!V&&_(W)<=V)};const S=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function g(W){for(const V in W){if(S.has(V))return!0;const Z=W[V];if(Array.isArray(Z)&&Z.some(g)||"object"==typeof Z&&g(Z))return!0}return!1}function _(W){let V=0;for(const Z in W){if("$ref"===Z)return 1/0;if(V++,!B.has(Z)&&("object"==typeof W[Z]&&(0,i.eachItem)(W[Z],q=>V+=_(q)),V===1/0))return 1/0}return V}function R(W,V="",Z){!1!==Z&&(V=j(V));const q=W.parse(V);return T(W,q)}function T(W,V){return W.serialize(V).split("#")[0]+"#"}F.getFullPath=R,F._getFullPath=T;const E=/#\/?$/;function j(W){return W?W.replace(E,""):""}F.normalizeId=j,F.resolveUrl=function M(W,V,Z){return Z=j(Z),W.resolve(V,Z)};const k=/^[a-z_][-a-z0-9._]*$/i;F.getSchemaRefs=function K(W,V){if("boolean"==typeof W)return{};const{schemaId:Z,uriResolver:q}=this.opts,ne=j(W[Z]||V),te={"":ne},ie=R(q,ne,!1),ae={},me=new Set;return x(W,{allKeys:!0},($,o,h,A)=>{if(void 0===A)return;const C=ie+o;let O=te[A];function z(I){if(I=j(O?(0,this.opts.uriResolver.resolve)(O,I):I),me.has(I))throw ue(I);me.add(I);let p=this.refs[I];return"string"==typeof p&&(p=this.refs[p]),"object"==typeof p?ye($,p.schema,I):I!==j(C)&&("#"===I[0]?(ye($,ae[I],I),ae[I]=$):this.refs[I]=C),I}function H(I){if("string"==typeof I){if(!k.test(I))throw new Error(`invalid anchor "${I}"`);z.call(this,`#${I}`)}}"string"==typeof $[Z]&&(O=z.call(this,$[Z])),H.call(this,$.$anchor),H.call(this,$.$dynamicAnchor),te[o]=O}),ae;function ye($,o,h){if(void 0!==o&&!c($,o))throw ue(h)}function ue($){return new Error(`reference "${$}" resolves to more than one schema`)}}},32203:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getRules=F.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);F.isJSONType=function c(B){return"string"==typeof B&&i.has(B)},F.getRules=function x(){const B={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...B,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},B.number,B.string,B.array,B.object],post:{rules:[]},all:{},keywords:{}}}},27006:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;const i=f(1038),c=f(33337);function m(ie,ae=ie.schema){const{opts:me,self:ye}=ie;if(!me.strictSchema||"boolean"==typeof ae)return;const ue=ye.RULES.keywords;for(const $ in ae)ue[$]||te(ie,`unknown keyword: "${$}"`)}function S(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if(ae[me])return!0;return!1}function E(ie){return"number"==typeof ie?`${ie}`:ie.replace(/~/g,"~0").replace(/\//g,"~1")}function j(ie){return ie.replace(/~1/g,"/").replace(/~0/g,"~")}function k({mergeNames:ie,mergeToName:ae,mergeValues:me,resultToName:ye}){return(ue,$,o,h)=>{const A=void 0===o?$:o instanceof i.Name?($ instanceof i.Name?ie(ue,$,o):ae(ue,$,o),o):$ instanceof i.Name?(ae(ue,o,$),$):me($,o);return h!==i.Name||A instanceof i.Name?A:ye(ue,A)}}function K(ie,ae){if(!0===ae)return ie.var("props",!0);const me=ie.var("props",i._`{}`);return void 0!==ae&&W(ie,me,ae),me}function W(ie,ae,me){Object.keys(me).forEach(ye=>ie.assign(i._`${ae}${(0,i.getProperty)(ye)}`,!0))}F.toHash=function x(ie){const ae={};for(const me of ie)ae[me]=!0;return ae},F.alwaysValidSchema=function B(ie,ae){return"boolean"==typeof ae?ae:0===Object.keys(ae).length||(m(ie,ae),!S(ae,ie.self.RULES.all))},F.checkUnknownRules=m,F.schemaHasRules=S,F.schemaHasRulesButRef=function g(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if("$ref"!==me&&ae.all[me])return!0;return!1},F.schemaRefOrVal=function _({topSchemaRef:ie,schemaPath:ae},me,ye,ue){if(!ue){if("number"==typeof me||"boolean"==typeof me)return me;if("string"==typeof me)return i._`${me}`}return i._`${ie}${ae}${(0,i.getProperty)(ye)}`},F.unescapeFragment=function R(ie){return j(decodeURIComponent(ie))},F.escapeFragment=function T(ie){return encodeURIComponent(E(ie))},F.escapeJsonPointer=E,F.unescapeJsonPointer=j,F.eachItem=function M(ie,ae){if(Array.isArray(ie))for(const me of ie)ae(me);else ae(ie)},F.mergeEvaluated={props:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>{ie.if(i._`${ae} === true`,()=>ie.assign(me,!0),()=>ie.assign(me,i._`${me} || {}`).code(i._`Object.assign(${me}, ${ae})`))}),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>{!0===ae?ie.assign(me,!0):(ie.assign(me,i._`${me} || {}`),W(ie,me,ae))}),mergeValues:(ie,ae)=>!0===ie||{...ie,...ae},resultToName:K}),items:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>ie.assign(me,i._`${ae} === true ? true : ${me} > ${ae} ? ${me} : ${ae}`)),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>ie.assign(me,!0===ae||i._`${me} > ${ae} ? ${me} : ${ae}`)),mergeValues:(ie,ae)=>!0===ie||Math.max(ie,ae),resultToName:(ie,ae)=>ie.var("items",ae)})},F.evaluatedPropsToName=K,F.setEvaluated=W;const V={};var q,ie;function te(ie,ae,me=ie.opts.strictSchema){if(me){if(ae=`strict mode: ${ae}`,!0===me)throw new Error(ae);ie.self.logger.warn(ae)}}F.useFunc=function Z(ie,ae){return ie.scopeValue("func",{ref:ae,code:V[ae.code]||(V[ae.code]=new c._Code(ae.code))})},(ie=q=F.Type||(F.Type={}))[ie.Num=0]="Num",ie[ie.Str=1]="Str",F.getErrorPath=function ne(ie,ae,me){if(ie instanceof i.Name){const ye=ae===q.Num;return me?ye?i._`"[" + ${ie} + "]"`:i._`"['" + ${ie} + "']"`:ye?i._`"/" + ${ie}`:i._`"/" + ${ie}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return me?(0,i.getProperty)(ie).toString():"/"+E(ie)},F.checkStrictMode=te},22650:(Me,F)=>{"use strict";function i(x,B){return B.rules.some(m=>c(x,m))}function c(x,B){var m;return void 0!==x[B.keyword]||(null===(m=B.definition.implements)||void 0===m?void 0:m.some(S=>void 0!==x[S]))}Object.defineProperty(F,"__esModule",{value:!0}),F.shouldUseRule=F.shouldUseGroup=F.schemaHasRulesForType=void 0,F.schemaHasRulesForType=function f({schema:x,self:B},m){const S=B.RULES.types[m];return S&&!0!==S&&i(x,S)},F.shouldUseGroup=i,F.shouldUseRule=c},37864:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.boolOrEmptySchema=F.topBoolOrEmptySchema=void 0;const i=f(53421),c=f(1038),x=f(23432),B={message:"boolean schema is false"};function g(_,R){const{gen:T,data:E}=_;(0,i.reportError)({gen:T,keyword:"false schema",data:E,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:_},B,void 0,R)}F.topBoolOrEmptySchema=function m(_){const{gen:R,schema:T,validateName:E}=_;!1===T?g(_,!1):"object"==typeof T&&!0===T.$async?R.return(x.default.data):(R.assign(c._`${E}.errors`,null),R.return(!0))},F.boolOrEmptySchema=function S(_,R){const{gen:T,schema:E}=_;!1===E?(T.var(R,!1),g(_)):T.var(R,!0)}},55999:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.reportTypeError=F.checkDataTypes=F.checkDataType=F.coerceAndCheckDataType=F.getJSONTypes=F.getSchemaTypes=F.DataType=void 0;const i=f(32203),c=f(22650),x=f(53421),B=f(1038),m=f(27006);var S,q;function _(q){const ne=Array.isArray(q)?q:q?[q]:[];if(ne.every(i.isJSONType))return ne;throw new Error("type must be JSONType or JSONType[]: "+ne.join(","))}(q=S=F.DataType||(F.DataType={}))[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong",F.getSchemaTypes=function g(q){const ne=_(q.type);if(ne.includes("null")){if(!1===q.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!ne.length&&void 0!==q.nullable)throw new Error('"nullable" cannot be used without "type"');!0===q.nullable&&ne.push("null")}return ne},F.getJSONTypes=_,F.coerceAndCheckDataType=function R(q,ne){const{gen:te,data:ie,opts:ae}=q,me=function E(q,ne){return ne?q.filter(te=>T.has(te)||"array"===ne&&"array"===te):[]}(ne,ae.coerceTypes),ye=ne.length>0&&!(0===me.length&&1===ne.length&&(0,c.schemaHasRulesForType)(q,ne[0]));if(ye){const ue=K(ne,ie,ae.strictNumbers,S.Wrong);te.if(ue,()=>{me.length?function j(q,ne,te){const{gen:ie,data:ae,opts:me}=q,ye=ie.let("dataType",B._`typeof ${ae}`),ue=ie.let("coerced",B._`undefined`);"array"===me.coerceTypes&&ie.if(B._`${ye} == 'object' && Array.isArray(${ae}) && ${ae}.length == 1`,()=>ie.assign(ae,B._`${ae}[0]`).assign(ye,B._`typeof ${ae}`).if(K(ne,ae,me.strictNumbers),()=>ie.assign(ue,ae))),ie.if(B._`${ue} !== undefined`);for(const o of te)(T.has(o)||"array"===o&&"array"===me.coerceTypes)&&$(o);function $(o){switch(o){case"string":return void ie.elseIf(B._`${ye} == "number" || ${ye} == "boolean"`).assign(ue,B._`"" + ${ae}`).elseIf(B._`${ae} === null`).assign(ue,B._`""`);case"number":return void ie.elseIf(B._`${ye} == "boolean" || ${ae} === null +(self.webpackChunkapp=self.webpackChunkapp||[]).push([[8792],{44273:(Me,F,f)=>{"use strict";var i,c,x,B,m,S,g,_,R,T,E,j,M,k,K,W,V;f.r(F),f.d(F,{JSONPath:()=>uc}),(c={})[(i={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",c[i.EOF]="",c[i.Identifier]="Identifier",c[i.Keyword]="Keyword",c[i.NullLiteral]="Null",c[i.NumericLiteral]="Numeric",c[i.Punctuator]="Punctuator",c[i.StringLiteral]="String",c[i.RegularExpression]="RegularExpression",x=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="];var Z={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"};function q(yt,kt){if(!yt)throw new Error("ASSERT: "+kt)}function ne(yt){return yt>=48&&yt<=57}function te(yt){return"0123456789abcdefABCDEF".indexOf(yt)>=0}function ie(yt){return"01234567".indexOf(yt)>=0}function ae(yt){return 32===yt||9===yt||11===yt||12===yt||160===yt||yt>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(yt)>=0}function me(yt){return 10===yt||13===yt||8232===yt||8233===yt}function ye(yt){return 64==yt||36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||92===yt||yt>=128&&S.NonAsciiIdentifierStart.test(String.fromCharCode(yt))}function ue(yt){return 36===yt||95===yt||yt>=65&&yt<=90||yt>=97&&yt<=122||yt>=48&&yt<=57||92===yt||yt>=128&&S.NonAsciiIdentifierPart.test(String.fromCharCode(yt))}function o(yt){switch(yt){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function h(yt){return"eval"===yt||"arguments"===yt}function C(yt,kt,wr,Yt,hr){var Or;q("number"==typeof wr,"Comment must have valid position"),!(W.lastCommentStart>=wr)&&(W.lastCommentStart=wr,Or={type:yt,value:kt},V.range&&(Or.range=[wr,Yt]),V.loc&&(Or.loc=hr),V.comments.push(Or),V.attachComment&&(V.leadingComments.push(Or),V.trailingComments.push(Or)))}function O(yt){var kt,wr,Yt,hr;for(kt=T-yt,wr={start:{line:E,column:T-j-yt}};T=M&&Qe({},m.UnexpectedToken,"ILLEGAL");else if(42===wr){if(47===_.charCodeAt(T+1))return++T,++T,void(V.comments&&(Yt=_.slice(yt+2,T-2),kt.end={line:E,column:T-j},C("Block",Yt,yt,T,kt)));++T}else++T;Qe({},m.UnexpectedToken,"ILLEGAL")}function H(){var yt,kt;for(kt=0===T;T>>="===(pn=_.substr(T,4))?{type:i.Punctuator,value:pn,lineNumber:E,lineStart:j,start:yt,end:T+=4}:">>>"===(Or=pn.substr(0,3))||"<<="===Or||">>="===Or?{type:i.Punctuator,value:Or,lineNumber:E,lineStart:j,start:yt,end:T+=3}:Yt===(hr=Or.substr(0,2))[1]&&"+-<>&|".indexOf(Yt)>=0||"=>"===hr?{type:i.Punctuator,value:hr,lineNumber:E,lineStart:j,start:yt,end:T+=2}:"<>=!+-*%&|^/".indexOf(Yt)>=0?(++T,{type:i.Punctuator,value:Yt,lineNumber:E,lineStart:j,start:yt,end:T}):void Qe({},m.UnexpectedToken,"ILLEGAL")}function Ae(){var yt,kt,wr;if(q(ne((wr=_[T]).charCodeAt(0))||"."===wr,"Numeric literal must start with a decimal digit or a decimal point"),kt=T,yt="","."!==wr){if(yt=_[T++],wr=_[T],"0"===yt){if("x"===wr||"X"===wr)return++T,function se(yt){for(var kt="";T0&&(Yt=V.tokens[V.tokens.length-1]).range[0]===yt&&"Punctuator"===Yt.type&&("/"===Yt.value||"/="===Yt.value)&&V.tokens.pop(),V.tokens.push({type:"RegularExpression",value:wr.literal,range:[yt,T],loc:kt})),wr}function Ee(){var yt;return H(),T>=M?{type:i.EOF,lineNumber:E,lineStart:j,start:T,end:T}:ye(yt=_.charCodeAt(T))?function J(){var yt,kt,wr;return yt=T,kt=92===_.charCodeAt(T)?s():function p(){var yt,kt;for(yt=T++;T=0&&T=0?ee():Te()}return Te()}return"Keyword"===yt.type?Te():ee()}():ee()}function ve(){var yt,kt,Yt;return H(),yt={start:{line:E,column:T-j}},kt=Ee(),yt.end={line:E,column:T-j},kt.type!==i.EOF&&(Yt=_.slice(kt.start,kt.end),V.tokens.push({type:c[kt.type],value:Yt,range:[kt.start,kt.end],loc:yt})),kt}function De(){var yt;return T=(yt=K).end,E=yt.lineNumber,j=yt.lineStart,K=typeof V.tokens<"u"?ve():Ee(),T=yt.end,E=yt.lineNumber,j=yt.lineStart,yt}function Re(){var yt,kt,wr;yt=T,kt=E,wr=j,K=typeof V.tokens<"u"?ve():Ee(),T=yt,E=kt,j=wr}function Je(yt,kt){this.line=yt,this.column=kt}function $e(yt,kt,wr,Yt){this.start=new Je(yt,kt),this.end=new Je(wr,Yt)}function nt(){var yt,kt,wr,Yt;return yt=T,kt=E,wr=j,H(),Yt=E!==kt,T=yt,E=kt,j=wr,Yt}function Qe(yt,kt){for(var wr=[],Yt=2;Yt":case"<=":case">=":case"instanceof":wr=7;break;case"in":wr=kt?7:0;break;case"<<":case">>":case">>>":wr=8;break;case"+":case"-":wr=9;break;case"*":case"/":case"%":wr=11}return wr}function Ke(){var yt,kt,wr,Yt,hr;return yt=K,hr=K,Yt=kt=function Nr(){var yt,kt,wr,Yt,hr;return hr=K,yt=function jt(){var yt,kt,wr,Yt,hr,Or,pn,bn,_i,Xi;if(yt=K,_i=Pt(),0===(hr=Ct(Yt=K,W.allowIn)))return _i;for(Yt.prec=hr,De(),kt=[yt,K],Or=[_i,Yt,pn=Pt()];(hr=Ct(K,W.allowIn))>0;){for(;Or.length>2&&hr<=Or[Or.length-2].prec;)pn=Or.pop(),bn=Or.pop().value,_i=Or.pop(),wr=k.createBinaryExpression(bn,_i,pn),kt.pop(),k.markEnd(wr,yt=kt[kt.length-1]),Or.push(wr);(Yt=De()).prec=hr,Or.push(Yt),kt.push(K),wr=Pt(),Or.push(wr)}for(wr=Or[Xi=Or.length-1],kt.pop();Xi>1;)wr=k.createBinaryExpression(Or[Xi-1].value,Or[Xi-2],wr),Xi-=2,yt=kt.pop(),k.markEnd(wr,yt);return wr}(),re("?")&&(De(),kt=W.allowIn,W.allowIn=!0,wr=Ke(),W.allowIn=kt,ze(":"),Yt=Ke(),yt=k.createConditionalExpression(yt,wr,Yt),k.markEnd(yt,hr)),yt}(),function G(){var yt;return K.type===i.Punctuator&&("="===(yt=K.value)||"*="===yt||"/="===yt||"%="===yt||"+="===yt||"-="===yt||"<<="===yt||">>="===yt||">>>="===yt||"&="===yt||"^="===yt||"|="===yt)}()&&(_e(kt)||Tt({},m.InvalidLHSInAssignment),R&&kt.type===Z.Identifier&&h(kt.name)&&Tt(yt,m.StrictLHSAssignment),yt=De(),wr=Ke(),Yt=k.markEnd(k.createAssignmentExpression(yt.value,kt,wr),hr)),Yt}function Ze(){var yt,kt=K;if(yt=Ke(),re(",")){for(yt=k.createSequenceExpression([yt]);T"u"));)yt.push(kt);return yt}(),ze("}"),k.markEnd(k.createBlockStatement(yt),kt)}function mt(){var yt,kt;return kt=K,(yt=De()).type!==i.Identifier&&ct(yt),k.markEnd(k.createIdentifier(yt.value),kt)}function Xt(yt){var wr,Yt,kt=null;return Yt=K,wr=mt(),R&&h(wr.name)&&Tt({},m.StrictVarName),"const"===yt?(ze("="),kt=Ke()):re("=")&&(De(),kt=Ke()),k.markEnd(k.createVariableDeclarator(wr,kt),Yt)}function Et(yt){var kt=[];do{if(kt.push(Xt(yt)),!re(","))break;De()}while(T"u"&&ze(";")),typeof Yt>"u"&&(re(";")||(kt=Ze()),ze(";"),re(")")||(wr=Ze())),ze(")"),pn=W.inIteration,W.inIteration=!0,Or=ur(),W.inIteration=pn,typeof Yt>"u"?k.createForStatement(yt,kt,wr,Or):k.createForInStatement(Yt,hr,Or)}(),hr);case"function":return k.markEnd(mr(),hr);case"if":return k.markEnd(function mi(){var yt,kt,wr;return St("if"),ze("("),yt=Ze(),ze(")"),kt=ur(),X("else")?(De(),wr=ur()):wr=null,k.createIfStatement(yt,kt,wr)}(),hr);case"return":return k.markEnd(function xr(){var yt=null;return St("return"),W.inFunctionBody||Tt({},m.IllegalReturn),32===_.charCodeAt(T)&&ye(_.charCodeAt(T+1))?(yt=Ze(),he(),k.createReturnStatement(yt)):nt()?k.createReturnStatement(null):(re(";")||!re("}")&&K.type!==i.EOF&&(yt=Ze()),he(),k.createReturnStatement(yt))}(),hr);case"switch":return k.markEnd(function Xn(){var yt,kt,wr,Yt,hr;if(St("switch"),ze("("),yt=Ze(),ze(")"),ze("{"),kt=[],re("}"))return De(),k.createSwitchStatement(yt,kt);for(Yt=W.inSwitch,W.inSwitch=!0,hr=!1;T"u"));)kt.push(yt);return ze("}"),W.labelSet=Or,W.inIteration=pn,W.inSwitch=bn,W.inFunctionBody=_i,k.markEnd(k.createBlockStatement(kt),Xi)}function qt(yt){var kt,Yt,hr,Or,pn,bn,wr=[];if(ze("("),!re(")"))for(Or={};T0?1:0,j=0,M=_.length,K=null,W={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},V={},typeof kt<"u"&&(V.range="boolean"==typeof kt.range&&kt.range,V.loc="boolean"==typeof kt.loc&&kt.loc,V.attachComment="boolean"==typeof kt.attachComment&&kt.attachComment,V.loc&&null!=kt.source&&(V.source=Yt(kt.source)),"boolean"==typeof kt.tokens&&kt.tokens&&(V.tokens=[]),"boolean"==typeof kt.comment&&kt.comment&&(V.comments=[]),"boolean"==typeof kt.tolerant&&kt.tolerant&&(V.errors=[]),V.attachComment&&(V.range=!0,V.comments=[],V.bottomRightStack=[],V.trailingComments=[],V.leadingComments=[]));try{wr=function An(){var yt,kt;return H(),Re(),kt=K,R=!1,yt=function gn(){for(var yt,wr,hr,kt=[];T"u");)kt.push(yt);return kt}(),k.markEnd(k.createProgram(yt),kt)}(),typeof V.comments<"u"&&(wr.comments=V.comments),typeof V.tokens<"u"&&(function On(){var yt,kt,wr,Yt=[];for(yt=0;yt0?0:Or-1)),wr=hr(0===wr?0:wr||(Yt>0?Or:-1)),kt=Yt>0?Math.max(0,kt):Math.min(Or,kt),wr=Yt>0?Math.min(wr,Or):Math.max(-1,wr),Yt>0&&wr<=kt)return[];if(Yt<0&&kt<=wr)return[];for(var pn=[],bn=kt;bn!=wr&&!(Yt<0&&bn<=wr||Yt>0&&bn>=wr);bn+=Yt)pn.push(yt[bn]);return pn}B={Data:1,Get:2,Set:4},m={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},S={NonAsciiIdentifierStart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),NonAsciiIdentifierPart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]")},g={name:"SyntaxTree",processComment:function(yt){var kt,wr;if(!(yt.type===Z.Program&&yt.body.length>0)){for(V.trailingComments.length>0?V.trailingComments[0].range[0]>=yt.range[1]?(wr=V.trailingComments,V.trailingComments=[]):V.trailingComments.length=0:V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments&&V.bottomRightStack[V.bottomRightStack.length-1].trailingComments[0].range[0]>=yt.range[1]&&(wr=V.bottomRightStack[V.bottomRightStack.length-1].trailingComments,delete V.bottomRightStack[V.bottomRightStack.length-1].trailingComments);V.bottomRightStack.length>0&&V.bottomRightStack[V.bottomRightStack.length-1].range[0]>=yt.range[0];)kt=V.bottomRightStack.pop();kt?kt.leadingComments&&kt.leadingComments[kt.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=kt.leadingComments,delete kt.leadingComments):V.leadingComments.length>0&&V.leadingComments[V.leadingComments.length-1].range[1]<=yt.range[0]&&(yt.leadingComments=V.leadingComments,V.leadingComments=[]),wr&&(yt.trailingComments=wr),V.bottomRightStack.push(yt)}},markEnd:function(yt,kt){return V.range&&(yt.range=[kt.start,T]),V.loc&&(yt.loc=new $e(void 0===kt.startLineNumber?kt.lineNumber:kt.startLineNumber,kt.start-(void 0===kt.startLineStart?kt.lineStart:kt.startLineStart),E,T-j),this.postProcess(yt)),V.attachComment&&this.processComment(yt),yt},postProcess:function(yt){return V.source&&(yt.loc.source=V.source),yt},createArrayExpression:function(yt){return{type:Z.ArrayExpression,elements:yt}},createAssignmentExpression:function(yt,kt,wr){return{type:Z.AssignmentExpression,operator:yt,left:kt,right:wr}},createBinaryExpression:function(yt,kt,wr){return{type:"||"===yt||"&&"===yt?Z.LogicalExpression:Z.BinaryExpression,operator:yt,left:kt,right:wr}},createBlockStatement:function(yt){return{type:Z.BlockStatement,body:yt}},createBreakStatement:function(yt){return{type:Z.BreakStatement,label:yt}},createCallExpression:function(yt,kt){return{type:Z.CallExpression,callee:yt,arguments:kt}},createCatchClause:function(yt,kt){return{type:Z.CatchClause,param:yt,body:kt}},createConditionalExpression:function(yt,kt,wr){return{type:Z.ConditionalExpression,test:yt,consequent:kt,alternate:wr}},createContinueStatement:function(yt){return{type:Z.ContinueStatement,label:yt}},createDebuggerStatement:function(){return{type:Z.DebuggerStatement}},createDoWhileStatement:function(yt,kt){return{type:Z.DoWhileStatement,body:yt,test:kt}},createEmptyStatement:function(){return{type:Z.EmptyStatement}},createExpressionStatement:function(yt){return{type:Z.ExpressionStatement,expression:yt}},createForStatement:function(yt,kt,wr,Yt){return{type:Z.ForStatement,init:yt,test:kt,update:wr,body:Yt}},createForInStatement:function(yt,kt,wr){return{type:Z.ForInStatement,left:yt,right:kt,body:wr,each:!1}},createFunctionDeclaration:function(yt,kt,wr,Yt){return{type:Z.FunctionDeclaration,id:yt,params:kt,defaults:wr,body:Yt,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(yt,kt,wr,Yt){return{type:Z.FunctionExpression,id:yt,params:kt,defaults:wr,body:Yt,rest:null,generator:!1,expression:!1}},createIdentifier:function(yt){return{type:Z.Identifier,name:yt}},createIfStatement:function(yt,kt,wr){return{type:Z.IfStatement,test:yt,consequent:kt,alternate:wr}},createLabeledStatement:function(yt,kt){return{type:Z.LabeledStatement,label:yt,body:kt}},createLiteral:function(yt){return{type:Z.Literal,value:yt.value,raw:_.slice(yt.start,yt.end)}},createMemberExpression:function(yt,kt,wr){return{type:Z.MemberExpression,computed:"["===yt,object:kt,property:wr}},createNewExpression:function(yt,kt){return{type:Z.NewExpression,callee:yt,arguments:kt}},createObjectExpression:function(yt){return{type:Z.ObjectExpression,properties:yt}},createPostfixExpression:function(yt,kt){return{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!1}},createProgram:function(yt){return{type:Z.Program,body:yt}},createProperty:function(yt,kt,wr){return{type:Z.Property,key:kt,value:wr,kind:yt}},createReturnStatement:function(yt){return{type:Z.ReturnStatement,argument:yt}},createSequenceExpression:function(yt){return{type:Z.SequenceExpression,expressions:yt}},createSwitchCase:function(yt,kt){return{type:Z.SwitchCase,test:yt,consequent:kt}},createSwitchStatement:function(yt,kt){return{type:Z.SwitchStatement,discriminant:yt,cases:kt}},createThisExpression:function(){return{type:Z.ThisExpression}},createThrowStatement:function(yt){return{type:Z.ThrowStatement,argument:yt}},createTryStatement:function(yt,kt,wr,Yt){return{type:Z.TryStatement,block:yt,guardedHandlers:kt,handlers:wr,finalizer:Yt}},createUnaryExpression:function(yt,kt){return"++"===yt||"--"===yt?{type:Z.UpdateExpression,operator:yt,argument:kt,prefix:!0}:{type:Z.UnaryExpression,operator:yt,argument:kt,prefix:!0}},createVariableDeclaration:function(yt,kt){return{type:Z.VariableDeclaration,declarations:yt,kind:kt}},createVariableDeclarator:function(yt,kt){return{type:Z.VariableDeclarator,id:yt,init:kt}},createWhileStatement:function(yt,kt){return{type:Z.WhileStatement,test:yt,body:kt}},createWithStatement:function(yt,kt){return{type:Z.WithStatement,object:yt,body:kt}}};var no=f(18911),Zi=f.n(no);function Ao(yt){return function(kt,wr,Yt,hr){var Or=kt.value,pn=kt.path,bn=[],_i=function(Xi,Io){Jn(Xi)?(Xi.forEach(function(Mo,Ma){bn.length>=hr||Yt(Ma,Mo,wr)&&bn.push({path:Io.concat(Ma),value:Mo})}),Xi.forEach(function(Mo,Ma){bn.length>=hr||yt&&_i(Mo,Io.concat(Ma))})):function Qo(yt){return yt&&!(yt instanceof Array)&&yt instanceof Object}(Xi)&&(Object.keys(Xi).forEach(function(Mo){bn.length>=hr||Yt(Mo,Xi[Mo],wr)&&bn.push({path:Io.concat(Mo),value:Xi[Mo]})}),Object.keys(Xi).forEach(function(Mo){bn.length>=hr||yt&&_i(Xi[Mo],Io.concat(Mo))}))}.bind(this);return _i(Or,pn),bn}}function Fo(yt,kt){try{return Zi()(yt,kt)}catch{}}function Hi(yt){return function(kt,wr,Yt){return this.descend(wr,kt.expression.value,yt,Yt)}}function ro(yt){return function(kt,wr,Yt){return this.traverse(wr,kt.expression.value,yt,Yt)}}function uo(yt){return function ks(yt,kt){for(var wr=[],Yt=[],hr=0,Or=yt?.length;hr=Yt||kt.expression.value.forEach(function(_i){var Xi={operation:"subscript",scope:"child",expression:_i.expression},Mo=hr.resolve(Xi)(Xi,bn);Or=Or.concat(Mo)})}),uo(Or)},"subscript-child-filter_expression":function(kt,wr,Yt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.descend(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Yt)},"subscript-descendant-filter_expression":function(kt,wr,Yt){var Or=oi(kt.expression.value.slice(2,-1)).body[0].expression;return this.traverse(wr,null,function(bn,_i){return Fo(Or,{"@":_i})},Yt)},"subscript-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(kt,wr){return Gs(wr,kt.expression.value.slice(1,-1),"$..value")}},this.initialize()}return yt.prototype.initialize=function(){this.traverse=Ao(!0),this.descend=Ao(),this._fns["subscript-child-string_literal"]=this._fns["member-child-identifier"],this._fns["member-descendant-numeric_literal"]=this._fns["subscript-descendant-string_literal"]=this._fns["member-descendant-identifier"]},yt.prototype.resolve=function(kt){var wr=[kt.operation,kt.scope,kt.expression.type].join("-"),Yt=this._fns[wr];if(!Yt)throw new Error("couldn't resolve key: "+wr);return Yt.bind(this)},yt.prototype.register=function(kt,wr){if(!(wr instanceof Function))throw new Error("handler must be a function");this._fns[kt]=wr},yt}(),ys=f(15320);function Ji(){var yt=new ys.iX,kt=yt.parseError;return yt.yy.parseError=function(){yt.yy.ast&&yt.yy.ast.initialize(),kt.apply(yt,arguments)},yt}var vs=function(){function yt(){}return yt.ok=function(kt,wr){if(!kt)throw new Error(wr)},yt.equal=function(kt,wr,Yt){if(kt!==wr)throw new Error(Yt)},yt}(),uc=function(){function yt(){}return yt.parse=function(kt){return vs.ok("string"==typeof kt,"we need a path"),(new Ji).parse(kt)},yt.parent=function(kt,wr){vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path");var Yt=this.nodes(kt,wr)[0];return Yt.path.pop(),this.value(kt,Yt.path)},yt.apply=function(kt,wr,Yt){vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),vs.equal(typeof Yt,"function","fn needs to be function");var hr=this.nodes(kt,wr).sort(function(Or,pn){return pn.path.length-Or.path.length});return hr.forEach(function(Or){var pn=Or.path.pop(),bn=this.value(kt,this.stringify(Or.path)),_i=Or.value=Yt.call(kt,bn[pn]);bn[pn]=_i},this),hr},yt.value=function(kt,wr,Yt){if(vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),void 0!==Yt){var hr=this.nodes(kt,wr).shift();if(!hr)return this._vivify(kt,wr,Yt);var Or=hr.path.slice(-1).shift();this.parent(kt,this.stringify(hr.path))[Or]=Yt}return this.query(kt,this.stringify(wr),1).shift()},yt._vivify=function(kt,wr,Yt){var hr=this;vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path");var Or=(new Ji).parse(wr).map(function(bn){return bn.expression.value}),pn=function(bn,_i){var Xi=bn.pop(),Io=hr.value(kt,bn);Io||(pn(bn.concat(),"string"==typeof Xi?{}:[]),Io=hr.value(kt,bn)),Io[Xi]=_i};return pn(Or,Yt),this.query(kt,wr)[0]},yt.query=function(kt,wr,Yt){return vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok("string"==typeof wr,"we need a path"),this.nodes(kt,wr,Yt).map(function(Or){return Or.value})},yt.paths=function(kt,wr,Yt){return vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),this.nodes(kt,wr,Yt).map(function(Or){return Or.path})},yt.nodes=function(kt,wr,Yt){if(vs.ok(kt instanceof Object,"obj needs to be an object"),vs.ok(wr,"we need a path"),0===Yt)return[];var hr=(new Ji).parse(wr),Or=new As,pn=[{path:["$"],value:kt}],bn=[];return hr.length&&"root"==hr[0].expression.type&&hr.shift(),hr.length?(hr.forEach(function(_i,Xi){if(!(bn.length>=Yt)){var Io=Or.resolve(_i),Mo=[];pn.forEach(function(Ma){if(!(bn.length>=Yt)){var Rs=Io(_i,Ma,Yt);Xi==hr.length-1?bn=bn.concat(Rs||[]):Mo=Mo.concat(Rs||[])}}),pn=Mo}}),Yt?bn.slice(0,Yt):bn):pn},yt.stringify=function(kt){vs.ok(kt,"we need a path");var wr="$",Yt={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(kt=this._normalize(kt)).forEach(function(hr){if("root"!=hr.expression.type){var bn,Or=[hr.scope,hr.operation].join("-"),pn=Yt[Or];if(bn="string_literal"==hr.expression.type?JSON.stringify(hr.expression.value):hr.expression.value,!pn)throw new Error("couldn't find template "+Or);wr+=pn.replace(/{{value}}/,bn)}}),wr},yt._normalize=function(kt){if(vs.ok(kt,"we need a path"),"string"==typeof kt)return(new Ji).parse(kt);if(Array.isArray(kt)&&"string"==typeof kt[0]){var wr=[{expression:{type:"root",value:"$"}}];return kt.forEach(function(Yt,hr){"$"==Yt&&0===hr||("string"==typeof Yt&&Yt.match("^[a-zA-Z_]+[a-zA-Z0-9_]*$")?wr.push({operation:"member",scope:"child",expression:{value:Yt,type:"identifier"}}):wr.push({operation:"subscript",scope:"child",expression:{value:Yt,type:"number"==typeof Yt?"numeric_literal":"string_literal"}}))}),wr}if(Array.isArray(kt)&&"object"==typeof kt[0])return kt;throw new Error("couldn't understand path "+kt)},yt}()},15320:(Me,F)=>{var i=function(){var c=function(me,ye,ue,$){for(ue=ue||{},$=me.length;$--;ue[me[$]]=ye);return ue},x=[1,5],B=[1,6],m=[1,7],S=[1,8],g=[1,9],_=[1,18],R=[1,19],T=[1,20],E=[1,12,14,22],j=[1,29],M=[1,30],k=[1,33],K=[1,35],W=[1,31],V=[1,36],Z=[1,37],q=[24,28],ne={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(ye,ue,$,o,h,A,C){o.ast||(o.ast=te,te.initialize());var O=A.length-1;switch(h){case 1:return o.ast.set({expression:{type:"root",value:A[O]}}),o.ast.unshift(),o.ast.yield();case 2:return o.ast.set({expression:{type:"root",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 3:return o.ast.unshift(),o.ast.yield();case 4:return o.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:A[O-1]}}),o.ast.unshift(),o.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:o.ast.set({operation:"member"}),o.ast.push();break;case 8:o.ast.set({operation:"subscript"}),o.ast.push();break;case 9:case 19:o.ast.set({scope:"child"});break;case 10:case 20:o.ast.set({scope:"descendant"});break;case 12:o.ast.set({scope:"child",operation:"member"});break;case 14:o.ast.set({expression:{type:"wildcard",value:A[O]}});break;case 15:o.ast.set({expression:{type:"identifier",value:A[O]}});break;case 16:o.ast.set({expression:{type:"script_expression",value:A[O]}});break;case 17:o.ast.set({expression:{type:"numeric_literal",value:parseInt(A[O])}});break;case 24:A[O].length>1?o.ast.set({expression:{type:"union",value:A[O]}}):this.$=A[O];break;case 25:this.$=[A[O]];break;case 26:this.$=A[O-2].concat(A[O]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(A[O])}},o.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:A[O]}},o.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:A[O]}},o.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:A[O]}},o.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:A[O]}},o.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:A[O]}},o.ast.set(this.$);break;case 33:case 34:this.$=A[O]}},table:[{3:1,4:[1,2],6:3,13:4,15:x,16:B,17:m,18:S,19:g},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},c(E,[2,12]),c(E,[2,14]),c(E,[2,15]),c(E,[2,16]),c(E,[2,17]),c(E,[2,18]),{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},c(E,[2,5]),c(E,[2,7]),c(E,[2,8]),c(E,[2,9]),c(E,[2,10]),c(E,[2,19]),c(E,[2,20]),{13:23,15:x,16:B,17:m,18:S,19:g},{13:24,15:x,16:B,17:m,18:S,19:g,22:[1,25]},{15:j,17:M,18:k,23:26,25:27,26:28,27:32,29:34,30:K,31:W,32:V,33:Z},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:_,14:R,20:16,21:17,22:T},c(E,[2,6]),c(E,[2,11]),c(E,[2,13]),{15:j,17:M,18:k,23:38,25:27,26:28,27:32,29:34,30:K,31:W,32:V,33:Z},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},c(q,[2,25]),c(q,[2,27]),c(q,[2,28]),c(q,[2,29]),c(q,[2,33]),c(q,[2,34]),{24:[1,41]},c(E,[2,21]),{18:k,27:42,29:34,30:K,32:V,33:Z},c(E,[2,22]),c(q,[2,26])],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(ye,ue){if(!ue.recoverable){var $=new Error(ye);throw $.hash=ue,$}this.trace(ye)},parse:function(ye){var $=[0],h=[null],A=[],C=this.table,O="",z=0,H=0,I=0,J=A.slice.call(arguments,1),ee=Object.create(this.lexer),se={yy:{}};for(var de in this.yy)Object.prototype.hasOwnProperty.call(this.yy,de)&&(se.yy[de]=this.yy[de]);ee.setInput(ye,se.yy),se.yy.lexer=ee,se.yy.parser=this,typeof ee.yylloc>"u"&&(ee.yylloc={});var Ae=ee.yylloc;A.push(Ae);var Qe,Ie=ee.options&&ee.options.ranges;this.parseError="function"==typeof se.yy.parseError?se.yy.parseError:Object.getPrototypeOf(this).parseError;for(var Ce,Xe,Te,ke,Ee,De,Re,$e,ve={};;){if(this.defaultActions[Te=$[$.length-1]]?ke=this.defaultActions[Te]:((null===Ce||typeof Ce>"u")&&(Qe=void 0,"number"!=typeof(Qe=ee.lex()||1)&&(Qe=this.symbols_[Qe]||Qe),Ce=Qe),ke=C[Te]&&C[Te][Ce]),typeof ke>"u"||!ke.length||!ke[0]){var nt;for(De in $e=[],C[Te])this.terminals_[De]&&De>2&&$e.push("'"+this.terminals_[De]+"'");nt=ee.showPosition?"Parse error on line "+(z+1)+":\n"+ee.showPosition()+"\nExpecting "+$e.join(", ")+", got '"+(this.terminals_[Ce]||Ce)+"'":"Parse error on line "+(z+1)+": Unexpected "+(1==Ce?"end of input":"'"+(this.terminals_[Ce]||Ce)+"'"),this.parseError(nt,{text:ee.match,token:this.terminals_[Ce]||Ce,line:ee.yylineno,loc:Ae,expected:$e})}if(ke[0]instanceof Array&&ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Te+", token: "+Ce);switch(ke[0]){case 1:$.push(Ce),h.push(ee.yytext),A.push(ee.yylloc),$.push(ke[1]),Ce=null,Xe?(Ce=Xe,Xe=null):(H=ee.yyleng,O=ee.yytext,z=ee.yylineno,Ae=ee.yylloc,I>0&&I--);break;case 2:if(ve.$=h[h.length-(Re=this.productions_[ke[1]][1])],ve._$={first_line:A[A.length-(Re||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(Re||1)].first_column,last_column:A[A.length-1].last_column},Ie&&(ve._$.range=[A[A.length-(Re||1)].range[0],A[A.length-1].range[1]]),typeof(Ee=this.performAction.apply(ve,[O,H,z,se.yy,ke[1],h,A].concat(J)))<"u")return Ee;Re&&($=$.slice(0,-1*Re*2),h=h.slice(0,-1*Re),A=A.slice(0,-1*Re)),$.push(this.productions_[ke[1]][0]),h.push(ve.$),A.push(ve._$),$.push(C[$[$.length-2]][$[$.length-1]]);break;case 3:return!0}}return!0}},te={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(me){for(var ye in me)this._node[ye]=me[ye];return this._node},node:function(me){return arguments.length&&(this._node=me),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var me=this._nodes;return this.initialize(),me}};function ae(){this.yy={}}return ne.lexer=function(){return{EOF:1,parseError:function(ue,$){if(!this.yy.parser)throw new Error(ue);this.yy.parser.parseError(ue,$)},setInput:function(ye,ue){return this.yy=ue||this.yy||{},this._input=ye,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var ye=this._input[0];return this.yytext+=ye,this.yyleng++,this.offset++,this.match+=ye,this.matched+=ye,ye.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ye},unput:function(ye){var ue=ye.length,$=ye.split(/(?:\r\n?|\n)/g);this._input=ye+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ue),this.offset-=ue;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1&&(this.yylineno-=$.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===o.length?this.yylloc.first_column:0)+o[o.length-$.length].length-$[0].length:this.yylloc.first_column-ue},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-ue]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(ye){this.unput(this.match.slice(ye))},pastInput:function(){var ye=this.matched.substr(0,this.matched.length-this.match.length);return(ye.length>20?"...":"")+ye.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var ye=this.match;return ye.length<20&&(ye+=this._input.substr(0,20-ye.length)),(ye.substr(0,20)+(ye.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var ye=this.pastInput(),ue=new Array(ye.length+1).join("-");return ye+this.upcomingInput()+"\n"+ue+"^"},test_match:function(ye,ue){var $,o,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(o=ye[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ye[0].length},this.yytext+=ye[0],this.match+=ye[0],this.matches=ye,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(ye[0].length),this.matched+=ye[0],$=this.performAction.call(this,this.yy,this,ue,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),$)return $;if(this._backtrack){for(var A in h)this[A]=h[A];return!1}return!1},next:function(){if(this.done)return this.EOF;var ye,ue,$,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),A=0;Aue[0].length)){if(ue=$,o=A,this.options.backtrack_lexer){if(!1!==(ye=this.test_match($,h[A])))return ye;if(this._backtrack){ue=!1;continue}return!1}if(!this.options.flex)break}return ue?!1!==(ye=this.test_match(ue,h[o]))&&ye:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(ue){this.conditionStack.push(ue)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(ue){return(ue=this.conditionStack.length-1-Math.abs(ue||0))>=0?this.conditionStack[ue]:"INITIAL"},pushState:function(ue){this.begin(ue)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(ue,$,o,h){switch(o){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return $.yytext=$.yytext.substr(1,$.yyleng-2),32;case 11:return $.yytext=$.yytext.substr(1,$.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}(),ae.prototype=ne,ne.Parser=ae,new ae}();F.iX=i.Parser},52191:(Me,F,f)=>{var i=f(40573);const c="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,x=()=>c.now(),m=g=>g===1/0||(g=>g&&g===Math.floor(g)&&g>0&&isFinite(g))(g);class S{constructor({max:_=1/0,ttl:R,updateAgeOnGet:T=!1,checkAgeOnGet:E=!1,noUpdateTTL:j=!1,dispose:M,noDisposeOnSet:k=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,void 0!==R&&!m(R))throw new TypeError("ttl must be positive integer or Infinity if set");if(!m(_))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=R,this.max=_,this.updateAgeOnGet=!!T,this.checkAgeOnGet=!!E,this.noUpdateTTL=!!j,this.noDisposeOnSet=!!k,void 0!==M){if("function"!=typeof M)throw new TypeError("dispose must be function if set");this.dispose=M}this.timer=void 0,this.timerExpiration=void 0}setTimer(_,R){if(this.timerExpiration<_)return;this.timer&&clearTimeout(this.timer);const T=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const E in this.expirations){this.setTimer(E,E-x());break}},R);T.unref&&T.unref(),this.timerExpiration=_,this.timer=T}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return i.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const _=this.dispose!==S.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[R,T]of _)this.dispose(T,R,"delete")}setTTL(_,R=this.ttl){const T=this.expirationMap.get(_);if(void 0!==T){const E=this.expirations[T];!E||E.length<=1?delete this.expirations[T]:this.expirations[T]=E.filter(j=>j!==_)}if(R!==1/0){const E=Math.floor(x()+R);this.expirationMap.set(_,E),this.expirations[E]||(this.expirations[E]=[],this.setTimer(E,R)),this.expirations[E].push(_)}else this.expirationMap.set(_,1/0)}set(_,R,{ttl:T=this.ttl,noUpdateTTL:E=this.noUpdateTTL,noDisposeOnSet:j=this.noDisposeOnSet}={}){if(!m(T))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(_)){E||this.setTTL(_,T);const M=this.data.get(_);M!==R&&(this.data.set(_,R),j||this.dispose(M,_,"set"))}else this.setTTL(_,T),this.data.set(_,R);for(;this.size>this.max;)this.purgeToCapacity();return this}has(_){return this.data.has(_)}getRemainingTTL(_){const R=this.expirationMap.get(_);return R===1/0?R:void 0!==R?Math.max(0,Math.ceil(R-x())):0}get(_,{updateAgeOnGet:R=this.updateAgeOnGet,ttl:T=this.ttl,checkAgeOnGet:E=this.checkAgeOnGet}={}){const j=this.data.get(_);if(!E||0!==this.getRemainingTTL(_))return R&&this.setTTL(_,T),j;this.delete(_)}dispose(_,R){}delete(_){const R=this.expirationMap.get(_);if(void 0!==R){const T=this.data.get(_);this.data.delete(_),this.expirationMap.delete(_);const E=this.expirations[R];return E&&(E.length<=1?delete this.expirations[R]:this.expirations[R]=E.filter(j=>j!==_)),this.dispose(T,_,"delete"),0===this.size&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const _ in this.expirations){const R=this.expirations[_];if(!(this.size-R.length>=this.max)){const T=this.size-this.max,E=[];for(const j of R.splice(0,T))E.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,M]of E)this.dispose(M,j,"evict");return}{delete this.expirations[_];const T=[];for(const E of R)T.push([E,this.data.get(E)]),this.data.delete(E),this.expirationMap.delete(E);for(const[E,j]of T)this.dispose(j,E,"evict")}}}get size(){return this.data.size}purgeStale(){const _=Math.ceil(x());for(const R in this.expirations){if("Infinity"===R||R>_)return;const T=[...this.expirations[R]||[]],E=[];delete this.expirations[R];for(const j of T)E.push([j,this.data.get(j)]),this.data.delete(j),this.expirationMap.delete(j);for(const[j,M]of E)this.dispose(M,j,"stale")}0===this.size&&this.cancelTimer()}*entries(){for(const _ in this.expirations)for(const R of this.expirations[_])yield[R,this.data.get(R)]}*keys(){for(const _ in this.expirations)for(const R of this.expirations[_])yield R}*values(){for(const _ in this.expirations)for(const R of this.expirations[_])yield this.data.get(R)}[Symbol.iterator](){return this.entries()}}Me.exports=S},33065:(Me,F,f)=>{"use strict";f.r(F),f.d(F,{RestoreComponent:()=>ue});var i=f(10467),c=f(54438),x=f(89417),B=f(88834),m=f(25596),S=f(99213),g=f(99631),_=f(5951),R=f(82798),T=f(34635),E=f(20180),j=f(52778),M=f(65571),k=f(12621),K=f(30046),W=f(80865),V=f(3902),Z=f(53719);const q=$=>["/account",$];function ne($,o){1&$&&(c.j41(0,"mat-error"),c.EFF(1,"Private key is "),c.j41(2,"strong"),c.EFF(3,"required"),c.k0s()())}function te($,o){if(1&$&&(c.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),c.EFF(3,"Private Key"),c.k0s(),c.j41(4,"mat-card-subtitle"),c.EFF(5,"Enter your Stellar private key (starts with 'S')"),c.k0s()(),c.j41(6,"mat-card-content"),c.nrm(7,"br"),c.j41(8,"mat-form-field",8)(9,"mat-label"),c.EFF(10,"Stellar Private Key"),c.k0s(),c.nrm(11,"textarea",9,0),c.DNE(13,ne,4,0,"mat-error"),c.k0s()(),c.j41(14,"mat-card-actions",10)(15,"button",11),c.EFF(16,"Restore"),c.k0s()()()),2&$){const h=c.XpG();c.R7$(13),c.vxM(h.addressForm.controls.recoveryPhrase.hasError("required")?13:-1),c.R7$(2),c.Y8G("disabled",h.app.loading())}}function ie($,o){if(1&$&&(c.j41(0,"a",14)(1,"mat-icon",15),c.EFF(2,"account_circle"),c.k0s(),c.j41(3,"span",16),c.EFF(4),c.k0s(),c.j41(5,"span",17),c.EFF(6),c.k0s()()),2&$){const h=o.$implicit;c.Y8G("routerLink",c.eq3(3,q,h.did.uri)),c.R7$(4),c.JRh(h.metadata.name),c.R7$(2),c.JRh(h.did.uri)}}function ae($,o){if(1&$&&(c.j41(0,"h1"),c.EFF(1,"Imported Accounts"),c.k0s(),c.j41(2,"mat-list"),c.Z7z(3,ie,7,5,"a",14,c.fX1),c.k0s()),2&$){const h=c.XpG(2);c.R7$(3),c.Dyx(h.importedIdentities)}}function me($,o){if(1&$){const h=c.RV6();c.j41(0,"mat-card",7)(1,"mat-card-header")(2,"mat-card-title"),c.EFF(3,"Portable DID"),c.k0s(),c.j41(4,"mat-card-subtitle"),c.EFF(5,"Choose your backup file (portableIdentity.json)"),c.k0s()(),c.j41(6,"mat-card-content"),c.nrm(7,"br"),c.j41(8,"button",12),c.bIt("click",function(){c.eBV(h);const C=c.XpG();return c.Njj(C.editFile({}))}),c.j41(9,"mat-icon"),c.EFF(10,"upload_file"),c.k0s(),c.j41(11,"span"),c.EFF(12,"Choose portable DID files"),c.k0s()(),c.j41(13,"input",13),c.bIt("change",function(C){c.eBV(h);const O=c.XpG();return c.Njj(O.onFileSelected(C))}),c.k0s()()(),c.DNE(14,ae,5,0)}if(2&$){const h=c.XpG();c.R7$(14),c.vxM(h.importedIdentities.length>0?14:-1)}}function ye($,o){1&$&&(c.j41(0,"mat-card",7)(1,"mat-card-content")(2,"p"),c.EFF(3,"Support for Nostr is coming in the future"),c.k0s()()())}let ue=(()=>{class ${constructor(){this.fb=(0,c.WQX)(x.ok),this.crypto=(0,c.WQX)(E.j),this.app=(0,c.WQX)(j.d),this.protocol=(0,c.WQX)(W.w),this.route=(0,c.WQX)(K.Ix),this.identity=(0,c.WQX)(T.K),this.importedIdentities=[],this.addressForm=this.fb.group({recoveryPhrase:[null,x.k0.required],importType:["ariton",x.k0.required]})}editFile(h){return(0,i.A)(function*(){document.getElementById("input")?.click()})()}query(){var h=this;return(0,i.A)(function*(){const A={message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",A),console.log(h.identity.web5.agent),console.log(h.identity.web5.dwn),console.log(h.identity.web5.dwn.records),console.log("Object above");var{records:O,status:z}=yield h.identity.web5.dwn.records.query(A);console.log("Status:",z),console.log(O);const C={from:h.identity.did,message:{filter:{protocol:"https://schema.ariton.app/note",schema:"https://schema.ariton.app/note/schema/note",dataFormat:"application/json"}}};console.log("Query:",C);var{records:O,status:z}=yield h.identity.web5.dwn.records.query(C);console.log("Status:",z),console.log(O)})()}onFileSelected(h){var A=this;return(0,i.A)(function*(){const C=h.target.files;if(C&&0!==C.length){console.log("Uploading number of files:",C.length);for(let O=0;O{A.app.openSnackBar(`Error reading file ${z.name}: ${H.error}`,3e3),console.error(`Error reading file ${z.name}:`,H.error)},H.readAsText(z)}}})()}onSubmit(){var h=this;return(0,i.A)(function*(){if(console.log(h.addressForm.controls.recoveryPhrase.value),h.addressForm.disable(),h.app.loading.set(!0),"stellar"===h.addressForm.controls.importType.value){const A=h.identity.activeAgent(),C=yield k.hX.fromPrivateKey({privateKey:h.addressForm.controls.recoveryPhrase.value});console.log("Bearer DID: ",C);const O=yield C.export(),z={portableDid:O,metadata:{name:"Stellar Identity",tenant:O.uri,uri:O.uri}};try{console.log("Portable Identity:",z),yield A.identity.import({portableIdentity:z})}catch(s){console.error(s)}h.identity.identities=yield A.identity.list();const H=yield h.identity.registerAccount(O.uri,h.app.account().password);console.log(`Register protocols for ${O.uri}`),yield h.protocol.register(H),h.app.account(),h.identity.changeAccount(O.uri),h.route.navigate(["/accounts"])}else{let A=yield h.crypto.createPassword();A="123"}h.app.initialized.set(!0),h.app.loading.set(!1)})()}static{this.\u0275fac=function(A){return new(A||$)}}static{this.\u0275cmp=c.VBU({type:$,selectors:[["app-restore"]],standalone:!0,features:[c.aNF],decls:16,vars:5,consts:[["recoveryPhrase",""],["novalidate","",3,"ngSubmit","formGroup"],["formControlName","importType"],["value","ariton"],["value","did:is",3,"disabled"],["value","stellar",3,"disabled"],["value","nostr",3,"disabled"],[1,"shipping-card"],[1,"full-width"],["matInput","","placeholder","Secret Recovery Phrase","formControlName","recoveryPhrase"],["align","end"],["mat-flat-button","","color","primary","type","submit",3,"disabled"],["type","button","mat-button","",3,"click"],["type","file","id","input",2,"display","none",3,"change"],["mat-list-item","",1,"selectable-list-item",3,"routerLink"],["matListItemIcon",""],["matListItemTitle",""],["matListItemLine",""]],template:function(A,C){1&A&&(c.j41(0,"h1"),c.EFF(1,"Restore your account"),c.k0s(),c.j41(2,"form",1),c.bIt("ngSubmit",function(){return C.onSubmit()}),c.j41(3,"p")(4,"mat-button-toggle-group",2)(5,"mat-button-toggle",3),c.EFF(6,"Ariton"),c.k0s(),c.j41(7,"mat-button-toggle",4),c.EFF(8,"FreeID"),c.k0s(),c.j41(9,"mat-button-toggle",5),c.EFF(10,"Stellar"),c.k0s(),c.j41(11,"mat-button-toggle",6),c.EFF(12,"Nostr"),c.k0s()()(),c.DNE(13,te,17,2,"mat-card",7)(14,me,15,1)(15,ye,4,0,"mat-card",7),c.k0s()),2&A&&(c.R7$(2),c.Y8G("formGroup",C.addressForm),c.R7$(5),c.Y8G("disabled",!0),c.R7$(2),c.Y8G("disabled",!0),c.R7$(2),c.Y8G("disabled",!0),c.R7$(2),c.vxM("stellar"==C.addressForm.controls.importType.value?13:"ariton"==C.addressForm.controls.importType.value?14:15))},dependencies:[g.fS,g.fg,Z.rl,Z.nJ,Z.TL,B.Hl,B.$z,M.Vg,M.ec,M.pc,R.Ve,S.m_,S.An,V.Fg,V.jt,V.YE,V.ZV,V.C_,V.yE,K.iI,K.Wk,_.Wk,m.Hu,m.RN,m.YY,m.m2,m.MM,m.Lc,m.dh,x.X1,x.qT,x.me,x.BC,x.cb,x.j4,x.JD],styles:[".shipping-card[_ngcontent-%COMP%]{min-width:120px;margin:20px auto}.mat-radio-button[_ngcontent-%COMP%]{display:block;margin:5px 0}.row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.col[_ngcontent-%COMP%]{flex:1;margin-right:20px}.col[_ngcontent-%COMP%]:last-child{margin-right:0}.link-input[_ngcontent-%COMP%]{display:flex;align-items:baseline}.link-input[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:.4em}.account-action-button[_ngcontent-%COMP%]{padding-top:1.2em}.example-action-buttons[_ngcontent-%COMP%]{padding-bottom:20px}.example-headers-align[_ngcontent-%COMP%] .mat-expansion-panel-header-description[_ngcontent-%COMP%]{justify-content:space-between;align-items:center}.example-headers-align[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] + .mat-mdc-form-field[_ngcontent-%COMP%]{margin-left:8px}.selectable-list-item[_ngcontent-%COMP%]{cursor:pointer}.selectable-list-item[_ngcontent-%COMP%]:hover{background-color:var(--mdc-list-list-item-leading-avatar-color)}"]})}}return $})()},52778:(Me,F,f)=>{"use strict";f.d(F,{d:()=>Z,f:()=>V});var i=f(10467),c=f(54438),x=f(31948),B=f(20180),m=f(34635),g=f.t(JSON.parse('{"name":"ariton","version":"0.0.2","scripts":{"ng":"ng","start":"ng serve --port 4201","start2":"ng serve --port 4210","build":"ng build","watch":"ng build --watch --configuration development","test":"ng test","deploy":"ng deploy app","i18n":"ng extract-i18n --format=json --output-path src/locale"},"repository":{"type":"git","url":"git+https://github.com/block-core/ariton.git"},"private":true,"dependencies":{"@angular-builders/custom-webpack":"^18.0.0","@angular/animations":"^18.2.8","@angular/cdk":"^18.2.8","@angular/common":"^18.2.8","@angular/compiler":"^18.2.8","@angular/core":"^18.2.8","@angular/forms":"^18.2.8","@angular/material":"^18.2.8","@angular/platform-browser":"^18.2.8","@angular/platform-browser-dynamic":"^18.2.8","@angular/router":"^18.2.8","@angular/service-worker":"^18.2.8","@scure/bip39":"^1.4.0","@web5/agent":"^0.8.1","@web5/api":"^0.12.0","@web5/credentials":"^1.1.3","@web5/crypto":"^1.0.6","@web5/dids":"^1.2.0","@web5/identity-agent":"^0.7.1","@zxing/ngx-scanner":"^18.0.1","base32.js":"^0.1.0","cropperjs":"^1.6.2","crypto-browserify":"^3.12.1","process":"^0.11.10","qrcode":"^1.5.4","rxjs":"~7.8.1","stream":"^0.0.3","stream-browserify":"^3.0.0","tslib":"^2.7.0","zone.js":"~0.15.0"},"devDependencies":{"@angular-devkit/build-angular":"^18.2.8","@angular/cli":"^18.2.8","@angular/compiler-cli":"^18.2.8","@angular/localize":"^18.2.8","@types/jasmine":"~5.1.4","@types/qrcode":"^1.5.5","angular-cli-ghpages":"^2.0.3","jasmine-core":"~5.3.0","karma":"~6.4.4","karma-chrome-launcher":"~3.2.0","karma-coverage":"~2.2.1","karma-jasmine":"~5.1.0","karma-jasmine-html-reporter":"~2.1.0","typescript":"~5.5.4"}}'),2),_=f(80865),R=f(39434),T=f(1005),E=f(95416),j=f(21093);let M=(()=>{class q{constructor(){this.connection=(0,c.WQX)(j.K)}start(){var te=this;return(0,i.A)(function*(){const ie=function(){var ae=(0,i.A)(function*(){try{console.log("Processing task..."),console.log("connections count:",te.connection.requests().length),console.log("CONNECTIONS:",te.connection.requests());const me=te.connection.requests().filter(ye=>"credential"===ye.record.tags.type);console.log("credentialRequests:",me);for(const ye of me){console.log("Processing connection:",ye);const ue=yield te.connection.acceptFriendRequest(ye);ye.data.recordId=ue?.id,ye.data.did=ye.record.creator,console.log("REQUEST DATA:",ye.data);const $=yield te.connection.create(ye,j.X.Friend);console.log("Connection Entry that was made: ",$),yield te.connection.deleteRequest(ye)}}catch(me){console.error("Error processing task:",me)}finally{setTimeout(ie,6e4)}});return function(){return ae.apply(this,arguments)}}();yield ie()})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=c.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();f(68530);let K=(()=>{class q{constructor(){this.connections=(0,c.WQX)(j.K),this.identity=(0,c.WQX)(m.K)}initialize(){return(0,i.A)(function*(){})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=c.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})();var W=f(43794),V=function(q){return q[q.Initial=0]="Initial",q[q.NewUser=1]="NewUser",q[q.Locked=2]="Locked",q[q.Unlocked=3]="Unlocked",q[q.Error=4]="Error",q}(V||{});let Z=(()=>{class q{constructor(){var te=this;this.onboardingState=(0,c.vPA)(V.Initial),this.initialized=(0,c.vPA)(!1),this.loading=(0,c.vPA)(!1),this.localStorage=(0,c.WQX)(x.s),this.storage=(0,c.WQX)(W.n),this.hash=(0,c.WQX)(T.G),this.worker=(0,c.WQX)(M),this.crypto=(0,c.WQX)(B.j),this.identity=(0,c.WQX)(m.K),this.profile=(0,c.WQX)(R.p),this.connection=(0,c.WQX)(j.K),this.protocol=(0,c.WQX)(_.w),this.snackBar=(0,c.WQX)(E.UG),this.event=(0,c.WQX)(K),this.state=(0,c.vPA)({loginAction:"/dashboard",selectedIdentity:"",hidden:{}}),this.account=(0,c.vPA)({did:"",recoveryPhrase:"",password:"",passwordHash:"",bundleTimestamp:""}),this.identities=(0,c.vPA)([]),this.agent=(0,c.vPA)(null),this.activeIdentity=(0,c.vPA)(null),this.params=(0,c.vPA)({}),this.package=g,this.aritonDid="did:dht:mo7am9cz6qrjwoc4kapffeue9kjw6igdh9dmqd3ywdif6qa7ju4o",console.log(`Ariton v${this.package.version} (${this.hash.getTimestamp()})`),this.dependencies=Object.entries(this.package.dependencies).map(([ie,ae])=>({name:ie,version:ae})),(0,c.QZP)((0,i.A)(function*(){te.identity.locked()||(yield te.onUnlocked())}))}saveAgent(te){this.localStorage.save("agent",te)}saveIdentities(te){te&&0!=te.length?this.localStorage.save("identities",te):console.log("IDENTITIES ARE EMPTY!!!")}saveAccounts(te){this.localStorage.save("accounts",te)}saveState(te){this.localStorage.save("state",te)}hasStateBeenSet(){return!!this.localStorage.read("state")}createAccount(){var te=this;return(0,i.A)(function*(){te.localStorage.save("state",{selectedIdentity:"",hidden:{},loginAction:"/introduction"}),yield te.initialize()})()}openSnackBar(te,ie=2e3){this.snackBar.open(te,void 0,{duration:ie})}initialize(){var te=this;return(0,i.A)(function*(){te.loading.set(!0),console.log("Initializing Ariton...");let ie=te.localStorage.read("state");if(!ie)return te.onboardingState.set(V.NewUser),void te.loading.set(!1);let ye,ae=te.localStorage.read("identities"),me=te.localStorage.read("agent");if(console.log("IDENTITIES, AGENT from local:",ae,me),me){let ue;if(ie.selectedIdentity?(ue=ae.find($=>$.did===ie.selectedIdentity),console.log("!!! IDENTITIES: ",ae),console.log("!!! IDENTITY: ",ue),te.activeIdentity.set(ue),te.agent.set(me)):0===ae.length&&(ue=ae[0],te.activeIdentity.set(ue),console.log("!!! IDENTITY2: ",ue)),me.password){if(ye=yield te.identity.connect(ue.did,me.password),0===ae.length){const h=(yield(ye?.web5.agent).identity.list()).map(A=>({did:A.metadata.uri,bundleTimestamp:""}));te.saveIdentities(h),te.identities.set(h)}else te.saveIdentities(ae),te.identities.set(ae);ye?(te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES2",te.identities()),te.identity.locked.set(!1)):te.loading.set(!1)}else console.log("LOCKED TRUE, IDENTITIES3",te.identities()),te.identity.locked.set(!0),te.onboardingState.set(V.Locked)}else{console.log("No agent found");const ue=yield te.crypto.createPassword();if(ye=yield te.identity.initialConnect(ue),void 0===ye)return te.localStorage.remove("state"),te.onboardingState.set(V.Error),void te.loading.set(!1);console.log(ye),console.log("Initialize connect finished."),me={did:ye.web5.agent.agentDid.uri,recoveryPhrase:ye.recoveryPhrase,password:ue},te.saveAgent(me);const $={did:ye.did,bundleTimestamp:""};ae=[$],te.saveIdentities(ae),te.identities.set(ae),console.log("Identities saved:",ae),ie.selectedIdentity=ye.did,te.saveState(ie),te.agent.set(me),te.activeIdentity.set($),te.onboardingState.set(V.Unlocked),console.log("LOCKED FALSE, IDENTITIES1",te.identities()),te.identity.locked.set(!1)}te.state.set(ie)})()}onUnlocked(){var te=this;return(0,i.A)(function*(){try{yield te.profile.openCurrentUserProfile(te.activeIdentity().did)}catch(ie){console.error("Failed to load user profile:",ie)}yield te.loadAppData(),te.initialized.set(!0),te.loading.set(!1),te.worker.start(),yield te.event.initialize(),yield te.firstTimeInitialization()})()}loadAppData(){var te=this;return(0,i.A)(function*(){console.log("Loading app data..."),yield te.connection.initialize(),console.log("App data loaded.")})()}firstTimeInitialization(){var te=this;return(0,i.A)(function*(){console.log("First time initialization..."),console.log(te.identities()),console.log(te.activeIdentity()),null==te.hash.getTimestamp()||te.activeIdentity().bundleTimestamp!==te.hash.getTimestamp()?(console.log("Bundle hash is different from the previous one. Re-registering protocols..."),console.log(`Register protocols for ${te.identity.did}`),te.protocol.register(te.identity.web5),te.activeIdentity().bundleTimestamp=te.hash.getTimestamp(),te.saveIdentities(te.identities())):console.log("Bundle hash is the same as the previous one. No need to re-register protocols.")})()}static{this.\u0275fac=function(ie){return new(ie||q)}}static{this.\u0275prov=c.jDH({token:q,factory:q.\u0275fac,providedIn:"root"})}}return q})()},21093:(Me,F,f)=>{"use strict";f.d(F,{K:()=>T,X:()=>R});var i=f(10467),c=f(54438),x=f(34635),B=f(68530),m=f(77494),S=f(26703),g=f(76336),_=f(22312),R=function(E){return E.Data="data",E.Friend="friend",E.Credential="credential",E}(R||{});let T=(()=>{class E{constructor(){this.identity=(0,c.WQX)(x.K),this.utility=(0,c.WQX)(S.Q),this.blocks=(0,c.vPA)([]),this.connections=(0,c.vPA)([]),this.friends=(0,c.EWP)(()=>this.connections().filter(M=>"friend"==M.record.tags.type)),this.friendRequests=(0,c.EWP)(()=>this.requests().filter(M=>"friend"==M.record.tags.type)),this.requests=(0,c.vPA)([]),this.loading=(0,c.vPA)(!1)}create(M,k){var K=this;return(0,i.A)(function*(){const W={type:k};let V=M.data;console.log("CONNECTION SERVICE ENTRY DATA:",V);const{record:Z,status:q}=yield K.identity.web5.dwn.records.create({data:V,message:{tags:W,recipient:M.record.creator,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema,dataFormat:B.Q.types.connection.dataFormats[0]}});console.log("Connection created:",q,Z);const ne={record:Z,data:V,id:Z.id};return K.connections.update(te=>[ne,...te]),K.utility.executeAsyncWithToast(M.record.send(K.identity.did)),ne})()}validateAndStoreCredential(M){var k=this;return(0,i.A)(function*(){const K=M.data.vc;if(!K)throw new Error("The incoming VC is missing.");try{yield g.l6.verify({vcJwt:K})}catch(ne){return void console.error("Error verifying VC:",ne)}const W=g.l6.parseJwt({vcJwt:K});console.log("PARSED INVCOMING VC:",W),console.log("vc.issuer === this.identity.did:",W.issuer===k.identity.did);const{record:Z}=yield k.identity.web5.dwn.records.create({data:K,message:{schema:_.eE.friendship,dataFormat:_.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",Z);const{status:q}=yield Z.send(k.identity.did);console.log("Record sent:",q,Z),yield M.record.delete(),M.record.send(k.identity.did),console.log("Friend request validated")})()}removeFriendship(M){return(0,i.A)(function*(){})()}acceptFriendRequest(M){var k=this;return(0,i.A)(function*(){const K=M.data.vc;if(!K)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",K),!K)return;try{yield g.l6.verify({vcJwt:K})}catch(te){return void console.error("Error verifying VC:",te)}const W=g.l6.parseJwt({vcJwt:K});if(W.subject!=k.identity.did)return void console.error("VC is not valid.");if(W.issuer!=M.record.creator)return void console.error("VC is not valid.");const Z=W.vcDataModel.credentialSubject.vc;console.log("INNER VC JWT:",Z);try{yield g.l6.verify({vcJwt:Z})}catch(te){return void console.error("Error verifying VC:",te)}const q=g.l6.parseJwt({vcJwt:Z});if(console.log("VC issuer: ",q.issuer),console.log("this.identity.did",k.identity.did),q.issuer!=k.identity.did)return void console.error("VC is not valid.");if(q.subject!=W.issuer)return void console.error("VC is not valid.");console.log("Friend request validated");const{record:ne}=yield k.identity.web5.dwn.records.create({data:K,message:{schema:_.eE.friendship,dataFormat:_.eE.format,published:!1}});return console.log("TWO WAY VC RECORD:",ne),ne.send(k.identity.did),ne})()}approveFriendRequest(M){var k=this;return(0,i.A)(function*(){const K=M.data.vc;if(!K)throw new Error("The incoming VC is missing.");if(console.log("signedVcJwt:",K),!K)return;try{yield g.l6.verify({vcJwt:K})}catch(Z){return void console.error("Error verifying VC:",Z)}const W=g.l6.parseJwt({vcJwt:K});if(W.subject!=k.identity.did)return void console.error("VC is not valid.");if(W.issuer!=M.record.creator)return void console.error("VC is not valid.");const{record:V}=yield k.identity.web5.dwn.records.create({data:K,message:{schema:_.eE.friendship,dataFormat:_.eE.format,published:!1}});console.log("TWO WAY VC RECORD:",V),V.send(k.identity.did),yield k.deleteRequest(M)})()}initialize(){var M=this;return(0,i.A)(function*(){const k=yield M.loadBlocks();M.blocks.set(k);const K=yield M.loadConnections();M.connections.set(K),yield M.reloadRequests()})()}reloadRequests(){var M=this;return(0,i.A)(function*(){M.loading.set(!0);const k=yield M.loadRequests();M.requests.set(k),M.loading.set(!1)})()}request(M,k,K){var W=this;return(0,i.A)(function*(){const V=k,Z={type:K},{record:q,status:ne}=yield W.identity.web5.dwn.records.create({data:V,message:{tags:Z,recipient:M,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema,dataFormat:B.Q.types.request.dataFormats[0]}});console.log("Notification created:",ne,q);const te={record:q,data:V,id:q.id,direction:"out"};return W.requests.update(ie=>[te,...ie]),W.utility.executeAsyncWithToast(te.record.send(W.identity.did)),W.utility.executeAsyncWithToast(te.record.send(M)),te})()}deleteBlock(M){var k=this;return(0,i.A)(function*(){yield M.record.delete(),k.blocks.update(K=>[...K.filter(W=>W.id!==M.id)]),k.utility.executeAsyncWithToast(M.record.send(k.identity.did))})()}deleteConnection(M){var k=this;return(0,i.A)(function*(){yield M.record.delete(),k.connections.update(K=>[...K.filter(W=>W.id!==M.id)]),k.utility.executeAsyncWithToast(M.record.send(k.identity.did))})()}deleteRequest(M){var k=this;return(0,i.A)(function*(){const K=M.record.creator;console.log("Delete requested for this author:"+K),yield M.record.delete(),k.requests.update(W=>[...W.filter(V=>V.id!==M.id)]),k.utility.executeAsyncWithToast(M.record.send(k.identity.did)),k.utility.executeAsyncWithToast(M.record.send(K==k.identity.did?M.record.recipient:K))})()}deleteRequests(M){var k=this;return(0,i.A)(function*(){if(!M)return;const K=yield k.loadRequests(M);for(const W of K)console.log("DELETE THIS ENTRY:",W),yield k.deleteRequest(W)})()}deleteConnections(M){var k=this;return(0,i.A)(function*(){if(!M)return;const K=yield k.loadConnections(M);for(const W of K)yield W.record.delete(),yield W.record.send(k.identity.did),k.connections.update(V=>[...V.filter(Z=>Z.id!==W.id)])})()}block(M){var k=this;return(0,i.A)(function*(){if(console.log("BLOCKS THIS DID:",M),!M)return;const K={did:M};console.log("Delete all Requests and Connections before updating block list."),yield k.deleteRequests(M),yield k.deleteConnections(M);let W=k.blocks().find(V=>V.data.did==M);if(!W){const{records:V}=yield k.identity.web5.dwn.records.query({message:{filter:{recipient:M,protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]},dateSort:m.U0.CreatedAscending}});let Z;if(0==V.length){const{record:q}=yield k.identity.web5.dwn.records.create({data:{did:M},message:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema,dataFormat:B.Q.types.block.dataFormats[0]}});Z=q}else Z=V[0];W={record:Z,data:K,id:Z.id},k.blocks.update(q=>[...q,W])}return console.log("The Block record",W),W})()}loadRequests(M){var k=this;return(0,i.A)(function*(){const K=[],V={from:k.identity.did,message:{filter:{author:M||void 0,protocol:B.Q.protocol,protocolPath:"request",schema:B.Q.types.request.schema},dateSort:m.U0.CreatedAscending}};console.log("IDENTITY: ",k.identity),console.log("LOAD REQUESTS:",V);const{records:Z}=yield k.identity.web5.dwn.records.query(V);for(let q of Z){if(k.blocked(q.creator)){q.delete(),q.send(k.identity.did),q.send(q.creator);continue}const ne=yield q.data.json();let te={record:q,data:ne,id:q.id};q.creator==k.identity.did&&(te.direction="out"),K.push(te)}return console.log("REQUESTS: ",K),K})()}blocked(M){return void 0!==this.blocks().find(k=>k.data.did==M)}loadConnections(M){var k=this;return(0,i.A)(function*(){const K=[],W={recipient:M||void 0,protocol:B.Q.protocol,protocolPath:"connection",schema:B.Q.types.connection.schema},{records:V}=yield k.identity.web5.dwn.records.query({message:{filter:W,dateSort:m.U0.CreatedDescending}});for(let Z of V){const q=yield Z.data.json();K.push({record:Z,data:q,id:Z.id})}return K})()}loadBlocks(){var M=this;return(0,i.A)(function*(){const k=[],{records:K}=yield M.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,protocolPath:"block",schema:B.Q.types.block.schema},dateSort:m.U0.CreatedAscending}});for(let W of K){const V=yield W.data.json();k.push({record:W,data:V,id:W.id})}return k})()}static{this.\u0275fac=function(k){return new(k||E)}}static{this.\u0275prov=c.jDH({token:E,factory:E.\u0275fac,providedIn:"root"})}}return E})()},20180:(Me,F,f)=>{"use strict";f.d(F,{j:()=>je});var i=f(10467),c=f(42512);function S(Ne,...ot){if(!function m(Ne){return Ne instanceof Uint8Array||null!=Ne&&"object"==typeof Ne&&"Uint8Array"===Ne.constructor.name}(Ne))throw new Error("Uint8Array expected");if(ot.length>0&&!ot.includes(Ne.length))throw new Error(`Uint8Array expected of length ${ot}, not of length=${Ne.length}`)}function _(Ne,ot=!0){if(Ne.destroyed)throw new Error("Hash instance has been destroyed");if(ot&&Ne.finished)throw new Error("Hash#digest() has already been called")}const j="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,W=Ne=>new DataView(Ne.buffer,Ne.byteOffset,Ne.byteLength),V=(Ne,ot)=>Ne<<32-ot|Ne>>>ot;function O(Ne){return"string"==typeof Ne&&(Ne=function C(Ne){if("string"!=typeof Ne)throw new Error("utf8ToBytes expected string, got "+typeof Ne);return new Uint8Array((new TextEncoder).encode(Ne))}(Ne)),S(Ne),Ne}new Uint8Array(new Uint32Array([287454020]).buffer);class H{clone(){return this._cloneInto()}}function p(Ne){const ot=wt=>Ne().update(O(wt)).digest(),Ft=Ne();return ot.outputLen=Ft.outputLen,ot.blockLen=Ft.blockLen,ot.create=()=>Ne(),ot}const Ae=(Ne,ot,Ft)=>Ne&ot^~Ne&Ft,Ie=(Ne,ot,Ft)=>Ne&ot^Ne&Ft^ot&Ft;class Le extends H{constructor(ot,Ft,wt,zt){super(),this.blockLen=ot,this.outputLen=Ft,this.padOffset=wt,this.isLE=zt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(ot),this.view=W(this.buffer)}update(ot){_(this);const{view:Ft,buffer:wt,blockLen:zt}=this,rr=(ot=O(ot)).length;for(let ar=0;arzt-ar&&(this.process(wt,0),ar=0);for(let Tr=ar;Tr>zt&rr),lr=Number(Ft&rr),Wr=wt?0:4;Ne.setUint32(ot+(wt?4:0),ar,wt),Ne.setUint32(ot+Wr,lr,wt)})(wt,zt-8,BigInt(8*this.length),rr),this.process(wt,0);const lr=W(ot),hn=this.outputLen;if(hn%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const Wr=hn/4,vr=this.get();if(Wr>vr.length)throw new Error("_sha2: outputLen bigger than state");for(let Tr=0;Tr>>3,Ct=V(lt,17)^V(lt,19)^lt>>>10;Xe[Tr]=Ct+Xe[Tr-7]+Pt+Xe[Tr-16]|0}let{A:wt,B:zt,C:rr,D:ar,E:lr,F:hn,G:Wr,H:vr}=this;for(let Tr=0;Tr<64;Tr++){const lt=vr+(V(lr,6)^V(lr,11)^V(lr,25))+Ae(lr,hn,Wr)+xe[Tr]+Xe[Tr]|0,Ct=(V(wt,2)^V(wt,13)^V(wt,22))+Ie(wt,zt,rr)|0;vr=Wr,Wr=hn,hn=lr,lr=ar+lt|0,ar=rr,rr=zt,zt=wt,wt=lt+Ct|0}wt=wt+this.A|0,zt=zt+this.B|0,rr=rr+this.C|0,ar=ar+this.D|0,lr=lr+this.E|0,hn=hn+this.F|0,Wr=Wr+this.G|0,vr=vr+this.H|0,this.set(wt,zt,rr,ar,lr,hn,Wr,vr)}roundClean(){Xe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Se=p(()=>new Te);var ve=f(53813);function nt(Ne,ot=128){if(function x(Ne){if(!Number.isSafeInteger(Ne)||Ne<0)throw new Error(`positive integer expected, not ${Ne}`)}(ot),ot%32!=0||ot>256)throw new TypeError("Invalid entropy");return function ze(Ne,ot){return function $e(Ne){S(Ne,16,20,24,28,32)}(Ne),function Tt(Ne){if(!Array.isArray(Ne)||2048!==Ne.length||"string"!=typeof Ne[0])throw new Error("Wordlist: expected array of 2048 strings");return Ne.forEach(ot=>{if("string"!=typeof ot)throw new Error(`Wordlist: non-string element: ${ot}`)}),ve.Wp.chain(ve.Wp.checksum(1,Qe),ve.Wp.radix2(11,!0),ve.Wp.alphabet(Ne))}(ot).encode(Ne).join((Ne=>"\u3042\u3044\u3053\u304f\u3057\u3093"===Ne[0])(ot)?"\u3000":" ")}(function se(Ne=32){if(j&&"function"==typeof j.getRandomValues)return j.getRandomValues(new Uint8Array(Ne));if(j&&"function"==typeof j.randomBytes)return j.randomBytes(Ne);throw new Error("crypto.getRandomValues must be defined")}(ot/8),Ne)}const Qe=Ne=>{const ot=8-Ne.length/4;return new Uint8Array([Se(Ne)[0]>>ot<{class Ne{constructor(){}createPassword(Ft=6,wt=128){return(0,i.A)(function*(){try{const zt=nt(he,wt).split(" "),rr=[];for(let ar=0;ar{"use strict";f.d(F,{G:()=>B});var i=f(10467),c=f(54438),x=f(21626);let B=(()=>{class m{constructor(g){this.http=g,this.timestamp=null}load(){var g=this;return(0,i.A)(function*(){const _=yield fetch("/ngsw.json");if(_.ok){const R=yield _.json();console.log("DATA FROM HASH",R),g.timestamp=R.timestamp}})()}getTimestamp(){return this.timestamp}static{this.\u0275fac=function(_){return new(_||m)(c.KVO(x.Qq))}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},34635:(Me,F,f)=>{"use strict";f.d(F,{K:()=>T});var i=f(10467),c=f(54438),x=f(25246),B=f(80785),m=f(20180),S=f(77494),g=f(80428),_=f(4080),R=f(12621);let T=(()=>{class E{constructor(M){this.cryptoService=M,this.syncInterval="15s",this.agents=(0,c.vPA)([]),this.identities=[],this.accounts={},this.crypto=(0,c.WQX)(m.j),this.activeAccount=(0,c.vPA)(void 0),this.activeIdentity=(0,c.vPA)(void 0),this.preinitialized=(0,c.vPA)(!1),this.initialized=(0,c.vPA)(!1),this.locked=(0,c.vPA)(!0)}initialConnect(M){var k=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const K=yield x.uW.connect({password:M,sync:k.syncInterval});return k.did=K.did,k.web5=K.web5,k.agent=K.web5.agent,console.log("Web5 Connected.",k.did),k.preinitialized.set(!0),k.initialized.set(!0),K}catch(K){console.error(K)}})()}get identity(){return this.identities.find(M=>M.metadata.uri===this.did)}connectWithIdentity(M){var k=this;return(0,i.A)(function*(){const K=yield k.crypto.createPassword(),W=new S.TX({keyDerivationWorkFactor:21e4,store:new _.cG({location:"DATA/AGENT/VAULT_STORE"})});let V;const Z=new S.Bq({didMethods:[B.ES,B.E6,R.hX],resolverCache:new S.Td({location:"DATA/AGENT/DID_RESOLVERCACHE"}),store:new S.QZ});k.store=new S.dk;const q=new S.yc({store:k.store});k.identityApi=q;const ne=yield g.s.create({didApi:Z,identityApi:q,agentVault:W}),ie=yield ne.firstLaunch();console.log("FIRST LAUNCH???",ie),ie&&(V=yield ne.initialize({password:K,recoveryPhrase:V,dwnEndpoints:["https://dwn.tbddev.org/beta"]}),console.log("USER AGENT RECOVERY PHRASE:",V)),yield ne.start({password:K});const ae=yield ne.identity.import({portableIdentity:M});console.log("IDENTITY MADE IN IMPORT:",ae),yield ne.sync.registerIdentity({did:ae.did.uri});const me=new x.uW({agent:ne,connectedDid:ae.did.uri});return console.log("WEB5:",me),{password:K,agentDid:me.agent.agentDid.uri,did:ae.did.uri,recoveryPhrase:V,web5:me}})()}connect(M,k){var K=this;return(0,i.A)(function*(){console.log("PASSWORD:",k);try{console.log("Connecting to Web5...");const W=yield x.uW.connect({connectedDid:M,password:k,sync:K.syncInterval});return K.accounts[M]=W.web5,W.did!=M&&console.error("Connected DID does not match the result DID:",M,W.did),K.did=W.did,K.web5=W.web5,K.agent=W.web5.agent,console.log("Web5 Connected."),K.preinitialized.set(!0),K.initialized.set(!0),K.loadAccounts(k),W}catch(W){console.error("Failed to initialize web5:",W),alert("Failed to initialize Web5:"+W)}})()}changeAccount(M){var k=this;return(0,i.A)(function*(){const K=k.accounts[M];console.log("Changing to this Account:",K),K&&(k.web5=K,k.agent=K.agent,k.did=M,k.activeAccount.set(k.web5))})()}loadAccounts(M){var k=this;return(0,i.A)(function*(){k.identities=yield k.agent.identity.list(),console.log("LIST OF ALL IDENTITIES: ",k.identities);for(const K of k.identities){const W=K?.metadata?.uri;yield k.registerAccount(W,M)}})()}registerEndpoints(M,k,K=[]){return(0,i.A)(function*(){try{for(const W of K){const V=yield M.rpc.getServerInfo(W);console.log("SERVER INFO: ",V),0!==V.registrationRequirements.length?(yield S.Vu.registerTenant(W,M.agentDid.uri),yield S.Vu.registerTenant(W,k.did.uri)):console.log("No registration requirements")}}catch(W){console.error("Failed to register DWN endpoints",W)}})()}registerAccount(M,k){var K=this;return(0,i.A)(function*(){const{web5:W}=yield x.uW.connect({connectedDid:M,password:k,sync:K.syncInterval});return K.accounts[M]=W,W})()}activeAgent(){return this.web5.agent}changePassword(M,k){var K=this;return(0,i.A)(function*(){yield K.web5.agent.vault.changePassword({oldPassword:M,newPassword:k})})()}lock(){var M=this;return(0,i.A)(function*(){console.log("Locking account..."),yield M.web5.agent.vault.lock(),console.log("Vault locked"),M.locked.set(!0)})()}unlock(M,k){var K=this;return(0,i.A)(function*(){try{console.log("Connecting to Web5...");const{did:W,web5:V}=yield x.uW.connect({connectedDid:M,sync:K.syncInterval,password:k});return K.did=W,K.web5=V,M!=W&&console.error("Connected DID does not match the result DID:",W,M),console.log("UNLOCK WAS CALLED!!"),K.initialized.set(!0),K.locked.set(!1),!0}catch(W){return console.error(W),console.log("Show unlock screen!"),K.locked.set(!0),!1}})()}static{this.\u0275fac=function(k){return new(k||E)(c.KVO(m.j))}}static{this.\u0275prov=c.jDH({token:E,factory:E.\u0275fac,providedIn:"root"})}}return E})()},36815:(Me,F,f)=>{"use strict";f.d(F,{Y:()=>B});var i=f(99327),c=f(54438),x=f(30046);let B=(()=>{class m{constructor(){this.search=(0,c.vPA)(!1),this.searchInput="",this.scrolling=(0,c.vPA)(!0),this.tray=(0,c.vPA)(!1),this.navigation=(0,c.vPA)(!1),this.margin=(0,c.vPA)(!0),this.custom=(0,c.vPA)(!1),this.actions=(0,c.vPA)([]),this.breakpointObserver=(0,c.WQX)(i.QP),this.router=(0,c.WQX)(x.Ix),this.small=(0,c.vPA)(!1),this.router.events.subscribe(_=>{_ instanceof x.Z?this.enableScrolling():_ instanceof x.wF&&(this.scrollToTop(),this.countChar("/",_.url)>1?this.enableNavigation():this.disableNavigation())}),this.breakpointObserver.observe(["(max-width: 959.98px)"]).subscribe(_=>{this.small.set(!!_.matches)}),(0,c.QZP)(()=>{const _=document.querySelector(".sidenav-scroll-wrapper");_&&(_.style.overflow=this.scrolling()?"auto":"hidden");const R=document.getElementById("sidenav-content");R&&(R.style.overflow=this.scrolling()?"auto":"hidden")})}countChar(g,_){return _.split(g).length-1}ngAfterContentInit(){}toggleSearch(){this.search.set(!this.search()),this.searchInput=""}setActions(g){this.actions.set(g)}addAction(g){this.actions.update(_=>[..._,g])}customOff(){this.custom.set(!1)}customOn(){this.custom.set(!0)}marginOff(){this.margin.set(!1)}marginOn(){this.margin.set(!0)}resetActions(){this.actions.set([])}enableScrolling(){this.scrolling.set(!0)}scrollToTop(){const g=document.querySelector(".sidenav-content");g&&(g.scrollTop=0)}disableScrolling(){this.scrolling.set(!1)}enableNavigation(){this.navigation.set(!0)}disableNavigation(){this.navigation.set(!1)}static{this.\u0275fac=function(_){return new(_||m)}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},31948:(Me,F,f)=>{"use strict";f.d(F,{s:()=>x});var i=f(54438),c=f(36815);let x=(()=>{class B{constructor(){this.prefix="ariton-",this.layout=(0,i.WQX)(c.Y),this.layout.resetActions()}save(S,g){localStorage.setItem(this.prefix+S,JSON.stringify(g))}read(S){const g=localStorage.getItem(this.prefix+S);return g?JSON.parse(g):null}remove(S){localStorage.removeItem(this.prefix+S)}clear(){Object.keys(localStorage).forEach(S=>{S.startsWith(this.prefix)&&localStorage.removeItem(S)})}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=i.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},55619:(Me,F,f)=>{"use strict";f.d(F,{o:()=>B});var i=f(30046),c=f(54438),x=f(60177);let B=(()=>{class m{constructor(g,_){this.router=g,this.location=_,this.history=[],this.router.events.subscribe(R=>{R instanceof i.wF&&this.history.push(R.urlAfterRedirects),R instanceof i.OY&&console.log("SCROLL EVENT",R)})}back(){this.history.pop(),this.history.length>0?this.location.back():this.router.navigateByUrl("/")}static{this.\u0275fac=function(_){return new(_||m)(c.KVO(i.Ix),c.KVO(x.aZ))}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},82546:(Me,F,f)=>{"use strict";f.d(F,{J:()=>S});var i=f(10467),c=f(54438),x=f(34635),B=f(5397),m=f(77494);let S=(()=>{class g{constructor(){this.identity=(0,c.WQX)(x.K)}create(R){var T=this;return(0,i.A)(function*(){const E=R,{record:j,status:M}=yield T.identity.web5.dwn.records.create({data:E,message:{protocol:B.Q.protocol,protocolPath:"event",schema:B.Q.types.event.schema,dataFormat:B.Q.types.event.dataFormats[0]}});return console.log("Notification created:",M,j),{record:j,data:E,id:j.id}})()}load(){var R=this;return(0,i.A)(function*(){const T=[],{records:E}=yield R.identity.web5.dwn.records.query({message:{filter:{protocol:B.Q.protocol,schema:B.Q.types.event.schema},dateSort:m.U0.CreatedAscending}});for(let j of E){const M=yield j.data.json();T.push({record:j,data:M,id:j.id})}return T})()}static{this.\u0275fac=function(T){return new(T||g)}}static{this.\u0275prov=c.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}}return g})()},63528:(Me,F,f)=>{"use strict";f.d(F,{x:()=>x});var i=f(10467),c=f(54438);let x=(()=>{class B{constructor(){this.title=(0,c.vPA)(""),this.timeUpdateEvent=new c.bkB,this.init()}init(){var S=this;navigator.mediaSession.setActionHandler("play",(0,i.A)(function*(){try{S.audio&&(yield S.audio.play())}catch(g){console.error(g.name,g.message)}})),navigator.mediaSession.setActionHandler("pause",()=>{this.audio&&this.audio.pause()})}previous(){}next(){}onTimeUpdate(S){this.timeUpdateEvent.subscribe(S)}createAudio(S){return this.audio||(this.audio=new Audio(S),this.audio.addEventListener("timeupdate",()=>{this.audio&&this.timeUpdateEvent.emit(this.audio.currentTime)})),this.audio}play(){var S=this;return(0,i.A)(function*(){const g="https://magazine.ariton.app/assets/creative-technology-showreel-241274.mp3";S.setTitle(g),S.audio||(S.audio=S.createAudio(g)),yield S.audio.play()})()}setTitle(S){const _=new URL(S).pathname,R=_.substring(_.lastIndexOf("/")+1);this.title=(0,c.vPA)(R),navigator.mediaSession.metadata=new MediaMetadata({title:R,artist:R,album:"Ariton",artwork:[{src:R}]}),navigator.mediaSession.playbackState="playing"}pause(){this.audio&&this.audio.pause(),navigator.mediaSession.playbackState="paused"}get paused(){return!this.audio||this.audio.paused}get time(){return this.audio?Math.floor(this.audio.currentTime):10}set time(S){this.audio&&(this.audio.currentTime=S)}get duration(){return this.audio?Math.floor(this.audio.duration):100}rate(){this.audio&&(console.log(this.audio.playbackRate),this.audio.playbackRate=2==this.audio.playbackRate?1:2)}static{this.\u0275fac=function(g){return new(g||B)}}static{this.\u0275prov=c.jDH({token:B,factory:B.\u0275fac,providedIn:"root"})}}return B})()},39434:(Me,F,f)=>{"use strict";f.d(F,{p:()=>m});var i=f(10467),c=f(54438),x=f(34635),B=f(22312);let m=(()=>{class S{constructor(){var _=this;this.identity=(0,c.WQX)(x.K),this.current=(0,c.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.selected=(0,c.vPA)({did:"",name:"",title:"",bio:"",profileImage:"",profileBanner:"",status:"",location:"",links:[],birthDate:""}),this.avatar=(0,c.vPA)(null),this.avatarSelected=(0,c.vPA)(null),(0,c.QZP)((0,i.A)(function*(){_.identity.initialized()&&_.identity.activeIdentity()&&(console.log("Active account found, loading profile...",_.identity.did),_.openCurrentUserProfile(_.identity.did))}))}loadProfile(_){var R=this;return(0,i.A)(function*(){const T=yield R.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});let E={},j=null;if(console.log("RESPONSE FOUND FOR PROFILE:",T),console.log("RECORDS FOUND FOR PROFILE1:",T.records),T.records&&T.records.length>0)for(const K of T.records)K.import(),console.log("IMPORTING PROFILE RECORD:",K),j=K,E={...yield K.data.json(),id:K.dataCid,did:K.creator,created:K.dateCreated},R.loadProfileRemote(_);else E=yield R.loadProfileRemote(_);var{avatar:M,avatarRecord:k}=yield R.loadAvatar(_);return{record:j,avatarRecord:k,avatar:M,profile:E,did:_}})()}loadAvatar(_){var R=this;return(0,i.A)(function*(){var T=null,E=null;const j=yield R.identity.web5.dwn.records.query({message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(j.records&&j.records.length>0){const M=j.records[0];T=M,E=yield M.data.text(),R.loadAvatarRemote(_)}else{yield R.loadAvatarRemote(_)}return{avatar:E,avatarRecord:T}})()}loadAvatarRemote(_){var R=this;return(0,i.A)(function*(){var T=null,E=null;const j=yield R.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"avatar",dataFormat:"image/jpeg"}}});if(j.records&&j.records.length>0){const M=j.records[0];M.import(),T=M,E=yield M.data.text()}return{avatar:E,avatarRecord:T}})()}loadProfileRemote(_){var R=this;return(0,i.A)(function*(){console.log("Loading remote profile:",_);const T=yield R.identity.web5.dwn.records.query({from:_,message:{filter:{author:_,protocol:B.ME.uri,protocolPath:"profile",dataFormat:"application/json"}}});console.log("QUERY FOR PROFILE WORKS??");let E={},j=null;if(console.log("RESPONSE FOUND FOR PROFILE:",T),console.log("RECORDS FOUND FOR PROFILE2:",T.records),T.records)for(const M of T.records)M.import(),j=M,E={...yield M.data.json(),id:M.dataCid,did:M.creator,created:M.dateCreated};return E})()}openCurrentUserProfile(_){var R=this;return(0,i.A)(function*(){console.log("Open current user profile",_);const T=yield R.loadProfile(_);R.current.set(T.profile)})()}openProfile(_){var R=this;return(0,i.A)(function*(){console.log("Open profile",_);const T=yield R.loadProfile(_);R.avatarSelected.set(T.avatar),R.selected.set(T.profile),_==R.identity.did&&(R.avatar.set(T.avatar),R.current.set(T.profile))})()}static{this.\u0275fac=function(R){return new(R||S)}}static{this.\u0275prov=c.jDH({token:S,factory:S.\u0275fac,providedIn:"root"})}}return S})()},80865:(Me,F,f)=>{"use strict";f.d(F,{w:()=>ie});var i=f(10467),c=f(54438),x=f(4053),B=f(77949),m=f(45189),S=f(49245),g=f(62060),_=f(67136),R=f(1639),T=f(69371),E=f(2685),j=f(69314),M=f(97372),k=f(70669),K=f(50963),W=f(68530),V=f(5397),Z=f(29508),q=f(32794),ne=f(34635),te=f(95416);let ie=(()=>{class ae{constructor(){this.identityService=(0,c.WQX)(ne.K),this.snackBar=(0,c.WQX)(te.UG)}register(ye){var ue=this;return(0,i.A)(function*(){const $=[j.Q,x.Q,B.Q,m.Q,S.Q,g.Q,_.Q,R.Q,T.Q,E.Q,M.Q,k.Q,K.Q,W.Q,V.Q,Z.Q,q.Q];for(const o of $){const{protocol:h,status:A}=yield ye.dwn.protocols.configure({message:{definition:o}});202!==A.code&&(console.error("Failed to install protocol:",A,h),ue.snackBar.open(`Failed to install protocol. Code: ${A.code}, Protocol: ${o.protocol}`,"Close",{duration:1e3}));const C=yield h?.send(ue.identityService.did);console.log("Protocol send status: ",C?.status)}console.log("Protocols installed.")})()}static{this.\u0275fac=function(ue){return new(ue||ae)}}static{this.\u0275prov=c.jDH({token:ae,factory:ae.\u0275fac,providedIn:"root"})}}return ae})()},51889:(Me,F,f)=>{"use strict";f.d(F,{k:()=>B});var i=f(75351),c=f(68314),x=f(54438);let B=(()=>{class m{constructor(g){this.data=g}ngAfterViewInit(){const g=document.querySelector("canvas");c.mo(g,this.data.did,_=>{_&&console.error("Error generating QR code: ",_)})}static{this.\u0275fac=function(_){return new(_||m)(x.rXU(i.Vh))}}static{this.\u0275cmp=x.VBU({type:m,selectors:[["app-qrcode-dialog"]],standalone:!0,features:[x.aNF],decls:2,vars:0,consts:[["qrCanvas",""]],template:function(_,R){1&_&&x.nrm(0,"canvas",null,0)}})}}return m})()},98703:(Me,F,f)=>{"use strict";f.d(F,{g:()=>c});var i=f(54438);let c=(()=>{class x{transform(m,S){if(m){const g=Math.floor((+new Date-+new Date(m))/1e3);if(g<29)return"Just now";const _={year:31536e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60,second:1};let R;for(const T in _)if(R=Math.floor(g/_[T]),R>0)return 1===R?R+" "+T+" ago":R+" "+T+"s ago"}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"ago",type:x,pure:!0,standalone:!0})}}return x})()},33347:(Me,F,f)=>{"use strict";f.d(F,{k:()=>c});var i=f(54438);let c=(()=>{class x{transform(m,S){if(m){const g=m.lastIndexOf(":");if(-1!==g){const _=m.slice(0,g+1),R=m.slice(g+1);return _+R.slice(0,5)+"..."+R.slice(-5)}return m.slice(0,5)+"..."+m.slice(-5)}return m}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"did",type:x,pure:!0,standalone:!0})}}return x})()},78013:(Me,F,f)=>{"use strict";f.d(F,{d:()=>x});var i=f(54438),c=f(345);let x=(()=>{class B{constructor(S){this.sanitizer=S}transform(S){return this.sanitizer.bypassSecurityTrustResourceUrl(S)}static{this.\u0275fac=function(g){return new(g||B)(i.rXU(c.up,16))}}static{this.\u0275pipe=i.EJ8({name:"safeResourceUrl",type:B,pure:!0,standalone:!0})}}return B})()},28741:(Me,F,f)=>{"use strict";f.d(F,{M:()=>c});var i=f(54438);let c=(()=>{class x{transform(m,S){if(null==m)return"";if(0===m)return"0 Bytes";const R=Math.floor(Math.log(m)/Math.log(1024));return parseFloat((m/Math.pow(1024,R)).toFixed(2))+" "+["Bytes","KB","MB","GB","TB","PB"][R]}static{this.\u0275fac=function(S){return new(S||x)}}static{this.\u0275pipe=i.EJ8({name:"size",type:x,pure:!0,standalone:!0})}}return x})()},43794:(Me,F,f)=>{"use strict";f.d(F,{n:()=>B});var i=f(10467),c=f(54438),x=f(34635);let B=(()=>{class m{constructor(){this.identity=(0,c.WQX)(x.K)}save(g,_,R){var T=this;return(0,i.A)(function*(){const{record:E,status:j}=yield T.identity.web5.dwn.records.create({data:_,message:{tags:R,protocol:g.protocol,protocolPath:g.protocolPath,schema:g.schema,dataFormat:g.dataFormat}});if(202!==j.code)throw new Error(`Failed to save data (${j.code}): ${j.detail}`);return{data:_,id:E.id,record:E}})()}load(g,_){var R=this;return(0,i.A)(function*(){var{records:T}=yield R.identity.web5.dwn.records.query({message:{filter:{tags:_,protocol:g.protocol,schema:g.schema,dataFormat:g.dataFormat}}});if(!T||0===T.length)return[];const E=[];for(const j of T){let M=yield j.data.json();E.push({record:j,data:M,id:j.id})}return E})()}get(g){var _=this;return(0,i.A)(function*(){var{record:R,status:T}=yield _.identity.web5.dwn.records.read({message:{filter:{recordId:g}}});if(200!==T.code)throw new Error(`Failed to get data (${T.code}): ${T.detail}`);return{data:yield R.data.json(),id:R.id,record:R}})()}update(g,_,R){return(0,i.A)(function*(){const{status:T}=yield g.update({data:_,tags:R});if(202!==T.code)throw new Error(`Failed to save data (${T.code}): ${T.detail}`);return{data:_,id:g.id,record:g}})()}delete(g){return(0,i.A)(function*(){const{status:_}=yield g.delete();if(202!==_.code)throw new Error(`Failed to delete data (${_.code}): ${_.detail}`)})()}static{this.\u0275fac=function(_){return new(_||m)}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},26703:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>B});var i=f(10467),c=f(54438),x=f(95416);let B=(()=>{class m{constructor(){this.snackBar=(0,c.WQX)(x.UG)}executeAsyncWithToast(g,_,R){var T=this;return(0,i.A)(function*(){try{yield g,_&&T.openSnackBar(_)}catch(E){T.openSnackBar(R||`Error: ${E}.`)}})()}openSnackBar(g){this.snackBar.open(g,void 0,{duration:2e3})}backupAccount({portableIdentity:g}={}){return(0,i.A)(function*(){if(g){const _=new Blob([JSON.stringify(g)],{type:"application/json"}),R=URL.createObjectURL(_),T=document.createElement("a");T.href=R,T.download="portableIdentity.json",document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(R)}})()}static{this.\u0275fac=function(_){return new(_||m)}}static{this.\u0275prov=c.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},12621:(Me,F,f)=>{"use strict";f.d(F,{hX:()=>Z});var i=f(10467),c=f(4080),x=f(42512),B=f(80785),m=f(70285),S=f(68989);const _={ed25519PublicKey:48,ed25519SecretSeed:144,med25519PublicKey:96,preAuthTx:152,sha256Hash:184,signedPayload:120,contract:16},R={G:"ed25519PublicKey",S:"ed25519SecretSeed",M:"med25519PublicKey",T:"preAuthTx",X:"sha256Hash",P:"signedPayload",C:"contract"};class T{static encodeEd25519PublicKey(te){return M("ed25519PublicKey",te)}static decodeEd25519PublicKey(te){return j("ed25519PublicKey",te)}static isValidEd25519PublicKey(te){return E("ed25519PublicKey",te)}static encodeEd25519SecretSeed(te){return M("ed25519SecretSeed",te)}static decodeEd25519SecretSeed(te){return j("ed25519SecretSeed",te)}static isValidEd25519SecretSeed(te){return E("ed25519SecretSeed",te)}static encodeMed25519PublicKey(te){return M("med25519PublicKey",te)}static decodeMed25519PublicKey(te){return j("med25519PublicKey",te)}static isValidMed25519PublicKey(te){return E("med25519PublicKey",te)}static encodePreAuthTx(te){return M("preAuthTx",te)}static decodePreAuthTx(te){return j("preAuthTx",te)}static encodeSha256Hash(te){return M("sha256Hash",te)}static decodeSha256Hash(te){return j("sha256Hash",te)}static encodeSignedPayload(te){return M("signedPayload",te)}static decodeSignedPayload(te){return j("signedPayload",te)}static isValidSignedPayload(te){return E("signedPayload",te)}static encodeContract(te){return M("contract",te)}static decodeContract(te){return j("contract",te)}static isValidContract(te){return E("contract",te)}static getVersionByteForPrefix(te){return R[te[0]]}}function E(ne,te){if("string"!=typeof te)return!1;switch(ne){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":if(56!==te.length)return!1;break;case"med25519PublicKey":if(69!==te.length)return!1;break;case"signedPayload":if(te.length<56||te.length>165)return!1;break;default:return!1}let ie="";try{ie=j(ne,te).toString()}catch{return!1}switch(ne){case"ed25519PublicKey":case"ed25519SecretSeed":case"preAuthTx":case"sha256Hash":case"contract":return 32===ie.length;case"med25519PublicKey":return 40===ie.length;case"signedPayload":return ie.length>=40&&ie.length<=100;default:return!1}}function j(ne,te){if("string"!=typeof te)throw new TypeError("encoded argument must be of type String");const ie=S.decode(te),ae=ie[0],me=ie.slice(0,-2),ye=me.slice(1),ue=ie.slice(-2);if(te!==S.encode(ie))throw new Error("invalid encoded string");const $=_[ne];if(void 0===$)throw new Error(`${ne} is not a valid version byte name. Expected one of ${Object.keys(_).join(", ")}`);if(ae!==$)throw new Error(`invalid version byte. expected ${$}, got ${ae}`);if(!function g(ne,te){if(ne.length!==te.length)return!1;if(0===ne.length)return!0;for(let ie=0;ie>8^ne[me]],ie&=65535;const ae=new Uint8Array(2);return ae[0]=255&ie,ae[1]=ie>>8&255,ae}const W={Ed25519VerificationKey2020:"https://w3id.org/security/suites/ed25519-2020/v1",JsonWebKey2020:"https://w3id.org/security/suites/jws-2020/v1",X25519KeyAgreementKey2020:"https://w3id.org/security/suites/x25519-2020/v1"};let Z=(()=>{class ne extends B.TI{static{this.methodName="stellar"}static create({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=yield ie.generateKey({algorithm:me}),ue=yield ie.getPublicKey({keyUri:ye}),$=yield x.Mc.publicKeyToBytes({publicKey:ue}),o=T.encodeEd25519PublicKey($),h=`did:${ne.methodName}:${o}`,C=(yield ne.resolve(h,ae)).didDocument;return new B.tW({uri:h,document:C,metadata:{},keyManager:ie})})()}static create2({keyManager:ie=new x.eP,options:ae={}}={}){return(0,i.A)(function*(){if(ae.algorithm&&ae.verificationMethods)throw new Error("The 'algorithm' and 'verificationMethods' options are mutually exclusive");if(ae.verificationMethods&&1!==ae.verificationMethods.length)throw new Error("The 'verificationMethods' option must contain exactly one entry");const me=ae.algorithm??ae.verificationMethods?.[0]?.algorithm??"Ed25519",ye=ie,ue=yield ie.generateKey({algorithm:me}),o=(yield ie.getPublicKey({keyUri:ue}),yield ye.exportKey({keyUri:ue}));console.log("privateKey",o);const A="GCFXHS4GXL6BVUCXBWXGTITROWLVYXQKQLF4YH5O5JT3YZXCYPAFBJZB",C=T.decodeEd25519SecretSeed("SAV76USXIJOBMEQXPANUOQM6F5LIOTLPDIDVRJBFFE2MDJXG24TAPUU7"),O=yield x.Mc.bytesToPrivateKey({privateKeyBytes:C});console.log("privateKeyJwk",O);const z=yield x.Mc.getPublicKey({key:O});console.log("publicKeyJwk",z);const H=yield x.Mc.publicKeyToBytes({publicKey:z}),I=T.encodeEd25519PublicKey(H);O.kid=I;const s=yield ye.getKeyUri({key:O});s===(yield ye.getKeyUri({key:z}))&&console.log("Yipppppi!!");const J=yield ye.importKey({key:O});console.log("Import result: ",J),(yield ye.exportKey({keyUri:s})).d==O.d&&console.log("Yipppppi!! PRIVATE KEY SAME!"),A==I?console.log("CORRECT!!!!"):console.warn("NO!!!!!!"),O.kid=yield(0,x.BA)({jwk:o}),O.kid=I,console.log("IDENTIFIER3: ",I),A==I?console.log("CORRECT!!!!"):console.warn("NO!!!!!!");let se=yield q.keyConverter(o.crv).privateKeyToBytes({privateKey:o});console.log("privateKeyBytes",se),console.log("Secret: ",T.encodeEd25519SecretSeed(se));const de=`did:${ne.methodName}:${I}`,Ie=(yield ne.resolve(de,ae)).didDocument;return new B.tW({uri:de,document:Ie,metadata:{},keyManager:ie})})()}static fromPrivateKey({keyManager:ie=new x.eP,privateKey:ae}){return(0,i.A)(function*(){const me=T.decodeEd25519SecretSeed(ae),ye=yield x.Mc.bytesToPrivateKey({privateKeyBytes:me}),ue=yield ie.importKey({key:ye}),$=yield ie.getPublicKey({keyUri:ue}),o=yield x.Mc.publicKeyToBytes({publicKey:$}),h=T.encodeEd25519PublicKey(o),A=`did:${ne.methodName}:${h}`,C=yield ne.resolve(A,{});return console.log("didResolutionResult",C),new B.tW({uri:A,document:C.didDocument,metadata:{},keyManager:ie})})()}static getSigningMethod({didDocument:ie}){var ae=this;return(0,i.A)(function*(){const me=B.yR.parse(ie.id);if(me&&me.method!==ae.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${me.method}`);const[ye]=ie.assertionMethod||[],ue=ie.verificationMethod?.find($=>$.id===ye);if(!ue||!ue.publicKeyJwk)throw new B.WK(B.F8.InternalError,"A verification method intended for signing could not be determined from the DID Document");return ue})()}static import({portableDid:ie,keyManager:ae=new x.eP}){return(0,i.A)(function*(){if(B.yR.parse(ie.uri)?.method!==ne.methodName)throw new B.WK(B.F8.MethodNotSupported,"Method not supported");const ye=yield B.tW.import({portableDid:ie,keyManager:ae});if(1!==ye.document.verificationMethod.length)throw new B.WK(B.F8.InvalidDidDocument,"DID document must contain exactly one verification method");return ye})()}static resolve(ie,ae){return(0,i.A)(function*(){try{const me=yield ne.createDocument({didUri:ie,options:ae});return{...B.zh,didDocument:me}}catch(me){if(!(me instanceof B.WK))throw new Error(me);return{...B.zh,didResolutionMetadata:{error:me.code,...me.message&&{errorMessage:me.message}}}}})()}static createDocument({didUri:ie,options:ae={}}){return(0,i.A)(function*(){const{defaultContext:me="https://www.w3.org/ns/did/v1"}=ae,ye={id:ie},ue=B.yR.parse(ie);if(!ue)throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const o=T.decodeEd25519PublicKey(ue.id),h=yield x.Mc.bytesToPublicKey({publicKeyBytes:o});if(ue.method!==ne.methodName)throw new B.WK(B.F8.MethodNotSupported,`Method not supported: ${ue.method}`);if(!ne.validateIdentifier(ue))throw new B.WK(B.F8.InvalidDid,`Invalid DID URI: ${ie}`);const C={id:`${ye.id}#0`,type:"JsonWebKey",controller:ye.id,publicKeyJwk:h};ye.id=ue.uri,ye.verificationMethod=[C],ye.authentication=[C.id],ye.assertionMethod=[C.id],ye.capabilityInvocation=[C.id],ye.capabilityDelegation=[C.id],ye.keyAgreement=[C.id];const O=[me];return(0,m.getVerificationMethodTypes)({didDocument:ye}).forEach(H=>{O.push(W[H])}),ye["@context"]=O,ye.service=[{id:"dwn",type:"DecentralizedWebNode",serviceEndpoint:["https://dwn.tbddev.org/beta"]}],ye})()}static deriveEncryptionKey({multibaseValue:ie}){return(0,i.A)(function*(){let ae={keyBytes:new Uint8Array,multicodecCode:0};const{keyBytes:me,multicodecCode:ye}=(0,m.multibaseIdToKeyBytes)({multibaseKeyId:ie});if(237===ye){const ue=yield q.keyConverter("Ed25519").bytesToPublicKey({publicKeyBytes:me}),$=yield x.Mc.convertPublicKeyToX25519({publicKey:ue});ae={keyBytes:yield q.keyConverter("Ed25519").publicKeyToBytes({publicKey:$}),multicodecCode:236}}return ae})()}static validateIdentifier(ie){const{method:ae,id:me}=ie,[ye]=ie.uri.split(":",1);return"did"===ye&&"stellar"===ae&&Number("1")>0&&"String"===(0,c.fc)(me)&&me.startsWith("G")}}return ne})(),q=(()=>{class ne{static{this.JWK_TO_MULTICODEC={"Ed25519:public":"ed25519-pub","Ed25519:private":"ed25519-priv","secp256k1:public":"secp256k1-pub","secp256k1:private":"secp256k1-priv","X25519:public":"x25519-pub","X25519:private":"x25519-priv"}}static{this.MULTICODEC_PUBLIC_KEY_LENGTH={231:33,236:32,237:32}}static{this.MULTICODEC_TO_JWK={"ed25519-pub":{crv:"Ed25519",kty:"OKP",x:""},"ed25519-priv":{crv:"Ed25519",kty:"OKP",x:"",d:""},"secp256k1-pub":{crv:"secp256k1",kty:"EC",x:"",y:""},"secp256k1-priv":{crv:"secp256k1",kty:"EC",x:"",y:"",d:""},"x25519-pub":{crv:"X25519",kty:"OKP",x:""},"x25519-priv":{crv:"X25519",kty:"OKP",x:"",d:""}}}static keyCompressor(ie){const me={"P-256":x.iH.compressPublicKey,secp256k1:x.jg.compressPublicKey}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}static keyConverter(ie){const me={Ed25519:x.Mc,"P-256":x.iH,secp256k1:x.jg,X25519:x.Nx}[ie];if(!me)throw new B.WK(B.F8.InvalidPublicKeyType,`Unsupported curve: ${ie}`);return me}}return ne})()},70236:(Me,F,f)=>{"use strict";var i=f(345),c=f(54438),x=f(30046),B=f(10467),m=f(52778),S=f(36815),g=f(34635),_=f(97372),R=f(60177),T=f(89417),E=f(88834),j=f(75351),M=f(99213),k=f(99631),K=f(59115),W=f(14823),V=f(53719);let Z=(()=>{class v{constructor(u,w){this.dialogRef=u,this.data=w,this.fb=(0,c.WQX)(T.ok),this.form=this.fb.group({name:[null,T.k0.required]})}ngAfterViewInit(){}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(j.CP),c.rXU(j.Vh))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-folder-dialog"]],standalone:!0,features:[c.aNF],decls:10,vars:2,consts:[["mat-dialog-title",""],["appearance","outline",1,"full-width"],["matInput","","required","true","placeholder","Name","maxlength","200",3,"ngModelChange","ngModel"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(w,U){1&w&&(c.j41(0,"h2",0),c.EFF(1,"Folder name"),c.k0s(),c.j41(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"input",2),c.mxI("ngModelChange",function(le){return c.DH7(U.data.name,le)||(U.data.name=le),le}),c.k0s()()(),c.j41(5,"mat-dialog-actions",3)(6,"button",4),c.EFF(7,"Cancel"),c.k0s(),c.j41(8,"button",5),c.EFF(9,"Save"),c.k0s()()),2&w&&(c.R7$(4),c.R50("ngModel",U.data.name),c.R7$(4),c.Y8G("mat-dialog-close",!0))},dependencies:[R.MD,W.uc,K.Cn,M.m_,E.Hl,E.$z,k.fS,k.fg,V.rl,j.hM,j.tx,j.BI,j.E7,j.Yi,T.YN,T.me,T.BC,T.YS,T.tU,T.vS],styles:["form[_ngcontent-%COMP%]{display:inline}"]})}}return v})();var q=f(3902),ne=f(98703),te=f(5964);let ie=(()=>{class v{constructor(u,w){this.router=u,this.activatedRoute=w,this.breadcrumbs=[],this.router.events.pipe((0,te.p)(U=>U instanceof x.wF)).subscribe(()=>{this.breadcrumbs=this.createBreadcrumbs(this.activatedRoute.root)})}createBreadcrumbs(u,w="",U=[]){const Y=u.children;if(0===Y.length)return U;for(const le of Y){const ge=le.snapshot.url.map(Pe=>Pe.path).join("/");return""!==ge&&(w+=`/${ge}`),U.push({label:le.snapshot.data.breadcrumb,url:w}),this.createBreadcrumbs(le,w,U)}return U}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(x.Ix),c.KVO(x.nX))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})(),ae=(()=>{class v{constructor(){}registerActions(u){}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})();var me=f(28741),ye=f(77494),ue=f(2042),$=f(9159),o=f(25596);function h(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",18),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.up())}),c.j41(1,"mat-icon"),c.EFF(2,"arrow_upward"),c.k0s()()}}function A(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",18),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolder(null))}),c.j41(1,"mat-icon"),c.EFF(2,"create_new_folder"),c.k0s()()}}function C(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",20),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolder(null))}),c.j41(1,"mat-icon"),c.EFF(2,"create_new_folder"),c.k0s(),c.j41(3,"span"),c.EFF(4,"New folder"),c.k0s()()}}function O(v,a){if(1&v&&c.DNE(0,A,3,0,"button",1)(1,C,5,0,"button",19),2&v){const u=c.XpG();c.vxM(u.layout.small()?0:1)}}function z(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",21),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolderById(U.parentId))}),c.j41(1,"mat-icon"),c.EFF(2,"edit"),c.k0s()(),c.j41(3,"button",21),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.deleteFolder())}),c.j41(4,"mat-icon"),c.EFF(5,"delete_forever"),c.k0s()()}}function H(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",2),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.editFolderById(U.parentId))}),c.j41(1,"mat-icon"),c.EFF(2,"edit"),c.k0s(),c.j41(3,"span"),c.EFF(4,"Rename folder"),c.k0s()(),c.j41(5,"button",2),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.deleteFolder())}),c.j41(6,"mat-icon"),c.EFF(7,"delete_forever"),c.k0s(),c.j41(8,"span"),c.EFF(9,"Delete folder"),c.k0s()()}}function I(v,a){if(1&v&&c.DNE(0,z,6,0)(1,H,10,0),2&v){const u=c.XpG();c.vxM(u.layout.small()?0:1)}}function s(v,a){1&v&&c.nrm(0,"th",22)}function p(v,a){if(1&v){const u=c.RV6();c.j41(0,"td",23),c.bIt("click",function(){const U=c.eBV(u).$implicit,Y=c.XpG();return c.Njj(Y.openEntry(U))}),c.j41(1,"mat-icon",24),c.EFF(2),c.k0s()()}if(2&v){const u=a.$implicit;c.R7$(2),c.JRh(u.icon)}}function J(v,a){1&v&&(c.j41(0,"th",25),c.EFF(1,"Name"),c.k0s())}function ee(v,a){if(1&v){const u=c.RV6();c.j41(0,"td",26),c.bIt("click",function(){const U=c.eBV(u).$implicit,Y=c.XpG();return c.Njj(Y.openEntry(U))}),c.EFF(1),c.k0s()}if(2&v){const u=a.$implicit;c.R7$(),c.JRh(u.name)}}function se(v,a){1&v&&(c.j41(0,"th",27),c.EFF(1,"Modified"),c.k0s())}function de(v,a){if(1&v&&(c.j41(0,"td",28),c.EFF(1),c.nI1(2,"ago"),c.k0s()),2&v){const u=a.$implicit;c.R7$(),c.SpI(" ",c.bMT(2,1,u.modified)," ")}}function Ae(v,a){1&v&&(c.j41(0,"th",29),c.EFF(1,"File size"),c.k0s())}function Ie(v,a){if(1&v&&(c.j41(0,"td",28),c.EFF(1),c.nI1(2,"size"),c.k0s()),2&v){const u=a.$implicit;c.R7$(),c.JRh(c.bMT(2,1,u.size))}}function Le(v,a){1&v&&c.nrm(0,"tr",30)}function xe(v,a){1&v&&c.nrm(0,"tr",31)}class Ce{constructor(a){this.icon="folder"==a.tags.entryType?"folder":"note",this.name=a.tags.name,this.modified="folder"===a.tags.entryType?a.dateModified:a.tags.lastModified,this.size=a.tags.size,this.type=a.tags.type,this.entryType=a.tags.entryType,this.record=a}}let Xe=(()=>{class v{constructor(){var u=this;this.entries=(0,c.vPA)([]),this.app=(0,c.WQX)(m.d),this.breadcrumb=(0,c.WQX)(ie),this.layout=(0,c.WQX)(S.Y),this.identity=(0,c.WQX)(g.K),this.dialog=(0,c.WQX)(j.bZ),this.router=(0,c.WQX)(x.Ix),this.route=(0,c.WQX)(x.nX),this.fileService=(0,c.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.protocolPath="entry",this.hasInitialized=!1,this.folderLevel=1,this.displayedColumns=["icon","name","modified","size"],this.dataSource=new $.I6([]),this.changeDetectorRefs=(0,c.WQX)(c.gRc),this.layout.resetActions(),(0,c.QZP)((0,B.A)(function*(){if(u.app.initialized()){if(u.hasInitialized)return;const w=u.getResolvedUrl(u.route.snapshot);yield u.processUrl(w)}}),{allowSignalWrites:!0}),(0,c.QZP)((0,B.A)(function*(){u.updateTable()})),this.routingSub=this.router.events.subscribe(function(){var w=(0,B.A)(function*(U){U instanceof x.wF&&(yield u.processUrl(U.urlAfterRedirects))});return function(U){return w.apply(this,arguments)}}()),this.layout.disableNavigation(),console.log("FOLDER COMPONENT INITIALIZED")}ngAfterViewInit(){this.dataSource.sort=this.sort}updateTable(){this.dataSource.data=this.entries().map(u=>new Ce(u))}up(){const w=this.router.url.split("/");if(w.length>1){w.pop();const U=w.join("/");this.router.navigate([U])}}sortData(u){}announceSortChange(u){}getValueAfterFolder(u){const w=u.match(/\/folder\/(.+)/);return w?w[1]:null}generateUrl(u){const w=[];for(let U=0;UY.url.map(le=>le.toString()).join("/")).join("/");const U=u.queryParamMap;return U.keys.length>0&&(w+="?"+U.keys.map(Y=>U.getAll(Y).map(le=>Y+"="+le).join("&")).join("&")),w}editFile(u){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}ngOnDestroy(){console.log("ON DESTROY!!!);"),this.routingSub.unsubscribe(),this.layout.resetActions()}onFileSelected(u){var w=this;return(0,B.A)(function*(){const U=u.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let Y=0;Y[..._t,dt])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var u=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield u.identity.web5.dwn.records.create({data:u.file,message:{schema:_.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}deleteFolder(){var u=this;return(0,B.A)(function*(){const{record:w}=yield u.identity.web5.dwn.records.read({message:{filter:{recordId:u.parentId}}});if(w){const{status:U}=yield w.delete({prune:!0});console.log("Delete status:",U);const Y=u.contextId.split("/").slice(0,-1);console.log("Parent path:",Y),u.router.navigate(["app","files","folder",...Y])}})()}editFolderById(u){var w=this;return(0,B.A)(function*(){const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:u}}});yield w.editFolder(U)})()}editFolder(u){var w=this;return(0,B.A)(function*(){let U={name:u?u.tags.name:"Untitled folder",entryType:"folder"};const Y=JSON.parse(JSON.stringify(U)),le=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return le.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),yield w.saveFolder(u,U)):U=Y});return function(Pe){return ge.apply(this,arguments)}}()),le.afterClosed()})()}saveFolder(u,w){var U=this;return(0,B.A)(function*(){if(u){const Y={name:w.name,entryType:w.entryType},{status:le}=yield u.update({tags:Y,data:{}});console.log("Record status:",le)}else{const Y={tags:{name:w.name,entryType:w.entryType},protocol:_.Q.protocol,protocolPath:U.protocolPath,parentContextId:U.contextId??=void 0,schema:_.Q.types.entry.schema};console.log("Create folder:",Y);const{record:le,status:ge}=yield U.identity.web5.dwn.records.create({data:{},message:Y});console.log("Record created:",le),console.log("Record status:",ge),le&&U.entries.update(Pe=>[...Pe,le])}})()}openEntry(u){var w=this;return(0,B.A)(function*(){console.log(u),w.router.navigate("folder"===u.entryType?["/app/files/folder/"+u.record.contextId]:["/app/files/file/"+u.record.id])})()}loadEntries(u){var w=this;return(0,B.A)(function*(){console.log("VALUE OF TAGS:",u),console.log("PARENT ID:",w.parentId),console.log("PARENT CONTEXT ID:",w.contextId);const U={filter:{protocolPath:w.protocolPath,protocol:_.Q.protocol,schema:_.Q.types.entry.schema},dateSort:ye.U0.CreatedDescending};w.parentId&&"root"!==w.parentId&&(U.filter.parentId=w.parentId),console.log(U);var{records:Y}=yield w.identity.web5.dwn.records.query({message:U});w.entries.set(Y??[]),console.log("All entries:",w.entries())})()}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-folder"]],viewQuery:function(w,U){if(1&w&&c.GBs(ue.B4,5),2&w){let Y;c.mGM(Y=c.lsd())&&(U.sort=Y.first)}},standalone:!0,features:[c.aNF],decls:26,vars:6,consts:[[1,"toolbar-actions","margin-bottom"],["mat-icon-button","",1,"toolbar-icon-button"],["type","button","mat-button","",3,"click"],["type","file","id","input","multiple","",2,"display","none",3,"change"],["mat-table","","matSort","",3,"matSortChange","dataSource"],["matColumnDef","icon"],["mat-header-cell","","mat-sort-header","","class","icon-column",4,"matHeaderCellDef"],["mat-cell","","class","clickable icon-column",3,"click",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name",4,"matHeaderCellDef"],["mat-cell","","class","clickable",3,"click",4,"matCellDef"],["matColumnDef","modified"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","size"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-button",""],["mat-button","",3,"click"],["type","button","mat-icon-button","",1,"toolbar-icon-button",3,"click"],["mat-header-cell","","mat-sort-header","",1,"icon-column"],["mat-cell","",1,"clickable","icon-column",3,"click"],["matListItemIcon",""],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by name"],["mat-cell","",1,"clickable",3,"click"],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by modified"],["mat-cell",""],["mat-header-cell","","mat-sort-header","","sortActionDescription","Sort by file size"],["mat-header-row",""],["mat-row",""]],template:function(w,U){1&w&&(c.j41(0,"mat-card",0)(1,"mat-card-content"),c.DNE(2,h,3,0,"button",1),c.j41(3,"button",2),c.bIt("click",function(){return U.editFile({})}),c.j41(4,"mat-icon"),c.EFF(5,"upload_file"),c.k0s(),c.j41(6,"span"),c.EFF(7,"Upload files"),c.k0s()(),c.DNE(8,O,2,1)(9,I,2,1),c.k0s()(),c.j41(10,"input",3),c.bIt("change",function(le){return U.onFileSelected(le)}),c.k0s(),c.j41(11,"table",4),c.bIt("matSortChange",function(le){return U.sortData(le)}),c.qex(12,5),c.DNE(13,s,1,0,"th",6)(14,p,3,1,"td",7),c.bVm(),c.qex(15,8),c.DNE(16,J,2,0,"th",9)(17,ee,2,1,"td",10),c.bVm(),c.qex(18,11),c.DNE(19,se,2,0,"th",12)(20,de,3,3,"td",13),c.bVm(),c.qex(21,14),c.DNE(22,Ae,2,0,"th",15)(23,Ie,3,3,"td",13),c.bVm(),c.DNE(24,Le,1,0,"tr",16)(25,xe,1,0,"tr",17),c.k0s()),2&w&&(c.R7$(2),c.vxM(U.folderLevel>1?2:-1),c.R7$(6),c.vxM(U.folderLevel<4?8:-1),c.R7$(),c.vxM(U.folderLevel>1?9:-1),c.R7$(2),c.Y8G("dataSource",U.dataSource),c.R7$(13),c.Y8G("matHeaderRowDef",U.displayedColumns),c.R7$(),c.Y8G("matRowDefColumns",U.displayedColumns))},dependencies:[o.Hu,o.RN,o.m2,E.Hl,E.$z,E.iY,$.tP,$.Zl,$.tL,$.ji,$.cC,$.YV,$.iL,$.KS,$.$R,$.YZ,$.NB,ue.NQ,ue.B4,ue.aE,me.M,R.MD,q.Fg,q.ZV,M.m_,M.An,ne.g],styles:["table[_ngcontent-%COMP%]{width:100%}.icon-column[_ngcontent-%COMP%]{width:36px;max-width:36px;min-width:36px}"]})}}return v})();var Te=function(v){return v.PDF="application/pdf",v.JPEG="image/jpeg",v.PNG="image/png",v.MP4="video/mp4",v.MP3="audio/mpeg",v}(Te||{});const ke=["*"],Se=v=>({transform:v});function Ee(v,a){if(1&v&&(c.j41(0,"div",1),c.nrm(1,"iframe",2),c.k0s()),2&v){const u=c.XpG();c.R7$(),c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")"))("src",u.src,c.f$h)}}function ve(v,a){if(1&v&&c.nrm(0,"iframe",2),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")"))("src",u.src,c.f$h)}}function De(v,a){if(1&v&&c.nrm(0,"iframe",2),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")"))("src",u.src,c.f$h)}}function Re(v,a){if(1&v&&(c.j41(0,"video",3),c.nrm(1,"source",5),c.EFF(2," Your browser does not support HTML5 video. "),c.k0s()),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")")),c.R7$(),c.Y8G("src",u.src,c.B4B)}}function Je(v,a){if(1&v&&(c.j41(0,"audio",4),c.nrm(1,"source",6),c.EFF(2," Your browser does not support the audio element. "),c.k0s()),2&v){const u=c.XpG();c.Y8G("ngStyle",c.eq3(2,Se,"scale("+u.zoom+")")),c.R7$(),c.Y8G("src",u.src,c.B4B)}}function $e(v,a){1&v&&(c.j41(0,"span",null,0),c.SdG(2),c.k0s())}let nt=(()=>{class v{ngAfterViewInit(){const u=document.getElementById("frame");if(u&&u.contentDocument){const w=document.createElement("style");w.textContent="\n body {\n background-color: #f0f0f0;\n margin: 0;\n padding: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n ",u.contentDocument.head.appendChild(w)}}ngOnInit(){this.totalPages=this.getPdfTotalPages()}goToPage(){this.currentPage<1?this.currentPage=1:this.currentPage>this.totalPages&&(this.currentPage=this.totalPages)}constructor(){this.fileMimeType=Te,this.zoom=1,this.currentPage=1,this.totalPages=1,this.totalPages=this.getPdfTotalPages()}getPdfTotalPages(){return 10}goToPreviousPage(){this.currentPage>1&&this.currentPage--}goToNextPage(){this.currentPagef.e(4630).then(f.bind(f,64630)).then(v=>v.IntroductionComponent),title:"Introduction",data:{hide:!0,icon:"lightbulb"}},{path:"dashboard",loadComponent:()=>Promise.all([f.e(6195),f.e(2320)]).then(f.bind(f,62320)).then(v=>v.DashboardComponent),title:"Dashboard",data:{hide:!0,icon:"dashboard"}},{path:"communities",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(2076),f.e(6702)]).then(f.bind(f,6702)).then(v=>v.CommunitiesComponent),title:"Communities",data:{icon:"diversity_2"}},{path:"app/projects",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(8101)]).then(f.bind(f,18101)).then(v=>v.ProjectsComponent),title:"Projects",data:{hide:!0,icon:"diversity_1"}},{path:"communities/create",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(v=>v.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"communities/create/:id",loadComponent:()=>Promise.all([f.e(2765),f.e(3475),f.e(2076),f.e(9847)]).then(f.bind(f,99847)).then(v=>v.CreateComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"community/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3028)]).then(f.bind(f,73028)).then(v=>v.CommunityComponent),title:"Communities",data:{hide:!0,icon:"diversity_2"}},{path:"friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(v=>v.FriendsComponent),title:"Friends",data:{hide:!0,icon:"people"}},{path:"app/friends",loadComponent:()=>Promise.all([f.e(6850),f.e(9996),f.e(8834)]).then(f.bind(f,38834)).then(v=>v.FriendsComponent),title:"Friends",data:{hide:!1,icon:"people"}},{path:"app/chat",redirectTo:"app/chat/home",pathMatch:"full"},{path:"app/chat/:id",loadComponent:()=>f.e(3446).then(f.bind(f,63446)).then(v=>v.ChatComponent),title:"Chat",data:{icon:"chat"}},{path:"app/voluntaryist-covenant",loadComponent:()=>Promise.all([f.e(6850),f.e(4885)]).then(f.bind(f,74885)).then(v=>v.VoluntaryistCovenantComponent),title:"Voluntaryist Covenant",data:{hide:!0,icon:"assured_workload"}},{path:"marketplace",loadComponent:()=>f.e(4392).then(f.bind(f,94392)).then(v=>v.MarketplaceComponent),title:"Marketplace",data:{icon:"storefront"}},{path:"apps",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(946)]).then(f.bind(f,50946)).then(v=>v.AppsComponent),title:"Apps",data:{icon:"apps"}},{path:"app/files",loadComponent:()=>f.e(6797).then(f.bind(f,46797)).then(v=>v.FilesComponent),title:"Files",data:{icon:"folder",breadcrumb:"Files"},children:[{path:"",pathMatch:"full",redirectTo:"folder/root"},{path:"file/:id",component:(()=>{class v{constructor(){var u=this;this.entries=(0,c.vPA)([]),this.app=(0,c.WQX)(m.d),this.breadcrumb=(0,c.WQX)(ie),this.layout=(0,c.WQX)(S.Y),this.identity=(0,c.WQX)(g.K),this.dialog=(0,c.WQX)(j.bZ),this.router=(0,c.WQX)(x.Ix),this.route=(0,c.WQX)(x.nX),this.fileService=(0,c.WQX)(ae),this.uploadProgress=null,this.isUploading=!1,this.file=null,this.uploadSuccess=!1,this.fileError=null,this.fileId=null,this.sanitizer=(0,c.WQX)(i.up),this.navigation=(0,c.WQX)(Tt.o),this.zoom=1,this.loading=!1,this.fullscreen=(0,c.vPA)(!1),this.canZoomIn=!1,this.canZoomOut=!0,this.fileMimeType=Te,this.pdfZoom=1,(0,c.QZP)((0,B.A)(function*(){u.app.initialized()&&(yield u.loadEntries())})),this.route.paramMap.subscribe(w=>{console.log("ROUTING!!!",w.get("id")),this.fileId=w.get("id")})}toggleFullscreen(){var u=document.getElementById("file-viewer");this.fullscreen()?(document.exitFullscreen(),this.fullscreen.set(!1)):(u.requestFullscreen(),this.fullscreen.set(!0))}updateZoomControls(){this.canZoomIn=this.zoom<1,this.canZoomOut=this.zoom>.1}zoomIn(){this.zoom=Math.min(1,this.zoom+.1),this.updateZoomControls()}zoomOut(){this.zoom=Math.max(.1,this.zoom-.1),this.updateZoomControls()}download(){const u=URL.createObjectURL(this.fileUrl),w=document.createElement("a");console.log("File URL"),console.log(u),w.href=u;const U=this.record?.tags.name;w.download=U,w.click(),URL.revokeObjectURL(u)}pdfZoomIn(){this.pdfZoom++}pdfZoomOut(){this.pdfZoom>1&&this.pdfZoom--}editFile(u){return(0,B.A)(function*(){document.getElementById("input")?.click()})()}onFileSelected(u){var w=this;return(0,B.A)(function*(){const U=u.currentTarget.files;if(0!=U.length){console.log("Uploading number of files:",U.length);for(let Y=0;Y[...Ht,{record:Ot,data:dt}])}}})()}cancelUpload(){return(0,B.A)(function*(){})()}upload(){var u=this;return(0,B.A)(function*(){console.log("Uploading file");const{status:w,record:U}=yield u.identity.web5.dwn.records.create({data:u.file,message:{schema:_.Q.types.entry.schema}});return console.log("Record created:",U),console.log("Record status:",w),U})()}editFolder(u){var w=this;return(0,B.A)(function*(){let U={name:u.data.name,entryType:"folder"};const Y=JSON.parse(JSON.stringify(U)),le=w.dialog.open(Z,{maxWidth:"80vw",maxHeight:"80vh",data:U});return le.afterClosed().subscribe(function(){var ge=(0,B.A)(function*(Pe){Pe?(console.log("data result for saving:",U),u.data=U,yield w.saveFolder(u,U)):U=Y});return function(Pe){return ge.apply(this,arguments)}}()),le.afterClosed()})()}saveFolder(u,w){var U=this;return(0,B.A)(function*(){if(u.record){const{status:Y,record:le}=yield u.record.update({data:w});console.log("Record created:",le),console.log("Record status:",Y)}else{const{record:Y,status:le}=yield U.identity.web5.dwn.records.create({data:w,message:{tags:{entryType:w.entryType},protocol:_.Q.protocol,protocolPath:"entry",schema:_.Q.types.entry.schema}});console.log("Record created:",Y),console.log("Record status:",le),Y&&(u.record=Y,U.entries.update(ge=>[...ge,u]))}})()}openEntry(u){var w=this;return(0,B.A)(function*(){w.router.navigate("folder"===u.entryType?["/app/files/folder",u.record.id]:["/app/files/file",u.record.id])})()}deleteFile(){var u=this;return(0,B.A)(function*(){u.loading=!0;const{status:w}=yield u.record.delete(),{status:U}=yield u.record.send(u.identity.did);console.log("Delete status:",w),console.log("Delete send status:",U),u.record=void 0,u.src=void 0,u.navigation.back()})()}loadEntries(u){var w=this;return(0,B.A)(function*(){if(console.log("VALUE OF TAGS:",u),!w.fileId)return;const{record:U}=yield w.identity.web5.dwn.records.read({message:{filter:{recordId:w.fileId}}});if(w.record=U,w.fileUrl=yield U.data.blob(),console.log(U),w.type=U.dataFormat,"application/pdf"===U.dataFormat){const Y=URL.createObjectURL(w.fileUrl)+"#toolbar=0&navpanes=0&scrollbar=0&view=FitH";w.src=w.sanitizer.bypassSecurityTrustResourceUrl(Y)}else{const Y=URL.createObjectURL(w.fileUrl);w.src=w.sanitizer.bypassSecurityTrustResourceUrl(Y)}})()}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-file"]],standalone:!0,features:[c.aNF],decls:3,vars:2,consts:[["id","file-viewer"],[3,"src","type","zoom"],["mat-icon-button","",3,"click","title","disabled"],["mat-icon-button","",3,"click","title"],[1,"ellipsis",3,"matTooltip"],[1,"toolbar-spacer"],["mat-icon-button","",3,"click","disabled"],["mat-icon-button","",3,"title"]],template:function(w,U){1&w&&(c.j41(0,"div",0),c.DNE(1,re,17,7,"mat-toolbar")(2,X,3,3,"app-file-viewer",1),c.k0s()),2&w&&(c.R7$(),c.vxM(U.record?1:-1),c.R7$(),c.vxM(U.src?2:-1))},dependencies:[nt,R.MD,q.Fg,M.m_,M.An,Qe.s5,Qe.KQ,E.Hl,E.iY,W.uc,W.oV]})}}return v})(),data:{breadcrumb:"Folder"}},{path:"**",component:Xe,data:{breadcrumb:"Folder"}}]},{path:"app/notes",loadComponent:()=>Promise.all([f.e(6471),f.e(8067),f.e(5832)]).then(f.bind(f,55832)).then(v=>v.NotesComponent),title:"Notes",data:{icon:"note"}},{path:"app/player",loadComponent:()=>f.e(2429).then(f.bind(f,22429)).then(v=>v.PlayerComponent),title:"Player",data:{icon:"play_circle"}},{path:"app/text",loadComponent:()=>Promise.all([f.e(6471),f.e(2765),f.e(8067),f.e(6406)]).then(f.bind(f,86406)).then(v=>v.TextComponent),title:"Text",data:{icon:"notes"}},{path:"app/tasks",redirectTo:"app/tasks/home",pathMatch:"full"},{path:"app/tasks/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(2765),f.e(1391),f.e(3907)]).then(f.bind(f,93907)).then(v=>v.TasksComponent),title:"Tasks",data:{icon:"task"}},{path:"registries",loadComponent:()=>Promise.all([f.e(6695),f.e(9466)]).then(f.bind(f,69466)).then(v=>v.RegistriesComponent),title:"Registries",data:{icon:"folder_shared"}},{path:"registry/bsn",loadComponent:()=>Promise.all([f.e(6850),f.e(6695),f.e(6471),f.e(2076),f.e(5026)]).then(f.bind(f,65026)).then(v=>v.RegistryComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/freeid",loadComponent:()=>f.e(7160).then(f.bind(f,47160)).then(v=>v.FreeIDComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/podcast",loadComponent:()=>f.e(60).then(f.bind(f,80060)).then(v=>v.PodcastComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/liberstad-land-registry",loadComponent:()=>f.e(8880).then(f.bind(f,68880)).then(v=>v.LiberstadLandComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/gaianet",loadComponent:()=>f.e(4388).then(f.bind(f,64388)).then(v=>v.GaianetComponent),title:"Gaianet",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(2084)]).then(f.bind(f,32084)).then(v=>v.LocalCompanyComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"registry/local-company-registry/:id",loadComponent:()=>Promise.all([f.e(6695),f.e(450),f.e(6195),f.e(9158)]).then(f.bind(f,89158)).then(v=>v.LocalCompanyViewComponent),title:"Registry",data:{hide:!0,icon:"folder_shared"}},{path:"data/view/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(3474)]).then(f.bind(f,53474)).then(v=>v.DataViewComponent),title:"Data View",data:{hide:!0,icon:"folder_shared"}},{path:"data",loadComponent:()=>Promise.all([f.e(6850),f.e(7358),f.e(9454),f.e(3287)]).then(f.bind(f,63287)).then(v=>v.DataComponent),title:"Data",data:{hide:!0,icon:"source"}},{path:"data/:source/:id",loadComponent:()=>Promise.all([f.e(2076),f.e(9533)]).then(f.bind(f,29533)).then(v=>v.DataEntryComponent),title:"Data Entry",data:{hide:!0,icon:"source"}},{path:"profile/:id",loadComponent:()=>Promise.all([f.e(6850),f.e(6489)]).then(f.bind(f,96489)).then(v=>v.ProfileComponent),title:"Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/edit",loadComponent:()=>Promise.all([f.e(3475),f.e(7380)]).then(f.bind(f,37380)).then(v=>v.ProfileEditComponent),title:"Edit Profile",data:{hide:!0,icon:"account_circle"}},{path:"profile/:id/posts/:postId",loadComponent:()=>f.e(5680).then(f.bind(f,45680)).then(v=>v.PostComponent),title:"Posts",data:{hide:!0,icon:"note"}},{path:"notifications",loadComponent:()=>f.e(2228).then(f.bind(f,92228)).then(v=>v.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"notifications"}},{path:"accounts",loadComponent:()=>Promise.all([f.e(6850),f.e(9454),f.e(6486)]).then(f.bind(f,96486)).then(v=>v.AccountsComponent),title:"Accounts",data:{hide:!0,icon:"account_circle"}},{path:"account/password",loadComponent:()=>f.e(8012).then(f.bind(f,88012)).then(v=>v.PasswordComponent),title:"Password",data:{hide:!0,icon:"account_circle"}},{path:"account/backup",loadComponent:()=>f.e(5962).then(f.bind(f,75962)).then(v=>v.BackupComponent),title:"Backup",data:{hide:!0,icon:"account_circle"}},{path:"account/create",loadComponent:()=>f.e(5806).then(f.bind(f,75806)).then(v=>v.CreateComponent),title:"Create Account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/new",loadComponent:()=>f.e(9613).then(f.bind(f,29613)).then(v=>v.NewComponent),title:"Create new account",data:{hide:!0,icon:"account_circle"}},{path:"account/create/restore",loadComponent:()=>Promise.resolve().then(f.bind(f,33065)).then(v=>v.RestoreComponent),title:"Restore existing account",data:{hide:!0,icon:"account_circle"}},{path:"account/:id",loadComponent:()=>f.e(7880).then(f.bind(f,17880)).then(v=>v.AccountComponent),title:"Account",data:{hide:!0,icon:"account_circle"}},{path:"identity",loadComponent:()=>f.e(5854).then(f.bind(f,85854)).then(v=>v.IdentityComponent),title:"Identity",data:{hide:!0,icon:"account_circle"}},{path:"settings",loadComponent:()=>f.e(959).then(f.bind(f,60959)).then(v=>v.SettingsComponent),title:"Settings",data:{hide:!0,icon:"settings"}},{path:"settings/about",loadComponent:()=>f.e(5216).then(f.bind(f,85216)).then(v=>v.AboutComponent),title:"About",data:{hide:!0,icon:"settings"}},{path:"settings/licenses",loadComponent:()=>f.e(9727).then(f.bind(f,19727)).then(v=>v.LicensesComponent),title:"Licenses",data:{hide:!0,icon:"settings"}},{path:"settings/privacy",loadComponent:()=>f.e(9128).then(f.bind(f,99128)).then(v=>v.PrivacyComponent),title:"Privacy",data:{hide:!0,icon:"settings"}},{path:"settings/handler",loadComponent:()=>f.e(8552).then(f.bind(f,18552)).then(v=>v.HandlerComponent),title:"Protocol Handler",data:{hide:!0,icon:"search"}},{path:"settings/connections",loadComponent:()=>Promise.all([f.e(9996),f.e(2276)]).then(f.bind(f,62276)).then(v=>v.ConnectionsComponent),title:"Connections",data:{hide:!0,icon:"people"}},{path:"settings/blocks",loadComponent:()=>f.e(5874).then(f.bind(f,45874)).then(v=>v.BlocksComponent),title:"Blocks",data:{hide:!0,icon:"manage_accounts"}},{path:"settings/roles",loadComponent:()=>f.e(7660).then(f.bind(f,47660)).then(v=>v.RolesComponent),title:"Roles",data:{hide:!0,icon:"group"}},{path:"settings/notifications",loadComponent:()=>f.e(4500).then(f.bind(f,74500)).then(v=>v.NotificationsComponent),title:"Notifications",data:{hide:!0,icon:"settings"}},{path:"settings/debug",loadComponent:()=>f.e(3416).then(f.bind(f,13416)).then(v=>v.DebugComponent),title:"Debug",data:{hide:!0,icon:"bug_report"}},{path:"tree",loadComponent:()=>Promise.all([f.e(7358),f.e(9238)]).then(f.bind(f,9238)).then(v=>v.TreeComponent),title:"Tree",data:{hide:!0,icon:"folder"}},{path:"drag-drop",loadComponent:()=>Promise.all([f.e(1391),f.e(7988)]).then(f.bind(f,77988)).then(v=>v.DragDropComponent),title:"Drag-Drop",data:{hide:!0,icon:"folder"}},{path:"storage",loadComponent:()=>Promise.all([f.e(6471),f.e(7848)]).then(f.bind(f,17848)).then(v=>v.StorageComponent),title:"Storage",data:{icon:"cloud"}},{path:"management",loadComponent:()=>Promise.all([f.e(6850),f.e(8864)]).then(f.bind(f,48864)).then(v=>v.ManagementComponent),title:"Management",data:{hide:!0,icon:"manage_accounts"}}];let je=(()=>{class v{constructor(u,w,U,Y,le){this.doc=u,this.delegate=w,this.zone=U,this.animationType=Y,this.moduleImpl=le,this._rendererFactoryPromise=null,this.scheduler=(0,c.WQX)(c.An2,{optional:!0}),this.loadingSchedulerFn=(0,c.WQX)(ot,{optional:!0})}ngOnDestroy(){this._engine?.flush()}loadImpl(){const u=()=>this.moduleImpl??f.e(8008).then(f.bind(f,68008)).then(U=>U);let w;return w=this.loadingSchedulerFn?this.loadingSchedulerFn(u):u(),w.catch(U=>{throw new c.wOt(5300,!1)}).then(({\u0275createEngine:U,\u0275AnimationRendererFactory:Y})=>{this._engine=U(this.animationType,this.doc);const le=new Y(this.delegate,this._engine,this.zone);return this.delegate=le,le})}createRenderer(u,w){const U=this.delegate.createRenderer(u,w);if(0===U.\u0275type)return U;"boolean"==typeof U.throwOnSyntheticProps&&(U.throwOnSyntheticProps=!1);const Y=new Ne(U);return w?.data?.animation&&!this._rendererFactoryPromise&&(this._rendererFactoryPromise=this.loadImpl()),this._rendererFactoryPromise?.then(le=>{const ge=le.createRenderer(u,w);Y.use(ge),this.scheduler?.notify(10)}).catch(le=>{Y.use(U)}),Y}begin(){this.delegate.begin?.()}end(){this.delegate.end?.()}whenRenderingDone(){return this.delegate.whenRenderingDone?.()??Promise.resolve()}static{this.\u0275fac=function(w){c.QTQ()}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac})}}return v})();class Ne{constructor(a){this.delegate=a,this.replay=[],this.\u0275type=1}use(a){if(this.delegate=a,null!==this.replay){for(const u of this.replay)u(a);this.replay=null}}get data(){return this.delegate.data}destroy(){this.replay=null,this.delegate.destroy()}createElement(a,u){return this.delegate.createElement(a,u)}createComment(a){return this.delegate.createComment(a)}createText(a){return this.delegate.createText(a)}get destroyNode(){return this.delegate.destroyNode}appendChild(a,u){this.delegate.appendChild(a,u)}insertBefore(a,u,w,U){this.delegate.insertBefore(a,u,w,U)}removeChild(a,u,w){this.delegate.removeChild(a,u,w)}selectRootElement(a,u){return this.delegate.selectRootElement(a,u)}parentNode(a){return this.delegate.parentNode(a)}nextSibling(a){return this.delegate.nextSibling(a)}setAttribute(a,u,w,U){this.delegate.setAttribute(a,u,w,U)}removeAttribute(a,u,w){this.delegate.removeAttribute(a,u,w)}addClass(a,u){this.delegate.addClass(a,u)}removeClass(a,u){this.delegate.removeClass(a,u)}setStyle(a,u,w,U){this.delegate.setStyle(a,u,w,U)}removeStyle(a,u,w){this.delegate.removeStyle(a,u,w)}setProperty(a,u,w){this.shouldReplay(u)&&this.replay.push(U=>U.setProperty(a,u,w)),this.delegate.setProperty(a,u,w)}setValue(a,u){this.delegate.setValue(a,u)}listen(a,u,w){return this.shouldReplay(u)&&this.replay.push(U=>U.listen(a,u,w)),this.delegate.listen(a,u,w)}shouldReplay(a){return null!==this.replay&&a.startsWith("@")}}const ot=new c.nKC("");var wt=f(59030),zt=f(18810),rr=f(33726),ar=f(7673),lr=f(28793),hn=f(21413),Wr=f(71985),vr=f(85343);const Tr=new Wr.c(vr.l);var lt=f(57786),Pt=f(86648),Ct=f(96354),jt=f(25558),Nr=f(30017),Ke=f(98071),Ze=f(58750),gt=f(39974);const mt={connector:()=>new hn.B};function Xt(v,a=mt){const{connector:u}=a;return(0,gt.N)((w,U)=>{const Y=u();(0,Ze.Tg)(v(function st(v){return new Wr.c(a=>v.subscribe(a))}(Y))).subscribe(U),U.add(w.subscribe(Y))})}var Lr=f(96697),yr=f(88141),$r=f(91986);const mi="Service workers are disabled or not supported by this browser";class wn{constructor(a){if(this.serviceWorker=a,a){const w=(0,rr.R)(a,"controllerchange").pipe((0,Ct.T)(()=>a.controller)),U=(0,wt.v)(()=>(0,ar.of)(a.controller)),Y=(0,lr.x)(U,w);this.worker=Y.pipe((0,te.p)(dt=>!!dt)),this.registration=this.worker.pipe((0,jt.n)(()=>a.getRegistration()));const Ge=(0,rr.R)(a,"message").pipe((0,Ct.T)(dt=>dt.data)).pipe((0,te.p)(dt=>dt&&dt.type)).pipe(function Zt(v){return v?a=>Xt(v)(a):a=>function Et(v,a){const u=(0,Ke.T)(v)?v:()=>v;return(0,Ke.T)(a)?Xt(a,{connector:u}):w=>new Nr.G(w,u)}(new hn.B)(a)}());Ge.connect(),this.events=Ge}else this.worker=this.events=this.registration=function Vn(v){return(0,wt.v)(()=>(0,zt.$)(new Error(v)))}(mi)}postMessage(a,u){return this.worker.pipe((0,Lr.s)(1),(0,yr.M)(w=>{w.postMessage({action:a,...u})})).toPromise().then(()=>{})}postMessageWithOperation(a,u,w){const U=this.waitForOperationCompleted(w),Y=this.postMessage(a,u);return Promise.all([Y,U]).then(([,le])=>le)}generateNonce(){return Math.round(1e7*Math.random())}eventsOfType(a){let u;return u="string"==typeof a?w=>w.type===a:w=>a.includes(w.type),this.events.pipe((0,te.p)(u))}nextEventOfType(a){return this.eventsOfType(a).pipe((0,Lr.s)(1))}waitForOperationCompleted(a){return this.eventsOfType("OPERATION_COMPLETED").pipe((0,te.p)(u=>u.nonce===a),(0,Lr.s)(1),(0,Ct.T)(u=>{if(void 0!==u.result)return u.result;throw new Error(u.error)})).toPromise()}get isEnabled(){return!!this.serviceWorker}}let Jt=(()=>{class v{get isEnabled(){return this.sw.isEnabled}constructor(u){if(this.sw=u,this.pushManager=null,this.subscriptionChanges=new hn.B,!u.isEnabled)return this.messages=Tr,this.notificationClicks=Tr,void(this.subscription=Tr);this.messages=this.sw.eventsOfType("PUSH").pipe((0,Ct.T)(U=>U.data)),this.notificationClicks=this.sw.eventsOfType("NOTIFICATION_CLICK").pipe((0,Ct.T)(U=>U.data)),this.pushManager=this.sw.registration.pipe((0,Ct.T)(U=>U.pushManager));const w=this.pushManager.pipe((0,jt.n)(U=>U.getSubscription()));this.subscription=(0,lt.h)(w,this.subscriptionChanges)}requestSubscription(u){if(!this.sw.isEnabled||null===this.pushManager)return Promise.reject(new Error(mi));const w={userVisibleOnly:!0};let U=this.decodeBase64(u.serverPublicKey.replace(/_/g,"/").replace(/-/g,"+")),Y=new Uint8Array(new ArrayBuffer(U.length));for(let le=0;lele.subscribe(w)),(0,Lr.s)(1)).toPromise().then(le=>(this.subscriptionChanges.next(le),le))}unsubscribe(){return this.sw.isEnabled?this.subscription.pipe((0,Lr.s)(1),(0,jt.n)(w=>{if(null===w)throw new Error("Not subscribed to push notifications.");return w.unsubscribe().then(U=>{if(!U)throw new Error("Unsubscribe failed!");this.subscriptionChanges.next(null)})})).toPromise():Promise.reject(new Error(mi))}decodeBase64(u){return atob(u)}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(wn))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac})}}return v})(),Hr=(()=>{class v{get isEnabled(){return this.sw.isEnabled}constructor(u){if(this.sw=u,!u.isEnabled)return this.versionUpdates=Tr,void(this.unrecoverable=Tr);this.versionUpdates=this.sw.eventsOfType(["VERSION_DETECTED","VERSION_INSTALLATION_FAILED","VERSION_READY","NO_NEW_VERSION_DETECTED"]),this.unrecoverable=this.sw.eventsOfType("UNRECOVERABLE_STATE")}checkForUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const u=this.sw.generateNonce();return this.sw.postMessageWithOperation("CHECK_FOR_UPDATES",{nonce:u},u)}activateUpdate(){if(!this.sw.isEnabled)return Promise.reject(new Error(mi));const u=this.sw.generateNonce();return this.sw.postMessageWithOperation("ACTIVATE_UPDATE",{nonce:u},u)}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(wn))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac})}}return v})();const Lt=new c.nKC("");function dr(v,a,u,w){return()=>{if(!(0,R.UE)(w)||!("serviceWorker"in navigator)||!1===u.enabled)return;const U=v.get(c.SKi),Y=v.get(c.o8S);let le;if(U.runOutsideAngular(()=>{const ge=navigator.serviceWorker,Pe=()=>ge.controller?.postMessage({action:"INITIALIZE"});ge.addEventListener("controllerchange",Pe),Y.onDestroy(()=>{ge.removeEventListener("controllerchange",Pe)})}),"function"==typeof u.registrationStrategy)le=u.registrationStrategy();else{const[ge,...Pe]=(u.registrationStrategy||"registerWhenStable:30000").split(":");switch(ge){case"registerImmediately":le=(0,ar.of)(null);break;case"registerWithDelay":le=xr(+Pe[0]||0);break;case"registerWhenStable":const Ge=(0,Pt.H)(v.get(c.o8S).whenStable());le=Pe[0]?(0,lt.h)(Ge,xr(+Pe[0])):Ge;break;default:throw new Error(`Unknown ServiceWorker registration strategy: ${u.registrationStrategy}`)}}U.runOutsideAngular(()=>le.pipe((0,Lr.s)(1)).subscribe(()=>navigator.serviceWorker.register(a,{scope:u.scope}).catch(ge=>console.error("Service worker registration failed with:",ge))))}}function xr(v){return(0,ar.of)(null).pipe((0,$r.c)(v))}function fn(v,a){return new wn((0,R.UE)(a)&&!1!==v.enabled?navigator.serviceWorker:void 0)}class Sn{}var li=f(21626),Kr=f(1005);const ur={providers:[(0,li.$R)(),(0,c.Jn2)({eventCoalescing:!0}),(0,x.lh)(he,(0,x.Sn)(x.Kp)),function Ft(v="animations"){return(0,c.ngT)("NgAsyncAnimations"),(0,c.EmA)([{provide:c._9s,useFactory:(a,u,w)=>new je(a,u,w,v),deps:[R.qQ,i.B7,c.SKi]},{provide:c.bc$,useValue:"noop"===v?"NoopAnimations":"BrowserAnimations"}])}(),function Xn(v,a={}){return(0,c.EmA)([Jt,Hr,{provide:Lt,useValue:v},{provide:Sn,useValue:a},{provide:wn,useFactory:fn,deps:[Sn,c.Agw]},{provide:c.hnV,useFactory:dr,deps:[c.zZn,Lt,Sn,c.Agw],multi:!0}])}("ngsw-worker.js",{enabled:!(0,c.naY)(),registrationStrategy:"registerWhenStable:30000"}),{provide:c.hnV,useFactory:function er(v){return()=>v.load()},deps:[Kr.G],multi:!0}]};var Fr=f(99327),qt=f(67333),mr=f(86600),_r=f(18617),Gr=f(28203),gn=f(14085),An=f(67336),On=f(36860),Un=f(73703),oi=f(56977),$i=f(23294),Fi=f(99172),no=f(70152),Zi=f(49969);const Ao=["*"],Fo=["content"],Hi=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],ro=["mat-drawer","mat-drawer-content","*"];function uo(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",1),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U._onBackdropClicked())}),c.k0s()}if(2&v){const u=c.XpG();c.AVh("mat-drawer-shown",u._isShowingBackdrop())}}function Oi(v,a){1&v&&(c.j41(0,"mat-drawer-content"),c.SdG(1,2),c.k0s())}const Jn=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],Qo=["mat-sidenav","mat-sidenav-content","*"];function Gs(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",1),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U._onBackdropClicked())}),c.k0s()}if(2&v){const u=c.XpG();c.AVh("mat-drawer-shown",u._isShowingBackdrop())}}function As(v,a){1&v&&(c.j41(0,"mat-sidenav-content"),c.SdG(1,2),c.k0s())}const Fa={transformDrawer:(0,Zi.hZ)("transform",[(0,Zi.wk)("open, open-instant",(0,Zi.iF)({transform:"none",visibility:"visible"})),(0,Zi.wk)("void",(0,Zi.iF)({"box-shadow":"none",visibility:"hidden"})),(0,Zi.kY)("void => open-instant",(0,Zi.i0)("0ms")),(0,Zi.kY)("void <=> open, open-instant => void",(0,Zi.i0)("400ms cubic-bezier(0.25, 0.8, 0.25, 1)"))])},Ji=new c.nKC("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:function uc(){return!1}}),vs=new c.nKC("MAT_DRAWER_CONTAINER");let yt=(()=>{class v extends qt.uv{constructor(u,w,U,Y,le){super(U,Y,le),this._changeDetectorRef=u,this._container=w}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.gRc),c.rXU((0,c.Rfq)(()=>wr)),c.rXU(c.aKT),c.rXU(qt.R),c.rXU(c.SKi))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:4,hostBindings:function(w,U){2&w&&c.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[c.Jv_([{provide:qt.uv,useExisting:v}]),c.Vt3,c.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(c.NAR(),c.SdG(0))},encapsulation:2,changeDetection:0})}}return v})(),kt=(()=>{class v{get position(){return this._position}set position(u){(u="end"===u?"end":"start")!==this._position&&(this._isAttached&&this._updatePositionInParent(u),this._position=u,this.onPositionChanged.emit())}get mode(){return this._mode}set mode(u){this._mode=u,this._updateFocusTrapState(),this._modeChanged.next()}get disableClose(){return this._disableClose}set disableClose(u){this._disableClose=(0,gn.he)(u)}get autoFocus(){return this._autoFocus??("side"===this.mode?"dialog":"first-tabbable")}set autoFocus(u){("true"===u||"false"===u||null==u)&&(u=(0,gn.he)(u)),this._autoFocus=u}get opened(){return this._opened}set opened(u){this.toggle((0,gn.he)(u))}constructor(u,w,U,Y,le,ge,Pe,Ge){this._elementRef=u,this._focusTrapFactory=w,this._focusMonitor=U,this._platform=Y,this._ngZone=le,this._interactivityChecker=ge,this._doc=Pe,this._container=Ge,this._focusTrap=null,this._elementFocusedBeforeDrawerWasOpened=null,this._enableAnimations=!1,this._position="start",this._mode="over",this._disableClose=!1,this._opened=!1,this._animationStarted=new hn.B,this._animationEnd=new hn.B,this._animationState="void",this.openedChange=new c.bkB(!0),this._openedStream=this.openedChange.pipe((0,te.p)(dt=>dt),(0,Ct.T)(()=>{})),this.openedStart=this._animationStarted.pipe((0,te.p)(dt=>dt.fromState!==dt.toState&&0===dt.toState.indexOf("open")),(0,Un.u)(void 0)),this._closedStream=this.openedChange.pipe((0,te.p)(dt=>!dt),(0,Ct.T)(()=>{})),this.closedStart=this._animationStarted.pipe((0,te.p)(dt=>dt.fromState!==dt.toState&&"void"===dt.toState),(0,Un.u)(void 0)),this._destroyed=new hn.B,this.onPositionChanged=new c.bkB,this._modeChanged=new hn.B,this._injector=(0,c.WQX)(c.zZn),this._changeDetectorRef=(0,c.WQX)(c.gRc),this.openedChange.pipe((0,oi.Q)(this._destroyed)).subscribe(dt=>{dt?(this._doc&&(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement),this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._ngZone.runOutsideAngular(()=>{(0,rr.R)(this._elementRef.nativeElement,"keydown").pipe((0,te.p)(dt=>dt.keyCode===An._f&&!this.disableClose&&!(0,An.rp)(dt)),(0,oi.Q)(this._destroyed)).subscribe(dt=>this._ngZone.run(()=>{this.close(),dt.stopPropagation(),dt.preventDefault()}))}),this._animationEnd.pipe((0,$i.F)((dt,_t)=>dt.fromState===_t.fromState&&dt.toState===_t.toState)).subscribe(dt=>{const{fromState:_t,toState:Ot}=dt;(0===Ot.indexOf("open")&&"void"===_t||"void"===Ot&&0===_t.indexOf("open"))&&this.openedChange.emit(this._opened)})}_forceFocus(u,w){this._interactivityChecker.isFocusable(u)||(u.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{const U=()=>{u.removeEventListener("blur",U),u.removeEventListener("mousedown",U),u.removeAttribute("tabindex")};u.addEventListener("blur",U),u.addEventListener("mousedown",U)})),u.focus(w)}_focusByCssSelector(u,w){let U=this._elementRef.nativeElement.querySelector(u);U&&this._forceFocus(U,w)}_takeFocus(){if(!this._focusTrap)return;const u=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":(0,c.mal)(()=>{!this._focusTrap.focusInitialElement()&&"function"==typeof u.focus&&u.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus)}}_restoreFocus(u){"dialog"!==this.autoFocus&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,u):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){const u=this._doc.activeElement;return!!u&&this._elementRef.nativeElement.contains(u)}ngAfterViewInit(){this._isAttached=!0,"end"===this._position&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngAfterContentChecked(){this._platform.isBrowser&&(this._enableAnimations=!0)}ngOnDestroy(){this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(u){return this.toggle(!0,u)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(u=!this.opened,w){u&&w&&(this._openedVia=w);const U=this._setOpen(u,!u&&this._isFocusWithinDrawer(),this._openedVia||"program");return u||(this._openedVia=null),U}_setOpen(u,w,U){return this._opened=u,u?this._animationState=this._enableAnimations?"open":"open-instant":(this._animationState="void",w&&this._restoreFocus(U)),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(Y=>{this.openedChange.pipe((0,Lr.s)(1)).subscribe(le=>Y(le?"open":"close"))})}_getWidth(){return this._elementRef.nativeElement&&this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=!!this._container?.hasBackdrop&&this.opened)}_updatePositionInParent(u){if(!this._platform.isBrowser)return;const w=this._elementRef.nativeElement,U=w.parentNode;"end"===u?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),U.insertBefore(this._anchor,w)),U.appendChild(w)):this._anchor&&this._anchor.parentNode.insertBefore(w,this._anchor)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.aKT),c.rXU(_r.GX),c.rXU(_r.FN),c.rXU(On.OD),c.rXU(c.SKi),c.rXU(_r.Z7),c.rXU(R.qQ,8),c.rXU(vs,8))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-drawer"]],viewQuery:function(w,U){if(1&w&&c.GBs(Fo,5),2&w){let Y;c.mGM(Y=c.lsd())&&(U._content=Y.first)}},hostAttrs:["tabIndex","-1",1,"mat-drawer"],hostVars:12,hostBindings:function(w,U){1&w&&c.Kam("@transform.start",function(le){return U._animationStarted.next(le)})("@transform.done",function(le){return U._animationEnd.next(le)}),2&w&&(c.zvX("@transform",U._animationState),c.BMQ("align",null),c.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],standalone:!0,features:[c.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(c.NAR(),c.j41(0,"div",1,0),c.SdG(2),c.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Fa.transformDrawer]},changeDetection:0})}}return v})(),wr=(()=>{class v{get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(u){this._autosize=(0,gn.he)(u)}get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(u){this._backdropOverride=null==u?null:(0,gn.he)(u)}get scrollable(){return this._userContent||this._content}constructor(u,w,U,Y,le,ge=!1,Pe){this._dir=u,this._element=w,this._ngZone=U,this._changeDetectorRef=Y,this._animationMode=Pe,this._drawers=new c.rOR,this.backdropClick=new c.bkB,this._destroyed=new hn.B,this._doCheckSubject=new hn.B,this._contentMargins={left:null,right:null},this._contentMarginChanges=new hn.B,this._injector=(0,c.WQX)(c.zZn),u&&u.change.pipe((0,oi.Q)(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),le.change().pipe((0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins()),this._autosize=ge}ngAfterContentInit(){this._allDrawers.changes.pipe((0,Fi.Z)(this._allDrawers),(0,oi.Q)(this._destroyed)).subscribe(u=>{this._drawers.reset(u.filter(w=>!w._container||w._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe((0,Fi.Z)(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(u=>{this._watchDrawerToggle(u),this._watchDrawerPosition(u),this._watchDrawerMode(u)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe((0,no.B)(10),(0,oi.Q)(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(u=>u.open())}close(){this._drawers.forEach(u=>u.close())}updateContentMargins(){let u=0,w=0;if(this._left&&this._left.opened)if("side"==this._left.mode)u+=this._left._getWidth();else if("push"==this._left.mode){const U=this._left._getWidth();u+=U,w-=U}if(this._right&&this._right.opened)if("side"==this._right.mode)w+=this._right._getWidth();else if("push"==this._right.mode){const U=this._right._getWidth();w+=U,u-=U}u=u||null,w=w||null,(u!==this._contentMargins.left||w!==this._contentMargins.right)&&(this._contentMargins={left:u,right:w},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(u){u._animationStarted.pipe((0,te.p)(w=>w.fromState!==w.toState),(0,oi.Q)(this._drawers.changes)).subscribe(w=>{"open-instant"!==w.toState&&"NoopAnimations"!==this._animationMode&&this._element.nativeElement.classList.add("mat-drawer-transition"),this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),"side"!==u.mode&&u.openedChange.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>this._setContainerClass(u.opened))}_watchDrawerPosition(u){u&&u.onPositionChanged.pipe((0,oi.Q)(this._drawers.changes)).subscribe(()=>{(0,c.mal)(()=>{this._validateDrawers()},{injector:this._injector,phase:c.wjH.Read})})}_watchDrawerMode(u){u&&u._modeChanged.pipe((0,oi.Q)((0,lt.h)(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(u){const w=this._element.nativeElement.classList,U="mat-drawer-container-has-open";u?w.add(U):w.remove(U)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(u=>{"end"==u.position?this._end=u:this._start=u}),this._right=this._left=null,this._dir&&"rtl"===this._dir.value?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&"over"!=this._start.mode||this._isDrawerOpen(this._end)&&"over"!=this._end.mode}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(u=>u&&!u.disableClose&&this._drawerHasBackdrop(u)).forEach(u=>u._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(u){return null!=u&&u.opened}_drawerHasBackdrop(u){return null==this._backdropOverride?!!u&&"side"!==u.mode:this._backdropOverride}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(Gr.dS,8),c.rXU(c.aKT),c.rXU(c.SKi),c.rXU(c.gRc),c.rXU(qt.Xj),c.rXU(Ji),c.rXU(c.bc$,8))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-drawer-container"]],contentQueries:function(w,U,Y){if(1&w&&(c.wni(Y,yt,5),c.wni(Y,kt,5)),2&w){let le;c.mGM(le=c.lsd())&&(U._content=le.first),c.mGM(le=c.lsd())&&(U._allDrawers=le)}},viewQuery:function(w,U){if(1&w&&c.GBs(yt,5),2&w){let Y;c.mGM(Y=c.lsd())&&(U._userContent=Y.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(w,U){2&w&&c.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],standalone:!0,features:[c.Jv_([{provide:vs,useExisting:v}]),c.aNF],ngContentSelectors:ro,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(c.NAR(Hi),c.DNE(0,uo,1,2,"div",0),c.SdG(1),c.SdG(2,1),c.DNE(3,Oi,2,0,"mat-drawer-content")),2&w&&(c.vxM(U.hasBackdrop?0:-1),c.R7$(3),c.vxM(U._content?-1:3))},dependencies:[yt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return v})(),Yt=(()=>{class v extends yt{constructor(u,w,U,Y,le){super(u,w,U,Y,le)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.gRc),c.rXU((0,c.Rfq)(()=>Or)),c.rXU(c.aKT),c.rXU(qt.R),c.rXU(c.SKi))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],hostVars:4,hostBindings:function(w,U){2&w&&c.xc7("margin-left",U._container._contentMargins.left,"px")("margin-right",U._container._contentMargins.right,"px")},standalone:!0,features:[c.Jv_([{provide:qt.uv,useExisting:v}]),c.Vt3,c.aNF],ngContentSelectors:Ao,decls:1,vars:0,template:function(w,U){1&w&&(c.NAR(),c.SdG(0))},encapsulation:2,changeDetection:0})}}return v})(),hr=(()=>{class v extends kt{constructor(){super(...arguments),this._fixedInViewport=!1,this._fixedTopGap=0,this._fixedBottomGap=0}get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(u){this._fixedInViewport=(0,gn.he)(u)}get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(u){this._fixedTopGap=(0,gn.OE)(u)}get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(u){this._fixedBottomGap=(0,gn.OE)(u)}static{this.\u0275fac=(()=>{let u;return function(U){return(u||(u=c.xGo(v)))(U||v)}})()}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-sidenav"]],hostAttrs:["tabIndex","-1",1,"mat-drawer","mat-sidenav"],hostVars:17,hostBindings:function(w,U){2&w&&(c.BMQ("align",null),c.xc7("top",U.fixedInViewport?U.fixedTopGap:null,"px")("bottom",U.fixedInViewport?U.fixedBottomGap:null,"px"),c.AVh("mat-drawer-end","end"===U.position)("mat-drawer-over","over"===U.mode)("mat-drawer-push","push"===U.mode)("mat-drawer-side","side"===U.mode)("mat-drawer-opened",U.opened)("mat-sidenav-fixed",U.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],standalone:!0,features:[c.Vt3,c.aNF],ngContentSelectors:Ao,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(w,U){1&w&&(c.NAR(),c.j41(0,"div",1,0),c.SdG(2),c.k0s())},dependencies:[qt.uv],encapsulation:2,data:{animation:[Fa.transformDrawer]},changeDetection:0})}}return v})(),Or=(()=>{class v extends wr{constructor(){super(...arguments),this._allDrawers=void 0,this._content=void 0}static{this.\u0275fac=(()=>{let u;return function(U){return(u||(u=c.xGo(v)))(U||v)}})()}static{this.\u0275cmp=c.VBU({type:v,selectors:[["mat-sidenav-container"]],contentQueries:function(w,U,Y){if(1&w&&(c.wni(Y,Yt,5),c.wni(Y,hr,5)),2&w){let le;c.mGM(le=c.lsd())&&(U._content=le.first),c.mGM(le=c.lsd())&&(U._allDrawers=le)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(w,U){2&w&&c.AVh("mat-drawer-container-explicit-backdrop",U._backdropOverride)},exportAs:["matSidenavContainer"],standalone:!0,features:[c.Jv_([{provide:vs,useExisting:v}]),c.Vt3,c.aNF],ngContentSelectors:Qo,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(w,U){1&w&&(c.NAR(Jn),c.DNE(0,Gs,1,2,"div",0),c.SdG(1),c.SdG(2,1),c.DNE(3,As,2,0,"mat-sidenav-content")),2&w&&(c.vxM(U.hasBackdrop?0:-1),c.R7$(3),c.vxM(U._content?-1:3))},dependencies:[Yt],styles:['.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-app-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-app-background));box-sizing:border-box;-webkit-overflow-scrolling:touch;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color)}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}.cdk-high-contrast-active .mat-drawer-backdrop{opacity:.5}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-app-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow);background-color:var(--mat-sidenav-container-background-color, var(--mat-app-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));width:var(--mat-sidenav-container-width);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}.cdk-high-contrast-active .mat-drawer,.cdk-high-contrast-active [dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}.cdk-high-contrast-active [dir=rtl] .mat-drawer,.cdk-high-contrast-active .mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-app-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer[style*="visibility: hidden"]{display:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}.mat-sidenav-fixed{position:fixed}'],encapsulation:2,changeDetection:0})}}return v})(),pn=(()=>{class v{static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275mod=c.$C({type:v})}static{this.\u0275inj=c.G2t({imports:[mr.yE,qt.Gj,qt.Gj,mr.yE]})}}return v})();var bn=f(44668),_i=f(31948),Xi=f(40605);let Io=(()=>{class v{constructor(u,w){this.swUpdate=u,this.zone=w,this.isNewVersionAvailable=!1,this.intervalSource=(0,Xi.Y)(9e5),this.checkForUpdateOnInterval(),this.checkForUpdateOnLoad()}applyUpdate(){this.swUpdate.activateUpdate().then(()=>document.location.reload()).catch(u=>console.error("Failed to apply updates:",u))}checkForUpdateOnInterval(){var u=this;this.intervalSubscription?.unsubscribe(),this.swUpdate.isEnabled&&this.zone.runOutsideAngular(()=>{this.intervalSubscription=this.intervalSource.subscribe((0,B.A)(function*(){if(u.isNewVersionAvailable)yield u.swUpdate.checkForUpdate();else try{u.isNewVersionAvailable=yield u.swUpdate.checkForUpdate(),console.log(u.isNewVersionAvailable?"A new version is available.":"Already on the latest version.")}catch(w){console.error("Failed to check for updates:",w)}}))})}checkForUpdateOnLoad(){this.newVersionSubscription?.unsubscribe(),this.swUpdate.isEnabled?(this.newVersionSubscription=this.swUpdate.versionUpdates.subscribe(u=>{switch(console.log("New version update event:"),console.log(u),u.type){case"VERSION_DETECTED":console.log(`Downloading new app version: ${u.version.hash}`);break;case"VERSION_READY":console.log(`Current app version: ${u.currentVersion.hash}`),console.log(`New app version ready for use: ${u.latestVersion.hash}`),this.isNewVersionAvailable=!0;break;case"VERSION_INSTALLATION_FAILED":console.log(`Failed to install app version '${u.version.hash}': ${u.error}`)}}),console.log("Subscribed to new version updates.")):console.log("Service worker updates are disabled for this app.")}static{this.\u0275fac=function(w){return new(w||v)(c.KVO(Hr),c.KVO(c.SKi))}}static{this.\u0275prov=c.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})();var Mo=f(33347),Ma=f(39434),Rs=f(78013);var oc=function(){var v=function(u,w){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(U,Y){U.__proto__=Y}||function(U,Y){for(var le in Y)Object.prototype.hasOwnProperty.call(Y,le)&&(U[le]=Y[le])})(u,w)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Si=function(v){function a(u,w){var U=this.constructor,Y=v.call(this,u,w)||this;return Object.defineProperty(Y,"name",{value:U.name,enumerable:!1,configurable:!0}),function Ua(v,a){var u=Object.setPrototypeOf;u?u(v,a):v.__proto__=a}(Y,U.prototype),function ls(v,a){void 0===a&&(a=v.constructor);var u=Error.captureStackTrace;u&&u(v,a)}(Y),Y}return oc(a,v),a}(Error),is=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Us=function(v){function a(u){void 0===u&&(u=void 0);var w=v.call(this,u)||this;return w.message=u,w}return is(a,v),a.prototype.getKind=function(){return this.constructor.kind},a.kind="Exception",a}(Si);var Ec=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const bs=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ec(a,v),a.kind="ArgumentException",a}(Us);var Ds=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const ki=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ds(a,v),a.kind="IllegalArgumentException",a}(Us),jc=function(){function v(a){if(this.binarizer=a,null===a)throw new ki("Binarizer must be non-null.")}return v.prototype.getWidth=function(){return this.binarizer.getWidth()},v.prototype.getHeight=function(){return this.binarizer.getHeight()},v.prototype.getBlackRow=function(a,u){return this.binarizer.getBlackRow(a,u)},v.prototype.getBlackMatrix=function(){return null==this.matrix&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},v.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},v.prototype.crop=function(a,u,w,U){var Y=this.binarizer.getLuminanceSource().crop(a,u,w,U);return new v(this.binarizer.createBinarizer(Y))},v.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},v.prototype.rotateCounterClockwise=function(){var a=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new v(this.binarizer.createBinarizer(a))},v.prototype.rotateCounterClockwise45=function(){var a=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new v(this.binarizer.createBinarizer(a))},v.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},v}();var Ta=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const rs=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ta(a,v),a.getChecksumInstance=function(){return new a},a.kind="ChecksumException",a}(Us),Qt=function(){function v(a){this.source=a}return v.prototype.getLuminanceSource=function(){return this.source},v.prototype.getWidth=function(){return this.source.getWidth()},v.prototype.getHeight=function(){return this.source.getHeight()},v}(),Rt=function(){function v(){}return v.arraycopy=function(a,u,w,U,Y){for(;Y--;)w[U++]=a[u++]},v.currentTimeMillis=function(){return Date.now()},v}();var Pr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const qr=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Pr(a,v),a.kind="IndexOutOfBoundsException",a}(Us);var zn=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Zn=function(v){function a(u,w){void 0===u&&(u=void 0),void 0===w&&(w=void 0);var U=v.call(this,w)||this;return U.index=u,U.message=w,U}return zn(a,v),a.kind="ArrayIndexOutOfBoundsException",a}(qr),Vi=function(){function v(){}return v.fill=function(a,u){for(var w=0,U=a.length;ww)throw new ki("fromIndex("+u+") > toIndex("+w+")");if(u<0)throw new Zn(u);if(w>a)throw new Zn(w)},v.asList=function(){for(var a=[],u=0;u=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),le=Y.next();!le.done;le=Y.next())U=31*U+le.value}catch(Pe){u={error:Pe}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return U},v.fillUint8Array=function(a,u){for(var w=0;w!==a.length;w++)a[w]=u},v.copyOf=function(a,u){return a.slice(0,u)},v.copyOfUint8Array=function(a,u){if(a.length<=u){var w=new Uint8Array(u);return w.set(a),w}return a.slice(0,u)},v.copyOfRange=function(a,u,w){var U=w-u,Y=new Int32Array(U);return Rt.arraycopy(a,u,Y,0,U),Y},v.binarySearch=function(a,u,w){void 0===w&&(w=v.numberComparator);for(var U=0,Y=a.length-1;U<=Y;){var le=Y+U>>1,ge=w(u,a[le]);if(ge>0)U=le+1;else{if(!(ge<0))return le;Y=le-1}}return-U-1},v.numberComparator=function(a,u){return a-u},v}(),pi=function(){function v(){}return v.numberOfTrailingZeros=function(a){var u;if(0===a)return 32;var w=31;return 0!=(u=a<<16)&&(w-=16,a=u),0!=(u=a<<8)&&(w-=8,a=u),0!=(u=a<<4)&&(w-=4,a=u),0!=(u=a<<2)&&(w-=2,a=u),w-(a<<1>>>31)},v.numberOfLeadingZeros=function(a){if(0===a)return 32;var u=1;return a>>>16||(u+=16,a<<=16),a>>>24||(u+=8,a<<=8),a>>>28||(u+=4,a<<=4),a>>>30||(u+=2,a<<=2),u-(a>>>31)},v.toHexString=function(a){return a.toString(16)},v.toBinaryString=function(a){return String(parseInt(String(a),2))},v.bitCount=function(a){return a=(a=(858993459&(a-=a>>>1&1431655765))+(a>>>2&858993459))+(a>>>4)&252645135,63&(a+=a>>>8)+(a>>>16)},v.truncDivision=function(a,u){return Math.trunc(a/u)},v.parseInt=function(a,u){return void 0===u&&(u=void 0),parseInt(a,u)},v.MIN_VALUE_32_BITS=-2147483648,v.MAX_VALUE=Number.MAX_SAFE_INTEGER,v}(),bi=function(){function v(a,u){void 0===a?(this.size=0,this.bits=new Int32Array(1)):(this.size=a,this.bits=null==u?v.makeArray(a):u)}return v.prototype.getSize=function(){return this.size},v.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},v.prototype.ensureCapacity=function(a){if(a>32*this.bits.length){var u=v.makeArray(a);Rt.arraycopy(this.bits,0,u,0,this.bits.length),this.bits=u}},v.prototype.get=function(a){return!!(this.bits[Math.floor(a/32)]&1<<(31&a))},v.prototype.set=function(a){this.bits[Math.floor(a/32)]|=1<<(31&a)},v.prototype.flip=function(a){this.bits[Math.floor(a/32)]^=1<<(31&a)},v.prototype.getNextSet=function(a){var u=this.size;if(a>=u)return u;var w=this.bits,U=Math.floor(a/32),Y=w[U];Y&=~((1<<(31&a))-1);for(var le=w.length;0===Y;){if(++U===le)return u;Y=w[U]}var ge=32*U+pi.numberOfTrailingZeros(Y);return ge>u?u:ge},v.prototype.getNextUnset=function(a){var u=this.size;if(a>=u)return u;var w=this.bits,U=Math.floor(a/32),Y=~w[U];Y&=~((1<<(31&a))-1);for(var le=w.length;0===Y;){if(++U===le)return u;Y=~w[U]}var ge=32*U+pi.numberOfTrailingZeros(Y);return ge>u?u:ge},v.prototype.setBulk=function(a,u){this.bits[Math.floor(a/32)]=u},v.prototype.setRange=function(a,u){if(uthis.size)throw new ki;if(u!==a){u--;for(var w=Math.floor(a/32),U=Math.floor(u/32),Y=this.bits,le=w;le<=U;le++)Y[le]|=(2<<(lew?0:31&a))}},v.prototype.clear=function(){for(var a=this.bits.length,u=this.bits,w=0;wthis.size)throw new ki;if(u===a)return!0;u--;for(var U=Math.floor(a/32),Y=Math.floor(u/32),le=this.bits,ge=U;ge<=Y;ge++){var dt=(2<<(geU?0:31&a))&4294967295;if((le[ge]&dt)!==(w?dt:0))return!1}return!0},v.prototype.appendBit=function(a){this.ensureCapacity(this.size+1),a&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},v.prototype.appendBits=function(a,u){if(u<0||u>32)throw new ki("Num bits must be between 0 and 32");this.ensureCapacity(this.size+u);for(var w=u;w>0;w--)this.appendBit(1==(a>>w-1&1))},v.prototype.appendBitArray=function(a){var u=a.size;this.ensureCapacity(this.size+u);for(var w=0;w>1&1431655765|(1431655765&le)<<1)>>2&858993459|(858993459&le)<<2)>>4&252645135|(252645135&le)<<4)>>8&16711935|(16711935&le)<<8)>>16&65535|(65535&le)<<16}if(this.size!==32*w){var ge=32*w-this.size,Pe=a[0]>>>ge;for(Y=1;Y>>ge}a[w-1]=Pe}this.bits=a},v.makeArray=function(a){return new Int32Array(Math.floor((a+31)/32))},v.prototype.equals=function(a){return a instanceof v&&(this.size===a.size&&Vi.equals(this.bits,a.bits))},v.prototype.hashCode=function(){return 31*this.size+Vi.hashCode(this.bits)},v.prototype.toString=function(){for(var a="",u=0,w=this.size;u=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(le),Ht=Ot.next();!Ht.done;Ht=Ot.next())v.NAME_TO_ECI.set(Ht.value,this)}catch(Ur){U={error:Ur}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}}return v.prototype.getValueIdentifier=function(){return this.valueIdentifier},v.prototype.getName=function(){return this.name},v.prototype.getValue=function(){return this.values[0]},v.getCharacterSetECIByValue=function(a){if(a<0||a>=900)throw new Qn("incorect value");var u=v.VALUES_TO_ECI.get(a);if(void 0===u)throw new Qn("incorect value");return u},v.getCharacterSetECIByName=function(a){var u=v.NAME_TO_ECI.get(a);if(void 0===u)throw new Qn("incorect value");return u},v.prototype.equals=function(a){if(!(a instanceof v))return!1;var u=a;return this.getName()===u.getName()},v.VALUE_IDENTIFIER_TO_ECI=new Map,v.VALUES_TO_ECI=new Map,v.NAME_TO_ECI=new Map,v.Cp437=new v(Ti.Cp437,Int32Array.from([0,2]),"Cp437"),v.ISO8859_1=new v(Ti.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),v.ISO8859_2=new v(Ti.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),v.ISO8859_3=new v(Ti.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),v.ISO8859_4=new v(Ti.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),v.ISO8859_5=new v(Ti.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),v.ISO8859_6=new v(Ti.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),v.ISO8859_7=new v(Ti.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),v.ISO8859_8=new v(Ti.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),v.ISO8859_9=new v(Ti.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),v.ISO8859_10=new v(Ti.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),v.ISO8859_11=new v(Ti.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),v.ISO8859_13=new v(Ti.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),v.ISO8859_14=new v(Ti.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),v.ISO8859_15=new v(Ti.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),v.ISO8859_16=new v(Ti.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),v.SJIS=new v(Ti.SJIS,20,"SJIS","Shift_JIS"),v.Cp1250=new v(Ti.Cp1250,21,"Cp1250","windows-1250"),v.Cp1251=new v(Ti.Cp1251,22,"Cp1251","windows-1251"),v.Cp1252=new v(Ti.Cp1252,23,"Cp1252","windows-1252"),v.Cp1256=new v(Ti.Cp1256,24,"Cp1256","windows-1256"),v.UnicodeBigUnmarked=new v(Ti.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),v.UTF8=new v(Ti.UTF8,26,"UTF8","UTF-8"),v.ASCII=new v(Ti.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),v.Big5=new v(Ti.Big5,28,"Big5"),v.GB18030=new v(Ti.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),v.EUC_KR=new v(Ti.EUC_KR,30,"EUC_KR","EUC-KR"),v}();var na=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const ia=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return na(a,v),a.kind="UnsupportedOperationException",a}(Us),Wt=function(){function v(){}return v.decode=function(a,u){var w=this.encodingName(u);return this.customDecoder?this.customDecoder(a,w):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(w)?this.decodeFallback(a,w):new TextDecoder(w).decode(a)},v.shouldDecodeOnFallback=function(a){return!v.isBrowser()&&"ISO-8859-1"===a},v.encode=function(a,u){var w=this.encodingName(u);return this.customEncoder?this.customEncoder(a,w):typeof TextEncoder>"u"?this.encodeFallback(a):(new TextEncoder).encode(a)},v.isBrowser=function(){return typeof window<"u"&&"[object Window]"==={}.toString.call(window)},v.encodingName=function(a){return"string"==typeof a?a:a.getName()},v.encodingCharacterSet=function(a){return a instanceof Jo?a:Jo.getCharacterSetECIByName(a)},v.decodeFallback=function(a,u){var w=this.encodingCharacterSet(u);if(v.isDecodeFallbackSupported(w)){for(var U="",Y=0,le=a.length;Y3&&239===a[0]&&187===a[1]&&191===a[2],Tn=0;Tn0?128&Gn?ge--:le=!1:128&Gn&&(64&Gn?(ge++,32&Gn?(ge++,16&Gn?(ge++,8&Gn?le=!1:dt++):Ge++):Pe++):le=!1)),U&&(Gn>127&&Gn<160?U=!1:Gn>159&&(Gn<192||215===Gn||247===Gn)&&dn++),Y&&(_t>0?Gn<64||127===Gn||Gn>252?Y=!1:_t--:128===Gn||160===Gn||Gn>239?Y=!1:Gn>160&&Gn<224?(Ot++,Sr=0,++Ht>Ur&&(Ur=Ht)):Gn>127?(_t++,Ht=0,++Sr>Zr&&(Zr=Sr)):(Ht=0,Sr=0))}return le&&ge>0&&(le=!1),Y&&_t>0&&(Y=!1),le&&(ln||Pe+Ge+dt>0)?v.UTF8:Y&&(v.ASSUME_SHIFT_JIS||Ur>=3||Zr>=3)?v.SHIFT_JIS:U&&Y?2===Ur&&2===Ot||10*dn>=w?v.SHIFT_JIS:v.ISO88591:U?v.ISO88591:Y?v.SHIFT_JIS:le?v.UTF8:v.PLATFORM_DEFAULT_ENCODING},v.format=function(a){for(var u=[],w=1;wle){if(-1===ge)ge=Y-le;else if(Y-le!==ge)throw new ki("row lengths do not match");le=Y,Pe++}Ge++}else if(a.substring(Ge,Ge+u.length)===u)Ge+=u.length,U[Y]=!0,Y++;else{if(a.substring(Ge,Ge+w.length)!==w)throw new ki("illegal character encountered: "+a.substring(Ge));Ge+=w.length,U[Y]=!1,Y++}if(Y>le){if(-1===ge)ge=Y-le;else if(Y-le!==ge)throw new ki("row lengths do not match");Pe++}for(var dt=new v(ge,Pe),_t=0;_t>>(31&a)&1)},v.prototype.set=function(a,u){var w=u*this.rowSize+Math.floor(a/32);this.bits[w]|=1<<(31&a)&4294967295},v.prototype.unset=function(a,u){var w=u*this.rowSize+Math.floor(a/32);this.bits[w]&=~(1<<(31&a)&4294967295)},v.prototype.flip=function(a,u){var w=u*this.rowSize+Math.floor(a/32);this.bits[w]^=1<<(31&a)&4294967295},v.prototype.xor=function(a){if(this.width!==a.getWidth()||this.height!==a.getHeight()||this.rowSize!==a.getRowSize())throw new ki("input matrix dimensions do not match");for(var u=new bi(Math.floor(this.width/32)+1),w=this.rowSize,U=this.bits,Y=0,le=this.height;Ythis.height||Y>this.width)throw new ki("The region must fit inside the matrix");for(var ge=this.rowSize,Pe=this.bits,Ge=u;GePe&&(Pe=Ge),32*dtge){for(Ot=31;!(_t>>>Ot);)Ot--;32*dt+Ot>ge&&(ge=32*dt+Ot)}}}return ge=0&&0===u[w];)w--;if(w<0)return null;for(var U=Math.floor(w/a),Y=32*Math.floor(w%a),le=u[w],ge=31;!(le>>>ge);)ge--;return Int32Array.from([Y+=ge,U])},v.prototype.getWidth=function(){return this.width},v.prototype.getHeight=function(){return this.height},v.prototype.getRowSize=function(){return this.rowSize},v.prototype.equals=function(a){return a instanceof v&&(this.width===a.width&&this.height===a.height&&this.rowSize===a.rowSize&&Vi.equals(this.bits,a.bits))},v.prototype.hashCode=function(){var a=this.width;return 31*(a=31*(a=31*(a=31*a+this.width)+this.height)+this.rowSize)+Vi.hashCode(this.bits)},v.prototype.toString=function(a,u,w){return void 0===a&&(a="X "),void 0===u&&(u=" "),void 0===w&&(w="\n"),this.buildToString(a,u,w)},v.prototype.buildToString=function(a,u,w){for(var U=new jr,Y=0,le=this.height;Y>a.LUMINANCE_SHIFT]++;var Ge=a.estimateBlackPoint(ge);if(Y<3)for(Pe=0;Pe>a.LUMINANCE_SHIFT]++;var Ht=a.estimateBlackPoint(le),Sr=u.getMatrix();for(ge=0;gele&&(Y=ge,le=u[ge]),u[ge]>U&&(U=u[ge]);var Pe=0,Ge=0;for(ge=0;geGe&&(Pe=ge,Ge=_t)}if(Y>Pe){var Ot=Y;Y=Pe,Pe=Ot}if(Pe-Y<=w/16)throw new Wn;var Ht=Pe-1,Sr=-1;for(ge=Pe-1;ge>Y;ge--){var _t,Ur=ge-Y;(_t=Ur*Ur*(Pe-ge)*(U-u[ge]))>Sr&&(Ht=ge,Sr=_t)}return Ht<=a.MINIMUM_DIMENSION&&U>=a.MINIMUM_DIMENSION){var Y=u.getMatrix(),le=w>>a.BLOCK_SIZE_POWER;w&a.BLOCK_SIZE_MASK&&le++;var ge=U>>a.BLOCK_SIZE_POWER;U&a.BLOCK_SIZE_MASK&&ge++;var Pe=a.calculateBlackPoints(Y,le,ge,w,U),Ge=new Qi(w,U);a.calculateThresholdForBlock(Y,le,ge,w,U,Pe,Ge),this.matrix=Ge}else this.matrix=v.prototype.getBlackMatrix.call(this);return this.matrix},a.prototype.createBinarizer=function(u){return new a(u)},a.calculateThresholdForBlock=function(u,w,U,Y,le,ge,Pe){for(var Ge=le-a.BLOCK_SIZE,dt=Y-a.BLOCK_SIZE,_t=0;_tGe&&(Ot=Ge);for(var Ht=a.cap(_t,2,U-3),Sr=0;Srdt&&(Ur=dt);for(var Zr=a.cap(Sr,2,w-3),dn=0,ln=-2;ln<=2;ln++){var Tn=ge[Ht+ln];dn+=Tn[Zr-2]+Tn[Zr-1]+Tn[Zr]+Tn[Zr+1]+Tn[Zr+2]}a.thresholdBlock(u,Ur,Ot,dn/25,Y,Pe)}}},a.cap=function(u,w,U){return uU?U:u},a.thresholdBlock=function(u,w,U,Y,le,ge){for(var Pe=0,Ge=U*le+w;Pege&&(_t=ge);for(var Ot=0;OtPe&&(Ht=Pe);for(var Sr=0,Ur=255,Zr=0,dn=0,ln=_t*Y+Ht;dnZr&&(Zr=Gn)}if(Zr-Ur>a.MIN_DYNAMIC_RANGE)for(dn++,ln+=Y;dn>2*a.BLOCK_SIZE_POWER;if(Zr-Ur<=a.MIN_DYNAMIC_RANGE&&(yi=Ur/2,dt>0&&Ot>0)){var Bi=(Ge[dt-1][Ot]+2*Ge[dt][Ot-1]+Ge[dt-1][Ot-1])/4;Ur>10}else{le=0,ge=0;for(var Sr=u.length;le>10)}return Y},a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth(),Y=u*U;return null===w?w=this.buffer.slice(Y,Y+U):(w.length0&&Y[Y.length-1])&&(6===Ge[0]||2===Ge[0])){u=0;continue}if(3===Ge[0]&&(!Y||Ge[1]>Y[0]&&Ge[1]=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),U=w.next();!U.done;U=w.next())"videoinput"===(le="video"===(Y=U.value).kind?"videoinput":Y.kind)&&u.push({deviceId:Y.deviceId||Y.id,label:Y.label||"Video device "+(u.length+1),kind:le,groupId:Y.groupId})}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,u]}})})},v.prototype.getVideoInputDevices=function(){return Ka(this,void 0,void 0,function(){return sc(this,function(u){switch(u.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,u.sent().map(function(w){return new $s(w.deviceId,w.label)})]}})})},v.prototype.findDeviceById=function(a){return Ka(this,void 0,void 0,function(){var u;return sc(this,function(w){switch(w.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(u=w.sent())?[2,u.find(function(U){return U.deviceId===a})]:[2,null]}})})},v.prototype.decodeFromInputVideoDevice=function(a,u){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.decodeOnceFromVideoDevice(a,u)];case 1:return[2,w.sent()]}})})},v.prototype.decodeOnceFromVideoDevice=function(a,u){return Ka(this,void 0,void 0,function(){return sc(this,function(Y){switch(Y.label){case 0:return this.reset(),[4,this.decodeOnceFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u)];case 1:return[2,Y.sent()]}})})},v.prototype.decodeOnceFromConstraints=function(a,u){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return[4,navigator.mediaDevices.getUserMedia(a)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,u)];case 2:return[2,U.sent()]}})})},v.prototype.decodeOnceFromStream=function(a,u){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(Y){switch(Y.label){case 0:return this.reset(),[4,this.attachStreamToVideo(a,u)];case 1:return w=Y.sent(),[4,this.decodeOnce(w)];case 2:return[2,Y.sent()]}})})},v.prototype.decodeFromInputVideoDeviceContinuously=function(a,u,w){return Ka(this,void 0,void 0,function(){return sc(this,function(U){switch(U.label){case 0:return[4,this.decodeFromVideoDevice(a,u,w)];case 1:return[2,U.sent()]}})})},v.prototype.decodeFromVideoDevice=function(a,u,w){return Ka(this,void 0,void 0,function(){return sc(this,function(le){switch(le.label){case 0:return[4,this.decodeFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u,w)];case 1:return[2,le.sent()]}})})},v.prototype.decodeFromConstraints=function(a,u,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(Y){switch(Y.label){case 0:return[4,navigator.mediaDevices.getUserMedia(a)];case 1:return U=Y.sent(),[4,this.decodeFromStream(U,u,w)];case 2:return[2,Y.sent()]}})})},v.prototype.decodeFromStream=function(a,u,w){return Ka(this,void 0,void 0,function(){var U;return sc(this,function(Y){switch(Y.label){case 0:return this.reset(),[4,this.attachStreamToVideo(a,u)];case 1:return U=Y.sent(),[4,this.decodeContinuously(U,w)];case 2:return[2,Y.sent()]}})})},v.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},v.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},v.prototype.attachStreamToVideo=function(a,u){return Ka(this,void 0,void 0,function(){var w;return sc(this,function(U){switch(U.label){case 0:return w=this.prepareVideoElement(u),this.addVideoSource(w,a),this.videoElement=w,this.stream=a,[4,this.playVideoOnLoadAsync(w)];case 1:return U.sent(),[2,w]}})})},v.prototype.playVideoOnLoadAsync=function(a){var u=this;return new Promise(function(w,U){return u.playVideoOnLoad(a,function(){return w()})})},v.prototype.playVideoOnLoad=function(a,u){var w=this;this.videoEndedListener=function(){return w.stopStreams()},this.videoCanPlayListener=function(){return w.tryPlayVideo(a)},a.addEventListener("ended",this.videoEndedListener),a.addEventListener("canplay",this.videoCanPlayListener),a.addEventListener("playing",u),this.tryPlayVideo(a)},v.prototype.isVideoPlaying=function(a){return a.currentTime>0&&!a.paused&&!a.ended&&a.readyState>2},v.prototype.tryPlayVideo=function(a){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:if(this.isVideoPlaying(a))return console.warn("Trying to play video that is already playing."),[2];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,a.play()];case 2:return w.sent(),[3,4];case 3:return w.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},v.prototype.getMediaElement=function(a,u){var w=document.getElementById(a);if(!w)throw new bs("element with id '"+a+"' not found");if(w.nodeName.toLowerCase()!==u.toLowerCase())throw new bs("element with id '"+a+"' must be an "+u+" element");return w},v.prototype.decodeFromImage=function(a,u){if(!a&&!u)throw new bs("either imageElement with a src set or an url must be provided");return u&&!a?this.decodeFromImageUrl(u):this.decodeFromImageElement(a)},v.prototype.decodeFromVideo=function(a,u){if(!a&&!u)throw new bs("Either an element with a src set or an URL must be provided");return u&&!a?this.decodeFromVideoUrl(u):this.decodeFromVideoElement(a)},v.prototype.decodeFromVideoContinuously=function(a,u,w){if(void 0===a&&void 0===u)throw new bs("Either an element with a src set or an URL must be provided");return u&&!a?this.decodeFromVideoUrlContinuously(u,w):this.decodeFromVideoElementContinuously(a,w)},v.prototype.decodeFromImageElement=function(a){if(!a)throw new bs("An image element must be provided.");this.reset();var u=this.prepareImageElement(a);return this.imageElement=u,this.isImageLoaded(u)?this.decodeOnce(u,!1,!0):this._decodeOnLoadImage(u)},v.prototype.decodeFromVideoElement=function(a){var u=this._decodeFromVideoElementSetup(a);return this._decodeOnLoadVideo(u)},v.prototype.decodeFromVideoElementContinuously=function(a,u){var w=this._decodeFromVideoElementSetup(a);return this._decodeOnLoadVideoContinuously(w,u)},v.prototype._decodeFromVideoElementSetup=function(a){if(!a)throw new bs("A video element must be provided.");this.reset();var u=this.prepareVideoElement(a);return this.videoElement=u,u},v.prototype.decodeFromImageUrl=function(a){if(!a)throw new bs("An URL must be provided.");this.reset();var u=this.prepareImageElement();this.imageElement=u;var w=this._decodeOnLoadImage(u);return u.src=a,w},v.prototype.decodeFromVideoUrl=function(a){if(!a)throw new bs("An URL must be provided.");this.reset();var u=this.prepareVideoElement(),w=this.decodeFromVideoElement(u);return u.src=a,w},v.prototype.decodeFromVideoUrlContinuously=function(a,u){if(!a)throw new bs("An URL must be provided.");this.reset();var w=this.prepareVideoElement(),U=this.decodeFromVideoElementContinuously(w,u);return w.src=a,U},v.prototype._decodeOnLoadImage=function(a){var u=this;return new Promise(function(w,U){u.imageLoadedListener=function(){return u.decodeOnce(a,!1,!0).then(w,U)},a.addEventListener("load",u.imageLoadedListener)})},v.prototype._decodeOnLoadVideo=function(a){return Ka(this,void 0,void 0,function(){return sc(this,function(u){switch(u.label){case 0:return[4,this.playVideoOnLoadAsync(a)];case 1:return u.sent(),[4,this.decodeOnce(a)];case 2:return[2,u.sent()]}})})},v.prototype._decodeOnLoadVideoContinuously=function(a,u){return Ka(this,void 0,void 0,function(){return sc(this,function(w){switch(w.label){case 0:return[4,this.playVideoOnLoadAsync(a)];case 1:return w.sent(),this.decodeContinuously(a,u),[2]}})})},v.prototype.isImageLoaded=function(a){return!(!a.complete||0===a.naturalWidth)},v.prototype.prepareImageElement=function(a){var u;return typeof a>"u"&&((u=document.createElement("img")).width=200,u.height=200),"string"==typeof a&&(u=this.getMediaElement(a,"img")),a instanceof HTMLImageElement&&(u=a),u},v.prototype.prepareVideoElement=function(a){var u;return!a&&typeof document<"u"&&((u=document.createElement("video")).width=200,u.height=200),"string"==typeof a&&(u=this.getMediaElement(a,"video")),a instanceof HTMLVideoElement&&(u=a),u.setAttribute("autoplay","true"),u.setAttribute("muted","true"),u.setAttribute("playsinline","true"),u},v.prototype.decodeOnce=function(a,u,w){var U=this;void 0===u&&(u=!0),void 0===w&&(w=!0),this._stopAsyncDecode=!1;var Y=function(le,ge){if(U._stopAsyncDecode)return ge(new Wn("Video stream has ended before any code could be detected.")),void(U._stopAsyncDecode=void 0);try{le(U.decode(a))}catch(Ot){if(u&&Ot instanceof Wn||(Ot instanceof rs||Ot instanceof Qn)&&w)return setTimeout(Y,U._timeBetweenDecodingAttempts,le,ge);ge(Ot)}};return new Promise(function(le,ge){return Y(le,ge)})},v.prototype.decodeContinuously=function(a,u){var w=this;this._stopContinuousDecode=!1;var U=function(){if(w._stopContinuousDecode)w._stopContinuousDecode=void 0;else try{var Y=w.decode(a);u(Y,null),setTimeout(U,w.timeBetweenScansMillis)}catch(Pe){u(null,Pe),(Pe instanceof rs||Pe instanceof Qn||Pe instanceof Wn)&&setTimeout(U,w._timeBetweenDecodingAttempts)}};U()},v.prototype.decode=function(a){var u=this.createBinaryBitmap(a);return this.decodeBitmap(u)},v.prototype.createBinaryBitmap=function(a){this.getCaptureCanvasContext(a),a instanceof HTMLVideoElement?this.drawFrameOnCanvas(a):this.drawImageOnCanvas(a);var w=this.getCaptureCanvas(a),U=new dc(w),Y=new mc(U);return new jc(Y)},v.prototype.getCaptureCanvasContext=function(a){if(!this.captureCanvasContext){var u=this.getCaptureCanvas(a),w=void 0;try{w=u.getContext("2d",{willReadFrequently:!0})}catch{w=u.getContext("2d")}this.captureCanvasContext=w}return this.captureCanvasContext},v.prototype.getCaptureCanvas=function(a){if(!this.captureCanvas){var u=this.createCaptureCanvas(a);this.captureCanvas=u}return this.captureCanvas},v.prototype.drawFrameOnCanvas=function(a,u,w){void 0===u&&(u={sx:0,sy:0,sWidth:a.videoWidth,sHeight:a.videoHeight,dx:0,dy:0,dWidth:a.videoWidth,dHeight:a.videoHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(a,u.sx,u.sy,u.sWidth,u.sHeight,u.dx,u.dy,u.dWidth,u.dHeight)},v.prototype.drawImageOnCanvas=function(a,u,w){void 0===u&&(u={sx:0,sy:0,sWidth:a.naturalWidth,sHeight:a.naturalHeight,dx:0,dy:0,dWidth:a.naturalWidth,dHeight:a.naturalHeight}),void 0===w&&(w=this.captureCanvasContext),w.drawImage(a,u.sx,u.sy,u.sWidth,u.sHeight,u.dx,u.dy,u.dWidth,u.dHeight)},v.prototype.decodeBitmap=function(a){return this.reader.decode(a,this._hints)},v.prototype.createCaptureCanvas=function(a){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var w,U,u=document.createElement("canvas");return typeof a<"u"&&(a instanceof HTMLVideoElement?(w=a.videoWidth,U=a.videoHeight):a instanceof HTMLImageElement&&(w=a.naturalWidth||a.width,U=a.naturalHeight||a.height)),u.style.width=w+"px",u.style.height=U+"px",u.width=w,u.height=U,u},v.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(a){return a.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},v.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},v.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},v.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},v.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},v.prototype.addVideoSource=function(a,u){try{a.srcObject=u}catch{a.src=URL.createObjectURL(u)}},v.prototype.cleanVideoSource=function(a){try{a.srcObject=null}catch{a.src=""}this.videoElement.removeAttribute("src")},v}();const Cs=function(){function v(a,u,w,U,Y,le){void 0===w&&(w=null==u?0:8*u.length),void 0===le&&(le=Rt.currentTimeMillis()),this.text=a,this.rawBytes=u,this.numBits=w,this.resultPoints=U,this.format=Y,this.timestamp=le,this.text=a,this.rawBytes=u,this.numBits=null==w?null==u?0:8*u.length:w,this.resultPoints=U,this.format=Y,this.resultMetadata=null,this.timestamp=null==le?Rt.currentTimeMillis():le}return v.prototype.getText=function(){return this.text},v.prototype.getRawBytes=function(){return this.rawBytes},v.prototype.getNumBits=function(){return this.numBits},v.prototype.getResultPoints=function(){return this.resultPoints},v.prototype.getBarcodeFormat=function(){return this.format},v.prototype.getResultMetadata=function(){return this.resultMetadata},v.prototype.putMetadata=function(a,u){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(a,u)},v.prototype.putAllMetadata=function(a){null!==a&&(this.resultMetadata=null===this.resultMetadata?a:new Map(a))},v.prototype.addResultPoints=function(a){var u=this.resultPoints;if(null===u)this.resultPoints=a;else if(null!==a&&a.length>0){var w=new Array(u.length+a.length);Rt.arraycopy(u,0,w,0,u.length),Rt.arraycopy(a,0,w,u.length,a.length),this.resultPoints=w}},v.prototype.getTimestamp=function(){return this.timestamp},v.prototype.toString=function(){return this.text},v}();var gf=function(v){return v[v.AZTEC=0]="AZTEC",v[v.CODABAR=1]="CODABAR",v[v.CODE_39=2]="CODE_39",v[v.CODE_93=3]="CODE_93",v[v.CODE_128=4]="CODE_128",v[v.DATA_MATRIX=5]="DATA_MATRIX",v[v.EAN_8=6]="EAN_8",v[v.EAN_13=7]="EAN_13",v[v.ITF=8]="ITF",v[v.MAXICODE=9]="MAXICODE",v[v.PDF_417=10]="PDF_417",v[v.QR_CODE=11]="QR_CODE",v[v.RSS_14=12]="RSS_14",v[v.RSS_EXPANDED=13]="RSS_EXPANDED",v[v.UPC_A=14]="UPC_A",v[v.UPC_E=15]="UPC_E",v[v.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION",v}(gf||{});const Do=gf;var gh=function(v){return v[v.OTHER=0]="OTHER",v[v.ORIENTATION=1]="ORIENTATION",v[v.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",v[v.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",v[v.ISSUE_NUMBER=4]="ISSUE_NUMBER",v[v.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",v[v.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",v[v.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",v[v.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",v[v.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",v[v.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY",v}(gh||{});const gc=gh,qu=function(){function v(a,u,w,U,Y,le){void 0===Y&&(Y=-1),void 0===le&&(le=-1),this.rawBytes=a,this.text=u,this.byteSegments=w,this.ecLevel=U,this.structuredAppendSequenceNumber=Y,this.structuredAppendParity=le,this.numBits=null==a?0:8*a.length}return v.prototype.getRawBytes=function(){return this.rawBytes},v.prototype.getNumBits=function(){return this.numBits},v.prototype.setNumBits=function(a){this.numBits=a},v.prototype.getText=function(){return this.text},v.prototype.getByteSegments=function(){return this.byteSegments},v.prototype.getECLevel=function(){return this.ecLevel},v.prototype.getErrorsCorrected=function(){return this.errorsCorrected},v.prototype.setErrorsCorrected=function(a){this.errorsCorrected=a},v.prototype.getErasures=function(){return this.erasures},v.prototype.setErasures=function(a){this.erasures=a},v.prototype.getOther=function(){return this.other},v.prototype.setOther=function(a){this.other=a},v.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},v.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},v.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},v}(),tl=function(){function v(){}return v.prototype.exp=function(a){return this.expTable[a]},v.prototype.log=function(a){if(0===a)throw new ki;return this.logTable[a]},v.addOrSubtract=function(a,u){return a^u},v}(),mu=function(){function v(a,u){if(0===u.length)throw new ki;this.field=a;var w=u.length;if(w>1&&0===u[0]){for(var U=1;Uw.length){var U=u;u=w,w=U}var Y=new Int32Array(w.length),le=w.length-u.length;Rt.arraycopy(w,0,Y,0,le);for(var ge=le;ge=a.getDegree()&&!U.isZero();){var ge=U.getDegree()-a.getDegree(),Pe=u.multiply(U.getCoefficient(U.getDegree()),le),Ge=a.multiplyByMonomial(ge,Pe),dt=u.buildMonomial(ge,Pe);w=w.addOrSubtract(dt),U=U.addOrSubtract(Ge)}return[w,U]},v.prototype.toString=function(){for(var a="",u=this.getDegree();u>=0;u--){var w=this.getCoefficient(u);if(0!==w){if(w<0?(a+=" - ",w=-w):a.length>0&&(a+=" + "),0===u||1!==w){var U=this.field.log(w);0===U?a+="1":1===U?a+="a":(a+="a^",a+=U)}0!==u&&(1===u?a+="x":(a+="x^",a+=u))}}return a},v}();var Ll=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Od=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return Ll(a,v),a.kind="ArithmeticException",a}(Us);var Lu=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Pa=function(v){function a(u,w,U){var Y=v.call(this)||this;Y.primitive=u,Y.size=w,Y.generatorBase=U;for(var le=new Int32Array(w),ge=1,Pe=0;Pe=w&&(ge^=u,ge&=w-1);Y.expTable=le;var Ge=new Int32Array(w);for(Pe=0;Pe=(w/2|0);){var dt=le,_t=Pe;if(Pe=Ge,(le=ge).isZero())throw new Hl("r_{i-1} was zero");ge=dt;for(var Ot=Y.getZero(),Ht=le.getCoefficient(le.getDegree()),Sr=Y.inverse(Ht);ge.getDegree()>=le.getDegree()&&!ge.isZero();){var Ur=ge.getDegree()-le.getDegree(),Zr=Y.multiply(ge.getCoefficient(ge.getDegree()),Sr);Ot=Ot.addOrSubtract(Y.buildMonomial(Ur,Zr)),ge=ge.addOrSubtract(le.multiplyByMonomial(Ur,Zr))}if(Ge=Ot.multiply(Pe).addOrSubtract(_t),ge.getDegree()>=le.getDegree())throw new ou("Division algorithm failed to reduce polynomial?")}var dn=Ge.getCoefficient(0);if(0===dn)throw new Hl("sigmaTilde(0) was zero");var ln=Y.inverse(dn);return[Ge.multiplyScalar(ln),ge.multiplyScalar(ln)]},v.prototype.findErrorLocations=function(a){var u=a.getDegree();if(1===u)return Int32Array.from([a.getCoefficient(1)]);for(var w=new Int32Array(u),U=0,Y=this.field,le=1;le1,Sr,Sr+w-1),Sr+=w-1;else for(var Ur=w-1;Ur>=0;--Ur)Ht[Sr++]=!!(Ot&1<=8?v.readCode(a,u,8):v.readCode(a,u,w)<<8-w},v.convertBoolArrayToByteArray=function(a){for(var u=new Uint8Array((a.length+7)/8),w=0;w","?","[","]","{","}","CTRL_UL"],v.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],v}(),Js=function(){function v(){}return v.round=function(a){return isNaN(a)?0:a<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:a>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:a+(a<0?-.5:.5)|0},v.distance=function(a,u,w,U){var Y=a-w,le=u-U;return Math.sqrt(Y*Y+le*le)},v.sum=function(a){for(var u=0,w=0,U=a.length;w!==U;w++)u+=a[w];return u},v}(),yc=function(){function v(){}return v.floatToIntBits=function(a){return a},v.MAX_VALUE=Number.MAX_SAFE_INTEGER,v}(),Eo=function(){function v(a,u){this.x=a,this.y=u}return v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.equals=function(a){return a instanceof v&&(this.x===a.x&&this.y===a.y)},v.prototype.hashCode=function(){return 31*yc.floatToIntBits(this.x)+yc.floatToIntBits(this.y)},v.prototype.toString=function(){return"("+this.x+","+this.y+")"},v.orderBestPatterns=function(a){var Y,le,ge,u=this.distance(a[0],a[1]),w=this.distance(a[1],a[2]),U=this.distance(a[0],a[2]);if(w>=u&&w>=U?(le=a[0],Y=a[1],ge=a[2]):U>=w&&U>=u?(le=a[1],Y=a[0],ge=a[2]):(le=a[2],Y=a[0],ge=a[1]),this.crossProductZ(Y,le,ge)<0){var Pe=Y;Y=ge,ge=Pe}a[0]=Y,a[1]=le,a[2]=ge},v.distance=function(a,u){return Js.distance(a.x,a.y,u.x,u.y)},v.crossProductZ=function(a,u,w){var U=u.x,Y=u.y;return(w.x-U)*(a.y-Y)-(w.y-Y)*(a.x-U)},v}(),cr=function(){function v(a,u){this.bits=a,this.points=u}return v.prototype.getBits=function(){return this.bits},v.prototype.getPoints=function(){return this.points},v}();var Mt=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Xr=function(v){function a(u,w,U,Y,le){var ge=v.call(this,u,w)||this;return ge.compact=U,ge.nbDatablocks=Y,ge.nbLayers=le,ge}return Mt(a,v),a.prototype.getNbLayers=function(){return this.nbLayers},a.prototype.getNbDatablocks=function(){return this.nbDatablocks},a.prototype.isCompact=function(){return this.compact},a}(cr),ri=function(){function v(a,u,w,U){this.image=a,this.height=a.getHeight(),this.width=a.getWidth(),null==u&&(u=v.INIT_SIZE),null==w&&(w=a.getWidth()/2|0),null==U&&(U=a.getHeight()/2|0);var Y=u/2|0;if(this.leftInit=w-Y,this.rightInit=w+Y,this.upInit=U-Y,this.downInit=U+Y,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new Wn}return v.prototype.detect=function(){for(var a=this.leftInit,u=this.rightInit,w=this.upInit,U=this.downInit,Y=!1,le=!0,ge=!1,Pe=!1,Ge=!1,dt=!1,_t=!1,Ot=this.width,Ht=this.height;le;){le=!1;for(var Sr=!0;(Sr||!Pe)&&u=Ot){Y=!0;break}for(var Ur=!0;(Ur||!Ge)&&U=Ht){Y=!0;break}for(var Zr=!0;(Zr||!dt)&&a>=0;)(Zr=this.containsBlackPoint(w,U,a,!1))?(a--,le=!0,dt=!0):dt||a--;if(a<0){Y=!0;break}for(var dn=!0;(dn||!_t)&&w>=0;)(dn=this.containsBlackPoint(a,u,w,!0))?(w--,le=!0,_t=!0):_t||w--;if(w<0){Y=!0;break}le&&(ge=!0)}if(!Y&&ge){for(var ln=u-a,Tn=null,Gn=1;null===Tn&&Gnw||Pe<-1||Pe>U)throw new Wn;Y=!1,-1===ge?(u[le]=0,Y=!0):ge===w&&(u[le]=w-1,Y=!0),-1===Pe?(u[le+1]=0,Y=!0):Pe===U&&(u[le+1]=U-1,Y=!0)}for(Y=!0,le=u.length-2;le>=0&&Y;le-=2){if(ge=Math.floor(u[le]),Pe=Math.floor(u[le+1]),ge<-1||ge>w||Pe<-1||Pe>U)throw new Wn;Y=!1,-1===ge?(u[le]=0,Y=!0):ge===w&&(u[le]=w-1,Y=!0),-1===Pe?(u[le+1]=0,Y=!0):Pe===U&&(u[le+1]=U-1,Y=!0)}},v}(),Fs=function(){function v(a,u,w,U,Y,le,ge,Pe,Ge){this.a11=a,this.a21=u,this.a31=w,this.a12=U,this.a22=Y,this.a32=le,this.a13=ge,this.a23=Pe,this.a33=Ge}return v.quadrilateralToQuadrilateral=function(a,u,w,U,Y,le,ge,Pe,Ge,dt,_t,Ot,Ht,Sr,Ur,Zr){var dn=v.quadrilateralToSquare(a,u,w,U,Y,le,ge,Pe);return v.squareToQuadrilateral(Ge,dt,_t,Ot,Ht,Sr,Ur,Zr).times(dn)},v.prototype.transformPoints=function(a){for(var u=a.length,w=this.a11,U=this.a12,Y=this.a13,le=this.a21,ge=this.a22,Pe=this.a23,Ge=this.a31,dt=this.a32,_t=this.a33,Ot=0;Ot>1&127):(U<<=10,U+=(le>>2&992)+(le>>1&31))}var ge=this.getCorrectedParameterData(U,this.compact);this.compact?(this.nbLayers=1+(ge>>6),this.nbDataBlocks=1+(63&ge)):(this.nbLayers=1+(ge>>11),this.nbDataBlocks=1+(2047&ge))},v.prototype.getRotation=function(a,u){var w=0;a.forEach(function(Y,le,ge){w=(Y>>u-2<<1)+(1&Y)+(w<<3)}),w=((1&w)<<11)+(w>>1);for(var U=0;U<4;U++)if(pi.bitCount(w^this.EXPECTED_CORNER_BITS[U])<=2)return U;throw new Wn},v.prototype.getCorrectedParameterData=function(a,u){var w,U;u?(w=7,U=2):(w=10,U=4);for(var Y=w-U,le=new Int32Array(w),ge=w-1;ge>=0;--ge)le[ge]=15&a,a>>=4;try{new xc(Pa.AZTEC_PARAM).decode(le,Y)}catch{throw new Wn}var Ge=0;for(ge=0;ge2){var _t=this.distancePoint(dt,ge)*this.nbCenterLayers/(this.distancePoint(Y,u)*(this.nbCenterLayers+2));if(_t<.75||_t>1.25||!this.isWhiteOrBlackRectangle(ge,Pe,Ge,dt))break}u=ge,w=Pe,U=Ge,Y=dt,le=!le}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new Wn;this.compact=5===this.nbCenterLayers;var Ot=new Eo(u.getX()+.5,u.getY()-.5),Ht=new Eo(w.getX()+.5,w.getY()+.5),Sr=new Eo(U.getX()-.5,U.getY()+.5),Ur=new Eo(Y.getX()-.5,Y.getY()-.5);return this.expandSquare([Ot,Ht,Sr,Ur],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},v.prototype.getMatrixCenter=function(){var a,u,w,U;try{a=(Y=new ri(this.image).detect())[0],u=Y[1],w=Y[2],U=Y[3]}catch{var le=this.image.getWidth()/2,ge=this.image.getHeight()/2;a=this.getFirstDifferent(new os(le+7,ge-7),!1,1,-1).toResultPoint(),u=this.getFirstDifferent(new os(le+7,ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new os(le-7,ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new os(le-7,ge-7),!1,-1,-1).toResultPoint()}var Pe=Js.round((a.getX()+U.getX()+u.getX()+w.getX())/4),Ge=Js.round((a.getY()+U.getY()+u.getY()+w.getY())/4);try{var Y;a=(Y=new ri(this.image,15,Pe,Ge).detect())[0],u=Y[1],w=Y[2],U=Y[3]}catch{a=this.getFirstDifferent(new os(Pe+7,Ge-7),!1,1,-1).toResultPoint(),u=this.getFirstDifferent(new os(Pe+7,Ge+7),!1,1,1).toResultPoint(),w=this.getFirstDifferent(new os(Pe-7,Ge+7),!1,-1,1).toResultPoint(),U=this.getFirstDifferent(new os(Pe-7,Ge-7),!1,-1,-1).toResultPoint()}return Pe=Js.round((a.getX()+U.getX()+u.getX()+w.getX())/4),Ge=Js.round((a.getY()+U.getY()+u.getY()+w.getY())/4),new os(Pe,Ge)},v.prototype.getMatrixCornerPoints=function(a){return this.expandSquare(a,2*this.nbCenterLayers,this.getDimension())},v.prototype.sampleGrid=function(a,u,w,U,Y){var le=vo.getInstance(),ge=this.getDimension(),Pe=ge/2-this.nbCenterLayers,Ge=ge/2+this.nbCenterLayers;return le.sampleGrid(a,ge,ge,Pe,Pe,Ge,Pe,Ge,Ge,Pe,Ge,u.getX(),u.getY(),w.getX(),w.getY(),U.getX(),U.getY(),Y.getX(),Y.getY())},v.prototype.sampleLine=function(a,u,w){for(var U=0,Y=this.distanceResultPoint(a,u),le=Y/w,ge=a.getX(),Pe=a.getY(),Ge=le*(u.getX()-a.getX())/Y,dt=le*(u.getY()-a.getY())/Y,_t=0;_t.1&&Ot<.9?0:Ot<=.1===Ge?1:-1},v.prototype.getFirstDifferent=function(a,u,w,U){for(var Y=a.getX()+w,le=a.getY()+U;this.isValid(Y,le)&&this.image.get(Y,le)===u;)Y+=w,le+=U;for(Y-=w,le-=U;this.isValid(Y,le)&&this.image.get(Y,le)===u;)Y+=w;for(Y-=w;this.isValid(Y,le)&&this.image.get(Y,le)===u;)le+=U;return new os(Y,le-=U)},v.prototype.expandSquare=function(a,u,w){var U=w/(2*u),Y=a[0].getX()-a[2].getX(),le=a[0].getY()-a[2].getY(),ge=(a[0].getX()+a[2].getX())/2,Pe=(a[0].getY()+a[2].getY())/2,Ge=new Eo(ge+U*Y,Pe+U*le),dt=new Eo(ge-U*Y,Pe-U*le);return Y=a[1].getX()-a[3].getX(),le=a[1].getY()-a[3].getY(),ge=(a[1].getX()+a[3].getX())/2,Pe=(a[1].getY()+a[3].getY())/2,[Ge,new Eo(ge+U*Y,Pe+U*le),dt,new Eo(ge-U*Y,Pe-U*le)]},v.prototype.isValid=function(a,u){return a>=0&&a0&&u>(le?8:5));Pe=le?U:15;for(var Ge=Math.trunc(U/2),dt=0;dt=U)break;try{Y=a.getBlackRow(Ht,Y)}catch{continue}for(var Sr=function(ln){if(1===ln&&(Y.reverse(),u&&!0===u.get(Di.NEED_RESULT_POINT_CALLBACK))){var Tn=new Map;u.forEach(function(Bi,Ki){return Tn.set(Ki,Bi)}),Tn.delete(Di.NEED_RESULT_POINT_CALLBACK),u=Tn}try{var Gn=Ur.decodeRow(Ht,Y,u);if(1===ln){Gn.putMetadata(gc.ORIENTATION,180);var yi=Gn.getResultPoints();null!==yi&&(yi[0]=new Eo(w-yi[0].getX()-1,yi[0].getY()),yi[1]=new Eo(w-yi[1].getX()-1,yi[1].getY()))}return{value:Gn}}catch{}},Ur=this,Zr=0;Zr<2;Zr++){var dn=Sr(Zr);if("object"==typeof dn)return dn.value}}throw new Wn},v.recordPattern=function(a,u,w){for(var U=w.length,Y=0;Y=le)throw new Wn;for(var ge=!a.get(u),Pe=0,Ge=u;Ge0&&U>=0;)a.get(--u)!==Y&&(U--,Y=!Y);if(U>=0)throw new Wn;v.recordPattern(a,u+1,w)},v.patternMatchVariance=function(a,u,w){for(var U=a.length,Y=0,le=0,ge=0;geOt?_t-Ot:Ot-_t;if(Ht>w)return Number.POSITIVE_INFINITY;Ge+=Ht}return Ge/Y},v}();var gr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const tn=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return gr(a,v),a.findStartPattern=function(u){for(var w=u.getSize(),U=u.getNextSet(0),Y=0,le=Int32Array.from([0,0,0,0,0,0]),ge=U,Pe=!1,dt=U;dt=0&&u.isRange(Math.max(0,ge-(dt-ge)/2),ge,!1))return Int32Array.from([ge,dt,Ot]);ge+=le[0]+le[1],(le=le.slice(2,le.length))[Y-1]=0,le[Y]=0,Y--}else Y++;le[Y]=1,Pe=!Pe}throw new Wn},a.decodeCode=function(u,w,U){Ut.recordPattern(u,U,w);for(var Y=a.MAX_AVG_VARIANCE,le=-1,ge=0;ge=0)return le;throw new Wn},a.prototype.decodeRow=function(u,w,U){var dt,Y=U&&!0===U.get(Di.ASSUME_GS1),le=a.findStartPattern(w),ge=le[2],Pe=0,Ge=new Uint8Array(20);switch(Ge[Pe++]=ge,ge){case a.CODE_START_A:dt=a.CODE_CODE_A;break;case a.CODE_START_B:dt=a.CODE_CODE_B;break;case a.CODE_START_C:dt=a.CODE_CODE_C;break;default:throw new Qn}for(var _t=!1,Ot=!1,Ht="",Sr=le[0],Ur=le[1],Zr=Int32Array.from([0,0,0,0,0,0]),dn=0,ln=0,Tn=ge,Gn=0,yi=!0,Bi=!1,Ki=!1;!_t;){var po=Ot;switch(Ot=!1,dn=ln,ln=a.decodeCode(w,Zr,Ur),Ge[Pe++]=ln,ln!==a.CODE_STOP&&(yi=!0),ln!==a.CODE_STOP&&(Tn+=++Gn*ln),Sr=Ur,Ur+=Zr.reduce(function(Y1,Q1){return Y1+Q1},0),ln){case a.CODE_START_A:case a.CODE_START_B:case a.CODE_START_C:throw new Qn}switch(dt){case a.CODE_CODE_A:if(ln<64)Ht+=String.fromCharCode(Ki===Bi?32+ln:32+ln+128),Ki=!1;else if(ln<96)Ht+=String.fromCharCode(Ki===Bi?ln-64:ln+64),Ki=!1;else switch(ln!==a.CODE_STOP&&(yi=!1),ln){case a.CODE_FNC_1:Y&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case a.CODE_FNC_2:case a.CODE_FNC_3:break;case a.CODE_FNC_4_A:!Bi&&Ki?(Bi=!0,Ki=!1):Bi&&Ki?(Bi=!1,Ki=!1):Ki=!0;break;case a.CODE_SHIFT:Ot=!0,dt=a.CODE_CODE_B;break;case a.CODE_CODE_B:dt=a.CODE_CODE_B;break;case a.CODE_CODE_C:dt=a.CODE_CODE_C;break;case a.CODE_STOP:_t=!0}break;case a.CODE_CODE_B:if(ln<96)Ht+=String.fromCharCode(Ki===Bi?32+ln:32+ln+128),Ki=!1;else switch(ln!==a.CODE_STOP&&(yi=!1),ln){case a.CODE_FNC_1:Y&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case a.CODE_FNC_2:case a.CODE_FNC_3:break;case a.CODE_FNC_4_B:!Bi&&Ki?(Bi=!0,Ki=!1):Bi&&Ki?(Bi=!1,Ki=!1):Ki=!0;break;case a.CODE_SHIFT:Ot=!0,dt=a.CODE_CODE_A;break;case a.CODE_CODE_A:dt=a.CODE_CODE_A;break;case a.CODE_CODE_C:dt=a.CODE_CODE_C;break;case a.CODE_STOP:_t=!0}break;case a.CODE_CODE_C:if(ln<100)ln<10&&(Ht+="0"),Ht+=ln;else switch(ln!==a.CODE_STOP&&(yi=!1),ln){case a.CODE_FNC_1:Y&&(Ht+=0===Ht.length?"]C1":"\x1d");break;case a.CODE_CODE_A:dt=a.CODE_CODE_A;break;case a.CODE_CODE_B:dt=a.CODE_CODE_B;break;case a.CODE_STOP:_t=!0}}po&&(dt=dt===a.CODE_CODE_A?a.CODE_CODE_B:a.CODE_CODE_A)}var gs=Ur-Sr;if(Ur=w.getNextUnset(Ur),!w.isRange(Ur,Math.min(w.getSize(),Ur+(Ur-Sr)/2),!1))throw new Wn;if((Tn-=Gn*dn)%103!==dn)throw new rs;var ns=Ht.length;if(0===ns)throw new Wn;ns>0&&yi&&(Ht=Ht.substring(0,dt===a.CODE_CODE_C?ns-2:ns-1));for(var _l=(le[1]+le[0])/2,ja=Sr+gs/2,Xc=Ge.length,bd=new Uint8Array(Xc),Th=0;Th=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ti=function(v){function a(u,w){void 0===u&&(u=!1),void 0===w&&(w=!1);var U=v.call(this)||this;return U.usingCheckDigit=u,U.extendedMode=w,U.decodeRowResult="",U.counters=new Int32Array(9),U}return En(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge,Pe,Ge=this.counters;Ge.fill(0),this.decodeRowResult="";var Ht,Sr,dt=a.findAsteriskPattern(w,Ge),_t=w.getNextSet(dt[1]),Ot=w.getSize();do{a.recordPattern(w,_t,Ge);var Ur=a.toNarrowWidePattern(Ge);if(Ur<0)throw new Wn;Ht=a.patternToChar(Ur),this.decodeRowResult+=Ht,Sr=_t;try{for(var Zr=(Y=void 0,_n(Ge)),dn=Zr.next();!dn.done;dn=Zr.next())_t+=dn.value}catch(Xc){Y={error:Xc}}finally{try{dn&&!dn.done&&(le=Zr.return)&&le.call(Zr)}finally{if(Y)throw Y.error}}_t=w.getNextSet(_t)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var ns,Tn=0;try{for(var Gn=_n(Ge),yi=Gn.next();!yi.done;yi=Gn.next())Tn+=yi.value}catch(Xc){ge={error:Xc}}finally{try{yi&&!yi.done&&(Pe=Gn.return)&&Pe.call(Gn)}finally{if(ge)throw ge.error}}if(_t!==Ot&&2*(_t-Sr-Tn)le&&(Pe=_t)}catch(Ur){w={error:Ur}}finally{try{dt&&!dt.done&&(U=Ge.return)&&U.call(Ge)}finally{if(w)throw w.error}}le=Pe,ge=0;for(var Ot=0,Ht=0,Sr=0;Srle&&(Ht|=1<0;Sr++){var _t;if((_t=u[Sr])>le&&(ge--,2*_t>=Ot))return-1}return Ht}}while(ge>3);return-1},a.patternToChar=function(u){for(var w=0;w="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"$":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"%":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if("X"!==ge&&"Y"!==ge&&"Z"!==ge)throw new Qn;Pe="\x7f"}break;case"/":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,Y++}else U+=le}return U},a.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",a.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],a.ASTERISK_ENCODING=148,a}(Ut);var So=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Vs=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const zs=function(v){function a(){var u=v.call(this)||this;return u.decodeRowResult="",u.counters=new Int32Array(6),u}return So(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge,Pe,Ht,Sr,Ge=this.findAsteriskPattern(w),dt=w.getNextSet(Ge[1]),_t=w.getSize(),Ot=this.counters;Ot.fill(0),this.decodeRowResult="";do{a.recordPattern(w,dt,Ot);var Ur=this.toPattern(Ot);if(Ur<0)throw new Wn;Ht=this.patternToChar(Ur),this.decodeRowResult+=Ht,Sr=dt;try{for(var Zr=(Y=void 0,Vs(Ot)),dn=Zr.next();!dn.done;dn=Zr.next())dt+=dn.value}catch(gs){Y={error:gs}}finally{try{dn&&!dn.done&&(le=Zr.return)&&le.call(Zr)}finally{if(Y)throw Y.error}}dt=w.getNextSet(dt)}while("*"!==Ht);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var Tn=0;try{for(var Gn=Vs(Ot),yi=Gn.next();!yi.done;yi=Gn.next())Tn+=yi.value}catch(gs){ge={error:gs}}finally{try{yi&&!yi.done&&(Pe=Gn.return)&&Pe.call(Gn)}finally{if(ge)throw ge.error}}if(dt===_t||!w.get(dt))throw new Wn;if(this.decodeRowResult.length<2)throw new Wn;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var Bi=this.decodeExtended(this.decodeRowResult),po=Sr+Tn/2;return new Cs(Bi,null,0,[new Eo((Ge[1]+Ge[0])/2,u),new Eo(po,u)],Do.CODE_93,(new Date).getTime())},a.prototype.findAsteriskPattern=function(u){var w=u.getSize(),U=u.getNextSet(0);this.counters.fill(0);for(var Y=this.counters,le=U,ge=!1,Pe=Y.length,Ge=0,dt=U;dt4)return-1;if(1&_t)Ge<<=Ot;else for(var Ht=0;Ht="a"&&le<="d"){if(Y>=w-1)throw new Qn;var ge=u.charAt(Y+1),Pe="\0";switch(le){case"d":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)+32);break;case"a":if(!(ge>="A"&&ge<="Z"))throw new Qn;Pe=String.fromCharCode(ge.charCodeAt(0)-64);break;case"b":if(ge>="A"&&ge<="E")Pe=String.fromCharCode(ge.charCodeAt(0)-38);else if(ge>="F"&&ge<="J")Pe=String.fromCharCode(ge.charCodeAt(0)-11);else if(ge>="K"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)+16);else if(ge>="P"&&ge<="T")Pe=String.fromCharCode(ge.charCodeAt(0)+43);else if("U"===ge)Pe="\0";else if("V"===ge)Pe="@";else if("W"===ge)Pe="`";else{if(!(ge>="X"&&ge<="Z"))throw new Qn;Pe="\x7f"}break;case"c":if(ge>="A"&&ge<="O")Pe=String.fromCharCode(ge.charCodeAt(0)-32);else{if("Z"!==ge)throw new Qn;Pe=":"}}U+=Pe,Y++}else U+=le}return U},a.prototype.checkChecksums=function(u){var w=u.length;this.checkOneChecksum(u,w-2,20),this.checkOneChecksum(u,w-1,15)},a.prototype.checkOneChecksum=function(u,w,U){for(var Y=1,le=0,ge=w-1;ge>=0;ge--)le+=Y*a.ALPHABET_STRING.indexOf(u.charAt(ge)),++Y>U&&(Y=1);if(u.charAt(w)!==a.ALPHABET_STRING[le%47])throw new rs},a.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",a.ASTERISK_ENCODING=(a.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350])[47],a}(Ut);var ea=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const us=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.narrowLineWidth=-1,u}return ea(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge=this.decodeStart(w),Pe=this.decodeEnd(w),Ge=new jr;a.decodeMiddle(w,ge[1],Pe[0],Ge);var dt=Ge.toString(),_t=null;null!=U&&(_t=U.get(Di.ALLOWED_LENGTHS)),null==_t&&(_t=a.DEFAULT_ALLOWED_LENGTHS);var Ot=dt.length,Ht=!1,Sr=0;try{for(var Ur=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(_t),Zr=Ur.next();!Zr.done;Zr=Ur.next()){var dn=Zr.value;if(Ot===dn){Ht=!0;break}dn>Sr&&(Sr=dn)}}catch(Gn){Y={error:Gn}}finally{try{Zr&&!Zr.done&&(le=Ur.return)&&le.call(Ur)}finally{if(Y)throw Y.error}}if(!Ht&&Ot>Sr&&(Ht=!0),!Ht)throw new Qn;var ln=[new Eo(ge[1],u),new Eo(Pe[0],u)];return new Cs(dt,null,0,ln,Do.ITF,(new Date).getTime())},a.decodeMiddle=function(u,w,U,Y){var le=new Int32Array(10),ge=new Int32Array(5),Pe=new Int32Array(5);for(le.fill(0),ge.fill(0),Pe.fill(0);w0&&Y>=0&&!u.get(Y);Y--)U--;if(0!==U)throw new Wn},a.skipWhiteSpace=function(u){var w=u.getSize(),U=u.getNextSet(0);if(U===w)throw new Wn;return U},a.prototype.decodeEnd=function(u){u.reverse();try{var w=a.skipWhiteSpace(u),U=void 0;try{U=a.findGuardPattern(u,w,a.END_PATTERN_REVERSED[0])}catch(le){le instanceof Wn&&(U=a.findGuardPattern(u,w,a.END_PATTERN_REVERSED[1]))}this.validateQuietZone(u,U[0]);var Y=U[0];return U[0]=u.getSize()-U[1],U[1]=u.getSize()-Y,U}finally{u.reverse()}},a.findGuardPattern=function(u,w,U){var Y=U.length,le=new Int32Array(Y),ge=u.getSize(),Pe=!1,Ge=0,dt=w;le.fill(0);for(var _t=w;_t=0)return U%10;throw new Wn},a.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],a.MAX_AVG_VARIANCE=.38,a.MAX_INDIVIDUAL_VARIANCE=.5,a.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],a.START_PATTERN=Int32Array.from([1,1,1,1]),a.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],a}(Ut);var ws=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const go=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.decodeRowStringBuffer="",u}return ws(a,v),a.findStartGuardPattern=function(u){for(var U,w=!1,Y=0,le=Int32Array.from([0,0,0]);!w;){le=Int32Array.from([0,0,0]);var ge=(U=a.findGuardPattern(u,Y,!1,this.START_END_PATTERN,le))[0],Pe=ge-((Y=U[1])-ge);Pe>=0&&(w=u.isRange(Pe,ge,!1))}return U},a.checkChecksum=function(u){return a.checkStandardUPCEANChecksum(u)},a.checkStandardUPCEANChecksum=function(u){var w=u.length;if(0===w)return!1;var U=parseInt(u.charAt(w-1),10);return a.getStandardUPCEANChecksum(u.substring(0,w-1))===U},a.getStandardUPCEANChecksum=function(u){for(var w=u.length,U=0,Y=w-1;Y>=0;Y-=2){if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}for(U*=3,Y=w-2;Y>=0;Y-=2){var le;if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}return(1e3-U)%10},a.decodeEnd=function(u,w){return a.findGuardPattern(u,w,!1,a.START_END_PATTERN,new Int32Array(a.START_END_PATTERN.length).fill(0))},a.findGuardPatternWithoutCounters=function(u,w,U,Y){return this.findGuardPattern(u,w,U,Y,new Int32Array(Y.length))},a.findGuardPattern=function(u,w,U,Y,le){for(var ge=u.getSize(),Pe=0,Ge=w=U?u.getNextUnset(w):u.getNextSet(w),dt=Y.length,_t=U,Ot=w;Ot=0)return ge;throw new Wn},a.MAX_AVG_VARIANCE=.48,a.MAX_INDIVIDUAL_VARIANCE=.7,a.START_END_PATTERN=Int32Array.from([1,1,1]),a.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),a.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),a.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],a}(Ut);var Ks=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ac=function(){function v(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return v.prototype.decodeRow=function(a,u,w){var U=this.decodeRowStringBuffer,Y=this.decodeMiddle(u,w,U),le=U.toString(),ge=v.parseExtensionString(le),Pe=[new Eo((w[0]+w[1])/2,a),new Eo(Y,a)],Ge=new Cs(le,null,0,Pe,Do.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},v.prototype.decodeMiddle=function(a,u,w){var U,Y,le=this.decodeMiddleCounters;le[0]=0,le[1]=0,le[2]=0,le[3]=0;for(var ge=a.getSize(),Pe=u[1],Ge=0,dt=0;dt<5&&Pe=10&&(Ge|=1<<4-dt),4!==dt&&(Pe=a.getNextSet(Pe),Pe=a.getNextUnset(Pe))}if(5!==w.length)throw new Wn;var Ur=this.determineCheckDigit(Ge);if(v.extensionChecksum(w.toString())!==Ur)throw new Wn;return Pe},v.extensionChecksum=function(a){for(var u=a.length,w=0,U=u-2;U>=0;U-=2)w+=a.charAt(U).charCodeAt(0)-48;for(w*=3,U=u-1;U>=0;U-=2)w+=a.charAt(U).charCodeAt(0)-48;return(w*=3)%10},v.prototype.determineCheckDigit=function(a){for(var u=0;u<10;u++)if(a===this.CHECK_DIGIT_ENCODINGS[u])return u;throw new Wn},v.parseExtensionString=function(a){if(5!==a.length)return null;var u=v.parseExtension5String(a);return null==u?null:new Map([[gc.SUGGESTED_PRICE,u]])},v.parseExtension5String=function(a){var u;switch(a.charAt(0)){case"0":u="\xa3";break;case"5":u="$";break;case"9":switch(a){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}u="";break;default:u=""}var w=parseInt(a.substring(1)),Y=w%100;return u+(w/100).toString()+"."+(Y<10?"0"+Y:Y.toString())},v}();var Na=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Fd=function(){function v(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return v.prototype.decodeRow=function(a,u,w){var U=this.decodeRowStringBuffer,Y=this.decodeMiddle(u,w,U),le=U.toString(),ge=v.parseExtensionString(le),Pe=[new Eo((w[0]+w[1])/2,a),new Eo(Y,a)],Ge=new Cs(le,null,0,Pe,Do.UPC_EAN_EXTENSION,(new Date).getTime());return null!=ge&&Ge.putAllMetadata(ge),Ge},v.prototype.decodeMiddle=function(a,u,w){var U,Y,le=this.decodeMiddleCounters;le[0]=0,le[1]=0,le[2]=0,le[3]=0;for(var ge=a.getSize(),Pe=u[1],Ge=0,dt=0;dt<2&&Pe=10&&(Ge|=1<<1-dt),1!==dt&&(Pe=a.getNextSet(Pe),Pe=a.getNextUnset(Pe))}if(2!==w.length)throw new Wn;if(parseInt(w.toString())%4!==Ge)throw new Wn;return Pe},v.parseExtensionString=function(a){return 2!==a.length?null:new Map([[gc.ISSUE_NUMBER,parseInt(a)]])},v}(),yu=function(){function v(){}return v.decodeRow=function(a,u,w){var U=go.findGuardPattern(u,w,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new ac).decodeRow(a,u,U)}catch{return(new Fd).decodeRow(a,u,U)}},v.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),v}();var vh=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const pl=function(v){function a(){var u=v.call(this)||this;u.decodeRowStringBuffer="",a.L_AND_G_PATTERNS=a.L_PATTERNS.map(function(ge){return Int32Array.from(ge)});for(var w=10;w<20;w++){for(var U=a.L_PATTERNS[w-10],Y=new Int32Array(U.length),le=0;le=w.getSize()||!w.isRange(Sr,Ur,!1))throw new Wn;var Zr=dt.toString();if(Zr.length<8)throw new Qn;if(!a.checkChecksum(Zr))throw new rs;var dn=(Y[1]+Y[0])/2,ln=(Ot[1]+Ot[0])/2,Tn=this.getBarcodeFormat(),Gn=[new Eo(dn,u),new Eo(ln,u)],yi=new Cs(Zr,null,0,Gn,Tn,(new Date).getTime()),Bi=0;try{var Ki=yu.decodeRow(u,w,Ot[1]);yi.putMetadata(gc.UPC_EAN_EXTENSION,Ki.getText()),yi.putAllMetadata(Ki.getResultMetadata()),yi.addResultPoints(Ki.getResultPoints()),Bi=Ki.getText().length}catch{}var po=null==U?null:U.get(Di.ALLOWED_EAN_EXTENSIONS);if(null!=po){var gs=!1;for(var ns in po)if(Bi.toString()===ns){gs=!0;break}if(!gs)throw new Wn}return yi},a.checkChecksum=function(u){return a.checkStandardUPCEANChecksum(u)},a.checkStandardUPCEANChecksum=function(u){var w=u.length;if(0===w)return!1;var U=parseInt(u.charAt(w-1),10);return a.getStandardUPCEANChecksum(u.substring(0,w-1))===U},a.getStandardUPCEANChecksum=function(u){for(var w=u.length,U=0,Y=w-1;Y>=0;Y-=2){if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}for(U*=3,Y=w-2;Y>=0;Y-=2){var le;if((le=u.charAt(Y).charCodeAt(0)-48)<0||le>9)throw new Qn;U+=le}return(1e3-U)%10},a.decodeEnd=function(u,w){return a.findGuardPattern(u,w,!1,a.START_END_PATTERN,new Int32Array(a.START_END_PATTERN.length).fill(0))},a}(go);var Mp=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),zh=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Kh=function(v){function a(){var u=v.call(this)||this;return u.decodeMiddleCounters=Int32Array.from([0,0,0,0]),u}return Mp(a,v),a.prototype.decodeMiddle=function(u,w,U){var Y,le,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var dt=u.getSize(),_t=w[1],Ot=0,Ht=0;Ht<6&&_t=10&&(Ot|=1<<5-Ht)}for(U=a.determineFirstDigit(U,Ot),_t=pl.findGuardPattern(u,_t,!0,pl.MIDDLE_PATTERN,new Int32Array(pl.MIDDLE_PATTERN.length).fill(0))[1],Ht=0;Ht<6&&_t=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const zg=function(v){function a(){var u=v.call(this)||this;return u.decodeMiddleCounters=Int32Array.from([0,0,0,0]),u}return qv(a,v),a.prototype.decodeMiddle=function(u,w,U){var Y,le,ge,Pe,Ge=this.decodeMiddleCounters;Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0;for(var dt=u.getSize(),_t=w[1],Ot=0;Ot<4&&_t=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Dr=function(v){function a(){var u=v.call(this)||this;return u.decodeMiddleCounters=new Int32Array(4),u}return at(a,v),a.prototype.decodeMiddle=function(u,w,U){var Y,le,ge=this.decodeMiddleCounters.map(function(Zr){return Zr});ge[0]=0,ge[1]=0,ge[2]=0,ge[3]=0;for(var Pe=u.getSize(),Ge=w[1],dt=0,_t=0;_t<6&&Ge=10&&(dt|=1<<5-_t)}return a.determineNumSysAndCheckDigit(new jr(U),dt),Ge},a.prototype.decodeEnd=function(u,w){return a.findGuardPatternWithoutCounters(u,w,!0,a.MIDDLE_END_PATTERN)},a.prototype.checkChecksum=function(u){return pl.checkChecksum(a.convertUPCEtoUPCA(u))},a.determineNumSysAndCheckDigit=function(u,w){for(var U=0;U<=1;U++)for(var Y=0;Y<10;Y++)if(w===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[U][Y])return u.insert(0,"0"+U),void u.append("0"+Y);throw Wn.getNotFoundInstance()},a.prototype.getBarcodeFormat=function(){return Do.UPC_E},a.convertUPCEtoUPCA=function(u){var w=u.slice(1,7).split("").map(function(le){return le.charCodeAt(0)}),U=new jr;U.append(u.charAt(0));var Y=w[5];switch(Y){case 0:case 1:case 2:U.appendChars(w,0,2),U.append(Y),U.append("0000"),U.appendChars(w,2,3);break;case 3:U.appendChars(w,0,3),U.append("00000"),U.appendChars(w,3,2);break;case 4:U.appendChars(w,0,4),U.append("00000"),U.append(w[4]);break;default:U.appendChars(w,0,5),U.append("0000"),U.append(Y)}return u.length>=8&&U.append(u.charAt(7)),U.toString()},a.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),a.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],a}(pl);var Jr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Kn=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Gi=function(v){function a(u){var w=v.call(this)||this,U=null==u?null:u.get(Di.POSSIBLE_FORMATS),Y=[];return null!=U&&(U.indexOf(Do.EAN_13)>-1&&Y.push(new Kh),U.indexOf(Do.UPC_A)>-1&&Y.push(new At),U.indexOf(Do.EAN_8)>-1&&Y.push(new zg),U.indexOf(Do.UPC_E)>-1&&Y.push(new Dr)),0===Y.length&&(Y.push(new Kh),Y.push(new At),Y.push(new zg),Y.push(new Dr)),w.readers=Y,w}return Jr(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le;try{for(var ge=Kn(this.readers),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;try{var dt=Ge.decodeRow(u,w,U),_t=dt.getBarcodeFormat()===Do.EAN_13&&"0"===dt.getText().charAt(0),Ot=null==U?null:U.get(Di.POSSIBLE_FORMATS),Ht=null==Ot||Ot.includes(Do.UPC_A);if(_t&&Ht){var Sr=dt.getRawBytes(),Ur=new Cs(dt.getText().substring(1),Sr,Sr?Sr.length:null,dt.getResultPoints(),Do.UPC_A);return Ur.putAllMetadata(dt.getResultMetadata()),Ur}return dt}catch{}}}catch(Zr){Y={error:Zr}}finally{try{Pe&&!Pe.done&&(le=ge.return)&&le.call(ge)}finally{if(Y)throw Y.error}}throw new Wn},a.prototype.reset=function(){var u,w;try{for(var U=Kn(this.readers),Y=U.next();!Y.done;Y=U.next())Y.value.reset()}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}},a}(Ut);var ss=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const vc=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},u}return ss(a,v),a.prototype.decodeRow=function(u,w,U){var Y=this.getValidRowData(w);if(!Y)throw new Wn;var le=this.codaBarDecodeRow(Y.row);if(!le)throw new Wn;return new Cs(le,null,0,[new Eo(Y.left,u),new Eo(Y.right,u)],Do.CODABAR,(new Date).getTime())},a.prototype.getValidRowData=function(u){var w=u.toArray(),U=w.indexOf(!0);if(-1===U)return null;var Y=w.lastIndexOf(!0);if(Y<=U)return null;for(var le=[],ge=(w=w.slice(U,Y+1))[0],Pe=1,Ge=1;Ge0;){var le=u.splice(0,8).splice(0,7).map(function(Pe){return PeY&&(Y=w[le],U=le);u[U]++},a.decrement=function(u,w){for(var U=0,Y=w[0],le=1;le=a.MIN_FINDER_PATTERN_RATIO&&ge<=a.MAX_FINDER_PATTERN_RATIO){var Pe=Number.MAX_SAFE_INTEGER,Ge=Number.MIN_SAFE_INTEGER;try{for(var dt=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;Ot>Ge&&(Ge=Ot),Ot=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),Pe=ge.next();!Pe.done;Pe=ge.next())le+=Pe.value}catch(ln){U={error:ln}}finally{try{Pe&&!Pe.done&&(Y=ge.return)&&Y.call(ge)}finally{if(U)throw U.error}}for(var dt=0,_t=0,Ot=a.length,Ht=0;Ht=Ot-Ht-1&&(Ur-=v.combins(le-Sr-(Ot-Ht),Ot-Ht-2)),Ot-Ht-1>1){for(var Zr=0,dn=le-Sr-(Ot-Ht-2);dn>u;dn--)Zr+=v.combins(le-Sr-dn-1,Ot-Ht-3);Ur-=Zr*(Ot-1-Ht)}else le-Sr>u&&Ur--;dt+=Ur}le-=Sr}return dt},v.combins=function(a,u){var w,U;a-u>u?(U=u,w=a-u):(U=a-u,w=u);for(var Y=1,le=1,ge=a;ge>w;ge--)Y*=ge,le<=U&&(Y/=le,le++);for(;le<=U;)Y/=le,le++;return Y},v}(),Hh=function(){function v(){}return v.buildBitArray=function(a){var u=2*a.length-1;null==a[a.length-1].getRightChar()&&(u-=1);for(var U=new bi(12*u),Y=0,ge=a[0].getRightChar().getValue(),Pe=11;Pe>=0;--Pe)ge&1<=0;--_t)dt&1<<_t&&U.set(Y),Y++;if(null!==Ge.getRightChar()){var Ot=Ge.getRightChar().getValue();for(_t=11;_t>=0;--_t)Ot&1<<_t&&U.set(Y),Y++}}return U},v}(),Qs=function(){function v(a,u){u?this.decodedInformation=null:(this.finished=a,this.decodedInformation=u)}return v.prototype.getDecodedInformation=function(){return this.decodedInformation},v.prototype.isFinished=function(){return this.finished},v}(),bh=function(){function v(a){this.newPosition=a}return v.prototype.getNewPosition=function(){return this.newPosition},v}();var su=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const vu=function(v){function a(u,w){var U=v.call(this,u)||this;return U.value=w,U}return su(a,v),a.prototype.getValue=function(){return this.value},a.prototype.isFNC1=function(){return this.value===a.FNC1},a.FNC1="$",a}(bh);var Fe=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Ye=function(v){function a(u,w,U){var Y=v.call(this,u)||this;return U?(Y.remaining=!0,Y.remainingValue=Y.remainingValue):(Y.remaining=!1,Y.remainingValue=0),Y.newString=w,Y}return Fe(a,v),a.prototype.getNewString=function(){return this.newString},a.prototype.isRemaining=function(){return this.remaining},a.prototype.getRemainingValue=function(){return this.remainingValue},a}(bh);var pr=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Er=function(v){function a(u,w,U){var Y=v.call(this,u)||this;if(w<0||w>10||U<0||U>10)throw new Qn;return Y.firstDigit=w,Y.secondDigit=U,Y}return pr(a,v),a.prototype.getFirstDigit=function(){return this.firstDigit},a.prototype.getSecondDigit=function(){return this.secondDigit},a.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},a.prototype.isFirstDigitFNC1=function(){return this.firstDigit===a.FNC1},a.prototype.isSecondDigitFNC1=function(){return this.secondDigit===a.FNC1},a.prototype.isAnyFNC1=function(){return this.firstDigit===a.FNC1||this.secondDigit===a.FNC1},a.FNC1=10,a}(bh);var on=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Ri=function(){function v(){}return v.parseFieldsInGeneralPurpose=function(a){var u,w,U,Y,le,ge,Pe,Ge;if(!a)return null;if(a.length<2)throw new Wn;var dt=a.substring(0,2);try{for(var _t=on(v.TWO_DIGIT_DATA_LENGTH),Ot=_t.next();!Ot.done;Ot=_t.next())if((Ht=Ot.value)[0]===dt)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(2,Ht[2],a):v.processFixedAI(2,Ht[1],a)}catch(Bi){u={error:Bi}}finally{try{Ot&&!Ot.done&&(w=_t.return)&&w.call(_t)}finally{if(u)throw u.error}}if(a.length<3)throw new Wn;var Sr=a.substring(0,3);try{for(var Ur=on(v.THREE_DIGIT_DATA_LENGTH),Zr=Ur.next();!Zr.done;Zr=Ur.next())if((Ht=Zr.value)[0]===Sr)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(3,Ht[2],a):v.processFixedAI(3,Ht[1],a)}catch(Bi){U={error:Bi}}finally{try{Zr&&!Zr.done&&(Y=Ur.return)&&Y.call(Ur)}finally{if(U)throw U.error}}try{for(var dn=on(v.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),ln=dn.next();!ln.done;ln=dn.next())if((Ht=ln.value)[0]===Sr)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(4,Ht[2],a):v.processFixedAI(4,Ht[1],a)}catch(Bi){le={error:Bi}}finally{try{ln&&!ln.done&&(ge=dn.return)&&ge.call(dn)}finally{if(le)throw le.error}}if(a.length<4)throw new Wn;var Tn=a.substring(0,4);try{for(var Gn=on(v.FOUR_DIGIT_DATA_LENGTH),yi=Gn.next();!yi.done;yi=Gn.next()){var Ht;if((Ht=yi.value)[0]===Tn)return Ht[1]===v.VARIABLE_LENGTH?v.processVariableAI(4,Ht[2],a):v.processFixedAI(4,Ht[1],a)}}catch(Bi){Pe={error:Bi}}finally{try{yi&&!yi.done&&(Ge=Gn.return)&&Ge.call(Gn)}finally{if(Pe)throw Pe.error}}throw new Wn},v.processFixedAI=function(a,u,w){if(w.lengththis.information.getSize())return a+4<=this.information.getSize();for(var u=a;uthis.information.getSize()){var u=this.extractNumericValueFromBitArray(a,4);return new Er(this.information.getSize(),0===u?Er.FNC1:u-1,Er.FNC1)}var w=this.extractNumericValueFromBitArray(a,7);return new Er(a+7,(w-8)/11,(w-8)%11)},v.prototype.extractNumericValueFromBitArray=function(a,u){return v.extractNumericValueFromBitArray(this.information,a,u)},v.extractNumericValueFromBitArray=function(a,u,w){for(var U=0,Y=0;Ythis.information.getSize())return!1;var u=this.extractNumericValueFromBitArray(a,5);if(u>=5&&u<16)return!0;if(a+7>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(a,7);if(w>=64&&w<116)return!0;if(a+8>this.information.getSize())return!1;var U=this.extractNumericValueFromBitArray(a,8);return U>=232&&U<253},v.prototype.decodeIsoIec646=function(a){var u=this.extractNumericValueFromBitArray(a,5);if(15===u)return new vu(a+5,vu.FNC1);if(u>=5&&u<15)return new vu(a+5,"0"+(u-5));var Y,w=this.extractNumericValueFromBitArray(a,7);if(w>=64&&w<90)return new vu(a+7,""+(w+1));if(w>=90&&w<116)return new vu(a+7,""+(w+7));switch(this.extractNumericValueFromBitArray(a,8)){case 232:Y="!";break;case 233:Y='"';break;case 234:Y="%";break;case 235:Y="&";break;case 236:Y="'";break;case 237:Y="(";break;case 238:Y=")";break;case 239:Y="*";break;case 240:Y="+";break;case 241:Y=",";break;case 242:Y="-";break;case 243:Y=".";break;case 244:Y="/";break;case 245:Y=":";break;case 246:Y=";";break;case 247:Y="<";break;case 248:Y="=";break;case 249:Y=">";break;case 250:Y="?";break;case 251:Y="_";break;case 252:Y=" ";break;default:throw new Qn}return new vu(a+8,Y)},v.prototype.isStillAlpha=function(a){if(a+5>this.information.getSize())return!1;var u=this.extractNumericValueFromBitArray(a,5);if(u>=5&&u<16)return!0;if(a+6>this.information.getSize())return!1;var w=this.extractNumericValueFromBitArray(a,6);return w>=16&&w<63},v.prototype.decodeAlphanumeric=function(a){var u=this.extractNumericValueFromBitArray(a,5);if(15===u)return new vu(a+5,vu.FNC1);if(u>=5&&u<15)return new vu(a+5,"0"+(u-5));var U,w=this.extractNumericValueFromBitArray(a,6);if(w>=32&&w<58)return new vu(a+6,""+(w+33));switch(w){case 58:U="*";break;case 59:U=",";break;case 60:U="-";break;case 61:U=".";break;case 62:U="/";break;default:throw new ou("Decoding invalid alphanumeric value: "+w)}return new vu(a+6,U)},v.prototype.isAlphaTo646ToAlphaLatch=function(a){if(a+1>this.information.getSize())return!1;for(var u=0;u<5&&u+athis.information.getSize())return!1;for(var u=a;uthis.information.getSize())return!1;for(var u=0;u<4&&u+a=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const jl=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.pairs=new Array(a.MAX_PAIRS),u.rows=new Array,u.startEnd=[2],u}return Uw(a,v),a.prototype.decodeRow=function(u,w,U){this.pairs.length=0,this.startFromEven=!1;try{return a.constructResult(this.decodeRow2pairs(u,w))}catch{}return this.pairs.length=0,this.startFromEven=!0,a.constructResult(this.decodeRow2pairs(u,w))},a.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},a.prototype.decodeRow2pairs=function(u,w){for(var U=!1;!U;)try{this.pairs.push(this.retrieveNextPair(w,this.pairs,u))}catch(ge){if(ge instanceof Wn){if(!this.pairs.length)throw new Wn;U=!0}}if(this.checkChecksum())return this.pairs;var Y;if(Y=!!this.rows.length,this.storeRow(u,!1),Y){var le=this.checkRowsBoolean(!1);if(null!=le||null!=(le=this.checkRowsBoolean(!0)))return le}throw new Wn},a.prototype.checkRowsBoolean=function(u){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,u&&(this.rows=this.rows.reverse());var w=null;try{w=this.checkRows(new Array,0)}catch(U){console.log(U)}return u&&(this.rows=this.rows.reverse()),w},a.prototype.checkRows=function(u,w){for(var U,Y,le=w;lege.length)){for(var Pe=!0,Ge=0;Geu){le=ge.isEquivalent(this.pairs);break}Y=ge.isEquivalent(this.pairs),U++}le||Y||a.isPartialRow(this.pairs,this.rows)||(this.rows.push(U,new Wh(this.pairs,u,w)),this.removePartialRows(this.pairs,this.rows))},a.prototype.removePartialRows=function(u,w){var U,Y,le,ge,Pe,Ge;try{for(var dt=Hc(w),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;if(Ot.getPairs().length!==u.length)try{for(var Sr=(le=void 0,Hc(Ot.getPairs())),Ur=Sr.next();!Ur.done;Ur=Sr.next()){var Zr=Ur.value;try{for(var ln=(Pe=void 0,Hc(u)),Tn=ln.next();!Tn.done;Tn=ln.next())if(Yf.equals(Zr,Tn.value)){!0;break}}catch(yi){Pe={error:yi}}finally{try{Tn&&!Tn.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}}}catch(yi){le={error:yi}}finally{try{Ur&&!Ur.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(le)throw le.error}}}}catch(yi){U={error:yi}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}},a.isPartialRow=function(u,w){var U,Y,le,ge,Pe,Ge;try{for(var dt=Hc(w),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value,Ht=!0;try{for(var Sr=(le=void 0,Hc(u)),Ur=Sr.next();!Ur.done;Ur=Sr.next()){var Zr=Ur.value,dn=!1;try{for(var ln=(Pe=void 0,Hc(Ot.getPairs())),Tn=ln.next();!Tn.done;Tn=ln.next())if(Zr.equals(Tn.value)){dn=!0;break}}catch(yi){Pe={error:yi}}finally{try{Tn&&!Tn.done&&(Ge=ln.return)&&Ge.call(ln)}finally{if(Pe)throw Pe.error}}if(!dn){Ht=!1;break}}}catch(yi){le={error:yi}}finally{try{Ur&&!Ur.done&&(ge=Sr.return)&&ge.call(Sr)}finally{if(le)throw le.error}}if(Ht)return!0}}catch(yi){U={error:yi}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}return!1},a.prototype.getRows=function(){return this.rows},a.constructResult=function(u){var U=function YE(v){try{if(v.get(1))return new Xo(v);if(!v.get(2))return new Wa(v);switch(un.extractNumericValueFromBitArray(v,1,4)){case 4:return new qn(v);case 5:return new r1(v)}switch(un.extractNumericValueFromBitArray(v,1,5)){case 12:return new Gg(v);case 13:return new wh(v)}switch(un.extractNumericValueFromBitArray(v,1,7)){case 56:return new Pp(v,"310","11");case 57:return new Pp(v,"320","11");case 58:return new Pp(v,"310","13");case 59:return new Pp(v,"320","13");case 60:return new Pp(v,"310","15");case 61:return new Pp(v,"320","15");case 62:return new Pp(v,"310","17");case 63:return new Pp(v,"320","17")}}catch(U){throw console.log(U),new ou("unknown decoder: "+v)}}(Hh.buildBitArray(u)),Y=U.parseInformation(),le=u[0].getFinderPattern().getResultPoints(),ge=u[u.length-1].getFinderPattern().getResultPoints();return new Cs(Y,null,null,[le[0],le[1],ge[0],ge[1]],Do.RSS_EXPANDED,null)},a.prototype.checkChecksum=function(){var u=this.pairs.get(0),w=u.getLeftChar(),U=u.getRightChar();if(null===U)return!1;for(var Y=U.getChecksumPortion(),le=2,ge=1;ge=0?U:this.isEmptyPair(w)?0:w[w.length-1].getFinderPattern().getStartEnd()[1];var Ge=w.length%2!=0;this.startFromEven&&(Ge=!Ge);for(var dt=!1;ge=0&&!u.get(Pe);)Pe--;Pe++,Y=this.startEnd[0]-Pe,le=Pe,ge=this.startEnd[1]}else le=this.startEnd[0],Y=(ge=u.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var dt,Ge=this.getDecodeFinderCounters();Rt.arraycopy(Ge,0,Ge,1,Ge.length-1),Ge[0]=Y;try{dt=this.parseFinderValue(Ge,a.FINDER_PATTERNS)}catch{return null}return new Kg(dt,[le,ge],le,ge,w)},a.prototype.decodeDataCharacter=function(u,w,U,Y){for(var le=this.getDataCharacterCounters(),ge=0;ge.3)throw new Wn;var Sr=this.getOddCounts(),Ur=this.getEvenCounts(),Zr=this.getOddRoundingErrors(),dn=this.getEvenRoundingErrors();for(Pe=0;Pe8){if(ln>8.7)throw new Wn;Tn=8}var Gn=Pe/2;1&Pe?(Ur[Gn]=Tn,dn[Gn]=ln-Tn):(Sr[Gn]=Tn,Zr[Gn]=ln-Tn)}this.adjustOddEvenCounts(17);var yi=4*w.getValue()+(U?0:2)+(Y?0:1)-1,Bi=0,Ki=0;for(Pe=Sr.length-1;Pe>=0;Pe--)a.isNotA1left(w,U,Y)&&(Ki+=Sr[Pe]*a.WEIGHTS[yi][2*Pe]),Bi+=Sr[Pe];var gs=0;for(Pe=Ur.length-1;Pe>=0;Pe--)a.isNotA1left(w,U,Y)&&(gs+=Ur[Pe]*a.WEIGHTS[yi][2*Pe+1]);var ns=Ki+gs;if(1&Bi||Bi>13||Bi<4)throw new Wn;var _l=(13-Bi)/2,ja=a.SYMBOL_WIDEST[_l],Xc=9-ja,bd=af.getRSSvalue(Sr,ja,!0),Th=af.getRSSvalue(Ur,Xc,!1);return new Xf(bd*a.EVEN_TOTAL_SUBSET[_l]+Th+a.GSUM[_l],ns)},a.isNotA1left=function(u,w,U){return!(0===u.getValue()&&w&&U)},a.prototype.adjustOddEvenCounts=function(u){var w=Js.sum(new Int32Array(this.getOddCounts())),U=Js.sum(new Int32Array(this.getEvenCounts())),Y=!1,le=!1;w>13?le=!0:w<4&&(Y=!0);var ge=!1,Pe=!1;U>13?Pe=!0:U<4&&(ge=!0);var Ge=w+U-u,dt=!(1&~w),_t=!(1&U);if(1===Ge)if(dt){if(_t)throw new Wn;le=!0}else{if(!_t)throw new Wn;Pe=!0}else if(-1===Ge)if(dt){if(_t)throw new Wn;Y=!0}else{if(!_t)throw new Wn;ge=!0}else{if(0!==Ge)throw new Wn;if(dt){if(!_t)throw new Wn;w=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const wm=function(v){function a(){var u=null!==v&&v.apply(this,arguments)||this;return u.possibleLeftPairs=[],u.possibleRightPairs=[],u}return $w(a,v),a.prototype.decodeRow=function(u,w,U){var Y,le,ge,Pe,Ge=this.decodePair(w,!1,u,U);a.addOrTally(this.possibleLeftPairs,Ge),w.reverse();var dt=this.decodePair(w,!0,u,U);a.addOrTally(this.possibleRightPairs,dt),w.reverse();try{for(var _t=bm(this.possibleLeftPairs),Ot=_t.next();!Ot.done;Ot=_t.next()){var Ht=Ot.value;if(Ht.getCount()>1)try{for(var Sr=(ge=void 0,bm(this.possibleRightPairs)),Ur=Sr.next();!Ur.done;Ur=Sr.next()){var Zr=Ur.value;if(Zr.getCount()>1&&a.checkChecksum(Ht,Zr))return a.constructResult(Ht,Zr)}}catch(dn){ge={error:dn}}finally{try{Ur&&!Ur.done&&(Pe=Sr.return)&&Pe.call(Sr)}finally{if(ge)throw ge.error}}}}catch(dn){Y={error:dn}}finally{try{Ot&&!Ot.done&&(le=_t.return)&&le.call(_t)}finally{if(Y)throw Y.error}}throw new Wn},a.addOrTally=function(u,w){var U,Y;if(null!=w){var le=!1;try{for(var ge=bm(u),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(Ge.getValue()===w.getValue()){Ge.incrementCount(),le=!0;break}}}catch(dt){U={error:dt}}finally{try{Pe&&!Pe.done&&(Y=ge.return)&&Y.call(ge)}finally{if(U)throw U.error}}le||u.push(w)}},a.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},a.constructResult=function(u,w){for(var U=4537077*u.getValue()+w.getValue(),Y=new String(U).toString(),le=new jr,ge=13-Y.length;ge>0;ge--)le.append("0");le.append(Y);var Pe=0;for(ge=0;ge<13;ge++){var Ge=le.charAt(ge).charCodeAt(0)-48;Pe+=1&ge?Ge:3*Ge}10==(Pe=10-Pe%10)&&(Pe=0),le.append(Pe.toString());var dt=u.getFinderPattern().getResultPoints(),_t=w.getFinderPattern().getResultPoints();return new Cs(le.toString(),null,0,[dt[0],dt[1],_t[0],_t[1]],Do.RSS_14,(new Date).getTime())},a.checkChecksum=function(u,w){var U=(u.getChecksumPortion()+16*w.getChecksumPortion())%79,Y=9*u.getFinderPattern().getValue()+w.getFinderPattern().getValue();return Y>72&&Y--,Y>8&&Y--,U===Y},a.prototype.decodePair=function(u,w,U,Y){try{var le=this.findFinderPattern(u,w),ge=this.parseFoundFinderPattern(u,U,w,le),Pe=null==Y?null:Y.get(Di.NEED_RESULT_POINT_CALLBACK);if(null!=Pe){var Ge=(le[0]+le[1])/2;w&&(Ge=u.getSize()-1-Ge),Pe.foundPossibleResultPoint(new Eo(Ge,U))}var dt=this.decodeDataCharacter(u,ge,!0),_t=this.decodeDataCharacter(u,ge,!1);return new Qf(1597*dt.getValue()+_t.getValue(),dt.getChecksumPortion()+4*_t.getChecksumPortion(),ge)}catch{return null}},a.prototype.decodeDataCharacter=function(u,w,U){for(var Y=this.getDataCharacterCounters(),le=0;le8&&(dn=8);var ln=Math.floor(ge/2);1&ge?(Ht[ln]=dn,Ur[ln]=Zr-dn):(Ot[ln]=dn,Sr[ln]=Zr-dn)}this.adjustOddEvenCounts(U,dt);var Tn=0,Gn=0;for(ge=Ot.length-1;ge>=0;ge--)Gn*=9,Gn+=Ot[ge],Tn+=Ot[ge];var yi=0,Bi=0;for(ge=Ht.length-1;ge>=0;ge--)yi*=9,yi+=Ht[ge],Bi+=Ht[ge];var po,gs,Ki=Gn+3*yi;if(U){if(1&Tn||Tn>12||Tn<4)throw new Wn;var ns=9-(gs=a.OUTSIDE_ODD_WIDEST[po=(12-Tn)/2]),_l=af.getRSSvalue(Ot,gs,!1),ja=af.getRSSvalue(Ht,ns,!0);return new Xf(_l*a.OUTSIDE_EVEN_TOTAL_SUBSET[po]+ja+a.OUTSIDE_GSUM[po],Ki)}if(1&Bi||Bi>10||Bi<4)throw new Wn;return ns=9-(gs=a.INSIDE_ODD_WIDEST[po=(10-Bi)/2]),_l=af.getRSSvalue(Ot,gs,!0),ja=af.getRSSvalue(Ht,ns,!1),new Xf(ja*a.INSIDE_ODD_TOTAL_SUBSET[po]+_l+a.INSIDE_GSUM[po],Ki)},a.prototype.findFinderPattern=function(u,w){var U=this.getDecodeFinderCounters();U[0]=0,U[1]=0,U[2]=0,U[3]=0;for(var Y=u.getSize(),le=!1,ge=0;ge=0&&le!==u.get(ge);)ge--;ge++;var Pe=Y[0]-ge,Ge=this.getDecodeFinderCounters(),dt=new Int32Array(Ge.length);Rt.arraycopy(Ge,0,dt,1,Ge.length-1),dt[0]=Pe;var _t=this.parseFinderValue(dt,a.FINDER_PATTERNS),Ot=ge,Ht=Y[1];return U&&(Ot=u.getSize()-1-Ot,Ht=u.getSize()-1-Ht),new Kg(_t,[ge,Y[1]],Ot,Ht,w)},a.prototype.adjustOddEvenCounts=function(u,w){var U=Js.sum(new Int32Array(this.getOddCounts())),Y=Js.sum(new Int32Array(this.getEvenCounts())),le=!1,ge=!1,Pe=!1,Ge=!1;u?(U>12?ge=!0:U<4&&(le=!0),Y>12?Ge=!0:Y<4&&(Pe=!0)):(U>11?ge=!0:U<5&&(le=!0),Y>10?Ge=!0:Y<4&&(Pe=!0));var dt=U+Y-w,_t=(1&U)==(u?1:0),Ot=!(1&~Y);if(1===dt)if(_t){if(Ot)throw new Wn;ge=!0}else{if(!Ot)throw new Wn;Ge=!0}else if(-1===dt)if(_t){if(Ot)throw new Wn;le=!0}else{if(!Ot)throw new Wn;Pe=!0}else{if(0!==dt)throw new Wn;if(_t){if(!Ot)throw new Wn;U=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}),Ms=function(){function v(a,u,w){this.ecCodewords=a,this.ecBlocks=[u],w&&this.ecBlocks.push(w)}return v.prototype.getECCodewords=function(){return this.ecCodewords},v.prototype.getECBlocks=function(){return this.ecBlocks},v}(),Ja=function(){function v(a,u){this.count=a,this.dataCodewords=u}return v.prototype.getCount=function(){return this.count},v.prototype.getDataCodewords=function(){return this.dataCodewords},v}();const Gl=function(){function v(a,u,w,U,Y,le){var ge,Pe;this.versionNumber=a,this.symbolSizeRows=u,this.symbolSizeColumns=w,this.dataRegionSizeRows=U,this.dataRegionSizeColumns=Y,this.ecBlocks=le;var Ge=0,dt=le.getECCodewords(),_t=le.getECBlocks();try{for(var Ot=Xg(_t),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var Sr=Ht.value;Ge+=Sr.getCount()*(Sr.getDataCodewords()+dt)}}catch(Ur){ge={error:Ur}}finally{try{Ht&&!Ht.done&&(Pe=Ot.return)&&Pe.call(Ot)}finally{if(ge)throw ge.error}}this.totalCodewords=Ge}return v.prototype.getVersionNumber=function(){return this.versionNumber},v.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},v.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},v.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},v.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},v.prototype.getTotalCodewords=function(){return this.totalCodewords},v.prototype.getECBlocks=function(){return this.ecBlocks},v.getVersionForDimensions=function(a,u){var w,U;if(1&a||1&u)throw new Qn;try{for(var Y=Xg(v.VERSIONS),le=Y.next();!le.done;le=Y.next()){var ge=le.value;if(ge.symbolSizeRows===a&&ge.symbolSizeColumns===u)return ge}}catch(Pe){w={error:Pe}}finally{try{le&&!le.done&&(U=Y.return)&&U.call(Y)}finally{if(w)throw w.error}}throw new Qn},v.prototype.toString=function(){return""+this.versionNumber},v.buildVersions=function(){return[new v(1,10,10,8,8,new Ms(5,new Ja(1,3))),new v(2,12,12,10,10,new Ms(7,new Ja(1,5))),new v(3,14,14,12,12,new Ms(10,new Ja(1,8))),new v(4,16,16,14,14,new Ms(12,new Ja(1,12))),new v(5,18,18,16,16,new Ms(14,new Ja(1,18))),new v(6,20,20,18,18,new Ms(18,new Ja(1,22))),new v(7,22,22,20,20,new Ms(20,new Ja(1,30))),new v(8,24,24,22,22,new Ms(24,new Ja(1,36))),new v(9,26,26,24,24,new Ms(28,new Ja(1,44))),new v(10,32,32,14,14,new Ms(36,new Ja(1,62))),new v(11,36,36,16,16,new Ms(42,new Ja(1,86))),new v(12,40,40,18,18,new Ms(48,new Ja(1,114))),new v(13,44,44,20,20,new Ms(56,new Ja(1,144))),new v(14,48,48,22,22,new Ms(68,new Ja(1,174))),new v(15,52,52,24,24,new Ms(42,new Ja(2,102))),new v(16,64,64,14,14,new Ms(56,new Ja(2,140))),new v(17,72,72,16,16,new Ms(36,new Ja(4,92))),new v(18,80,80,18,18,new Ms(48,new Ja(4,114))),new v(19,88,88,20,20,new Ms(56,new Ja(4,144))),new v(20,96,96,22,22,new Ms(68,new Ja(4,174))),new v(21,104,104,24,24,new Ms(56,new Ja(6,136))),new v(22,120,120,18,18,new Ms(68,new Ja(6,175))),new v(23,132,132,20,20,new Ms(62,new Ja(8,163))),new v(24,144,144,22,22,new Ms(62,new Ja(8,156),new Ja(2,155))),new v(25,8,18,6,16,new Ms(7,new Ja(1,5))),new v(26,8,32,6,14,new Ms(11,new Ja(1,10))),new v(27,12,26,10,24,new Ms(14,new Ja(1,16))),new v(28,12,36,10,16,new Ms(18,new Ja(1,22))),new v(29,16,36,14,16,new Ms(24,new Ja(1,32))),new v(30,16,48,14,22,new Ms(28,new Ja(1,49)))]},v.VERSIONS=v.buildVersions(),v}(),Wc=function(){function v(a){var u=a.getHeight();if(u<8||u>144||1&u)throw new Qn;this.version=v.readVersion(a),this.mappingBitMatrix=this.extractDataRegion(a),this.readMappingMatrix=new Qi(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return v.prototype.getVersion=function(){return this.version},v.readVersion=function(a){var u=a.getHeight(),w=a.getWidth();return Gl.getVersionForDimensions(u,w)},v.prototype.readCodewords=function(){var a=new Int8Array(this.version.getTotalCodewords()),u=0,w=4,U=0,Y=this.mappingBitMatrix.getHeight(),le=this.mappingBitMatrix.getWidth(),ge=!1,Pe=!1,Ge=!1,dt=!1;do{if(w!==Y||0!==U||ge)if(w===Y-2&&0===U&&3&le&&!Pe)a[u++]=255&this.readCorner2(Y,le),w-=2,U+=2,Pe=!0;else if(w!==Y+4||2!==U||7&le||Ge)if(w!==Y-2||0!==U||4!=(7&le)||dt){do{w=0&&!this.readMappingMatrix.get(U,w)&&(a[u++]=255&this.readUtah(w,U,Y,le)),w-=2,U+=2}while(w>=0&&U=0&&U=0);w+=3,U+=1}else a[u++]=255&this.readCorner4(Y,le),w-=2,U+=2,dt=!0;else a[u++]=255&this.readCorner3(Y,le),w-=2,U+=2,Ge=!0;else a[u++]=255&this.readCorner1(Y,le),w-=2,U+=2,ge=!0}while(w=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const wc=function(){function v(a,u){this.numDataCodewords=a,this.codewords=u}return v.getDataBlocks=function(a,u){var w,U,Y,le,ge=u.getECBlocks(),Pe=0,Ge=ge.getECBlocks();try{for(var dt=zw(Ge),_t=dt.next();!_t.done;_t=dt.next())Pe+=(Ot=_t.value).getCount()}catch(bd){w={error:bd}}finally{try{_t&&!_t.done&&(U=dt.return)&&U.call(dt)}finally{if(w)throw w.error}}var Ht=new Array(Pe),Sr=0;try{for(var Ur=zw(Ge),Zr=Ur.next();!Zr.done;Zr=Ur.next())for(var Ot=Zr.value,dn=0;dn7?dn-1:dn]=a[Ki++]}if(Ki!==a.length)throw new ki;return Ht},v.prototype.getNumDataCodewords=function(){return this.numDataCodewords},v.prototype.getCodewords=function(){return this.codewords},v}(),Zg=function(){function v(a){this.bytes=a,this.byteOffset=0,this.bitOffset=0}return v.prototype.getBitOffset=function(){return this.bitOffset},v.prototype.getByteOffset=function(){return this.byteOffset},v.prototype.readBits=function(a){if(a<1||a>32||a>this.available())throw new ki(""+a);var u=0,w=this.bitOffset,U=this.byteOffset,Y=this.bytes;if(w>0){var le=8-w,ge=a>8-ge<<(Pe=le-ge))>>Pe,a-=ge,8===(w+=ge)&&(w=0,U++)}if(a>0){for(;a>=8;)u=u<<8|255&Y[U],U++,a-=8;var Pe;a>0&&(u=u<>(Pe=8-a)<>Pe,w+=a)}return this.bitOffset=w,this.byteOffset=U,u},v.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},v}();var Ga=function(v){return v[v.PAD_ENCODE=0]="PAD_ENCODE",v[v.ASCII_ENCODE=1]="ASCII_ENCODE",v[v.C40_ENCODE=2]="C40_ENCODE",v[v.TEXT_ENCODE=3]="TEXT_ENCODE",v[v.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",v[v.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",v[v.BASE256_ENCODE=6]="BASE256_ENCODE",v}(Ga||{});const Eh=function(){function v(){}return v.decode=function(a){var u=new Zg(a),w=new jr,U=new jr,Y=new Array,le=Ga.ASCII_ENCODE;do{if(le===Ga.ASCII_ENCODE)le=this.decodeAsciiSegment(u,w,U);else{switch(le){case Ga.C40_ENCODE:this.decodeC40Segment(u,w);break;case Ga.TEXT_ENCODE:this.decodeTextSegment(u,w);break;case Ga.ANSIX12_ENCODE:this.decodeAnsiX12Segment(u,w);break;case Ga.EDIFACT_ENCODE:this.decodeEdifactSegment(u,w);break;case Ga.BASE256_ENCODE:this.decodeBase256Segment(u,w,Y);break;default:throw new Qn}le=Ga.ASCII_ENCODE}}while(le!==Ga.PAD_ENCODE&&u.available()>0);return U.length()>0&&w.append(U.toString()),new qu(a,w.toString(),0===Y.length?null:Y,null)},v.decodeAsciiSegment=function(a,u,w){var U=!1;do{var Y=a.readBits(8);if(0===Y)throw new Qn;if(Y<=128)return U&&(Y+=128),u.append(String.fromCharCode(Y-1)),Ga.ASCII_ENCODE;if(129===Y)return Ga.PAD_ENCODE;if(Y<=229){var le=Y-130;le<10&&u.append("0"),u.append(""+le)}else switch(Y){case 230:return Ga.C40_ENCODE;case 231:return Ga.BASE256_ENCODE;case 232:u.append("\x1d");break;case 233:case 234:case 241:break;case 235:U=!0;break;case 236:u.append("[)>\x1e05\x1d"),w.insert(0,"\x1e\x04");break;case 237:u.append("[)>\x1e06\x1d"),w.insert(0,"\x1e\x04");break;case 238:return Ga.ANSIX12_ENCODE;case 239:return Ga.TEXT_ENCODE;case 240:return Ga.EDIFACT_ENCODE;default:if(254!==Y||0!==a.available())throw new Qn}}while(a.available()>0);return Ga.ASCII_ENCODE},v.decodeC40Segment=function(a,u){var w=!1,U=[],Y=0;do{if(8===a.available())return;var le=a.readBits(8);if(254===le)return;this.parseTwoBytes(le,a.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(Y){case 0:if(Pe<3)Y=Pe+1;else{if(!(Pe0)},v.decodeTextSegment=function(a,u){var w=!1,U=[],Y=0;do{if(8===a.available())return;var le=a.readBits(8);if(254===le)return;this.parseTwoBytes(le,a.readBits(8),U);for(var ge=0;ge<3;ge++){var Pe=U[ge];switch(Y){case 0:if(Pe<3)Y=Pe+1;else{if(!(Pe0)},v.decodeAnsiX12Segment=function(a,u){var w=[];do{if(8===a.available())return;var U=a.readBits(8);if(254===U)return;this.parseTwoBytes(U,a.readBits(8),w);for(var Y=0;Y<3;Y++){var le=w[Y];switch(le){case 0:u.append("\r");break;case 1:u.append("*");break;case 2:u.append(">");break;case 3:u.append(" ");break;default:if(le<14)u.append(String.fromCharCode(le+44));else{if(!(le<40))throw new Qn;u.append(String.fromCharCode(le+51))}}}}while(a.available()>0)},v.parseTwoBytes=function(a,u,w){var U=(a<<8)+u-1,Y=Math.floor(U/1600);w[0]=Y,U-=1600*Y,Y=Math.floor(U/40),w[1]=Y,w[2]=U-40*Y},v.decodeEdifactSegment=function(a,u){do{if(a.available()<=16)return;for(var w=0;w<4;w++){var U=a.readBits(6);if(31===U){var Y=8-a.getBitOffset();return void(8!==Y&&a.readBits(Y))}32&U||(U|=64),u.append(String.fromCharCode(U))}}while(a.available()>0)},v.decodeBase256Segment=function(a,u,w){var le,U=1+a.getByteOffset(),Y=this.unrandomize255State(a.readBits(8),U++);if((le=0===Y?a.available()/8|0:Y<250?Y:250*(Y-249)+this.unrandomize255State(a.readBits(8),U++))<0)throw new Qn;for(var ge=new Uint8Array(le),Pe=0;Pe=0?U:U+256},v.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],v.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],v.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],v.TEXT_SHIFT2_SET_CHARS=v.C40_SHIFT2_SET_CHARS,v.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~","\x7f"],v}(),Yg=function(){function v(){this.rsDecoder=new xc(Pa.DATA_MATRIX_FIELD_256)}return v.prototype.decode=function(a){var u,w,U=new Wc(a),Y=U.getVersion(),le=U.readCodewords(),ge=wc.getDataBlocks(le,Y),Pe=0;try{for(var Ge=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge),dt=Ge.next();!dt.done;dt=Ge.next())Pe+=dt.value.getNumDataCodewords()}catch(Tn){u={error:Tn}}finally{try{dt&&!dt.done&&(w=Ge.return)&&w.call(Ge)}finally{if(u)throw u.error}}for(var Ot=new Uint8Array(Pe),Ht=ge.length,Sr=0;Srge&&(dt=ge,_t[0]=u,_t[1]=w,_t[2]=U,_t[3]=Y),dt>Pe&&(dt=Pe,_t[0]=w,_t[1]=U,_t[2]=Y,_t[3]=u),dt>Ge&&(_t[0]=U,_t[1]=Y,_t[2]=u,_t[3]=w),_t},v.prototype.detectSolid2=function(a){var u=a[0],w=a[1],U=a[2],Y=a[3],le=this.transitionsBetween(u,Y),ge=v.shiftPoint(w,U,4*(le+1)),Pe=v.shiftPoint(U,w,4*(le+1));return this.transitionsBetween(ge,u)this.transitionsBetween(Pe,_t)+this.transitionsBetween(Ge,_t)?dt:_t:dt:this.isValid(_t)?_t:null},v.prototype.shiftToModuleCenter=function(a){var u=a[0],w=a[1],U=a[2],Y=a[3],le=this.transitionsBetween(u,Y)+1,ge=this.transitionsBetween(U,Y)+1,Pe=v.shiftPoint(u,w,4*ge),Ge=v.shiftPoint(U,w,4*le);!(1&~(le=this.transitionsBetween(Pe,Y)+1))&&(le+=1),!(1&~(ge=this.transitionsBetween(Ge,Y)+1))&&(ge+=1);var Ot,Ht,dt=(u.getX()+w.getX()+U.getX()+Y.getX())/4,_t=(u.getY()+w.getY()+U.getY()+Y.getY())/4;return u=v.moveAway(u,dt,_t),w=v.moveAway(w,dt,_t),U=v.moveAway(U,dt,_t),Y=v.moveAway(Y,dt,_t),Pe=v.shiftPoint(u,w,4*ge),Pe=v.shiftPoint(Pe,Y,4*le),Ot=v.shiftPoint(w,u,4*ge),Ot=v.shiftPoint(Ot,U,4*le),Ge=v.shiftPoint(U,Y,4*ge),Ge=v.shiftPoint(Ge,w,4*le),Ht=v.shiftPoint(Y,U,4*ge),[Pe,Ot,Ge,Ht=v.shiftPoint(Ht,u,4*le)]},v.prototype.isValid=function(a){return a.getX()>=0&&a.getX()0&&a.getY()Math.abs(Y-w);if(ge){var Pe=w;w=U,U=Pe,Pe=Y,Y=le,le=Pe}for(var Ge=Math.abs(Y-w),dt=Math.abs(le-U),_t=-Ge/2,Ot=U0){if(dn===le)break;dn+=Ot,_t-=Ge}}return Sr},v}(),y0=function(){function v(){this.decoder=new Yg}return v.prototype.decode=function(a,u){var w,U;if(void 0===u&&(u=null),null!=u&&u.has(Di.PURE_BARCODE)){var Y=v.extractPureBits(a.getBlackMatrix());w=this.decoder.decode(Y),U=v.NO_POINTS}else{var le=new Kw(a.getBlackMatrix()).detect();w=this.decoder.decode(le.getBits()),U=le.getPoints()}var ge=w.getRawBytes(),Pe=new Cs(w.getText(),ge,8*ge.length,U,Do.DATA_MATRIX,Rt.currentTimeMillis()),Ge=w.getByteSegments();null!=Ge&&Pe.putMetadata(gc.BYTE_SEGMENTS,Ge);var dt=w.getECLevel();return null!=dt&&Pe.putMetadata(gc.ERROR_CORRECTION_LEVEL,dt),Pe},v.prototype.reset=function(){},v.extractPureBits=function(a){var u=a.getTopLeftOnBit(),w=a.getBottomRightOnBit();if(null==u||null==w)throw new Wn;var U=this.moduleSize(u,a),Y=u[1],ge=u[0],Ge=(w[0]-ge+1)/U,dt=(w[1]-Y+1)/U;if(Ge<=0||dt<=0)throw new Wn;var _t=U/2;Y+=_t,ge+=_t;for(var Ot=new Qi(Ge,dt),Ht=0;Ht=v.FOR_BITS.size)throw new ki;return v.FOR_BITS.get(a)},v.FOR_BITS=new Map,v.FOR_VALUE=new Map,v.L=new v(xh.L,"L",1),v.M=new v(xh.M,"M",0),v.Q=new v(xh.Q,"Q",3),v.H=new v(xh.H,"H",2),v}(),Uc=function(){function v(a){this.errorCorrectionLevel=Al.forBits(a>>3&3),this.dataMask=7&a}return v.numBitsDiffering=function(a,u){return pi.bitCount(a^u)},v.decodeFormatInformation=function(a,u){var w=v.doDecodeFormatInformation(a,u);return null!==w?w:v.doDecodeFormatInformation(a^v.FORMAT_INFO_MASK_QR,u^v.FORMAT_INFO_MASK_QR)},v.doDecodeFormatInformation=function(a,u){var w,U,Y=Number.MAX_SAFE_INTEGER,le=0;try{for(var ge=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(v.FORMAT_INFO_DECODE_LOOKUP),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,dt=Ge[0];if(dt===a||dt===u)return new v(Ge[1]);var _t=v.numBitsDiffering(a,dt);_t=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),le=Y.next();!le.done;le=Y.next())w+=le.value.getCount()}catch(Pe){a={error:Pe}}finally{try{le&&!le.done&&(u=Y.return)&&u.call(Y)}finally{if(a)throw a.error}}return w},v.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},v.prototype.getECBlocks=function(){return this.ecBlocks},v}(),Vr=function(){function v(a,u){this.count=a,this.dataCodewords=u}return v.prototype.getCount=function(){return this.count},v.prototype.getDataCodewords=function(){return this.dataCodewords},v}(),Xh=function(){function v(a,u){for(var w,U,Y=[],le=2;le=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;ge+=Ot.getCount()*(Ot.getDataCodewords()+Pe)}}catch(Ht){w={error:Ht}}finally{try{_t&&!_t.done&&(U=dt.return)&&U.call(dt)}finally{if(w)throw w.error}}this.totalCodewords=ge}return v.prototype.getVersionNumber=function(){return this.versionNumber},v.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},v.prototype.getTotalCodewords=function(){return this.totalCodewords},v.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},v.prototype.getECBlocksForLevel=function(a){return this.ecBlocks[a.getValue()]},v.getProvisionalVersionForDimension=function(a){if(a%4!=1)throw new Qn;try{return this.getVersionForNumber((a-17)/4)}catch{throw new Qn}},v.getVersionForNumber=function(a){if(a<1||a>40)throw new ki;return v.VERSIONS[a-1]},v.decodeVersionInformation=function(a){for(var u=Number.MAX_SAFE_INTEGER,w=0,U=0;U6&&(u.setRegion(a-11,0,3,6),u.setRegion(0,a-11,6,3)),u},v.prototype.toString=function(){return""+this.versionNumber},v.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),v.VERSIONS=[new v(1,new Int32Array(0),new Mn(7,new Vr(1,19)),new Mn(10,new Vr(1,16)),new Mn(13,new Vr(1,13)),new Mn(17,new Vr(1,9))),new v(2,Int32Array.from([6,18]),new Mn(10,new Vr(1,34)),new Mn(16,new Vr(1,28)),new Mn(22,new Vr(1,22)),new Mn(28,new Vr(1,16))),new v(3,Int32Array.from([6,22]),new Mn(15,new Vr(1,55)),new Mn(26,new Vr(1,44)),new Mn(18,new Vr(2,17)),new Mn(22,new Vr(2,13))),new v(4,Int32Array.from([6,26]),new Mn(20,new Vr(1,80)),new Mn(18,new Vr(2,32)),new Mn(26,new Vr(2,24)),new Mn(16,new Vr(4,9))),new v(5,Int32Array.from([6,30]),new Mn(26,new Vr(1,108)),new Mn(24,new Vr(2,43)),new Mn(18,new Vr(2,15),new Vr(2,16)),new Mn(22,new Vr(2,11),new Vr(2,12))),new v(6,Int32Array.from([6,34]),new Mn(18,new Vr(2,68)),new Mn(16,new Vr(4,27)),new Mn(24,new Vr(4,19)),new Mn(28,new Vr(4,15))),new v(7,Int32Array.from([6,22,38]),new Mn(20,new Vr(2,78)),new Mn(18,new Vr(4,31)),new Mn(18,new Vr(2,14),new Vr(4,15)),new Mn(26,new Vr(4,13),new Vr(1,14))),new v(8,Int32Array.from([6,24,42]),new Mn(24,new Vr(2,97)),new Mn(22,new Vr(2,38),new Vr(2,39)),new Mn(22,new Vr(4,18),new Vr(2,19)),new Mn(26,new Vr(4,14),new Vr(2,15))),new v(9,Int32Array.from([6,26,46]),new Mn(30,new Vr(2,116)),new Mn(22,new Vr(3,36),new Vr(2,37)),new Mn(20,new Vr(4,16),new Vr(4,17)),new Mn(24,new Vr(4,12),new Vr(4,13))),new v(10,Int32Array.from([6,28,50]),new Mn(18,new Vr(2,68),new Vr(2,69)),new Mn(26,new Vr(4,43),new Vr(1,44)),new Mn(24,new Vr(6,19),new Vr(2,20)),new Mn(28,new Vr(6,15),new Vr(2,16))),new v(11,Int32Array.from([6,30,54]),new Mn(20,new Vr(4,81)),new Mn(30,new Vr(1,50),new Vr(4,51)),new Mn(28,new Vr(4,22),new Vr(4,23)),new Mn(24,new Vr(3,12),new Vr(8,13))),new v(12,Int32Array.from([6,32,58]),new Mn(24,new Vr(2,92),new Vr(2,93)),new Mn(22,new Vr(6,36),new Vr(2,37)),new Mn(26,new Vr(4,20),new Vr(6,21)),new Mn(28,new Vr(7,14),new Vr(4,15))),new v(13,Int32Array.from([6,34,62]),new Mn(26,new Vr(4,107)),new Mn(22,new Vr(8,37),new Vr(1,38)),new Mn(24,new Vr(8,20),new Vr(4,21)),new Mn(22,new Vr(12,11),new Vr(4,12))),new v(14,Int32Array.from([6,26,46,66]),new Mn(30,new Vr(3,115),new Vr(1,116)),new Mn(24,new Vr(4,40),new Vr(5,41)),new Mn(20,new Vr(11,16),new Vr(5,17)),new Mn(24,new Vr(11,12),new Vr(5,13))),new v(15,Int32Array.from([6,26,48,70]),new Mn(22,new Vr(5,87),new Vr(1,88)),new Mn(24,new Vr(5,41),new Vr(5,42)),new Mn(30,new Vr(5,24),new Vr(7,25)),new Mn(24,new Vr(11,12),new Vr(7,13))),new v(16,Int32Array.from([6,26,50,74]),new Mn(24,new Vr(5,98),new Vr(1,99)),new Mn(28,new Vr(7,45),new Vr(3,46)),new Mn(24,new Vr(15,19),new Vr(2,20)),new Mn(30,new Vr(3,15),new Vr(13,16))),new v(17,Int32Array.from([6,30,54,78]),new Mn(28,new Vr(1,107),new Vr(5,108)),new Mn(28,new Vr(10,46),new Vr(1,47)),new Mn(28,new Vr(1,22),new Vr(15,23)),new Mn(28,new Vr(2,14),new Vr(17,15))),new v(18,Int32Array.from([6,30,56,82]),new Mn(30,new Vr(5,120),new Vr(1,121)),new Mn(26,new Vr(9,43),new Vr(4,44)),new Mn(28,new Vr(17,22),new Vr(1,23)),new Mn(28,new Vr(2,14),new Vr(19,15))),new v(19,Int32Array.from([6,30,58,86]),new Mn(28,new Vr(3,113),new Vr(4,114)),new Mn(26,new Vr(3,44),new Vr(11,45)),new Mn(26,new Vr(17,21),new Vr(4,22)),new Mn(26,new Vr(9,13),new Vr(16,14))),new v(20,Int32Array.from([6,34,62,90]),new Mn(28,new Vr(3,107),new Vr(5,108)),new Mn(26,new Vr(3,41),new Vr(13,42)),new Mn(30,new Vr(15,24),new Vr(5,25)),new Mn(28,new Vr(15,15),new Vr(10,16))),new v(21,Int32Array.from([6,28,50,72,94]),new Mn(28,new Vr(4,116),new Vr(4,117)),new Mn(26,new Vr(17,42)),new Mn(28,new Vr(17,22),new Vr(6,23)),new Mn(30,new Vr(19,16),new Vr(6,17))),new v(22,Int32Array.from([6,26,50,74,98]),new Mn(28,new Vr(2,111),new Vr(7,112)),new Mn(28,new Vr(17,46)),new Mn(30,new Vr(7,24),new Vr(16,25)),new Mn(24,new Vr(34,13))),new v(23,Int32Array.from([6,30,54,78,102]),new Mn(30,new Vr(4,121),new Vr(5,122)),new Mn(28,new Vr(4,47),new Vr(14,48)),new Mn(30,new Vr(11,24),new Vr(14,25)),new Mn(30,new Vr(16,15),new Vr(14,16))),new v(24,Int32Array.from([6,28,54,80,106]),new Mn(30,new Vr(6,117),new Vr(4,118)),new Mn(28,new Vr(6,45),new Vr(14,46)),new Mn(30,new Vr(11,24),new Vr(16,25)),new Mn(30,new Vr(30,16),new Vr(2,17))),new v(25,Int32Array.from([6,32,58,84,110]),new Mn(26,new Vr(8,106),new Vr(4,107)),new Mn(28,new Vr(8,47),new Vr(13,48)),new Mn(30,new Vr(7,24),new Vr(22,25)),new Mn(30,new Vr(22,15),new Vr(13,16))),new v(26,Int32Array.from([6,30,58,86,114]),new Mn(28,new Vr(10,114),new Vr(2,115)),new Mn(28,new Vr(19,46),new Vr(4,47)),new Mn(28,new Vr(28,22),new Vr(6,23)),new Mn(30,new Vr(33,16),new Vr(4,17))),new v(27,Int32Array.from([6,34,62,90,118]),new Mn(30,new Vr(8,122),new Vr(4,123)),new Mn(28,new Vr(22,45),new Vr(3,46)),new Mn(30,new Vr(8,23),new Vr(26,24)),new Mn(30,new Vr(12,15),new Vr(28,16))),new v(28,Int32Array.from([6,26,50,74,98,122]),new Mn(30,new Vr(3,117),new Vr(10,118)),new Mn(28,new Vr(3,45),new Vr(23,46)),new Mn(30,new Vr(4,24),new Vr(31,25)),new Mn(30,new Vr(11,15),new Vr(31,16))),new v(29,Int32Array.from([6,30,54,78,102,126]),new Mn(30,new Vr(7,116),new Vr(7,117)),new Mn(28,new Vr(21,45),new Vr(7,46)),new Mn(30,new Vr(1,23),new Vr(37,24)),new Mn(30,new Vr(19,15),new Vr(26,16))),new v(30,Int32Array.from([6,26,52,78,104,130]),new Mn(30,new Vr(5,115),new Vr(10,116)),new Mn(28,new Vr(19,47),new Vr(10,48)),new Mn(30,new Vr(15,24),new Vr(25,25)),new Mn(30,new Vr(23,15),new Vr(25,16))),new v(31,Int32Array.from([6,30,56,82,108,134]),new Mn(30,new Vr(13,115),new Vr(3,116)),new Mn(28,new Vr(2,46),new Vr(29,47)),new Mn(30,new Vr(42,24),new Vr(1,25)),new Mn(30,new Vr(23,15),new Vr(28,16))),new v(32,Int32Array.from([6,34,60,86,112,138]),new Mn(30,new Vr(17,115)),new Mn(28,new Vr(10,46),new Vr(23,47)),new Mn(30,new Vr(10,24),new Vr(35,25)),new Mn(30,new Vr(19,15),new Vr(35,16))),new v(33,Int32Array.from([6,30,58,86,114,142]),new Mn(30,new Vr(17,115),new Vr(1,116)),new Mn(28,new Vr(14,46),new Vr(21,47)),new Mn(30,new Vr(29,24),new Vr(19,25)),new Mn(30,new Vr(11,15),new Vr(46,16))),new v(34,Int32Array.from([6,34,62,90,118,146]),new Mn(30,new Vr(13,115),new Vr(6,116)),new Mn(28,new Vr(14,46),new Vr(23,47)),new Mn(30,new Vr(44,24),new Vr(7,25)),new Mn(30,new Vr(59,16),new Vr(1,17))),new v(35,Int32Array.from([6,30,54,78,102,126,150]),new Mn(30,new Vr(12,121),new Vr(7,122)),new Mn(28,new Vr(12,47),new Vr(26,48)),new Mn(30,new Vr(39,24),new Vr(14,25)),new Mn(30,new Vr(22,15),new Vr(41,16))),new v(36,Int32Array.from([6,24,50,76,102,128,154]),new Mn(30,new Vr(6,121),new Vr(14,122)),new Mn(28,new Vr(6,47),new Vr(34,48)),new Mn(30,new Vr(46,24),new Vr(10,25)),new Mn(30,new Vr(2,15),new Vr(64,16))),new v(37,Int32Array.from([6,28,54,80,106,132,158]),new Mn(30,new Vr(17,122),new Vr(4,123)),new Mn(28,new Vr(29,46),new Vr(14,47)),new Mn(30,new Vr(49,24),new Vr(10,25)),new Mn(30,new Vr(24,15),new Vr(46,16))),new v(38,Int32Array.from([6,32,58,84,110,136,162]),new Mn(30,new Vr(4,122),new Vr(18,123)),new Mn(28,new Vr(13,46),new Vr(32,47)),new Mn(30,new Vr(48,24),new Vr(14,25)),new Mn(30,new Vr(42,15),new Vr(32,16))),new v(39,Int32Array.from([6,26,54,82,110,138,166]),new Mn(30,new Vr(20,117),new Vr(4,118)),new Mn(28,new Vr(40,47),new Vr(7,48)),new Mn(30,new Vr(43,24),new Vr(22,25)),new Mn(30,new Vr(10,15),new Vr(67,16))),new v(40,Int32Array.from([6,30,58,86,114,142,170]),new Mn(30,new Vr(19,118),new Vr(6,119)),new Mn(28,new Vr(18,47),new Vr(31,48)),new Mn(30,new Vr(34,24),new Vr(34,25)),new Mn(30,new Vr(20,15),new Vr(61,16)))],v}();var Oa=function(v){return v[v.DATA_MASK_000=0]="DATA_MASK_000",v[v.DATA_MASK_001=1]="DATA_MASK_001",v[v.DATA_MASK_010=2]="DATA_MASK_010",v[v.DATA_MASK_011=3]="DATA_MASK_011",v[v.DATA_MASK_100=4]="DATA_MASK_100",v[v.DATA_MASK_101=5]="DATA_MASK_101",v[v.DATA_MASK_110=6]="DATA_MASK_110",v[v.DATA_MASK_111=7]="DATA_MASK_111",v}(Oa||{});const au=function(){function v(a,u){this.value=a,this.isMasked=u}return v.prototype.unmaskBitMatrix=function(a,u){for(var w=0;w=0;w--)a=this.copyBit(8,w,a);var U=this.bitMatrix.getHeight(),Y=0,le=U-7;for(w=U-1;w>=le;w--)Y=this.copyBit(8,w,Y);for(u=U-8;u=0;Y--)for(var le=a-9;le>=U;le--)w=this.copyBit(le,Y,w);var ge=Xh.decodeVersionInformation(w);if(null!==ge&&ge.getDimensionForVersion()===a)return this.parsedVersion=ge,ge;for(w=0,le=5;le>=0;le--)for(Y=a-9;Y>=U;Y--)w=this.copyBit(le,Y,w);if(null!==(ge=Xh.decodeVersionInformation(w))&&ge.getDimensionForVersion()===a)return this.parsedVersion=ge,ge;throw new Qn},v.prototype.copyBit=function(a,u,w){return(this.isMirror?this.bitMatrix.get(u,a):this.bitMatrix.get(a,u))?w<<1|1:w<<1},v.prototype.readCodewords=function(){var a=this.readFormatInformation(),u=this.readVersion(),w=au.values.get(a.getDataMask()),U=this.bitMatrix.getHeight();w.unmaskBitMatrix(this.bitMatrix,U);for(var Y=u.buildFunctionPattern(),le=!0,ge=new Uint8Array(u.getTotalCodewords()),Pe=0,Ge=0,dt=0,_t=U-1;_t>0;_t-=2){6===_t&&_t--;for(var Ot=0;Ot=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const Gw=function(){function v(a,u){this.numDataCodewords=a,this.codewords=u}return v.getDataBlocks=function(a,u,w){var U,Y,le,ge;if(a.length!==u.getTotalCodewords())throw new ki;var Pe=u.getECBlocksForLevel(w),Ge=0,dt=Pe.getECBlocks();try{for(var _t=s1(dt),Ot=_t.next();!Ot.done;Ot=_t.next())Ge+=(Ht=Ot.value).getCount()}catch(Xc){U={error:Xc}}finally{try{Ot&&!Ot.done&&(Y=_t.return)&&Y.call(_t)}finally{if(U)throw U.error}}var Sr=new Array(Ge),Ur=0;try{for(var Zr=s1(dt),dn=Zr.next();!dn.done;dn=Zr.next())for(var Ht=dn.value,ln=0;ln=0&&Sr[Bi].codewords.length!==yi;)Bi--;Bi++;var po=yi-Pe.getECCodewordsPerBlock(),gs=0;for(ln=0;lna.available())throw new Qn;for(var U=new Uint8Array(2*w),Y=0;w>0;){var le=a.readBits(13),ge=le/96<<8&4294967295|le%96;U[Y]=(ge+=ge<959?41377:42657)>>8&255,U[Y+1]=255&ge,Y+=2,w--}try{u.append(Wt.decode(U,bt.GB2312))}catch(Pe){throw new Qn(Pe)}},v.decodeKanjiSegment=function(a,u,w){if(13*w>a.available())throw new Qn;for(var U=new Uint8Array(2*w),Y=0;w>0;){var le=a.readBits(13),ge=le/192<<8&4294967295|le%192;U[Y]=(ge+=ge<7936?33088:49472)>>8,U[Y+1]=ge,Y+=2,w--}try{u.append(Wt.decode(U,bt.SHIFT_JIS))}catch(Pe){throw new Qn(Pe)}},v.decodeByteSegment=function(a,u,w,U,Y,le){if(8*w>a.available())throw new Qn;for(var ge=new Uint8Array(w),Pe=0;Pe=v.ALPHANUMERIC_CHARS.length)throw new Qn;return v.ALPHANUMERIC_CHARS[a]},v.decodeAlphanumericSegment=function(a,u,w,U){for(var Y=u.length();w>1;){if(a.available()<11)throw new Qn;var le=a.readBits(11);u.append(v.toAlphaNumericChar(Math.floor(le/45))),u.append(v.toAlphaNumericChar(le%45)),w-=2}if(1===w){if(a.available()<6)throw new Qn;u.append(v.toAlphaNumericChar(a.readBits(6)))}if(U)for(var ge=Y;ge=3;){if(a.available()<10)throw new Qn;var U=a.readBits(10);if(U>=1e3)throw new Qn;u.append(v.toAlphaNumericChar(Math.floor(U/100))),u.append(v.toAlphaNumericChar(Math.floor(U/10)%10)),u.append(v.toAlphaNumericChar(U%10)),w-=3}if(2===w){if(a.available()<7)throw new Qn;var Y=a.readBits(7);if(Y>=100)throw new Qn;u.append(v.toAlphaNumericChar(Math.floor(Y/10))),u.append(v.toAlphaNumericChar(Y%10))}else if(1===w){if(a.available()<4)throw new Qn;var le=a.readBits(4);if(le>=10)throw new Qn;u.append(v.toAlphaNumericChar(le))}},v.parseECIValue=function(a){var u=a.readBits(8);if(!(128&u))return 127&u;if(128==(192&u))return(63&u)<<8&4294967295|a.readBits(8);if(192==(224&u))return(31&u)<<16&4294967295|a.readBits(16);throw new Qn},v.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",v.GB2312_SUBSET=1,v}(),c1=function(){function v(a){this.mirrored=a}return v.prototype.isMirrored=function(){return this.mirrored},v.prototype.applyMirroredCorrection=function(a){if(this.mirrored&&null!==a&&!(a.length<3)){var u=a[0];a[0]=a[2],a[2]=u}},v}();var cx=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ux=function(){function v(){this.rsDecoder=new xc(Pa.QR_CODE_FIELD_256)}return v.prototype.decodeBooleanArray=function(a,u){return this.decodeBitMatrix(Qi.parseFromBooleanArray(a),u)},v.prototype.decodeBitMatrix=function(a,u){var w=new Sh(a),U=null;try{return this.decodeBitMatrixParser(w,u)}catch(le){U=le}try{w.remask(),w.setMirror(!0),w.readVersion(),w.readFormatInformation(),w.mirror();var Y=this.decodeBitMatrixParser(w,u);return Y.setOther(new c1(!0)),Y}catch(le){throw null!==U?U:le}},v.prototype.decodeBitMatrixParser=function(a,u){var w,U,Y,le,ge=a.readVersion(),Pe=a.readFormatInformation().getErrorCorrectionLevel(),Ge=a.readCodewords(),dt=Gw.getDataBlocks(Ge,ge,Pe),_t=0;try{for(var Ot=cx(dt),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t+=(Sr=Ht.value).getNumDataCodewords()}catch(Bi){w={error:Bi}}finally{try{Ht&&!Ht.done&&(U=Ot.return)&&U.call(Ot)}finally{if(w)throw w.error}}var Ur=new Uint8Array(_t),Zr=0;try{for(var dn=cx(dt),ln=dn.next();!ln.done;ln=dn.next()){var Sr,Tn=(Sr=ln.value).getCodewords(),Gn=Sr.getNumDataCodewords();this.correctErrors(Tn,Gn);for(var yi=0;yi=w)return!1;return!0},v.prototype.crossCheckVertical=function(a,u,w,U){var Y=this.image,le=Y.getHeight(),ge=this.crossCheckStateCount;ge[0]=0,ge[1]=0,ge[2]=0;for(var Pe=a;Pe>=0&&Y.get(u,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&!Y.get(u,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=a+1;Pew)return NaN;for(;Pew||5*Math.abs(ge[0]+ge[1]+ge[2]-U)>=2*U?NaN:this.foundPatternCross(ge)?v.centerFromEnd(ge,Pe):NaN},v.prototype.handlePossibleCenter=function(a,u,w){var U,Y,le=a[0]+a[1]+a[2],ge=v.centerFromEnd(a,w),Pe=this.crossCheckVertical(u,ge,2*a[1],le);if(!isNaN(Pe)){var Ge=(a[0]+a[1]+a[2])/3;try{for(var dt=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.possibleCenters),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;if(Ot.aboutEquals(Ge,Pe,ge))return Ot.combineEstimate(Pe,ge,Ge)}}catch(Sr){U={error:Sr}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}var Ht=new $u(ge,Pe,Ge);this.possibleCenters.push(Ht),null!=this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(Ht)}return null},v}();var gd=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const w0=function(v){function a(u,w,U,Y){var le=v.call(this,u,w)||this;return le.estimatedModuleSize=U,le.count=Y,void 0===Y&&(le.count=1),le}return gd(a,v),a.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},a.prototype.getCount=function(){return this.count},a.prototype.aboutEquals=function(u,w,U){if(Math.abs(w-this.getY())<=u&&Math.abs(U-this.getX())<=u){var Y=Math.abs(u-this.estimatedModuleSize);return Y<=1||Y<=this.estimatedModuleSize}return!1},a.prototype.combineEstimate=function(u,w,U){var Y=this.count+1;return new a((this.count*this.getX()+w)/Y,(this.count*this.getY()+u)/Y,(this.count*this.estimatedModuleSize+U)/Y,Y)},a}(Eo),Jl=function(){function v(a){this.bottomLeft=a[0],this.topLeft=a[1],this.topRight=a[2]}return v.prototype.getBottomLeft=function(){return this.bottomLeft},v.prototype.getTopLeft=function(){return this.topLeft},v.prototype.getTopRight=function(){return this.topRight},v}();var ty=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const l1=function(){function v(a,u){this.image=a,this.resultPointCallback=u,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=u}return v.prototype.getImage=function(){return this.image},v.prototype.getPossibleCenters=function(){return this.possibleCenters},v.prototype.find=function(a){var u=null!=a&&void 0!==a.get(Di.TRY_HARDER),w=null!=a&&void 0!==a.get(Di.PURE_BARCODE),U=this.image,Y=U.getHeight(),le=U.getWidth(),ge=Math.floor(3*Y/(4*v.MAX_MODULES));(geGe[2]&&(dt+=Sr-Ge[2]-ge,Ot=le-1)}_t=0,Ge[0]=0,Ge[1]=0,Ge[2]=0,Ge[3]=0,Ge[4]=0}else Ge[0]=Ge[2],Ge[1]=Ge[3],Ge[2]=Ge[4],Ge[3]=1,Ge[4]=0,_t=3;else Ge[++_t]++;v.foundPatternCross(Ge)&&!0===this.handlePossibleCenter(Ge,dt,le,w)&&(ge=Ge[0],this.hasSkipped&&(Pe=this.haveMultiplyConfirmedCenters()))}var Ur=this.selectBestPatterns();return Eo.orderBestPatterns(Ur),new Jl(Ur)},v.centerFromEnd=function(a,u){return u-a[4]-a[3]-a[2]/2},v.foundPatternCross=function(a){for(var u=0,w=0;w<5;w++){var U=a[w];if(0===U)return!1;u+=U}if(u<7)return!1;var Y=u/7,le=Y/2;return Math.abs(Y-a[0])=le&&u>=le&&ge.get(u-le,a-le);)Y[2]++,le++;if(a=le&&u>=le&&!ge.get(u-le,a-le)&&Y[1]<=w;)Y[1]++,le++;if(aw)return!1;for(;a>=le&&u>=le&&ge.get(u-le,a-le)&&Y[0]<=w;)Y[0]++,le++;if(Y[0]>w)return!1;var Pe=ge.getHeight(),Ge=ge.getWidth();for(le=1;a+le=Pe||u+le>=Ge)return!1;for(;a+le=Pe||u+le>=Ge||Y[3]>=w)return!1;for(;a+le=w)&&Math.abs(Y[0]+Y[1]+Y[2]+Y[3]+Y[4]-U)<2*U&&v.foundPatternCross(Y)},v.prototype.crossCheckVertical=function(a,u,w,U){for(var Y=this.image,le=Y.getHeight(),ge=this.getCrossCheckStateCount(),Pe=a;Pe>=0&&Y.get(u,Pe);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!Y.get(u,Pe)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&Y.get(u,Pe)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=a+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=2*U?NaN:v.foundPatternCross(ge)?v.centerFromEnd(ge,Pe):NaN},v.prototype.crossCheckHorizontal=function(a,u,w,U){for(var Y=this.image,le=Y.getWidth(),ge=this.getCrossCheckStateCount(),Pe=a;Pe>=0&&Y.get(Pe,u);)ge[2]++,Pe--;if(Pe<0)return NaN;for(;Pe>=0&&!Y.get(Pe,u)&&ge[1]<=w;)ge[1]++,Pe--;if(Pe<0||ge[1]>w)return NaN;for(;Pe>=0&&Y.get(Pe,u)&&ge[0]<=w;)ge[0]++,Pe--;if(ge[0]>w)return NaN;for(Pe=a+1;Pe=w)return NaN;for(;Pe=w||5*Math.abs(ge[0]+ge[1]+ge[2]+ge[3]+ge[4]-U)>=U?NaN:v.foundPatternCross(ge)?v.centerFromEnd(ge,Pe):NaN},v.prototype.handlePossibleCenter=function(a,u,w,U){var Y=a[0]+a[1]+a[2]+a[3]+a[4],le=v.centerFromEnd(a,w),ge=this.crossCheckVertical(u,Math.floor(le),a[2],Y);if(!isNaN(ge)&&(le=this.crossCheckHorizontal(Math.floor(le),Math.floor(ge),a[2],Y),!isNaN(le)&&(!U||this.crossCheckDiagonal(Math.floor(ge),Math.floor(le),a[2],Y)))){for(var Pe=Y/7,Ge=!1,dt=this.possibleCenters,_t=0,Ot=dt.length;_t=v.CENTER_QUORUM){if(null!=U)return this.hasSkipped=!0,Math.floor((Math.abs(U.getX()-ge.getX())-Math.abs(U.getY()-ge.getY()))/2);U=ge}}}catch(Pe){a={error:Pe}}finally{try{le&&!le.done&&(u=Y.return)&&u.call(Y)}finally{if(a)throw a.error}}return 0},v.prototype.haveMultiplyConfirmedCenters=function(){var a,u,w,U,Y=0,le=0,ge=this.possibleCenters.length;try{for(var Pe=ty(this.possibleCenters),Ge=Pe.next();!Ge.done;Ge=Pe.next())(dt=Ge.value).getCount()>=v.CENTER_QUORUM&&(Y++,le+=dt.getEstimatedModuleSize())}catch(Ur){a={error:Ur}}finally{try{Ge&&!Ge.done&&(u=Pe.return)&&u.call(Pe)}finally{if(a)throw a.error}}if(Y<3)return!1;var _t=le/ge,Ot=0;try{for(var Ht=ty(this.possibleCenters),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var dt=Sr.value;Ot+=Math.abs(dt.getEstimatedModuleSize()-_t)}}catch(Ur){w={error:Ur}}finally{try{Sr&&!Sr.done&&(U=Ht.return)&&U.call(Ht)}finally{if(w)throw w.error}}return Ot<=.05*le},v.prototype.selectBestPatterns=function(){var a,u,w,U,Y=this.possibleCenters.length;if(Y<3)throw new Wn;var ge,le=this.possibleCenters;if(Y>3){var Pe=0,Ge=0;try{for(var dt=ty(this.possibleCenters),_t=dt.next();!_t.done;_t=dt.next()){var Ht=_t.value.getEstimatedModuleSize();Pe+=Ht,Ge+=Ht*Ht}}catch(yi){a={error:yi}}finally{try{_t&&!_t.done&&(u=dt.return)&&u.call(dt)}finally{if(a)throw a.error}}ge=Pe/Y;var Sr=Math.sqrt(Ge/Y-ge*ge);le.sort(function(yi,Bi){var Ki=Math.abs(Bi.getEstimatedModuleSize()-ge),po=Math.abs(yi.getEstimatedModuleSize()-ge);return Kipo?1:0});for(var Ur=Math.max(.2*ge,Sr),Zr=0;Zr3;Zr++)Math.abs(le[Zr].getEstimatedModuleSize()-ge)>Ur&&(le.splice(Zr,1),Zr--)}if(le.length>3){Pe=0;try{for(var ln=ty(le),Tn=ln.next();!Tn.done;Tn=ln.next())Pe+=Tn.value.getEstimatedModuleSize()}catch(Bi){w={error:Bi}}finally{try{Tn&&!Tn.done&&(U=ln.return)&&U.call(ln)}finally{if(w)throw w.error}}ge=Pe/le.length,le.sort(function(Bi,Ki){if(Ki.getCount()===Bi.getCount()){var po=Math.abs(Ki.getEstimatedModuleSize()-ge),gs=Math.abs(Bi.getEstimatedModuleSize()-ge);return pogs?-1:0}return Ki.getCount()-Bi.getCount()}),le.splice(3)}return[le[0],le[1],le[2]]},v.CENTER_QUORUM=2,v.MIN_SKIP=3,v.MAX_MODULES=57,v}(),Sm=function(){function v(a){this.image=a}return v.prototype.getImage=function(){return this.image},v.prototype.getResultPointCallback=function(){return this.resultPointCallback},v.prototype.detect=function(a){this.resultPointCallback=null==a?null:a.get(Di.NEED_RESULT_POINT_CALLBACK);var w=new l1(this.image,this.resultPointCallback).find(a);return this.processFinderPatternInfo(w)},v.prototype.processFinderPatternInfo=function(a){var u=a.getTopLeft(),w=a.getTopRight(),U=a.getBottomLeft(),Y=this.calculateModuleSize(u,w,U);if(Y<1)throw new Wn("No pattern found in proccess finder.");var le=v.computeDimension(u,w,U,Y),ge=Xh.getProvisionalVersionForDimension(le),Pe=ge.getDimensionForVersion()-7,Ge=null;if(ge.getAlignmentPatternCenters().length>0)for(var dt=w.getX()-u.getX()+U.getX(),_t=w.getY()-u.getY()+U.getY(),Ot=1-3/Pe,Ht=Math.floor(u.getX()+Ot*(dt-u.getX())),Sr=Math.floor(u.getY()+Ot*(_t-u.getY())),Ur=4;Ur<=16;Ur<<=1)try{Ge=this.findAlignmentInRegion(Y,Ht,Sr,Ur);break}catch(Tn){if(!(Tn instanceof Wn))throw Tn}var Zr=v.createTransform(u,w,U,Ge,le),dn=v.sampleGrid(this.image,Zr,le);return new cr(dn,null===Ge?[U,u,w]:[U,u,w,Ge])},v.createTransform=function(a,u,w,U,Y){var ge,Pe,Ge,dt,le=Y-3.5;return null!==U?(ge=U.getX(),Pe=U.getY(),dt=Ge=le-3):(ge=u.getX()-a.getX()+w.getX(),Pe=u.getY()-a.getY()+w.getY(),Ge=le,dt=le),Fs.quadrilateralToQuadrilateral(3.5,3.5,le,3.5,Ge,dt,3.5,le,a.getX(),a.getY(),u.getX(),u.getY(),ge,Pe,w.getX(),w.getY())},v.sampleGrid=function(a,u,w){return vo.getInstance().sampleGridWithTransform(a,w,w,u)},v.computeDimension=function(a,u,w,U){var Y=Js.round(Eo.distance(a,u)/U),le=Js.round(Eo.distance(a,w)/U),ge=Math.floor((Y+le)/2)+7;switch(3&ge){case 0:ge++;break;case 2:ge--;break;case 3:throw new Wn("Dimensions could be not found.")}return ge},v.prototype.calculateModuleSize=function(a,u,w){return(this.calculateModuleSizeOneWay(a,u)+this.calculateModuleSizeOneWay(a,w))/2},v.prototype.calculateModuleSizeOneWay=function(a,u){var w=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(a.getX()),Math.floor(a.getY()),Math.floor(u.getX()),Math.floor(u.getY())),U=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(u.getX()),Math.floor(u.getY()),Math.floor(a.getX()),Math.floor(a.getY()));return isNaN(w)?U/7:isNaN(U)?w/7:(w+U)/14},v.prototype.sizeOfBlackWhiteBlackRunBothWays=function(a,u,w,U){var Y=this.sizeOfBlackWhiteBlackRun(a,u,w,U),le=1,ge=a-(w-a);ge<0?(le=a/(a-ge),ge=0):ge>=this.image.getWidth()&&(le=(this.image.getWidth()-1-a)/(ge-a),ge=this.image.getWidth()-1);var Pe=Math.floor(u-(U-u)*le);return le=1,Pe<0?(le=u/(u-Pe),Pe=0):Pe>=this.image.getHeight()&&(le=(this.image.getHeight()-1-u)/(Pe-u),Pe=this.image.getHeight()-1),ge=Math.floor(a+(ge-a)*le),(Y+=this.sizeOfBlackWhiteBlackRun(a,u,ge,Pe))-1},v.prototype.sizeOfBlackWhiteBlackRun=function(a,u,w,U){var Y=Math.abs(U-u)>Math.abs(w-a);if(Y){var le=a;a=u,u=le,le=w,w=U,U=le}for(var ge=Math.abs(w-a),Pe=Math.abs(U-u),Ge=-ge/2,dt=a0){if(Ur===U)break;Ur+=_t,Ge-=ge}}return 2===Ot?Js.distance(w+dt,U,a,u):NaN},v.prototype.findAlignmentInRegion=function(a,u,w,U){var Y=Math.floor(U*a),le=Math.max(0,u-Y),ge=Math.min(this.image.getWidth()-1,u+Y);if(ge-le<3*a)throw new Wn("Alignment top exceeds estimated module size.");var Pe=Math.max(0,w-Y),Ge=Math.min(this.image.getHeight()-1,w+Y);if(Ge-Pe<3*a)throw new Wn("Alignment bottom exceeds estimated module size.");return new Rp(this.image,le,Pe,ge-le,Ge-Pe,a,this.resultPointCallback).find()},v}(),u1=function(){function v(){this.decoder=new ux}return v.prototype.getDecoder=function(){return this.decoder},v.prototype.decode=function(a,u){var w,U;if(null!=u&&void 0!==u.get(Di.PURE_BARCODE)){var Y=v.extractPureBits(a.getBlackMatrix());w=this.decoder.decodeBitMatrix(Y,u),U=v.NO_POINTS}else{var le=new Sm(a.getBlackMatrix()).detect(u);w=this.decoder.decodeBitMatrix(le.getBits(),u),U=le.getPoints()}w.getOther()instanceof c1&&w.getOther().applyMirroredCorrection(U);var ge=new Cs(w.getText(),w.getRawBytes(),void 0,U,Do.QR_CODE,void 0),Pe=w.getByteSegments();null!==Pe&&ge.putMetadata(gc.BYTE_SEGMENTS,Pe);var Ge=w.getECLevel();return null!==Ge&&ge.putMetadata(gc.ERROR_CORRECTION_LEVEL,Ge),w.hasStructuredAppend()&&(ge.putMetadata(gc.STRUCTURED_APPEND_SEQUENCE,w.getStructuredAppendSequenceNumber()),ge.putMetadata(gc.STRUCTURED_APPEND_PARITY,w.getStructuredAppendParity())),ge},v.prototype.reset=function(){},v.extractPureBits=function(a){var u=a.getTopLeftOnBit(),w=a.getBottomRightOnBit();if(null===u||null===w)throw new Wn;var U=this.moduleSize(u,a),Y=u[1],le=w[1],ge=u[0],Pe=w[0];if(ge>=Pe||Y>=le)throw new Wn;if(le-Y!=Pe-ge&&(Pe=ge+(le-Y))>=a.getWidth())throw new Wn;var Ge=Math.round((Pe-ge+1)/U),dt=Math.round((le-Y+1)/U);if(Ge<=0||dt<=0)throw new Wn;if(dt!==Ge)throw new Wn;var _t=Math.floor(U/2);Y+=_t;var Ot=(ge+=_t)+Math.floor((Ge-1)*U)-Pe;if(Ot>0){if(Ot>_t)throw new Wn;ge-=Ot}var Ht=Y+Math.floor((dt-1)*U)-le;if(Ht>0){if(Ht>_t)throw new Wn;Y-=Ht}for(var Sr=new Qi(Ge,dt),Ur=0;Ur=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),ge=le.next();!ge.done;ge=le.next())U[Y++]=ge.value}catch(Ge){u={error:Ge}}finally{try{ge&&!ge.done&&(w=le.return)&&w.call(le)}finally{if(u)throw u.error}}return U},v.getCodeword=function(a){var u=Vi.binarySearch(v.SYMBOL_TABLE,262143&a);return u<0?-1:(v.CODEWORD_TABLE[u]-1)%v.NUMBER_OF_CODEWORDS},v.MAX_CODEWORDS_IN_BARCODE=(v.NUMBER_OF_CODEWORDS=929)-1,v.MIN_ROWS_IN_BARCODE=3,v.MAX_ROWS_IN_BARCODE=90,v.MODULES_IN_CODEWORD=17,v.MODULES_IN_STOP_PATTERN=18,v.BARS_IN_MODULE=8,v.EMPTY_INT_ARRAY=new Int32Array([]),v.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),v.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),v}(),fx=function(){function v(a,u){this.bits=a,this.points=u}return v.prototype.getBits=function(){return this.bits},v.prototype.getPoints=function(){return this.points},v}();var Yw=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ya=function(){function v(){}return v.detectMultiple=function(a,u,w){var U=a.getBlackMatrix(),Y=v.detect(w,U);return Y.length||((U=U.clone()).rotate180(),Y=v.detect(w,U)),new fx(U,Y)},v.detect=function(a,u){for(var w,U,Y=new Array,le=0,ge=0,Pe=!1;le0;){if(null==(_t=v.findGuardPattern(a,Y,--U,w,!1,le,Ge))){U++;break}dt=_t}ge[0]=new Eo(dt[0],U),ge[1]=new Eo(dt[1],U),Pe=!0;break}var Ot=U+1;if(Pe){for(var Ht=0,_t=Int32Array.from([Math.trunc(ge[0].getX()),Math.trunc(ge[1].getX())]);Otv.SKIPPED_ROW_COUNT_MAX)break;Ht++}}ge[2]=new Eo(_t[0],Ot-=Ht+1),ge[3]=new Eo(_t[1],Ot)}return Ot-U0&&Ge++Ot?_t-Ot:Ot-_t;if(Ht>w)return 1/0;Ge+=Ht}return Ge/Y},v.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),v.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),v.MAX_AVG_VARIANCE=.42,v.MAX_INDIVIDUAL_VARIANCE=.8,v.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),v.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),v.MAX_PIXEL_DRIFT=3,v.MAX_PATTERN_DRIFT=5,v.SKIPPED_ROW_COUNT_MAX=25,v.ROW_STEP=5,v.BARCODE_MIN_HEIGHT=10,v}(),kp=function(){function v(a,u){if(0===u.length)throw new ki;this.field=a;var w=u.length;if(w>1&&0===u[0]){for(var U=1;U=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.coefficients),le=Y.next();!le.done;le=Y.next())U=this.field.add(U,le.value)}catch(_t){u={error:_t}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return U}for(var Pe=this.coefficients[0],Ge=this.coefficients.length,dt=1;dtw.length){var U=u;u=w,w=U}var Y=new Int32Array(w.length),le=w.length-u.length;Rt.arraycopy(w,0,Y,0,le);for(var ge=le;ge=0;u--){var w=this.getCoefficient(u);0!==w&&(w<0?(a.append(" - "),w=-w):a.length()>0&&a.append(" + "),(0===u||1!==w)&&a.append(w),0!==u&&(1===u?a.append("x"):(a.append("x^"),a.append(u))))}return a.toString()},v}(),ed=function(){function v(){}return v.prototype.add=function(a,u){return(a+u)%this.modulus},v.prototype.subtract=function(a,u){return(this.modulus+a-u)%this.modulus},v.prototype.exp=function(a){return this.expTable[a]},v.prototype.log=function(a){if(0===a)throw new ki;return this.logTable[a]},v.prototype.inverse=function(a){if(0===a)throw new Od;return this.expTable[this.modulus-this.logTable[a]-1]},v.prototype.multiply=function(a,u){return 0===a||0===u?0:this.expTable[(this.logTable[a]+this.logTable[u])%(this.modulus-1)]},v.prototype.getSize=function(){return this.modulus},v.prototype.equals=function(a){return a===this},v}();var e_=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const Sa=function(v){function a(u,w){var U=v.call(this)||this;U.modulus=u,U.expTable=new Int32Array(u),U.logTable=new Int32Array(u);for(var Y=1,le=0;le0;Ge--){var dt=le.evaluateAt(this.field.exp(Ge));ge[u-Ge]=dt,0!==dt&&(Pe=!0)}if(!Pe)return 0;var _t=this.field.getOne();if(null!=w)try{for(var Ot=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(w),Ht=Ot.next();!Ht.done;Ht=Ot.next()){var Ur=this.field.exp(a.length-1-Ht.value),Zr=new kp(this.field,new Int32Array([this.field.subtract(0,Ur),1]));_t=_t.multiply(Zr)}}catch(po){U={error:po}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}var dn=new kp(this.field,ge),ln=this.runEuclideanAlgorithm(this.field.buildMonomial(u,1),dn,u),Tn=ln[0],Gn=ln[1],yi=this.findErrorLocations(Tn),Bi=this.findErrorMagnitudes(Gn,Tn,yi);for(Ge=0;Ge=Math.round(w/2);){var Ge=Y,dt=ge;if(ge=Pe,(Y=le).isZero())throw rs.getChecksumInstance();le=Ge;for(var _t=this.field.getZero(),Ot=Y.getCoefficient(Y.getDegree()),Ht=this.field.inverse(Ot);le.getDegree()>=Y.getDegree()&&!le.isZero();){var Sr=le.getDegree()-Y.getDegree(),Ur=this.field.multiply(le.getCoefficient(le.getDegree()),Ht);_t=_t.add(this.field.buildMonomial(Sr,Ur)),le=le.subtract(Y.multiplyByMonomial(Sr,Ur))}Pe=_t.multiply(ge).subtract(dt).negative()}var Zr=Pe.getCoefficient(0);if(0===Zr)throw rs.getChecksumInstance();var dn=this.field.inverse(Zr);return[Pe.multiply(dn),le.multiply(dn)]},v.prototype.findErrorLocations=function(a){for(var u=a.getDegree(),w=new Int32Array(u),U=0,Y=1;Y0){var Pe=w?this.topLeft:this.topRight,Ge=Math.trunc(Pe.getY()-a);Ge<0&&(Ge=0);var dt=new Eo(Pe.getX(),Ge);w?U=dt:le=dt}if(u>0){var _t=w?this.bottomLeft:this.bottomRight,Ot=Math.trunc(_t.getY()+u);Ot>=this.image.getHeight()&&(Ot=this.image.getHeight()-1);var Ht=new Eo(_t.getX(),Ot);w?Y=Ht:ge=Ht}return new v(this.image,U,Y,le,ge)},v.prototype.getMinX=function(){return this.minX},v.prototype.getMaxX=function(){return this.maxX},v.prototype.getMinY=function(){return this.minY},v.prototype.getMaxY=function(){return this.maxY},v.prototype.getTopLeft=function(){return this.topLeft},v.prototype.getTopRight=function(){return this.topRight},v.prototype.getBottomLeft=function(){return this.bottomLeft},v.prototype.getBottomRight=function(){return this.bottomRight},v}(),hx=function(){function v(a,u,w,U){this.columnCount=a,this.errorCorrectionLevel=U,this.rowCountUpperPart=u,this.rowCountLowerPart=w,this.rowCount=u+w}return v.prototype.getColumnCount=function(){return this.columnCount},v.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},v.prototype.getRowCount=function(){return this.rowCount},v.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},v.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},v}(),m1=function(){function v(){this.buffer=""}return v.form=function(a,u){var w=-1;return a.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function U(le,ge,Pe,Ge,dt,_t){if("%%"===le)return"%";if(void 0!==u[++w]){le=Ge?parseInt(Ge.substr(1)):void 0;var Ht,Ot=dt?parseInt(dt.substr(1)):void 0;switch(_t){case"s":Ht=u[w];break;case"c":Ht=u[w][0];break;case"f":Ht=parseFloat(u[w]).toFixed(le);break;case"p":Ht=parseFloat(u[w]).toPrecision(le);break;case"e":Ht=parseFloat(u[w]).toExponential(le);break;case"x":Ht=parseInt(u[w]).toString(Ot||16);break;case"d":Ht=parseFloat(parseInt(u[w],Ot||10).toPrecision(le)).toFixed(0)}Ht="object"==typeof Ht?JSON.stringify(Ht):(+Ht).toString(Ot);for(var Sr=parseInt(Pe),Ur=Pe&&Pe[0]+""=="0"?"0":" ";Ht.length=0&&null!=(u=this.codewords[U])||(U=this.imageRowToCodewordIndex(a)+w)=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.codewords),le=Y.next();!le.done;le=Y.next()){var ge=le.value;null!=ge?w.format("%3d: %3d|%3d%n",U++,ge.getRowNumber(),ge.getValue()):w.format("%3d: | %n",U++)}}catch(Pe){a={error:Pe}}finally{try{le&&!le.done&&(u=Y.return)&&u.call(Y)}finally{if(a)throw a.error}}return w.toString()},v.MAX_NEARBY_DISTANCE=5,v}();var id=function(v,a){var u="function"==typeof Symbol&&v[Symbol.iterator];if(!u)return v;var U,le,w=u.call(v),Y=[];try{for(;(void 0===a||a-- >0)&&!(U=w.next()).done;)Y.push(U.value)}catch(ge){le={error:ge}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(le)throw le.error}}return Y};const Vu=function(){function v(){this.values=new Map}return v.prototype.setValue=function(a){a=Math.trunc(a);var u=this.values.get(a);null==u&&(u=0),u++,this.values.set(a,u)},v.prototype.getValue=function(){var a,u,w=-1,U=new Array,Y=function(_t,Ot){var Ht_getKey=function(){return _t},Ht_getValue=function(){return Ot};Ht_getValue()>w?(w=Ht_getValue(),(U=[]).push(Ht_getKey())):Ht_getValue()===w&&U.push(Ht_getKey())};try{for(var le=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.values.entries()),ge=le.next();!ge.done;ge=le.next()){var Pe=id(ge.value,2);Y(Pe[0],Pe[1])}}catch(_t){a={error:_t}}finally{try{ge&&!ge.done&&(u=le.return)&&u.call(le)}finally{if(a)throw a.error}}return xa.toIntArray(U)},v.prototype.getConfidence=function(a){return this.values.get(a)},v}();var i_=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),o_=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const _0=function(v){function a(u,w){var U=v.call(this,u)||this;return U._isLeft=w,U}return i_(a,v),a.prototype.setRowNumbers=function(){var u,w;try{for(var U=o_(this.getCodewords()),Y=U.next();!Y.done;Y=U.next()){var le=Y.value;le?.setRowNumberAsRowIndicatorColumn()}}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}},a.prototype.adjustCompleteIndicatorColumnRowNumbers=function(u){var w=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(w,u);for(var U=this.getBoundingBox(),Y=this._isLeft?U.getTopLeft():U.getTopRight(),le=this._isLeft?U.getBottomLeft():U.getBottomRight(),ge=this.imageRowToCodewordIndex(Math.trunc(Y.getY())),Pe=this.imageRowToCodewordIndex(Math.trunc(le.getY())),Ge=-1,dt=1,_t=0,Ot=ge;Ot=u.getRowCount()||Sr>Ot)w[Ot]=null;else{for(var Ur,Zr=(Ur=dt>2?(dt-2)*Sr:Sr)>=Ot,dn=1;dn<=Ur&&!Zr;dn++)Zr=null!=w[Ot-dn];Zr?w[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}}},a.prototype.getRowHeights=function(){var u,w,U=this.getBarcodeMetadata();if(null==U)return null;this.adjustIncompleteIndicatorColumnRowNumbers(U);var Y=new Int32Array(U.getRowCount());try{for(var le=o_(this.getCodewords()),ge=le.next();!ge.done;ge=le.next()){var Pe=ge.value;if(null!=Pe){var Ge=Pe.getRowNumber();if(Ge>=Y.length)continue;Y[Ge]++}}}catch(dt){u={error:dt}}finally{try{ge&&!ge.done&&(w=le.return)&&w.call(le)}finally{if(u)throw u.error}}return Y},a.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(u){for(var w=this.getBoundingBox(),U=this._isLeft?w.getTopLeft():w.getTopRight(),Y=this._isLeft?w.getBottomLeft():w.getBottomRight(),le=this.imageRowToCodewordIndex(Math.trunc(U.getY())),ge=this.imageRowToCodewordIndex(Math.trunc(Y.getY())),Pe=this.getCodewords(),Ge=-1,dt=1,_t=0,Ot=le;Ot=u.getRowCount()?Pe[Ot]=null:(Ge=Ht.getRowNumber(),_t=1)}},a.prototype.getBarcodeMetadata=function(){var u,w,U=this.getCodewords(),Y=new Vu,le=new Vu,ge=new Vu,Pe=new Vu;try{for(var Ge=o_(U),dt=Ge.next();!dt.done;dt=Ge.next()){var _t=dt.value;if(null!=_t){_t.setRowNumberAsRowIndicatorColumn();var Ot=_t.getValue()%30,Ht=_t.getRowNumber();switch(this._isLeft||(Ht+=2),Ht%3){case 0:le.setValue(3*Ot+1);break;case 1:Pe.setValue(Ot/3),ge.setValue(Ot%3);break;case 2:Y.setValue(Ot+1)}}}}catch(Ur){u={error:Ur}}finally{try{dt&&!dt.done&&(w=Ge.return)&&w.call(Ge)}finally{if(u)throw u.error}}if(0===Y.getValue().length||0===le.getValue().length||0===ge.getValue().length||0===Pe.getValue().length||Y.getValue()[0]<1||le.getValue()[0]+ge.getValue()[0]xa.MAX_ROWS_IN_BARCODE)return null;var Sr=new hx(Y.getValue()[0],le.getValue()[0],ge.getValue()[0],Pe.getValue()[0]);return this.removeIncorrectCodewords(U,Sr),Sr},a.prototype.removeIncorrectCodewords=function(u,w){for(var U=0;Uw.getRowCount()){u[U]=null;continue}switch(this._isLeft||(ge+=2),ge%3){case 0:3*le+1!==w.getRowCountUpperPart()&&(u[U]=null);break;case 1:(Math.trunc(le/3)!==w.getErrorCorrectionLevel()||le%3!==w.getRowCountLowerPart())&&(u[U]=null);break;case 2:le+1!==w.getColumnCount()&&(u[U]=null)}}}},a.prototype.isLeft=function(){return this._isLeft},a.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+v.prototype.toString.call(this)},a}(px),Yo=function(){function v(a,u){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=a,this.barcodeColumnCount=a.getColumnCount(),this.boundingBox=u,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return v.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var u,a=xa.MAX_CODEWORDS_IN_BARCODE;do{u=a,a=this.adjustRowNumbersAndGetCount()}while(a>0&&a0&&Y0&&(Ge[0]=w[u-1],Ge[4]=ge[u-1],Ge[5]=Pe[u-1]),u>1&&(Ge[8]=w[u-2],Ge[10]=ge[u-2],Ge[11]=Pe[u-2]),u=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(Ge),_t=dt.next();!_t.done;_t=dt.next())if(v.adjustRowNumber(le,_t.value))return}catch(Ht){U={error:Ht}}finally{try{_t&&!_t.done&&(Y=dt.return)&&Y.call(dt)}finally{if(U)throw U.error}}}},v.adjustRowNumber=function(a,u){return!(null==u||!u.hasValidRowNumber()||u.getBucket()!==a.getBucket()||(a.setRowNumber(u.getRowNumber()),0))},v.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},v.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},v.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},v.prototype.setBoundingBox=function(a){this.boundingBox=a},v.prototype.getBoundingBox=function(){return this.boundingBox},v.prototype.setDetectionResultColumn=function(a,u){this.detectionResultColumns[a]=u},v.prototype.getDetectionResultColumn=function(a){return this.detectionResultColumns[a]},v.prototype.toString=function(){var a=this.detectionResultColumns[0];null==a&&(a=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var u=new m1,w=0;w>=1;w=1&u,v.RATIOS_TABLE[a]||(v.RATIOS_TABLE[a]=new Array(xa.BARS_IN_MODULE)),v.RATIOS_TABLE[a][xa.BARS_IN_MODULE-U-1]=Math.fround(Y/xa.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},v.getDecodedValue=function(a){var u=v.getDecodedCodewordValue(v.sampleBitCounts(a));return-1!==u?u:v.getClosestDecodedValue(a)},v.sampleBitCounts=function(a){for(var u=Js.sum(a),w=new Int32Array(xa.BARS_IN_MODULE),U=0,Y=0,le=0;le1)for(var U=0;U=Y)break}Pea.length||w<0||u+w>a.length||u+w<0)throw new qr;if(0!==w)for(var U=0;U0&&this.grow(u)},a.prototype.grow=function(u){var U=this.buf.length<<1;if(U-u<0&&(U=u),U<0){if(u<0)throw new wx;U=pi.MAX_VALUE}this.buf=Vi.copyOfUint8Array(this.buf,U)},a.prototype.write=function(u){this.ensureCapacity(this.count+1),this.buf[this.count]=u,this.count+=1},a.prototype.writeBytesOffset=function(u,w,U){if(w<0||w>u.length||U<0||w+U-u.length>0)throw new qr;this.ensureCapacity(this.count+U),Rt.arraycopy(u,w,this.buf,this.count,U),this.count+=U},a.prototype.writeTo=function(u){u.writeBytesOffset(this.buf,0,this.count)},a.prototype.reset=function(){this.count=0},a.prototype.toByteArray=function(){return Vi.copyOfUint8Array(this.buf,this.count)},a.prototype.size=function(){return this.count},a.prototype.toString=function(u){return u?"string"==typeof u?this.toString_string(u):this.toString_number(u):this.toString_void()},a.prototype.toString_void=function(){return new String(this.buf).toString()},a.prototype.toString_string=function(u){return new String(this.buf).toString()},a.prototype.toString_number=function(u){return new String(this.buf).toString()},a.prototype.close=function(){},a}(iC);var qs,Oc=function(v){return v[v.ALPHA=0]="ALPHA",v[v.LOWER=1]="LOWER",v[v.MIXED=2]="MIXED",v[v.PUNCT=3]="PUNCT",v[v.ALPHA_SHIFT=4]="ALPHA_SHIFT",v[v.PUNCT_SHIFT=5]="PUNCT_SHIFT",v}(Oc||{});function qh(){if(typeof window<"u")return window.BigInt||null;if(typeof globalThis<"u")return globalThis.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function eh(v){if(typeof qs>"u"&&(qs=qh()),null===qs)throw new Error("BigInt is not supported!");return qs(v)}const Cl=function(){function v(){}return v.decode=function(a,u){var w=new jr(""),U=Jo.ISO8859_1;w.enableDecoding(U);for(var Y=1,le=a[Y++],ge=new s_;Ya[0])throw Qn.getFormatInstance();for(var U=new Int32Array(v.NUMBER_OF_SEQUENCE_CODEWORDS),Y=0;Y0){for(var Ot=0;Ot<6;++Ot)le.write(Number(eh(Pe)>>eh(8*(5-Ot))));Pe=0,ge=0}}U===u[0]&&_t0){for(Ot=0;Ot<6;++Ot)le.write(Number(eh(Pe)>>eh(8*(5-Ot))));Pe=0,ge=0}}}return Y.append(Wt.decode(le.toByteArray(),w)),U},v.numericCompaction=function(a,u,w){for(var U=0,Y=!1,le=new Int32Array(v.MAX_NUMERIC_CODEWORDS);u0&&(w.append(v.decodeBase900toBase10(le,U)),U=0)}return u},v.decodeBase900toBase10=function(a,u){for(var w=eh(0),U=0;U@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",v.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",v.EXP900=qh()?function E0(){var v=[];v[0]=eh(1);var a=eh(900);v[1]=a;for(var u=2;u<16;u++)v[u]=v[u-1]*a;return v}():[],v.NUMBER_OF_SEQUENCE_CODEWORDS=2,v}();var _f=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ep=function(){function v(){}return v.decode=function(a,u,w,U,Y,le,ge){for(var _t,Pe=new n_(a,u,w,U,Y),Ge=null,dt=null,Ot=!0;;Ot=!1){if(null!=u&&(Ge=v.getRowIndicatorColumn(a,Pe,u,!0,le,ge)),null!=U&&(dt=v.getRowIndicatorColumn(a,Pe,U,!1,le,ge)),null==(_t=v.merge(Ge,dt)))throw Wn.getNotFoundInstance();var Ht=_t.getBoundingBox();if(!Ot||null==Ht||!(Ht.getMinY()Pe.getMaxY()))break;Pe=Ht}_t.setBoundingBox(Pe);var Sr=_t.getBarcodeColumnCount()+1;_t.setDetectionResultColumn(0,Ge),_t.setDetectionResultColumn(Sr,dt);for(var Ur=null!=Ge,Zr=1;Zr<=Sr;Zr++){var dn=Ur?Zr:Sr-Zr;if(void 0===_t.getDetectionResultColumn(dn)){var ln=void 0;ln=0===dn||dn===Sr?new _0(Pe,0===dn):new px(Pe),_t.setDetectionResultColumn(dn,ln);for(var Tn=-1,Gn=Tn,yi=Pe.getMinY();yi<=Pe.getMaxY();yi++){if((Tn=v.getStartColumn(_t,dn,yi,Ur))<0||Tn>Pe.getMaxX()){if(-1===Gn)continue;Tn=Gn}var Bi=v.detectCodeword(a,Pe.getMinX(),Pe.getMaxX(),Ur,Tn,yi,le,ge);null!=Bi&&(ln.setCodeword(yi,Bi),Gn=Tn,le=Math.min(le,Bi.getWidth()),ge=Math.max(ge,Bi.getWidth()))}}}return v.createDecoderResult(_t)},v.merge=function(a,u){if(null==a&&null==u)return null;var w=v.getBarcodeMetadata(a,u);if(null==w)return null;var U=n_.merge(v.adjustBoundingBox(a),v.adjustBoundingBox(u));return new Yo(w,U)},v.adjustBoundingBox=function(a){var u,w;if(null==a)return null;var U=a.getRowHeights();if(null==U)return null;var Y=v.getMax(U),le=0;try{for(var ge=_f(U),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value;if(le+=Y-Ge,Ge>0)break}}catch(Ht){u={error:Ht}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(u)throw u.error}}for(var dt=a.getCodewords(),_t=0;le>0&&null==dt[_t];_t++)le--;var Ot=0;for(_t=U.length-1;_t>=0&&(Ot+=Y-U[_t],!(U[_t]>0));_t--);for(_t=dt.length-1;Ot>0&&null==dt[_t];_t--)Ot--;return a.getBoundingBox().addMissingRows(le,Ot,a.isLeft())},v.getMax=function(a){var u,w,U=-1;try{for(var Y=_f(a),le=Y.next();!le.done;le=Y.next())U=Math.max(U,le.value)}catch(Pe){u={error:Pe}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return U},v.getBarcodeMetadata=function(a,u){var w,U;return null==a||null==(w=a.getBarcodeMetadata())?null==u?null:u.getBarcodeMetadata():null==u||null==(U=u.getBarcodeMetadata())?w:w.getColumnCount()!==U.getColumnCount()&&w.getErrorCorrectionLevel()!==U.getErrorCorrectionLevel()&&w.getRowCount()!==U.getRowCount()?null:w},v.getRowIndicatorColumn=function(a,u,w,U,Y,le){for(var ge=new _0(u,U),Pe=0;Pe<2;Pe++)for(var Ge=0===Pe?1:-1,dt=Math.trunc(Math.trunc(w.getX())),_t=Math.trunc(Math.trunc(w.getY()));_t<=u.getMaxY()&&_t>=u.getMinY();_t+=Ge){var Ot=v.detectCodeword(a,0,a.getWidth(),U,dt,_t,Y,le);null!=Ot&&(ge.setCodeword(_t,Ot),dt=U?Ot.getStartX():Ot.getEndX())}return ge},v.adjustCodewordCount=function(a,u){var w=u[0][1],U=w.getValue(),Y=a.getBarcodeColumnCount()*a.getBarcodeRowCount()-v.getNumberOfECCodeWords(a.getBarcodeECLevel());if(0===U.length){if(Y<1||Y>xa.MAX_CODEWORDS_IN_BARCODE)throw Wn.getNotFoundInstance();w.setValue(Y)}else U[0]!==Y&&w.setValue(Y)},v.createDecoderResult=function(a){var u=v.createBarcodeMatrix(a);v.adjustCodewordCount(a,u);for(var w=new Array,U=new Int32Array(a.getBarcodeRowCount()*a.getBarcodeColumnCount()),Y=[],le=new Array,ge=0;ge0;){for(var Pe=0;Pe=0){if(Zr>=le.length)continue;le[Zr][Ge].setValue(Ur.getValue())}}}}catch(dn){U={error:dn}}finally{try{Sr&&!Sr.done&&(Y=Ht.return)&&Y.call(Ht)}finally{if(U)throw U.error}}Ge++}}catch(dn){u={error:dn}}finally{try{_t&&!_t.done&&(w=dt.return)&&w.call(dt)}finally{if(u)throw u.error}}return le},v.isValidBarcodeColumn=function(a,u){return u>=0&&u<=a.getBarcodeColumnCount()+1},v.getStartColumn=function(a,u,w,U){var Y,le,ge=U?1:-1,Pe=null;if(v.isValidBarcodeColumn(a,u-ge)&&(Pe=a.getDetectionResultColumn(u-ge).getCodeword(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();if(null!=(Pe=a.getDetectionResultColumn(u).getCodewordNearby(w)))return U?Pe.getStartX():Pe.getEndX();if(v.isValidBarcodeColumn(a,u-ge)&&(Pe=a.getDetectionResultColumn(u-ge).getCodewordNearby(w)),null!=Pe)return U?Pe.getEndX():Pe.getStartX();for(var Ge=0;v.isValidBarcodeColumn(a,u-ge);){u-=ge;try{for(var dt=(Y=void 0,_f(a.getDetectionResultColumn(u).getCodewords())),_t=dt.next();!_t.done;_t=dt.next()){var Ot=_t.value;if(null!=Ot)return(U?Ot.getEndX():Ot.getStartX())+ge*Ge*(Ot.getEndX()-Ot.getStartX())}}catch(Ht){Y={error:Ht}}finally{try{_t&&!_t.done&&(le=dt.return)&&le.call(dt)}finally{if(Y)throw Y.error}}Ge++}return U?a.getBoundingBox().getMinX():a.getBoundingBox().getMaxX()},v.detectCodeword=function(a,u,w,U,Y,le,ge,Pe){Y=v.adjustCodewordStartColumn(a,u,w,U,Y,le);var Ge=v.getModuleBitCount(a,u,w,U,Y,le);if(null==Ge)return null;var dt,_t=Js.sum(Ge);if(U)dt=Y+_t;else{for(var Ot=0;Ot=u)&&Ge=u:gev.CODEWORD_SKEW_SIZE)return Y;ge+=Pe}Pe=-Pe,U=!U}return ge},v.checkCodewordSkew=function(a,u,w){return u-v.CODEWORD_SKEW_SIZE<=a&&a<=w+v.CODEWORD_SKEW_SIZE},v.decodeCodewords=function(a,u,w){if(0===a.length)throw Qn.getFormatInstance();var U=1<w/2+v.MAX_ERRORS||w<0||w>v.MAX_EC_CODEWORDS)throw rs.getChecksumInstance();return v.errorCorrection.decode(a,w,u)},v.verifyCodewordCount=function(a,u){if(a.length<4)throw Qn.getFormatInstance();var w=a[0];if(w>a.length)throw Qn.getFormatInstance();if(0===w){if(!(u>=1;return u},v.getCodewordBucketNumber=function(a){return a instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(a):this.getCodewordBucketNumber_number(a)},v.getCodewordBucketNumber_number=function(a){return v.getCodewordBucketNumber(v.getBitCountForCodeword(a))},v.getCodewordBucketNumber_Int32Array=function(a){return(a[0]-a[2]+a[4]-a[6]+9)%9},v.toString=function(a){for(var u=new m1,w=0;w=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(ge.getPoints()),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var dt=Ge.value,_t=ep.decode(ge.getBits(),dt[4],dt[5],dt[6],dt[7],v.getMinCodewordWidth(dt),v.getMaxCodewordWidth(dt)),Ot=new Cs(_t.getText(),_t.getRawBytes(),void 0,dt,Do.PDF_417);Ot.putMetadata(gc.ERROR_CORRECTION_LEVEL,_t.getECLevel());var Ht=_t.getOther();null!=Ht&&Ot.putMetadata(gc.PDF417_EXTRA_METADATA,Ht),le.push(Ot)}}catch(Sr){U={error:Sr}}finally{try{Ge&&!Ge.done&&(Y=Pe.return)&&Y.call(Pe)}finally{if(U)throw U.error}}return le.map(function(Sr){return Sr})},v.getMaxWidth=function(a,u){return null==a||null==u?0:Math.trunc(Math.abs(a.getX()-u.getX()))},v.getMinWidth=function(a,u){return null==a||null==u?pi.MAX_VALUE:Math.trunc(Math.abs(a.getX()-u.getX()))},v.getMaxCodewordWidth=function(a){return Math.floor(Math.max(Math.max(v.getMaxWidth(a[0],a[4]),v.getMaxWidth(a[6],a[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.max(v.getMaxWidth(a[1],a[5]),v.getMaxWidth(a[7],a[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},v.getMinCodewordWidth=function(a){return Math.floor(Math.min(Math.min(v.getMinWidth(a[0],a[4]),v.getMinWidth(a[6],a[2])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN),Math.min(v.getMinWidth(a[1],a[5]),v.getMinWidth(a[7],a[3])*xa.MODULES_IN_CODEWORD/xa.MODULES_IN_STOP_PATTERN)))},v.prototype.reset=function(){},v}();var _1=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const tp=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return _1(a,v),a.kind="ReaderException",a}(Us);var Ud=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const ny=function(){function v(){}return v.prototype.decode=function(a,u){return this.setHints(u),this.decodeInternal(a)},v.prototype.decodeWithState=function(a){return null==this.readers&&this.setHints(null),this.decodeInternal(a)},v.prototype.setHints=function(a){this.hints=a;var u=null!=a&&void 0!==a.get(Di.TRY_HARDER),w=null==a?null:a.get(Di.POSSIBLE_FORMATS),U=new Array;if(null!=w){var Y=w.some(function(le){return le===Do.UPC_A||le===Do.UPC_E||le===Do.EAN_13||le===Do.EAN_8||le===Do.CODABAR||le===Do.CODE_39||le===Do.CODE_93||le===Do.CODE_128||le===Do.ITF||le===Do.RSS_14||le===Do.RSS_EXPANDED});Y&&!u&&U.push(new Ac(a)),w.includes(Do.QR_CODE)&&U.push(new u1),w.includes(Do.DATA_MATRIX)&&U.push(new y0),w.includes(Do.AZTEC)&&U.push(new We),w.includes(Do.PDF_417)&&U.push(new S0),Y&&u&&U.push(new Ac(a))}0===U.length&&(u||U.push(new Ac(a)),U.push(new u1),U.push(new y0),U.push(new We),U.push(new S0),u&&U.push(new Ac(a))),this.readers=U},v.prototype.reset=function(){var a,u;if(null!==this.readers)try{for(var w=Ud(this.readers),U=w.next();!U.done;U=w.next())U.value.reset()}catch(le){a={error:le}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(a)throw a.error}}},v.prototype.decodeInternal=function(a){var u,w;if(null===this.readers)throw new tp("No readers where selected, nothing can be read.");try{for(var U=Ud(this.readers),Y=U.next();!Y.done;Y=U.next()){var le=Y.value;try{return le.decode(a,this.hints)}catch(ge){if(ge instanceof tp)continue}}}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}throw new Wn("No MultiFormat Readers were able to detect the code.")},v}();var xx=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),iy=(function(v){function a(u,w){void 0===u&&(u=null),void 0===w&&(w=500);var Y=new ny;return Y.setHints(u),v.call(this,Y,w)||this}xx(a,v),a.prototype.decodeBitmap=function(u){return this.reader.decodeWithState(u)}}(Qu),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Cm=(function(v){iy(function a(u){return void 0===u&&(u=500),v.call(this,new S0,u)||this},v)}(Qu),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Ax=(function(v){Cm(function a(u){return void 0===u&&(u=500),v.call(this,new u1,u)||this},v)}(Qu),function(v){return v[v.ERROR_CORRECTION=0]="ERROR_CORRECTION",v[v.CHARACTER_SET=1]="CHARACTER_SET",v[v.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",v[v.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",v[v.MIN_SIZE=4]="MIN_SIZE",v[v.MAX_SIZE=5]="MAX_SIZE",v[v.MARGIN=6]="MARGIN",v[v.PDF417_COMPACT=7]="PDF417_COMPACT",v[v.PDF417_COMPACTION=8]="PDF417_COMPACTION",v[v.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",v[v.AZTEC_LAYERS=10]="AZTEC_LAYERS",v[v.QR_VERSION=11]="QR_VERSION",v[v.GS1_FORMAT=12]="GS1_FORMAT",v[v.FORCE_C40=13]="FORCE_C40",v}(Ax||{}));const as=Ax,x1=function(){function v(a){this.field=a,this.cachedGenerators=[],this.cachedGenerators.push(new mu(a,Int32Array.from([1])))}return v.prototype.buildGenerator=function(a){var u=this.cachedGenerators;if(a>=u.length)for(var w=u[u.length-1],U=this.field,Y=u.length;Y<=a;Y++){var le=w.multiply(new mu(U,Int32Array.from([1,U.exp(Y-1+U.getGeneratorBase())])));u.push(le),w=le}return u[a]},v.prototype.encode=function(a,u){if(0===u)throw new ki("No error correction bytes");var w=a.length-u;if(w<=0)throw new ki("No data bytes provided");var U=this.buildGenerator(u),Y=new Int32Array(w);Rt.arraycopy(a,0,Y,0,w);for(var le=new mu(this.field,Y),Pe=(le=le.multiplyByMonomial(u,1)).divide(U)[1].getCoefficients(),Ge=u-Pe.length,dt=0;dt=5&&(w+=v.N1+(Pe-5)),Pe=1,Ge=_t)}Pe>=5&&(w+=v.N1+(Pe-5))}return w},v.N1=3,v.N2=3,v.N3=40,v.N4=10,v}(),Bp=function(){function v(a,u){this.width=a,this.height=u;for(var w=new Array(u),U=0;U!==u;U++)w[U]=new Uint8Array(a);this.bytes=w}return v.prototype.getHeight=function(){return this.height},v.prototype.getWidth=function(){return this.width},v.prototype.get=function(a,u){return this.bytes[u][a]},v.prototype.getArray=function(){return this.bytes},v.prototype.setNumber=function(a,u,w){this.bytes[u][a]=w},v.prototype.setBoolean=function(a,u,w){this.bytes[u][a]=w?1:0},v.prototype.clear=function(a){var u,w;try{for(var U=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.bytes),Y=U.next();!Y.done;Y=U.next())Vi.fill(Y.value,a)}catch(ge){u={error:ge}}finally{try{Y&&!Y.done&&(w=U.return)&&w.call(U)}finally{if(u)throw u.error}}},v.prototype.equals=function(a){if(!(a instanceof v))return!1;var u=a;if(this.width!==u.width||this.height!==u.height)return!1;for(var w=0,U=this.height;w>\n"),a.toString()},v.prototype.setMode=function(a){this.mode=a},v.prototype.setECLevel=function(a){this.ecLevel=a},v.prototype.setVersion=function(a){this.version=a},v.prototype.setMaskPattern=function(a){this.maskPattern=a},v.prototype.setMatrix=function(a){this.matrix=a},v.isValidMaskPattern=function(a){return a>=0&&a0;){for(6===le&&(le-=1);ge>=0&&ge=w;)a^=u<=0)for(var Pe=0;Pe!==le;Pe++){var Ge=U[Pe];Ge>=0&&v.isEmpty(u.get(Ge,ge))&&v.embedPositionAdjustmentPattern(Ge-2,ge-2,u)}}},v.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),v.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),v.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),v.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),v.VERSION_INFO_POLY=7973,v.TYPE_INFO_POLY=1335,v.TYPE_INFO_MASK_PATTERN=21522,v}(),f_=function(){function v(a,u){this.dataBytes=a,this.errorCorrectionBytes=u}return v.prototype.getDataBytes=function(){return this.dataBytes},v.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},v}();var D0=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const C0=function(){function v(){}return v.calculateMaskPenalty=function(a){return rp.applyMaskPenaltyRule1(a)+rp.applyMaskPenaltyRule2(a)+rp.applyMaskPenaltyRule3(a)+rp.applyMaskPenaltyRule4(a)},v.encode=function(a,u,w){void 0===w&&(w=null);var U=v.DEFAULT_BYTE_MODE_ENCODING,Y=null!==w&&void 0!==w.get(as.CHARACTER_SET);Y&&(U=w.get(as.CHARACTER_SET).toString());var le=this.chooseMode(a,U),ge=new bi;if(le===Pc.BYTE&&(Y||v.DEFAULT_BYTE_MODE_ENCODING!==U)){var Pe=Jo.getCharacterSetECIByName(U);void 0!==Pe&&this.appendECI(Pe,ge)}this.appendModeInfo(le,ge);var dt,Ge=new bi;if(this.appendBytes(a,le,Ge,U),null!==w&&void 0!==w.get(as.QR_VERSION)){var _t=Number.parseInt(w.get(as.QR_VERSION).toString(),10);dt=Xh.getVersionForNumber(_t);var Ot=this.calculateBitsNeeded(le,ge,Ge,dt);if(!this.willFit(Ot,dt,u))throw new Gc("Data too big for requested version")}else dt=this.recommendVersion(u,le,ge,Ge);var Ht=new bi;Ht.appendBitArray(ge);var Sr=le===Pc.BYTE?Ge.getSizeInBytes():a.length;this.appendLengthInfo(Sr,dt,le,Ht),Ht.appendBitArray(Ge);var Ur=dt.getECBlocksForLevel(u),Zr=dt.getTotalCodewords()-Ur.getTotalECCodewords();this.terminateBits(Zr,Ht);var dn=this.interleaveWithECBytes(Ht,dt.getTotalCodewords(),Zr,Ur.getNumBlocks()),ln=new oy;ln.setECLevel(u),ln.setMode(le),ln.setVersion(dt);var Tn=dt.getDimensionForVersion(),Gn=new Bp(Tn,Tn),yi=this.chooseMaskPattern(dn,u,dt,Gn);return ln.setMaskPattern(yi),np.buildMatrix(dn,u,dt,yi,Gn),ln.setMatrix(Gn),ln},v.recommendVersion=function(a,u,w,U){var Y=this.calculateBitsNeeded(u,w,U,Xh.getVersionForNumber(1)),le=this.chooseVersion(Y,a),ge=this.calculateBitsNeeded(u,w,U,le);return this.chooseVersion(ge,a)},v.calculateBitsNeeded=function(a,u,w,U){return u.getSize()+a.getCharacterCountBits(U)+w.getSize()},v.getAlphanumericCode=function(a){return a159)&&(Y<224||Y>235))return!1}return!0},v.chooseMaskPattern=function(a,u,w,U){for(var Y=Number.MAX_SAFE_INTEGER,le=-1,ge=0;ge=(a+7)/8},v.terminateBits=function(a,u){var w=8*a;if(u.getSize()>w)throw new Gc("data bits cannot fit in the QR Code"+u.getSize()+" > "+w);for(var U=0;U<4&&u.getSize()0)for(U=Y;U<8;U++)u.appendBit(!1);var le=a-u.getSizeInBytes();for(U=0;U=w)throw new Gc("Block ID too large");var ge=a%w,Pe=w-ge,Ge=Math.floor(a/w),dt=Ge+1,_t=Math.floor(u/w),Ot=_t+1,Ht=Ge-_t,Sr=dt-Ot;if(Ht!==Sr)throw new Gc("EC bytes mismatch");if(w!==Pe+ge)throw new Gc("RS blocks mismatch");if(a!==(_t+Ht)*Pe+(Ot+Sr)*ge)throw new Gc("Total bytes mismatch");U=1<=0&&u<=9},v.appendNumericBytes=function(a,u){for(var w=a.length,U=0;U=33088&&Pe<=40956?Ge=Pe-33088:Pe>=57408&&Pe<=60351&&(Ge=Pe-49472),-1===Ge)throw new Gc("Invalid byte sequence");u.appendBits(192*(Ge>>8)+(255&Ge),13)}},v.appendECI=function(a,u){u.appendBits(Pc.ECI.getBits(),4),u.appendBits(a.getValue(),8)},v.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),v.DEFAULT_BYTE_MODE_ENCODING=Jo.UTF8.getName(),v}();!function(){function v(){}v.prototype.write=function(a,u,w,U){if(void 0===U&&(U=null),0===a.length)throw new ki("Found empty contents");if(u<0||w<0)throw new ki("Requested dimensions are too small: "+u+"x"+w);var Y=Al.L,le=v.QUIET_ZONE_SIZE;null!==U&&(void 0!==U.get(as.ERROR_CORRECTION)&&(Y=Al.fromString(U.get(as.ERROR_CORRECTION).toString())),void 0!==U.get(as.MARGIN)&&(le=Number.parseInt(U.get(as.MARGIN).toString(),10)));var ge=C0.encode(a,Y,U);return this.renderResult(ge,u,w,le)},v.prototype.writeToDom=function(a,u,w,U,Y){void 0===Y&&(Y=null),"string"==typeof a&&(a=document.querySelector(a));var le=this.write(u,w,U,Y);a&&a.appendChild(le)},v.prototype.renderResult=function(a,u,w,U){var Y=a.getMatrix();if(null===Y)throw new ou;for(var le=Y.getWidth(),ge=Y.getHeight(),Pe=le+2*U,Ge=ge+2*U,dt=Math.max(u,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(dt/Pe),Math.floor(_t/Ge)),Ht=Math.floor((dt-le*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),Ur=this.createSVGElement(dt,_t),Zr=0,dn=Sr;Zrw||le+Pe>U)throw new ki("Crop rectangle does not fit within image data.");return Ge&&dt.reverseHorizontal(ge,Pe),dt}Ox(a,v),a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth();return(null==w||w.length>16&255)+(Ht>>7&510)+(255&Ht))/4&255}Ge.luminances=_t}else Ge.luminances=u;if(void 0===Y&&(Ge.dataWidth=w),void 0===le&&(Ge.dataHeight=U),void 0===ge&&(Ge.left=0),void 0===Pe&&(Ge.top=0),Ge.left+w>Ge.dataWidth||Ge.top+U>Ge.dataHeight)throw new ki("Crop rectangle does not fit within image data.");return Ge}p_(a,v),a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth();return(null==w||w.length=0&&this.noBit(w,u)&&this.utah(u,w,a++),u-=2,w+=2}while(u>=0&&w=0&&w=0);u+=3,w++}while(u=256&&(u^=301);return{LOG:v,ALOG:a}}([],[])).LOG,g_=A1.ALOG,lf="[)>\x1e05\x1d",eo="[)>\x1e06\x1d";const sp=function(){function v(){}return v.encodeECC200=function(a,u){if(a.length!==u.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var w=new jr;w.append(a);var U=u.getInterleavedBlockCount();if(1===U){var Y=this.createECCBlock(a,u.getErrorCodewords());w.append(Y)}else{for(var le=[],ge=[],Pe=0;Pe0;Pe--)le[Pe]=0!==ge&&0!==Y[Pe]?le[Pe-1]^g_[(dy[ge]+dy[Y[Pe]])%255]:le[Pe-1];le[0]=0!==ge&&0!==Y[0]?g_[(dy[ge]+dy[Y[0]])%255]:0}var Ge=[];for(U=0;U=2)a.writeCodeword(this.encodeASCIIDigits(a.getMessage().charCodeAt(a.pos),a.getMessage().charCodeAt(a.pos+1))),a.pos+=2;else{var w=a.getCurrentChar(),U=Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode());if(U!==this.getEncodingMode())switch(U){case 5:return a.writeCodeword(231),void a.signalEncoderChange(5);case 1:return a.writeCodeword(230),void a.signalEncoderChange(1);case 3:a.writeCodeword(238),a.signalEncoderChange(3);break;case 2:a.writeCodeword(239),a.signalEncoderChange(2);break;case 4:a.writeCodeword(240),a.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+U)}else Aa.isExtendedASCII(w)?(a.writeCodeword(235),a.writeCodeword(w-128+1),a.pos++):(a.writeCodeword(w+1),a.pos++)}},v.prototype.encodeASCIIDigits=function(a,u){if(Aa.isDigit(a)&&Aa.isDigit(u))return 10*(a-48)+(u-48)+130;throw new Error("not digits: "+a+u)},v}(),T1=function(){function v(){}return v.prototype.getEncodingMode=function(){return 5},v.prototype.encode=function(a){var u=new jr;for(u.append(0);a.hasMoreCharacters();){var w=a.getCurrentChar();if(u.append(w),a.pos++,Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode())!==this.getEncodingMode()){a.signalEncoderChange(0);break}}var Y=u.length()-1,ge=a.getCodewordCount()+Y+1;a.updateSymbolInfo(ge);var Pe=a.getSymbolInfo().getDataCapacity()-ge>0;if(a.hasMoreCharacters()||Pe)if(Y<=249)u.setCharAt(0,bt.getCharAt(Y));else{if(!(Y<=1555))throw new Error("Message length not in valid ranges: "+Y);u.setCharAt(0,bt.getCharAt(Math.floor(Y/250)+249)),u.insert(1,bt.getCharAt(Y%250))}var Ge=0;for(w=u.length();Ge3||1!==Ge))&&(a.pos=U)}u.length()>0&&a.writeCodeword(230),this.handleEOD(a,u)},v.prototype.encode=function(a){for(var u=new jr;a.hasMoreCharacters();){var w=a.getCurrentChar();a.pos++;var U=this.encodeChar(w,u),Y=2*Math.floor(u.length()/3),le=a.getCodewordCount()+Y;a.updateSymbolInfo(le);var ge=a.getSymbolInfo().getDataCapacity()-le;if(!a.hasMoreCharacters()){var Pe=new jr;for(u.length()%3==2&&2!==ge&&(U=this.backtrackOneCharacter(a,u,Pe,U));u.length()%3==1&&(U>3||1!==ge);)U=this.backtrackOneCharacter(a,u,Pe,U);break}if(u.length()%3==0&&Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode())!==this.getEncodingMode()){a.signalEncoderChange(0);break}}this.handleEOD(a,u)},v.prototype.backtrackOneCharacter=function(a,u,w,U){var Y=u.length(),le=u.toString().substring(0,Y-U);u.setLengthToZero(),u.append(le),a.pos--;var ge=a.getCurrentChar();return U=this.encodeChar(ge,w),a.resetSymbolInfo(),U},v.prototype.writeNextTriplet=function(a,u){a.writeCodewords(this.encodeToCodewords(u.toString()));var w=u.toString().substring(3);u.setLengthToZero(),u.append(w)},v.prototype.handleEOD=function(a,u){var w=Math.floor(u.length()/3*2),U=u.length()%3,Y=a.getCodewordCount()+w;a.updateSymbolInfo(Y);var le=a.getSymbolInfo().getDataCapacity()-Y;if(2===U){for(u.append("\0");u.length()>=3;)this.writeNextTriplet(a,u);a.hasMoreCharacters()&&a.writeCodeword(254)}else if(1===le&&1===U){for(;u.length()>=3;)this.writeNextTriplet(a,u);a.hasMoreCharacters()&&a.writeCodeword(254),a.pos--}else{if(0!==U)throw new Error("Unexpected case. Please report!");for(;u.length()>=3;)this.writeNextTriplet(a,u);(le>0||a.hasMoreCharacters())&&a.writeCodeword(254)}a.signalEncoderChange(0)},v.prototype.encodeChar=function(a,u){return 32===a?(u.append(3),1):a>=48&&a<=57?(u.append(a-48+4),1):a>=65&&a<=90?(u.append(a-65+14),1):a<32?(u.append(0),u.append(a),2):a<=47?(u.append(1),u.append(a-33),2):a<=64?(u.append(1),u.append(a-58+15),2):a<=95?(u.append(1),u.append(a-91+22),2):a<=127?(u.append(2),u.append(a-96),2):(u.append("1\x1e"),2+this.encodeChar(a-128,u))},v.prototype.encodeToCodewords=function(a){var u=1600*a.charCodeAt(0)+40*a.charCodeAt(1)+a.charCodeAt(2)+1,w=u/256,U=u%256,Y=new jr;return Y.append(w),Y.append(U),Y.toString()},v}(),v_=function(){function v(){}return v.prototype.getEncodingMode=function(){return 4},v.prototype.encode=function(a){for(var u=new jr;a.hasMoreCharacters();){var w=a.getCurrentChar();if(this.encodeChar(w,u),a.pos++,u.length()>=4){a.writeCodewords(this.encodeToCodewords(u.toString()));var Y=u.toString().substring(4);if(u.setLengthToZero(),u.append(Y),Aa.lookAheadTest(a.getMessage(),a.pos,this.getEncodingMode())!==this.getEncodingMode()){a.signalEncoderChange(0);break}}}u.append(bt.getCharAt(31)),this.handleEOD(a,u)},v.prototype.handleEOD=function(a,u){try{var w=u.length();if(0===w)return;if(1===w){a.updateSymbolInfo();var U=a.getSymbolInfo().getDataCapacity()-a.getCodewordCount(),Y=a.getRemainingCharacters();if(Y>U&&(a.updateSymbolInfo(a.getCodewordCount()+1),U=a.getSymbolInfo().getDataCapacity()-a.getCodewordCount()),Y<=U&&U<=2)return}if(w>4)throw new Error("Count must not exceed 4");var le=w-1,ge=this.encodeToCodewords(u.toString()),Ge=!a.hasMoreCharacters()&&le<=2;le<=2&&(a.updateSymbolInfo(a.getCodewordCount()+le),(U=a.getSymbolInfo().getDataCapacity()-a.getCodewordCount())>=3&&(Ge=!1,a.updateSymbolInfo(a.getCodewordCount()+ge.length))),Ge?(a.resetSymbolInfo(),a.pos-=le):a.writeCodewords(ge)}finally{a.signalEncoderChange(0)}},v.prototype.encodeChar=function(a,u){a>=32&&a<=63?u.append(a):a>=64&&a<=94?u.append(bt.getCharAt(a-64)):Aa.illegalCharacter(bt.getCharAt(a))},v.prototype.encodeToCodewords=function(a){var u=a.length;if(0===u)throw new Error("StringBuilder must not be empty");var ge=(a.charAt(0).charCodeAt(0)<<18)+((u>=2?a.charAt(1).charCodeAt(0):0)<<12)+((u>=3?a.charAt(2).charCodeAt(0):0)<<6)+(u>=4?a.charAt(3).charCodeAt(0):0),Pe=ge>>16&255,Ge=ge>>8&255,dt=255&ge,_t=new jr;return _t.append(Pe),u>=2&&_t.append(Ge),u>=3&&_t.append(dt),_t.toString()},v}(),Fx=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),nc=function(){function v(a,u,w,U,Y,le,ge,Pe){void 0===ge&&(ge=0),void 0===Pe&&(Pe=0),this.rectangular=a,this.dataCapacity=u,this.errorCodewords=w,this.matrixWidth=U,this.matrixHeight=Y,this.dataRegions=le,this.rsBlockData=ge,this.rsBlockError=Pe}return v.lookup=function(a,u,w,U,Y){var le,ge;void 0===u&&(u=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===Y&&(Y=!0);try{for(var Pe=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(P1),Ge=Pe.next();!Ge.done;Ge=Pe.next()){var dt=Ge.value;if((1!==u||!dt.rectangular)&&(2!==u||dt.rectangular)&&(null==w||!(dt.getSymbolWidth()U.getWidth()||dt.getSymbolHeight()>U.getHeight()))&&a<=dt.dataCapacity)return dt}}catch(_t){le={error:_t}}finally{try{Ge&&!Ge.done&&(ge=Pe.return)&&ge.call(Pe)}finally{if(le)throw le.error}}if(Y)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+a);return null},v.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},v.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},v.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},v.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},v.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},v.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},v.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},v.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},v.prototype.getDataCapacity=function(){return this.dataCapacity},v.prototype.getErrorCodewords=function(){return this.errorCodewords},v.prototype.getDataLengthForInterleavedBlock=function(a){return this.rsBlockData},v.prototype.getErrorLengthForInterleavedBlock=function(a){return this.rsBlockError},v}();const my=nc;var T0=function(v){function a(){return v.call(this,!1,1558,620,22,22,36,-1,62)||this}return Fx(a,v),a.prototype.getInterleavedBlockCount=function(){return 10},a.prototype.getDataLengthForInterleavedBlock=function(u){return u<=8?156:155},a}(nc),P1=[new nc(!1,3,5,8,8,1),new nc(!1,5,7,10,10,1),new nc(!0,5,7,16,6,1),new nc(!1,8,10,12,12,1),new nc(!0,10,11,14,6,2),new nc(!1,12,12,14,14,1),new nc(!0,16,14,24,10,1),new nc(!1,18,14,16,16,1),new nc(!1,22,18,18,18,1),new nc(!0,22,18,16,10,2),new nc(!1,30,20,20,20,1),new nc(!0,32,24,16,14,2),new nc(!1,36,24,22,22,1),new nc(!1,44,28,24,24,1),new nc(!0,49,28,22,14,2),new nc(!1,62,36,14,14,4),new nc(!1,86,42,16,16,4),new nc(!1,114,48,18,18,4),new nc(!1,144,56,20,20,4),new nc(!1,174,68,22,22,4),new nc(!1,204,84,24,24,4,102,42),new nc(!1,280,112,14,14,16,140,56),new nc(!1,368,144,16,16,16,92,36),new nc(!1,456,192,18,18,16,114,48),new nc(!1,576,224,20,20,16,144,56),new nc(!1,696,272,22,22,16,174,68),new nc(!1,816,336,24,24,16,136,56),new nc(!1,1050,408,18,18,36,175,68),new nc(!1,1304,496,20,20,36,163,62),new T0],dC=function(){function v(a){this.msg=a,this.pos=0,this.skipAtEnd=0;for(var u=a.split("").map(function(ge){return ge.charCodeAt(0)}),w=new jr,U=0,Y=u.length;Uthis.symbolInfo.getDataCapacity())&&(this.symbolInfo=my.lookup(a,this.shape,this.minSize,this.maxSize,!0))},v.prototype.resetSymbolInfo=function(){this.symbolInfo=null},v}(),P0=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),O0=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return P0(a,v),a.prototype.getEncodingMode=function(){return 3},a.prototype.encode=function(u){for(var w=new jr;u.hasMoreCharacters();){var U=u.getCurrentChar();if(u.pos++,this.encodeChar(U,w),w.length()%3==0&&(this.writeNextTriplet(u,w),Aa.lookAheadTest(u.getMessage(),u.pos,this.getEncodingMode())!==this.getEncodingMode())){u.signalEncoderChange(0);break}}this.handleEOD(u,w)},a.prototype.encodeChar=function(u,w){switch(u){case 13:w.append(0);break;case 42:w.append(1);break;case 62:w.append(2);break;case 32:w.append(3);break;default:u>=48&&u<=57?w.append(u-48+4):u>=65&&u<=90?w.append(u-65+14):Aa.illegalCharacter(bt.getCharAt(u))}return 1},a.prototype.handleEOD=function(u,w){u.updateSymbolInfo();var U=u.getSymbolInfo().getDataCapacity()-u.getCodewordCount(),Y=w.length();u.pos-=Y,(u.getRemainingCharacters()>1||U>1||u.getRemainingCharacters()!==U)&&u.writeCodeword(254),u.getNewEncoding()<0&&u.signalEncoderChange(0)},a}(py),gy=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),O1=function(v){function a(){return null!==v&&v.apply(this,arguments)||this}return gy(a,v),a.prototype.getEncodingMode=function(){return 2},a.prototype.encodeChar=function(u,w){return 32===u?(w.append(3),1):u>=48&&u<=57?(w.append(u-48+4),1):u>=97&&u<=122?(w.append(u-97+14),1):u<32?(w.append(0),w.append(u),2):u<=47?(w.append(1),w.append(u-33),2):u<=64?(w.append(1),w.append(u-58+15),2):u>=91&&u<=95?(w.append(1),w.append(u-91+22),2):96===u?(w.append(2),w.append(0),2):u<=90?(w.append(2),w.append(u-65+1),2):u<=127?(w.append(2),w.append(u-123+27),2):(w.append("1\x1e"),2+this.encodeChar(u-128,w))},a}(py);const Aa=function(){function v(){}return v.randomize253State=function(a){var w=149*a%253+1+129;return w<=254?w:w-254},v.encodeHighLevel=function(a,u,w,U,Y){void 0===u&&(u=0),void 0===w&&(w=null),void 0===U&&(U=null),void 0===Y&&(Y=!1);var le=new py,ge=[new hy,le,new O1,new O0,new v_,new T1],Pe=new dC(a);Pe.setSymbolShape(u),Pe.setSizeConstraints(w,U),a.startsWith(lf)&&a.endsWith("\x1e\x04")?(Pe.writeCodeword(236),Pe.setSkipAtEnd(2),Pe.pos+=7):a.startsWith(eo)&&a.endsWith("\x1e\x04")&&(Pe.writeCodeword(237),Pe.setSkipAtEnd(2),Pe.pos+=7);var Ge=0;for(Y&&(le.encodeMaximal(Pe),Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());Pe.hasMoreCharacters();)ge[Ge].encode(Pe),Pe.getNewEncoding()>=0&&(Ge=Pe.getNewEncoding(),Pe.resetEncoderSignal());var dt=Pe.getCodewordCount();Pe.updateSymbolInfo();var _t=Pe.getSymbolInfo().getDataCapacity();dt<_t&&0!==Ge&&5!==Ge&&4!==Ge&&Pe.writeCodeword("\xfe");var Ot=Pe.getCodewords();for(Ot.length()<_t&&Ot.append(129);Ot.length()<_t;)Ot.append(this.randomize253State(Ot.length()+1));return Pe.getCodewords().toString()},v.lookAheadTest=function(a,u,w){var U=this.lookAheadTestIntern(a,u,w);if(3===w&&3===U){for(var Y=Math.min(u+3,a.length),le=u;le=a.length)return w;var U;0===w?U=[0,1,1,1,1,1.25]:(U=[1,2,2,2,2,2.25])[w]=0;for(var Y=0,le=new Uint8Array(6),ge=[];;){if(u+Y===a.length){Vi.fill(le,0),Vi.fill(ge,0);var Pe=this.findMinimums(U,ge,pi.MAX_VALUE,le),Ge=this.getMinimumCount(le);if(ge[0]===Pe)return 0;if(1===Ge){if(le[5]>0)return 5;if(le[4]>0)return 4;if(le[2]>0)return 2;if(le[3]>0)return 3}return 1}var dt=a.charCodeAt(u+Y);if(Y++,this.isDigit(dt)?U[0]+=.5:this.isExtendedASCII(dt)?(U[0]=Math.ceil(U[0]),U[0]+=2):(U[0]=Math.ceil(U[0]),U[0]++),this.isNativeC40(dt)?U[1]+=2/3:this.isExtendedASCII(dt)?U[1]+=8/3:U[1]+=4/3,this.isNativeText(dt)?U[2]+=2/3:this.isExtendedASCII(dt)?U[2]+=8/3:U[2]+=4/3,this.isNativeX12(dt)?U[3]+=2/3:this.isExtendedASCII(dt)?U[3]+=13/3:U[3]+=10/3,this.isNativeEDIFACT(dt)?U[4]+=3/4:this.isExtendedASCII(dt)?U[4]+=4.25:U[4]+=3.25,this.isSpecialB256(dt)?U[5]+=4:U[5]++,Y>=4){if(Vi.fill(le,0),Vi.fill(ge,0),this.findMinimums(U,ge,pi.MAX_VALUE,le),ge[0]le&&(w=le,Vi.fill(U,0)),w===le&&(U[Y]=U[Y]+1)}return w},v.getMinimumCount=function(a){for(var u=0,w=0;w<6;w++)u+=a[w];return u||0},v.isDigit=function(a){return a>=48&&a<=57},v.isExtendedASCII=function(a){return a>=128&&a<=255},v.isNativeC40=function(a){return 32===a||a>=48&&a<=57||a>=65&&a<=90},v.isNativeText=function(a){return 32===a||a>=48&&a<=57||a>=97&&a<=122},v.isNativeX12=function(a){return this.isX12TermSep(a)||32===a||a>=48&&a<=57||a>=65&&a<=90},v.isX12TermSep=function(a){return 13===a||42===a||62===a},v.isNativeEDIFACT=function(a){return a>=32&&a<=94},v.isSpecialB256=function(a){return!1},v.determineConsecutiveDigitCount=function(a,u){void 0===u&&(u=0);for(var w=a.length,U=u;U=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},vy=function(){function v(a){this.charset=a,this.name=a.name}return v.prototype.canEncode=function(a){try{return null!=Wt.encode(a,this.charset)}catch{return!1}},v}(),Nx=function(){function v(a,u,w){var U,Y,le,ge,Pe,Ge;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(gs){return new vy(ay.forName(gs))}),this.encoders=[];var dt=[];dt.push(new vy(cy.ISO_8859_1));for(var _t=null!=u&&u.name.startsWith("UTF"),Ot=0;Ot=this.bytes.length)return!1;for(var w=0;w=this.length())throw new Error(""+a);if(this.isECI(a))throw new Error("value at "+a+" is not a character but an ECI");return this.isFNC1(a)?this.fnc1:this.bytes[a]},v.prototype.subSequence=function(a,u){if(a<0||a>u||u>this.length())throw new Error(""+a);for(var w=new jr,U=a;U=this.length())throw new Error(""+a);return this.bytes[a]>255&&this.bytes[a]<=999},v.prototype.isFNC1=function(a){if(a<0||a>=this.length())throw new Error(""+a);return 1e3===this.bytes[a]},v.prototype.getECIValue=function(a){if(a<0||a>=this.length())throw new Error(""+a);if(!this.isECI(a))throw new Error("value at "+a+" is not an ECI but a character");return this.bytes[a]-256},v.prototype.addEdge=function(a,u,w){(null==a[u][w.encoderIndex]||a[u][w.encoderIndex].cachedTotalSize>w.cachedTotalSize)&&(a[u][w.encoderIndex]=w)},v.prototype.addEdges=function(a,u,w,U,Y,le){var ge=a.charAt(U).charCodeAt(0),Pe=0,Ge=u.length();u.getPriorityEncoderIndex()>=0&&(ge===le||u.canEncode(ge,u.getPriorityEncoderIndex()))&&(Ge=(Pe=u.getPriorityEncoderIndex())+1);for(var dt=Pe;dt=0;le--)_t.unshift(255&Ht[le])}(null===Ot.previous?0:Ot.previous.encoderIndex)!==Ot.encoderIndex&&_t.unshift(256+u.getECIValue(Ot.encoderIndex)),Ot=Ot.previous}var Ur=[];for(le=0;le=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},jx=function(v,a){var u="function"==typeof Symbol&&v[Symbol.iterator];if(!u)return v;var U,le,w=u.call(v),Y=[];try{for(;(void 0===a||a-- >0)&&!(U=w.next()).done;)Y.push(U.value)}catch(ge){le={error:ge}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(le)throw le.error}}return Y},ao=function(v){return v[v.ASCII=0]="ASCII",v[v.C40=1]="C40",v[v.TEXT=2]="TEXT",v[v.X12=3]="X12",v[v.EDF=4]="EDF",v[v.B256=5]="B256",v}(ao||{}),by=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],_u=function(){function v(){}return v.isExtendedASCII=function(a,u){return a!==u&&a>=128&&a<=255},v.isInC40Shift1Set=function(a){return a<=31},v.isInC40Shift2Set=function(a,u){var w,U;try{for(var Y=R0(by),le=Y.next();!le.done;le=Y.next())if(le.value.charCodeAt(0)===a)return!0}catch(Pe){w={error:Pe}}finally{try{le&&!le.done&&(U=Y.return)&&U.call(Y)}finally{if(w)throw w.error}}return a===u},v.isInTextShift1Set=function(a){return this.isInC40Shift1Set(a)},v.isInTextShift2Set=function(a,u){return this.isInC40Shift2Set(a,u)},v.encodeHighLevel=function(a,u,w,U){void 0===u&&(u=null),void 0===w&&(w=-1),void 0===U&&(U=0);var Y=0;return a.startsWith(lf)&&a.endsWith("\x1e\x04")?(Y=5,a=a.substring(7,a.length-2)):a.startsWith(eo)&&a.endsWith("\x1e\x04")&&(Y=6,a=a.substring(7,a.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,function(){for(var v=[],a=0;au.cachedTotalSize)&&(a[w][u.getEndMode()]=u)},v.getNumberOfC40Words=function(a,u,w,U){for(var Y=0,le=u;le=128&&(w&&Aa.isNativeC40(Pe-128)||!w&&Aa.isNativeText(Pe-128))?Y+=3:Y+=4}else Y+=2;if(Y%3==0||(Y-2)%3==0&&le+1===a.length())return U[0]=le-u+1,Math.ceil(Y/3)}return U[0]=0,0},v.addEdges=function(a,u,w,U){var Y,le;if(a.isECI(w))this.addEdge(u,new $d(a,ao.ASCII,w,1,U));else{var Ht,ge=a.charAt(w);if(null===U||U.getEndMode()!==ao.EDF){Aa.isDigit(ge)&&a.haveNCharacters(w,2)&&Aa.isDigit(a.charAt(w+1))?this.addEdge(u,new $d(a,ao.ASCII,w,2,U)):this.addEdge(u,new $d(a,ao.ASCII,w,1,U));var Pe=[ao.C40,ao.TEXT];try{for(var Ge=R0(Pe),dt=Ge.next();!dt.done;dt=Ge.next()){var _t=dt.value,Ot=[];v.getNumberOfC40Words(a,w,_t===ao.C40,Ot)>0&&this.addEdge(u,new $d(a,_t,w,Ot[0],U))}}catch(Ur){Y={error:Ur}}finally{try{dt&&!dt.done&&(le=Ge.return)&&le.call(Ge)}finally{if(Y)throw Y.error}}a.haveNCharacters(w,3)&&Aa.isNativeX12(a.charAt(w))&&Aa.isNativeX12(a.charAt(w+1))&&Aa.isNativeX12(a.charAt(w+2))&&this.addEdge(u,new $d(a,ao.X12,w,3,U)),this.addEdge(u,new $d(a,ao.B256,w,1,U))}for(Ht=0;Ht<3;Ht++){var Sr=w+Ht;if(!a.haveNCharacters(Sr,1)||!Aa.isNativeEDIFACT(a.charAt(Sr)))break;this.addEdge(u,new $d(a,ao.EDF,w,Ht+1,U))}3===Ht&&a.haveNCharacters(w,4)&&Aa.isNativeEDIFACT(a.charAt(w+3))&&this.addEdge(u,new $d(a,ao.EDF,w,4,U))}},v.encodeMinimally=function(a){var u=a.length(),w=Array(u+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(a,w,0,null);for(var U=1;U<=u;U++){for(var Y=0;Y<6;Y++)null!==w[U][Y]&&U=1&&Y<=3?Pe.cachedTotalSize+1:Pe.cachedTotalSize;Ge0&&(w+=this.prepend($d.getBytes(232),U));for(var Pe=0;Pe=0;w--)u.unshift(a[w]);return a.length},v.prototype.randomize253State=function(a){var w=149*a%253+1+129;return w<=254?w:w-254},v.prototype.applyRandomPattern=function(a,u,w){for(var U=0;U0&&this.getCodewordsRemaining(this.cachedTotalSize+a)<=2-a)return ao.ASCII}if(this.mode===ao.C40||this.mode===ao.TEXT||this.mode===ao.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return ao.ASCII;var a;if(1===(a=this.getLastASCII())&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return ao.ASCII}return this.mode},v.prototype.getMode=function(){return this.mode},v.prototype.getLastASCII=function(){var a=this.input.length(),u=this.fromPosition+this.characterLength;return a-u>4||u>=a?0:a-u==1?_u.isExtendedASCII(this.input.charAt(u),this.input.getFNC1Character())?0:1:a-u==2?_u.isExtendedASCII(this.input.charAt(u),this.input.getFNC1Character())||_u.isExtendedASCII(this.input.charAt(u+1),this.input.getFNC1Character())?0:Aa.isDigit(this.input.charAt(u))&&Aa.isDigit(this.input.charAt(u+1))?1:2:a-u==3?Aa.isDigit(this.input.charAt(u))&&Aa.isDigit(this.input.charAt(u+1))&&!_u.isExtendedASCII(this.input.charAt(u+2),this.input.getFNC1Character())||Aa.isDigit(this.input.charAt(u+1))&&Aa.isDigit(this.input.charAt(u+2))&&!_u.isExtendedASCII(this.input.charAt(u),this.input.getFNC1Character())?2:0:Aa.isDigit(this.input.charAt(u))&&Aa.isDigit(this.input.charAt(u+1))&&Aa.isDigit(this.input.charAt(u+2))&&Aa.isDigit(this.input.charAt(u+3))?2:0},v.prototype.getMinSymbolSize=function(a){var u,w,U,Y,le,ge;switch(this.input.getShapeHint()){case 1:try{for(var Pe=R0(this.squareCodewordCapacities),Ge=Pe.next();!Ge.done;Ge=Pe.next())if((dt=Ge.value)>=a)return dt}catch(Ur){u={error:Ur}}finally{try{Ge&&!Ge.done&&(w=Pe.return)&&w.call(Pe)}finally{if(u)throw u.error}}break;case 2:try{for(var _t=R0(this.rectangularCodewordCapacities),Ot=_t.next();!Ot.done;Ot=_t.next())if((dt=Ot.value)>=a)return dt}catch(Ur){U={error:Ur}}finally{try{Ot&&!Ot.done&&(Y=_t.return)&&Y.call(_t)}finally{if(U)throw U.error}}}try{for(var Ht=R0(this.allCodewordCapacities),Sr=Ht.next();!Sr.done;Sr=Ht.next()){var dt;if((dt=Sr.value)>=a)return dt}}catch(Ur){le={error:Ur}}finally{try{Sr&&!Sr.done&&(ge=Ht.return)&&ge.call(Ht)}finally{if(le)throw le.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},v.prototype.getCodewordsRemaining=function(a){return this.getMinSymbolSize(a)-a},v.getBytes=function(a,u){var w=new Uint8Array(u?2:1);return w[0]=a,u&&(w[1]=u),w},v.prototype.setC40Word=function(a,u,w,U,Y){var le=1600*(255&w)+40*(255&U)+(255&Y)+1;a[u]=le/256,a[u+1]=le%256},v.prototype.getX12Value=function(a){return 13===a?0:42===a?1:62===a?2:32===a?3:a>=48&&a<=57?a-44:a>=65&&a<=90?a-51:a},v.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var a=new Uint8Array(this.characterLength/3*2),u=0;u=33&&w<=47?w-33:w>=48&&w<=57?w-44:w>=58&&w<=64?w-43:w>=65&&w<=90?w-64:w>=91&&w<=95?w-69:96===w?0:w>=97&&w<=122?w-83:w>=123&&w<=127?w-96:w},v.prototype.getC40Words=function(a,u){for(var w=[],U=0;U>16&255,u[Y+1]=Pe>>8&255,u[Y+2]=255&Pe}return u},v.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case ao.ASCII:case ao.B256:switch(this.mode){case ao.B256:return v.getBytes(231);case ao.C40:return v.getBytes(230);case ao.TEXT:return v.getBytes(239);case ao.X12:return v.getBytes(238);case ao.EDF:return v.getBytes(240)}break;case ao.C40:case ao.TEXT:case ao.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case ao.ASCII:return v.getBytes(254);case ao.B256:return v.getBytes(254,231);case ao.C40:return v.getBytes(254,230);case ao.TEXT:return v.getBytes(254,239);case ao.X12:return v.getBytes(254,238);case ao.EDF:return v.getBytes(254,240)}break;case ao.EDF:if(this.mode!==ao.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},v.prototype.getDataBytes=function(){switch(this.mode){case ao.ASCII:return this.input.isECI(this.fromPosition)?v.getBytes(241,this.input.getECIValue(this.fromPosition)+1):_u.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?v.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?v.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?v.getBytes(232):v.getBytes(this.input.charAt(this.fromPosition)+1);case ao.B256:return v.getBytes(this.input.charAt(this.fromPosition));case ao.C40:return this.getC40Words(!0,this.input.getFNC1Character());case ao.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case ao.X12:return this.getX12Words();case ao.EDF:return this.getEDFBytes()}},v}(),__=function(v){function a(u,w,U,Y,le){var ge=v.call(this,u,w,U)||this;return ge.shape=Y,ge.macroId=le,ge}return Lx(a,v),a.prototype.getMacroId=function(){return this.macroId},a.prototype.getShapeHint=function(){return this.shape},a}(w_);!function(){function v(){}v.prototype.encode=function(a,u,w,U,Y){if(void 0===Y&&(Y=null),""===a.trim())throw new Error("Found empty contents");if(u!==Do.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+u);if(w<0||U<0)throw new Error("Requested dimensions can't be negative: "+w+"x"+U);var Ot,le=0,ge=null,Pe=null;if(null!=Y){var Ge=Y.get(as.DATA_MATRIX_SHAPE);null!=Ge&&(le=Ge);var dt=Y.get(as.MIN_SIZE);null!=dt&&(ge=dt);var _t=Y.get(as.MAX_SIZE);null!=_t&&(Pe=_t)}if(null!=Y&&Y.has(as.DATA_MATRIX_COMPACT)&&Y.get(as.DATA_MATRIX_COMPACT).toString()){var Sr=Y.has(as.GS1_FORMAT)&&!!Y.get(as.GS1_FORMAT).toString(),Ur=null;Y.has(as.CHARACTER_SET)&&(Ur=ay.forName(Y.get(as.CHARACTER_SET).toString())),Ot=_u.encodeHighLevel(a,Ur,Sr?29:-1,le)}else{var dn=null!=Y&&Y.has(as.FORCE_C40)&&!!Y.get(as.FORCE_C40).toString();Ot=Aa.encodeHighLevel(a,le,ge,Pe,dn)}var ln=my.lookup(Ot.length,le,ge,Pe,!0),Tn=sp.encodeECC200(Ot,ln),Gn=new ly(Tn,ln.getSymbolDataWidth(),ln.getSymbolDataHeight());return Gn.place(),this.encodeLowLevel(Gn,ln,w,U)},v.prototype.encodeLowLevel=function(a,u,w,U){for(var Y=u.getSymbolDataWidth(),le=u.getSymbolDataHeight(),ge=new Bp(u.getSymbolWidth(),u.getSymbolHeight()),Pe=0,Ge=0;Ge"},a}(fC);var mC=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)U.hasOwnProperty(Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}();const B0=function(v){function a(u,w,U){var Y=v.call(this,u,0,0)||this;return Y.binaryShiftStart=w,Y.binaryShiftByteCount=U,Y}return mC(a,v),a.prototype.appendTo=function(u,w){for(var U=0;U62?u.appendBits(this.binaryShiftByteCount-31,16):u.appendBits(0===U?Math.min(this.binaryShiftByteCount,31):this.binaryShiftByteCount-31,5)),u.appendBits(w[this.binaryShiftStart+U],8)},a.prototype.addBinaryShift=function(u,w){return new a(this,u,w)},a.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},a}(x_);function km(v,a,u){return new x_(v,a,u)}var Vx=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],S_=new x_(null,0,0),F0=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],rh=function _y(v){var a,u;try{for(var w=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(v),U=w.next();!U.done;U=w.next())Vi.fill(U.value,-1)}catch(le){a={error:le}}finally{try{U&&!U.done&&(u=w.return)&&u.call(w)}finally{if(a)throw a.error}}return v[0][4]=0,v[1][4]=0,v[1][0]=28,v[3][4]=0,v[2][4]=0,v[2][0]=15,v}(Vi.createInt32Array(6,6));const D_=function(){function v(a,u,w,U){this.token=a,this.mode=u,this.binaryShiftByteCount=w,this.bitCount=U}return v.prototype.getMode=function(){return this.mode},v.prototype.getToken=function(){return this.token},v.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},v.prototype.getBitCount=function(){return this.bitCount},v.prototype.latchAndAppend=function(a,u){var w=this.bitCount,U=this.token;if(a!==this.mode){var Y=F0[this.mode][a];U=km(U,65535&Y,Y>>16),w+=Y>>16}var le=2===a?4:5;return new v(U=km(U,u,le),a,0,w+le)},v.prototype.shiftAndAppend=function(a,u){var w=this.token,U=2===this.mode?4:5;return w=km(w,rh[this.mode][a],U),new v(w=km(w,u,5),this.mode,0,this.bitCount+U+5)},v.prototype.addBinaryShiftChar=function(a){var u=this.token,w=this.mode,U=this.bitCount;if(4===this.mode||2===this.mode){var Y=F0[w][0];u=km(u,65535&Y,Y>>16),U+=Y>>16,w=0}var ge=new v(u,w,this.binaryShiftByteCount+1,U+(0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8));return 2078===ge.binaryShiftByteCount&&(ge=ge.endBinaryShift(a+1)),ge},v.prototype.endBinaryShift=function(a){if(0===this.binaryShiftByteCount)return this;var u=this.token;return u=function $x(v,a,u){return new B0(v,a,u)}(u,a-this.binaryShiftByteCount,this.binaryShiftByteCount),new v(u,this.mode,0,this.bitCount)},v.prototype.isBetterThanOrEqualTo=function(a){var u=this.bitCount+(F0[this.mode][a.mode]>>16);return this.binaryShiftByteCounta.binaryShiftByteCount&&a.binaryShiftByteCount>0&&(u+=10),u<=a.bitCount},v.prototype.toBitArray=function(a){for(var u,w,U=[],Y=this.endBinaryShift(a.length).token;null!==Y;Y=Y.getPrevious())U.unshift(Y);var le=new bi;try{for(var ge=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(U),Pe=ge.next();!Pe.done;Pe=ge.next())Pe.value.appendTo(le,a)}catch(dt){u={error:dt}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(u)throw u.error}}return le},v.prototype.toString=function(){return bt.format("%s bits=%d bytes=%d",Vx[this.mode],this.bitCount,this.binaryShiftByteCount)},v.calculateBinaryShiftCost=function(a){return a.binaryShiftByteCount>62?21:a.binaryShiftByteCount>31?20:a.binaryShiftByteCount>0?10:0},v.INITIAL_STATE=new v(S_,0,0,0),v}();var I_=function C_(v){var a=bt.getCharCode(" "),u=bt.getCharCode("."),w=bt.getCharCode(",");v[0][a]=1;for(var U=bt.getCharCode("Z"),Y=bt.getCharCode("A"),le=Y;le<=U;le++)v[0][le]=le-Y+2;v[1][a]=1;var ge=bt.getCharCode("z"),Pe=bt.getCharCode("a");for(le=Pe;le<=ge;le++)v[1][le]=le-Pe+2;v[2][a]=1;var Ge=bt.getCharCode("9"),dt=bt.getCharCode("0");for(le=dt;le<=Ge;le++)v[2][le]=le-dt+2;v[2][w]=12,v[2][u]=13;for(var _t=["\0"," ","\x01","\x02","\x03","\x04","\x05","\x06","\x07","\b","\t","\n","\v","\f","\r","\x1b","\x1c","\x1d","\x1e","\x1f","@","\\","^","_","`","|","~","\x7f"],Ot=0;Ot<_t.length;Ot++)v[3][bt.getCharCode(_t[Ot])]=Ot;var Ht=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(Ot=0;Ot0&&(v[4][bt.getCharCode(Ht[Ot])]=Ot);return v}(Vi.createInt32Array(5,256)),F1=function(v){var a="function"==typeof Symbol&&Symbol.iterator,u=a&&v[a],w=0;if(u)return u.call(v);if(v&&"number"==typeof v.length)return{next:function(){return v&&w>=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")};const N1=function(){function v(a){this.text=a}return v.prototype.encode=function(){for(var a=bt.getCharCode(" "),u=bt.getCharCode("\n"),w=E_.singletonList(D_.INITIAL_STATE),U=0;U0?(w=v.updateStateListForPair(w,U,Y),U++):w=this.updateStateListForChar(w,U)}return E_.min(w,function(Pe,Ge){return Pe.getBitCount()-Ge.getBitCount()}).toBitArray(this.text)},v.prototype.updateStateListForChar=function(a,u){var w,U,Y=[];try{for(var le=F1(a),ge=le.next();!ge.done;ge=le.next())this.updateStateForChar(ge.value,u,Y)}catch(Ge){w={error:Ge}}finally{try{ge&&!ge.done&&(U=le.return)&&U.call(le)}finally{if(w)throw w.error}}return v.simplifyStates(Y)},v.prototype.updateStateForChar=function(a,u,w){for(var U=255&this.text[u],Y=I_[a.getMode()][U]>0,le=null,ge=0;ge<=4;ge++){var Pe=I_[ge][U];if(Pe>0){if(null==le&&(le=a.endBinaryShift(u)),!Y||ge===a.getMode()||2===ge){var Ge=le.latchAndAppend(ge,Pe);w.push(Ge)}if(!Y&&rh[a.getMode()][ge]>=0){var dt=le.shiftAndAppend(ge,Pe);w.push(dt)}}}if(a.getBinaryShiftByteCount()>0||0===I_[a.getMode()][U]){var _t=a.addBinaryShiftChar(u);w.push(_t)}},v.updateStateListForPair=function(a,u,w){var U,Y,le=[];try{for(var ge=F1(a),Pe=ge.next();!Pe.done;Pe=ge.next())this.updateStateForPair(Pe.value,u,w,le)}catch(dt){U={error:dt}}finally{try{Pe&&!Pe.done&&(Y=ge.return)&&Y.call(ge)}finally{if(U)throw U.error}}return this.simplifyStates(le)},v.updateStateForPair=function(a,u,w,U){var Y=a.endBinaryShift(u);if(U.push(Y.latchAndAppend(4,w)),4!==a.getMode()&&U.push(Y.shiftAndAppend(4,w)),3===w||4===w){var le=Y.latchAndAppend(2,16-w).latchAndAppend(2,1);U.push(le)}if(a.getBinaryShiftByteCount()>0){var ge=a.addBinaryShiftChar(u).addBinaryShiftChar(u+1);U.push(ge)}},v.simplifyStates=function(a){var u,w,U,Y,le=[];try{for(var ge=F1(a),Pe=ge.next();!Pe.done;Pe=ge.next()){var Ge=Pe.value,dt=!0,_t=function(Zr){if(Zr.isBetterThanOrEqualTo(Ge))return dt=!1,"break";Ge.isBetterThanOrEqualTo(Zr)&&(le=le.filter(function(dn){return dn!==Zr}))};try{for(var Ot=(U=void 0,F1(le)),Ht=Ot.next();!Ht.done&&"break"!==_t(Ht.value);Ht=Ot.next());}catch(Zr){U={error:Zr}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}dt&&le.push(Ge)}}catch(Zr){u={error:Zr}}finally{try{Pe&&!Pe.done&&(w=ge.return)&&w.call(ge)}finally{if(u)throw u.error}}return le},v}(),Ey=function(){function v(){}return v.encodeBytes=function(a){return v.encode(a,v.DEFAULT_EC_PERCENT,v.DEFAULT_AZTEC_LAYERS)},v.encode=function(a,u,w){var ge,Pe,Ge,dt,_t,U=new N1(a).encode(),Y=pi.truncDivision(U.getSize()*u,100)+11,le=U.getSize()+Y;if(w!==v.DEFAULT_AZTEC_LAYERS){if(ge=w<0,(Pe=Math.abs(w))>(ge?v.MAX_NB_BITS_COMPACT:v.MAX_NB_BITS))throw new ki(bt.format("Illegal value %s for layers",w));var Ot=(Ge=v.totalBitsInLayer(Pe,ge))-Ge%(dt=v.WORD_SIZE[Pe]);if((_t=v.stuffBits(U,dt)).getSize()+Y>Ot)throw new ki("Data to large for user specified layer");if(ge&&_t.getSize()>64*dt)throw new ki("Data to large for user specified layer")}else{dt=0,_t=null;for(var Ht=0;;Ht++){if(Ht>v.MAX_NB_BITS)throw new ki("Data too large for an Aztec code");if(!(le>(Ge=v.totalBitsInLayer(Pe=(ge=Ht<=3)?Ht+1:Ht,ge)))&&((null==_t||dt!==v.WORD_SIZE[Pe])&&(_t=v.stuffBits(U,dt=v.WORD_SIZE[Pe])),Ot=Ge-Ge%dt,!(ge&&_t.getSize()>64*dt)&&_t.getSize()+Y<=Ot))break}}var Tn,Sr=v.generateCheckWords(_t,Ge,dt),Ur=_t.getSize()/dt,Zr=v.generateModeMessage(ge,Pe,Ur),dn=(ge?11:14)+4*Pe,ln=new Int32Array(dn);if(ge)for(Tn=dn,Ht=0;Ht=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}(Array.from(Ge)),Ht=Ot.next();!Ht.done;Ht=Ot.next())_t.appendBits(Ht.value,w)}catch(Ur){U={error:Ur}}finally{try{Ht&&!Ht.done&&(Y=Ot.return)&&Y.call(Ot)}finally{if(U)throw U.error}}return _t},v.bitsToWords=function(a,u,w){var Y,le,U=new Int32Array(w);for(Y=0,le=a.getSize()/u;Y=U||a.get(le+Pe))&&(ge|=1<>10}return Y},a.prototype.getRow=function(u,w){if(u<0||u>=this.getHeight())throw new ki("Requested row is outside the image: "+u);var U=this.getWidth(),Y=u*U;return null===w?w=this.buffer.slice(Y,Y+U):(w.length0&&Y[Y.length-1])&&(6===Ge[0]||2===Ge[0])){u=0;continue}if(3===Ge[0]&&(!Y||Ge[1]>Y[0]&&Ge[1]=v.length&&(v=void 0),{value:v&&v[w++],done:!v}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},wl={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},uf=function(){function v(a,u,w){void 0===u&&(u=new Map),void 0===w&&(w={}),this.reader=a,this.hints=u,this.options=Bm(Bm({},wl),w)}return Object.defineProperty(v.prototype,"possibleFormats",{set:function(a){this.hints.set(Di.POSSIBLE_FORMATS,a)},enumerable:!1,configurable:!0}),v.addVideoSource=function(a,u){try{a.srcObject=u}catch{console.error("got interrupted by new loading request")}},v.mediaStreamSetTorch=function(a,u){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return[4,a.applyConstraints({advanced:[{fillLightMode:u?"flash":"off",torch:!!u}]})];case 1:return w.sent(),[2]}})})},v.mediaStreamIsTorchCompatible=function(a){var u,w,U=a.getVideoTracks();try{for(var Y=Fm(U),le=Y.next();!le.done;le=Y.next())if(v.mediaStreamIsTorchCompatibleTrack(le.value))return!0}catch(Pe){u={error:Pe}}finally{try{le&&!le.done&&(w=Y.return)&&w.call(Y)}finally{if(u)throw u.error}}return!1},v.mediaStreamIsTorchCompatibleTrack=function(a){try{return"torch"in a.getCapabilities()}catch(w){return console.error(w),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},v.isVideoPlaying=function(a){return a.currentTime>0&&!a.paused&&a.readyState>2},v.getMediaElement=function(a,u){var w=document.getElementById(a);if(!w)throw new bs("element with id '".concat(a,"' not found"));if(w.nodeName.toLowerCase()!==u.toLowerCase())throw new bs("element with id '".concat(a,"' must be an ").concat(u," element"));return w},v.createVideoElement=function(a){if(a instanceof HTMLVideoElement)return a;if("string"==typeof a)return v.getMediaElement(a,"video");if(!a&&typeof document<"u"){var u=document.createElement("video");return u.width=200,u.height=200,u}throw new Error("Couldn't get videoElement from videoSource!")},v.prepareImageElement=function(a){if(a instanceof HTMLImageElement)return a;if("string"==typeof a)return v.getMediaElement(a,"img");if(typeof a>"u"){var u=document.createElement("img");return u.width=200,u.height=200,u}throw new Error("Couldn't get imageElement from imageSource!")},v.prepareVideoElement=function(a){var u=v.createVideoElement(a);return u.setAttribute("autoplay","true"),u.setAttribute("muted","true"),u.setAttribute("playsinline","true"),u},v.isImageLoaded=function(a){return!(!a.complete||0===a.naturalWidth)},v.createBinaryBitmapFromCanvas=function(a){var u=new Hx(a),w=new mc(u);return new jc(w)},v.drawImageOnCanvas=function(a,u){a.drawImage(u,0,0)},v.getMediaElementDimensions=function(a){if(a instanceof HTMLVideoElement)return{height:a.videoHeight,width:a.videoWidth};if(a instanceof HTMLImageElement)return{height:a.naturalHeight||a.height,width:a.naturalWidth||a.width};throw new Error("Couldn't find the Source's dimensions!")},v.createCaptureCanvas=function(a){if(!a)throw new bs("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error('The page "Document" is undefined, make sure you\'re running in a browser.');var u=document.createElement("canvas"),w=v.getMediaElementDimensions(a),U=w.width,Y=w.height;return u.style.width=U+"px",u.style.height=Y+"px",u.width=U,u.height=Y,u},v.tryPlayVideo=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:if(a?.ended)return console.error("Trying to play video that has ended."),[2,!1];if(v.isVideoPlaying(a))return console.warn("Trying to play video that is already playing."),[2,!0];w.label=1;case 1:return w.trys.push([1,3,,4]),[4,a.play()];case 2:return w.sent(),[2,!0];case 3:return u=w.sent(),console.warn("It was not possible to play the video.",u),[2,!1];case 4:return[2]}})})},v.createCanvasFromMediaElement=function(a){var u=v.createCaptureCanvas(a),w=u.getContext("2d");if(!w)throw new Error("Couldn't find Canvas 2D Context.");return v.drawImageOnCanvas(w,a),u},v.createBinaryBitmapFromMediaElem=function(a){var u=v.createCanvasFromMediaElement(a);return v.createBinaryBitmapFromCanvas(u)},v.destroyImageElement=function(a){a.src="",a.removeAttribute("src"),a=void 0},v.listVideoInputDevices=function(){return bl(this,void 0,void 0,function(){var a,u,w,U,Y,le,ge,Pe,_t,Ot;return nl(this,function(Ht){switch(Ht.label){case 0:if(!M_())throw new Error("Can't enumerate devices, navigator is not present.");if(!function Sy(){return!(!function $1(){return M_()&&!!navigator.mediaDevices}()||!navigator.mediaDevices.enumerateDevices)}())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:a=Ht.sent(),u=[];try{for(w=Fm(a),U=w.next();!U.done;U=w.next())"videoinput"===(le="video"===(Y=U.value).kind?"videoinput":Y.kind)&&(ge=Y.deviceId||Y.id,Pe=Y.label||"Video device ".concat(u.length+1),u.push({deviceId:ge,label:Pe,kind:le,groupId:Y.groupId}))}catch(Sr){_t={error:Sr}}finally{try{U&&!U.done&&(Ot=w.return)&&Ot.call(w)}finally{if(_t)throw _t.error}}return[2,u]}})})},v.findDeviceById=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:return[4,v.listVideoInputDevices()];case 1:return(u=w.sent())?[2,u.find(function(U){return U.deviceId===a})]:[2]}})})},v.cleanVideoSource=function(a){if(a){try{a.srcObject=null}catch{a.src=""}a&&a.removeAttribute("src")}},v.releaseAllStreams=function(){0!==v.streamTracker.length&&v.streamTracker.forEach(function(a){a.getTracks().forEach(function(u){return u.stop()})}),v.streamTracker=[]},v.playVideoOnLoadAsync=function(a,u){return bl(this,void 0,void 0,function(){return nl(this,function(U){switch(U.label){case 0:return[4,v.tryPlayVideo(a)];case 1:return U.sent()?[2,!0]:[2,new Promise(function(Y,le){var ge=setTimeout(function(){v.isVideoPlaying(a)||(le(!1),a.removeEventListener("canplay",Pe))},u),Pe=function(){v.tryPlayVideo(a).then(function(Ge){clearTimeout(ge),a.removeEventListener("canplay",Pe),Y(Ge)})};a.addEventListener("canplay",Pe)})]}})})},v.attachStreamToVideo=function(a,u,w){return void 0===w&&(w=5e3),bl(this,void 0,void 0,function(){var U;return nl(this,function(Y){switch(Y.label){case 0:return U=v.prepareVideoElement(u),v.addVideoSource(U,a),[4,v.playVideoOnLoadAsync(U,w)];case 1:return Y.sent(),[2,U]}})})},v._waitImageLoad=function(a){return new Promise(function(u,w){var Y=setTimeout(function(){v.isImageLoaded(a)||(a.removeEventListener("load",le),w())},1e4),le=function(){clearTimeout(Y),a.removeEventListener("load",le),u()};a.addEventListener("load",le)})},v.checkCallbackFnOrThrow=function(a){if(!a)throw new bs("`callbackFn` is a required parameter, you cannot capture results without it.")},v.disposeMediaStream=function(a){a.getVideoTracks().forEach(function(u){return u.stop()}),a=void 0},v.prototype.decode=function(a){var u=v.createCanvasFromMediaElement(a);return this.decodeFromCanvas(u)},v.prototype.decodeBitmap=function(a){return this.reader.decode(a,this.hints)},v.prototype.decodeFromCanvas=function(a){var u=v.createBinaryBitmapFromCanvas(a);return this.decodeBitmap(u)},v.prototype.decodeFromImageElement=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:if(!a)throw new bs("An image element must be provided.");return u=v.prepareImageElement(a),[4,this._decodeOnLoadImage(u)];case 1:return[2,w.sent()]}})})},v.prototype.decodeFromImageUrl=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:if(!a)throw new bs("An URL must be provided.");(u=v.prepareImageElement()).src=a,w.label=1;case 1:return w.trys.push([1,,3,4]),[4,this.decodeFromImageElement(u)];case 2:return[2,w.sent()];case 3:return v.destroyImageElement(u),[7];case 4:return[2]}})})},v.prototype.decodeFromConstraints=function(a,u,w){return bl(this,void 0,void 0,function(){var U,Y;return nl(this,function(le){switch(le.label){case 0:return v.checkCallbackFnOrThrow(w),[4,this.getUserMedia(a)];case 1:U=le.sent(),le.label=2;case 2:return le.trys.push([2,4,,5]),[4,this.decodeFromStream(U,u,w)];case 3:return[2,le.sent()];case 4:throw Y=le.sent(),v.disposeMediaStream(U),Y;case 5:return[2]}})})},v.prototype.decodeFromStream=function(a,u,w){return bl(this,void 0,void 0,function(){var Y,ge,Pe,Ge,_t,Ot,Ht=this;return nl(this,function(Sr){switch(Sr.label){case 0:return v.checkCallbackFnOrThrow(w),[4,v.attachStreamToVideo(a,u,this.options.tryPlayVideoTimeout)];case 1:return Y=Sr.sent(),ge=this.scan(Y,w,function(){v.disposeMediaStream(a),v.cleanVideoSource(Y)}),Pe=a.getVideoTracks(),Ge=Bm(Bm({},ge),{stop:function(){ge.stop()},streamVideoConstraintsApply:function(Ur,Zr){return bl(this,void 0,void 0,function(){var dn,ln,Tn,yi,Bi,Ki;return nl(this,function(po){switch(po.label){case 0:dn=Zr?Pe.filter(Zr):Pe,po.label=1;case 1:po.trys.push([1,6,7,8]),ln=Fm(dn),Tn=ln.next(),po.label=2;case 2:return Tn.done?[3,5]:[4,Tn.value.applyConstraints(Ur)];case 3:po.sent(),po.label=4;case 4:return Tn=ln.next(),[3,2];case 5:return[3,8];case 6:return yi=po.sent(),Bi={error:yi},[3,8];case 7:try{Tn&&!Tn.done&&(Ki=ln.return)&&Ki.call(ln)}finally{if(Bi)throw Bi.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(Ur){return Pe.find(Ur).getConstraints()},streamVideoSettingsGet:function(Ur){return Pe.find(Ur).getSettings()},streamVideoCapabilitiesGet:function(Ur){return Pe.find(Ur).getCapabilities()}}),v.mediaStreamIsTorchCompatible(a)&&(_t=Pe?.find(function(Ur){return v.mediaStreamIsTorchCompatibleTrack(Ur)}),Ge.switchTorch=Ot=function(Ur){return bl(Ht,void 0,void 0,function(){return nl(this,function(Zr){switch(Zr.label){case 0:return[4,v.mediaStreamSetTorch(_t,Ur)];case 1:return Zr.sent(),[2]}})})},Ge.stop=function(){return bl(Ht,void 0,void 0,function(){return nl(this,function(Ur){switch(Ur.label){case 0:return ge.stop(),[4,Ot(!1)];case 1:return Ur.sent(),[2]}})})}),[2,Ge]}})})},v.prototype.decodeFromVideoDevice=function(a,u,w){return bl(this,void 0,void 0,function(){return nl(this,function(le){switch(le.label){case 0:return v.checkCallbackFnOrThrow(w),[4,this.decodeFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u,w)];case 1:return[2,le.sent()]}})})},v.prototype.decodeFromVideoElement=function(a,u){return bl(this,void 0,void 0,function(){var w;return nl(this,function(Y){switch(Y.label){case 0:if(v.checkCallbackFnOrThrow(u),!a)throw new bs("A video element must be provided.");return w=v.prepareVideoElement(a),[4,v.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return Y.sent(),[2,this.scan(w,u)]}})})},v.prototype.decodeFromVideoUrl=function(a,u){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(ge){switch(ge.label){case 0:if(v.checkCallbackFnOrThrow(u),!a)throw new bs("An URL must be provided.");return(w=v.prepareVideoElement()).src=a,U=function(){v.cleanVideoSource(w)},[4,v.playVideoOnLoadAsync(w,this.options.tryPlayVideoTimeout)];case 1:return ge.sent(),[2,this.scan(w,u,U)]}})})},v.prototype.decodeOnceFromConstraints=function(a,u){return bl(this,void 0,void 0,function(){var w;return nl(this,function(U){switch(U.label){case 0:return[4,this.getUserMedia(a)];case 1:return w=U.sent(),[4,this.decodeOnceFromStream(w,u)];case 2:return[2,U.sent()]}})})},v.prototype.decodeOnceFromStream=function(a,u){return bl(this,void 0,void 0,function(){var w,U;return nl(this,function(le){switch(le.label){case 0:return w=!!u,[4,v.attachStreamToVideo(a,u)];case 1:U=le.sent(),le.label=2;case 2:return le.trys.push([2,,4,5]),[4,this.scanOneResult(U)];case 3:return[2,le.sent()];case 4:return w||v.cleanVideoSource(U),[7];case 5:return[2]}})})},v.prototype.decodeOnceFromVideoDevice=function(a,u){return bl(this,void 0,void 0,function(){return nl(this,function(Y){switch(Y.label){case 0:return[4,this.decodeOnceFromConstraints({video:a?{deviceId:{exact:a}}:{facingMode:"environment"}},u)];case 1:return[2,Y.sent()]}})})},v.prototype.decodeOnceFromVideoElement=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(U){switch(U.label){case 0:if(!a)throw new bs("A video element must be provided.");return u=v.prepareVideoElement(a),[4,v.playVideoOnLoadAsync(u,this.options.tryPlayVideoTimeout)];case 1:return U.sent(),[4,this.scanOneResult(u)];case 2:return[2,U.sent()]}})})},v.prototype.decodeOnceFromVideoUrl=function(a){return bl(this,void 0,void 0,function(){var u,w;return nl(this,function(U){switch(U.label){case 0:if(!a)throw new bs("An URL must be provided.");(u=v.prepareVideoElement()).src=a,w=this.decodeOnceFromVideoElement(u),U.label=1;case 1:return U.trys.push([1,,3,4]),[4,w];case 2:return[2,U.sent()];case 3:return v.cleanVideoSource(u),[7];case 4:return[2]}})})},v.prototype.scanOneResult=function(a,u,w,U){var Y=this;return void 0===u&&(u=!0),void 0===w&&(w=!0),void 0===U&&(U=!0),new Promise(function(le,ge){Y.scan(a,function(Pe,Ge,dt){if(Pe)return le(Pe),void dt.stop();if(Ge){if(Ge instanceof Wn&&u||Ge instanceof rs&&w||Ge instanceof Qn&&U)return;dt.stop(),ge(Ge)}})})},v.prototype.scan=function(a,u,w){var U=this;v.checkCallbackFnOrThrow(u);var le,Y=v.createCaptureCanvas(a);try{le=Y.getContext("2d",{willReadFrequently:!0})}catch{le=Y.getContext("2d")}if(!le)throw new Error("Couldn't create canvas for visual element scan.");var Ge,ge=function(){le=void 0,Y=void 0},Pe=!1,_t={stop:function(){Pe=!0,clearTimeout(Ge),ge(),w&&w()}},Ot=function(){if(!Pe)try{v.drawImageOnCanvas(le,a);var Ht=U.decodeFromCanvas(Y);u(Ht,void 0,_t),Ge=setTimeout(Ot,U.options.delayBetweenScanSuccess)}catch(dn){if(u(void 0,dn,_t),dn instanceof rs||dn instanceof Qn||dn instanceof Wn)return void(Ge=setTimeout(Ot,U.options.delayBetweenScanAttempts));ge(),w&&w(dn)}};return Ot(),_t},v.prototype._decodeOnLoadImage=function(a){return bl(this,void 0,void 0,function(){return nl(this,function(w){switch(w.label){case 0:return v.isImageLoaded(a)?[3,2]:[4,v._waitImageLoad(a)];case 1:w.sent(),w.label=2;case 2:return[2,this.decode(a)]}})})},v.prototype.getUserMedia=function(a){return bl(this,void 0,void 0,function(){var u;return nl(this,function(w){switch(w.label){case 0:return[4,navigator.mediaDevices.getUserMedia(a)];case 1:return u=w.sent(),v.streamTracker.push(u),[2,u]}})})},v.streamTracker=[],v}(),V1=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Af=(function(v){V1(function a(u,w){return v.call(this,new We,u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),T_=(function(v){Af(function a(u,w){return v.call(this,new Ac(u),u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Ay=(function(v){T_(function a(u,w){return v.call(this,new y0,u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Gx=function(v){function a(u,w){var U=this,Y=new ny;return Y.setHints(u),(U=v.call(this,Y,u,w)||this).reader=Y,U}return Ay(a,v),Object.defineProperty(a.prototype,"possibleFormats",{set:function(u){this.hints.set(Di.POSSIBLE_FORMATS,u),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),a.prototype.decodeBitmap=function(u){return this.reader.decodeWithState(u)},a.prototype.setHints=function(u){this.hints=u,this.reader.setHints(this.hints)},a}(uf),Xx=function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}(),Jx=(function(v){Xx(function a(u,w){return v.call(this,new S0,u,w)||this},v)}(uf),function(){var v=function(a,u){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,U){w.__proto__=U}||function(w,U){for(var Y in U)Object.prototype.hasOwnProperty.call(U,Y)&&(w[Y]=U[Y])})(a,u)};return function(a,u){if("function"!=typeof u&&null!==u)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function w(){this.constructor=a}v(a,u),a.prototype=null===u?Object.create(u):(w.prototype=u.prototype,new w)}}()),Ih=(function(v){Jx(function a(u,w){return v.call(this,new u1,u,w)||this},v)}(uf),"http://www.w3.org/2000/svg"),Mh=(function(){function v(a){if("string"==typeof a){var u=document.getElementById(a);if(!u)throw new Error("Could not find a Container element with '".concat(a,"'."));this.containerElement=u}else this.containerElement=a}v.prototype.write=function(a,u,w,U){if(0===a.length)throw new ki("Found empty contents");if(u<0||w<0)throw new ki("Requested dimensions are too small: "+u+"x"+w);var Y=U&&void 0!==U.get(as.MARGIN)?Number.parseInt(U.get(as.MARGIN).toString(),10):v.QUIET_ZONE_SIZE,le=this.encode(U,a);return this.renderResult(le,u,w,Y)},v.prototype.createSVGElement=function(a,u){var w=document.createElementNS(v.SVG_NS,"svg");return w.setAttributeNS(Ih,"width",u.toString()),w.setAttributeNS(Ih,"height",a.toString()),w},v.prototype.createSvgPathPlaceholderElement=function(a,u){var w=document.createElementNS(v.SVG_NS,"path");return w.setAttributeNS(Ih,"d","M0 0h".concat(a,"v").concat(u,"H0z")),w.setAttributeNS(Ih,"fill","none"),w},v.prototype.createSvgRectElement=function(a,u,w,U){var Y=document.createElementNS(v.SVG_NS,"rect");return Y.setAttributeNS(Ih,"x",a.toString()),Y.setAttributeNS(Ih,"y",u.toString()),Y.setAttributeNS(Ih,"height",w.toString()),Y.setAttributeNS(Ih,"width",U.toString()),Y.setAttributeNS(Ih,"fill","#000000"),Y},v.prototype.encode=function(a,u){var w=Al.L;if(a&&void 0!==a.get(as.ERROR_CORRECTION)){var U=a.get(as.ERROR_CORRECTION).toString();w=Al.fromString(U)}return C0.encode(u,w,a)},v.prototype.renderResult=function(a,u,w,U){var Y=a.getMatrix();if(null===Y)throw new ou;var le=Y.getWidth(),ge=Y.getHeight(),Pe=le+2*U,Ge=ge+2*U,dt=Math.max(u,Pe),_t=Math.max(w,Ge),Ot=Math.min(Math.floor(dt/Pe),Math.floor(_t/Ge)),Ht=Math.floor((dt-le*Ot)/2),Sr=Math.floor((_t-ge*Ot)/2),Ur=this.createSVGElement(dt,_t),Zr=this.createSvgPathPlaceholderElement(u,w);Ur.appendChild(Zr),this.containerElement.appendChild(Ur);for(var dn=0,ln=Sr;dn{if(!ge)return void U.next({result:le});const Pe=ge.name;Pe===Wn.name||Pe===rs.name||Pe===Qn.name||ge.message.includes("No MultiFormat Readers were able to detect the code.")?U.next({error:ge}):(U.error(ge),w.scannerControls.stop(),w.scannerControls=void 0)}),w.scannerControls={...Y,stop(){Y.stop(),U.complete()}}}catch(le){U.error(le),w.scannerControls?.stop(),w.scannerControls=void 0}return U.asObservable()})()}}let Dy=(()=>{class v{get codeReader(){return this._codeReader}set device(u){this._ready?this.isAutostarting?console.warn("Avoid setting a device during auto-start."):this.isCurrentDevice(u)?console.warn("Setting the same device is not allowed."):this.hasPermission?this.setDevice(u):console.warn("Permissions not set yet, waiting for them to be set to apply device change."):this._devicePreStart=u}get device(){return this._device}get formats(){return this.hints.get(Di.POSSIBLE_FORMATS)}set formats(u){if("string"==typeof u)throw new Error("Invalid formats, make sure the [formats] input is a binding.");const w=u.map(Y=>this.getBarcodeFormatOrFail(Y)),U=this.hints;U.set(Di.POSSIBLE_FORMATS,w),this.hints=U}get hints(){return this._hints}set hints(u){this._hints=u,this.codeReader?.setHints(this._hints)}set videoConstraints(u){const w=this.codeReader?.getScannerControls();w&&w?.streamVideoConstraintsApply(u)}set isAutostarting(u){this._isAutostarting=u,this.autostarting.next(u)}get isAutostarting(){return this._isAutostarting}set torch(u){try{this.getCodeReader().getScannerControls().switchTorch(u)}catch{}}set enable(u){this._enabled!==!!u&&(this._enabled=!!u,this._enabled?this.device?this.scanFromDevice(this.device.deviceId):this.init():(this.reset(),z1.releaseAllStreams()))}get enabled(){return this._enabled}get tryHarder(){return this.hints.get(Di.TRY_HARDER)}set tryHarder(u){const w=this.hints;u?w.set(Di.TRY_HARDER,!0):w.delete(Di.TRY_HARDER),this.hints=w}constructor(){this.timeBetweenScans=500,this.delayBetweenScanSuccess=500,this.previewFitMode="cover",this.poster="",this._ready=!1,this.autostarted=new c.bkB,this.autostarting=new c.bkB,this.torchCompatible=new c.bkB(!1),this.scanSuccess=new c.bkB,this.scanFailure=new c.bkB,this.scanError=new c.bkB,this.scanComplete=new c.bkB,this.camerasFound=new c.bkB,this.camerasNotFound=new c.bkB,this.permissionResponse=new c.bkB(!0),this.hasDevices=new c.bkB,this.deviceChange=new c.bkB,this._enabled=!0,this._hints=new Map,this.autofocusEnabled=!0,this.autostart=!0,this.formats=[Do.QR_CODE],this.hasNavigator=typeof navigator<"u",this.isMediaDevicesSupported=this.hasNavigator&&!!navigator.mediaDevices}askForPermission(){var u=this;return(0,B.A)(function*(){if(!u.hasNavigator)return console.error("@zxing/ngx-scanner","Can't ask permission, navigator is not present."),u.setPermission(null),u.hasPermission;if(!u.isMediaDevicesSupported)return console.error("@zxing/ngx-scanner","Can't get user media, this is not supported."),u.setPermission(null),u.hasPermission;let w,U;try{w=yield u.getAnyVideoDevice(),U=!!w}catch(Y){return u.handlePermissionException(Y)}finally{u.terminateStream(w)}return u.setPermission(U),U})()}getAnyVideoDevice(){return navigator.mediaDevices.getUserMedia({video:!0})}terminateStream(u){u&&u.getTracks().forEach(w=>w.stop()),u=void 0}init(){var u=this;return(0,B.A)(function*(){if(!u.autostart)return console.warn("Feature 'autostart' disabled. Permissions and devices recovery has to be run manually."),u.initAutostartOff(),void(u._ready=!0);yield u.initAutostartOn(),u._ready=!0})()}initAutostartOff(){this.isAutostarting=!1,this.updateVideoInputDevices(),this._device&&this._devicePreStart&&this.setDevice(this._devicePreStart)}initAutostartOn(){var u=this;return(0,B.A)(function*(){let w;u.isAutostarting=!0;try{w=yield u.askForPermission()}catch(U){return void console.error("Exception occurred while asking for permission:",U)}if(w){const U=yield u.updateVideoInputDevices();yield u.autostartScanner([...U])}u.isAutostarting=!1,u.autostarted.next()})()}isCurrentDevice(u){return u?.deviceId===this._device?.deviceId}ngOnDestroy(){this.reset(),uf.cleanVideoSource(this.previewElemRef.nativeElement),z1.releaseAllStreams()}ngOnInit(){this.init()}scanStop(){this._scanSubscription&&(this.codeReader?.getScannerControls().stop(),this._scanSubscription?.unsubscribe(),this._scanSubscription=void 0)}scanStart(){if(this._scanSubscription)throw new Error("There is already a scan process running.");if(!this._device)throw new Error("No device defined, cannot start scan, please define a device.");this.scanFromDevice(this._device.deviceId)}restart(){this._codeReader=void 0;const u=this._reset();u&&(this.device=u)}updateVideoInputDevices(){var u=this;return(0,B.A)(function*(){const w=(yield uf.listVideoInputDevices())||[],U=w&&w.length>0;return u.hasDevices.next(U),u.camerasFound.next([...w]),U||u.camerasNotFound.next(null),w})()}autostartScanner(u){var w=this;return(0,B.A)(function*(){const Y=u.find(({label:le})=>/back|tr\xe1s|rear|traseira|environment|ambiente/gi.test(le))||u.pop();if(!Y)throw new Error("Impossible to autostart, no input devices available.");yield w.setDevice(Y),w.deviceChange.next(Y)})()}dispatchScanSuccess(u){this.scanSuccess.next(u.getText())}dispatchScanFailure(u){this.scanFailure.next(u)}dispatchScanError(u){this.scanError.observed||(console.error(`zxing scanner component: ${u.name}`,u),console.warn("Use the `(scanError)` property to handle errors like this!")),this.scanError.next(u)}dispatchScanComplete(u){this.scanComplete.next(u)}handlePermissionException(u){let w;switch(console.error("@zxing/ngx-scanner","Error when asking for permission.",u),u.name){case"NotSupportedError":console.warn("@zxing/ngx-scanner",u.message),w=null,this.hasDevices.next(null);break;case"NotAllowedError":console.warn("@zxing/ngx-scanner",u.message),w=!1,this.hasDevices.next(!0);break;case"NotFoundError":console.warn("@zxing/ngx-scanner",u.message),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(u);break;case"NotReadableError":console.warn("@zxing/ngx-scanner","Couldn't read the device(s)'s stream, it's probably in use by another app."),w=null,this.hasDevices.next(!1),this.camerasNotFound.next(u);break;default:console.warn("@zxing/ngx-scanner","I was not able to define if I have permissions for camera or not.",u),w=null}return this.setPermission(w),this.permissionResponse.error(u),w}getBarcodeFormatOrFail(u){return"string"==typeof u?Do[u.trim().toUpperCase()]:u}getCodeReader(){return this._codeReader||(this._codeReader=new z1(this.hints,{delayBetweenScanAttempts:this.timeBetweenScans,delayBetweenScanSuccess:this.delayBetweenScanSuccess})),this._codeReader}scanFromDevice(u){var w=this;return(0,B.A)(function*(){const U=w.previewElemRef.nativeElement,Y=w.getCodeReader(),le=yield Y.scanFromDeviceObservable(u,U);if(!le)throw new Error("Undefined decoding stream, aborting.");if(w._scanSubscription=le.subscribe(Ot=>w._onDecodeResult(Ot.result,Ot.error),Ot=>w._onDecodeError(Ot),()=>{}),w._scanSubscription.closed)return;const _t=typeof Y.getScannerControls().switchTorch<"u";w.torchCompatible.next(_t)})()}_onDecodeError(u){this.dispatchScanError(u)}_onDecodeResult(u,w){u?this.dispatchScanSuccess(u):this.dispatchScanFailure(w),this.dispatchScanComplete(u)}_reset(){if(!this._codeReader)return;this.scanStop();try{uf.cleanVideoSource(this.previewElemRef.nativeElement)}catch{}try{uf.releaseAllStreams()}catch{}this._codeReader=void 0;const u=this._device;return this.device=void 0,u}reset(){this._reset(),this.deviceChange.emit(null)}setDevice(u){var w=this;return(0,B.A)(function*(){w.scanStop(),w._device=u||void 0,w._device||uf.cleanVideoSource(w.previewElemRef.nativeElement),w._enabled&&u&&(yield w.scanFromDevice(u.deviceId))})()}setPermission(u){this.hasPermission=u,this.permissionResponse.next(u)}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["zxing-scanner"]],viewQuery:function(w,U){if(1&w&&c.GBs(cp,7),2&w){let Y;c.mGM(Y=c.lsd())&&(U.previewElemRef=Y.first)}},inputs:{autofocusEnabled:"autofocusEnabled",timeBetweenScans:"timeBetweenScans",delayBetweenScanSuccess:"delayBetweenScanSuccess",autostart:"autostart",previewFitMode:"previewFitMode",poster:"poster",device:"device",formats:"formats",videoConstraints:"videoConstraints",torch:"torch",enable:"enable",tryHarder:"tryHarder"},outputs:{autostarted:"autostarted",autostarting:"autostarting",torchCompatible:"torchCompatible",scanSuccess:"scanSuccess",scanFailure:"scanFailure",scanError:"scanError",scanComplete:"scanComplete",camerasFound:"camerasFound",camerasNotFound:"camerasNotFound",permissionResponse:"permissionResponse",hasDevices:"hasDevices",deviceChange:"deviceChange"},decls:6,vars:3,consts:[["preview",""],[3,"poster"]],template:function(w,U){1&w&&(c.j41(0,"video",1,0)(2,"p"),c.EFF(3," Your browser does not support this feature, please try to upgrade it. "),c.k0s(),c.j41(4,"p"),c.EFF(5," Seu navegador n\xe3o suporta este recurso, por favor tente atualiz\xe1-lo. "),c.k0s()()),2&w&&(c.xc7("object-fit",U.previewFitMode),c.Y8G("poster",U.poster,c.B4B))},styles:["[_nghost-%COMP%]{display:block}video[_ngcontent-%COMP%]{width:100%;height:auto;object-fit:contain}"],changeDetection:0})}}return v})(),Qx=(()=>{class v{static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275mod=c.$C({type:v})}static{this.\u0275inj=c.G2t({imports:[R.MD,T.YN]})}}return v})(),bC=(()=>{class v{constructor(u,w){this.data=u,this.dialogRef=w}ngAfterViewInit(){}scanSuccessHandler(u){console.log("Scan success:",u),this.dialogRef.close(u)}scanErrorHandler(u){console.log("Scan success:",u)}scanFailureHandler(u){console.log("Scan success:",u)}scanCompleteHandler(u){console.log("Scan success:",u)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(j.Vh),c.rXU(j.CP))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-qrcode-scan-dialog"]],standalone:!0,features:[c.aNF],decls:9,vars:1,consts:[["mat-dialog-title",""],[1,"qr-scanner",3,"scanSuccess","scanError","scanFailure","scanComplete"],["mat-button","","mat-dialog-close",""],["mat-flat-button","","type","submit","cdkFocusInitial","",3,"mat-dialog-close"]],template:function(w,U){1&w&&(c.j41(0,"h2",0),c.EFF(1,"Scan QR Code"),c.k0s(),c.j41(2,"mat-dialog-content")(3,"zxing-scanner",1),c.bIt("scanSuccess",function(le){return U.scanSuccessHandler(le)})("scanError",function(le){return U.scanErrorHandler(le)})("scanFailure",function(le){return U.scanFailureHandler(le)})("scanComplete",function(le){return U.scanCompleteHandler(le)}),c.k0s()(),c.j41(4,"mat-dialog-actions")(5,"button",2),c.EFF(6,"Cancel"),c.k0s(),c.j41(7,"button",3),c.EFF(8,"Ok"),c.k0s()()),2&w&&(c.R7$(7),c.Y8G("mat-dialog-close",!0))},dependencies:[Qx,Dy,j.hM,j.tx,j.BI,j.E7,j.Yi,E.Hl,E.$z],styles:["[_nghost-%COMP%]{width:100vw;height:100vh}[_nghost-%COMP%] zxing-scanner[_ngcontent-%COMP%] {object-fit:contain}"]})}}return v})();var wC=f(82546),_C=f(63528),R_=f(43881);let K1=(()=>{class v{constructor(){}transform(u,...w){return u?v.time(u):"00:00:00"}static time(u){var w=Math.floor(u/60/60),U=Math.floor(u/60)-60*w,Y=u%60;return w.toString().padStart(2,"0")+":"+U.toString().padStart(2,"0")+":"+Y.toString().padStart(2,"0")}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275pipe=c.EJ8({name:"time",type:v,pure:!0,standalone:!0})}}return v})();const _M=v=>({miniplayer:v});function EM(v,a){if(1&v&&(c.j41(0,"div",1),c.EFF(1),c.k0s()),2&v){const u=c.XpG();c.R7$(),c.JRh(u.player.title())}}function L0(v,a){if(1&v){const u=c.RV6();c.j41(0,"div")(1,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.player.play())}),c.j41(2,"mat-icon"),c.EFF(3,"play_arrow"),c.k0s()()()}}function xM(v,a){if(1&v){const u=c.RV6();c.j41(0,"div")(1,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.player.pause())}),c.j41(2,"mat-icon"),c.EFF(3,"pause"),c.k0s()()()}}function SM(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",6)(1,"div",8),c.EFF(2),c.nI1(3,"time"),c.k0s(),c.j41(4,"div",9)(5,"mat-slider",10)(6,"input",11),c.mxI("ngModelChange",function(U){c.eBV(u);const Y=c.XpG();return c.DH7(Y.player.time,U)||(Y.player.time=U),c.Njj(U)}),c.k0s()()(),c.j41(7,"div",12),c.EFF(8),c.nI1(9,"time"),c.k0s()()}if(2&v){const u=c.XpG();c.R7$(2),c.JRh(c.bMT(3,7,u.player.time)),c.R7$(3),c.Y8G("displayWith",u.formatLabel)("max",u.player.duration)("min",0)("step",1),c.R7$(),c.R50("ngModel",u.player.time),c.R7$(2),c.JRh(c.bMT(9,9,u.player.duration))}}function qx(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",7)(1,"div")(2,"button",13)(3,"mat-icon"),c.EFF(4,"queue"),c.k0s()()(),c.j41(5,"div")(6,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.closeTray())}),c.j41(7,"mat-icon"),c.EFF(8,"close"),c.k0s()()()()}}let k_=(()=>{class v{constructor(u,w){this.renderer=u,this.el=w,this.miniplayer=!1,this.layout=(0,c.WQX)(S.Y),this.player=(0,c.WQX)(_C.x)}formatLabel(u){return K1.time(u)}closeTray(){this.layout.tray.set(!1)}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(c.sFG),c.rXU(c.aKT))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-player-controls"]],inputs:{miniplayer:"miniplayer"},standalone:!0,features:[c.aNF],decls:16,vars:7,consts:[[1,"player",3,"ngClass"],[1,"player-media"],[1,"player-controls"],[1,"player-controls-top"],["mat-icon-button","",1,"nodrag",3,"click"],["mat-icon-button","",3,"click"],[1,"player-controls-bottom"],[1,"player-actions"],[1,"media-timeline-1","hide-small2"],[1,"media-timeline-2"],["discrete","",1,"media-slider",3,"displayWith","max","min","step"],["matSliderThumb","",3,"ngModelChange","ngModel"],[1,"media-timeline-3","hide-small2"],["mat-icon-button",""]],template:function(w,U){1&w&&(c.j41(0,"div",0),c.DNE(1,EM,2,1,"div",1),c.j41(2,"div",2)(3,"div",3)(4,"div")(5,"button",4),c.bIt("click",function(){return U.player.previous()}),c.j41(6,"mat-icon"),c.EFF(7,"skip_previous"),c.k0s()()(),c.DNE(8,L0,4,0,"div")(9,xM,4,0,"div"),c.j41(10,"div")(11,"button",5),c.bIt("click",function(){return U.player.next()}),c.j41(12,"mat-icon"),c.EFF(13,"skip_next"),c.k0s()()()(),c.DNE(14,SM,10,11,"div",6),c.k0s(),c.DNE(15,qx,9,0,"div",7),c.k0s()),2&w&&(c.Y8G("ngClass",c.eq3(5,_M,U.miniplayer)),c.R7$(),c.vxM(U.miniplayer?-1:1),c.R7$(7),c.vxM(U.player.paused?8:9),c.R7$(6),c.vxM(U.miniplayer?-1:14),c.R7$(),c.vxM(U.miniplayer?-1:15))},dependencies:[K1,E.Hl,E.iY,M.m_,M.An,R.MD,R.YU,R_.Ez,R_.IV,R_.OU,k.fS,T.YN,T.me,T.BC,T.vS],styles:[".player[_ngcontent-%COMP%]{display:flex;flex-direction:row;padding:1em}.miniplayer[_ngcontent-%COMP%]{padding:0;margin:-4px;-webkit-app-region:drag}.player-media[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;align-items:center}.player-controls[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 50%;justify-content:center}.player-actions[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex:1 1 25%;justify-content:flex-end;align-items:center}.smaller[_ngcontent-%COMP%]{font-size:.8em}.player-controls-top[_ngcontent-%COMP%]{display:flex;justify-content:center}.player-controls-bottom[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;font-size:.8em}"]})}}return v})();var va=f(51889),eS=f(43794),Cy=f(71997);const Iy=["*"],Nm=v=>({"title-bar-collapsed":v}),B_=v=>({"sidenav-collapsed":v}),H1=()=>["/introduction"],F_=()=>["/settings","notifications"],lp=v=>["/profile",v],j0=v=>["/profile",v,"edit"],il=()=>["/notifications"],Hu=()=>["/settings"],vd=()=>["/accounts"],My=()=>["/account/create"],jo=v=>({"sidenav-scroll-wrapper-tray":v}),Qa=(v,a,u)=>({"sidenav-content":v,"sidenav-content-marginless":a,"sidenav-content-custom":u});function Ty(v,a){1&v&&c.nrm(0,"img",15)}function Da(v,a){if(1&v&&c.EFF(0),2&v){const u=c.XpG().$implicit;c.SpI(" ",u.title," ")}}function U0(v,a){if(1&v&&(c.j41(0,"a",16,5)(2,"mat-icon",18),c.EFF(3),c.k0s(),c.DNE(4,Da,1,1),c.k0s()),2&v){const u=a.$implicit,w=c.sdS(1),U=c.XpG();c.Y8G("routerLink",u.path)("activated",w.isActive),c.R7$(3),c.JRh(u.data.icon),c.R7$(),c.vxM(U.collapsed()?-1:4)}}function $0(v,a){1&v&&(c.j41(0,"mat-icon",18),c.EFF(1,"chevron_right"),c.k0s())}function EC(v,a){1&v&&(c.j41(0,"mat-icon",18),c.EFF(1,"chevron_left"),c.k0s())}function Py(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",44),c.bIt("click",function(){c.eBV(u),c.XpG();const U=c.sdS(5);return c.Njj(U.toggle())}),c.j41(1,"mat-icon",45),c.EFF(2,"menu"),c.k0s()()}}function Oy(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",26),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.navigateBack())}),c.j41(1,"mat-icon"),c.EFF(2,"arrow_back"),c.k0s()()}}function Ry(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",46),c.bIt("click",function(){const U=c.eBV(u).$implicit;return c.Njj(U.action())}),c.j41(1,"mat-icon"),c.EFF(2),c.k0s()()}if(2&v){const u=a.$implicit;c.Y8G("title",u.name),c.R7$(2),c.JRh(u.icon)}}function W1(v,a){if(1&v){const u=c.RV6();c.j41(0,"input",47),c.mxI("ngModelChange",function(U){c.eBV(u);const Y=c.XpG();return c.DH7(Y.layout.searchInput,U)||(Y.layout.searchInput=U),c.Njj(U)}),c.bIt("input",function(U){c.eBV(u);const Y=c.XpG();return c.Njj(Y.onSearchInput(U))}),c.k0s()}if(2&v){const u=c.XpG();c.R50("ngModel",u.layout.searchInput)}}function V0(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",26),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.qrScan())}),c.j41(1,"mat-icon"),c.EFF(2,"qr_code_scanner"),c.k0s()()}}function z0(v,a){1&v&&(c.j41(0,"mat-icon"),c.EFF(1,"close"),c.k0s())}function N_(v,a){1&v&&(c.j41(0,"mat-icon"),c.EFF(1,"search"),c.k0s())}function ky(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",48),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.applyUpdate())}),c.j41(1,"mat-icon"),c.EFF(2,"get_app"),c.k0s()()}}function K0(v,a){if(1&v&&(c.j41(0,"button",30)(1,"mat-icon"),c.EFF(2),c.k0s(),c.j41(3,"span"),c.EFF(4),c.k0s(),c.j41(5,"div",49),c.EFF(6),c.nI1(7,"ago"),c.k0s()()),2&v){const u=a.$implicit;c.Y8G("routerLink",c.lJ4(7,il)),c.R7$(2),c.JRh(u.data.icon),c.R7$(2),c.JRh(u.data.title),c.R7$(2),c.Lme("",u.data.app," (",c.bMT(7,5,"2024-08-22 12:00"),")")}}function By(v,a){if(1&v&&(c.EFF(0),c.nrm(1,"br")),2&v){const u=c.XpG();c.SpI(" ",u.identity.identity.metadata.name,"")}}function Lp(v,a){if(1&v&&(c.j41(0,"strong"),c.EFF(1),c.k0s()),2&v){const u=c.XpG().$implicit;c.R7$(),c.SpI("",u.metadata.name," *")}}function L_(v,a){if(1&v&&(c.j41(0,"span"),c.EFF(1),c.k0s()),2&v){const u=c.XpG().$implicit;c.R7$(),c.JRh(u.metadata.name)}}function tS(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",29),c.bIt("click",function(){const U=c.eBV(u).$implicit,Y=c.XpG();return c.Njj(Y.changeAccount(U.did.uri))}),c.j41(1,"mat-icon"),c.EFF(2,"account_circle"),c.k0s(),c.DNE(3,Lp,2,1,"strong")(4,L_,2,1,"span"),c.k0s()}if(2&v){const u=a.$implicit,w=c.XpG();c.R7$(3),c.vxM(u.did.uri===w.identity.did?3:4)}}function rS(v,a){1&v&&(c.j41(0,"div",43),c.nrm(1,"app-player-controls"),c.k0s())}let nS=(()=>{class v{constructor(){var u=this;this.breakpointObserver=(0,c.WQX)(Fr.QP),this.localStorage=(0,c.WQX)(_i.s),this.storage=(0,c.WQX)(eS.n),this.identity=(0,c.WQX)(g.K),this.updateService=(0,c.WQX)(Io),this.profileService=(0,c.WQX)(Ma.p),this.app=(0,c.WQX)(m.d),this.layout=(0,c.WQX)(S.Y),this.navigation=(0,c.WQX)(Tt.o),this.notification=(0,c.WQX)(wC.J),this.dialog=(0,c.WQX)(j.bZ),this.router=(0,c.WQX)(x.Ix),this.rootRoutes=he.filter(w=>w.path).filter(w=>w.data&&1!=w.data.hide),this.isHandset$=this.breakpointObserver.observe("(max-width: 700px)").pipe((0,Ct.T)(w=>w.matches),(0,bn.t)()),this.notifications=(0,c.vPA)([]),this.collapsed=(0,c.vPA)(!1),(0,c.QZP)((0,B.A)(function*(){u.app.initialized()&&(yield u.loadNotifications())}))}changeAccount(u){var w=this;return(0,B.A)(function*(){w.identity.changeAccount(u),w.router.navigate(["/introduction"])})()}loadNotifications(){var u=this;return(0,B.A)(function*(){const w=yield u.notification.load();u.notifications.set(w)})()}copyDID(u){var w=this;return(0,B.A)(function*(){try{yield navigator.clipboard.writeText(u),w.app.openSnackBar("Your DID copied to clipboard")}catch(U){console.error("Failed to copy: ",U)}})()}qrScan(){this.dialog.open(bC,{data:{did:""},width:"100vw",height:"100vh"}).afterClosed().subscribe(w=>{console.log("The dialog was closed",w),this.router.navigate(["/profile",w])})}onSearchInput(u){null!==u.target.value?(clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{console.log("Handle search called!"),this.handleSearch(u.target.value)},750)):clearTimeout(this.debounceTimer)}handleSearch(u){u&&(u.includes(":")?this.router.navigate(["/profile",u]):this.router.navigate(["/search"],{queryParams:{query:u}}))}showQR(u){this.dialog.open(va.k,{data:{did:u}})}wipe(){var u=this;return(0,B.A)(function*(){u.localStorage.clear(),console.log("Local storage data has been wiped!"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DID_RESOLVERCACHE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_DATASTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_EVENTLOG"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGEINDEX"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/DWN_MESSAGESTORE"),yield indexedDB.deleteDatabase("level-js-DATA/AGENT/VAULT_STORE"),console.log("Data has been wiped!"),window.location.reload()})()}applyUpdate(){this.updateService.applyUpdate()}lock(){this.identity.lock()}navigateBack(){this.navigation.back()}collapseToggle(){this.collapsed.set(!this.collapsed())}static{this.\u0275fac=function(w){return new(w||v)}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-layout"]],standalone:!0,features:[c.aNF],ngContentSelectors:Iy,decls:151,vars:68,consts:[["drawer",""],["menuNotifications","matMenu"],["menu","matMenu"],["menuAccounts","matMenu"],["menuLanguages","matMenu"],["link","routerLinkActive"],["id","title-bar",1,"title-bar",3,"ngClass"],["height","24","width","24","src","ariton-icon-dark.svg",1,"logo-icon-title-bar"],[3,"miniplayer"],["autosize","",1,"sidenav-container"],["fixedInViewport","",1,"sidenav",3,"ngClass","mode","opened"],[1,"toolbar-logo-container"],["src","ariton-icon-dark.svg",1,"toolbar-logo",3,"routerLink"],[1,"toolbar-text"],["srcset","ariton-text-light.svg","media","(prefers-color-scheme: dark)"],["src","ariton-text-dark.svg"],["mat-list-item","","routerLinkActive","",3,"routerLink","activated"],[3,"click"],["matListItemIcon",""],[1,"main-toolbar"],["type","button","aria-label","Toggle sidenav","mat-icon-button",""],["mat-icon-button",""],["mat-icon-button","",3,"title"],[1,"toolbar-spacer"],["type","search",1,"search-input",3,"ngModel"],[1,"toolbar-items"],["mat-icon-button","",3,"click"],["matTooltip","Update available. Click to update now.","mat-icon-button",""],["mat-icon-button","",1,"notification-toolbar",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"routerLink"],["mat-icon-button","",3,"matMenuTriggerFor"],[1,"account-menu-profile",3,"routerLink"],["onerror","this.src='/avatar-placeholder.png';this.onerror='';",1,"account-menu-profile-icon",3,"src"],["mat-menu-item","",1,"account-menu-item",3,"routerLink"],["mat-menu-item","",1,"account-menu-item",3,"click"],["mat-menu-item","",3,"matMenuTriggerFor"],["mat-menu-item","",1,"notification-menu",3,"routerLink"],["href","https://help.ariton.app","target","_blank","mat-menu-item",""],["mat-menu-item",""],["mat-menu-item","",3,"disabled"],[1,"sidenav-scroll-wrapper",3,"ngClass"],["id","sidenav-content",3,"ngClass"],[1,"player"],["type","button","aria-label","Toggle sidenav","mat-icon-button","",3,"click"],["aria-label","Side nav toggle icon"],["mat-icon-button","",3,"click","title"],["type","search",1,"search-input",3,"ngModelChange","input","ngModel"],["matTooltip","Update available. Click to update now.","mat-icon-button","",3,"click"],[1,"notification-details","dimmed"]],template:function(w,U){if(1&w){const Y=c.RV6();c.NAR(),c.j41(0,"div",6),c.nrm(1,"img",7)(2,"app-player-controls",8),c.k0s(),c.j41(3,"mat-sidenav-container",9)(4,"mat-sidenav",10,0),c.nI1(6,"async"),c.nI1(7,"async"),c.nI1(8,"async"),c.j41(9,"mat-toolbar",11),c.nrm(10,"img",12),c.j41(11,"picture",13),c.nrm(12,"source",14),c.DNE(13,Ty,1,0,"img",15),c.k0s()(),c.j41(14,"mat-nav-list"),c.Z7z(15,U0,5,4,"a",16,c.Vm6),c.j41(17,"mat-list-item",17),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.collapseToggle())}),c.DNE(18,$0,2,0,"mat-icon",18)(19,EC,2,0,"mat-icon",18),c.k0s()()(),c.j41(20,"mat-sidenav-content")(21,"mat-toolbar",19),c.DNE(22,Py,3,0,"button",20),c.nI1(23,"async"),c.DNE(24,Oy,3,0,"button",21),c.Z7z(25,Ry,3,2,"button",22,c.fX1),c.j41(27,"span",23),c.DNE(28,W1,1,1,"input",24),c.k0s(),c.j41(29,"span",25),c.DNE(30,V0,3,0,"button",21),c.j41(31,"button",26),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.layout.toggleSearch())}),c.DNE(32,z0,2,0,"mat-icon")(33,N_,2,0,"mat-icon"),c.k0s(),c.DNE(34,ky,3,0,"button",27),c.j41(35,"button",28)(36,"mat-icon"),c.EFF(37,"notifications"),c.k0s()(),c.j41(38,"mat-menu",null,1)(40,"button",29),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.wipe())}),c.j41(41,"mat-icon"),c.EFF(42,"delete"),c.k0s(),c.j41(43,"span"),c.EFF(44,"Reset All Data (Wipe)"),c.k0s()(),c.nrm(45,"mat-divider"),c.j41(46,"button",30)(47,"mat-icon"),c.EFF(48,"settings"),c.k0s(),c.j41(49,"span"),c.EFF(50,"Notification Settings"),c.k0s()(),c.nrm(51,"mat-divider"),c.Z7z(52,K0,8,8,"button",30,c.fX1),c.k0s(),c.j41(54,"button",31)(55,"mat-icon"),c.EFF(56,"account_circle"),c.k0s()(),c.j41(57,"mat-menu",null,2)(59,"div",32),c.nrm(60,"img",33),c.nI1(61,"safeResourceUrl"),c.j41(62,"div")(63,"h2"),c.EFF(64),c.k0s(),c.EFF(65),c.nrm(66,"br"),c.EFF(67),c.nI1(68,"did"),c.nrm(69,"br"),c.DNE(70,By,2,1,"br"),c.k0s()(),c.j41(71,"button",34)(72,"mat-icon"),c.EFF(73,"account_circle"),c.k0s(),c.j41(74,"span"),c.EFF(75,"Edit Profile"),c.k0s()(),c.j41(76,"button",35),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.copyDID(U.identity.did))}),c.j41(77,"mat-icon"),c.EFF(78,"content_copy"),c.k0s(),c.j41(79,"span"),c.EFF(80,"Copy DID"),c.k0s()(),c.j41(81,"button",29),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.showQR(U.identity.did))}),c.j41(82,"mat-icon"),c.EFF(83,"qr_code"),c.k0s(),c.j41(84,"span"),c.EFF(85,"Show QR"),c.k0s()(),c.nrm(86,"mat-divider"),c.j41(87,"button",36)(88,"mat-icon"),c.EFF(89,"switch_account"),c.k0s(),c.j41(90,"span"),c.EFF(91,"Accounts"),c.k0s()(),c.j41(92,"button",29),c.bIt("click",function(){return c.eBV(Y),c.Njj(U.lock())}),c.j41(93,"mat-icon"),c.EFF(94,"lock"),c.k0s(),c.j41(95,"span"),c.EFF(96,"Lock account"),c.k0s()(),c.nrm(97,"mat-divider"),c.j41(98,"button",36)(99,"mat-icon"),c.EFF(100,"translate"),c.k0s(),c.j41(101,"span"),c.EFF(102,"Language: English"),c.k0s()(),c.nrm(103,"mat-divider"),c.j41(104,"button",37)(105,"mat-icon"),c.EFF(106,"notifications"),c.k0s(),c.j41(107,"span"),c.EFF(108,"Notifications"),c.k0s()(),c.j41(109,"button",30)(110,"mat-icon"),c.EFF(111,"settings"),c.k0s(),c.j41(112,"span"),c.EFF(113,"Settings"),c.k0s()(),c.nrm(114,"mat-divider"),c.j41(115,"a",38)(116,"mat-icon"),c.EFF(117,"help"),c.k0s(),c.j41(118,"span"),c.EFF(119,"Help"),c.k0s()()(),c.j41(120,"mat-menu",null,3)(122,"button",30)(123,"mat-icon"),c.EFF(124,"manage_accounts"),c.k0s(),c.j41(125,"span"),c.EFF(126,"Manage Accounts"),c.k0s()(),c.nrm(127,"mat-divider"),c.Z7z(128,tS,5,1,"button",39,c.fX1),c.nrm(130,"mat-divider"),c.j41(131,"button",30)(132,"mat-icon"),c.EFF(133,"person_add"),c.k0s(),c.j41(134,"span"),c.EFF(135,"Add account"),c.k0s()()(),c.j41(136,"mat-menu",null,4)(138,"button",39)(139,"span"),c.EFF(140,"English"),c.k0s()(),c.j41(141,"button",40)(142,"span"),c.EFF(143,"Norwegian"),c.k0s()(),c.j41(144,"button",40)(145,"span"),c.EFF(146,"Serbian"),c.k0s()()()()(),c.j41(147,"div",41)(148,"div",42),c.SdG(149),c.k0s()(),c.DNE(150,rS,2,0,"div",43),c.k0s()()}if(2&w){const Y=c.sdS(39),le=c.sdS(58),ge=c.sdS(121),Pe=c.sdS(137);c.Y8G("ngClass",c.eq3(48,Nm,U.collapsed())),c.R7$(2),c.Y8G("miniplayer",!0),c.R7$(2),c.Y8G("ngClass",c.eq3(50,B_,U.collapsed()))("mode",c.bMT(6,36,U.isHandset$)?"over":"side")("opened",!1===c.bMT(7,38,U.isHandset$)),c.BMQ("role",c.bMT(8,40,U.isHandset$)?"dialog":"navigation"),c.R7$(6),c.Y8G("routerLink",c.lJ4(52,H1)),c.R7$(3),c.vxM(U.collapsed()?-1:13),c.R7$(2),c.Dyx(U.rootRoutes),c.R7$(3),c.vxM(U.collapsed()?18:19),c.R7$(4),c.vxM(c.bMT(23,42,U.isHandset$)?22:-1),c.R7$(2),c.vxM(U.layout.navigation()?24:-1),c.R7$(),c.Dyx(U.layout.actions()),c.R7$(3),c.vxM(U.layout.search()?28:-1),c.R7$(2),c.vxM(U.layout.search()?30:-1),c.R7$(2),c.vxM(U.layout.search()?32:33),c.R7$(2),c.vxM(U.updateService.isNewVersionAvailable?34:-1),c.R7$(),c.Y8G("matMenuTriggerFor",Y),c.R7$(11),c.Y8G("routerLink",c.lJ4(53,F_)),c.R7$(6),c.Dyx(U.notifications()),c.R7$(2),c.Y8G("matMenuTriggerFor",le),c.R7$(5),c.Y8G("routerLink",c.eq3(54,lp,U.identity.did)),c.R7$(),c.Y8G("src",c.bMT(61,44,U.profileService.avatar()),c.B4B),c.R7$(4),c.JRh(U.profileService.current().name),c.R7$(),c.SpI(" ",U.profileService.current().title,""),c.R7$(2),c.SpI(" ",c.bMT(68,46,U.identity.did),""),c.R7$(3),c.vxM(U.identity.identity?70:-1),c.R7$(),c.Y8G("routerLink",c.eq3(56,j0,U.identity.did)),c.R7$(16),c.Y8G("matMenuTriggerFor",ge),c.R7$(11),c.Y8G("matMenuTriggerFor",Pe),c.R7$(6),c.Y8G("routerLink",c.lJ4(58,il)),c.R7$(5),c.Y8G("routerLink",c.lJ4(59,Hu)),c.R7$(13),c.Y8G("routerLink",c.lJ4(60,vd)),c.R7$(6),c.Dyx(U.identity.identities),c.R7$(3),c.Y8G("routerLink",c.lJ4(61,My)),c.R7$(10),c.Y8G("disabled",!0),c.R7$(3),c.Y8G("disabled",!0),c.R7$(3),c.Y8G("ngClass",c.eq3(62,jo,U.layout.tray())),c.R7$(),c.Y8G("ngClass",c.sMw(64,Qa,U.layout.margin(),!U.layout.margin(),U.layout.custom())),c.R7$(2),c.vxM(U.layout.tray()?150:-1)}},dependencies:[j.hM,Qx,T.YN,T.me,T.BC,T.vS,V.RG,k.fS,R.MD,R.YU,R.Jj,Rs.d,Qe.s5,Qe.KQ,E.Hl,E.iY,pn,hr,Or,Yt,q.Fg,q._L,q.YE,q.ZV,Cy.q,M.m_,M.An,K.Cn,K.kk,K.fb,K.Cp,x.Wk,x.wQ,W.uc,W.oV,Mo.k,ne.g,k_],styles:[".toolbar-logo[_ngcontent-%COMP%]{max-height:40px;max-width:40px;width:100%;cursor:pointer}.player[_ngcontent-%COMP%]{height:96px}.account-menu-profile[_ngcontent-%COMP%]{color:var(--mat-menu-item-label-text-color);display:flex;gap:8px;margin:8px;align-items:center;cursor:pointer}.account-menu-profile[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;padding:0}.account-menu-profile-icon[_ngcontent-%COMP%]{width:64px;border-radius:50%}.account-menu-profile[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{flex-grow:2}.toolbar-text[_ngcontent-%COMP%]{margin-left:.3em;margin-top:.5em;width:100px;height:32px}.sidenav-container[_ngcontent-%COMP%]{height:100%}.mat-toolbar.mat-primary[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1}.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 80px - env(titlebar-area-height,0px));overflow:auto;border-radius:16px;box-sizing:border-box}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 192px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%], .sidenav-content-marginless[_ngcontent-%COMP%]{max-height:100%;overflow-y:auto;padding:16px;box-sizing:border-box}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}.sidenav-content-custom[_ngcontent-%COMP%]{height:100%;overflow:hidden!important}.column-content[_ngcontent-%COMP%]{overflow-y:scroll;box-sizing:border-box}.sidenav[_ngcontent-%COMP%]{width:200px;padding:0 8px;box-sizing:border-box}.sidenav-collapsed[_ngcontent-%COMP%]{width:72px}@media (max-width: 959.98px){.sidenav-scroll-wrapper[_ngcontent-%COMP%]{height:calc(100dvh - 64px - env(titlebar-area-height,0px))}.sidenav-scroll-wrapper-tray[_ngcontent-%COMP%]{height:calc(100dvh - 160px - env(titlebar-area-height,0px))}.sidenav-content[_ngcontent-%COMP%]{padding:8px}.sidenav-content-marginless[_ngcontent-%COMP%]{padding:0}}.notification-menu[_ngcontent-%COMP%]{display:none}@media (max-width: 420px){.notification-toolbar[_ngcontent-%COMP%]{display:none}.notification-menu[_ngcontent-%COMP%]{display:block}}.title-bar[_ngcontent-%COMP%]{display:none}@media (display-mode: window-controls-overlay){.title-bar[_ngcontent-%COMP%]{-webkit-app-region:drag;flex:0 0 33px;display:flex;flex-direction:row;position:fixed;left:210px;top:env(titlebar-area-y,0);height:env(titlebar-area-height,33px);width:env(titlebar-area-width,100%);width:calc(env(titlebar-area-width,100%) - 210px);z-index:10000}mat-sidenav-content[_ngcontent-%COMP%]{padding-top:env(titlebar-area-height,0px)}}.title-bar-collapsed[_ngcontent-%COMP%]{left:80px!important;width:calc(env(titlebar-area-width,100%) - 80px)}.toolbar-logo-container[_ngcontent-%COMP%]{-webkit-app-region:drag}.logo-icon[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin-right:.4em}.logo-icon-title-bar[_ngcontent-%COMP%]{cursor:pointer;-webkit-app-region:drag;margin:4px 2em 4px 4px;display:none;flex:0 0 24px}@media screen and (max-height: 100px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}.logo-icon[_ngcontent-%COMP%]{display:none}.title-bar[_ngcontent-%COMP%]{left:0!important}.sidenav[_ngcontent-%COMP%], .main-toolbar[_ngcontent-%COMP%], mat-sidenav-content[_ngcontent-%COMP%]{display:none!important}}@media screen and (max-width: 599px){.logo-icon-title-bar[_ngcontent-%COMP%]{display:inline}}"]})}}return v})();var H0=f(9183);function W0(v,a){1&v&&c.nrm(0,"mat-spinner",4)}function Lm(v,a){1&v&&(c.j41(0,"span"),c.EFF(1,"Unlock"),c.k0s())}function j_(v,a){1&v&&(c.j41(0,"mat-error"),c.EFF(1,"Password is "),c.j41(2,"strong"),c.EFF(3,"invalid"),c.k0s()())}let xC=(()=>{class v{constructor(u){this.identityService=u,this.passwordInput=new T.MJ("",T.k0.required),this.unlocking=(0,c.vPA)(!1),this.invalidPassword=(0,c.vPA)(!1)}onSubmit(){var u=this;return(0,B.A)(function*(){u.unlocking.set(!0),(yield u.identityService.unlock(u.identityService.did,u.passwordInput.value))?(console.log("Vault unlocked"),u.invalidPassword.set(!1)):(console.log("Failed to unlock vault"),u.invalidPassword.set(!0)),u.unlocking.set(!1)})()}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(g.K))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-unlock"]],standalone:!0,features:[c.aNF],decls:18,vars:4,consts:[["src","ariton-icon-dark.svg",1,"unlock-logo"],[3,"ngSubmit"],["matInput","","type","password",3,"formControl"],["mat-flat-button","","type","submit","color","primary",3,"disabled"],["diameter","20"]],template:function(w,U){1&w&&(c.nrm(0,"img",0),c.j41(1,"h1"),c.EFF(2,"Unlock your account"),c.k0s(),c.j41(3,"p"),c.EFF(4,"You have configured your Ariton account with a secure personal password."),c.nrm(5,"br"),c.EFF(6,"Enter password to unlock your account."),c.k0s(),c.j41(7,"form",1),c.bIt("ngSubmit",function(){return U.onSubmit()}),c.j41(8,"mat-form-field")(9,"mat-label"),c.EFF(10,"Enter your password"),c.k0s(),c.nrm(11,"input",2),c.k0s(),c.EFF(12," \xa0 "),c.j41(13,"button",3),c.DNE(14,W0,1,0,"mat-spinner",4)(15,Lm,2,0,"span"),c.k0s(),c.j41(16,"p"),c.DNE(17,j_,4,0,"mat-error"),c.k0s()()),2&w&&(c.R7$(11),c.Y8G("formControl",U.passwordInput),c.R7$(2),c.Y8G("disabled",!(U.passwordInput.valid&&!U.unlocking())),c.R7$(),c.vxM(U.unlocking()?14:15),c.R7$(3),c.vxM(U.invalidPassword()?17:-1))},dependencies:[T.YN,T.qT,T.me,T.BC,T.cb,T.cV,H0.D6,H0.LG,T.X1,T.l_,V.RG,V.rl,V.nJ,V.TL,k.fS,k.fg,E.Hl,E.$z,M.m_],styles:["button[_ngcontent-%COMP%]{width:100px}.unlock-logo[_ngcontent-%COMP%]{max-width:200px}"]})}}return v})();var SC=f(33065);function G1(v,a){1&v&&(c.j41(0,"p"),c.EFF(1,"Starting Ariton..."),c.k0s())}function U_(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",7),c.bIt("click",function(){c.eBV(u);const U=c.XpG(3);return c.Njj(U.back())}),c.EFF(1,"Back"),c.k0s()}if(2&v){const u=c.XpG(3);c.Y8G("disabled",u.appService.loading())}}function jp(v,a){if(1&v){const u=c.RV6();c.j41(0,"button",8),c.bIt("click",function(){c.eBV(u);const U=c.XpG(3);return c.Njj(U.createAccount())}),c.EFF(1,"Create a new account"),c.k0s(),c.j41(2,"button",7),c.bIt("click",function(){c.eBV(u);const U=c.XpG(3);return c.Njj(U.restoreAccount())}),c.EFF(3,"Restore existing account"),c.k0s()}if(2&v){const u=c.XpG(3);c.Y8G("disabled",u.appService.loading()),c.R7$(2),c.Y8G("disabled",u.appService.loading())}}function $_(v,a){1&v&&c.nrm(0,"app-restore")}function V_(v,a){if(1&v&&(c.j41(0,"div",2),c.DNE(1,U_,2,1,"button",6)(2,jp,4,2)(3,$_,1,0,"app-restore"),c.k0s()),2&v){const u=c.XpG(2);c.R7$(),c.vxM(u.restore()?1:2),c.R7$(2),c.vxM(u.restore()?3:-1)}}function X1(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",3),c.nrm(1,"app-unlock"),c.j41(2,"p"),c.EFF(3,"Issues? "),c.j41(4,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.forceClose())}),c.EFF(5,"Close loading sceen"),c.k0s()()()}}function iS(v,a){1&v&&(c.j41(0,"p"),c.EFF(1,"Starting Ariton..."),c.k0s())}function Z1(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",4)(1,"h1"),c.EFF(2,"Error during initialization. Offline?"),c.k0s(),c.j41(3,"p"),c.EFF(4,"You must be online to create your account."),c.nrm(5,"br"),c.EFF(6,"Please verify network connection and try again."),c.k0s(),c.j41(7,"p")(8,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG(2);return c.Njj(U.reload())}),c.EFF(9,"Reload"),c.k0s()()()}}function z_(v,a){1&v&&c.nrm(0,"mat-spinner")}function J1(v,a){if(1&v){const u=c.RV6();c.j41(0,"div",0),c.nrm(1,"img",1),c.DNE(2,G1,2,0,"p")(3,V_,4,2,"div",2)(4,X1,6,0,"div",3)(5,iS,2,0,"p")(6,Z1,10,0,"div",4)(7,z_,1,0,"mat-spinner"),c.j41(8,"p"),c.EFF(9,"Issues? "),c.j41(10,"button",5),c.bIt("click",function(){c.eBV(u);const U=c.XpG();return c.Njj(U.forceClose())}),c.EFF(11,"Close loading sceen"),c.k0s()()()}if(2&v){let u;const w=c.XpG();c.R7$(2),c.vxM(0===(u=w.appService.onboardingState())?2:1===u?3:2===u?4:3===u?5:4===u?6:-1),c.R7$(5),c.vxM(w.appService.loading()?7:-1)}}(0,i.B8)((()=>{class v{constructor(u,w,U){this.router=u,this.layout=w,this.identityService=U,this.title="app",this.appService=(0,c.WQX)(m.d),this.previousUrl="",this.restore=(0,c.vPA)(!1);const Y=globalThis.location.search;if(Y){const le=Object.fromEntries(new URLSearchParams(Y));this.appService.params=le}console.log("queryParam:",Y),console.log("this.appService.params:",this.appService.params),(0,c.QZP)(()=>{this.appService.initialized()&&console.log("App has been initialized!!!!")})}forceClose(){this.appService.onboardingState.set(m.f.Unlocked),this.appService.initialized.set(!0)}restoreAccount(){var u=this;return(0,B.A)(function*(){u.restore.set(!0)})()}back(){this.restore.set(!1)}createAccount(){var u=this;return(0,B.A)(function*(){console.log("Creating new account..."),yield u.appService.createAccount(),u.router.navigate([u.appService.state().loginAction])})()}reload(){document.location=document.location}ngOnInit(){var u=this;return(0,B.A)(function*(){yield u.appService.initialize()})()}static{this.\u0275fac=function(w){return new(w||v)(c.rXU(x.Ix),c.rXU(S.Y),c.rXU(g.K))}}static{this.\u0275cmp=c.VBU({type:v,selectors:[["app-root"]],standalone:!0,features:[c.Jv_([{provide:V.U$,useValue:{appearance:"outline"}}]),c.aNF],decls:3,vars:1,consts:[[1,"loading-container"],["src","ariton-icon-dark.svg",1,"loading-logo"],[1,"new-user-actions"],[1,"unlock-container"],[1,"loading-error"],["mat-button","",3,"click"],["mat-button","",3,"disabled"],["mat-button","",3,"click","disabled"],["mat-flat-button","",3,"click","disabled"]],template:function(w,U){1&w&&(c.DNE(0,J1,12,2,"div",0),c.j41(1,"app-layout"),c.nrm(2,"router-outlet"),c.k0s()),2&w&&c.vxM(U.appService.initialized()?-1:0)},dependencies:[SC.RestoreComponent,E.Hl,E.$z,H0.D6,H0.LG,x.n3,nS,xC],styles:[".unlock-container[_ngcontent-%COMP%]{background-color:var(--mat-app-background-color);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1000;display:flex;justify-content:center;align-items:center;align-content:center;text-align:center}.loading-container[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);color:var(--mat-app-text-color);padding:2em;position:absolute;box-sizing:border-box;width:100%;inset:0;z-index:1001;display:flex;flex-direction:column;align-items:center;justify-content:center}.loading-logo[_ngcontent-%COMP%]{max-width:96px;position:absolute;right:1em;bottom:1em}mat-spinner[_ngcontent-%COMP%]{margin:2em}.new-user-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-right:1em;margin-bottom:1em}"]})}}return v})(),ur).catch(v=>console.error(v))},49245:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://anyone-collaborate-protocol.xyz",published:!0,types:{doc:{}},structure:{doc:{$actions:[{who:"anyone",can:["read","co-update","co-delete"]}]}}}},62060:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/chat",published:!0,types:{message:{schema:"https://schema.ariton.app/chat/message",dataFormats:["application/json"]}},structure:{message:{$actions:[{who:"anyone",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]}}}},77949:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/community",published:!0,types:{community:{schema:"https://schema.ariton.app/community/schema/community",dataFormats:["application/json"]},album:{schema:"https://schema.ariton.app/community/schema/album",dataFormats:["text/plain"]},photo:{schema:"https://schema.ariton.app/community/schema/photo",dataFormats:["text/plain"]},friend:{schema:"https://schema.ariton.app/community/schema/friend",dataFormats:["text/plain"]},participant:{schema:"https://schema.ariton.app/community/schema/participant",dataFormats:["text/plain"]},updater:{schema:"https://schema.ariton.app/community/schema/updater",dataFormats:["text/plain"]},globalAdmin:{schema:"https://schema.ariton.app/community/schema/globalAdmin",dataFormats:["application/json"]},admin:{schema:"https://schema.ariton.app/community/schema/admin",dataFormats:["application/json"]}},structure:{globalAdmin:{$role:!0},friend:{$role:!0},community:{$actions:[{role:"globalAdmin",can:["create","update"]}],admin:{$role:!0,$actions:[{role:"globalAdmin",can:["create","update"]}]}}}}},68530:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/connections",published:!0,types:{request:{schema:"https://schema.ariton.app/connections/schema/request",dataFormats:["application/json"]},connection:{schema:"https://schema.ariton.app/connections/schema/connection",dataFormats:["application/json"]},block:{schema:"https://schema.ariton.app/connect/schema/block",dataFormats:["application/json"]}},structure:{block:{},connection:{},request:{$size:{max:3e3},$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},32794:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/data",published:!0,types:{data:{schema:"https://schema.ariton.app/data/schema/data",dataFormats:["application/json"]}},structure:{data:{}}}},97372:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/file",published:!0,types:{entry:{schema:"https://schema.ariton.app/file/schema/entry"},collaborator:{schema:"https://schema.ariton.app/file/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},67136:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://free-for-all-protocol.xyz",published:!0,types:{post:{schema:"eph",dataFormats:["application/json"]},attachment:{}},structure:{post:{$actions:[{who:"anyone",can:["create","update","delete","prune","read","co-delete","co-prune"]}],attachment:{$actions:[{who:"anyone",can:["create","update","delete","read","co-delete"]}]}}}}},22312:(Me,F,f)=>{"use strict";f.d(F,{Aq:()=>T,ME:()=>g,eE:()=>S,iU:()=>E,u5:()=>R});var i=f(4053),c=f(77949),B=(f(45189),f(2685)),m=f(69371);const S={format:"application/vc+jwt",friendship:"FriendshipCredential"},g={uri:i.Q.protocol,definition:i.Q},R={uri:B.Q.protocol,definition:B.Q},T={uri:c.Q.protocol,definition:c.Q},E={uri:m.Q.protocol,definition:m.Q}},69371:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/message",published:!0,types:{message:{schema:"https://schema.ariton.app/message/schema/message",dataFormats:["application/json"]},writer:{schema:"https://schema.ariton.app/message/schema/writer",dataFormats:["application/json"]},request:{schema:"https://schema.ariton.app/message/schema/request",dataFormats:["application/json"]},credential:{schema:"https://schema.ariton.app/message/schema/credential",dataFormats:["application/json"]}},structure:{writer:{$role:!0},message:{$actions:[{role:"writer",can:["create","update"]},{who:"author",of:"message",can:["read"]},{who:"recipient",of:"message",can:["read"]}]},request:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]},credential:{$actions:[{who:"anyone",can:["create","update","delete"]},{who:"author",of:"request",can:["read","create","delete"]},{who:"recipient",of:"request",can:["read","create","delete","co-delete"]}]}}}},1639:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"http://minimal.xyz",published:!1,types:{foo:{}},structure:{foo:{}}}},69314:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/note",published:!0,types:{note:{schema:"https://schema.ariton.app/note/schema/note",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/note/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},note:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}},5397:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/notification",published:!0,types:{event:{schema:"https://schema.ariton.app/notification/schema/event",dataFormats:["application/json"]}},structure:{event:{}}}},29508:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/post",published:!0,types:{post:{schema:"https://schema.ariton.app/post/schema/post",dataFormats:["application/json"]}},structure:{post:{}}}},4053:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/profile",types:{profile:{schema:"https://schema.ariton.app/profile/schema/profile",dataFormats:["application/json"]},bio:{dataFormats:["application/json"]},status:{dataFormats:["application/json"]},location:{dataFormats:["application/json"]},birthDate:{dataFormats:["application/json"]},social:{dataFormats:["application/json"]},messaging:{dataFormats:["application/json"]},phone:{dataFormats:["application/json"]},address:{dataFormats:["application/json"]},career:{dataFormats:["application/json"]},payment:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]}},structure:{profile:{$actions:[{who:"anyone",can:["read"]}]},bio:{},status:{},location:{},birthDate:{},social:{},career:{},avatar:{$actions:[{who:"anyone",can:["read"]}]},hero:{$actions:[{who:"anyone",can:["read"]}]},messaging:{},address:{},phone:{},payment:{}}}},2685:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={published:!0,protocol:"https://schema.ariton.app/registry/entry",types:{profile:{dataFormats:["application/json"]},avatar:{dataFormats:["image/gif","image/png","image/jpeg"]},hero:{dataFormats:["image/gif","image/png","image/jpeg"]}},structure:{profile:{},avatar:{},hero:{}}}},45189:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://social-media.xyz",published:!0,types:{post:{schema:"https://social-media.xyz/schemas/postSchema",dataFormats:["text/plain"]},reply:{schema:"https://social-media.xyz/schemas/replySchema",dataFormats:["text/plain"]},image:{dataFormats:["image/jpeg"]},caption:{schema:"https://social-media.xyz/schemas/captionSchema",dataFormats:["text/plain"]}},structure:{post:{$actions:[{who:"anyone",can:["create","read"]}],reply:{$actions:[{who:"recipient",of:"post",can:["create"]},{who:"author",of:"post",can:["create"]}]}},image:{$actions:[{who:"anyone",can:["create","read"]}],caption:{$actions:[{who:"anyone",can:["read"]},{who:"author",of:"image",can:["create"]}]},reply:{$actions:[{who:"author",of:"image",can:["read"]},{who:"recipient",of:"image",can:["create"]}]}}}}},50963:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/task",published:!0,types:{list:{schema:"https://schema.ariton.app/task/list",dataFormats:["application/json"]},task:{schema:"https://schema.ariton.app/task/task",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/task/collaborator",dataFormats:["application/json"]}},structure:{list:{collaborator:{$role:!0},$actions:[{role:"list/collaborator",can:["read","query","subscribe"]}],task:{$actions:[{role:"list/collaborator",can:["create","read","update","query","subscribe","co-update","co-delete"]}]}}}}},70669:(Me,F,f)=>{"use strict";f.d(F,{Q:()=>i});const i={protocol:"https://schema.ariton.app/text",published:!0,types:{entry:{schema:"https://schema.ariton.app/text/schema/entry",dataFormats:["application/json"]},collaborator:{schema:"https://schema.ariton.app/text/schema/collaborator",dataFormats:["application/json"]}},structure:{collaborator:{$role:!0},entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}],entry:{$actions:[{role:"collaborator",can:["create","update","read","delete","query","subscribe"]}]}}}}}}},4521:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createCurve=F.getHash=void 0;const i=f(44882),c=f(96492),x=f(73040);function B(S){return{hash:S,hmac:(g,..._)=>(0,i.hmac)(S,g,(0,c.concatBytes)(..._)),randomBytes:c.randomBytes}}F.getHash=B,F.createCurve=function m(S,g){const _=R=>(0,x.weierstrass)({...S,...B(R)});return Object.freeze({..._(g),create:_})}},25299:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateBasic=F.wNAF=void 0;const i=f(63834),c=f(84097),x=BigInt(0),B=BigInt(1);F.wNAF=function m(g,_){const R=(E,j)=>{const M=j.negate();return E?M:j},T=E=>({windows:Math.ceil(_/E)+1,windowSize:2**(E-1)});return{constTimeNegate:R,unsafeLadder(E,j){let M=g.ZERO,k=E;for(;j>x;)j&B&&(M=M.add(k)),k=k.double(),j>>=B;return M},precomputeWindow(E,j){const{windows:M,windowSize:k}=T(j),K=[];let W=E,V=W;for(let Z=0;Z>=ne,ae>K&&(ae-=q,M+=B);const me=ie,ye=ie+Math.abs(ae)-1,$=ae<0;0===ae?V=V.add(R(te%2!=0,j[me])):W=W.add(R($,j[ye]))}return{p:W,f:V}},wNAFCached(E,j,M,k){const K=E._WINDOW_SIZE||1;let W=j.get(E);return W||(W=this.precomputeWindow(E,K),1!==K&&j.set(E,k(W))),this.wNAF(K,W,M)}}},F.validateBasic=function S(g){return(0,i.validateField)(g.Fp),(0,c.validateObject)(g,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,i.nLength)(g.n,g.nBitLength),...g,p:g.Fp.ORDER})}},45068:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.twistedEdwards=void 0;const i=f(63834),c=f(84097),x=f(84097),B=f(25299),m=BigInt(0),S=BigInt(1),g=BigInt(2),_=BigInt(8),R={zip215:!0};F.twistedEdwards=function E(j){const M=function T(j){const M=(0,B.validateBasic)(j);return c.validateObject(j,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...M})}(j),{Fp:k,n:K,prehash:W,hash:V,randomBytes:Z,nByteLength:q,h:ne}=M,te=g<{try{return{isValid:!0,value:k.sqrt(Ce*k.inv(Xe))}}catch{return{isValid:!1,value:m}}}),me=M.adjustScalarBytes||(Ce=>Ce),ye=M.domain||((Ce,Xe,Te)=>{if(Xe.length||Te)throw new Error("Contexts/pre-hash are not supported");return Ce}),ue=Ce=>"bigint"==typeof Ce&&mue(Ce)&&ue(Xe)&&CeCe===m||$(Ce,te);function h(Ce,Xe){if($(Ce,Xe))return Ce;throw new Error(`Expected valid scalar < ${Xe}, got ${typeof Ce} ${Ce}`)}function A(Ce){return Ce===m?Ce:h(Ce,K)}const C=new Map;function O(Ce){if(!(Ce instanceof z))throw new Error("ExtendedPoint expected")}class z{constructor(Xe,Te,ke,Se){if(this.ex=Xe,this.ey=Te,this.ez=ke,this.et=Se,!o(Xe))throw new Error("x required");if(!o(Te))throw new Error("y required");if(!o(ke))throw new Error("z required");if(!o(Se))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Xe){if(Xe instanceof z)throw new Error("extended point not allowed");const{x:Te,y:ke}=Xe||{};if(!o(Te)||!o(ke))throw new Error("invalid affine point");return new z(Te,ke,S,ie(Te*ke))}static normalizeZ(Xe){const Te=k.invertBatch(Xe.map(ke=>ke.ez));return Xe.map((ke,Se)=>ke.toAffine(Te[Se])).map(z.fromAffine)}_setWindowSize(Xe){this._WINDOW_SIZE=Xe,C.delete(this)}assertValidity(){const{a:Xe,d:Te}=M;if(this.is0())throw new Error("bad point: ZERO");const{ex:ke,ey:Se,ez:Ee,et:ve}=this,De=ie(ke*ke),Re=ie(Se*Se),Je=ie(Ee*Ee),$e=ie(Je*Je),nt=ie(De*Xe);if(ie(Je*ie(nt+Re))!==ie($e+ie(Te*ie(De*Re))))throw new Error("bad point: equation left != right (1)");if(ie(ke*Se)!==ie(Ee*ve))throw new Error("bad point: equation left != right (2)")}equals(Xe){O(Xe);const{ex:Te,ey:ke,ez:Se}=this,{ex:Ee,ey:ve,ez:De}=Xe,Re=ie(Te*De),Je=ie(Ee*Se),$e=ie(ke*De),nt=ie(ve*Se);return Re===Je&&$e===nt}is0(){return this.equals(z.ZERO)}negate(){return new z(ie(-this.ex),this.ey,this.ez,ie(-this.et))}double(){const{a:Xe}=M,{ex:Te,ey:ke,ez:Se}=this,Ee=ie(Te*Te),ve=ie(ke*ke),De=ie(g*ie(Se*Se)),Re=ie(Xe*Ee),Je=Te+ke,$e=ie(ie(Je*Je)-Ee-ve),nt=Re+ve,Qe=nt-De,Tt=Re-ve,ct=ie($e*Qe),ze=ie(nt*Tt),St=ie($e*Tt),re=ie(Qe*nt);return new z(ct,ze,re,St)}add(Xe){O(Xe);const{a:Te,d:ke}=M,{ex:Se,ey:Ee,ez:ve,et:De}=this,{ex:Re,ey:Je,ez:$e,et:nt}=Xe;if(Te===BigInt(-1)){const ot=ie((Ee-Se)*(Je+Re)),Ft=ie((Ee+Se)*(Je-Re)),wt=ie(Ft-ot);if(wt===m)return this.double();const zt=ie(ve*g*nt),rr=ie(De*g*$e),ar=rr+zt,lr=Ft+ot,hn=rr-zt,Wr=ie(ar*wt),vr=ie(lr*hn),Tr=ie(ar*hn),Ve=ie(wt*lr);return new z(Wr,vr,Ve,Tr)}const Qe=ie(Se*Re),Tt=ie(Ee*Je),ct=ie(De*ke*nt),ze=ie(ve*$e),St=ie((Se+Ee)*(Re+Je)-Qe-Tt),re=ze-ct,X=ze+ct,G=ie(Tt-Te*Qe),he=ie(St*re),_e=ie(X*G),je=ie(St*G),Ne=ie(re*X);return new z(he,_e,Ne,je)}subtract(Xe){return this.add(Xe.negate())}wNAF(Xe){return s.wNAFCached(this,C,Xe,z.normalizeZ)}multiply(Xe){const{p:Te,f:ke}=this.wNAF(h(Xe,K));return z.normalizeZ([Te,ke])[0]}multiplyUnsafe(Xe){let Te=A(Xe);return Te===m?I:this.equals(I)||Te===S?this:this.equals(H)?this.wNAF(Te).p:s.unsafeLadder(this,Te)}isSmallOrder(){return this.multiplyUnsafe(ne).is0()}isTorsionFree(){return s.unsafeLadder(this,K).is0()}toAffine(Xe){const{ex:Te,ey:ke,ez:Se}=this,Ee=this.is0();null==Xe&&(Xe=Ee?_:k.inv(Se));const ve=ie(Te*Xe),De=ie(ke*Xe),Re=ie(Se*Xe);if(Ee)return{x:m,y:S};if(Re!==S)throw new Error("invZ was invalid");return{x:ve,y:De}}clearCofactor(){const{h:Xe}=M;return Xe===S?this:this.multiplyUnsafe(Xe)}static fromHex(Xe,Te=!1){const{d:ke,a:Se}=M,Ee=k.BYTES,ve=(Xe=(0,x.ensureBytes)("pointHex",Xe,Ee)).slice(),De=Xe[Ee-1];ve[Ee-1]=-129&De;const Re=c.bytesToNumberLE(ve);Re===m||h(Re,Te?te:k.ORDER);const Je=ie(Re*Re),$e=ie(Je-S),nt=ie(ke*Je-Se);let{isValid:Qe,value:Tt}=ae($e,nt);if(!Qe)throw new Error("Point.fromHex: invalid y coordinate");const ct=(Tt&S)===S,ze=!!(128&De);if(!Te&&Tt===m&&ze)throw new Error("Point.fromHex: x=0 and x_0=1");return ze!==ct&&(Tt=ie(-Tt)),z.fromAffine({x:Tt,y:Re})}static fromPrivateKey(Xe){return ee(Xe).point}toRawBytes(){const{x:Xe,y:Te}=this.toAffine(),ke=c.numberToBytesLE(Te,k.BYTES);return ke[ke.length-1]|=Xe&S?128:0,ke}toHex(){return c.bytesToHex(this.toRawBytes())}}z.BASE=new z(M.Gx,M.Gy,S,ie(M.Gx*M.Gy)),z.ZERO=new z(m,S,S,m);const{BASE:H,ZERO:I}=z,s=(0,B.wNAF)(z,8*q);function p(Ce){return(0,i.mod)(Ce,K)}function J(Ce){return p(c.bytesToNumberLE(Ce))}function ee(Ce){const Xe=q;Ce=(0,x.ensureBytes)("private key",Ce,Xe);const Te=(0,x.ensureBytes)("hashed private key",V(Ce),2*Xe),ke=me(Te.slice(0,Xe)),Se=Te.slice(Xe,2*Xe),Ee=J(ke),ve=H.multiply(Ee),De=ve.toRawBytes();return{head:ke,prefix:Se,scalar:Ee,point:ve,pointBytes:De}}function de(Ce=new Uint8Array,...Xe){const Te=c.concatBytes(...Xe);return J(V(ye(Te,(0,x.ensureBytes)("context",Ce),!!W)))}const Ie=R;return H._setWindowSize(8),{CURVE:M,getPublicKey:function se(Ce){return ee(Ce).pointBytes},sign:function Ae(Ce,Xe,Te={}){Ce=(0,x.ensureBytes)("message",Ce),W&&(Ce=W(Ce));const{prefix:ke,scalar:Se,pointBytes:Ee}=ee(Xe),ve=de(Te.context,ke,Ce),De=H.multiply(ve).toRawBytes(),Je=p(ve+de(Te.context,De,Ee,Ce)*Se);A(Je);const $e=c.concatBytes(De,c.numberToBytesLE(Je,k.BYTES));return(0,x.ensureBytes)("result",$e,2*q)},verify:function Le(Ce,Xe,Te,ke=Ie){const{context:Se,zip215:Ee}=ke,ve=k.BYTES;Ce=(0,x.ensureBytes)("signature",Ce,2*ve),Xe=(0,x.ensureBytes)("message",Xe),W&&(Xe=W(Xe));const De=c.bytesToNumberLE(Ce.slice(ve,2*ve));let Re,Je,$e;try{Re=z.fromHex(Te,Ee),Je=z.fromHex(Ce.slice(0,ve),Ee),$e=H.multiplyUnsafe(De)}catch{return!1}if(!Ee&&Re.isSmallOrder())return!1;const nt=de(Se,Je.toRawBytes(),Re.toRawBytes(),Xe);return Je.add(Re.multiplyUnsafe(nt)).subtract($e).clearCofactor().equals(z.ZERO)},ExtendedPoint:z,utils:{getExtendedPublicKey:ee,randomPrivateKey:()=>Z(k.BYTES),precompute:(Ce=8,Xe=z.BASE)=>(Xe._setWindowSize(Ce),Xe.multiply(BigInt(3)),Xe)}}}},75752:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.createHasher=F.isogenyMap=F.hash_to_field=F.expand_message_xof=F.expand_message_xmd=void 0;const i=f(63834),c=f(84097),B=c.bytesToNumberBE;function m(k,K){if(k<0||k>=1<<8*K)throw new Error(`bad I2OSP call: value=${k} length=${K}`);const W=Array.from({length:K}).fill(0);for(let V=K-1;V>=0;V--)W[V]=255&k,k>>>=8;return new Uint8Array(W)}function S(k,K){const W=new Uint8Array(k.length);for(let V=0;V255&&(K=V((0,c.concatBytes)((0,c.utf8ToBytes)("H2C-OVERSIZE-DST-"),K)));const{outputLen:Z,blockLen:q}=V,ne=Math.ceil(W/Z);if(ne>255)throw new Error("Invalid xmd length");const te=(0,c.concatBytes)(K,m(K.length,1)),ie=m(0,q),ae=m(W,2),me=new Array(ne),ye=V((0,c.concatBytes)(ie,k,ae,m(0,1),te));me[0]=V((0,c.concatBytes)(ye,m(1,1),te));for(let $=1;$<=ne;$++){const o=[S(ye,me[$-1]),m($+1,1),te];me[$]=V((0,c.concatBytes)(...o))}return(0,c.concatBytes)(...me).slice(0,W)}function T(k,K,W,V,Z){if(g(k),g(K),_(W),K.length>255){const q=Math.ceil(2*V/8);K=Z.create({dkLen:q}).update((0,c.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(K).digest()}if(W>65535||K.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return Z.create({dkLen:W}).update(k).update(m(W,2)).update(K).update(m(K.length,1)).digest()}function E(k,K,W){(0,c.validateObject)(W,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:V,k:Z,m:q,hash:ne,expand:te,DST:ie}=W;g(k),_(K);const ae=function x(k){if((0,c.isBytes)(k))return k;if("string"==typeof k)return(0,c.utf8ToBytes)(k);throw new Error("DST must be Uint8Array or string")}(ie),me=V.toString(2).length,ye=Math.ceil((me+Z)/8),ue=K*q*ye;let $;if("xmd"===te)$=R(k,ae,ue,ne);else if("xof"===te)$=T(k,ae,ue,Z,ne);else{if("_internal_pass"!==te)throw new Error('expand must be "xmd" or "xof"');$=k}const o=new Array(K);for(let h=0;hArray.from(V).reverse());return(V,Z)=>{const[q,ne,te,ie]=W.map(ae=>ae.reduce((me,ye)=>k.add(k.mul(me,V),ye)));return V=k.div(q,ne),Z=k.mul(Z,k.div(te,ie)),{x:V,y:Z}}},F.createHasher=function M(k,K,W){if("function"!=typeof K)throw new Error("mapToCurve() must be defined");return{hashToCurve(V,Z){const q=E(V,2,{...W,DST:W.DST,...Z}),ne=k.fromAffine(K(q[0])),te=k.fromAffine(K(q[1])),ie=ne.add(te).clearCofactor();return ie.assertValidity(),ie},encodeToCurve(V,Z){const q=E(V,1,{...W,DST:W.encodeDST,...Z}),ne=k.fromAffine(K(q[0])).clearCofactor();return ne.assertValidity(),ne}}}},63834:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapHashToField=F.getMinHashLength=F.getFieldBytesLength=F.hashToPrivateScalar=F.FpSqrtEven=F.FpSqrtOdd=F.Field=F.nLength=F.FpIsSquare=F.FpDiv=F.FpInvertBatch=F.FpPow=F.validateField=F.isNegativeLE=F.FpSqrt=F.tonelliShanks=F.invert=F.pow2=F.pow=F.mod=void 0;const i=f(84097),c=BigInt(0),x=BigInt(1),B=BigInt(2),m=BigInt(3),S=BigInt(4),g=BigInt(5),_=BigInt(8);function E(O,z){const H=O%z;return H>=c?H:z+H}function j(O,z,H){if(H<=c||z 0");if(H===x)return c;let I=x;for(;z>c;)z&x&&(I=I*O%H),O=O*O%H,z>>=x;return I}function k(O,z){if(O===c||z<=c)throw new Error(`invert: expected positive integers, got n=${O} mod=${z}`);let H=E(O,z),I=z,s=c,p=x,J=x,ee=c;for(;H!==c;){const de=I/H,Ae=I%H,Ie=s-J*de,Le=p-ee*de;I=H,H=Ae,s=J,p=ee,J=Ie,ee=Le}if(I!==x)throw new Error("invert: does not exist");return E(s,z)}function K(O){const z=(O-x)/B;let H,I,s;for(H=O-x,I=0;H%B===c;H/=B,I++);for(s=B;sc;)I*=I,I%=H;return I},F.invert=k,F.tonelliShanks=K,F.FpSqrt=W,F.isNegativeLE=(O,z)=>(E(O,z)&x)===x;const Z=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ne(O,z,H){if(H 0");if(H===c)return O.ONE;if(H===x)return z;let I=O.ONE,s=z;for(;H>c;)H&x&&(I=O.mul(I,s)),s=O.sqr(s),H>>=x;return I}function te(O,z){const H=new Array(z.length),I=z.reduce((p,J,ee)=>O.is0(J)?p:(H[ee]=p,O.mul(p,J)),O.ONE),s=O.inv(I);return z.reduceRight((p,J,ee)=>O.is0(J)?p:(H[ee]=O.mul(p,H[ee]),O.mul(p,J)),s),H}function me(O,z){const H=void 0!==z?z:O.toString(2).length;return{nBitLength:H,nByteLength:Math.ceil(H/8)}}function h(O){if("bigint"!=typeof O)throw new Error("field order must be bigint");const z=O.toString(2).length;return Math.ceil(z/8)}function A(O){const z=h(O);return z+Math.ceil(z/2)}F.validateField=function q(O){const H=Z.reduce((I,s)=>(I[s]="function",I),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.validateObject)(O,H)},F.FpPow=ne,F.FpInvertBatch=te,F.FpDiv=function ie(O,z,H){return O.mul(z,"bigint"==typeof H?k(H,O.ORDER):O.inv(H))},F.FpIsSquare=function ae(O){const z=(O.ORDER-x)/B;return H=>{const I=O.pow(H,z);return O.eql(I,O.ZERO)||O.eql(I,O.ONE)}},F.nLength=me,F.Field=function ye(O,z,H=!1,I={}){if(O<=c)throw new Error(`Expected Field ORDER > 0, got ${O}`);const{nBitLength:s,nByteLength:p}=me(O,z);if(p>2048)throw new Error("Field lengths over 2048 bytes are not supported");const J=W(O),ee=Object.freeze({ORDER:O,BITS:s,BYTES:p,MASK:(0,i.bitMask)(s),ZERO:c,ONE:x,create:se=>E(se,O),isValid:se=>{if("bigint"!=typeof se)throw new Error("Invalid field element: expected bigint, got "+typeof se);return c<=se&&sese===c,isOdd:se=>(se&x)===x,neg:se=>E(-se,O),eql:(se,de)=>se===de,sqr:se=>E(se*se,O),add:(se,de)=>E(se+de,O),sub:(se,de)=>E(se-de,O),mul:(se,de)=>E(se*de,O),pow:(se,de)=>ne(ee,se,de),div:(se,de)=>E(se*k(de,O),O),sqrN:se=>se*se,addN:(se,de)=>se+de,subN:(se,de)=>se-de,mulN:(se,de)=>se*de,inv:se=>k(se,O),sqrt:I.sqrt||(se=>J(ee,se)),invertBatch:se=>te(ee,se),cmov:(se,de,Ae)=>Ae?de:se,toBytes:se=>H?(0,i.numberToBytesLE)(se,p):(0,i.numberToBytesBE)(se,p),fromBytes:se=>{if(se.length!==p)throw new Error(`Fp.fromBytes: expected ${p}, got ${se.length}`);return H?(0,i.bytesToNumberLE)(se):(0,i.bytesToNumberBE)(se)}});return Object.freeze(ee)},F.FpSqrtOdd=function ue(O,z){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt(z);return O.isOdd(H)?H:O.neg(H)},F.FpSqrtEven=function $(O,z){if(!O.isOdd)throw new Error("Field doesn't have isOdd");const H=O.sqrt(z);return O.isOdd(H)?O.neg(H):H},F.hashToPrivateScalar=function o(O,z,H=!1){const I=(O=(0,i.ensureBytes)("privateHash",O)).length,s=me(z).nByteLength+8;if(s<24||I1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${I}`);return E(H?(0,i.bytesToNumberLE)(O):(0,i.bytesToNumberBE)(O),z-x)+x},F.getFieldBytesLength=h,F.getMinHashLength=A,F.mapHashToField=function C(O,z,H=!1){const I=O.length,s=h(z),p=A(z);if(I<16||I1024)throw new Error(`expected ${p}-1024 bytes of input, got ${I}`);const ee=E(H?(0,i.bytesToNumberBE)(O):(0,i.bytesToNumberLE)(O),z-x)+x;return H?(0,i.numberToBytesLE)(ee,s):(0,i.numberToBytesBE)(ee,s)}},27661:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.montgomery=void 0;const i=f(63834),c=f(84097),x=BigInt(0),B=BigInt(1);F.montgomery=function S(g){const _=function m(g){return(0,c.validateObject)(g,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...g})}(g),{P:R}=_,T=ue=>(0,i.mod)(ue,R),E=_.montgomeryBits,j=Math.ceil(E/8),M=_.nByteLength,k=_.adjustScalarBytes||(ue=>ue),K=_.powPminus2||(ue=>(0,i.pow)(ue,R-BigInt(2),R));function W(ue,$,o){const h=T(ue*($-o));return[$=T($-h),o=T(o+h)]}function V(ue){if("bigint"==typeof ue&&x<=ue&&ue=x;J--){const ee=h>>J&B;I^=ee,s=W(I,C,z),C=s[0],z=s[1],s=W(I,O,H),O=s[0],H=s[1],I=ee;const se=C+O,de=T(se*se),Ae=C-O,Ie=T(Ae*Ae),Le=de-Ie,xe=z+H,Xe=T((z-H)*se),Te=T(xe*Ae),ke=Xe+Te,Se=Xe-Te;z=T(ke*ke),H=T(A*T(Se*Se)),C=T(de*Ie),O=T(Le*(de+T(Z*Le)))}s=W(I,C,z),C=s[0],z=s[1],s=W(I,O,H),O=s[0],H=s[1];const p=K(O);return T(C*p)}(o,h);if(A===x)throw new Error("Invalid private or public key received");return ne(A)}const me=ne(_.Gu);function ye(ue){return ae(ue,me)}return{scalarMult:ae,scalarMultBase:ye,getSharedSecret:(ue,$)=>ae(ue,$),getPublicKey:ue=>ye(ue),utils:{randomPrivateKey:()=>_.randomBytes(_.nByteLength)},GuBytes:me}}},84097:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateObject=F.createHmacDrbg=F.bitMask=F.bitSet=F.bitGet=F.bitLen=F.utf8ToBytes=F.equalBytes=F.concatBytes=F.ensureBytes=F.numberToVarBytesBE=F.numberToBytesLE=F.numberToBytesBE=F.bytesToNumberLE=F.bytesToNumberBE=F.hexToBytes=F.hexToNumber=F.numberToHexUnpadded=F.bytesToHex=F.isBytes=void 0;const f=BigInt(0),i=BigInt(1),c=BigInt(2);function x(h){return h instanceof Uint8Array||null!=h&&"object"==typeof h&&"Uint8Array"===h.constructor.name}F.isBytes=x;const B=Array.from({length:256},(h,A)=>A.toString(16).padStart(2,"0"));function m(h){if(!x(h))throw new Error("Uint8Array expected");let A="";for(let C=0;C=_._0&&h<=_._9?h-_._0:h>=_._A&&h<=_._F?h-(_._A-10):h>=_._a&&h<=_._f?h-(_._a-10):void 0}function T(h){if("string"!=typeof h)throw new Error("hex string expected, got "+typeof h);const A=h.length,C=A/2;if(A%2)throw new Error("padded hex string expected, got unpadded hex of length "+A);const O=new Uint8Array(C);for(let z=0,H=0;zf;h>>=i,A+=1);return A},F.bitGet=function te(h,A){return h>>BigInt(A)&i},F.bitSet=(h,A,C)=>h|(C?i:f)<(c<new Uint8Array(h),ye=h=>Uint8Array.from(h);F.createHmacDrbg=function ue(h,A,C){if("number"!=typeof h||h<2)throw new Error("hashLen must be a number");if("number"!=typeof A||A<2)throw new Error("qByteLen must be a number");if("function"!=typeof C)throw new Error("hmacFn must be a function");let O=me(h),z=me(h),H=0;const I=()=>{O.fill(1),z.fill(0),H=0},s=(...se)=>C(z,O,...se),p=(se=me())=>{z=s(ye([0]),se),O=s(),0!==se.length&&(z=s(ye([1]),se),O=s())},J=()=>{if(H++>=1e3)throw new Error("drbg: tried 1000 values");let se=0;const de=[];for(;se{let Ae;for(I(),p(se);!(Ae=de(J()));)p();return I(),Ae}};const $={bigint:h=>"bigint"==typeof h,function:h=>"function"==typeof h,boolean:h=>"boolean"==typeof h,string:h=>"string"==typeof h,stringOrUint8Array:h=>"string"==typeof h||x(h),isSafeInteger:h=>Number.isSafeInteger(h),array:h=>Array.isArray(h),field:(h,A)=>A.Fp.isValid(h),hash:h=>"function"==typeof h&&Number.isSafeInteger(h.outputLen)};F.validateObject=function o(h,A,C={}){const O=(z,H,I)=>{const s=$[H];if("function"!=typeof s)throw new Error(`Invalid validator "${H}", expected function`);const p=h[z];if(!(I&&void 0===p||s(p,h)))throw new Error(`Invalid param ${String(z)}=${p} (${typeof p}), expected ${H}`)};for(const[z,H]of Object.entries(A))O(z,H,!1);for(const[z,H]of Object.entries(C))O(z,H,!0);return h}},73040:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapToCurveSimpleSWU=F.SWUFpSqrtRatio=F.weierstrass=F.weierstrassPoints=F.DER=void 0;const i=f(63834),c=f(84097),x=f(84097),B=f(25299),{bytesToNumberBE:S,hexToBytes:g}=c;F.DER={Err:class extends Error{constructor(q=""){super(q)}},_parseInt(Z){const{Err:q}=F.DER;if(Z.length<2||2!==Z[0])throw new q("Invalid signature integer tag");const ne=Z[1],te=Z.subarray(2,ne+2);if(!ne||te.length!==ne)throw new q("Invalid signature integer: wrong length");if(128&te[0])throw new q("Invalid signature integer: negative");if(0===te[0]&&!(128&te[1]))throw new q("Invalid signature integer: unnecessary leading zero");return{d:S(te),l:Z.subarray(ne+2)}},toSig(Z){const{Err:q}=F.DER,ne="string"==typeof Z?g(Z):Z;if(!c.isBytes(ne))throw new Error("ui8a expected");let te=ne.length;if(te<2||48!=ne[0])throw new q("Invalid signature tag");if(ne[1]!==te-2)throw new q("Invalid signature: incorrect length");const{d:ie,l:ae}=F.DER._parseInt(ne.subarray(2)),{d:me,l:ye}=F.DER._parseInt(ae);if(ye.length)throw new q("Invalid signature: left bytes after parsing");return{r:ie,s:me}},hexFromSig(Z){const q=$=>8&Number.parseInt($[0],16)?"00"+$:$,ne=$=>{const o=$.toString(16);return 1&o.length?`0${o}`:o},te=q(ne(Z.s)),ie=q(ne(Z.r)),ae=te.length/2,me=ie.length/2,ye=ne(ae),ue=ne(me);return`30${ne(me+ae+4)}02${ue}${ie}02${ye}${te}`}};const _=BigInt(0),R=BigInt(1),T=BigInt(2),E=BigInt(3),j=BigInt(4);function M(Z){const q=function m(Z){const q=(0,B.validateBasic)(Z);c.validateObject(q,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:ne,Fp:te,a:ie}=q;if(ne){if(!te.eql(ie,te.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof ne||"bigint"!=typeof ne.beta||"function"!=typeof ne.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...q})}(Z),{Fp:ne}=q,te=q.toBytes||((O,z,H)=>{const I=z.toAffine();return c.concatBytes(Uint8Array.from([4]),ne.toBytes(I.x),ne.toBytes(I.y))}),ie=q.fromBytes||(O=>{const z=O.subarray(1);return{x:ne.fromBytes(z.subarray(0,ne.BYTES)),y:ne.fromBytes(z.subarray(ne.BYTES,2*ne.BYTES))}});function ae(O){const{a:z,b:H}=q,I=ne.sqr(O),s=ne.mul(I,O);return ne.add(ne.add(s,ne.mul(O,z)),H)}if(!ne.eql(ne.sqr(q.Gy),ae(q.Gx)))throw new Error("bad generator point: equation left != right");function me(O){return"bigint"==typeof O&&_ne.eql(p,ne.ZERO);return s(H)&&s(I)?h.ZERO:new h(H,I,ne.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(z){const H=ne.invertBatch(z.map(I=>I.pz));return z.map((I,s)=>I.toAffine(H[s])).map(h.fromAffine)}static fromHex(z){const H=h.fromAffine(ie((0,x.ensureBytes)("pointHex",z)));return H.assertValidity(),H}static fromPrivateKey(z){return h.BASE.multiply(ue(z))}_setWindowSize(z){this._WINDOW_SIZE=z,$.delete(this)}assertValidity(){if(this.is0()){if(q.allowInfinityPoint&&!ne.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:z,y:H}=this.toAffine();if(!ne.isValid(z)||!ne.isValid(H))throw new Error("bad point: x or y not FE");const I=ne.sqr(H),s=ae(z);if(!ne.eql(I,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:z}=this.toAffine();if(ne.isOdd)return!ne.isOdd(z);throw new Error("Field doesn't support isOdd")}equals(z){o(z);const{px:H,py:I,pz:s}=this,{px:p,py:J,pz:ee}=z,se=ne.eql(ne.mul(H,ee),ne.mul(p,s)),de=ne.eql(ne.mul(I,ee),ne.mul(J,s));return se&&de}negate(){return new h(this.px,ne.neg(this.py),this.pz)}double(){const{a:z,b:H}=q,I=ne.mul(H,E),{px:s,py:p,pz:J}=this;let ee=ne.ZERO,se=ne.ZERO,de=ne.ZERO,Ae=ne.mul(s,s),Ie=ne.mul(p,p),Le=ne.mul(J,J),xe=ne.mul(s,p);return xe=ne.add(xe,xe),de=ne.mul(s,J),de=ne.add(de,de),ee=ne.mul(z,de),se=ne.mul(I,Le),se=ne.add(ee,se),ee=ne.sub(Ie,se),se=ne.add(Ie,se),se=ne.mul(ee,se),ee=ne.mul(xe,ee),de=ne.mul(I,de),Le=ne.mul(z,Le),xe=ne.sub(Ae,Le),xe=ne.mul(z,xe),xe=ne.add(xe,de),de=ne.add(Ae,Ae),Ae=ne.add(de,Ae),Ae=ne.add(Ae,Le),Ae=ne.mul(Ae,xe),se=ne.add(se,Ae),Le=ne.mul(p,J),Le=ne.add(Le,Le),Ae=ne.mul(Le,xe),ee=ne.sub(ee,Ae),de=ne.mul(Le,Ie),de=ne.add(de,de),de=ne.add(de,de),new h(ee,se,de)}add(z){o(z);const{px:H,py:I,pz:s}=this,{px:p,py:J,pz:ee}=z;let se=ne.ZERO,de=ne.ZERO,Ae=ne.ZERO;const Ie=q.a,Le=ne.mul(q.b,E);let xe=ne.mul(H,p),Ce=ne.mul(I,J),Xe=ne.mul(s,ee),Te=ne.add(H,I),ke=ne.add(p,J);Te=ne.mul(Te,ke),ke=ne.add(xe,Ce),Te=ne.sub(Te,ke),ke=ne.add(H,s);let Se=ne.add(p,ee);return ke=ne.mul(ke,Se),Se=ne.add(xe,Xe),ke=ne.sub(ke,Se),Se=ne.add(I,s),se=ne.add(J,ee),Se=ne.mul(Se,se),se=ne.add(Ce,Xe),Se=ne.sub(Se,se),Ae=ne.mul(Ie,ke),se=ne.mul(Le,Xe),Ae=ne.add(se,Ae),se=ne.sub(Ce,Ae),Ae=ne.add(Ce,Ae),de=ne.mul(se,Ae),Ce=ne.add(xe,xe),Ce=ne.add(Ce,xe),Xe=ne.mul(Ie,Xe),ke=ne.mul(Le,ke),Ce=ne.add(Ce,Xe),Xe=ne.sub(xe,Xe),Xe=ne.mul(Ie,Xe),ke=ne.add(ke,Xe),xe=ne.mul(Ce,ke),de=ne.add(de,xe),xe=ne.mul(Se,ke),se=ne.mul(Te,se),se=ne.sub(se,xe),xe=ne.mul(Te,Ce),Ae=ne.mul(Se,Ae),Ae=ne.add(Ae,xe),new h(se,de,Ae)}subtract(z){return this.add(z.negate())}is0(){return this.equals(h.ZERO)}wNAF(z){return C.wNAFCached(this,$,z,H=>{const I=ne.invertBatch(H.map(s=>s.pz));return H.map((s,p)=>s.toAffine(I[p])).map(h.fromAffine)})}multiplyUnsafe(z){const H=h.ZERO;if(z===_)return H;if(ye(z),z===R)return this;const{endo:I}=q;if(!I)return C.unsafeLadder(this,z);let{k1neg:s,k1:p,k2neg:J,k2:ee}=I.splitScalar(z),se=H,de=H,Ae=this;for(;p>_||ee>_;)p&R&&(se=se.add(Ae)),ee&R&&(de=de.add(Ae)),Ae=Ae.double(),p>>=R,ee>>=R;return s&&(se=se.negate()),J&&(de=de.negate()),de=new h(ne.mul(de.px,I.beta),de.py,de.pz),se.add(de)}multiply(z){ye(z);let I,s,H=z;const{endo:p}=q;if(p){const{k1neg:J,k1:ee,k2neg:se,k2:de}=p.splitScalar(H);let{p:Ae,f:Ie}=this.wNAF(ee),{p:Le,f:xe}=this.wNAF(de);Ae=C.constTimeNegate(J,Ae),Le=C.constTimeNegate(se,Le),Le=new h(ne.mul(Le.px,p.beta),Le.py,Le.pz),I=Ae.add(Le),s=Ie.add(xe)}else{const{p:J,f:ee}=this.wNAF(H);I=J,s=ee}return h.normalizeZ([I,s])[0]}multiplyAndAddUnsafe(z,H,I){const s=h.BASE,p=(ee,se)=>se!==_&&se!==R&&ee.equals(s)?ee.multiply(se):ee.multiplyUnsafe(se),J=p(this,H).add(p(z,I));return J.is0()?void 0:J}toAffine(z){const{px:H,py:I,pz:s}=this,p=this.is0();null==z&&(z=p?ne.ONE:ne.inv(s));const J=ne.mul(H,z),ee=ne.mul(I,z),se=ne.mul(s,z);if(p)return{x:ne.ZERO,y:ne.ZERO};if(!ne.eql(se,ne.ONE))throw new Error("invZ was invalid");return{x:J,y:ee}}isTorsionFree(){const{h:z,isTorsionFree:H}=q;if(z===R)return!0;if(H)return H(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:z,clearCofactor:H}=q;return z===R?this:H?H(h,this):this.multiplyUnsafe(q.h)}toRawBytes(z=!0){return this.assertValidity(),te(h,this,z)}toHex(z=!0){return c.bytesToHex(this.toRawBytes(z))}}h.BASE=new h(q.Gx,q.Gy,ne.ONE),h.ZERO=new h(ne.ZERO,ne.ONE,ne.ZERO);const A=q.nBitLength,C=(0,B.wNAF)(h,q.endo?Math.ceil(A/2):A);return{CURVE:q,ProjectivePoint:h,normPrivateKeyToScalar:ue,weierstrassEquation:ae,isWithinCurveOrder:me}}function W(Z,q){const ne=Z.ORDER;let te=_;for(let O=ne-R;O%T===_;O/=T)te+=R;const ie=te,ae=T<{let H=h,I=Z.pow(z,$),s=Z.sqr(I);s=Z.mul(s,z);let p=Z.mul(O,s);p=Z.pow(p,ue),p=Z.mul(p,I),I=Z.mul(p,z),s=Z.mul(p,O);let J=Z.mul(s,I);p=Z.pow(J,o);let ee=Z.eql(p,Z.ONE);I=Z.mul(s,A),p=Z.mul(J,H),s=Z.cmov(I,s,ee),J=Z.cmov(p,J,ee);for(let se=ie;se>R;se--){let de=se-T;de=T<{let s=Z.sqr(I);const p=Z.mul(H,I);s=Z.mul(s,p);let J=Z.pow(s,O);J=Z.mul(J,p);const ee=Z.mul(J,z),se=Z.mul(Z.sqr(J),I),de=Z.eql(se,H);return{isValid:de,value:Z.cmov(ee,J,de)}}}return C}F.weierstrassPoints=M,F.weierstrass=function K(Z){const q=function k(Z){const q=(0,B.validateBasic)(Z);return c.validateObject(q,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...q})}(Z),{Fp:ne,n:te}=q,ie=ne.BYTES+1,ae=2*ne.BYTES+1;function ye(ke){return i.mod(ke,te)}function ue(ke){return i.invert(ke,te)}const{ProjectivePoint:$,normPrivateKeyToScalar:o,weierstrassEquation:h,isWithinCurveOrder:A}=M({...q,toBytes(ke,Se,Ee){const ve=Se.toAffine(),De=ne.toBytes(ve.x),Re=c.concatBytes;return Ee?Re(Uint8Array.from([Se.hasEvenY()?2:3]),De):Re(Uint8Array.from([4]),De,ne.toBytes(ve.y))},fromBytes(ke){const Se=ke.length,Ee=ke[0],ve=ke.subarray(1);if(Se!==ie||2!==Ee&&3!==Ee){if(Se===ae&&4===Ee)return{x:ne.fromBytes(ve.subarray(0,ne.BYTES)),y:ne.fromBytes(ve.subarray(ne.BYTES,2*ne.BYTES))};throw new Error(`Point of length ${Se} was invalid. Expected ${ie} compressed bytes or ${ae} uncompressed bytes`)}{const De=c.bytesToNumberBE(ve);if(!function me(ke){return _c.bytesToHex(c.numberToBytesBE(ke,q.nByteLength));function O(ke){return ke>te>>R}const H=(ke,Se,Ee)=>c.bytesToNumberBE(ke.slice(Se,Ee));class I{constructor(Se,Ee,ve){this.r=Se,this.s=Ee,this.recovery=ve,this.assertValidity()}static fromCompact(Se){const Ee=q.nByteLength;return Se=(0,x.ensureBytes)("compactSignature",Se,2*Ee),new I(H(Se,0,Ee),H(Se,Ee,2*Ee))}static fromDER(Se){const{r:Ee,s:ve}=F.DER.toSig((0,x.ensureBytes)("DER",Se));return new I(Ee,ve)}assertValidity(){if(!A(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!A(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(Se){return new I(this.r,this.s,Se)}recoverPublicKey(Se){const{r:Ee,s:ve,recovery:De}=this,Re=de((0,x.ensureBytes)("msgHash",Se));if(null==De||![0,1,2,3].includes(De))throw new Error("recovery id invalid");const Je=2===De||3===De?Ee+q.n:Ee;if(Je>=ne.ORDER)throw new Error("recovery id 2 or 3 invalid");const nt=$.fromHex((1&De?"03":"02")+C(Je)),Qe=ue(Je),Tt=ye(-Re*Qe),ct=ye(ve*Qe),ze=$.BASE.multiplyAndAddUnsafe(nt,Tt,ct);if(!ze)throw new Error("point at infinify");return ze.assertValidity(),ze}hasHighS(){return O(this.s)}normalizeS(){return this.hasHighS()?new I(this.r,ye(-this.s),this.recovery):this}toDERRawBytes(){return c.hexToBytes(this.toDERHex())}toDERHex(){return F.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return c.hexToBytes(this.toCompactHex())}toCompactHex(){return C(this.r)+C(this.s)}}const s={isValidPrivateKey(ke){try{return o(ke),!0}catch{return!1}},normPrivateKeyToScalar:o,randomPrivateKey:()=>{const ke=i.getMinHashLength(q.n);return i.mapHashToField(q.randomBytes(ke),q.n)},precompute:(ke=8,Se=$.BASE)=>(Se._setWindowSize(ke),Se.multiply(BigInt(3)),Se)};function J(ke){const Se=c.isBytes(ke),Ee="string"==typeof ke,ve=(Se||Ee)&&ke.length;return Se?ve===ie||ve===ae:Ee?ve===2*ie||ve===2*ae:ke instanceof $}const se=q.bits2int||function(ke){const Se=c.bytesToNumberBE(ke),Ee=8*ke.length-q.nBitLength;return Ee>0?Se>>BigInt(Ee):Se},de=q.bits2int_modN||function(ke){return ye(se(ke))},Ae=c.bitMask(q.nBitLength);function Ie(ke){if("bigint"!=typeof ke)throw new Error("bigint expected");if(!(_<=ke&&kere in Ee))throw new Error("sign() legacy options not supported");const{hash:ve,randomBytes:De}=q;let{lowS:Re,prehash:Je,extraEntropy:$e}=Ee;null==Re&&(Re=!0),ke=(0,x.ensureBytes)("msgHash",ke),Je&&(ke=(0,x.ensureBytes)("prehashed msgHash",ve(ke)));const nt=de(ke),Qe=o(Se),Tt=[Ie(Qe),Ie(nt)];if(null!=$e){const re=!0===$e?De(ne.BYTES):$e;Tt.push((0,x.ensureBytes)("extraEntropy",re))}const ct=c.concatBytes(...Tt),ze=nt;return{seed:ct,k2sig:function St(re){const X=se(re);if(!A(X))return;const G=ue(X),he=$.BASE.multiply(X).toAffine(),_e=ye(he.x);if(_e===_)return;const je=ye(G*ye(ze+_e*Qe));if(je===_)return;let Ne=(he.x===_e?0:2)|Number(he.y&R),ot=je;return Re&&O(je)&&(ot=function z(ke){return O(ke)?ye(-ke):ke}(je),Ne^=1),new I(_e,ot,Ne)}}}(ke,Se,Ee);return c.createHmacDrbg(q.hash.outputLen,q.nByteLength,q.hmac)(ve,De)},verify:function Te(ke,Se,Ee,ve=Ce){const De=ke;if(Se=(0,x.ensureBytes)("msgHash",Se),Ee=(0,x.ensureBytes)("publicKey",Ee),"strict"in ve)throw new Error("options.strict was renamed to lowS");const{lowS:Re,prehash:Je}=ve;let $e,nt;try{if("string"==typeof De||c.isBytes(De))try{$e=I.fromDER(De)}catch(he){if(!(he instanceof F.DER.Err))throw he;$e=I.fromCompact(De)}else{if("object"!=typeof De||"bigint"!=typeof De.r||"bigint"!=typeof De.s)throw new Error("PARSE");{const{r:he,s:_e}=De;$e=new I(he,_e)}}nt=$.fromHex(Ee)}catch(he){if("PARSE"===he.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Re&&$e.hasHighS())return!1;Je&&(Se=q.hash(Se));const{r:Qe,s:Tt}=$e,ct=de(Se),ze=ue(Tt),St=ye(ct*ze),re=ye(Qe*ze),X=$.BASE.multiplyAndAddUnsafe(nt,St,re)?.toAffine();return!!X&&ye(X.x)===Qe},ProjectivePoint:$,Signature:I,utils:s}},F.SWUFpSqrtRatio=W,F.mapToCurveSimpleSWU=function V(Z,q){if(i.validateField(Z),!Z.isValid(q.A)||!Z.isValid(q.B)||!Z.isValid(q.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const ne=W(Z,q.Z);if(!Z.isOdd)throw new Error("Fp.isOdd is not implemented!");return te=>{let ie,ae,me,ye,ue,$,o,h;ie=Z.sqr(te),ie=Z.mul(ie,q.Z),ae=Z.sqr(ie),ae=Z.add(ae,ie),me=Z.add(ae,Z.ONE),me=Z.mul(me,q.B),ye=Z.cmov(q.Z,Z.neg(ae),!Z.eql(ae,Z.ZERO)),ye=Z.mul(ye,q.A),ae=Z.sqr(me),$=Z.sqr(ye),ue=Z.mul($,q.A),ae=Z.add(ae,ue),ae=Z.mul(ae,me),$=Z.mul($,ye),ue=Z.mul($,q.B),ae=Z.add(ae,ue),o=Z.mul(ie,me);const{isValid:A,value:C}=ne(ae,$);h=Z.mul(ie,te),h=Z.mul(h,C),o=Z.cmov(o,me,A),h=Z.cmov(h,C,A);const O=Z.isOdd(te)===Z.isOdd(h);return h=Z.cmov(Z.neg(h),h,O),o=Z.div(o,ye),{x:o,y:h}}}},57340:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hash_to_ristretto255=F.hashToRistretto255=F.RistrettoPoint=F.encodeToCurve=F.hashToCurve=F.edwardsToMontgomeryPriv=F.edwardsToMontgomery=F.edwardsToMontgomeryPub=F.x25519=F.ed25519ph=F.ed25519ctx=F.ed25519=F.ED25519_TORSION_SUBGROUP=void 0;const i=f(44207),c=f(96492),x=f(45068),B=f(27661),m=f(63834),S=f(84097),g=f(75752),_=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),R=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),T=BigInt(0),E=BigInt(1),j=BigInt(2),M=BigInt(5),k=BigInt(10),K=BigInt(20),W=BigInt(40),V=BigInt(80);function Z(Xe){const Te=_,Se=Xe*Xe%Te*Xe%Te,Ee=(0,m.pow2)(Se,j,Te)*Se%Te,ve=(0,m.pow2)(Ee,E,Te)*Xe%Te,De=(0,m.pow2)(ve,M,Te)*ve%Te,Re=(0,m.pow2)(De,k,Te)*De%Te,Je=(0,m.pow2)(Re,K,Te)*Re%Te,$e=(0,m.pow2)(Je,W,Te)*Je%Te,nt=(0,m.pow2)($e,V,Te)*$e%Te,Qe=(0,m.pow2)(nt,V,Te)*$e%Te,Tt=(0,m.pow2)(Qe,k,Te)*De%Te;return{pow_p_5_8:(0,m.pow2)(Tt,j,Te)*Xe%Te,b2:Se}}function q(Xe){return Xe[0]&=248,Xe[31]&=127,Xe[31]|=64,Xe}function ne(Xe,Te){const ke=_,Se=(0,m.mod)(Te*Te*Te,ke),ve=Z(Xe*(0,m.mod)(Se*Se*Te,ke)).pow_p_5_8;let De=(0,m.mod)(Xe*Se*ve,ke);const Re=(0,m.mod)(Te*De*De,ke),Je=De,$e=(0,m.mod)(De*R,ke),nt=Re===Xe,Qe=Re===(0,m.mod)(-Xe,ke),Tt=Re===(0,m.mod)(-Xe*R,ke);return nt&&(De=Je),(Qe||Tt)&&(De=$e),(0,m.isNegativeLE)(De,ke)&&(De=(0,m.mod)(-De,ke)),{isValid:nt||Qe,value:De}}F.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const te=(0,m.Field)(_,void 0,!0),ie={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:te,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:i.sha512,randomBytes:c.randomBytes,adjustScalarBytes:q,uvRatio:ne};function ae(Xe,Te,ke){if(Te.length>255)throw new Error("Context is too big");return(0,c.concatBytes)((0,c.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([ke?1:0,Te.length]),Te,Xe)}function me(Xe){const{y:Te}=F.ed25519.ExtendedPoint.fromHex(Xe),ke=BigInt(1);return te.toBytes(te.create((ke+Te)*te.inv(ke-Te)))}F.ed25519=(0,x.twistedEdwards)(ie),F.ed25519ctx=(0,x.twistedEdwards)({...ie,domain:ae}),F.ed25519ph=(0,x.twistedEdwards)({...ie,domain:ae,prehash:i.sha512}),F.x25519=(0,B.montgomery)({P:_,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:Xe=>{const Te=_,{pow_p_5_8:ke,b2:Se}=Z(Xe);return(0,m.mod)((0,m.pow2)(ke,BigInt(3),Te)*Se,Te)},adjustScalarBytes:q,randomBytes:c.randomBytes}),F.edwardsToMontgomeryPub=me,F.edwardsToMontgomery=me,F.edwardsToMontgomeryPriv=function ye(Xe){const Te=ie.hash(Xe.subarray(0,32));return ie.adjustScalarBytes(Te).subarray(0,32)};const ue=(te.ORDER+BigInt(3))/BigInt(8),$=te.pow(j,ue),o=te.sqrt(te.neg(te.ONE)),h=(te.ORDER-BigInt(5))/BigInt(8),A=BigInt(486662),O=(0,m.FpSqrtEven)(te,te.neg(BigInt(486664)));const H=(0,g.createHasher)(F.ed25519.ExtendedPoint,Xe=>function z(Xe){const{xMn:Te,xMd:ke,yMn:Se,yMd:Ee}=function C(Xe){let Te=te.sqr(Xe);Te=te.mul(Te,j);let ke=te.add(Te,te.ONE),Se=te.neg(A),Ee=te.sqr(ke),ve=te.mul(Ee,ke),De=te.mul(Te,A);De=te.mul(De,Se),De=te.add(De,Ee),De=te.mul(De,Se);let Re=te.sqr(ve);Ee=te.sqr(Re),Re=te.mul(Re,ve),Re=te.mul(Re,De),Ee=te.mul(Ee,Re);let Je=te.pow(Ee,h);Je=te.mul(Je,Re);let $e=te.mul(Je,o);Ee=te.sqr(Je),Ee=te.mul(Ee,ve);let nt=te.eql(Ee,De),Qe=te.cmov($e,Je,nt),Tt=te.mul(Se,Te),ct=te.mul(Je,Xe);ct=te.mul(ct,$);let ze=te.mul(ct,o),St=te.mul(De,Te);Ee=te.sqr(ct),Ee=te.mul(Ee,ve);let re=te.eql(Ee,St),X=te.cmov(ze,ct,re);Ee=te.sqr(Qe),Ee=te.mul(Ee,ve);let G=te.eql(Ee,De),he=te.cmov(Tt,Se,G),_e=te.cmov(X,Qe,G),je=te.isOdd(_e);return _e=te.cmov(_e,te.neg(_e),G!==je),{xMn:he,xMd:ke,yMn:_e,yMd:E}}(Xe);let ve=te.mul(Te,Ee);ve=te.mul(ve,O);let De=te.mul(ke,Se),Re=te.sub(Te,ke),Je=te.add(Te,ke),$e=te.mul(De,Je),nt=te.eql($e,te.ZERO);ve=te.cmov(ve,te.ZERO,nt),De=te.cmov(De,te.ONE,nt),Re=te.cmov(Re,te.ONE,nt),Je=te.cmov(Je,te.ONE,nt);const Qe=te.invertBatch([De,Je]);return{x:te.mul(ve,Qe[0]),y:te.mul(Re,Qe[1])}}(Xe[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:te.ORDER,m:1,k:128,expand:"xmd",hash:i.sha512});function I(Xe){if(!(Xe instanceof xe))throw new Error("RistrettoPoint expected")}F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve;const s=R,p=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),J=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ee=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),se=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),de=Xe=>ne(E,Xe),Ae=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ie=Xe=>F.ed25519.CURVE.Fp.create((0,S.bytesToNumberLE)(Xe)&Ae);function Le(Xe){const{d:Te}=F.ed25519.CURVE,ke=F.ed25519.CURVE.Fp.ORDER,Se=F.ed25519.CURVE.Fp.create,Ee=Se(s*Xe*Xe),ve=Se((Ee+E)*ee);let De=BigInt(-1);const Re=Se((De-Te*Ee)*Se(Ee+Te));let{isValid:Je,value:$e}=ne(ve,Re),nt=Se($e*Xe);(0,m.isNegativeLE)(nt,ke)||(nt=Se(-nt)),Je||($e=nt),Je||(De=Ee);const Qe=Se(De*(Ee-E)*se-Re),Tt=$e*$e,ct=Se(($e+$e)*Re),ze=Se(Qe*p),St=Se(E-Tt),re=Se(E+Tt);return new F.ed25519.ExtendedPoint(Se(ct*re),Se(St*ze),Se(ze*re),Se(ct*St))}class xe{constructor(Te){this.ep=Te}static fromAffine(Te){return new xe(F.ed25519.ExtendedPoint.fromAffine(Te))}static hashToCurve(Te){Te=(0,S.ensureBytes)("ristrettoHash",Te,64);const Se=Le(Ie(Te.slice(0,32))),ve=Le(Ie(Te.slice(32,64)));return new xe(Se.add(ve))}static fromHex(Te){Te=(0,S.ensureBytes)("ristrettoHex",Te,32);const{a:ke,d:Se}=F.ed25519.CURVE,Ee=F.ed25519.CURVE.Fp.ORDER,ve=F.ed25519.CURVE.Fp.create,De="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",Re=Ie(Te);if(!(0,S.equalBytes)((0,S.numberToBytesLE)(Re,32),Te)||(0,m.isNegativeLE)(Re,Ee))throw new Error(De);const Je=ve(Re*Re),$e=ve(E+ke*Je),nt=ve(E-ke*Je),Qe=ve($e*$e),Tt=ve(nt*nt),ct=ve(ke*Se*Qe-Tt),{isValid:ze,value:St}=de(ve(ct*Tt)),re=ve(St*nt),X=ve(St*re*ct);let G=ve((Re+Re)*re);(0,m.isNegativeLE)(G,Ee)&&(G=ve(-G));const he=ve($e*X),_e=ve(G*he);if(!ze||(0,m.isNegativeLE)(_e,Ee)||he===T)throw new Error(De);return new xe(new F.ed25519.ExtendedPoint(G,he,E,_e))}toRawBytes(){let{ex:Te,ey:ke,ez:Se,et:Ee}=this.ep;const ve=F.ed25519.CURVE.Fp.ORDER,De=F.ed25519.CURVE.Fp.create,Re=De(De(Se+ke)*De(Se-ke)),Je=De(Te*ke),$e=De(Je*Je),{value:nt}=de(De(Re*$e)),Qe=De(nt*Re),Tt=De(nt*Je),ct=De(Qe*Tt*Ee);let ze;if((0,m.isNegativeLE)(Ee*ct,ve)){let re=De(ke*s),X=De(Te*s);Te=re,ke=X,ze=De(Qe*J)}else ze=Tt;(0,m.isNegativeLE)(Te*ct,ve)&&(ke=De(-ke));let St=De((Se-ke)*ze);return(0,m.isNegativeLE)(St,ve)&&(St=De(-St)),(0,S.numberToBytesLE)(St,32)}toHex(){return(0,S.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(Te){I(Te);const{ex:ke,ey:Se}=this.ep,{ex:Ee,ey:ve}=Te.ep,De=F.ed25519.CURVE.Fp.create,Re=De(ke*ve)===De(Se*Ee),Je=De(Se*ve)===De(ke*Ee);return Re||Je}add(Te){return I(Te),new xe(this.ep.add(Te.ep))}subtract(Te){return I(Te),new xe(this.ep.subtract(Te.ep))}multiply(Te){return new xe(this.ep.multiply(Te))}multiplyUnsafe(Te){return new xe(this.ep.multiplyUnsafe(Te))}double(){return new xe(this.ep.double())}negate(){return new xe(this.ep.negate())}}F.RistrettoPoint=(xe.BASE||(xe.BASE=new xe(F.ed25519.ExtendedPoint.BASE)),xe.ZERO||(xe.ZERO=new xe(F.ed25519.ExtendedPoint.ZERO)),xe),F.hashToRistretto255=(Xe,Te)=>{const ke=Te.DST,Se="string"==typeof ke?(0,c.utf8ToBytes)(ke):ke,Ee=(0,g.expand_message_xmd)(Xe,Se,64,i.sha512);return xe.hashToCurve(Ee)},F.hash_to_ristretto255=F.hashToRistretto255},91717:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.encodeToCurve=F.hashToCurve=F.schnorr=F.secp256k1=void 0;const i=f(1806),c=f(96492),x=f(63834),B=f(73040),m=f(84097),S=f(75752),g=f(4521),_=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),R=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),T=BigInt(1),E=BigInt(2),j=(I,s)=>(I+s/E)/s;function M(I){const s=_,p=BigInt(3),J=BigInt(6),ee=BigInt(11),se=BigInt(22),de=BigInt(23),Ae=BigInt(44),Ie=BigInt(88),Le=I*I*I%s,xe=Le*Le*I%s,Ce=(0,x.pow2)(xe,p,s)*xe%s,Xe=(0,x.pow2)(Ce,p,s)*xe%s,Te=(0,x.pow2)(Xe,E,s)*Le%s,ke=(0,x.pow2)(Te,ee,s)*Te%s,Se=(0,x.pow2)(ke,se,s)*ke%s,Ee=(0,x.pow2)(Se,Ae,s)*Se%s,ve=(0,x.pow2)(Ee,Ie,s)*Ee%s,De=(0,x.pow2)(ve,Ae,s)*Se%s,Re=(0,x.pow2)(De,p,s)*xe%s,Je=(0,x.pow2)(Re,de,s)*ke%s,$e=(0,x.pow2)(Je,J,s)*Le%s,nt=(0,x.pow2)($e,E,s);if(!k.eql(k.sqr(nt),I))throw new Error("Cannot find square root");return nt}const k=(0,x.Field)(_,void 0,void 0,{sqrt:M});F.secp256k1=(0,g.createCurve)({a:BigInt(0),b:BigInt(7),Fp:k,n:R,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:I=>{const s=R,p=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),J=-T*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ee=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),se=p,de=BigInt("0x100000000000000000000000000000000"),Ae=j(se*I,s),Ie=j(-J*I,s);let Le=(0,x.mod)(I-Ae*p-Ie*ee,s),xe=(0,x.mod)(-Ae*J-Ie*se,s);const Ce=Le>de,Xe=xe>de;if(Ce&&(Le=s-Le),Xe&&(xe=s-xe),Le>de||xe>de)throw new Error("splitScalar: Endomorphism failed, k="+I);return{k1neg:Ce,k1:Le,k2neg:Xe,k2:xe}}}},i.sha256);const K=BigInt(0),W=I=>"bigint"==typeof I&&Kee.charCodeAt(0)));p=(0,m.concatBytes)(J,J),Z[I]=p}return(0,i.sha256)((0,m.concatBytes)(p,...s))}const ne=I=>I.toRawBytes(!0).slice(1),te=I=>(0,m.numberToBytesBE)(I,32),ie=I=>(0,x.mod)(I,_),ae=I=>(0,x.mod)(I,R),me=F.secp256k1.ProjectivePoint;function ue(I){let s=F.secp256k1.utils.normPrivateKeyToScalar(I),p=me.fromPrivateKey(s);return{scalar:p.hasEvenY()?s:ae(-s),bytes:ne(p)}}function $(I){if(!W(I))throw new Error("bad x: need 0 < x < p");const s=ie(I*I);let J=M(ie(s*I+BigInt(7)));J%E!==K&&(J=ie(-J));const ee=new me(I,J,T);return ee.assertValidity(),ee}function o(...I){return ae((0,m.bytesToNumberBE)(q("BIP0340/challenge",...I)))}function C(I,s,p){const J=(0,m.ensureBytes)("signature",I,64),ee=(0,m.ensureBytes)("message",s),se=(0,m.ensureBytes)("publicKey",p,32);try{const de=$((0,m.bytesToNumberBE)(se)),Ae=(0,m.bytesToNumberBE)(J.subarray(0,32));if(!W(Ae))return!1;const Ie=(0,m.bytesToNumberBE)(J.subarray(32,64));if(!(I=>"bigint"==typeof I&&Kme.BASE.multiplyAndAddUnsafe(I,s,p))(de,Ie,ae(-Le));return!(!xe||!xe.hasEvenY()||xe.toAffine().x!==Ae)}catch{return!1}}F.schnorr={getPublicKey:function h(I){return ue(I).bytes},sign:function A(I,s,p=(0,c.randomBytes)(32)){const J=(0,m.ensureBytes)("message",I),{bytes:ee,scalar:se}=ue(s),de=(0,m.ensureBytes)("auxRand",p,32),Ae=te(se^(0,m.bytesToNumberBE)(q("BIP0340/aux",de))),Ie=q("BIP0340/nonce",Ae,ee,J),Le=ae((0,m.bytesToNumberBE)(Ie));if(Le===K)throw new Error("sign failed: k is zero");const{bytes:xe,scalar:Ce}=ue(Le),Xe=o(xe,ee,J),Te=new Uint8Array(64);if(Te.set(xe,0),Te.set(te(ae(Ce+Xe*se)),32),!C(Te,J,ee))throw new Error("sign: Invalid signature produced");return Te},verify:C,utils:{randomPrivateKey:F.secp256k1.utils.randomPrivateKey,lift_x:$,pointToBytes:ne,numberToBytesBE:m.numberToBytesBE,bytesToNumberBE:m.bytesToNumberBE,taggedHash:q,mod:x.mod}};const O=(0,S.isogenyMap)(k,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(I=>I.map(s=>BigInt(s)))),z=(0,B.mapToCurveSimpleSWU)(k,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:k.create(BigInt("-11"))}),H=(0,S.createHasher)(F.secp256k1.ProjectivePoint,I=>{const{x:s,y:p}=z(k.create(I[0]));return O(s,p)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:k.ORDER,m:1,k:128,expand:"xmd",hash:i.sha256});F.hashToCurve=H.hashToCurve,F.encodeToCurve=H.encodeToCurve},68578:(Me,F)=>{"use strict";function f(_){if(!Number.isSafeInteger(_)||_<0)throw new Error(`Wrong positive integer: ${_}`)}function i(_){if("boolean"!=typeof _)throw new Error(`Expected boolean, not ${_}`)}function x(_,...R){if(!function c(_){return _ instanceof Uint8Array||null!=_&&"object"==typeof _&&"Uint8Array"===_.constructor.name}(_))throw new Error("Expected Uint8Array");if(R.length>0&&!R.includes(_.length))throw new Error(`Expected Uint8Array of length ${R}, not of length=${_.length}`)}function B(_){if("function"!=typeof _||"function"!=typeof _.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");f(_.outputLen),f(_.blockLen)}function m(_,R=!0){if(_.destroyed)throw new Error("Hash instance has been destroyed");if(R&&_.finished)throw new Error("Hash#digest() has already been called")}function S(_,R){x(_);const T=R.outputLen;if(_.length{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SHA2=void 0;const i=f(68578),c=f(96492);F.SHA2=class B extends c.Hash{constructor(S,g,_,R){super(),this.blockLen=S,this.outputLen=g,this.padOffset=_,this.isLE=R,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(S),this.view=(0,c.createView)(this.buffer)}update(S){(0,i.exists)(this);const{view:g,buffer:_,blockLen:R}=this,T=(S=(0,c.toBytes)(S)).length;for(let E=0;ER-E&&(this.process(_,0),E=0);for(let W=E;W>R&T),j=Number(g&T),k=_?0:4;m.setUint32(S+(_?4:0),E,_),m.setUint32(S+k,j,_)})(_,R-8,BigInt(8*this.length),T),this.process(_,0);const j=(0,c.createView)(S),M=this.outputLen;if(M%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const k=M/4,K=this.get();if(k>K.length)throw new Error("_sha2: outputLen bigger than state");for(let W=0;W{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.add5L=F.add5H=F.add4H=F.add4L=F.add3H=F.add3L=F.add=F.rotlBL=F.rotlBH=F.rotlSL=F.rotlSH=F.rotr32L=F.rotr32H=F.rotrBL=F.rotrBH=F.rotrSL=F.rotrSH=F.shrSL=F.shrSH=F.toBig=F.split=F.fromBig=void 0;const f=BigInt(2**32-1),i=BigInt(32);function c(ye,ue=!1){return ue?{h:Number(ye&f),l:Number(ye>>i&f)}:{h:0|Number(ye>>i&f),l:0|Number(ye&f)}}function x(ye,ue=!1){let $=new Uint32Array(ye.length),o=new Uint32Array(ye.length);for(let h=0;hBigInt(ye>>>0)<>>0);F.toBig=B;const m=(ye,ue,$)=>ye>>>$;F.shrSH=m;const S=(ye,ue,$)=>ye<<32-$|ue>>>$;F.shrSL=S;const g=(ye,ue,$)=>ye>>>$|ue<<32-$;F.rotrSH=g;const _=(ye,ue,$)=>ye<<32-$|ue>>>$;F.rotrSL=_;const R=(ye,ue,$)=>ye<<64-$|ue>>>$-32;F.rotrBH=R;const T=(ye,ue,$)=>ye>>>$-32|ue<<64-$;F.rotrBL=T;const E=(ye,ue)=>ue;F.rotr32H=E;const j=(ye,ue)=>ye;F.rotr32L=j;const M=(ye,ue,$)=>ye<<$|ue>>>32-$;F.rotlSH=M;const k=(ye,ue,$)=>ue<<$|ye>>>32-$;F.rotlSL=k;const K=(ye,ue,$)=>ue<<$-32|ye>>>64-$;F.rotlBH=K;const W=(ye,ue,$)=>ye<<$-32|ue>>>64-$;function V(ye,ue,$,o){const h=(ue>>>0)+(o>>>0);return{h:ye+$+(h/2**32|0)|0,l:0|h}}F.rotlBL=W,F.add=V;const Z=(ye,ue,$)=>(ye>>>0)+(ue>>>0)+($>>>0);F.add3L=Z;const q=(ye,ue,$,o)=>ue+$+o+(ye/2**32|0)|0;F.add3H=q;const ne=(ye,ue,$,o)=>(ye>>>0)+(ue>>>0)+($>>>0)+(o>>>0);F.add4L=ne;const te=(ye,ue,$,o,h)=>ue+$+o+h+(ye/2**32|0)|0;F.add4H=te;const ie=(ye,ue,$,o,h)=>(ye>>>0)+(ue>>>0)+($>>>0)+(o>>>0)+(h>>>0);F.add5L=ie;const ae=(ye,ue,$,o,h,A)=>ue+$+o+h+A+(ye/2**32|0)|0;F.add5H=ae,F.default={fromBig:c,split:x,toBig:B,shrSH:m,shrSL:S,rotrSH:g,rotrSL:_,rotrBH:R,rotrBL:T,rotr32H:E,rotr32L:j,rotlSH:M,rotlSL:k,rotlBH:K,rotlBL:W,add:V,add3L:Z,add3H:q,add4L:ne,add4H:te,add5H:ae,add5L:ie}},89948:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.crypto=void 0,F.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},57334:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hkdf=F.expand=F.extract=void 0;const i=f(68578),c=f(96492),x=f(44882);function B(R,T,E){return(0,i.hash)(R),void 0===E&&(E=new Uint8Array(R.outputLen)),(0,x.hmac)(R,(0,c.toBytes)(E),(0,c.toBytes)(T))}F.extract=B;const m=new Uint8Array([0]),S=new Uint8Array;function g(R,T,E,j=32){if((0,i.hash)(R),(0,i.number)(j),j>255*R.outputLen)throw new Error("Length should be <= 255*HashLen");const M=Math.ceil(j/R.outputLen);void 0===E&&(E=S);const k=new Uint8Array(M*R.outputLen),K=x.hmac.create(R,T),W=K._cloneInto(),V=new Uint8Array(K.outputLen);for(let Z=0;Zg(R,B(R,T,E),j,M)},44882:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hmac=F.HMAC=void 0;const i=f(68578),c=f(96492);class x extends c.Hash{constructor(S,g){super(),this.finished=!1,this.destroyed=!1,(0,i.hash)(S);const _=(0,c.toBytes)(g);if(this.iHash=S.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const R=this.blockLen,T=new Uint8Array(R);T.set(_.length>R?S.create().update(_).digest():_);for(let E=0;Enew x(m,S).update(g).digest(),F.hmac.create=(m,S)=>new x(m,S)},1806:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha224=F.sha256=void 0;const i=f(25724),c=f(96492),x=(T,E,j)=>T&E^~T&j,B=(T,E,j)=>T&E^T&j^E&j,m=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),S=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g=new Uint32Array(64);class _ extends i.SHA2{constructor(){super(64,32,8,!1),this.A=0|S[0],this.B=0|S[1],this.C=0|S[2],this.D=0|S[3],this.E=0|S[4],this.F=0|S[5],this.G=0|S[6],this.H=0|S[7]}get(){const{A:E,B:j,C:M,D:k,E:K,F:W,G:V,H:Z}=this;return[E,j,M,k,K,W,V,Z]}set(E,j,M,k,K,W,V,Z){this.A=0|E,this.B=0|j,this.C=0|M,this.D=0|k,this.E=0|K,this.F=0|W,this.G=0|V,this.H=0|Z}process(E,j){for(let te=0;te<16;te++,j+=4)g[te]=E.getUint32(j,!1);for(let te=16;te<64;te++){const ie=g[te-15],ae=g[te-2],me=(0,c.rotr)(ie,7)^(0,c.rotr)(ie,18)^ie>>>3,ye=(0,c.rotr)(ae,17)^(0,c.rotr)(ae,19)^ae>>>10;g[te]=ye+g[te-7]+me+g[te-16]|0}let{A:M,B:k,C:K,D:W,E:V,F:Z,G:q,H:ne}=this;for(let te=0;te<64;te++){const ae=ne+((0,c.rotr)(V,6)^(0,c.rotr)(V,11)^(0,c.rotr)(V,25))+x(V,Z,q)+m[te]+g[te]|0,ye=((0,c.rotr)(M,2)^(0,c.rotr)(M,13)^(0,c.rotr)(M,22))+B(M,k,K)|0;ne=q,q=Z,Z=V,V=W+ae|0,W=K,K=k,k=M,M=ae+ye|0}M=M+this.A|0,k=k+this.B|0,K=K+this.C|0,W=W+this.D|0,V=V+this.E|0,Z=Z+this.F|0,q=q+this.G|0,ne=ne+this.H|0,this.set(M,k,K,W,V,Z,q,ne)}roundClean(){g.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class R extends _{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}F.sha256=(0,c.wrapConstructor)(()=>new _),F.sha224=(0,c.wrapConstructor)(()=>new R)},44207:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.sha384=F.sha512_256=F.sha512_224=F.sha512=F.SHA512=void 0;const i=f(25724),c=f(35059),x=f(96492),[B,m]=c.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(j=>BigInt(j))),S=new Uint32Array(80),g=new Uint32Array(80);class _ extends i.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:M,Al:k,Bh:K,Bl:W,Ch:V,Cl:Z,Dh:q,Dl:ne,Eh:te,El:ie,Fh:ae,Fl:me,Gh:ye,Gl:ue,Hh:$,Hl:o}=this;return[M,k,K,W,V,Z,q,ne,te,ie,ae,me,ye,ue,$,o]}set(M,k,K,W,V,Z,q,ne,te,ie,ae,me,ye,ue,$,o){this.Ah=0|M,this.Al=0|k,this.Bh=0|K,this.Bl=0|W,this.Ch=0|V,this.Cl=0|Z,this.Dh=0|q,this.Dl=0|ne,this.Eh=0|te,this.El=0|ie,this.Fh=0|ae,this.Fl=0|me,this.Gh=0|ye,this.Gl=0|ue,this.Hh=0|$,this.Hl=0|o}process(M,k){for(let C=0;C<16;C++,k+=4)S[C]=M.getUint32(k),g[C]=M.getUint32(k+=4);for(let C=16;C<80;C++){const O=0|S[C-15],z=0|g[C-15],H=c.default.rotrSH(O,z,1)^c.default.rotrSH(O,z,8)^c.default.shrSH(O,z,7),I=c.default.rotrSL(O,z,1)^c.default.rotrSL(O,z,8)^c.default.shrSL(O,z,7),s=0|S[C-2],p=0|g[C-2],J=c.default.rotrSH(s,p,19)^c.default.rotrBH(s,p,61)^c.default.shrSH(s,p,6),ee=c.default.rotrSL(s,p,19)^c.default.rotrBL(s,p,61)^c.default.shrSL(s,p,6),se=c.default.add4L(I,ee,g[C-7],g[C-16]),de=c.default.add4H(se,H,J,S[C-7],S[C-16]);S[C]=0|de,g[C]=0|se}let{Ah:K,Al:W,Bh:V,Bl:Z,Ch:q,Cl:ne,Dh:te,Dl:ie,Eh:ae,El:me,Fh:ye,Fl:ue,Gh:$,Gl:o,Hh:h,Hl:A}=this;for(let C=0;C<80;C++){const O=c.default.rotrSH(ae,me,14)^c.default.rotrSH(ae,me,18)^c.default.rotrBH(ae,me,41),z=c.default.rotrSL(ae,me,14)^c.default.rotrSL(ae,me,18)^c.default.rotrBL(ae,me,41),H=ae&ye^~ae&$,s=c.default.add5L(A,z,me&ue^~me&o,m[C],g[C]),p=c.default.add5H(s,h,O,H,B[C],S[C]),J=0|s,ee=c.default.rotrSH(K,W,28)^c.default.rotrBH(K,W,34)^c.default.rotrBH(K,W,39),se=c.default.rotrSL(K,W,28)^c.default.rotrBL(K,W,34)^c.default.rotrBL(K,W,39),de=K&V^K&q^V&q,Ae=W&Z^W&ne^Z≠h=0|$,A=0|o,$=0|ye,o=0|ue,ye=0|ae,ue=0|me,({h:ae,l:me}=c.default.add(0|te,0|ie,0|p,0|J)),te=0|q,ie=0|ne,q=0|V,ne=0|Z,V=0|K,Z=0|W;const Ie=c.default.add3L(J,se,Ae);K=c.default.add3H(Ie,p,ee,de),W=0|Ie}({h:K,l:W}=c.default.add(0|this.Ah,0|this.Al,0|K,0|W)),({h:V,l:Z}=c.default.add(0|this.Bh,0|this.Bl,0|V,0|Z)),({h:q,l:ne}=c.default.add(0|this.Ch,0|this.Cl,0|q,0|ne)),({h:te,l:ie}=c.default.add(0|this.Dh,0|this.Dl,0|te,0|ie)),({h:ae,l:me}=c.default.add(0|this.Eh,0|this.El,0|ae,0|me)),({h:ye,l:ue}=c.default.add(0|this.Fh,0|this.Fl,0|ye,0|ue)),({h:$,l:o}=c.default.add(0|this.Gh,0|this.Gl,0|$,0|o)),({h,l:A}=c.default.add(0|this.Hh,0|this.Hl,0|h,0|A)),this.set(K,W,V,Z,q,ne,te,ie,ae,me,ye,ue,$,o,h,A)}roundClean(){S.fill(0),g.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}F.SHA512=_;class R extends _{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class T extends _{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class E extends _{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}F.sha512=(0,x.wrapConstructor)(()=>new _),F.sha512_224=(0,x.wrapConstructor)(()=>new R),F.sha512_256=(0,x.wrapConstructor)(()=>new T),F.sha384=(0,x.wrapConstructor)(()=>new E)},96492:(Me,F,f)=>{"use strict";var i=f(29293).default;Object.defineProperty(F,"__esModule",{value:!0}),F.randomBytes=F.wrapXOFConstructorWithOpts=F.wrapConstructorWithOpts=F.wrapConstructor=F.checkOpts=F.Hash=F.concatBytes=F.toBytes=F.utf8ToBytes=F.asyncLoop=F.nextTick=F.hexToBytes=F.bytesToHex=F.isLE=F.rotr=F.createView=F.u32=F.u8=void 0;const c=f(89948);function m(ue){return ue instanceof Uint8Array||null!=ue&&"object"==typeof ue&&"Uint8Array"===ue.constructor.name}if(F.u8=ue=>new Uint8Array(ue.buffer,ue.byteOffset,ue.byteLength),F.u32=ue=>new Uint32Array(ue.buffer,ue.byteOffset,Math.floor(ue.byteLength/4)),F.createView=ue=>new DataView(ue.buffer,ue.byteOffset,ue.byteLength),F.rotr=(ue,$)=>ue<<32-$|ue>>>$,F.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!F.isLE)throw new Error("Non little-endian hardware is not supported");const _=Array.from({length:256},(ue,$)=>$.toString(16).padStart(2,"0"));F.bytesToHex=function R(ue){if(!m(ue))throw new Error("Uint8Array expected");let $="";for(let o=0;o=T__0&&ue<=T__9?ue-T__0:ue>=T__A&&ue<=T__F?ue-(T__A-10):ue>=T__a&&ue<=T__f?ue-(T__a-10):void 0}function K(){return(K=i(function*(ue,$,o){let h=Date.now();for(let A=0;A=0&&C<$||(yield(0,F.nextTick)(),h+=C)}})).apply(this,arguments)}function W(ue){if("string"!=typeof ue)throw new Error("utf8ToBytes expected string, got "+typeof ue);return new Uint8Array((new TextEncoder).encode(ue))}function V(ue){if("string"==typeof ue&&(ue=W(ue)),!m(ue))throw new Error("expected Uint8Array, got "+typeof ue);return ue}F.hexToBytes=function j(ue){if("string"!=typeof ue)throw new Error("hex string expected, got "+typeof ue);const $=ue.length,o=$/2;if($%2)throw new Error("padded hex string expected, got unpadded hex of length "+$);const h=new Uint8Array(o);for(let A=0,C=0;Aue().update(V(h)).digest(),o=ue();return $.outputLen=o.outputLen,$.blockLen=o.blockLen,$.create=()=>ue(),$},F.wrapConstructorWithOpts=function ae(ue){const $=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return $.outputLen=o.outputLen,$.blockLen=o.blockLen,$.create=h=>ue(h),$},F.wrapXOFConstructorWithOpts=function me(ue){const $=(h,A)=>ue(A).update(V(h)).digest(),o=ue({});return $.outputLen=o.outputLen,$.blockLen=o.blockLen,$.create=h=>ue(h),$},F.randomBytes=function ye(ue=32){if(c.crypto&&"function"==typeof c.crypto.getRandomValues)return c.crypto.getRandomValues(new Uint8Array(ue));throw new Error("crypto.getRandomValues must be defined")}},15315:(Me,F,f)=>{"use strict";var o,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,g=(o,h)=>{var A={};for(var C in o)m.call(o,C)&&h.indexOf(C)<0&&(A[C]=o[C]);if(null!=o&&B)for(var C of B(o))h.indexOf(C)<0&&S.call(o,C)&&(A[C]=o[C]);return A},E=(o,h,A)=>new Promise((C,O)=>{var z=s=>{try{I(A.next(s))}catch(p){O(p)}},H=s=>{try{I(A.throw(s))}catch(p){O(p)}},I=s=>s.done?C(s.value):Promise.resolve(s.value).then(z,H);I((A=A.apply(o,h)).next())}),j={};((o,h)=>{for(var A in h)i(o,A,{get:h[A],enumerable:!0})})(j,{createHashMapping:()=>ae,createHashMappingSync:()=>me,decodeJwt:()=>K,decodeSdJwt:()=>V,decodeSdJwtSync:()=>Z,getClaims:()=>q,getClaimsSync:()=>ne,getSDAlgAndPayload:()=>ye,splitSdJwt:()=>W,unpack:()=>ue,unpackArray:()=>te,unpackObj:()=>ie,unpackSync:()=>$}),Me.exports=(o=j,((o,h,A,C)=>{if(h&&"object"==typeof h||"function"==typeof h)for(let O of x(h))!m.call(o,O)&&undefined!==O&&i(o,O,{get:()=>h[O],enumerable:!(C=c(h,O))||C.enumerable});return o})(i({},"__esModule",{value:!0}),o));var M=f(47862),k=f(29994),K=o=>{const{0:h,1:A,2:C,length:O}=o.split(".");if(3!==O)throw new M.SDJWTException("Invalid JWT as input");return{header:JSON.parse((0,M.base64urlDecode)(h)),payload:JSON.parse((0,M.base64urlDecode)(A)),signature:C}},W=o=>{const[h,...A]=o.split(k.SD_SEPARATOR);if(0===A.length)return{jwt:h,disclosures:[]};const C=A.pop();return{jwt:h,disclosures:A,kbJwt:C||void 0}},V=(o,h)=>E(void 0,null,function*(){const[A,...C]=o.split(k.SD_SEPARATOR),O=K(A);if(0===C.length)return{jwt:O,disclosures:[]};const z=C.pop(),H=z?K(z):void 0,{_sd_alg:I}=ye(O.payload);return{jwt:O,disclosures:yield Promise.all(C.map(p=>M.Disclosure.fromEncode(p,{alg:I,hasher:h}))),kbJwt:H}}),Z=(o,h)=>{const[A,...C]=o.split(k.SD_SEPARATOR),O=K(A);if(0===C.length)return{jwt:O,disclosures:[]};const z=C.pop(),H=z?K(z):void 0,{_sd_alg:I}=ye(O.payload);return{jwt:O,disclosures:C.map(p=>M.Disclosure.fromEncodeSync(p,{alg:I,hasher:h})),kbJwt:H}},q=(o,h,A)=>E(void 0,null,function*(){const{unpackedObj:C}=yield ue(o,h,A);return C}),ne=(o,h,A)=>{const{unpackedObj:C}=$(o,h,A);return C},te=(o,h,A="")=>{const C={},O=[];return o.forEach((z,H)=>{if("object"==typeof z&&null!==z){const I=z[k.SD_LIST_KEY];if(I){const s=h[I];if(s){const p=A?`${A}.${H}`:`${H}`;C[p]=I;const{unpackedObj:J,disclosureKeymap:ee}=ie(s.value,h,p);O.push(J),Object.assign(C,ee)}}else{const s=A?`${A}.${H}`:`${H}`,{unpackedObj:p,disclosureKeymap:J}=ie(z,h,s);O.push(p),Object.assign(C,J)}}else O.push(z)}),{unpackedObj:O,disclosureKeymap:C}},ie=(o,h,A="")=>{const C={};if("object"==typeof o&&null!==o){if(Array.isArray(o))return te(o,h,A);for(const p in o)if(p!==k.SD_DIGEST&&p!==k.SD_LIST_KEY&&"object"==typeof o[p]){const J=A?`${A}.${p}`:p,{unpackedObj:ee,disclosureKeymap:se}=ie(o[p],h,J);o[p]=ee,Object.assign(C,se)}const O=o,{_sd:z}=O,H=g(O,["_sd"]),I={};if(z)for(const p of z){const J=h[p];if(J?.key){const ee=A?`${A}.${J.key}`:J.key;C[ee]=p;const{unpackedObj:se,disclosureKeymap:de}=ie(J.value,h,ee);I[J.key]=se,Object.assign(C,de)}}return{unpackedObj:Object.assign(H,I),disclosureKeymap:C}}return{unpackedObj:o,disclosureKeymap:C}},ae=(o,h)=>E(void 0,null,function*(){const A={};for(let C=0;C{const A={};for(let C=0;C{const h=o,{_sd_alg:A}=h,C=g(h,["_sd_alg"]);return"string"!=typeof A?{_sd_alg:"sha-256",payload:C}:{_sd_alg:A,payload:C}},ue=(o,h,A)=>E(void 0,null,function*(){const{_sd_alg:C,payload:O}=ye(o),H=yield ae(h,{hasher:A,alg:C});return ie(O,H)}),$=(o,h,A)=>{const{_sd_alg:C,payload:O}=ye(o),H=me(h,{hasher:A,alg:C});return ie(O,H)}},22084:(Me,F,f)=>{"use strict";var ne,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,_=(ne,te,ie)=>new Promise((ae,me)=>{var ye=o=>{try{$(ie.next(o))}catch(h){me(h)}},ue=o=>{try{$(ie.throw(o))}catch(h){me(h)}},$=o=>o.done?ae(o.value):Promise.resolve(o.value).then(ye,ue);$((ie=ie.apply(ne,te)).next())}),R={};((ne,te)=>{for(var ie in te)i(ne,ie,{get:te[ie],enumerable:!0})})(R,{createHashMappingForSerializedDisclosure:()=>Z,present:()=>K,presentSync:()=>W,presentableKeys:()=>M,presentableKeysSync:()=>k,selectDisclosures:()=>q,transformPresentationFrame:()=>V}),Me.exports=(ne=R,((ne,te,ie,ae)=>{if(te&&"object"==typeof te||"function"==typeof te)for(let me of x(te))!B.call(ne,me)&&undefined!==me&&i(ne,me,{get:()=>te[me],enumerable:!(ae=c(te,me))||ae.enumerable});return ne})(i({},"__esModule",{value:!0}),ne));var T=f(29994),E=f(47862),j=f(15315),M=(ne,te,ie)=>_(void 0,null,function*(){const{disclosureKeymap:ae}=yield(0,j.unpack)(ne,te,ie);return Object.keys(ae).sort()}),k=(ne,te,ie)=>{const{disclosureKeymap:ae}=(0,j.unpackSync)(ne,te,ie);return Object.keys(ae).sort()},K=(ne,te,ie)=>_(void 0,null,function*(){const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(ne),{jwt:{payload:ye},disclosures:ue}=yield(0,j.decodeSdJwt)(ne,ie),{_sd_alg:$}=(0,j.getSDAlgAndPayload)(ye),o={alg:$,hasher:ie},h=V(te),A=yield(0,j.createHashMapping)(ue,o),{disclosureKeymap:C}=yield(0,j.unpack)(ye,ue,ie);return[ae,...h.map(z=>A[C[z]]).filter(z=>void 0!==z).map(z=>z.encode()),me??""].join(T.SD_SEPARATOR)}),W=(ne,te,ie)=>{const{jwt:ae,kbJwt:me}=(0,j.splitSdJwt)(ne),{jwt:{payload:ye},disclosures:ue}=(0,j.decodeSdJwtSync)(ne,ie),{_sd_alg:$}=(0,j.getSDAlgAndPayload)(ye),o={alg:$,hasher:ie},h=V(te),A=(0,j.createHashMappingSync)(ue,o),{disclosureKeymap:C}=(0,j.unpackSync)(ye,ue,ie);return[ae,...h.map(z=>A[C[z]]).filter(z=>void 0!==z).map(z=>z.encode()),me??""].join(T.SD_SEPARATOR)},V=(ne,te="")=>Object.entries(ne).reduce((ie,[ae,me])=>{const ye=te?`${te}.${ae}`:ae;return"boolean"==typeof me?me&&ie.push(ye):ie.push(ye,...V(me,ye)),ie},[]),Z=ne=>{const te={};for(let ie=0;ie{if(0===te.length)return[];const ae=Z(te),{disclosureKeymap:me}=(0,j.unpackObj)(ne,ae);return V(ie).map(o=>ae[me[o]]).filter(o=>void 0!==o).map(o=>{const{salt:h,key:A,value:C,_digest:O}=o;if(!O)throw new E.SDJWTException("Implementation error: _digest is not defined");return{digest:O,encoded:o.encode(),salt:h,key:A,value:C}})}},29994:Me=>{"use strict";var j,F=Object.defineProperty,f=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,c=Object.prototype.hasOwnProperty,S={};((j,M)=>{for(var k in M)F(j,k,{get:M[k],enumerable:!0})})(S,{KB_JWT_TYP:()=>E,SD_DECOY:()=>T,SD_DIGEST:()=>R,SD_LIST_KEY:()=>_,SD_SEPARATOR:()=>g}),Me.exports=(j=S,((j,M,k,K)=>{if(M&&"object"==typeof M||"function"==typeof M)for(let W of i(M))!c.call(j,W)&&undefined!==W&&F(j,W,{get:()=>M[W],enumerable:!(K=f(M,W))||K.enumerable});return j})(F({},"__esModule",{value:!0}),j));var g="~",_="...",R="_sd",T="_sd_decoy",E="kb+jwt"},47862:(Me,F,f)=>{"use strict";var W,i=Object.defineProperty,c=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,B=Object.prototype.hasOwnProperty,_=(W,V,Z)=>new Promise((q,ne)=>{var te=me=>{try{ae(Z.next(me))}catch(ye){ne(ye)}},ie=me=>{try{ae(Z.throw(me))}catch(ye){ne(ye)}},ae=me=>me.done?q(me.value):Promise.resolve(me.value).then(te,ie);ae((Z=Z.apply(W,V)).next())}),R={};((W,V)=>{for(var Z in V)i(W,Z,{get:V[Z],enumerable:!0})})(R,{Disclosure:()=>K,SDJWTException:()=>k,base64urlDecode:()=>j,base64urlEncode:()=>E,uint8ArrayToBase64Url:()=>M}),Me.exports=(W=R,((W,V,Z,q)=>{if(V&&"object"==typeof V||"function"==typeof V)for(let ne of x(V))!B.call(W,ne)&&undefined!==ne&&i(W,ne,{get:()=>V[ne],enumerable:!(q=c(V,ne))||q.enumerable});return W})(i({},"__esModule",{value:!0}),W));var T=f(12398),E=T.Base64.encodeURI,j=T.Base64.decode,M=W=>T.Base64.fromUint8Array(W,!0),k=class hO extends Error{constructor(V,Z){super(V),Object.setPrototypeOf(this,hO.prototype),this.name="SDJWTException",this.details=Z}getFullMessage(){return`${this.name}: ${this.message} ${this.details?`- ${JSON.stringify(this.details)}`:""}`}},K=class yM{constructor(V,Z){if(this._digest=Z?.digest,this._encoded=Z?.encoded,2===V.length)return this.salt=V[0],void(this.value=V[1]);if(3===V.length)return this.salt=V[0],this.key=V[1],void(this.value=V[2]);throw new k("Invalid disclosure data")}static fromEncode(V,Z){return _(this,null,function*(){const{hasher:q,alg:ne}=Z,te=yield q(V,ne),ie=M(te),ae=JSON.parse(j(V));return yM.fromArray(ae,{digest:ie,encoded:V})})}static fromEncodeSync(V,Z){const{hasher:q,alg:ne}=Z,te=q(V,ne),ie=M(te),ae=JSON.parse(j(V));return yM.fromArray(ae,{digest:ie,encoded:V})}static fromArray(V,Z){return new yM(V,Z)}encode(){return this._encoded||(this._encoded=E(JSON.stringify(this.decode()))),this._encoded}decode(){return this.key?[this.salt,this.key,this.value]:[this.salt,this.value]}digest(V){return _(this,null,function*(){const{hasher:Z,alg:q}=V;if(!this._digest){const ne=yield Z(this.encode(),q);this._digest=M(ne)}return this._digest})}digestSync(V){const{hasher:Z,alg:q}=V;if(!this._digest){const ne=Z(this.encode(),q);this._digest=M(ne)}return this._digest}}},47636:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(83858),F)},66091:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25515:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},18414:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},95517:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},37728:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39762:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Directives=void 0,F.Directives={Required:"required",Allowed:"allowed",Disallowed:"disallowed"}},891:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ExchangeStatus=void 0,F.ExchangeStatus={Created:"CREATED",Submitted:"SUBMITTED",HolderDeclined:"HOLDER_DECLINED",Expired:"EXPIRED",Accepted:"ACCEPTED",VerifierDeclined:"VERIFIER_DECLINED"}},67847:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},40826:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},56911:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},17954:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79506:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},23843:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},39711:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},5179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},68020:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},54078:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},81755:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},73725:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},87260:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},75873:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},83858:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(66091),F),c(f(80723),F),c(f(25515),F),c(f(18414),F),c(f(95517),F),c(f(37728),F),c(f(39762),F),c(f(891),F),c(f(67847),F),c(f(40826),F),c(f(56911),F),c(f(17954),F),c(f(79506),F),c(f(23843),F),c(f(39711),F),c(f(5179),F),c(f(68020),F),c(f(54078),F),c(f(81755),F),c(f(83947),F),c(f(73725),F),c(f(87260),F),c(f(75873),F),c(f(99959),F),c(f(41787),F),c(f(25526),F),c(f(8946),F),c(f(62704),F),c(f(13065),F),c(f(42834),F),c(f(32206),F),c(f(35723),F),c(f(31748),F),c(f(80125),F),c(f(9668),F),c(f(57669),F),c(f(56179),F),c(f(79369),F),c(f(6982),F),c(f(46521),F),c(f(28858),F),c(f(78029),F),c(f(3296),F)},99959:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},41787:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},25526:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Optionality=void 0,F.Optionality={Required:"required",Preferred:"preferred"}},8946:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},62704:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},13065:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},42834:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},32206:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},35723:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},31748:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},80125:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},9668:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},57669:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Rules=void 0,F.Rules={All:"all",Pick:"pick"}},56179:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},79369:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},6982:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.Status=void 0,F.Status={Success:"SUCCESS",Warn:"WARN",Error:"ERROR"}},46521:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},28858:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},78029:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},3296:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30720:(Me,F,f)=>{"use strict";F.E8=void 0;const c=f(2700);Object.defineProperty(F,"E8",{enumerable:!0,get:function(){return c.PEX}})},55776:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.hasErrors=F.Checked=F.Status=void 0,F.Status={INFO:"info",WARN:"warn",ERROR:"error"},F.Checked=class{constructor(c,x,B){this.tag=c,this.status=x,this.message=B}},F.hasErrors=c=>c.filter(B=>function x(B){return B.status===F.Status.ERROR}(B)).length>0},97889:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(T,E,j,M){return new(j||(j=Promise))(function(K,W){function V(ne){try{q(M.next(ne))}catch(te){W(te)}}function Z(ne){try{q(M.throw(ne))}catch(te){W(te)}}function q(ne){ne.done?K(ne.value):function k(K){return K instanceof j?K:new j(function(W){W(K)})}(ne.value).then(V,Z)}q((M=M.apply(T,E||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.PEX=void 0;const c=f(11151),x=f(55776),B=f(70143),m=f(64864),S=f(99938),g=f(13486),_=f(80930);class R{constructor(E){this._evaluationClientWrapper=new B.EvaluationClientWrapper,this.options=E}evaluatePresentation(E,j,M){var k,K,W;const V=void 0!==M?.generatePresentationSubmission?M.generatePresentationSubmission:void 0===M?.presentationSubmission,Z=S.SSITypesBuilder.toInternalPresentationDefinition(E),q=JSON.parse(JSON.stringify(j)),ne=S.SSITypesBuilder.mapExternalVerifiablePresentationToWrappedVP(q,null===(k=this.options)||void 0===k?void 0:k.hasher),te=null!==(K=M?.presentationSubmission)&&void 0!==K?K:ne.decoded.presentation_submission;if(!te&&!V)throw Error("Either a presentation submission as part of the VP or provided separately was expected");const ie=c.CredentialMapper.isW3cPresentation(ne.presentation)&&ne.presentation.holder?[ne.presentation.holder]:[],ae=Object.assign(Object.assign({},M),{holderDIDs:ie,presentationSubmission:te,generatePresentationSubmission:V}),me=this._evaluationClientWrapper.evaluate(Z,ne.vcs,ae);return!(null===(W=me.value)||void 0===W)&&W.descriptor_map.length&&(new B.EvaluationClientWrapper).selectFrom(Z,ne.vcs,ae).areRequiredCredentialsPresent!==x.Status.ERROR&&(me.errors=[]),me}evaluateCredentials(E,j,M){var k;const K=S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher);this._evaluationClientWrapper=new B.EvaluationClientWrapper;const W=S.SSITypesBuilder.toInternalPresentationDefinition(E),V=this._evaluationClientWrapper.evaluate(W,K,M);if(V.value&&V.value.descriptor_map.length){const q=(new B.EvaluationClientWrapper).selectFrom(W,K,M);V.areRequiredCredentialsPresent=q.areRequiredCredentialsPresent,V.errors=q.errors}else V.areRequiredCredentialsPresent=x.Status.ERROR;return V}selectFrom(E,j,M){var k;const K=JSON.parse(JSON.stringify(j)),W=S.SSITypesBuilder.toInternalPresentationDefinition(E);return this._evaluationClientWrapper=new B.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(W,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(K,null===(k=this.options)||void 0===k?void 0:k.hasher),M)}presentationSubmissionFrom(E,j,M){var k;const K=S.SSITypesBuilder.toInternalPresentationDefinition(E);return this._evaluationClientWrapper.submissionFrom(K,S.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j,null===(k=this.options)||void 0===k?void 0:k.hasher),M)}presentationFrom(E,j,M){var k,K;const W=this.presentationSubmissionFrom(E,j,M),V=j.some(ne=>c.CredentialMapper.isSdJwtDecodedCredential(ne)||c.CredentialMapper.isSdJwtEncoded(ne));if(M?.presentationSubmissionLocation===m.PresentationSubmissionLocation.PRESENTATION&&V)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const Z=null!==(k=M?.presentationSubmissionLocation)&&void 0!==k?k:V?m.PresentationSubmissionLocation.EXTERNAL:m.PresentationSubmissionLocation.PRESENTATION;return{presentation:R.constructPresentation(j,Object.assign(Object.assign({},M),{presentationSubmission:Z===m.PresentationSubmissionLocation.PRESENTATION?W:void 0,hasher:null===(K=this.options)||void 0===K?void 0:K.hasher})),presentationSubmissionLocation:Z,presentationSubmission:W}}static constructPresentation(E,j){var M,k,K,W;const V=Array.isArray(E)?E:[E];if(V.some(Z=>c.CredentialMapper.isSdJwtDecodedCredential(Z)||c.CredentialMapper.isSdJwtEncoded(Z))){if(V.length>1)throw new Error("Only a single credential is supported when creating a presentation with an SD-JWT VC");if(j?.presentationSubmission)throw new Error("Presentation submission cannot be included in the presentation when creating a presentation with an SD-JWT VC");if(j?.basePresentationPayload)throw new Error("Base presentation payload cannot be when creating a presentation from an SD-JWT VC");const Z=c.CredentialMapper.isSdJwtEncoded(V[0])?c.CredentialMapper.decodeVerifiableCredential(V[0],j?.hasher):V[0];if(!j?.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const q=null!==(M=Z.signedPayload._sd_alg)&&void 0!==M?M:"sha-256",ne=(0,g.calculateSdHash)(Z.compactSdJwtVc,q,j.hasher),te={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),_sd_hash:ne}};return Object.assign(Object.assign({},Z),{kbJwt:te})}{if(!E)throw Error("At least a verifiable credential needs to be passed in to create a presentation");const Z=Array.isArray(E)?E:[E],q=Z.map(me=>c.CredentialMapper.toWrappedVerifiableCredential(me)),ne=Array.from(new Set(q.flatMap(me=>(0,g.getSubjectIdsAsString)(me.credential))));1!==ne.length&&!j?.holderDID&&console.log(`We deduced ${ne.length} subject from ${q.length} Verifiable Credentials, and no holder property was given. This might lead to undesired results`);const te=null!==(k=j?.holderDID)&&void 0!==k?k:1===ne.length?ne[0]:void 0,ie=null!==(K=j?.basePresentationPayload)&&void 0!==K&&K.type?Array.isArray(j.basePresentationPayload.type)?j.basePresentationPayload.type:[j.basePresentationPayload.type]:[];ie.includes("VerifiablePresentation")||ie.push("VerifiablePresentation");const ae=null!==(W=j?.basePresentationPayload)&&void 0!==W&&W["@context"]?Array.isArray(j.basePresentationPayload["@context"])?j.basePresentationPayload["@context"]:[j.basePresentationPayload["@context"]]:[];return ae.includes("https://www.w3.org/2018/credentials/v1")||ae.push("https://www.w3.org/2018/credentials/v1"),j?.presentationSubmission&&(ie.includes("PresentationSubmission")||ie.push("PresentationSubmission"),ae.includes("https://identity.foundation/presentation-exchange/submission/v1")||ae.push("https://identity.foundation/presentation-exchange/submission/v1")),Object.assign(Object.assign(Object.assign(Object.assign({},j?.basePresentationPayload),{"@context":ae,type:ie,holder:te}),!!j?.presentationSubmission&&{presentation_submission:j.presentationSubmission}),{verifiableCredential:Z})}}static validateDefinition(E){const j=(0,g.definitionVersionDiscovery)(E);if(j.error)throw new Error(j.error);const M=[];return M.push(j.version===S.PEVersion.v1?{bundler:new _.PresentationDefinitionV1VB("root"),target:S.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(E)}:{bundler:new _.PresentationDefinitionV2VB("root"),target:S.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(E)}),(new _.ValidationEngine).validate(M)}static validateSubmission(E){return(new _.ValidationEngine).validate([{bundler:new _.PresentationSubmissionVB("root"),target:E}])}verifiablePresentationFrom(E,j,M,k){return i(this,void 0,void 0,function*(){var K,W;const{holderDID:V,signatureOptions:Z,proofOptions:q}=k,te=V?[V]:[],ie=function ne(){let A=[];if(q?.typeSupportsSelectiveDisclosure){if(!q?.type)throw Error("Please provide a proof type if you enable selective disclosure");A=[q.type]}return A}(),ae=this.evaluateCredentials(E,j,{holderDIDs:te,limitDisclosureSignatureSuites:ie}),me=this.presentationFrom(E,ae.verifiableCredential,k),ye=this.evaluatePresentation(E,me.presentation,Object.assign({limitDisclosureSignatureSuites:ie},me.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&{presentationSubmission:me.presentationSubmission}));if(!ye.value)throw new Error("Could not get evaluation results from presentationResult");const ue={type:q?.type,verificationMethod:Z?.verificationMethod,created:q?.created?q.created:(new Date).toISOString(),proofPurpose:q?.proofPurpose,proofValue:Z?.proofValue,jws:Z?.jws,challenge:q?.challenge,nonce:q?.nonce,domain:q?.domain};let $=me.presentation;if(c.CredentialMapper.isSdJwtDecodedCredential(me.presentation)){if(null===(K=this.options)||void 0===K||!K.hasher)throw new Error("Hasher must be provided when creating a presentation with an SD-JWT VC");const A=null!==(W=me.presentation.signedPayload._sd_alg)&&void 0!==W?W:"sha-256",C=(0,g.calculateSdHash)(me.presentation.compactSdJwtVc,A,this.options.hasher),O={header:{typ:"kb+jwt"},payload:{iat:(new Date).getTime(),nonce:q?.nonce,_sd_hash:C}};$=Object.assign(Object.assign({},$),{kbJwt:O})}const o={options:Object.assign(Object.assign({},k),{presentationSubmissionLocation:me.presentationSubmissionLocation}),presentation:$,presentationDefinition:E,selectedCredentials:j,proof:ue,presentationSubmission:ye.value,evaluationResults:ye};return{verifiablePresentation:yield M(o),presentationSubmissionLocation:me.presentationSubmissionLocation,presentationSubmission:ye.value}})}static definitionVersionDiscovery(E){return(0,g.definitionVersionDiscovery)(E)}}F.PEX=R},38992:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv1=void 0;const i=f(11151),c=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv1=class g extends c.PEX{evaluatePresentation(R,T,E){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluatePresentation(R,T,E)}evaluateCredentials(R,T,E){return m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),super.evaluateCredentials(R,T,E)}selectFrom(R,T,E){const j=JSON.parse(JSON.stringify(T));return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(j),E)}presentationFrom(R,T,E){var j;const M=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(T),E),k=T.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(E?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const K=null!==(j=E?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:c.PEX.constructPresentation(T,Object.assign(Object.assign({},E),{presentationSubmission:K===B.PresentationSubmissionLocation.PRESENTATION?M:void 0})),presentationSubmissionLocation:K,presentationSubmission:M}}static validateDefinition(R){const T=m.SSITypesBuilder.modelEntityToInternalPresentationDefinitionV1(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV1VB("root"),target:T}])}static validateSubmission(R){return c.PEX.validateSubmission(R)}}},71945:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=void 0;const i=f(11151),c=f(97889),x=f(70143),B=f(64864),m=f(99938),S=f(80930);F.PEXv2=class g extends c.PEX{evaluatePresentation(R,T,E){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluatePresentation(R,T,E)}evaluateCredentials(R,T,E){return m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),super.evaluateCredentials(R,T,E)}selectFrom(R,T,E){return this._evaluationClientWrapper=new x.EvaluationClientWrapper,this._evaluationClientWrapper.selectFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(T),E)}presentationFrom(R,T,E){var j;const M=this._evaluationClientWrapper.submissionFrom(m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R),m.SSITypesBuilder.mapExternalVerifiableCredentialsToWrappedVcs(T),E),k=T.some(V=>i.CredentialMapper.isSdJwtDecodedCredential(V)||i.CredentialMapper.isSdJwtEncoded(V));if(E?.presentationSubmissionLocation===B.PresentationSubmissionLocation.PRESENTATION&&k)throw new Error("Presentation submission location cannot be set to presentation when creating a presentation with an SD-JWT VC");const K=null!==(j=E?.presentationSubmissionLocation)&&void 0!==j?j:k?B.PresentationSubmissionLocation.EXTERNAL:B.PresentationSubmissionLocation.PRESENTATION;return{presentation:c.PEX.constructPresentation(T,Object.assign(Object.assign({},E),{presentationSubmission:K===B.PresentationSubmissionLocation.PRESENTATION?M:void 0})),presentationSubmissionLocation:K,presentationSubmission:M}}static validateDefinition(R){const T=m.SSITypesBuilder.modelEntityInternalPresentationDefinitionV2(R);return(new S.ValidationEngine).validate([{bundler:new S.PresentationDefinitionV2VB("root"),target:T}])}static validateSubmission(R){return c.PEX.validateSubmission(R)}}},38947:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},45994:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=void 0,F.HandlerCheckResult=class{constructor(i,c,x,B,m,S){this.input_descriptor_path=i,this.verifiable_credential_path=c,this.evaluator=x,this.status=B,this.message=m,this.payload=S}}},92127:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(38947),F),c(f(45994),F),c(f(83565),F),c(f(21235),F)},83565:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},21235:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50950:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClient=void 0;const c=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(71001),g=[c.IProofType.BbsBlsSignatureProof2020,"DataIntegrityProof.anoncreds-2023"];F.EvaluationClient=class _{constructor(){this.failed_catched={tag:"root",status:x.Status.ERROR,message:B.default.UNKNOWN_EXCEPTION,stacktrace:""},this._results=[],this._wrappedVcs=[],this._presentationSubmission={},this._dids=[],this._limitDisclosureSignatureSuites=g,this._restrictToDIDMethods=[],this._generatePresentationSubmission=!0}evaluate(T,E,j){this._restrictToDIDMethods=j?.restrictToDIDMethods?(0,m.uniformDIDMethods)(j?.restrictToDIDMethods):[],this._dids=j?.holderDIDs?(0,m.filterToRestrictedDIDs)(j.holderDIDs,this._restrictToDIDMethods):[],this._limitDisclosureSignatureSuites=j?.limitDisclosureSignatureSuites,this._restrictToFormats=j?.restrictToFormats,this._generatePresentationSubmission=void 0===j?.generatePresentationSubmission||j.generatePresentationSubmission,j?.presentationSubmission&&(this._presentationSubmission=j.presentationSubmission);let M=this.initEvaluationHandlers();for(M?.handle(T,E);M?.hasNext();){M=M.getNext();try{M?.handle(T,E)}catch(k){throw this.failed_catched.message+=k.message,this.failed_catched.stacktrace=k,this.failed_catched}}}get results(){return this._results}get dids(){return this._dids}set dids(T){this._dids=T}assertPresentationSubmission(){if("string"==typeof this._presentationSubmission&&(console.log("Presentation submission present, but as string not object. External calls did not follow contract. Correcting"),this._presentationSubmission=JSON.parse(this._presentationSubmission)),!(this.generatePresentationSubmission||this.presentationSubmission&&0!==Object.keys(this.presentationSubmission).length))throw Error("No presentation submission present, but required option was set")}get generatePresentationSubmission(){return this._generatePresentationSubmission}set generatePresentationSubmission(T){this._generatePresentationSubmission=T}get presentationSubmission(){return this._presentationSubmission}set presentationSubmission(T){this._presentationSubmission=T}get wrappedVcs(){return this._wrappedVcs}set wrappedVcs(T){this._wrappedVcs=T}get limitDisclosureSignatureSuites(){return this._limitDisclosureSignatureSuites||g}set limitDisclosureSignatureSuites(T){this._limitDisclosureSignatureSuites=T}get restrictToDIDMethods(){return this._restrictToDIDMethods}set restrictToDIDMethods(T){this._restrictToDIDMethods=(0,m.uniformDIDMethods)(T)}hasRestrictToDIDMethods(){return this.restrictToDIDMethods&&this.restrictToDIDMethods.length>0}get restrictToFormats(){return this._restrictToFormats}set restrictToFormats(T){this._restrictToFormats=T}initEvaluationHandlers(){const T=new S.UriEvaluationHandler(this);return T.setNext(new S.DIDRestrictionEvaluationHandler(this)).setNext(new S.FormatRestrictionEvaluationHandler(this)).setNext(new S.InputDescriptorFilterEvaluationHandler(this)).setNext(new S.PredicateRelatedFieldEvaluationHandler(this)).setNext(new S.LimitDisclosureEvaluationHandler(this)).setNext(new S.SubjectIsIssuerEvaluationHandler(this)).setNext(new S.SubjectIsHolderEvaluationHandler(this)).setNext(new S.SameSubjectEvaluationHandler(this)).setNext(new S.MarkForSubmissionEvaluationHandler(this)),T}}},78995:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.EvaluationClientWrapper=void 0;const i=f(44273),c=f(47636),x=f(11151),B=f(55776),m=f(64864),S=f(13486),g=f(50950);F.EvaluationClientWrapper=class _{constructor(){this._client=new g.EvaluationClient}getEvaluationClient(){return this._client}selectFrom(T,E,j){var M;let k;this._client.evaluate(T,E,j);const K=[...this.formatNotInfo(B.Status.WARN)],W=[...this.formatNotInfo(B.Status.ERROR)];if(T.submission_requirements){const V=this._client.results.filter(ae=>"MarkForSubmissionEvaluation"===ae.evaluator&&ae.payload.group&&ae.status!==B.Status.ERROR),Z=Array.from(new Set(V));let q;try{q=this.matchSubmissionRequirements(T,T.submission_requirements,Z)}catch(ae){const me={status:B.Status.ERROR,message:JSON.stringify(ae),tag:"matchSubmissionRequirements"};return{errors:W?[...W,me]:[me],warnings:K,areRequiredCredentialsPresent:B.Status.ERROR}}const te=this.extractMatches(q).map(ae=>i.JSONPath.nodes(this._client.wrappedVcs.map(me=>me.original),ae)[0].value),ie=this.determineAreRequiredCredentialsPresent(T,q);k={errors:ie===B.Status.INFO?[]:W,matches:[...q],areRequiredCredentialsPresent:ie,verifiableCredential:te,warnings:K}}else{const V=this._client.results.filter(q=>"MarkForSubmissionEvaluation"===q.evaluator&&q.status!==B.Status.ERROR);if(this.checkWithoutSubmissionRequirements(V,T).length)return{errors:W,matches:[],areRequiredCredentialsPresent:B.Status.ERROR,verifiableCredential:E.map(q=>q.original),warnings:K};{const q=this.matchWithoutSubmissionRequirements(V,T),te=this.extractMatches(q).map(ie=>i.JSONPath.nodes(this._client.wrappedVcs.map(ae=>ae.original),ie)[0].value);k={errors:[],matches:[...q],areRequiredCredentialsPresent:B.Status.INFO,verifiableCredential:te,warnings:K}}}return this.fillSelectableCredentialsToVerifiableCredentialsMapping(k,E),k.areRequiredCredentialsPresent=this.determineAreRequiredCredentialsPresent(T,k?.matches),this.remapMatches(E.map(V=>V.original),k.matches,k?.verifiableCredential),null===(M=k.matches)||void 0===M||M.forEach(V=>{this.updateSubmissionRequirementMatchPathToAlias(V,"verifiableCredential")}),k.areRequiredCredentialsPresent===B.Status.INFO?k.errors=[]:(k.errors=W,k.warnings=K,k.verifiableCredential=E.map(V=>V.original)),k}remapMatches(T,E,j){E?.forEach(M=>{M.from_nested?this.remapMatches(T,M.from_nested,j):M.vc_path.forEach((k,K,W)=>{const V=i.JSONPath.query(T,k)[0],Z=j?.findIndex(q=>JSON.stringify(q)===JSON.stringify(V));if(-1===Z)throw new Error(`The index of the VerifiableCredential in your current call can't be found in your previously submitted credentials. Are you trying to send a new Credential?\nverifiableCredential: ${V}`);W[K]=`$[${Z}]`})})}extractMatches(T){const E=[];return T.forEach(j=>{E.push(...j.vc_path),j.from_nested&&E.push(...this.extractMatches(j.from_nested))}),Array.from(new Set(E))}checkWithoutSubmissionRequirements(T,E){const j=[];if(!E.input_descriptors)return[];if(!T.length)return[{input_descriptor_path:"",evaluator:"checkWithoutSubmissionRequirement",verifiable_credential_path:"",status:B.Status.ERROR,payload:"Not all the InputDescriptors are addressed"}];const M=E.input_descriptors,k=S.ObjectUtils.getDistinctFieldInObject(T,"input_descriptor_path");if(k.length!==M.length){const K=k.map(W=>S.JsonPathUtils.extractInputField(E,[W])[0].value).map(W=>W.id);for(let W=0;WZ.original)};if(V.warnings=this.formatNotInfo(B.Status.WARN),V.errors=this.formatNotInfo(B.Status.ERROR),this._client.assertPresentationSubmission(),null!==(M=this._client.presentationSubmission)&&void 0!==M&&M.descriptor_map.length){const Z=null===(k=this._client.presentationSubmission)||void 0===k?void 0:k.descriptor_map.length;for(let q=0;qZ.original),V.areRequiredCredentialsPresent=null!==(W=null===(K=V.value)||void 0===K?void 0:K.descriptor_map)&&void 0!==W&&W.length?B.Status.INFO:B.Status.ERROR,V}formatNotInfo(T){return this._client.results.filter(E=>E.status===T).map(E=>{const j=E.verifiable_credential_path.substring(1);return{tag:E.evaluator,status:E.status,message:`${E.message}: ${E.input_descriptor_path}: $.verifiableCredential${j}`}})}submissionFrom(T,E,j){if(!this._client.results.length)throw Error("You need to call evaluate() before pex.presentationFrom()");if(!this._client.generatePresentationSubmission)return this._client.presentationSubmission;if(T.submission_requirements){const K=this._client.results.filter(te=>"MarkForSubmissionEvaluation"===te.evaluator&&te.payload.group&&te.status!==B.Status.ERROR),[W,V]=this.matchUserSelectedVcs(K,E),Z=new Map;"input_descriptors"in T&&T.input_descriptors.forEach(te=>{te.group&&te.group.forEach(ie=>{Z.has(ie)?Z.set(ie,Z.get(ie)+1):Z.set(ie,1)})});const q=this.evaluateRequirements(T.submission_requirements,W,Z,0),ne=V.filter(te=>q[1].find(ie=>ie.verifiable_credential_path===te[1]));return this.updatePresentationSubmission(ne),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}const M=this._client.results.filter(K=>"MarkForSubmissionEvaluation"===K.evaluator&&K.status!==B.Status.ERROR),k=this.matchUserSelectedVcs(M,E);return this.updatePresentationSubmission(k[1]),this.updatePresentationSubmissionPathToVpPath(),j?.presentationSubmissionLocation===m.PresentationSubmissionLocation.EXTERNAL&&this.updatePresentationSubmissionToExternal(),this._client.presentationSubmission}updatePresentationSubmission(T){this._client.generatePresentationSubmission&&(this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.filter(E=>T.find(j=>j[0]===E.path)).map(E=>{const j=T.find(M=>M[0]===E.path);return j&&(E.path=j[1]),E}))}updatePresentationSubmissionToExternal(){this._client.presentationSubmission.descriptor_map=this._client.presentationSubmission.descriptor_map.map(E=>{if(E.path_nested)return E;if("vc+sd-jwt"===E.format)return E;const j=E.format,M=Object.assign({},E);return M.path_nested=Object.assign({},E),M.path="$",j.startsWith("ldp_")?M.format="ldp_vp":j.startsWith("di_")?M.format="di_vp":"jwt_vc"===j?(M.format="jwt_vp",M.path_nested.path=M.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")):"jwt_vc_json"===j&&(M.format="jwt_vp_json",M.path_nested.path=M.path_nested.path.replace("$.verifiableCredential[","$.vp.verifiableCredential[")),M})}matchUserSelectedVcs(T,E){const j=E.map((K,W)=>[W,JSON.stringify(K.original)]),M=this._client.wrappedVcs.map((K,W)=>[W,JSON.stringify(K.original)]),k=[];return j.forEach((K,W)=>{M.forEach((V,Z)=>{V[1]===K[1]&&k.push([`$[${Z}]`,`$[${W}]`])})}),[T=T.filter(K=>k.find(W=>W[0]===K.verifiable_credential_path)).map(K=>{const W=k.find(V=>V[0]===K.verifiable_credential_path);return W&&(K.verifiable_credential_path=W[1]),K}),k]}evaluateRequirements(T,E,j,M){let k=0;const K=[];for(const W of T)if(W.from){if(W.rule===c.Rules.All){const[V,Z]=this.countMatchingInputDescriptors(W,E);if(V!==(j.get(W.from)||0))throw Error(`Not all input descriptors are members of group ${W.from}`);k++,K.push(...Z)}else if(W.rule===c.Rules.Pick){const[V,Z]=this.countMatchingInputDescriptors(W,E);try{this.handleCount(W,V,M),k++}catch(q){if(0===M)throw q}K.push(...Z)}}else if(W.from_nested){const[V,Z]=this.evaluateRequirements(W.from_nested,E,j,++M);k+=V,K.push(...Z),this.handleCount(W,V,M)}return[k,K]}countMatchingInputDescriptors(T,E){let j=0;const M=[];for(const k of E)k.payload.group.includes(T.from)&&(M.push(k),j++);return[j,M]}handleCount(T,E,j){if(T.count&&E!==T.count)throw Error(`Count: expected: ${T.count} actual: ${E} at level: ${j}`);if(T.min&&ET.max)throw Error(`Max: expected: ${T.max} actual: ${E} at level: ${j}`)}removeDuplicateSubmissionRequirementMatches(T){return T.filter((E,j)=>{const M=JSON.stringify(E);return j===T.findIndex(k=>JSON.stringify(k)===M)})}fillSelectableCredentialsToVerifiableCredentialsMapping(T,E){var j;T&&(null===(j=T.verifiableCredential)||void 0===j||j.forEach(M=>{var k;const K=E.findIndex(W=>x.CredentialMapper.areOriginalVerifiableCredentialsEqual(W.original,M));if(-1===K)throw new Error("index is not right");null===(k=T.vcIndexes)||void 0===k||k.push(K)}))}determineAreRequiredCredentialsPresent(T,E,j){if(!E||!E.length)return B.Status.ERROR;const M=E.map(k=>this.determineSubmissionRequirementStatus(T,k));if(!j)return M.includes(B.Status.ERROR)?B.Status.ERROR:M.includes(B.Status.WARN)?B.Status.WARN:B.Status.INFO;{if(j.rule===c.Rules.All&&M.includes(B.Status.ERROR))return B.Status.ERROR;const k=M.filter(K=>K!==B.Status.ERROR).length;if(j.count)return j.count>k?B.Status.ERROR:j.countk)return B.Status.ERROR;if(j.max&&j.maxT.count?B.Status.WARN:B.Status.ERROR:T.min&&T.vc_path.lengthT.max?B.Status.WARN:B.Status.INFO}updateSubmissionRequirementMatchPathToAlias(T,E){const j=[];T.vc_path.forEach(M=>{j.push(M.replace("$","$."+E))}),T.vc_path=j,T.from_nested&&T.from_nested.forEach(M=>{this.updateSubmissionRequirementMatchPathToAlias(M,E)})}updatePresentationSubmissionPathToVpPath(T){const E=T?T.descriptor_map:this._client.generatePresentationSubmission?this._client.presentationSubmission.descriptor_map:void 0;E?.forEach(j=>{"vc+sd-jwt"===j.format?j.path="$":this.replacePathWithAlias(j,"verifiableCredential")})}replacePathWithAlias(T,E){T.path=T.path.replace("$[",`$.${E}[`),T.path_nested&&this.replacePathWithAlias(T.path_nested,E)}createIdToVcMap(T){const E=new Map,j=new Map;for(let M=0;M{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.AbstractEvaluationHandler=void 0;const i=f(44273),c=f(55776);F.AbstractEvaluationHandler=class x{constructor(m){this._client=m}setNext(m){return this.nextHandler=m,m}getNext(){return this.nextHandler}hasNext(){return null!=this.nextHandler}get client(){return this._client}get wrappedVcs(){return this._client.wrappedVcs}set wrappedVcs(m){this._client.wrappedVcs=m}get presentationSubmission(){return this._client.presentationSubmission}set presentationSubmission(m){this._client.presentationSubmission=m}getResults(){return this._client.results}updatePresentationSubmission(m){this._client.assertPresentationSubmission(),this.presentationSubmission.descriptor_map.forEach((S,g,_)=>{let R;this.getResults().filter(E=>E.status===c.Status.ERROR&&E.evaluator===this.getName()).find(E=>(R=i.JSONPath.query(m,E.input_descriptor_path)[0],E.verifiable_credential_path===S.path&&R?.id===S.id))&&delete _[g]})}removeDuplicate(m){return m.reduce((S,g)=>S.find(R=>R.input_descriptor_path===g.input_descriptor_path&&R.verifiable_credential_path===g.verifiable_credential_path)?S:S.concat([g]),[])}}},4028:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(F,"__esModule",{value:!0}),F.DIDRestrictionEvaluationHandler=void 0;const c=f(11151),x=f(55776),B=i(f(24080)),m=f(13486),S=f(32893);F.DIDRestrictionEvaluationHandler=class g extends S.AbstractEvaluationHandler{constructor(R){super(R)}getName(){return"DIDRestrictionEvaluation"}handle(R,T){R.input_descriptors.forEach((E,j)=>{T.forEach((M,k)=>{const K=this.getIssuerIdFromWrappedVerifiableCredential(M);this.client.hasRestrictToDIDMethods()&&K&&!(0,m.isRestrictedDID)(K,this.client.restrictToDIDMethods)&&K.toLowerCase().startsWith("did:")?this.getResults().push(this.generateErrorResult(j,`$[${k}]`,M)):this.getResults().push(this.generateSuccessResult(j,`$[${k}]`,M,`${K} is allowed`))})}),this.updatePresentationSubmission(R)}getIssuerIdFromWrappedVerifiableCredential(R){if(c.CredentialMapper.isW3cCredential(R.credential))return"object"==typeof R.credential.issuer?R.credential.issuer.id:R.credential.issuer;if(c.CredentialMapper.isSdJwtDecodedCredential(R.credential))return R.credential.decodedPayload.iss;throw new Error("Unsupported credential type")}generateErrorResult(R,T,E){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.ERROR,message:B.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:T,payload:{format:E.format}}}generateSuccessResult(R,T,E,j){return{input_descriptor_path:`$.input_descriptors[${R}]`,evaluator:this.getName(),status:x.Status.INFO,message:j??B.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:T,payload:{format:E.format}}}}},19819:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},30614:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(F,"__esModule",{value:!0}),F.FormatRestrictionEvaluationHandler=void 0;const c=f(55776),x=i(f(24080)),B=f(32893);F.FormatRestrictionEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g)}getName(){return"FormatRestrictionEvaluation"}handle(g,_){const R=this.client.restrictToFormats?Object.keys(this.client.restrictToFormats):void 0;g.input_descriptors.forEach((T,E)=>{_.forEach((j,M)=>{const k="format"in T&&T.format?Object.keys(T.format):[j.format];let K=R??k;"format"in T&&T.format&&void 0!==R&&(K=Object.keys(T.format).filter(W=>R.includes(W))),K.includes(j.format)?this.getResults().push(this.generateSuccessResult(E,`$[${M}]`,j,`${j.format} is allowed from ${JSON.stringify(K)}`)):this.getResults().push(this.generateErrorResult(E,`$[${M}]`,j))})}),this.updatePresentationSubmission(g)}generateErrorResult(g,_,R){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:c.Status.ERROR,message:x.default.FORMAT_RESTRICTION_DIDNT_PASS,verifiable_credential_path:_,payload:{format:R.format}}}generateSuccessResult(g,_,R,T){return{input_descriptor_path:`$.input_descriptors[${g}]`,evaluator:this.getName(),status:c.Status.INFO,message:T??x.default.FORMAT_RESTRICTION_PASSED,verifiable_credential_path:_,payload:{format:R.format}}}}},71001:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(32893),F),c(f(19819),F),c(f(298),F),c(f(19477),F),c(f(77918),F),c(f(60019),F),c(f(1599),F),c(f(4257),F),c(f(67966),F),c(f(63217),F),c(f(30614),F),c(f(4028),F)},298:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorFilterEvaluationHandler=void 0;const c=f(44273),x=i(f(39208)),B=i(f(21953)),m=f(55776),S=i(f(24080)),g=f(13486),_=f(32893),R=new x.default({verbose:!1,code:{source:!1,lines:!0,esm:!1},allowUnionTypes:!0,allErrors:!0,strict:!1});(0,B.default)(R);class T extends _.AbstractEvaluationHandler{constructor(j){super(j),T.keepCacheSizeInCheck()}getName(){return"FilterEvaluation"}handle(j,M){const k=c.JSONPath.nodes(j,"$..fields[*]");M.forEach((K,W)=>{this.createNoFieldResults(j,W,K),k.forEach(V=>{let Z=[];V.value.path&&(Z=g.JsonPathUtils.extractInputField(K.decoded,V.value.path));let q=!1;for(const ne of Z)if(this.evaluateFilter(ne,V.value)){q=!0;const te={result:Object.assign({},Z[0]),valid:!0,format:K.format};this.getResults().push(Object.assign({},this.createResultObject(c.JSONPath.stringify(V.path.slice(0,3)),W,te)))}if(!q)if(Z.length){const ne={result:Object.assign({},Z[0]),valid:!1,format:K.format};this.createResponse(V,W,ne,S.default.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION)}else this.createResponse(V,W,{valid:!1,format:K.format},S.default.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY)})}),this.updatePresentationSubmission(j)}createNoFieldResults(j,M,k){j.input_descriptors.map((W,V)=>({index:V,inDesc:W})).filter(W=>{var V,Z,q;return void 0===(null===(V=W.inDesc.constraints)||void 0===V?void 0:V.fields)||0===(null===(q=null===(Z=W.inDesc.constraints)||void 0===Z?void 0:Z.fields)||void 0===q?void 0:q.length)}).forEach(W=>{const V={result:[],valid:!0,format:k.format};this.getResults().push(Object.assign({},this.createResultObject(`$.input_descriptors[${W.index}]`,M,V)))})}createResponse(j,M,k,K){this.getResults().push(Object.assign(Object.assign({},this.createResultObject(c.JSONPath.stringify(j.path.slice(0,3)),M,k)),{status:m.Status.ERROR,message:K}))}createResultObject(j,M,k){return{input_descriptor_path:j,verifiable_credential_path:`$[${M}]`,evaluator:this.getName(),status:m.Status.INFO,message:S.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:k}}evaluateFilter(j,M){var k,K;null!==(k=M.filter)&&void 0!==k&&k.format&&"date"===M.filter.format&&this.transformDateFormat(j);let W=!0;if(M.filter){const V=JSON.stringify({filter:M.filter,value:j.value}),Z=Date.now();W=null===(K=T.FILTER_CACHE.get(V))||void 0===K?void 0:K.value,void 0===W&&(T.keepCacheSizeInCheck(),W=R.validate(M.filter,j.value),T.FILTER_CACHE.set(V,{value:W,ts:Z+T.DEFAULT_FILTER_CACHE_TTL}))}return W}transformDateFormat(j){const M=new Date(j.value);let k=M.getUTCMonth()+1+"";1===k.length&&(k="0"+k);let K=M.getUTCDate()+"";1===K.length&&(K="0"+K),j.value=M.getUTCFullYear()+"-"+k+"-"+K,j.value=M.toISOString().substring(0,M.toISOString().indexOf("T"))}static keepCacheSizeInCheck(j){var M,k,K;const W=null!==(M=j?.ttl)&&void 0!==M?M:T.DEFAULT_FILTER_CACHE_TTL,V=null!==(k=j?.maxCacheSize)&&void 0!==k?k:T.DEFAULT_MAX_FILTER_CACHE_SIZE,Z=null!==(K=j?.resetCacheSize)&&void 0!==K?K:T.DEFAULT_RESET_CACHE_SIZE,q=Date.now();for(const[te,ie]of T.FILTER_CACHE)ie.ts+WV){const te=T.FILTER_CACHE.keys();for(let ie=0;ie{var k,K,W;null!==(k=j.constraints)&&void 0!==k&&k.fields&&((null===(K=j.constraints)||void 0===K?void 0:K.limit_disclosure)===c.Optionality.Required||(null===(W=j.constraints)||void 0===W?void 0:W.limit_disclosure)===c.Optionality.Preferred)&&this.evaluateLimitDisclosure(E,j.constraints,M)})}isLimitDisclosureSupported(T,E,j,M){if("vc+sd-jwt"===T.format)return!0;const k=this.client.limitDisclosureSignatureSuites,K=T.decoded.proof;if(!K||Array.isArray(K)||!K.type)return!1;const W=K.cryptosuite?`${K.type}.${K.cryptosuite}`:K.type;return!!k?.includes(W)||(M==c.Optionality.Required&&this.createLimitDisclosureNotSupportedResult(j,E),!1)}evaluateLimitDisclosure(T,E,j){const M=E?.fields,k=E.limit_disclosure;T.forEach((K,W)=>{k&&this.isLimitDisclosureSupported(K,W,j,k)&&this.enforceLimitDisclosure(K,M,j,W,T,k)})}enforceLimitDisclosure(T,E,j,M,k,K){if(x.CredentialMapper.isWrappedSdJwtVerifiableCredential(T)){const W=this.createSdJwtPresentationFrame(T.credential,E,j,M);W&&((0,S.applySdJwtLimitDisclosure)(T.credential,W),T.decoded=T.credential.decodedPayload,T.original=x.CredentialMapper.isSdJwtDecodedCredential(T.original)?T.credential:T.credential.compactSdJwtVc,this.createSuccessResult(j,`$[${M}]`,K))}else{if(!x.CredentialMapper.isW3cCredential(T.credential))throw new Error(`Unsupported format for selective disclosure ${T.format}`);{const W=this.createVcWithRequiredFields(T.credential,E,j,M);W&&(k[M].credential=W,this.createSuccessResult(j,`$[${M}]`,K))}}}createSdJwtPresentationFrame(T,E,j,M){const k={};for(const K of E)if(K.path){const W=S.JsonPathUtils.extractInputField(T.decodedPayload,K.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,M,K.path);S.JsonPathUtils.setValue(k,W[0].path,!0)}return k}createVcWithRequiredFields(T,E,j,M){let k={};k=Object.assign(k,T),k.credentialSubject={};for(const K of E)if(K.path){const W=S.JsonPathUtils.extractInputField(T,K.path);if(!(W.length>0))return void this.createMandatoryFieldNotFoundResult(j,M,K.path);k=this.copyResultPathToDestinationCredential(W[0],T,k)}return k}copyResultPathToDestinationCredential(T,E,j){let M=Object.assign({},E.credentialSubject);return T.path.forEach(k=>{M[k]&&(M={[k]:M[k]})}),j.credentialSubject=Object.assign(Object.assign({},j.credentialSubject),M),j}createSuccessResult(T,E,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${T}]`,verifiable_credential_path:`${E}`,evaluator:this.getName(),status:j===c.Optionality.Required?B.Status.INFO:B.Status.WARN,message:m.default.LIMIT_DISCLOSURE_APPLIED,payload:void 0})}createMandatoryFieldNotFoundResult(T,E,j){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${T}]`,verifiable_credential_path:`$[${E}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT,payload:j})}createLimitDisclosureNotSupportedResult(T,E){return this.getResults().push({input_descriptor_path:`$.input_descriptors[${T}]`,verifiable_credential_path:`$[${E}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.LIMIT_DISCLOSURE_NOT_SUPPORTED})}}},60019:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.MarkForSubmissionEvaluationHandler=void 0;const c=f(44273),x=f(55776),B=i(f(24080)),m=f(32893);F.MarkForSubmissionEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(_){super(_)}getName(){return"MarkForSubmissionEvaluation"}handle(_,R){const T=[...this.getResults()],E=T.filter(M=>M.status===x.Status.ERROR),j=this.retrieveNoErrorStatus(T,E);this.client.wrappedVcs=R,this.produceErrorResults(E),this.produceSuccessResults(j,_)}retrieveNoErrorStatus(_,R){return _.filter(E=>E.status!==x.Status.ERROR).filter(E=>!R.find(j=>E.input_descriptor_path===j.input_descriptor_path&&E.verifiable_credential_path===j.verifiable_credential_path))}produceSuccessResults(_,R){this.removeDuplicate(_).forEach(T=>{const j=c.JSONPath.nodes(R,T.input_descriptor_path)[0].value.group;this.getResults().push({input_descriptor_path:T.input_descriptor_path,verifiable_credential_path:T.verifiable_credential_path,evaluator:this.getName(),status:x.Status.INFO,payload:{group:j},message:B.default.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION})})}produceErrorResults(_){this.removeDuplicate(_).forEach(R=>{const T=Object.assign({},R.payload);T.evaluator=R.evaluator,this.getResults().push(Object.assign(Object.assign({},R),{evaluator:this.getName(),message:B.default.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION,payload:T}))})}}},1599:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(F,"__esModule",{value:!0}),F.PredicateRelatedFieldEvaluationHandler=void 0;const c=f(47636),x=f(55776),B=i(f(24080)),m=f(32893);F.PredicateRelatedFieldEvaluationHandler=class S extends m.AbstractEvaluationHandler{constructor(_){super(_)}getName(){return"PredicateRelatedFieldEvaluation"}handle(_){_.input_descriptors.forEach((R,T)=>{R.constraints&&this.examinePredicateRelatedField(T,R.constraints)})}examinePredicateRelatedField(_,R){if(R?.fields)for(let T=0;T{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SameSubjectEvaluationHandler=void 0;const i=f(44273),c=f(47636),x=f(55776),B=f(32893);F.SameSubjectEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIds=[],this.sameSubject=[],this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the same subject to belong to same subject"),this.messages.set(x.Status.WARN,"The field ids preferring the same subject to belong to same subject"),this.messages.set(x.Status.ERROR,"The fields ids not belong to the same subject")}getName(){return"SameSubjectEvaluation"}handle(g,_){const R=this.mapSameSubjectFieldIdsToInputDescriptors(g),T=this.mapCredentialsToResultObjecs(_,R),E=this.countSameSubjectOccurrences(R,T);this.generateErrorResults(E,T),this.updatePresentationSubmission(g)}mapSameSubjectFieldIdsToInputDescriptors(g){this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.sameSubject.push(...i.JSONPath.nodes(g,"$..same_subject[*]"));const _=[];return this.fieldIds.forEach(R=>{const T=this.sameSubject.find(E=>E.value.field_id.includes(R.value));T&&_.push([R,T])}),_}generateErrorResults(g,_){g.forEach((R,T)=>{const E=_.filter(j=>T===j.payload.fieldIdSet).map(j=>j.payload.credentialSubject.id);(E.length!==R||1!==new Set(E).size)&&_.forEach((j,M,k)=>{j.payload.fieldIdSet===T&&(j.status=x.Status.ERROR,j.message=this.messages.get(x.Status.ERROR),k[M]=j)})}),this.client.results.push(..._)}countSameSubjectOccurrences(g,_){const R=new Map;return g.forEach(T=>{_.filter(j=>T[1].value.field_id===j.payload.fieldIdSet)&&(R.has(T[1].value.field_id)&&R.get(T[1].value.field_id)?R.set(T[1].value.field_id,R.get(T[1].value.field_id)+1):R.set(T[1].value.field_id,1))}),R}mapCredentialsToResultObjecs(g,_){const R=[...i.JSONPath.nodes(g.map(E=>E.credential),"$..credentialSubject")],T=[];return R.forEach(E=>{const j=_.find(M=>0!==i.JSONPath.query(E.value,`$..${M[0].value}`).length);j&&j[1].value.directive===c.Optionality.Required?T.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.INFO,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:E.value},message:this.messages.get(x.Status.INFO),verifiable_credential_path:i.JSONPath.stringify(E.path.slice(0,2))}):j&&j[1].value.directive===c.Optionality.Preferred&&T.push({input_descriptor_path:i.JSONPath.stringify(j[0].path.slice(0,3)),status:x.Status.WARN,evaluator:this.getName(),payload:{fieldIdSet:j[1].value.field_id,credentialSubject:E.value},message:this.messages.get(x.Status.WARN),verifiable_credential_path:i.JSONPath.stringify(E.path.slice(0,2))})}),T}}},19477:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsHolderEvaluationHandler=void 0;const i=f(44273),c=f(47636),x=f(55776),B=f(32893);F.SubjectIsHolderEvaluationHandler=class m extends B.AbstractEvaluationHandler{constructor(g){super(g),this.fieldIdzInputDescriptorsSameSubjectRequired=new Map,this.fieldIdzInputDescriptorsSameSubjectPreferred=new Map,this.isHolder=[],this.fieldIds=[],this.credentialsSubjectsByPath=new Map,this.credentialsByPath=new Map,this.messages=new Map,this.messages.set(x.Status.INFO,"The field ids requiring the subject to be the holder"),this.messages.set(x.Status.WARN,"The field ids preferring the subject to be the holder"),this.messages.set(x.Status.ERROR,"The field id missing")}getName(){return"IsHolderEvaluation"}handle(g,_){this.findIsHolderFieldIdsToInputDescriptorsSets(g),this.findAllCredentialSubjects(_),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectRequired,x.Status.INFO,c.Optionality.Required),this.confirmAllFieldSetHasSameSubject(this.fieldIdzInputDescriptorsSameSubjectPreferred,x.Status.WARN,c.Optionality.Preferred),this.updatePresentationSubmission(g)}findIsHolderFieldIdsToInputDescriptorsSets(g){var _;this.fieldIds.push(...i.JSONPath.nodes(g,"$..fields[*].id")),this.isHolder.push(...i.JSONPath.nodes(g,"$..is_holder[*]"));const R=null===(_=this.fieldIds)||void 0===_?void 0:_.map(E=>E.value),T=[];T.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectPreferred,this.isHolder,R,c.Optionality.Preferred)),T.push(...this.evaluateFields(this.fieldIdzInputDescriptorsSameSubjectRequired,this.isHolder,R,c.Optionality.Required)),T.forEach(E=>this.getResults().push(this.createResult(E[1],E[0],["",{}],x.Status.ERROR,void 0)))}evaluateFields(g,_,R,T){const E=[];return _.filter(j=>j.value.directive===T).filter(j=>j.value.field_id.every(M=>R.includes(M))).forEach(j=>g.set(i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id)),_.filter(j=>j.value.directive===T).filter(j=>!j.value.field_id.every(M=>R.includes(M))).forEach(j=>E.push([i.JSONPath.stringify(j.path.slice(0,3)),j.value.field_id])),E}findAllCredentialSubjects(g){const _=i.JSONPath.nodes(g.map(R=>R.credential),"$..credentialSubject");for(let R=0;R<_.length;R++){const T=_[R],E=i.JSONPath.stringify(T.path.slice(0,2));this.credentialsSubjectsByPath.set(E,T.value),this.credentialsByPath.set(E,g[R])}}confirmAllFieldSetHasSameSubject(g,_,R){const T=Array.from(g).flatMap(k=>Array.from(this.credentialsSubjectsByPath).filter(K=>k[1].find(W=>Object.keys(K[1]).includes(W)))),E=this.mapCredentialPathsToInputDescriptors(R),j=Array.from(T).flatMap(k=>Object.keys(k[1]).filter(K=>"id"!==K)),M=Array.from(g.values()).flatMap(k=>k.every(K=>j.includes(K)))[0];T.forEach(k=>{const K=E.get(k[0]);M&&k[1].id&&this.client.dids.includes(k[1].id)?this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),K,k,_,this.credentialsByPath.get(k[0]))):this.getResults().push(this.createResult(Object.keys(k[1]).filter(W=>"id"!==W),K,k,x.Status.ERROR,this.credentialsByPath.get(k[0])))})}mapCredentialPathsToInputDescriptors(g){var _;const R=new Map;return null===(_=this.fieldIds)||void 0===_||_.forEach(T=>{const E=i.JSONPath.stringify(T.path.slice(0,3));this.credentialsSubjectsByPath.forEach((j,M)=>{const k=this.isHolder.find(K=>i.JSONPath.stringify(K.path.slice(0,3))===E);Object.keys(j).includes(T.value)&&k?.value.directive===g&&R.set(M,E)})}),R}createResult(g,_,R,T,E,j){return{input_descriptor_path:_,verifiable_credential_path:R[0],evaluator:this.getName(),status:T,payload:Object.assign({fieldIdSet:g,credentialSubject:R[1]},E?{format:E.format}:{}),message:j??this.messages.get(T)}}}},67966:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.SubjectIsIssuerEvaluationHandler=void 0;const c=f(47636),x=f(11151),B=f(55776),m=i(f(24080)),S=f(13486),g=f(32893);F.SubjectIsIssuerEvaluationHandler=class _ extends g.AbstractEvaluationHandler{constructor(T){super(T)}getName(){return"SubjectIsIssuerEvaluation"}handle(T,E){T.input_descriptors.forEach((j,M)=>{const k=j.constraints;k?.subject_is_issuer===c.Optionality.Required?this.checkSubjectIsIssuer(j.id,E,M):this.getResults().push(...E.map((K,W)=>this.generateSuccessResult(M,`$[${W}]`,K,"not applicable")))}),this.updatePresentationSubmission(T)}checkSubjectIsIssuer(T,E,j){this.client.presentationSubmission.descriptor_map.forEach(M=>{if(M.id===T){const k=S.JsonPathUtils.extractInputField(E.map(K=>K.credential),[M.path]);for(const K of k){const W=(0,S.getIssuerString)(K.value);K&&K.value&&(0,S.getSubjectIdsAsString)(K.value).every(V=>V===W)?this.getResults().push(this.generateSuccessResult(j,M.path,x.CredentialMapper.toWrappedVerifiableCredential(K.value))):this.getResults().push(this.generateErrorResult(j,M.path,x.CredentialMapper.toWrappedVerifiableCredential(K.value)))}}})}generateErrorResult(T,E,j){return{input_descriptor_path:`$.input_descriptors[${T}]`,evaluator:this.getName(),status:B.Status.ERROR,message:m.default.SUBJECT_IS_NOT_ISSUER,verifiable_credential_path:E,payload:{format:j.format}}}generateSuccessResult(T,E,j,M){return{input_descriptor_path:`$.input_descriptors[${T}]`,evaluator:this.getName(),status:B.Status.INFO,message:M??m.default.SUBJECT_IS_ISSUER,verifiable_credential_path:E,payload:{format:j.format}}}}},63217:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(F,"__esModule",{value:!0}),F.UriEvaluationHandler=void 0;const c=f(44273),x=f(11151),B=f(35975),m=f(55776),S=f(99938),g=i(f(24080)),_=f(32893);class R extends _.AbstractEvaluationHandler{constructor(E){super(E)}getName(){return"UriEvaluation"}handle(E,j){var M,k,K;E.input_descriptors.forEach((Z,q)=>{const ne=E.getVersion()!==S.PEVersion.v2?Z.schema.map(te=>te.uri):[];j.forEach((te,ie)=>{const ae=R.buildVcContextAndSchemaUris(te.credential,E.getVersion());this.evaluateUris(te,ae,ne,q,ie,E.getVersion())})});const W=(null===(M=E.format)||void 0===M?void 0:M.di)||(null===(k=E.format)||void 0===k?void 0:k.di_vc)||(null===(K=E.format)||void 0===K?void 0:K.di_vp),V=this.getResults().filter(Z=>Z.status===m.Status.INFO).map(Z=>{var q,ne,te,ie;let ae=null===(q=Z.payload)||void 0===q?void 0:q.format;if(W&&("ldp_vc"===ae||"ldp"===ae)){const $=c.JSONPath.nodes(j,Z.verifiable_credential_path).map(A=>A.value).map(A=>A.type===x.OriginalType.JSONLD&&A.credential.proof?(Array.isArray(A.credential.proof)?A.credential.proof:[A.credential.proof]).filter(z=>"DataIntegrityProof"===z.type&&void 0!==z.cryptosuite):[]).reduce((A,C)=>A.filter(O=>C.includes(O))),o=c.JSONPath.nodes(E,Z.input_descriptor_path)[0].value,h=!o.format||(null===(ne=o?.format)||void 0===ne?void 0:ne.di)||(null===(te=o?.format)||void 0===te?void 0:te.di_vc)||(null===(ie=o?.format)||void 0===ie?void 0:ie.di_vp);$.length>0&&h&&(ae="di_vc")}return{id:c.JSONPath.nodes(E,Z.input_descriptor_path)[0].value.id,format:ae,path:Z.verifiable_credential_path}});this.client.generatePresentationSubmission&&(!this.presentationSubmission||0===Object.keys(this.presentationSubmission).length)&&(this.presentationSubmission={id:(0,B.nanoid)(),definition_id:E.id,descriptor_map:V})}evaluateUris(E,j,M,k,K,W){let V=!1;if(W===S.PEVersion.v1){for(let Z=0;Zq===j[Z])&&(V=!0)}else V=!0;V?this.getResults().push(this.createSuccessResultObject(E,M,k,K)):this.getResults().push(this.createErrorResultObject(E,M,k,K))}static buildVcContextAndSchemaUris(E,j){const M=[];return x.CredentialMapper.isW3cCredential(E)&&(Array.isArray(E["@context"])?E["@context"].forEach(k=>M.push(k)):M.push(E["@context"]),Array.isArray(E.credentialSchema)&&E.credentialSchema.length>0?E.credentialSchema.forEach(k=>M.push(k.id)):E.credentialSchema&&M.push(E.credentialSchema.id),j===S.PEVersion.v1&&(Array.isArray(E.type)?E.type.forEach(k=>M.push(k)):E.type&&M.push(E.type))),x.CredentialMapper.isSdJwtDecodedCredential(E)&&j===S.PEVersion.v1&&M.push(E.decodedPayload.vct),M}createSuccessResultObject(E,j,M,k){const K=this.createResult(M,k);return K.status=m.Status.INFO,K.message=g.default.URI_EVALUATION_PASSED,K.payload={format:E.format,vcContext:x.CredentialMapper.isW3cCredential(E.credential)?E.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(E.credential)?E.credential.credentialSchema:void 0,inputDescriptorsUris:j},K}createErrorResultObject(E,j,M,k){const K=this.createResult(M,k);return K.status=m.Status.ERROR,K.message=g.default.URI_EVALUATION_DIDNT_PASS,K.payload={format:E.format,vcContext:x.CredentialMapper.isW3cCredential(E.credential)?E.credential["@context"]:void 0,vcCredentialSchema:x.CredentialMapper.isW3cCredential(E.credential)?E.credential.credentialSchema:void 0,inputDescriptorsUris:j},K}createWarnResultObject(E,j){const M=this.createResult(E,j);return M.status=m.Status.WARN,M.message=g.default.URI_EVALUATION_DIDNT_PASS,M.payload=g.default.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED,M}createResult(E,j){return{input_descriptor_path:`$.input_descriptors[${E}]`,verifiable_credential_path:`$[${j}]`,evaluator:this.getName(),status:m.Status.INFO,message:void 0}}static containsHashlink(E){return!(this.matchAll(E,R.HASHLINK_QUERY_URL_REGEX).next().done&&this.matchAll(E,R.HASHLINK_URL_ENCODED_REGEX).next().done)}}F.UriEvaluationHandler=R,R.matchAll=f(72373),R.HASHLINK_URL_ENCODED_REGEX=/hl:[a-zA-Z0-9]+:[a-zA-Z0-9]+/g,R.HASHLINK_QUERY_URL_REGEX=/https*?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(hl=[a-zA-Z0-9]+)/g},70143:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.HandlerCheckResult=F.EvaluationClientWrapper=F.EvaluationClient=void 0;const i=f(92127);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return i.HandlerCheckResult}});const c=f(50950);Object.defineProperty(F,"EvaluationClient",{enumerable:!0,get:function(){return c.EvaluationClient}});var x=f(78995);Object.defineProperty(F,"EvaluationClientWrapper",{enumerable:!0,get:function(){return x.EvaluationClientWrapper}})},2700:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(T,E,j,M){void 0===M&&(M=j);var k=Object.getOwnPropertyDescriptor(E,j);(!k||("get"in k?!E.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return E[j]}}),Object.defineProperty(T,M,k)}:function(T,E,j,M){void 0===M&&(M=j),T[M]=E[j]}),c=this&&this.__exportStar||function(T,E){for(var j in T)"default"!==j&&!Object.prototype.hasOwnProperty.call(E,j)&&i(E,T,j)};Object.defineProperty(F,"__esModule",{value:!0}),F.PEXv2=F.PEXv1=F.PEX=F.Status=F.Checked=F.PEVersion=F.ValidationEngine=F.HandlerCheckResult=void 0;const x=f(55776);Object.defineProperty(F,"Checked",{enumerable:!0,get:function(){return x.Checked}}),Object.defineProperty(F,"Status",{enumerable:!0,get:function(){return x.Status}});const B=f(97889);Object.defineProperty(F,"PEX",{enumerable:!0,get:function(){return B.PEX}});const m=f(38992);Object.defineProperty(F,"PEXv1",{enumerable:!0,get:function(){return m.PEXv1}});const S=f(71945);Object.defineProperty(F,"PEXv2",{enumerable:!0,get:function(){return S.PEXv2}});const g=f(70143);Object.defineProperty(F,"HandlerCheckResult",{enumerable:!0,get:function(){return g.HandlerCheckResult}});const _=f(99938);Object.defineProperty(F,"PEVersion",{enumerable:!0,get:function(){return _.PEVersion}});const R=f(80930);Object.defineProperty(F,"ValidationEngine",{enumerable:!0,get:function(){return R.ValidationEngine}}),c(f(64864),F)},64864:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(34277),F)},34277:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.KeyEncoding=F.PresentationSubmissionLocation=void 0;var f=function(c){return c[c.EXTERNAL=0]="EXTERNAL",c[c.PRESENTATION=1]="PRESENTATION",c}(f||(F.PresentationSubmissionLocation=f={})),i=function(c){return c.Jwk="Jwk",c.Base58="Base58",c.Hex="Hex",c.Multibase="Multibase",c}(i||(F.KeyEncoding=i={}))},99358:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PEVersion=F.InternalPresentationDefinitionV2=F.InternalPresentationDefinitionV1=void 0,F.InternalPresentationDefinitionV1=class f{constructor(B,m,S,g,_,R){this.id=B,this.input_descriptors=m,this.format=S,this.name=g,this.purpose=_,this.submission_requirements=R}getVersion(){return c.v1}},F.InternalPresentationDefinitionV2=class i{constructor(B,m,S,g,_,R,T){this.format=S,this.frame=g,this.id=B,this.input_descriptors=m,this.name=_,this.purpose=R,this.submission_requirements=T}getVersion(){return c.v2}};var c=function(x){return x.v1="v1",x.v2="v2",x}(c||(F.PEVersion=c={}))},24080:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});var f=function(i){return i.INPUT_CANDIDATE_DOESNT_CONTAIN_PROPERTY="Input candidate does not contain property",i.INPUT_CANDIDATE_FAILED_FILTER_EVALUATION="Input candidate failed filter evaluation",i.INPUT_CANDIDATE_IS_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is eligible for submission",i.INPUT_CANDIDATE_IS_NOT_ELIGIBLE_FOR_PRESENTATION_SUBMISSION="The input candidate is not eligible for submission",i.INPUT_DESCRIPTOR_CONTEXT_CONTAINS_HASHLINK_VERIFICATION_NOT_SUPPORTED="Input descriptor contains hashlink. This version doesn't support hashlink verification.",i.LIMIT_DISCLOSURE_APPLIED="added variable in the limit_disclosure to the verifiableCredential",i.LIMIT_DISCLOSURE_NOT_SUPPORTED="Limit disclosure not supported",i.SUBJECT_IS_NOT_ISSUER="subject is not issuer",i.SUBJECT_IS_ISSUER="subject is issuer",i.FORMAT_RESTRICTION_PASSED="the Credential format of the candidate inputs matches the required formats",i.FORMAT_RESTRICTION_DIDNT_PASS="the Credential format of the candidate inputs didn't match the required formats",i.URI_EVALUATION_PASSED="@context URI(s) for the schema of the candidate input is equal to one of the input_descriptors object uri values.",i.URI_EVALUATION_DIDNT_PASS="@context URI for the of the candidate input MUST be equal to one of the input_descriptors object uri values exactly.",i.UNKNOWN_EXCEPTION="unknown exception occurred: ",i.VERIFIABLE_CREDENTIAL_MANDATORY_FIELD_NOT_PRESENT="mandatory field not present in the verifiableCredential",i}(f||{});F.default=f},88819:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SSITypesBuilder=void 0;const i=f(11151),c=f(13486),x=f(99358);class B{static modelEntityToInternalPresentationDefinitionV1(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV1(g.id,g.input_descriptors,g.format,g.name,g.purpose,g.submission_requirements)}static modelEntityInternalPresentationDefinitionV2(S){const g=B.createCopyAndModifyPresentationDefinition(S);return new x.InternalPresentationDefinitionV2(g.id,g.input_descriptors,g.format,g.frame,g.name,g.purpose,g.submission_requirements)}static createCopyAndModifyPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S));return c.JsonPathUtils.changePropertyNameRecursively(g,"_const","const"),c.JsonPathUtils.changePropertyNameRecursively(g,"_enum","enum"),c.JsonPathUtils.changeSpecialPathsRecursively(g),g}static mapExternalVerifiablePresentationToWrappedVP(S,g){return i.CredentialMapper.toWrappedVerifiablePresentation(S,{hasher:g})}static mapExternalVerifiableCredentialsToWrappedVcs(S,g){return i.CredentialMapper.toWrappedVerifiableCredentials(Array.isArray(S)?S:[S],{hasher:g})}static toInternalPresentationDefinition(S){const g=JSON.parse(JSON.stringify(S)),_=(0,c.definitionVersionDiscovery)(g);if(_.error)throw _.error;return _.version==x.PEVersion.v1?B.modelEntityToInternalPresentationDefinitionV1(g):B.modelEntityInternalPresentationDefinitionV2(g)}}F.SSITypesBuilder=B},99938:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(24080),F),c(f(99358),F),c(f(88819),F)},27426:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(c){return Array.isArray(c)?c:[c]}static isObject(c){return"[object Object]"===Object.prototype.toString.call(c)}static isUrlAbsolute(c){f.isString(c)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(c)}static isString(c){return"string"==typeof c||"[object String]"===Object.prototype.toString.call(c)}static getDistinctFieldInObject(c,x){const B=c.map(m=>m[x]);return Array.from(new Set(B))}static cloneDeep(c){return JSON.parse(JSON.stringify(c))}}F.ObjectUtils=f},18471:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectValidationUtils=void 0,F.ObjectValidationUtils=class f{static optionalNonEmptyString(c){return null==c||c.length>0}static nonEmptyString(c){return null!=c&&c.length>0}static isValidDIDURI(c){return new RegExp("^did:([a-z0-9]+)(:([a-zA-Z0-9\\.\\-_]|%[0-9a-fA-F]{2})+)+(/([a-zA-Z-\\._~]|%[0-9a-fA-F]{2}|[!$&'()*+,;=:@])*)?").test(c)}}},79446:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(F,"__esModule",{value:!0}),F.filterToRestrictedDIDs=F.isRestrictedDID=F.uniformDIDMethods=F.definitionVersionDiscovery=F.getIssuerString=F.getSubjectIdsAsString=void 0;const c=f(99938),x=i(f(86515)),B=i(f(93046)),m=f(27426),S=f(45408);function T(M,k){var K;let W=null!==(K=M?.map(V=>V.toLowerCase()).map(V=>V.startsWith("did:")?V:`did:${V}`))&&void 0!==K?K:[];if(k?.removePrefix){const V=k.removePrefix.endsWith(":")?k.removePrefix.length:k.removePrefix.length+1;W=W.map(Z=>Z.startsWith(k.removePrefix)?Z.substring(V):Z)}return W.includes("did")?[]:W}F.getSubjectIdsAsString=function g(M){return(Array.isArray(M.credentialSubject)?M.credentialSubject:[M.credentialSubject]).filter(K=>!!K.id).map(K=>K.id)},F.getIssuerString=function _(M){return m.ObjectUtils.isString(M.issuer)?M.issuer:M.issuer.id},F.definitionVersionDiscovery=function R(M){const k=JSON.parse(JSON.stringify(M));S.JsonPathUtils.changePropertyNameRecursively(k,"_const","const"),S.JsonPathUtils.changePropertyNameRecursively(k,"_enum","enum");const K={presentation_definition:k};let W=(0,B.default)(K);return W?{version:c.PEVersion.v2}:(W=(0,x.default)(K),W?{version:c.PEVersion.v1}:{error:"This is not a valid PresentationDefinition"})},F.uniformDIDMethods=T,F.isRestrictedDID=function E(M,k){const K=T(k);return 0===K.length||K.some(W=>M.toLowerCase().startsWith(W))},F.filterToRestrictedDIDs=function j(M,k){const K=T(k);return 0===K.length?M:K.flatMap(W=>M.filter(V=>V.toLowerCase().startsWith(W)))}},13486:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(45408),F),c(f(27426),F),c(f(18471),F),c(f(79446),F),c(f(58870),F)},45408:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JsonPathUtils=void 0;const i=f(44273);class c{static extractInputField(B,m){let S=[];if(m)for(const g of m)if(S=i.JSONPath.nodes(B,g),S.length)break;return S}static changePropertyNameRecursively(B,m,S){const g=c.extractInputField(B,["$.."+m]);for(const _ of g)this.copyResultPathToDestinationDefinition(_.path,B,S)}static setValue(B,m,S){const g="string"==typeof m?m:i.JSONPath.stringify(m);return i.JSONPath.value(B,g,S),B}static copyResultPathToDestinationDefinition(B,m,S){let g=m;for(let _=1;_1&&"['"!==m.substring(_-2,_)&&'["'!==m.substring(_-2,_))if(".."===m.substring(_-2,_)){m=m.substring(0,_-2)+"..['"+S.value[0]+"']"+m.substring(_+S.value[0].length),g=!0;const R=this.matchAll(m,this.REGEX_PATH);this.modifyPathRecursive(R,m)}else"."===m.charAt(_-1)&&(m=m.substring(0,_-1)+"['"+S.value[0]+"']"+m.substring(_+S.value[0].length),g=!0,this.modifyPathRecursive(B,m));S=B.next()}return m}}F.JsonPathUtils=c,c.matchAll=f(72373),c.REGEX_PATH=/@\w+/g},58870:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(T,E,j,M){void 0===M&&(M=j);var k=Object.getOwnPropertyDescriptor(E,j);(!k||("get"in k?!E.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return E[j]}}),Object.defineProperty(T,M,k)}:function(T,E,j,M){void 0===M&&(M=j),T[M]=E[j]}),c=this&&this.__setModuleDefault||(Object.create?function(T,E){Object.defineProperty(T,"default",{enumerable:!0,value:E})}:function(T,E){T.default=E}),x=this&&this.__importStar||function(T){if(T&&T.__esModule)return T;var E={};if(null!=T)for(var j in T)"default"!==j&&Object.prototype.hasOwnProperty.call(T,j)&&i(E,T,j);return c(E,T),E};Object.defineProperty(F,"__esModule",{value:!0}),F.applySdJwtLimitDisclosure=F.calculateSdHash=void 0;const B=f(15315),m=f(22084),S=x(f(75324)),g=f(27426);F.calculateSdHash=function _(T,E,j){const M=j(T,E);return S.toString(M,"base64url")},F.applySdJwtLimitDisclosure=function R(T,E){const j=T.disclosures.map(q=>({digest:q.digest,encoded:q.encoded,salt:q.decoded[0],value:3===q.decoded.length?q.decoded[2]:q.decoded[1],key:3===q.decoded.length?q.decoded[1]:void 0})),M=(0,m.selectDisclosures)(g.ObjectUtils.cloneDeep(T.signedPayload),j,E);T.disclosures=M.map(q=>({encoded:q.encoded,decoded:q.key?[q.salt,q.key,q.value]:[q.salt,q.value],digest:q.digest}));const k=T.disclosures.map(q=>q.encoded),K=T.compactSdJwtVc.split("~");T.compactSdJwtVc=K.filter((q,ne)=>0===ne||ne===K.length-1||k.includes(q)).join("~");const{payload:W}=(0,B.getSDAlgAndPayload)(g.ObjectUtils.cloneDeep(T.signedPayload)),V=(0,m.createHashMappingForSerializedDisclosure)(M),{unpackedObj:Z}=(0,B.unpackObj)(W,V);T.decodedPayload=Z}},38612:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ConstraintsVB=void 0;const i=f(47636),c=f(30387),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"constraints"),this.disclosureLimitShouldHaveKnownValueMsg="limit_disclosure should have known value",this.statusShouldHaveKnownValueMsg="Unknown status property",this.statusDirectiveShouldHaveKnownValueMsg="status directive should have known value",this.subjectIsIssuerShouldBeKnownValueMsg="subject_is_issuer should be known value",this.fieldIdIsMandatoryMsg="field_id property is mandatory",this.fieldIdMustBeArrayOfStringsMsg="field_id property must be an array of strings",this.fieldIdMustCorrespondToFieldIdMsg="field_id must correspond to a present field object id property",this.directivePropertyIsMandatoryMsg="directive property is mandatory",this.oneOfTheKnownDirectivePropertiesMandatoryMsg="directive property must be one of [required, preferred]"}getValidations(S){let g=[];return S&&(g=[{tag:this.getTag(),target:S,predicate:_=>B.disclosureLimitShouldHaveKnownValue(_.limit_disclosure),message:this.disclosureLimitShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:_=>B.statusShouldHaveKnownValue(_.statuses),message:this.statusShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:B.statusDirectiveShouldHaveKnownValue(),message:this.statusDirectiveShouldHaveKnownValueMsg},{tag:this.getTag(),target:S,predicate:_=>B.shouldBeKnownOption(_.is_holder),message:this.subjectIsIssuerShouldBeKnownValueMsg},{tag:this.getTag(),target:S,predicate:_=>this.fieldIdInSubjectMustCorrespondToFieldId(_,_.is_holder),message:this.fieldIdMustCorrespondToFieldIdMsg},{tag:this.getTag(),target:S,predicate:_=>this.fieldIdInSubjectMustCorrespondToFieldId(_,_.same_subject),message:this.fieldIdMustCorrespondToFieldIdMsg},...this.getSubjectsValidations(S?.is_holder),...this.getSubjectsValidations(S?.same_subject),...this.getFieldsValidations(S)]),g}getFieldsValidations(S){var g;return null!==(g=S?.fields)&&void 0!==g&&g.length?new c.FieldsVB(this.getTag()).getValidations(S.fields):[]}static disclosureLimitShouldHaveKnownValue(S){return!S||S===i.Optionality.Preferred||S===i.Optionality.Required}static statusShouldHaveKnownValue(S){return null==S||null!=S.active||null!=S.revoked||null!=S.suspended}static statusDirectiveShouldHaveKnownValue(){return S=>{var g,_,R;return this.pdStatusShouldBeKnown(null===(g=S?.statuses)||void 0===g?void 0:g.active)&&this.pdStatusShouldBeKnown(null===(_=S?.statuses)||void 0===_?void 0:_.revoked)&&this.pdStatusShouldBeKnown(null===(R=S?.statuses)||void 0===R?void 0:R.suspended)}}static pdStatusShouldBeKnown(S){return!S||S.directive===i.Directives.Allowed||S.directive===i.Directives.Disallowed||S.directive===i.Directives.Required}static shouldBeKnownOption(S){return!S||0===S.filter(g=>g.directive!==i.Optionality.Preferred&&g.directive!==i.Optionality.Required).length}getSubjectsValidations(S){if(S){let g=[];for(let _=0;_Array.isArray(R.field_id),message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>!!R.field_id,message:this.fieldIdIsMandatoryMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>R.field_id.length===R.field_id.filter(T=>"string"==typeof T).length,message:this.fieldIdMustBeArrayOfStringsMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>void 0!==R.directive,message:this.directivePropertyIsMandatoryMsg},{tag:this.getMyTag(_),target:S[_],predicate:R=>R.directive===i.Optionality.Preferred||R.directive===i.Optionality.Required,message:this.oneOfTheKnownDirectivePropertiesMandatoryMsg}];return g}return[]}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}fieldIdInSubjectMustCorrespondToFieldId(S,g){if(g)for(const _ of g)for(const R of _.field_id)if(!B.isValidFieldId(S,R))return!1;return!0}static isValidFieldId(S,g){return!!S?.fields&&S.fields.map(_=>_.id).includes(g)}}F.ConstraintsVB=B},30387:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(F,"__esModule",{value:!0}),F.FieldsVB=void 0;const c=f(44273),x=f(47636),B=i(f(94217)),m=i(f(61264)),S=f(10767);class g extends S.ValidationBundler{constructor(R){super(R,"fields"),this.mustHaveValidJsonPathsMsg='field object "path" property must contain array of valid json paths',this.pathObjMustHaveValidJsonPathMsg='field object "path" property must contain valid json paths.',this.filterMustBeValidJsonSchemaMsg='field object "filter" property must be valid json schema',this.filterIsMustInPresenceOfPredicateMsg='field object must have a "filter" property if "predicate" is present',this.filterIsNotValidJsonSchemaDescriptorMsg='could not parse "filter" object as a valid json schema descriptor.',this.purposeShouldBeANonEmptyStringMsg="purpose should be a non empty string",this.shouldBeKnownOptionMsg="Unknown predicate property"}getValidations(R){let T=[];if(R)for(let E=0;Eg.optionalNonEmptyString(E?.purpose),message:this.purposeShouldBeANonEmptyStringMsg},{tag:this.getMyTag(T),target:R,predicate:E=>g.shouldBeKnownOption(E?.predicate),message:this.shouldBeKnownOptionMsg}]}getMyTag(R){return this.parentTag+"."+this.myTag+"["+R+"]"}mustHaveValidJsonPaths(){return R=>null!=R.path&&R.path.length>0&&this._validateJsonPaths(R.path)}_validateJsonPaths(R){const T=[];if(R.forEach(E=>{try{c.JSONPath.parse(E)}catch{T.push(E)}}),T.length>0)throw this.toChecked(this.pathObjMustHaveValidJsonPathMsg+" Got: "+JSON.stringify(T));return!0}filterMustBeValidJsonSchema(){return R=>this._validateFilter(R.filter)}_validateFilter(R){if(null==R)return!0;let T=!1;try{T=(0,m.default)(R),T||(T=(0,B.default)(R))}catch{throw this.toChecked(this.filterIsNotValidJsonSchemaDescriptorMsg+" Got "+JSON.stringify(R))}return T}filterIsMustInPresenceOfPredicate(){return R=>!(null!=R.predicate&&null==R.filter)}static optionalNonEmptyString(R){return null==R||R.length>0}static shouldBeKnownOption(R){return null==R||R==x.Optionality.Required||R==x.Optionality.Preferred}}F.FieldsVB=g},79241:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.FrameVB=void 0;const i=f(13486),c=f(10767);class x extends c.ValidationBundler{constructor(m){super(m,"frame"),this.frameIsValidMsg="frame value is not valid"}getValidations(m){let S=[];return S=[...S,...this.getMyValidations(m)],S}getMyValidations(m){return[{tag:this.getMyTag(),target:m,predicate:x.frameIsValid,message:this.frameIsValidMsg}]}getMyTag(){return this.parentTag+"."+this.myTag}static frameIsValid(m){if(!m||Array.isArray(m)||"object"!=typeof m)return!1;const S=m;if(S&&S["@id"])for(const g of i.ObjectUtils.asArray(m["@id"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;if(S["@types"])for(const g of i.ObjectUtils.asArray(m["@types"]))if(!i.ObjectUtils.isObject(g)&&!i.ObjectUtils.isUrlAbsolute(g)||i.ObjectUtils.isString(g)&&0===g.indexOf("_:"))return!1;return!0}}F.FrameVB=x},75056:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(30387),F),c(f(853),F),c(f(74840),F),c(f(27506),F),c(f(12915),F),c(f(3170),F),c(f(97091),F),c(f(10767),F),c(f(38612),F)},853:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV1VB=void 0;const i=f(13486),c=f(38612),x=f(10767);F.InputDescriptorsV1VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string",this.shouldHaveValidSchemaURIMsg="schema should have valid URI"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueIds(_),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueFieldsIds(_),message:"fields id must be unique"}),S.forEach((_,R)=>{g=[...g,...this.getValidationFor(_,R),...this.constraintsValidations(_,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.nonEmptyString(_?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:this.isValidSchema(),message:this.shouldHaveValidSchemaURIMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],_=new Set,R=[];return S.map(T=>{var E;return null===(E=T.constraints)||void 0===E?void 0:E.fields}).forEach(T=>{T&&R.push(...T)}),R.forEach(T=>{T.id&&g.push(T.id)}),g.forEach(T=>_.add(T)),g.length===_.size}shouldHaveUniqueIds(S){const g=[],_=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>_.add(R)),g.length===_.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}isValidSchema(){return S=>S.schema.filter(g=>this.isAValidURI(g.uri)&&(null==g.required||"boolean"==typeof g.required)).length>0}isAValidURI(S){if(!S)return!1;if(!i.ObjectValidationUtils.nonEmptyString(S))return!1;if(S.startsWith("http://")||S.startsWith("https://"))try{new URL(S)}catch{return i.ObjectValidationUtils.isValidDIDURI(S)}return!0}constraintsValidations(S,g){return S.constraints?new c.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}}},74840:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.InputDescriptorsV2VB=void 0;const i=f(13486),c=f(38612),x=f(10767);F.InputDescriptorsV2VB=class B extends x.ValidationBundler{constructor(S){super(S,"input_descriptor"),this.idMustBeNonEmptyStringMsg="input descriptor id must be non-empty string",this.nameShouldBeNonEmptyStringMsg="input descriptor name should be non-empty string",this.purposeShouldBeNonEmptyStringMsg="input descriptor purpose should be non-empty string"}getValidations(S){let g=[];return g.push({tag:this.getTag(),target:S,predicate:_=>this.shouldNotHaveSchema(_),message:"input descriptor should not have schema property"},{tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueIds(_),message:"input descriptor ids must be unique"},{tag:this.getTag(),target:S,predicate:_=>this.shouldHaveUniqueFieldsIds(_),message:"fields id must be unique"}),S.forEach((_,R)=>{g=[...g,...this.getValidationFor(_,R),...this.constraintsValidations(_,R)]}),g}getValidationFor(S,g){return[{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.nonEmptyString(_?.id),message:this.idMustBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.name),message:this.nameShouldBeNonEmptyStringMsg},{tag:this.getMyTag(g),target:S,predicate:_=>i.ObjectValidationUtils.optionalNonEmptyString(_?.purpose),message:this.purposeShouldBeNonEmptyStringMsg}]}shouldHaveUniqueFieldsIds(S){const g=[],_=new Set,R=[];return S.map(T=>{var E;return null===(E=T.constraints)||void 0===E?void 0:E.fields}).forEach(T=>{T&&R.push(...T)}),R.forEach(T=>{T.id&&g.push(T.id)}),g.forEach(T=>_.add(T)),g.length===_.size}shouldHaveUniqueIds(S){const g=[],_=new Set;return S.forEach(R=>g.push(R.id)),g.forEach(R=>_.add(R)),g.length===_.size}getMyTag(S){return this.parentTag+"."+this.myTag+"["+S+"]"}constraintsValidations(S,g){return S.constraints?new c.ConstraintsVB(this.getMyTag(g)).getValidations(S.constraints):[]}shouldNotHaveSchema(S){let g=!1;return S.forEach(_=>{_.schema&&(g=!0)}),!g}}},27506:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV1VB=void 0;const c=f(92209),x=f(83851),B=i(f(86515)),m=f(853),S=f(97091),g=f(10767);class _ extends g.ValidationBundler{constructor(T){super(T,"presentation_definition")}getValidations(T){return T.submission_requirements?[...this.myValidations(T),...new m.InputDescriptorsV1VB(this.myTag).getValidations(T.input_descriptors),...new S.SubmissionRequirementVB(this.myTag).getValidations(T.submission_requirements)]:[...this.myValidations(T),...new m.InputDescriptorsV1VB(this.myTag).getValidations(T.input_descriptors)]}myValidations(T){return[{tag:this.getTag(),target:T,predicate:E=>null!=E,message:"presentation_definition should be non null."},{tag:this.getTag(),target:T,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:T,predicate:E=>_.nonEmptyString(E?.id),message:"id should not be empty"},{tag:this.getTag(),target:T,predicate:E=>_.optionalNonEmptyString(E?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:T,predicate:E=>_.optionalNonEmptyString(E?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:T,predicate:E=>_.formatValuesShouldNotBeEmpty(E?.format),message:"formats values should not empty"},{tag:this.getTag(),target:T,predicate:E=>_.formatValuesShouldBeAmongKnownValues(E?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:T,predicate:E=>_.groupShouldMatchSubmissionRequirements(E),message:"input descriptor group should match the from in submission requirements."},{tag:this.getTag(),target:T,predicate:E=>_.shouldNotHaveFrameProperty(E),message:"input descriptor should not have frame property."}]}static optionalNonEmptyString(T){return null==T||T.length>0}static nonEmptyString(T){return null!=T&&T.length>0}static formatValuesShouldNotBeEmpty(T){var E,j,M,k,K,W,V,Z,q,ne,te;let ie=!0;return null!=T?.jwt&&(ie=ie&&(null===(E=T.jwt.alg)||void 0===E?void 0:E.length)>0),null!=T?.jwt_vc&&(ie=ie&&(null===(j=T.jwt_vc.alg)||void 0===j?void 0:j.length)>0),null!=T?.jwt_vc_json&&(ie=ie&&(null===(M=T.jwt_vc_json.alg)||void 0===M?void 0:M.length)>0),null!=T?.jwt_vp&&(ie=ie&&(null===(k=T.jwt_vp.alg)||void 0===k?void 0:k.length)>0),null!=T?.jwt_vp_json&&(ie=ie&&(null===(K=T.jwt_vp_json.alg)||void 0===K?void 0:K.length)>0),null!=T?.ldp&&(ie=ie&&(null===(W=T.ldp.proof_type)||void 0===W?void 0:W.length)>0),null!=T?.ldp_vc&&(ie=ie&&(null===(V=T.ldp_vc.proof_type)||void 0===V?void 0:V.length)>0),null!=T?.ldp_vp&&(ie=ie&&(null===(Z=T.ldp_vp.proof_type)||void 0===Z?void 0:Z.length)>0),null!=T?.di&&(ie=ie&&(null===(q=T.di.proof_type)||void 0===q?void 0:q.length)>0),null!=T?.di_vc&&(ie=ie&&(null===(ne=T.di_vc.proof_type)||void 0===ne?void 0:ne.length)>0),null!=T?.di_vp&&(ie=ie&&(null===(te=T.di_vp.proof_type)||void 0===te?void 0:te.length)>0),ie}static formatValuesShouldBeAmongKnownValues(T){let E=[];if(T){const j=c.JwtAlgos.getJwtAlgos(),M=x.LdpTypes.getLdpTypes();E=[];for(const[k,K]of Object.entries(T))k.startsWith("jwt")?E.push(..._.isJWTAlgoKnown(K,j)):E.push(..._.isLDPProofKnown(K,M))}return 0===E.length}static isJWTAlgoKnown(T,E){const j=[];if(null!=T&&null!=T.alg)for(const M of T.alg)E.includes(M)||j.push(M);return j}static isLDPProofKnown(T,E){const j=[];if(null!=T&&null!=T.proof_type)for(const M of T.proof_type)E.includes(M)||j.push(M);return j}static groupShouldMatchSubmissionRequirements(T){if(null!=T.submission_requirements&&T.submission_requirements.length>0){const E=[];T.input_descriptors.forEach(W=>{W.group&&E.push(...W.group)});const j=new Set(E),M=[];_.flatten(T.submission_requirements).forEach(W=>{W.from&&(Array.isArray(W.from)?M.push(...W.from):M.push(W.from))});const k=new Set(M);return 0===new Set([...k].filter(W=>null!=W&&W.length>0&&!j.has(W))).size}return!0}static flatten(T){return T?.reduce((E,j)=>E.concat(Array.isArray(j.from_nested)?this.flatten(j.from_nested):j),[])}shouldBeAsPerJsonSchema(){return T=>(0,B.default)({presentation_definition:T})}static shouldNotHaveFrameProperty(T){return!T.frame}}F.PresentationDefinitionV1VB=_},12915:function(Me,F,f){"use strict";var i=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationDefinitionV2VB=void 0;const c=f(92209),x=f(83851),B=i(f(93046)),m=f(79241),S=f(74840),g=f(97091),_=f(10767);class R extends _.ValidationBundler{constructor(E){super(E,"presentation_definition")}getValidations(E){let j=[];return j=E.submission_requirements?[...this.myValidations(E),...new S.InputDescriptorsV2VB(this.myTag).getValidations(E.input_descriptors),...new g.SubmissionRequirementVB(this.myTag).getValidations(E.submission_requirements)]:[...this.myValidations(E),...new S.InputDescriptorsV2VB(this.myTag).getValidations(E.input_descriptors)],E.frame&&j.push(...new m.FrameVB(this.myTag).getValidations(E.frame)),j}myValidations(E){return[{tag:this.getTag(),target:E,predicate:j=>null!=j,message:"presentation_definition should be non null."},{tag:this.getTag(),target:E,predicate:this.shouldBeAsPerJsonSchema(),message:"presentation_definition should be as per json schema."},{tag:this.getTag(),target:E,predicate:j=>R.nonEmptyString(j?.id),message:"id should not be empty"},{tag:this.getTag(),target:E,predicate:j=>R.optionalNonEmptyString(j?.name),message:"name should be a non-empty string"},{tag:this.getTag(),target:E,predicate:j=>R.optionalNonEmptyString(j?.purpose),message:"purpose should be a non-empty string"},{tag:this.getTag(),target:E,predicate:j=>R.formatValuesShouldNotBeEmpty(j?.format),message:"formats values should not empty"},{tag:this.getTag(),target:E,predicate:j=>R.formatValuesShouldBeAmongKnownValues(j?.format),message:"formats should only have known identifiers for alg or proof_type"},{tag:this.getTag(),target:E,predicate:j=>R.groupShouldMatchSubmissionRequirements(j),message:"input descriptor group should match the from in submission requirements."}]}static optionalNonEmptyString(E){return null==E||E.length>0}static nonEmptyString(E){return null!=E&&E.length>0}static formatValuesShouldNotBeEmpty(E){var j,M,k,K,W,V,Z,q,ne,te,ie;let ae=!0;return null!=E?.jwt&&(ae=ae&&(null===(j=E.jwt.alg)||void 0===j?void 0:j.length)>0),null!=E?.jwt_vc&&(ae=ae&&(null===(M=E.jwt_vc.alg)||void 0===M?void 0:M.length)>0),null!=E?.jwt_vc_json&&(ae=ae&&(null===(k=E.jwt_vc_json.alg)||void 0===k?void 0:k.length)>0),null!=E?.jwt_vp&&(ae=ae&&(null===(K=E.jwt_vp.alg)||void 0===K?void 0:K.length)>0),null!=E?.jwt_vp_json&&(ae=ae&&(null===(W=E.jwt_vp_json.alg)||void 0===W?void 0:W.length)>0),null!=E?.ldp&&(ae=ae&&(null===(V=E.ldp.proof_type)||void 0===V?void 0:V.length)>0),null!=E?.ldp_vc&&(ae=ae&&(null===(Z=E.ldp_vc.proof_type)||void 0===Z?void 0:Z.length)>0),null!=E?.ldp_vp&&(ae=ae&&(null===(q=E.ldp_vp.proof_type)||void 0===q?void 0:q.length)>0),null!=E?.di&&(ae=ae&&(null===(ne=E.di.proof_type)||void 0===ne?void 0:ne.length)>0),null!=E?.di_vc&&(ae=ae&&(null===(te=E.di_vc.proof_type)||void 0===te?void 0:te.length)>0),null!=E?.di_vp&&(ae=ae&&(null===(ie=E.di_vp.proof_type)||void 0===ie?void 0:ie.length)>0),ae}static formatValuesShouldBeAmongKnownValues(E){let j=[];if(E){const M=c.JwtAlgos.getJwtAlgos(),k=x.LdpTypes.getLdpTypes();j=[];for(const[K,W]of Object.entries(E))K.startsWith("jwt")?j.push(...R.isJWTAlgoKnown(W,M)):j.push(...R.isLDPProofKnown(W,k))}return 0===j.length}static isJWTAlgoKnown(E,j){const M=[];if(null!=E&&null!=E.alg)for(const k of E.alg)j.includes(k)||M.push(k);return M}static isLDPProofKnown(E,j){const M=[];if(null!=E&&null!=E.proof_type)for(const k of E.proof_type)j.includes(k)||M.push(k);return M}static groupShouldMatchSubmissionRequirements(E){if(null!=E.submission_requirements&&E.submission_requirements.length>0){const j=[];E.input_descriptors.forEach(V=>{V.group&&j.push(...V.group)});const M=new Set(j),k=[];R.flatten(E.submission_requirements).forEach(V=>{V.from&&k.push(V.from)});const K=new Set(k);return 0===new Set([...K].filter(V=>null!=V&&V.length>0&&!M.has(V))).size}return!0}static flatten(E){return E?.reduce((j,M)=>j.concat(Array.isArray(M.from_nested)?this.flatten(M.from_nested):M),[])}shouldBeAsPerJsonSchema(){return E=>(0,B.default)({presentation_definition:E})}}F.PresentationDefinitionV2VB=R},3170:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.PresentationSubmissionVB=void 0;const i=f(44273),c=f(55776),x=f(10767);class B extends x.ValidationBundler{constructor(S){super(S,"presentation_submission")}getValidations(S){return[{tag:this.getTag(),target:S,predicate:g=>null!=g,message:"presentation_submission should be non null."},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.id),message:"id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.nonEmptyString(g?.definition_id),message:"presentation_definition_id should not be empty"},{tag:this.getTag(),target:S,predicate:g=>B.descriptorMapMustBePresent(g?.descriptor_map),message:"descriptor_map should be a non-empty list"},{tag:this.getTag(),target:S,predicate:g=>B.idMustBeSameForEachLevelOfNesting(g?.descriptor_map),message:"each descriptor should have a one id in it, on all levels"},{tag:this.getTag(),target:S,predicate:g=>B.formatsShouldBeKnown(g?.descriptor_map),message:"each format should be one of the known format"},{tag:this.getTag(),target:S,predicate:g=>B.pathsShouldBeValidJsonPaths(g?.descriptor_map),message:"each path should be a valid jsonPath"}]}static nonEmptyString(S){return null!=S&&S.length>0}static descriptorMapMustBePresent(S){return null!=S&&S.length>0}static idMustBeSameForEachLevelOfNesting(S){let g=!0;if(null!=S)for(let _=0;_0)throw new c.Checked("",c.Status.ERROR,"These were not parsable json paths: "+JSON.stringify(g));return!0}}F.PresentationSubmissionVB=B},97091:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.SubmissionRequirementVB=void 0;const i=f(10767);class c extends i.ValidationBundler{constructor(B){super(B,"submission_requirements"),this.ruleIsMandatoryMsg="rule is a mandatory field",this.needsOneFromOrFromNestedMsg="needs exactly one of from or from_nested",this.fromNestedShouldBeArrayMsg="The value of the from_nested property MUST be an array",this.isCountPositiveIntMsg="count must be a practical positive number",this.isMinPositiveIntMsg="min must be a practical positive number",this.isMaxPositiveIntMsg="max must be a practical positive number",this.ruleShouldBePickOrAllMsg="rule should be either pick or all"}getValidations(B){let m=[];if(null!=B&&B.length>0)for(let S=0;S{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationBundler=void 0;const i=f(55776);F.ValidationBundler=class c{constructor(B,m){this.parentTag=B,this.myTag=m}getTag(){return null!=this.parentTag?this.parentTag+"."+this.myTag:this.myTag}toChecked(B){return new i.Checked(this.getTag(),i.Status.ERROR,B)}}},80320:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(51130),F),c(f(93398),F),c(f(50903),F)},92209:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.JwtAlgos=void 0,F.JwtAlgos=class f{static getJwtAlgos(){return["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","PS256","PS384","PS512","none","RSA1_5","RSA-OAEP","RSA-OAEP-256","A128KW","A192KW","A256KW","dir","ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"]}}},83851:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.LdpTypes=void 0,F.LdpTypes=class f{static getLdpTypes(){return["Ed25519VerificationKey2018","Ed25519Signature2018","RsaSignature2018","EcdsaSecp256k1Signature2019","EcdsaSecp256k1RecoverySignature2020","JsonWebSignature2020","GpgSignature2020","JcsEd25519Signature2020","BbsBlsSignature2020","Bls12381G2Key2020","DataIntegrityProof"]}}},93398:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},50903:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValidationEngine=void 0;const i=f(80320);F.ValidationEngine=class c{validate(B){let m=[];for(const S of B)m=m.concat(S.bundler.getValidations(S.target));return(0,i.validate)(m)}}},51130:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validate=void 0;const i=f(55776);F.validate=x=>{function m(T){return new i.Checked(T.tag,i.Status.ERROR,T.message)}function S(T){return new i.Checked(T,i.Status.INFO,"ok")}const R=x.map(T=>function g(T){let E;try{E=T.predicate(T.target)?S(T.tag):m(T)}catch{E=m(T)}return E}(T)).reduce((T,E)=>(E.status!==i.Status.INFO&&T.push(E),T),[]);return(0,i.hasErrors)(R)?R:[S("root")]}},80930:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(75056),F),c(f(80320),F)},94217:Me=>{"use strict";Me.exports=g,Me.exports.default=g;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},required:["type"],type:"object"},i=Object.prototype.hasOwnProperty,c={type:["number","string","boolean"]};function x(_,{instancePath:R="",rootData:j=_}={}){let M=null,k=0;if("number"!=typeof _&&"string"!=typeof _&&"boolean"!=typeof _){const K={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:c.type},message:"must be number,string,boolean",schema:c.type,parentSchema:c,data:_};null===M?M=[K]:M.push(K),k++}return x.errors=M,0===k}const B={type:["number","string"]};function m(_,{instancePath:R="",rootData:j=_}={}){let M=null,k=0;if("number"!=typeof _&&"string"!=typeof _){const K={instancePath:R,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:_};null===M?M=[K]:M.push(K),k++}return m.errors=M,0===k}function S(_,{instancePath:R="",rootData:j=_}={}){let M=null,k=0;if(_&&"object"==typeof _&&!Array.isArray(_)){if(void 0===_.type){const K={instancePath:R,schemaPath:"#/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'",schema:f.required,parentSchema:f,data:_};null===M?M=[K]:M.push(K),k++}for(const K in _)if(!i.call(f.properties,K)){const W={instancePath:R,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:K},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:_};null===M?M=[W]:M.push(W),k++}if(void 0!==_.const&&(x(_.const,{instancePath:R+"/const",parentData:_,parentDataProperty:"const",rootData:j})||(M=null===M?x.errors:M.concat(x.errors),k=M.length)),void 0!==_.enum){let K=_.enum;if(Array.isArray(K)){const W=K.length;for(let V=0;V{"use strict";Me.exports=_,Me.exports.default=_;const f={additionalProperties:!1,properties:{const:{$ref:"#/definitions/OneOfNumberStringBoolean"},contains:{$ref:"#/definitions/FilterV2"},enum:{items:{$ref:"#/definitions/OneOfNumberString"},type:"array"},exclusiveMaximum:{$ref:"#/definitions/OneOfNumberString"},exclusiveMinimum:{$ref:"#/definitions/OneOfNumberString"},format:{type:"string"},formatExclusiveMaximum:{type:"string"},formatExclusiveMinimum:{type:"string"},formatMaximum:{type:"string"},formatMinimum:{type:"string"},items:{anyOf:[{$ref:"#/definitions/FilterV2"},{items:{$ref:"#/definitions/FilterV2"},minItems:1,type:"array"}]},maxLength:{type:"number"},maximum:{$ref:"#/definitions/OneOfNumberString"},minLength:{type:"number"},minimum:{$ref:"#/definitions/OneOfNumberString"},not:{type:"object"},pattern:{type:"string"},type:{type:"string"}},type:"object"},i=Object.prototype.hasOwnProperty,c={type:["number","string","boolean"]};function x(R,{instancePath:T="",rootData:M=R}={}){let k=null,K=0;if("number"!=typeof R&&"string"!=typeof R&&"boolean"!=typeof R){const W={instancePath:T,schemaPath:"#/type",keyword:"type",params:{type:c.type},message:"must be number,string,boolean",schema:c.type,parentSchema:c,data:R};null===k?k=[W]:k.push(W),K++}return x.errors=k,0===K}const B={type:["number","string"]};function m(R,{instancePath:T="",rootData:M=R}={}){let k=null,K=0;if("number"!=typeof R&&"string"!=typeof R){const W={instancePath:T,schemaPath:"#/type",keyword:"type",params:{type:B.type},message:"must be number,string",schema:B.type,parentSchema:B,data:R};null===k?k=[W]:k.push(W),K++}return m.errors=k,0===K}const S={validate:g};function g(R,{instancePath:T="",rootData:M=R}={}){let k=null,K=0;if(R&&"object"==typeof R&&!Array.isArray(R)){for(const V in R)if(!i.call(f.properties,V)){const Z={instancePath:T,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:R};null===k?k=[Z]:k.push(Z),K++}if(void 0!==R.const&&(x(R.const,{instancePath:T+"/const",parentData:R,parentDataProperty:"const",rootData:M})||(k=null===k?x.errors:k.concat(x.errors),K=k.length)),void 0!==R.contains&&(S.validate(R.contains,{instancePath:T+"/contains",parentData:R,parentDataProperty:"contains",rootData:M})||(k=null===k?S.validate.errors:k.concat(S.validate.errors),K=k.length)),void 0!==R.enum){let V=R.enum;if(Array.isArray(V)){const Z=V.length;for(let q=0;q{"use strict";Me.exports=ne,Me.exports.default=ne;const F={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{schema:{type:"object",properties:{uri:{type:"string"},required:{type:"boolean"}},required:["uri"],additionalProperties:!1},issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},filter:{type:"object",properties:{type:{type:"string"},format:{type:"string"},pattern:{type:"string"},minimum:{type:["number","string"]},minLength:{type:"integer"},maxLength:{type:"integer"},exclusiveMinimum:{type:["number","string"]},exclusiveMaximum:{type:["number","string"]},maximum:{type:["number","string"]},const:{type:["number","string"]},enum:{type:"array",items:{type:["number","string"]}},not:{type:"object",minProperties:1}},required:["type"],additionalProperties:!1},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},group:{type:"array",items:{type:"string"}},schema:{type:"array",items:{$ref:"#/definitions/schema"}},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id","schema"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},filter:{$ref:"#/definitions/filter"},predicate:{type:"string",enum:["required","preferred"]}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},f={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},i=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$","u"),c=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),x=new RegExp("^di_vc$|^di_vp$|^di$","u"),B=new RegExp("additionalProperties","u");function m(te,{instancePath:ie="",rootData:ye=te}={}){let ue=null,$=0;if(te&&"object"==typeof te&&!Array.isArray(te)){for(const o in te)if(!("vc+sd-jwt"===o||i.test(o)||c.test(o)||x.test(o)||B.test(o))){const h={instancePath:ie,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:o},message:"must NOT have additional properties",schema:!1,parentSchema:f,data:te};null===ue?ue=[h]:ue.push(h),$++}if(void 0!==te["vc+sd-jwt"]){let o=te["vc+sd-jwt"];if(o&&"object"==typeof o&&!Array.isArray(o)){for(const h in o)if("sd-jwt_alg_values"!==h&&"kb-jwt_alg_values"!==h){const A={instancePath:ie+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties",schema:!1,parentSchema:f.properties["vc+sd-jwt"],data:o};null===ue?ue=[A]:ue.push(A),$++}if(void 0!==o["sd-jwt_alg_values"]){let h=o["sd-jwt_alg_values"];if(Array.isArray(h)){if(h.length<1){const C={instancePath:ie+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:f.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:h};null===ue?ue=[C]:ue.push(C),$++}const A=h.length;for(let C=0;C=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[0].properties.count,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.min.type,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[0].properties.max.type,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[0].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.from){let H=te.from;if("string"!=typeof H){const I={instancePath:ie+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[0].properties.from.type,parentSchema:S.oneOf[0].properties.from,data:H};null===ue?ue=[I]:ue.push(I),$++}}}C===$&&(h=!0,A=0);const O=$;if(te&&"object"==typeof te&&!Array.isArray(te)){if(void 0===te.rule){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),$++}if(void 0===te.from_nested){const H={instancePath:ie,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:S.oneOf[1].required,parentSchema:S.oneOf[1],data:te};null===ue?ue=[H]:ue.push(H),$++}for(const H in te)if("name"!==H&&"purpose"!==H&&"rule"!==H&&"count"!==H&&"min"!==H&&"max"!==H&&"from_nested"!==H){const I={instancePath:ie,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:H},message:"must NOT have additional properties",schema:!1,parentSchema:S.oneOf[1],data:te};null===ue?ue=[I]:ue.push(I),$++}if(void 0!==te.name){let H=te.name;if("string"!=typeof H){const I={instancePath:ie+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.name.type,parentSchema:S.oneOf[1].properties.name,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.purpose){let H=te.purpose;if("string"!=typeof H){const I={instancePath:ie+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.purpose.type,parentSchema:S.oneOf[1].properties.purpose,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.rule){let H=te.rule;if("string"!=typeof H){const I={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:S.oneOf[1].properties.rule.type,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[I]:ue.push(I),$++}if("all"!==H&&"pick"!==H){const I={instancePath:ie+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:S.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:S.oneOf[1].properties.rule.enum,parentSchema:S.oneOf[1].properties.rule,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.count){let H=te.count;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.count.type,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<1||isNaN(H))){const I={instancePath:ie+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:S.oneOf[1].properties.count,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.min){let H=te.min;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.min.type,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.min,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.max){let H=te.max;if("number"!=typeof H||H%1||isNaN(H)){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:S.oneOf[1].properties.max.type,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}if("number"==typeof H&&(H<0||isNaN(H))){const I={instancePath:ie+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:S.oneOf[1].properties.max,data:H};null===ue?ue=[I]:ue.push(I),$++}}if(void 0!==te.from_nested){let H=te.from_nested;if(Array.isArray(H)){if(H.length<1){const s={instancePath:ie+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:S.oneOf[1].properties.from_nested,data:H};null===ue?ue=[s]:ue.push(s),$++}const I=H.length;for(let s=0;s{"use strict";Me.exports=C,Me.exports.default=C;const i={$schema:"http://json-schema.org/draft-07/schema#",title:"Presentation Definition",definitions:{issuance:{type:"object",properties:{manifest:{type:"string"}},additionalProperties:!0},format:{type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},submission_requirements:{type:"object",oneOf:[{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from:{type:"string"}},required:["rule","from"],additionalProperties:!1},{properties:{name:{type:"string"},purpose:{type:"string"},rule:{type:"string",enum:["all","pick"]},count:{type:"integer",minimum:1},min:{type:"integer",minimum:0},max:{type:"integer",minimum:0},from_nested:{type:"array",minItems:1,items:{$ref:"#/definitions/submission_requirements"}}},required:["rule","from_nested"],additionalProperties:!1}]},input_descriptors:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},issuance:{type:"array",items:{$ref:"#/definitions/issuance"}},group:{type:"array",items:{type:"string"}},format:{$ref:"#/definitions/format"},constraints:{type:"object",properties:{limit_disclosure:{type:"string",enum:["required","preferred"]},statuses:{type:"object",properties:{active:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},suspended:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}},revoked:{type:"object",properties:{directive:{type:"string",enum:["required","allowed","disallowed"]}}}}},fields:{type:"array",items:{$ref:"#/definitions/field"}},subject_is_issuer:{type:"string",enum:["required","preferred"]},is_holder:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}},same_subject:{type:"array",items:{type:"object",properties:{field_id:{type:"array",items:{type:"string"}},directive:{type:"string",enum:["required","preferred"]}},required:["field_id","directive"],additionalProperties:!1}}},additionalProperties:!1}},required:["id"],additionalProperties:!1},field:{type:"object",oneOf:[{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},name:{type:"string"}},required:["path"],additionalProperties:!1},{properties:{id:{type:"string"},path:{type:"array",items:{type:"string"}},purpose:{type:"string"},intent_to_retain:{type:"boolean"},filter:{$ref:"http://json-schema.org/schema#"},predicate:{type:"string",enum:["required","preferred"]},name:{type:"string"}},required:["path","filter","predicate"],additionalProperties:!1}]}},type:"object",properties:{presentation_definition:{type:"object",properties:{id:{type:"string"},name:{type:"string"},purpose:{type:"string"},format:{$ref:"#/definitions/format"},frame:{type:"object",additionalProperties:!0},submission_requirements:{type:"array",items:{$ref:"#/definitions/submission_requirements"}},input_descriptors:{type:"array",items:{$ref:"#/definitions/input_descriptors"}}},required:["id","input_descriptors"],additionalProperties:!1}}},c={type:"object",properties:{"vc+sd-jwt":{type:"object",properties:{"sd-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a SD-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented SD-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}},"kb-jwt_alg_values":{type:"array",description:"A JSON array containing identifiers of cryptographic algorithms the verifier supports for protection of a KB-JWT. If present, the alg JOSE header (as defined in [RFC7515]) of the presented KB-JWT MUST match one of the array values.",minItems:1,items:{type:"string"}}},required:[],additionalProperties:!1}},patternProperties:{"^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$":{type:"object",properties:{alg:{type:"array",minItems:1,items:{type:"string"}}},required:["alg"],additionalProperties:!1},"^ldp_vc$|^ldp_vp$|^ldp$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type"],additionalProperties:!1},"^di_vc$|^di_vp$|^di$":{type:"object",properties:{proof_type:{type:"array",minItems:1,items:{type:"string"}},cryptosuite:{type:"array",minItems:1,items:{type:"string"}}},required:["proof_type","cryptosuite"],additionalProperties:!1},additionalProperties:!1},additionalProperties:!1},x=new RegExp("^jwt$|^jwt_vc$|^jwt_vc_json$|^jwt_vp$|^jwt_vp_json$|^mso_mdoc$","u"),B=new RegExp("^ldp_vc$|^ldp_vp$|^ldp$","u"),m=new RegExp("^di_vc$|^di_vp$|^di$","u"),S=new RegExp("additionalProperties","u");function g(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if(O&&"object"==typeof O&&!Array.isArray(O)){for(const ee in O)if(!("vc+sd-jwt"===ee||x.test(ee)||B.test(ee)||m.test(ee)||S.test(ee))){const se={instancePath:z,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ee},message:"must NOT have additional properties",schema:!1,parentSchema:c,data:O};null===p?p=[se]:p.push(se),J++}if(void 0!==O["vc+sd-jwt"]){let ee=O["vc+sd-jwt"];if(ee&&"object"==typeof ee&&!Array.isArray(ee)){for(const se in ee)if("sd-jwt_alg_values"!==se&&"kb-jwt_alg_values"!==se){const de={instancePath:z+"/vc+sd-jwt",schemaPath:"#/properties/vc%2Bsd-jwt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:se},message:"must NOT have additional properties",schema:!1,parentSchema:c.properties["vc+sd-jwt"],data:ee};null===p?p=[de]:p.push(de),J++}if(void 0!==ee["sd-jwt_alg_values"]){let se=ee["sd-jwt_alg_values"];if(Array.isArray(se)){if(se.length<1){const Ae={instancePath:z+"/vc+sd-jwt/sd-jwt_alg_values",schemaPath:"#/properties/vc%2Bsd-jwt/properties/sd-jwt_alg_values/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:c.properties["vc+sd-jwt"].properties["sd-jwt_alg_values"],data:se};null===p?p=[Ae]:p.push(Ae),J++}const de=se.length;for(let Ae=0;Ae=",limit:1},message:"must be >= 1",schema:1,parentSchema:_.oneOf[0].properties.count,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/0/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[0].properties.min.type,parentSchema:_.oneOf[0].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/0/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[0].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/0/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[0].properties.max.type,parentSchema:_.oneOf[0].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/0/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[0].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.from){let xe=O.from;if("string"!=typeof xe){const Ce={instancePath:z+"/from",schemaPath:"#/oneOf/0/properties/from/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[0].properties.from.type,parentSchema:_.oneOf[0].properties.from,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}}Ae===J&&(se=!0,de=0);const Ie=J;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.rule){const xe={instancePath:z,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"rule"},message:"must have required property 'rule'",schema:_.oneOf[1].required,parentSchema:_.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),J++}if(void 0===O.from_nested){const xe={instancePath:z,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:"from_nested"},message:"must have required property 'from_nested'",schema:_.oneOf[1].required,parentSchema:_.oneOf[1],data:O};null===p?p=[xe]:p.push(xe),J++}for(const xe in O)if("name"!==xe&&"purpose"!==xe&&"rule"!==xe&&"count"!==xe&&"min"!==xe&&"max"!==xe&&"from_nested"!==xe){const Ce={instancePath:z,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:_.oneOf[1],data:O};null===p?p=[Ce]:p.push(Ce),J++}if(void 0!==O.name){let xe=O.name;if("string"!=typeof xe){const Ce={instancePath:z+"/name",schemaPath:"#/oneOf/1/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[1].properties.name.type,parentSchema:_.oneOf[1].properties.name,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.purpose){let xe=O.purpose;if("string"!=typeof xe){const Ce={instancePath:z+"/purpose",schemaPath:"#/oneOf/1/properties/purpose/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[1].properties.purpose.type,parentSchema:_.oneOf[1].properties.purpose,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.rule){let xe=O.rule;if("string"!=typeof xe){const Ce={instancePath:z+"/rule",schemaPath:"#/oneOf/1/properties/rule/type",keyword:"type",params:{type:"string"},message:"must be string",schema:_.oneOf[1].properties.rule.type,parentSchema:_.oneOf[1].properties.rule,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("all"!==xe&&"pick"!==xe){const Ce={instancePath:z+"/rule",schemaPath:"#/oneOf/1/properties/rule/enum",keyword:"enum",params:{allowedValues:_.oneOf[1].properties.rule.enum},message:"must be equal to one of the allowed values",schema:_.oneOf[1].properties.rule.enum,parentSchema:_.oneOf[1].properties.rule,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.count){let xe=O.count;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/count",schemaPath:"#/oneOf/1/properties/count/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[1].properties.count.type,parentSchema:_.oneOf[1].properties.count,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<1||isNaN(xe))){const Ce={instancePath:z+"/count",schemaPath:"#/oneOf/1/properties/count/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1",schema:1,parentSchema:_.oneOf[1].properties.count,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.min){let xe=O.min;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/1/properties/min/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[1].properties.min.type,parentSchema:_.oneOf[1].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/min",schemaPath:"#/oneOf/1/properties/min/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[1].properties.min,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.max){let xe=O.max;if("number"!=typeof xe||xe%1||isNaN(xe)){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/1/properties/max/type",keyword:"type",params:{type:"integer"},message:"must be integer",schema:_.oneOf[1].properties.max.type,parentSchema:_.oneOf[1].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}if("number"==typeof xe&&(xe<0||isNaN(xe))){const Ce={instancePath:z+"/max",schemaPath:"#/oneOf/1/properties/max/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0",schema:0,parentSchema:_.oneOf[1].properties.max,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.from_nested){let xe=O.from_nested;if(Array.isArray(xe)){if(xe.length<1){const Xe={instancePath:z+"/from_nested",schemaPath:"#/oneOf/1/properties/from_nested/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:_.oneOf[1].properties.from_nested,data:xe};null===p?p=[Xe]:p.push(Xe),J++}const Ce=xe.length;for(let Xe=0;Xe=",limit:0},message:"must be >= 0",schema:0,parentSchema:W,data:O};null===p?p=[ee]:p.push(ee),J++}return V.errors=p,0===J}function q(O,{instancePath:z="",parentData:H,parentDataProperty:I,rootData:s=O}={}){let p=null,J=0;return V(O,{instancePath:z,parentData:H,parentDataProperty:I,rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length),q.errors=p,0===J}const ne={type:"array",minItems:1,items:{$ref:"#"}},te={validate:o};function ie(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if(Array.isArray(O)){if(O.length<1){const se={instancePath:z,schemaPath:"#/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:ne,data:O};null===p?p=[se]:p.push(se),J++}const ee=O.length;for(let se=0;se1){const Ae={};for(;se--;){let Ie=O[se];if("string"==typeof Ie){if("number"==typeof Ae[Ie]){de=Ae[Ie];const Le={instancePath:z,schemaPath:"#/uniqueItems",keyword:"uniqueItems",params:{i:se,j:de},message:"must NOT have duplicate items (items ## "+de+" and "+se+" are identical)",schema:!0,parentSchema:ae,data:O};null===p?p=[Le]:p.push(Le),J++;break}Ae[Ie]=se}}}}else{const ee={instancePath:z,schemaPath:"#/type",keyword:"type",params:{type:"array"},message:"must be array",schema:ae.type,parentSchema:ae,data:O};null===p?p=[ee]:p.push(ee),J++}return me.errors=p,0===J}const ye={enum:["array","boolean","integer","null","number","object","string"]};function ue(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if("array"!==O&&"boolean"!==O&&"integer"!==O&&"null"!==O&&"number"!==O&&"object"!==O&&"string"!==O){const ee={instancePath:z,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:ye.enum},message:"must be equal to one of the allowed values",schema:ye.enum,parentSchema:ye,data:O};null===p?p=[ee]:p.push(ee),J++}return ue.errors=p,0===J}const $=f(54195).default;function o(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if((!O||"object"!=typeof O||Array.isArray(O))&&"boolean"!=typeof O){const Ie={instancePath:z,schemaPath:"#/type",keyword:"type",params:{type:K.type},message:"must be object,boolean",schema:K.type,parentSchema:K,data:O};null===p?p=[Ie]:p.push(Ie),J++}if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0!==O.$id){let Ie=O.$id;if("string"!=typeof Ie){const Le={instancePath:z+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$id.type,parentSchema:K.properties.$id,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.$schema){let Ie=O.$schema;if("string"!=typeof Ie){const Le={instancePath:z+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$schema.type,parentSchema:K.properties.$schema,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.$ref){let Ie=O.$ref;if("string"!=typeof Ie){const Le={instancePath:z+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$ref.type,parentSchema:K.properties.$ref,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.$comment){let Ie=O.$comment;if("string"!=typeof Ie){const Le={instancePath:z+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.$comment.type,parentSchema:K.properties.$comment,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.title){let Ie=O.title;if("string"!=typeof Ie){const Le={instancePath:z+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.title.type,parentSchema:K.properties.title,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.description){let Ie=O.description;if("string"!=typeof Ie){const Le={instancePath:z+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.description.type,parentSchema:K.properties.description,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.readOnly){let Ie=O.readOnly;if("boolean"!=typeof Ie){const Le={instancePath:z+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:K.properties.readOnly.type,parentSchema:K.properties.readOnly,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.examples){let Ie=O.examples;if(!Array.isArray(Ie)){const Le={instancePath:z+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type:"array"},message:"must be array",schema:K.properties.examples.type,parentSchema:K.properties.examples,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.multipleOf){let Ie=O.multipleOf;if("number"==typeof Ie){if(Ie<=0||isNaN(Ie)){const Le={instancePath:z+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison:">",limit:0},message:"must be > 0",schema:0,parentSchema:K.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),J++}}else{const Le={instancePath:z+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.multipleOf.type,parentSchema:K.properties.multipleOf,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.maximum){let Ie=O.maximum;if("number"!=typeof Ie){const Le={instancePath:z+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.maximum.type,parentSchema:K.properties.maximum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.exclusiveMaximum){let Ie=O.exclusiveMaximum;if("number"!=typeof Ie){const Le={instancePath:z+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.exclusiveMaximum.type,parentSchema:K.properties.exclusiveMaximum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.minimum){let Ie=O.minimum;if("number"!=typeof Ie){const Le={instancePath:z+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.minimum.type,parentSchema:K.properties.minimum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.exclusiveMinimum){let Ie=O.exclusiveMinimum;if("number"!=typeof Ie){const Le={instancePath:z+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type:"number"},message:"must be number",schema:K.properties.exclusiveMinimum.type,parentSchema:K.properties.exclusiveMinimum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.maxLength&&(V(O.maxLength,{instancePath:z+"/maxLength",parentData:O,parentDataProperty:"maxLength",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length)),void 0!==O.minLength&&(q(O.minLength,{instancePath:z+"/minLength",parentData:O,parentDataProperty:"minLength",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),J=p.length)),void 0!==O.pattern){let Ie=O.pattern;if("string"!=typeof Ie){const Le={instancePath:z+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.pattern.type,parentSchema:K.properties.pattern,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.additionalItems&&(o(O.additionalItems,{instancePath:z+"/additionalItems",parentData:O,parentDataProperty:"additionalItems",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.items){let Ie=O.items;const Le=J;let xe=!1;const Ce=J;o(Ie,{instancePath:z+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);var ee=Ce===J;if(xe=xe||ee,!xe){const Xe=J;ie(Ie,{instancePath:z+"/items",parentData:O,parentDataProperty:"items",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length),ee=Xe===J,xe=xe||ee}if(xe)J=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:z+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:K.properties.items.anyOf,parentSchema:K.properties.items,data:Ie};null===p?p=[Xe]:p.push(Xe),J++}}if(void 0!==O.maxItems&&(V(O.maxItems,{instancePath:z+"/maxItems",parentData:O,parentDataProperty:"maxItems",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length)),void 0!==O.minItems&&(q(O.minItems,{instancePath:z+"/minItems",parentData:O,parentDataProperty:"minItems",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),J=p.length)),void 0!==O.uniqueItems){let Ie=O.uniqueItems;if("boolean"!=typeof Ie){const Le={instancePath:z+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type:"boolean"},message:"must be boolean",schema:K.properties.uniqueItems.type,parentSchema:K.properties.uniqueItems,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.contains&&(o(O.contains,{instancePath:z+"/contains",parentData:O,parentDataProperty:"contains",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.maxProperties&&(V(O.maxProperties,{instancePath:z+"/maxProperties",parentData:O,parentDataProperty:"maxProperties",rootData:s})||(p=null===p?V.errors:p.concat(V.errors),J=p.length)),void 0!==O.minProperties&&(q(O.minProperties,{instancePath:z+"/minProperties",parentData:O,parentDataProperty:"minProperties",rootData:s})||(p=null===p?q.errors:p.concat(q.errors),J=p.length)),void 0!==O.required&&(me(O.required,{instancePath:z+"/required",parentData:O,parentDataProperty:"required",rootData:s})||(p=null===p?me.errors:p.concat(me.errors),J=p.length)),void 0!==O.additionalProperties&&(o(O.additionalProperties,{instancePath:z+"/additionalProperties",parentData:O,parentDataProperty:"additionalProperties",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.definitions){let Ie=O.definitions;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:z+"/definitions/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);else{const Le={instancePath:z+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.definitions.type,parentSchema:K.properties.definitions,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.properties){let Ie=O.properties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie)o(Ie[Le],{instancePath:z+"/properties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);else{const Le={instancePath:z+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.properties.type,parentSchema:K.properties.properties,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.patternProperties){let Ie=O.patternProperties;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie)){for(const Le in Ie)if(J!=J){const Ce={instancePath:z+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName:Le},message:"property name must be valid",schema:K.properties.patternProperties.propertyNames,parentSchema:K.properties.patternProperties,data:Ie};null===p?p=[Ce]:p.push(Ce),J++}for(const Le in Ie)o(Ie[Le],{instancePath:z+"/patternProperties/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)}else{const Le={instancePath:z+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.patternProperties.type,parentSchema:K.properties.patternProperties,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.dependencies){let Ie=O.dependencies;if(Ie&&"object"==typeof Ie&&!Array.isArray(Ie))for(const Le in Ie){let xe=Ie[Le];const Ce=J;let Xe=!1;const Te=J;o(xe,{instancePath:z+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length);var de=Te===J;if(Xe=Xe||de,!Xe){const ke=J;me(xe,{instancePath:z+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:Ie,parentDataProperty:Le,rootData:s})||(p=null===p?me.errors:p.concat(me.errors),J=p.length),de=ke===J,Xe=Xe||de}if(Xe)J=Ce,null!==p&&(Ce?p.length=Ce:p=null);else{const ke={instancePath:z+"/dependencies/"+Le.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:K.properties.dependencies.additionalProperties.anyOf,parentSchema:K.properties.dependencies.additionalProperties,data:xe};null===p?p=[ke]:p.push(ke),J++}}else{const Le={instancePath:z+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type:"object"},message:"must be object",schema:K.properties.dependencies.type,parentSchema:K.properties.dependencies,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.propertyNames&&(o(O.propertyNames,{instancePath:z+"/propertyNames",parentData:O,parentDataProperty:"propertyNames",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.enum){let Ie=O.enum;if(Array.isArray(Ie)){if(Ie.length<1){const Ce={instancePath:z+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:K.properties.enum,data:Ie};null===p?p=[Ce]:p.push(Ce),J++}let xe,Le=Ie.length;if(Le>1)e:for(;Le--;)for(xe=Le;xe--;)if($(Ie[Le],Ie[xe])){const Ce={instancePath:z+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i:Le,j:xe},message:"must NOT have duplicate items (items ## "+xe+" and "+Le+" are identical)",schema:!0,parentSchema:K.properties.enum,data:Ie};null===p?p=[Ce]:p.push(Ce),J++;break e}}else{const Le={instancePath:z+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type:"array"},message:"must be array",schema:K.properties.enum.type,parentSchema:K.properties.enum,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.type){let Ie=O.type;const Le=J;let xe=!1;const Ce=J;ue(Ie,{instancePath:z+"/type",parentData:O,parentDataProperty:"type",rootData:s})||(p=null===p?ue.errors:p.concat(ue.errors),J=p.length);var Ae=Ce===J;if(xe=xe||Ae,!xe){const Xe=J;if(Array.isArray(Ie)){if(Ie.length<1){const ve={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items",schema:1,parentSchema:K.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),J++}const ke=Ie.length;for(let ve=0;ve1)e:for(;Se--;)for(Ee=Se;Ee--;)if($(Ie[Se],Ie[Ee])){const ve={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i:Se,j:Ee},message:"must NOT have duplicate items (items ## "+Ee+" and "+Se+" are identical)",schema:!0,parentSchema:K.properties.type.anyOf[1],data:Ie};null===p?p=[ve]:p.push(ve),J++;break e}}else{const ke={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array",schema:K.properties.type.anyOf[1].type,parentSchema:K.properties.type.anyOf[1],data:Ie};null===p?p=[ke]:p.push(ke),J++}Ae=Xe===J,xe=xe||Ae}if(xe)J=Le,null!==p&&(Le?p.length=Le:p=null);else{const Xe={instancePath:z+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf",schema:K.properties.type.anyOf,parentSchema:K.properties.type,data:Ie};null===p?p=[Xe]:p.push(Xe),J++}}if(void 0!==O.format){let Ie=O.format;if("string"!=typeof Ie){const Le={instancePath:z+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.format.type,parentSchema:K.properties.format,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.contentMediaType){let Ie=O.contentMediaType;if("string"!=typeof Ie){const Le={instancePath:z+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.contentMediaType.type,parentSchema:K.properties.contentMediaType,data:Ie};null===p?p=[Le]:p.push(Le),J++}}if(void 0!==O.contentEncoding){let Ie=O.contentEncoding;if("string"!=typeof Ie){const Le={instancePath:z+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type:"string"},message:"must be string",schema:K.properties.contentEncoding.type,parentSchema:K.properties.contentEncoding,data:Ie};null===p?p=[Le]:p.push(Le),J++}}void 0!==O.if&&(o(O.if,{instancePath:z+"/if",parentData:O,parentDataProperty:"if",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.then&&(o(O.then,{instancePath:z+"/then",parentData:O,parentDataProperty:"then",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.else&&(o(O.else,{instancePath:z+"/else",parentData:O,parentDataProperty:"else",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length)),void 0!==O.allOf&&(ie(O.allOf,{instancePath:z+"/allOf",parentData:O,parentDataProperty:"allOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length)),void 0!==O.anyOf&&(ie(O.anyOf,{instancePath:z+"/anyOf",parentData:O,parentDataProperty:"anyOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length)),void 0!==O.oneOf&&(ie(O.oneOf,{instancePath:z+"/oneOf",parentData:O,parentDataProperty:"oneOf",rootData:s})||(p=null===p?ie.errors:p.concat(ie.errors),J=p.length)),void 0!==O.not&&(o(O.not,{instancePath:z+"/not",parentData:O,parentDataProperty:"not",rootData:s})||(p=null===p?o.errors:p.concat(o.errors),J=p.length))}return o.errors=p,0===J}function h(O,{instancePath:z="",rootData:s=O}={}){let p=null,J=0;if(!O||"object"!=typeof O||Array.isArray(O)){const xe={instancePath:z,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object",schema:k.type,parentSchema:k,data:O};null===p?p=[xe]:p.push(xe),J++}const ee=J;let se=!1,de=null;const Ae=J;if(O&&"object"==typeof O&&!Array.isArray(O)){if(void 0===O.path){const xe={instancePath:z,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:"path"},message:"must have required property 'path'",schema:k.oneOf[0].required,parentSchema:k.oneOf[0],data:O};null===p?p=[xe]:p.push(xe),J++}for(const xe in O)if("id"!==xe&&"path"!==xe&&"purpose"!==xe&&"intent_to_retain"!==xe&&"filter"!==xe&&"name"!==xe){const Ce={instancePath:z,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:xe},message:"must NOT have additional properties",schema:!1,parentSchema:k.oneOf[0],data:O};null===p?p=[Ce]:p.push(Ce),J++}if(void 0!==O.id){let xe=O.id;if("string"!=typeof xe){const Ce={instancePath:z+"/id",schemaPath:"#/oneOf/0/properties/id/type",keyword:"type",params:{type:"string"},message:"must be string",schema:k.oneOf[0].properties.id.type,parentSchema:k.oneOf[0].properties.id,data:xe};null===p?p=[Ce]:p.push(Ce),J++}}if(void 0!==O.path){let xe=O.path;if(Array.isArray(xe)){const Ce=xe.length;for(let Xe=0;Xe{"use strict";function f(me,ye){return{validate:me,compare:ye}}Object.defineProperty(F,"__esModule",{value:!0}),F.formatNames=F.fastFormats=F.fullFormats=void 0,F.fullFormats={date:f(B,m),time:f(g,_),"date-time":f(function T(me){const ye=me.split(R);return 2===ye.length&&B(ye[0])&&g(ye[1],!0)},E),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function k(me){return j.test(me)&&M.test(me)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function ae(me){if(ie.test(me))return!1;try{return new RegExp(me),!0}catch{return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function W(me){return K.lastIndex=0,K.test(me)},int32:{type:"number",validate:function q(me){return Number.isInteger(me)&&me<=Z&&me>=V}},int64:{type:"number",validate:function ne(me){return Number.isInteger(me)}},float:{type:"number",validate:te},double:{type:"number",validate:te},password:!0,binary:!0},F.fastFormats={...F.fullFormats,date:f(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,m),time:f(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"date-time":f(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,E),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},F.formatNames=Object.keys(F.fullFormats);const c=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,x=[0,31,28,31,30,31,30,31,31,30,31,30,31];function B(me){const ye=c.exec(me);if(!ye)return!1;const $=+ye[2],o=+ye[3];return $>=1&&$<=12&&o>=1&&o<=(2===$&&function i(me){return me%4==0&&(me%100!=0||me%400==0)}(+ye[1])?29:x[$])}function m(me,ye){if(me&&ye)return me>ye?1:me(ye=$[1]+$[2]+$[3]+($[4]||""))?1:me{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(3993),c=f(10122),x=f(85432),B=new x.Name("fullFormats"),m=new x.Name("fastFormats"),S=(_,R={keywords:!0})=>{if(Array.isArray(R))return g(_,R,i.fullFormats,B),_;const[T,E]="fast"===R.mode?[i.fastFormats,m]:[i.fullFormats,B];return g(_,R.formats||i.formatNames,T,E),R.keywords&&c.default(_),_};function g(_,R,T,E){var j,M;null!==(j=(M=_.opts.code).formats)&&void 0!==j||(M.formats=x._`require("ajv-formats/dist/formats").${E}`);for(const k of R)_.addFormat(k,T[k])}S.get=(_,R="full")=>{const E=("fast"===R?i.fastFormats:i.fullFormats)[_];if(!E)throw new Error(`Unknown format "${_}"`);return E},Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S},10122:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.formatLimitDefinition=void 0;const i=f(39208),c=f(85432),x=c.operators,B={formatMaximum:{okStr:"<=",ok:x.LTE,fail:x.GT},formatMinimum:{okStr:">=",ok:x.GTE,fail:x.LT},formatExclusiveMaximum:{okStr:"<",ok:x.LT,fail:x.GTE},formatExclusiveMinimum:{okStr:">",ok:x.GT,fail:x.LTE}},m={message:({keyword:g,schemaCode:_})=>c.str`should be ${B[g].okStr} ${_}`,params:({keyword:g,schemaCode:_})=>c._`{comparison: ${B[g].okStr}, limit: ${_}}`};F.formatLimitDefinition={keyword:Object.keys(B),type:"string",schemaType:"string",$data:!0,error:m,code(g){const{gen:_,data:R,schemaCode:T,keyword:E,it:j}=g,{opts:M,self:k}=j;if(!M.validateFormats)return;const K=new i.KeywordCxt(j,k.RULES.all.format.definition,"format");function Z(q){return c._`${q}.compare(${R}, ${T}) ${B[E].fail} 0`}K.$data?function W(){const q=_.scopeValue("formats",{ref:k.formats,code:M.code.formats}),ne=_.const("fmt",c._`${q}[${K.schemaCode}]`);g.fail$data(c.or(c._`typeof ${ne} != "object"`,c._`${ne} instanceof RegExp`,c._`typeof ${ne}.compare != "function"`,Z(ne)))}():function V(){const q=K.schema,ne=k.formats[q];if(!ne||!0===ne)return;if("object"!=typeof ne||ne instanceof RegExp||"function"!=typeof ne.compare)throw new Error(`"${E}": format "${q}" does not define "compare" function`);const te=_.scopeValue("formats",{key:q,ref:ne,code:M.code.formats?c._`${M.code.formats}${c.getProperty(q)}`:void 0});g.fail$data(Z(te))}()},dependencies:["format"]},F.default=g=>(g.addKeyword(F.formatLimitDefinition),g)},11151:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(76533),F),c(f(59433),F),c(f(54065),F)},51236:function(Me,F,f){"use strict";var i=this&&this.__rest||function(g,_){var R={};for(var T in g)Object.prototype.hasOwnProperty.call(g,T)&&_.indexOf(T)<0&&(R[T]=g[T]);if(null!=g&&"function"==typeof Object.getOwnPropertySymbols){var E=0;for(T=Object.getOwnPropertySymbols(g);ES.toWrappedVerifiableCredential(T,R))}static toWrappedVerifiableCredential(_,R){var T;if(S.isSdJwtDecodedCredential(_)||S.isSdJwtEncoded(_)){let q;if(S.isSdJwtEncoded(_)){if(!R?.hasher)throw new Error("Hasher implementation is required to decode SD-JWT");q=(0,B.decodeSdJwtVc)(_,R.hasher)}else q=_;return{type:S.isSdJwtDecodedCredential(_)?B.OriginalType.SD_JWT_VC_DECODED:B.OriginalType.SD_JWT_VC_ENCODED,format:"vc+sd-jwt",original:_,credential:q,decoded:q.decodedPayload}}const E=S.getFirstProof(_),j=S.hasJWTProofType(_)&&E&&null!==(T=E.jwt)&&void 0!==T?T:_;if(!j)throw Error("Could not determine original credential, probably it was a converted JWT credential, that is now missing the JWT value in the proof");const M=S.decodeVerifiableCredential(j),k=S.isJwtEncoded(j),K=S.isJwtDecodedCredential(j);return{original:j,decoded:M,format:k||K?"jwt_vc":"ldp_vc",type:k?B.OriginalType.JWT_ENCODED:K?B.OriginalType.JWT_DECODED:B.OriginalType.JSONLD,credential:k||K?S.jwtDecodedCredentialToUniformCredential(M,R):M}}static isJwtEncoded(_){return m.ObjectUtils.isString(_)&&_.startsWith("ey")&&!_.includes("~")}static isSdJwtEncoded(_){return m.ObjectUtils.isString(_)&&_.startsWith("ey")&&_.includes("~")}static isW3cCredential(_){var R;return"@context"in _&&((null===(R=_.type)||void 0===R?void 0:R.includes("VerifiableCredential"))||!1)}static isCredential(_){try{if(S.isJwtEncoded(_)){const R=S.toUniformCredential(_);return S.isW3cCredential(R)}return!!S.isSdJwtEncoded(_)||S.isW3cCredential(_)||S.isSdJwtDecodedCredentialPayload(_)||S.isJwtDecodedCredential(_)||S.isSdJwtDecodedCredential(_)}catch{return!1}}static isPresentation(_){try{if(S.isJwtEncoded(_)){const R=S.toUniformPresentation(_);return S.isW3cPresentation(R)}return!S.isSdJwtEncoded(_)&&(S.isW3cPresentation(_)||S.isSdJwtDecodedCredentialPayload(_)||S.isJwtDecodedPresentation(_)||S.isSdJwtDecodedCredential(_))}catch{return!1}}static hasProof(_){try{return!!(S.isJwtEncoded(_)||S.isJwtDecodedCredential(_)||S.isSdJwtEncoded(_)||S.isSdJwtDecodedCredential(_)||"vc"in _&&_.vc.proof||"vp"in _&&_.vp.proof)||!!_.proof}catch{return!1}}static isW3cPresentation(_){var R;return"@context"in _&&((null===(R=_.type)||void 0===R?void 0:R.includes("VerifiablePresentation"))||!1)}static isSdJwtDecodedCredentialPayload(_){return"vct"in _}static areOriginalVerifiableCredentialsEqual(_,R){return"string"==typeof _||"string"==typeof R?_===R:S.isSdJwtDecodedCredential(_)||S.isSdJwtDecodedCredential(R)?_.compactSdJwtVc===R.compactSdJwtVc:JSON.stringify(R.proof)===JSON.stringify(_.proof)}static isJsonLdAsString(_){return m.ObjectUtils.isString(_)&&_.includes("@context")}static isSdJwtDecodedCredential(_){return void 0!==_.compactSdJwtVc}static isJwtDecodedCredential(_){return void 0!==_.vc&&void 0!==_.iss}static isJwtDecodedPresentation(_){return void 0!==_.vp&&void 0!==_.iss}static jwtEncodedPresentationToUniformPresentation(_,R=!0,T){return S.jwtDecodedPresentationToUniformPresentation((0,x.default)(_),R,T)}static jwtDecodedPresentationToUniformPresentation(_,R=!0,T){const{iss:E,aud:j,jti:M,vp:k}=_,K=i(_,["iss","aud","jti","vp"]),W=Object.assign(Object.assign({},K),k);if(R){if(!k.verifiableCredential)throw Error("Verifiable Presentation should have a verifiable credential at this point");W.verifiableCredential=k.verifiableCredential.map(V=>S.toUniformCredential(V,T))}if(E){const V=W.holder;if(V&&V!==E)throw new Error(`Inconsistent holders between JWT claim (${E}) and VC value (${V})`);W.holder=E}if(j){const V=W.verifier;if(V&&V!==j)throw new Error(`Inconsistent holders between JWT claim (${j}) and VC value (${V})`);W.verifier=j}if(M){const V=W.id;if(V&&V!==M)throw new Error(`Inconsistent VP ids between JWT claim (${M}) and VP value (${V})`);W.id=M}return W}static toUniformCredential(_,R){var T;if(S.isSdJwtDecodedCredential(_))throw new Error("Converting SD-JWT VC to uniform VC is not supported.");const E="string"!=typeof _&&S.hasJWTProofType(_)?null===(T=S.getFirstProof(_))||void 0===T?void 0:T.jwt:_;if(!E)throw Error("Could not determine original credential from passed in credential. Probably because a JWT proof type was present, but now is not available anymore");const j=S.decodeVerifiableCredential(E),M=S.isJwtEncoded(E);return S.isJwtDecodedCredential(E)||M?S.jwtDecodedCredentialToUniformCredential(j,R):j}static toUniformPresentation(_,R){var T;if(S.isSdJwtDecodedCredential(_))throw new Error("Converting SD-JWT VC to uniform VP is not supported.");const E=S.getFirstProof(_),j="string"!=typeof _&&S.hasJWTProofType(_)?E?.jwt:_;if(!j)throw Error("Could not determine original presentation, probably it was a converted JWT presentation, that is now missing the JWT value in the proof");const M=S.decodeVerifiablePresentation(j),k=S.isJwtEncoded(j),K=S.isJwtDecodedPresentation(j),W=k||K?S.jwtDecodedPresentationToUniformPresentation(M,!1):M;return R?.addContextIfMissing&&!W["@context"]&&(W["@context"]=["https://www.w3.org/2018/credentials/v1"]),W.verifiableCredential=null===(T=W.verifiableCredential)||void 0===T?void 0:T.map(V=>S.toUniformCredential(V,R)),W}static jwtEncodedCredentialToUniformCredential(_,R){return S.jwtDecodedCredentialToUniformCredential((0,x.default)(_),R)}static jwtDecodedCredentialToUniformCredential(_,R){var T;const{exp:E,nbf:j,iss:M,vc:k,sub:K,jti:W}=_,V=i(_,["exp","nbf","iss","vc","sub","jti"]),Z=Object.assign(Object.assign({},V),k),q=null!==(T=R?.maxTimeSkewInMS)&&void 0!==T?T:1500;if(E){const ne=Z.expirationDate,te=parseInt(E.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(ne&&ne!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(ne).getTime());if(!q||ae>q)throw new Error(`Inconsistent expiration dates between JWT claim (${ie}) and VC value (${ne})`)}Z.expirationDate=ie}if(j){const ne=Z.issuanceDate,te=parseInt(j.toString()),ie=te<9999999999?new Date(1e3*te).toISOString().replace(/\.000Z/,"Z"):new Date(te).toISOString();if(ne&&ne!==ie){const ae=Math.abs(new Date(ie).getTime()-new Date(ne).getTime());if(!q||ae>q)throw new Error(`Inconsistent issuance dates between JWT claim (${ie}) and VC value (${ne})`)}Z.issuanceDate=ie}if(M){const ne=Z.issuer;if(ne){if("string"==typeof ne){if(ne!==M)throw new Error(`Inconsistent issuers between JWT claim (${M}) and VC value (${ne})`)}else if(!ne.id&&Object.keys(ne).length>0&&(ne.id=M),ne.id!==M)throw new Error(`Inconsistent issuers between JWT claim (${M}) and VC value (${ne.id})`)}else Z.issuer=M}if(K){const ne=Array.isArray(Z.credentialSubject)?Z.credentialSubject:[Z.credentialSubject];for(let te=0;te{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.mapLanguageValues=F.mapLanguageValue=F.toLanguageValueObjects=F.toLanguageValueObject=F.isLanguageValueObjects=F.isLanguageValueObject=void 0;const i=f(59433);F.isLanguageValueObject=_=>!(!_||!i.ObjectUtils.isObject(_)||Array.isArray(_)||2!==Object.keys(_).length||!("language"in _)||!_.language||!("value"in _)||!_.value),F.isLanguageValueObjects=_=>!(!_||!Array.isArray(_))&&_.every(R=>(0,F.isLanguageValueObject)(R)),F.toLanguageValueObject=_=>(0,F.isLanguageValueObject)(_)?_:void 0,F.toLanguageValueObjects=_=>(0,F.isLanguageValueObject)(_)?i.ObjectUtils.asArray((0,F.toLanguageValueObject)(_)):(0,F.isLanguageValueObjects)(_)?_:void 0,F.mapLanguageValue=(_,R)=>{const T=(0,F.toLanguageValueObjects)(_);if(Array.isArray(T)){if(0===T.length)return _;const E=T.filter(M=>!R?.language||M.language.toLowerCase().includes(R.language.toLowerCase()));let j;if(E.length>0)j=E[0];else{if(!1===R?.fallbackToFirstObject)return _;j=T[0]}return j.value}return _},F.mapLanguageValues=(_,R)=>{const T=R?.noDeepClone?_:JSON.parse(JSON.stringify(_));return Object.keys(_).forEach(E=>{T[E]=(0,F.mapLanguageValue)(T[E],R),(i.ObjectUtils.isObject(T[E])||Array.isArray(T[E]))&&(T[E]=(0,F.mapLanguageValues)(T[E],Object.assign(Object.assign({},R),{noDeepClone:!0})))}),T}},40528:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.parseDid=F.IProofType=F.IProofPurpose=void 0;var f=function(B){return B.verificationMethod="verificationMethod",B.assertionMethod="assertionMethod",B.authentication="authentication",B.keyAgreement="keyAgreement",B.contractAgreement="contactAgreement",B.capabilityInvocation="capabilityInvocation",B.capabilityDelegation="capabilityDelegation",B}(f||(F.IProofPurpose=f={})),i=function(B){return B.Ed25519Signature2018="Ed25519Signature2018",B.Ed25519Signature2020="Ed25519Signature2020",B.EcdsaSecp256k1Signature2019="EcdsaSecp256k1Signature2019",B.EcdsaSecp256k1RecoverySignature2020="EcdsaSecp256k1RecoverySignature2020",B.JsonWebSignature2020="JsonWebSignature2020",B.RsaSignature2018="RsaSignature2018",B.GpgSignature2020="GpgSignature2020",B.JcsEd25519Signature2020="JcsEd25519Signature2020",B.BbsBlsSignatureProof2020="BbsBlsSignatureProof2020",B.BbsBlsBoundSignatureProof2020="BbsBlsBoundSignatureProof2020",B.JwtProof2020="JwtProof2020",B}(i||(F.IProofType=i={}));F.parseDid=B=>{const m=x(B);if(null===m)throw new Error("invalid did");return m};const x=B=>{const S="(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))",R="[a-zA-Z0-9_.:%-]",K=new RegExp(`^did:([a-z0-9]+):((?:${S}*:)*(${S}+))((;${R}+=${R}*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$`);if(""===B||!B)return null;const W=B.match(K);if(W){const V={did:`did:${W[1]}:${W[2]}`,method:W[1],id:W[2],didUrl:B};if(W[4]){const Z=W[4].slice(1).split(";");V.params={};for(const q of Z){const ne=q.split("=");V.params[ne[0]]=ne[1]}}return W[6]&&(V.path=W[6]),W[7]&&(V.query=W[7].slice(1)),W[8]&&(V.fragment=W[8].slice(1)),V}return null}},5940:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},76533:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(40528),F),c(f(30988),F),c(f(69922),F),c(f(5940),F),c(f(86548),F),c(f(66996),F)},30988:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0})},86548:function(Me,F,f){"use strict";var i=this&&this.__awaiter||function(g,_,R,T){return new(R||(R=Promise))(function(j,M){function k(V){try{W(T.next(V))}catch(Z){M(Z)}}function K(V){try{W(T.throw(V))}catch(Z){M(Z)}}function W(V){V.done?j(V.value):function E(j){return j instanceof R?j:new R(function(M){M(j)})}(V.value).then(k,K)}W((T=T.apply(g,_||[])).next())})};Object.defineProperty(F,"__esModule",{value:!0}),F.decodeSdJwtVcAsync=F.decodeSdJwtVc=F.isWrappedSdJwtVerifiablePresentation=F.isWrappedSdJwtVerifiableCredential=void 0;const c=f(15315);F.isWrappedSdJwtVerifiableCredential=function x(g){return"vc+sd-jwt"===g.format},F.isWrappedSdJwtVerifiablePresentation=function B(g){return"vc+sd-jwt"===g.format},F.decodeSdJwtVc=function m(g,_){const{jwt:R,disclosures:T}=(0,c.decodeSdJwtSync)(g,_),E=R.payload;return{compactSdJwtVc:g,decodedPayload:(0,c.getClaimsSync)(E,T,_),disclosures:T.map(M=>{const k=M.key?[M.salt,M.key,M.value]:[M.salt,M.value];if(!M._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:M._digest,encoded:M.encode()}}),signedPayload:E}},F.decodeSdJwtVcAsync=function S(g,_){return i(this,void 0,void 0,function*(){const{jwt:R,disclosures:T}=yield(0,c.decodeSdJwt)(g,_),E=R.payload,j=yield(0,c.getClaims)(E,T,_);return{compactSdJwtVc:g,decodedPayload:j,disclosures:T.map(M=>{const k=M.key?[M.salt,M.key,M.value]:[M.salt,M.value];if(!M._digest)throw new Error("Implementation error: digest not present in disclosure");return{decoded:k,digest:M._digest,encoded:M.encode()}}),signedPayload:E}})}},69922:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.DocumentFormat=F.OriginalType=void 0;var f=function(c){return c.JSONLD="json-ld",c.JWT_ENCODED="jwt-encoded",c.JWT_DECODED="jwt-decoded",c.SD_JWT_VC_ENCODED="sd-jwt-vc-encoded",c.SD_JWT_VC_DECODED="sd-jwt-vc-decoded",c}(f||(F.OriginalType=f={})),i=function(c){return c[c.JWT=0]="JWT",c[c.JSONLD=1]="JSONLD",c[c.SD_JWT_VC=2]="SD_JWT_VC",c[c.EIP712=3]="EIP712",c}(i||(F.DocumentFormat=i={}))},66996:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.isWrappedW3CVerifiablePresentation=F.isWrappedW3CVerifiableCredential=F.StatusListDriverType=F.StatusListCredentialIdMode=F.StatusListType=F.JWT_PROOF_TYPE_2020=void 0,F.JWT_PROOF_TYPE_2020="JwtProof2020";var f=function(m){return m.StatusList2021="StatusList2021",m}(f||(F.StatusListType=f={})),i=function(m){return m.ISSUANCE="ISSUANCE",m.PERSISTENCE="PERSISTENCE",m.NEVER="NEVER",m}(i||(F.StatusListCredentialIdMode=i={})),c=function(m){return m.AGENT_TYPEORM="agent_typeorm",m.AGENT_KV_STORE="agent_kv_store",m.GITHUB="github",m.AGENT_FILESYSTEM="agent_filesystem",m}(c||(F.StatusListDriverType=c={}));F.isWrappedW3CVerifiableCredential=function x(m){return"jwt_vc"===m.format||"ldp_vc"===m.format},F.isWrappedW3CVerifiablePresentation=function B(m){return"jwt_vp"===m.format||"ldp_vp"===m.format}},59433:function(Me,F,f){"use strict";var i=this&&this.__createBinding||(Object.create?function(x,B,m,S){void 0===S&&(S=m);var g=Object.getOwnPropertyDescriptor(B,m);(!g||("get"in g?!B.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return B[m]}}),Object.defineProperty(x,S,g)}:function(x,B,m,S){void 0===S&&(S=m),x[S]=B[m]}),c=this&&this.__exportStar||function(x,B){for(var m in x)"default"!==m&&!Object.prototype.hasOwnProperty.call(B,m)&&i(B,x,m)};Object.defineProperty(F,"__esModule",{value:!0}),c(f(24418),F)},24418:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ObjectUtils=void 0;class f{static asArray(c){return Array.isArray(c)?c:[c]}static isObject(c){return"object"==typeof c||"[object Object]"===Object.prototype.toString.call(c)}static isUrlAbsolute(c){f.isString(c)&&/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/.test(c)}static isString(c){return"string"==typeof c||"[object String]"===Object.prototype.toString.call(c)}}F.ObjectUtils=f},20844:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.MissingRefError=F.ValidationError=F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;const i=f(35419),c=f(98496),x=f(86980),B=f(87577),m="https://json-schema.org/draft/2020-12/schema";class S extends i.default{constructor(j={}){super({...j,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),c.default.forEach(j=>this.addVocabulary(j)),this.opts.discriminator&&this.addKeyword(x.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:j,meta:M}=this.opts;M&&(B.default.call(this,j),this.refs["http://json-schema.org/schema"]=m)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(m)?m:void 0)}}Me.exports=F=S,Object.defineProperty(F,"__esModule",{value:!0}),F.default=S;var g=f(40339);Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:function(){return g.KeywordCxt}});var _=f(1038);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(F,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var R=f(42467);Object.defineProperty(F,"ValidationError",{enumerable:!0,get:function(){return R.default}});var T=f(26288);Object.defineProperty(F,"MissingRefError",{enumerable:!0,get:function(){return T.default}})},33337:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.regexpCode=F.getEsmExportName=F.getProperty=F.safeStringify=F.stringify=F.strConcat=F.addCodeArg=F.str=F._=F.nil=F._Code=F.Name=F.IDENTIFIER=F._CodeOrName=void 0;class f{}F._CodeOrName=f,F.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends f{constructor(V){if(super(),!F.IDENTIFIER.test(V))throw new Error("CodeGen: name must be a valid identifier");this.str=V}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}F.Name=i;class c extends f{constructor(V){super(),this._items="string"==typeof V?[V]:V}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const V=this._items[0];return""===V||'""'===V}get str(){var V;return null!==(V=this._str)&&void 0!==V?V:this._str=this._items.reduce((Z,q)=>`${Z}${q}`,"")}get names(){var V;return null!==(V=this._names)&&void 0!==V?V:this._names=this._items.reduce((Z,q)=>(q instanceof i&&(Z[q.str]=(Z[q.str]||0)+1),Z),{})}}function x(W,...V){const Z=[W[0]];let q=0;for(;q{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.or=F.and=F.not=F.CodeGen=F.operators=F.varKinds=F.ValueScopeName=F.ValueScope=F.Scope=F.Name=F.regexpCode=F.stringify=F.getProperty=F.nil=F.strConcat=F.str=F._=void 0;const i=f(33337),c=f(85934);var x=f(33337);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return x._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return x.str}}),Object.defineProperty(F,"strConcat",{enumerable:!0,get:function(){return x.strConcat}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return x.nil}}),Object.defineProperty(F,"getProperty",{enumerable:!0,get:function(){return x.getProperty}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return x.stringify}}),Object.defineProperty(F,"regexpCode",{enumerable:!0,get:function(){return x.regexpCode}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return x.Name}});var B=f(85934);Object.defineProperty(F,"Scope",{enumerable:!0,get:function(){return B.Scope}}),Object.defineProperty(F,"ValueScope",{enumerable:!0,get:function(){return B.ValueScope}}),Object.defineProperty(F,"ValueScopeName",{enumerable:!0,get:function(){return B.ValueScopeName}}),Object.defineProperty(F,"varKinds",{enumerable:!0,get:function(){return B.varKinds}}),F.operators={GT:new i._Code(">"),GTE:new i._Code(">="),LT:new i._Code("<"),LTE:new i._Code("<="),EQ:new i._Code("==="),NEQ:new i._Code("!=="),NOT:new i._Code("!"),OR:new i._Code("||"),AND:new i._Code("&&"),ADD:new i._Code("+")};class m{optimizeNodes(){return this}optimizeNames(se,de){return this}}class S extends m{constructor(se,de,Ae){super(),this.varKind=se,this.name=de,this.rhs=Ae}render({es5:se,_n:de}){return`${se?c.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+de}optimizeNames(se,de){if(se[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,se,de)),this}get names(){return this.rhs instanceof i._CodeOrName?this.rhs.names:{}}}class g extends m{constructor(se,de,Ae){super(),this.lhs=se,this.rhs=de,this.sideEffects=Ae}render({_n:se}){return`${this.lhs} = ${this.rhs};`+se}optimizeNames(se,de){if(!(this.lhs instanceof i.Name)||se[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,se,de),this}get names(){return h(this.lhs instanceof i.Name?{}:{...this.lhs.names},this.rhs)}}class _ extends g{constructor(se,de,Ae,Ie){super(se,Ae,Ie),this.op=de}render({_n:se}){return`${this.lhs} ${this.op}= ${this.rhs};`+se}}class R extends m{constructor(se){super(),this.label=se,this.names={}}render({_n:se}){return`${this.label}:`+se}}class T extends m{constructor(se){super(),this.label=se,this.names={}}render({_n:se}){return`break${this.label?` ${this.label}`:""};`+se}}class E extends m{constructor(se){super(),this.error=se}render({_n:se}){return`throw ${this.error};`+se}get names(){return this.error.names}}class j extends m{constructor(se){super(),this.code=se}render({_n:se}){return`${this.code};`+se}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(se,de){return this.code=A(this.code,se,de),this}get names(){return this.code instanceof i._CodeOrName?this.code.names:{}}}class M extends m{constructor(se=[]){super(),this.nodes=se}render(se){return this.nodes.reduce((de,Ae)=>de+Ae.render(se),"")}optimizeNodes(){const{nodes:se}=this;let de=se.length;for(;de--;){const Ae=se[de].optimizeNodes();Array.isArray(Ae)?se.splice(de,1,...Ae):Ae?se[de]=Ae:se.splice(de,1)}return se.length>0?this:void 0}optimizeNames(se,de){const{nodes:Ae}=this;let Ie=Ae.length;for(;Ie--;){const Le=Ae[Ie];Le.optimizeNames(se,de)||(C(se,Le.names),Ae.splice(Ie,1))}return Ae.length>0?this:void 0}get names(){return this.nodes.reduce((se,de)=>o(se,de.names),{})}}class k extends M{render(se){return"{"+se._n+super.render(se)+"}"+se._n}}class K extends M{}let W=(()=>{class ee extends k{}return ee.kind="else",ee})(),V=(()=>{class ee extends k{constructor(de,Ae){super(Ae),this.condition=de}render(de){let Ae=`if(${this.condition})`+super.render(de);return this.else&&(Ae+="else "+this.else.render(de)),Ae}optimizeNodes(){super.optimizeNodes();const de=this.condition;if(!0===de)return this.nodes;let Ae=this.else;if(Ae){const Ie=Ae.optimizeNodes();Ae=this.else=Array.isArray(Ie)?new W(Ie):Ie}return Ae?!1===de?Ae instanceof ee?Ae:Ae.nodes:this.nodes.length?this:new ee(O(de),Ae instanceof ee?[Ae]:Ae.nodes):!1!==de&&this.nodes.length?this:void 0}optimizeNames(de,Ae){var Ie;if(this.else=null===(Ie=this.else)||void 0===Ie?void 0:Ie.optimizeNames(de,Ae),super.optimizeNames(de,Ae)||this.else)return this.condition=A(this.condition,de,Ae),this}get names(){const de=super.names;return h(de,this.condition),this.else&&o(de,this.else.names),de}}return ee.kind="if",ee})(),Z=(()=>{class ee extends k{}return ee.kind="for",ee})();class q extends Z{constructor(se){super(),this.iteration=se}render(se){return`for(${this.iteration})`+super.render(se)}optimizeNames(se,de){if(super.optimizeNames(se,de))return this.iteration=A(this.iteration,se,de),this}get names(){return o(super.names,this.iteration.names)}}class ne extends Z{constructor(se,de,Ae,Ie){super(),this.varKind=se,this.name=de,this.from=Ae,this.to=Ie}render(se){const de=se.es5?c.varKinds.var:this.varKind,{name:Ae,from:Ie,to:Le}=this;return`for(${de} ${Ae}=${Ie}; ${Ae}<${Le}; ${Ae}++)`+super.render(se)}get names(){const se=h(super.names,this.from);return h(se,this.to)}}class te extends Z{constructor(se,de,Ae,Ie){super(),this.loop=se,this.varKind=de,this.name=Ae,this.iterable=Ie}render(se){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(se)}optimizeNames(se,de){if(super.optimizeNames(se,de))return this.iterable=A(this.iterable,se,de),this}get names(){return o(super.names,this.iterable.names)}}let ie=(()=>{class ee extends k{constructor(de,Ae,Ie){super(),this.name=de,this.args=Ae,this.async=Ie}render(de){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(de)}}return ee.kind="func",ee})(),ae=(()=>{class ee extends M{render(de){return"return "+super.render(de)}}return ee.kind="return",ee})();class me extends k{render(se){let de="try"+super.render(se);return this.catch&&(de+=this.catch.render(se)),this.finally&&(de+=this.finally.render(se)),de}optimizeNodes(){var se,de;return super.optimizeNodes(),null===(se=this.catch)||void 0===se||se.optimizeNodes(),null===(de=this.finally)||void 0===de||de.optimizeNodes(),this}optimizeNames(se,de){var Ae,Ie;return super.optimizeNames(se,de),null===(Ae=this.catch)||void 0===Ae||Ae.optimizeNames(se,de),null===(Ie=this.finally)||void 0===Ie||Ie.optimizeNames(se,de),this}get names(){const se=super.names;return this.catch&&o(se,this.catch.names),this.finally&&o(se,this.finally.names),se}}let ye=(()=>{class ee extends k{constructor(de){super(),this.error=de}render(de){return`catch(${this.error})`+super.render(de)}}return ee.kind="catch",ee})(),ue=(()=>{class ee extends k{render(de){return"finally"+super.render(de)}}return ee.kind="finally",ee})();function o(ee,se){for(const de in se)ee[de]=(ee[de]||0)+(se[de]||0);return ee}function h(ee,se){return se instanceof i._CodeOrName?o(ee,se.names):ee}function A(ee,se,de){return ee instanceof i.Name?Ae(ee):function Ie(Le){return Le instanceof i._Code&&Le._items.some(xe=>xe instanceof i.Name&&1===se[xe.str]&&void 0!==de[xe.str])}(ee)?new i._Code(ee._items.reduce((Le,xe)=>(xe instanceof i.Name&&(xe=Ae(xe)),xe instanceof i._Code?Le.push(...xe._items):Le.push(xe),Le),[])):ee;function Ae(Le){const xe=de[Le.str];return void 0===xe||1!==se[Le.str]?Le:(delete se[Le.str],xe)}}function C(ee,se){for(const de in se)ee[de]=(ee[de]||0)-(se[de]||0)}function O(ee){return"boolean"==typeof ee||"number"==typeof ee||null===ee?!ee:i._`!${J(ee)}`}F.CodeGen=class ${constructor(se,de={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...de,_n:de.lines?"\n":""},this._extScope=se,this._scope=new c.Scope({parent:se}),this._nodes=[new K]}toString(){return this._root.render(this.opts)}name(se){return this._scope.name(se)}scopeName(se){return this._extScope.name(se)}scopeValue(se,de){const Ae=this._extScope.value(se,de);return(this._values[Ae.prefix]||(this._values[Ae.prefix]=new Set)).add(Ae),Ae}getScopeValue(se,de){return this._extScope.getValue(se,de)}scopeRefs(se){return this._extScope.scopeRefs(se,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(se,de,Ae,Ie){const Le=this._scope.toName(de);return void 0!==Ae&&Ie&&(this._constants[Le.str]=Ae),this._leafNode(new S(se,Le,Ae)),Le}const(se,de,Ae){return this._def(c.varKinds.const,se,de,Ae)}let(se,de,Ae){return this._def(c.varKinds.let,se,de,Ae)}var(se,de,Ae){return this._def(c.varKinds.var,se,de,Ae)}assign(se,de,Ae){return this._leafNode(new g(se,de,Ae))}add(se,de){return this._leafNode(new _(se,F.operators.ADD,de))}code(se){return"function"==typeof se?se():se!==i.nil&&this._leafNode(new j(se)),this}object(...se){const de=["{"];for(const[Ae,Ie]of se)de.length>1&&de.push(","),de.push(Ae),(Ae!==Ie||this.opts.es5)&&(de.push(":"),(0,i.addCodeArg)(de,Ie));return de.push("}"),new i._Code(de)}if(se,de,Ae){if(this._blockNode(new V(se)),de&&Ae)this.code(de).else().code(Ae).endIf();else if(de)this.code(de).endIf();else if(Ae)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(se){return this._elseNode(new V(se))}else(){return this._elseNode(new W)}endIf(){return this._endBlockNode(V,W)}_for(se,de){return this._blockNode(se),de&&this.code(de).endFor(),this}for(se,de){return this._for(new q(se),de)}forRange(se,de,Ae,Ie,Le=(this.opts.es5?c.varKinds.var:c.varKinds.let)){const xe=this._scope.toName(se);return this._for(new ne(Le,xe,de,Ae),()=>Ie(xe))}forOf(se,de,Ae,Ie=c.varKinds.const){const Le=this._scope.toName(se);if(this.opts.es5){const xe=de instanceof i.Name?de:this.var("_arr",de);return this.forRange("_i",0,i._`${xe}.length`,Ce=>{this.var(Le,i._`${xe}[${Ce}]`),Ae(Le)})}return this._for(new te("of",Ie,Le,de),()=>Ae(Le))}forIn(se,de,Ae,Ie=(this.opts.es5?c.varKinds.var:c.varKinds.const)){if(this.opts.ownProperties)return this.forOf(se,i._`Object.keys(${de})`,Ae);const Le=this._scope.toName(se);return this._for(new te("in",Ie,Le,de),()=>Ae(Le))}endFor(){return this._endBlockNode(Z)}label(se){return this._leafNode(new R(se))}break(se){return this._leafNode(new T(se))}return(se){const de=new ae;if(this._blockNode(de),this.code(se),1!==de.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ae)}try(se,de,Ae){if(!de&&!Ae)throw new Error('CodeGen: "try" without "catch" and "finally"');const Ie=new me;if(this._blockNode(Ie),this.code(se),de){const Le=this.name("e");this._currNode=Ie.catch=new ye(Le),de(Le)}return Ae&&(this._currNode=Ie.finally=new ue,this.code(Ae)),this._endBlockNode(ye,ue)}throw(se){return this._leafNode(new E(se))}block(se,de){return this._blockStarts.push(this._nodes.length),se&&this.code(se).endBlock(de),this}endBlock(se){const de=this._blockStarts.pop();if(void 0===de)throw new Error("CodeGen: not in self-balancing block");const Ae=this._nodes.length-de;if(Ae<0||void 0!==se&&Ae!==se)throw new Error(`CodeGen: wrong number of nodes: ${Ae} vs ${se} expected`);return this._nodes.length=de,this}func(se,de=i.nil,Ae,Ie){return this._blockNode(new ie(se,de,Ae)),Ie&&this.code(Ie).endFunc(),this}endFunc(){return this._endBlockNode(ie)}optimize(se=1){for(;se-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(se){return this._currNode.nodes.push(se),this}_blockNode(se){this._currNode.nodes.push(se),this._nodes.push(se)}_endBlockNode(se,de){const Ae=this._currNode;if(Ae instanceof se||de&&Ae instanceof de)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${de?`${se.kind}/${de.kind}`:se.kind}"`)}_elseNode(se){const de=this._currNode;if(!(de instanceof V))throw new Error('CodeGen: "else" without "if"');return this._currNode=de.else=se,this}get _root(){return this._nodes[0]}get _currNode(){const se=this._nodes;return se[se.length-1]}set _currNode(se){const de=this._nodes;de[de.length-1]=se}},F.not=O;const z=p(F.operators.AND);F.and=function H(...ee){return ee.reduce(z)};const I=p(F.operators.OR);function p(ee){return(se,de)=>se===i.nil?de:de===i.nil?se:i._`${J(se)} ${ee} ${J(de)}`}function J(ee){return ee instanceof i.Name?ee:i._`(${ee})`}F.or=function s(...ee){return ee.reduce(I)}},85934:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.ValueScope=F.ValueScopeName=F.Scope=F.varKinds=F.UsedValueState=void 0;const i=f(33337);class c extends Error{constructor(R){super(`CodeGen: "code" for ${R} not defined`),this.value=R.value}}var x,_;(_=x=F.UsedValueState||(F.UsedValueState={}))[_.Started=0]="Started",_[_.Completed=1]="Completed",F.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class B{constructor({prefixes:R,parent:T}={}){this._names={},this._prefixes=R,this._parent=T}toName(R){return R instanceof i.Name?R:this.name(R)}name(R){return new i.Name(this._newName(R))}_newName(R){return`${R}${(this._names[R]||this._nameGroup(R)).index++}`}_nameGroup(R){var T,E;if(null!==(E=null===(T=this._parent)||void 0===T?void 0:T._prefixes)&&void 0!==E&&E.has(R)||this._prefixes&&!this._prefixes.has(R))throw new Error(`CodeGen: prefix "${R}" is not allowed in this scope`);return this._names[R]={prefix:R,index:0}}}F.Scope=B;class m extends i.Name{constructor(R,T){super(T),this.prefix=R}setValue(R,{property:T,itemIndex:E}){this.value=R,this.scopePath=i._`.${new i.Name(T)}[${E}]`}}F.ValueScopeName=m;const S=i._`\n`;F.ValueScope=class g extends B{constructor(R){super(R),this._values={},this._scope=R.scope,this.opts={...R,_n:R.lines?S:i.nil}}get(){return this._scope}name(R){return new m(R,this._newName(R))}value(R,T){var E;if(void 0===T.ref)throw new Error("CodeGen: ref must be passed in value");const j=this.toName(R),{prefix:M}=j,k=null!==(E=T.key)&&void 0!==E?E:T.ref;let K=this._values[M];if(K){const Z=K.get(k);if(Z)return Z}else K=this._values[M]=new Map;K.set(k,j);const W=this._scope[M]||(this._scope[M]=[]),V=W.length;return W[V]=T.ref,j.setValue(T,{property:M,itemIndex:V}),j}getValue(R,T){const E=this._values[R];if(E)return E.get(T)}scopeRefs(R,T=this._values){return this._reduceValues(T,E=>{if(void 0===E.scopePath)throw new Error(`CodeGen: name "${E}" has no value`);return i._`${R}${E.scopePath}`})}scopeCode(R=this._values,T,E){return this._reduceValues(R,j=>{if(void 0===j.value)throw new Error(`CodeGen: name "${j}" has no value`);return j.value.code},T,E)}_reduceValues(R,T,E={},j){let M=i.nil;for(const k in R){const K=R[k];if(!K)continue;const W=E[k]=E[k]||new Map;K.forEach(V=>{if(W.has(V))return;W.set(V,x.Started);let Z=T(V);if(Z)M=i._`${M}${this.opts.es5?F.varKinds.var:F.varKinds.const} ${V} = ${Z};${this.opts._n}`;else{if(!(Z=j?.(V)))throw new c(V);M=i._`${M}${Z}${this.opts._n}`}W.set(V,x.Completed)})}return M}}},53421:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.extendErrors=F.resetErrorsCount=F.reportExtraError=F.reportError=F.keyword$DataError=F.keywordError=void 0;const i=f(1038),c=f(27006),x=f(23432);function _(W,V){const Z=W.const("err",V);W.if(i._`${x.default.vErrors} === null`,()=>W.assign(x.default.vErrors,i._`[${Z}]`),i._`${x.default.vErrors}.push(${Z})`),W.code(i._`${x.default.errors}++`)}function R(W,V){const{gen:Z,validateName:q,schemaEnv:ne}=W;ne.$async?Z.throw(i._`new ${W.ValidationError}(${V})`):(Z.assign(i._`${q}.errors`,V),Z.return(!1))}F.keywordError={message:({keyword:W})=>i.str`must pass "${W}" keyword validation`},F.keyword$DataError={message:({keyword:W,schemaType:V})=>V?i.str`"${W}" keyword must be ${V} ($data)`:i.str`"${W}" keyword is invalid ($data)`},F.reportError=function B(W,V=F.keywordError,Z,q){const{it:ne}=W,{gen:te,compositeRule:ie,allErrors:ae}=ne,me=E(W,V,Z);q??(ie||ae)?_(te,me):R(ne,i._`[${me}]`)},F.reportExtraError=function m(W,V=F.keywordError,Z){const{it:q}=W,{gen:ne,compositeRule:te,allErrors:ie}=q;_(ne,E(W,V,Z)),te||ie||R(q,x.default.vErrors)},F.resetErrorsCount=function S(W,V){W.assign(x.default.errors,V),W.if(i._`${x.default.vErrors} !== null`,()=>W.if(V,()=>W.assign(i._`${x.default.vErrors}.length`,V),()=>W.assign(x.default.vErrors,null)))},F.extendErrors=function g({gen:W,keyword:V,schemaValue:Z,data:q,errsCount:ne,it:te}){if(void 0===ne)throw new Error("ajv implementation error");const ie=W.name("err");W.forRange("i",ne,x.default.errors,ae=>{W.const(ie,i._`${x.default.vErrors}[${ae}]`),W.if(i._`${ie}.instancePath === undefined`,()=>W.assign(i._`${ie}.instancePath`,(0,i.strConcat)(x.default.instancePath,te.errorPath))),W.assign(i._`${ie}.schemaPath`,i.str`${te.errSchemaPath}/${V}`),te.opts.verbose&&(W.assign(i._`${ie}.schema`,Z),W.assign(i._`${ie}.data`,q))})};const T={keyword:new i.Name("keyword"),schemaPath:new i.Name("schemaPath"),params:new i.Name("params"),propertyName:new i.Name("propertyName"),message:new i.Name("message"),schema:new i.Name("schema"),parentSchema:new i.Name("parentSchema")};function E(W,V,Z){const{createErrors:q}=W.it;return!1===q?i._`{}`:function j(W,V,Z={}){const{gen:q,it:ne}=W,te=[M(ne,Z),k(W,Z)];return function K(W,{params:V,message:Z},q){const{keyword:ne,data:te,schemaValue:ie,it:ae}=W,{opts:me,propertyName:ye,topSchemaRef:ue,schemaPath:$}=ae;q.push([T.keyword,ne],[T.params,"function"==typeof V?V(W):V||i._`{}`]),me.messages&&q.push([T.message,"function"==typeof Z?Z(W):Z]),me.verbose&&q.push([T.schema,ie],[T.parentSchema,i._`${ue}${$}`],[x.default.data,te]),ye&&q.push([T.propertyName,ye])}(W,V,te),q.object(...te)}(W,V,Z)}function M({errorPath:W},{instancePath:V}){const Z=V?i.str`${W}${(0,c.getErrorPath)(V,c.Type.Str)}`:W;return[x.default.instancePath,(0,i.strConcat)(x.default.instancePath,Z)]}function k({keyword:W,it:{errSchemaPath:V}},{schemaPath:Z,parentSchema:q}){let ne=q?V:i.str`${V}/${W}`;return Z&&(ne=i.str`${ne}${(0,c.getErrorPath)(Z,c.Type.Str)}`),[T.schemaPath,ne]}},97692:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.resolveSchema=F.getCompilingSchema=F.resolveRef=F.compileSchema=F.SchemaEnv=void 0;const i=f(1038),c=f(42467),x=f(23432),B=f(77172),m=f(27006),S=f(40339);class g{constructor(Z){var q;let ne;this.refs={},this.dynamicAnchors={},"object"==typeof Z.schema&&(ne=Z.schema),this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=null!==(q=Z.baseId)&&void 0!==q?q:(0,B.normalizeId)(ne?.[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=ne?.$async,this.refs={}}}function _(V){const Z=E.call(this,V);if(Z)return Z;const q=(0,B.getFullPath)(this.opts.uriResolver,V.root.baseId),{es5:ne,lines:te}=this.opts.code,{ownProperties:ie}=this.opts,ae=new i.CodeGen(this.scope,{es5:ne,lines:te,ownProperties:ie});let me;V.$async&&(me=ae.scopeValue("Error",{ref:c.default,code:i._`require("ajv/dist/runtime/validation_error").default`}));const ye=ae.scopeName("validate");V.validateName=ye;const ue={gen:ae,allErrors:this.opts.allErrors,data:x.default.data,parentData:x.default.parentData,parentDataProperty:x.default.parentDataProperty,dataNames:[x.default.data],dataPathArr:[i.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:ae.scopeValue("schema",!0===this.opts.code.source?{ref:V.schema,code:(0,i.stringify)(V.schema)}:{ref:V.schema}),validateName:ye,ValidationError:me,schema:V.schema,schemaEnv:V,rootId:q,baseId:V.baseId||q,schemaPath:i.nil,errSchemaPath:V.schemaPath||(this.opts.jtd?"":"#"),errorPath:i._`""`,opts:this.opts,self:this};let $;try{this._compilations.add(V),(0,S.validateFunctionCode)(ue),ae.optimize(this.opts.code.optimize);const o=ae.toString();$=`${ae.scopeRefs(x.default.scope)}return ${o}`,this.opts.code.process&&($=this.opts.code.process($,V));const A=new Function(`${x.default.self}`,`${x.default.scope}`,$)(this,this.scope.get());if(this.scope.value(ye,{ref:A}),A.errors=null,A.schema=V.schema,A.schemaEnv=V,V.$async&&(A.$async=!0),!0===this.opts.code.source&&(A.source={validateName:ye,validateCode:o,scopeValues:ae._values}),this.opts.unevaluated){const{props:C,items:O}=ue;A.evaluated={props:C instanceof i.Name?void 0:C,items:O instanceof i.Name?void 0:O,dynamicProps:C instanceof i.Name,dynamicItems:O instanceof i.Name},A.source&&(A.source.evaluated=(0,i.stringify)(A.evaluated))}return V.validate=A,V}catch(o){throw delete V.validate,delete V.validateName,$&&this.logger.error("Error compiling schema, function code:",$),o}finally{this._compilations.delete(V)}}function T(V){return(0,B.inlineRef)(V.schema,this.opts.inlineRefs)?V.schema:V.validate?V:_.call(this,V)}function E(V){for(const Z of this._compilations)if(j(Z,V))return Z}function j(V,Z){return V.schema===Z.schema&&V.root===Z.root&&V.baseId===Z.baseId}function M(V,Z){let q;for(;"string"==typeof(q=this.refs[Z]);)Z=q;return q||this.schemas[Z]||k.call(this,V,Z)}function k(V,Z){const q=this.opts.uriResolver.parse(Z),ne=(0,B._getFullPath)(this.opts.uriResolver,q);let te=(0,B.getFullPath)(this.opts.uriResolver,V.baseId,void 0);if(Object.keys(V.schema).length>0&&ne===te)return W.call(this,q,V);const ie=(0,B.normalizeId)(ne),ae=this.refs[ie]||this.schemas[ie];if("string"==typeof ae){const me=k.call(this,V,ae);return"object"!=typeof me?.schema?void 0:W.call(this,q,me)}if("object"==typeof ae?.schema){if(ae.validate||_.call(this,ae),ie===(0,B.normalizeId)(Z)){const{schema:me}=ae,{schemaId:ye}=this.opts,ue=me[ye];return ue&&(te=(0,B.resolveUrl)(this.opts.uriResolver,te,ue)),new g({schema:me,schemaId:ye,root:V,baseId:te})}return W.call(this,q,ae)}}F.SchemaEnv=g,F.compileSchema=_,F.resolveRef=function R(V,Z,q){var ne;q=(0,B.resolveUrl)(this.opts.uriResolver,Z,q);const te=V.refs[q];if(te)return te;let ie=M.call(this,V,q);if(void 0===ie){const ae=null===(ne=V.localRefs)||void 0===ne?void 0:ne[q],{schemaId:me}=this.opts;ae&&(ie=new g({schema:ae,schemaId:me,root:V,baseId:Z}))}return void 0!==ie?V.refs[q]=T.call(this,ie):void 0},F.getCompilingSchema=E,F.resolveSchema=k;const K=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function W(V,{baseId:Z,schema:q,root:ne}){var te;if("/"!==(null===(te=V.fragment)||void 0===te?void 0:te[0]))return;for(const me of V.fragment.slice(1).split("/")){if("boolean"==typeof q)return;const ye=q[(0,m.unescapeFragment)(me)];if(void 0===ye)return;const ue="object"==typeof(q=ye)&&q[this.opts.schemaId];!K.has(me)&&ue&&(Z=(0,B.resolveUrl)(this.opts.uriResolver,Z,ue))}let ie;if("boolean"!=typeof q&&q.$ref&&!(0,m.schemaHasRulesButRef)(q,this.RULES)){const me=(0,B.resolveUrl)(this.opts.uriResolver,Z,q.$ref);ie=k.call(this,ne,me)}const{schemaId:ae}=this.opts;return ie=ie||new g({schema:q,schemaId:ae,root:ne,baseId:Z}),ie.schema!==ie.root.schema?ie:void 0}},23432:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(1038),c={data:new i.Name("data"),valCxt:new i.Name("valCxt"),instancePath:new i.Name("instancePath"),parentData:new i.Name("parentData"),parentDataProperty:new i.Name("parentDataProperty"),rootData:new i.Name("rootData"),dynamicAnchors:new i.Name("dynamicAnchors"),vErrors:new i.Name("vErrors"),errors:new i.Name("errors"),this:new i.Name("this"),self:new i.Name("self"),scope:new i.Name("scope"),json:new i.Name("json"),jsonPos:new i.Name("jsonPos"),jsonLen:new i.Name("jsonLen"),jsonPart:new i.Name("jsonPart")};F.default=c},26288:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(77172);class c extends Error{constructor(B,m,S,g){super(g||`can't resolve reference ${S} from id ${m}`),this.missingRef=(0,i.resolveUrl)(B,m,S),this.missingSchema=(0,i.normalizeId)((0,i.getFullPath)(B,this.missingRef))}}F.default=c},77172:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getSchemaRefs=F.resolveUrl=F.normalizeId=F._getFullPath=F.getFullPath=F.inlineRef=void 0;const i=f(27006),c=f(40362),x=f(44331),B=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);F.inlineRef=function m(W,V=!0){return"boolean"==typeof W||(!0===V?!g(W):!!V&&_(W)<=V)};const S=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function g(W){for(const V in W){if(S.has(V))return!0;const Z=W[V];if(Array.isArray(Z)&&Z.some(g)||"object"==typeof Z&&g(Z))return!0}return!1}function _(W){let V=0;for(const Z in W){if("$ref"===Z)return 1/0;if(V++,!B.has(Z)&&("object"==typeof W[Z]&&(0,i.eachItem)(W[Z],q=>V+=_(q)),V===1/0))return 1/0}return V}function R(W,V="",Z){!1!==Z&&(V=j(V));const q=W.parse(V);return T(W,q)}function T(W,V){return W.serialize(V).split("#")[0]+"#"}F.getFullPath=R,F._getFullPath=T;const E=/#\/?$/;function j(W){return W?W.replace(E,""):""}F.normalizeId=j,F.resolveUrl=function M(W,V,Z){return Z=j(Z),W.resolve(V,Z)};const k=/^[a-z_][-a-z0-9._]*$/i;F.getSchemaRefs=function K(W,V){if("boolean"==typeof W)return{};const{schemaId:Z,uriResolver:q}=this.opts,ne=j(W[Z]||V),te={"":ne},ie=R(q,ne,!1),ae={},me=new Set;return x(W,{allKeys:!0},($,o,h,A)=>{if(void 0===A)return;const C=ie+o;let O=te[A];function z(I){if(I=j(O?(0,this.opts.uriResolver.resolve)(O,I):I),me.has(I))throw ue(I);me.add(I);let p=this.refs[I];return"string"==typeof p&&(p=this.refs[p]),"object"==typeof p?ye($,p.schema,I):I!==j(C)&&("#"===I[0]?(ye($,ae[I],I),ae[I]=$):this.refs[I]=C),I}function H(I){if("string"==typeof I){if(!k.test(I))throw new Error(`invalid anchor "${I}"`);z.call(this,`#${I}`)}}"string"==typeof $[Z]&&(O=z.call(this,$[Z])),H.call(this,$.$anchor),H.call(this,$.$dynamicAnchor),te[o]=O}),ae;function ye($,o,h){if(void 0!==o&&!c($,o))throw ue(h)}function ue($){return new Error(`reference "${$}" resolves to more than one schema`)}}},32203:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getRules=F.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);F.isJSONType=function c(B){return"string"==typeof B&&i.has(B)},F.getRules=function x(){const B={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...B,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},B.number,B.string,B.array,B.object],post:{rules:[]},all:{},keywords:{}}}},27006:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;const i=f(1038),c=f(33337);function m(ie,ae=ie.schema){const{opts:me,self:ye}=ie;if(!me.strictSchema||"boolean"==typeof ae)return;const ue=ye.RULES.keywords;for(const $ in ae)ue[$]||te(ie,`unknown keyword: "${$}"`)}function S(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if(ae[me])return!0;return!1}function E(ie){return"number"==typeof ie?`${ie}`:ie.replace(/~/g,"~0").replace(/\//g,"~1")}function j(ie){return ie.replace(/~1/g,"/").replace(/~0/g,"~")}function k({mergeNames:ie,mergeToName:ae,mergeValues:me,resultToName:ye}){return(ue,$,o,h)=>{const A=void 0===o?$:o instanceof i.Name?($ instanceof i.Name?ie(ue,$,o):ae(ue,$,o),o):$ instanceof i.Name?(ae(ue,o,$),$):me($,o);return h!==i.Name||A instanceof i.Name?A:ye(ue,A)}}function K(ie,ae){if(!0===ae)return ie.var("props",!0);const me=ie.var("props",i._`{}`);return void 0!==ae&&W(ie,me,ae),me}function W(ie,ae,me){Object.keys(me).forEach(ye=>ie.assign(i._`${ae}${(0,i.getProperty)(ye)}`,!0))}F.toHash=function x(ie){const ae={};for(const me of ie)ae[me]=!0;return ae},F.alwaysValidSchema=function B(ie,ae){return"boolean"==typeof ae?ae:0===Object.keys(ae).length||(m(ie,ae),!S(ae,ie.self.RULES.all))},F.checkUnknownRules=m,F.schemaHasRules=S,F.schemaHasRulesButRef=function g(ie,ae){if("boolean"==typeof ie)return!ie;for(const me in ie)if("$ref"!==me&&ae.all[me])return!0;return!1},F.schemaRefOrVal=function _({topSchemaRef:ie,schemaPath:ae},me,ye,ue){if(!ue){if("number"==typeof me||"boolean"==typeof me)return me;if("string"==typeof me)return i._`${me}`}return i._`${ie}${ae}${(0,i.getProperty)(ye)}`},F.unescapeFragment=function R(ie){return j(decodeURIComponent(ie))},F.escapeFragment=function T(ie){return encodeURIComponent(E(ie))},F.escapeJsonPointer=E,F.unescapeJsonPointer=j,F.eachItem=function M(ie,ae){if(Array.isArray(ie))for(const me of ie)ae(me);else ae(ie)},F.mergeEvaluated={props:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>{ie.if(i._`${ae} === true`,()=>ie.assign(me,!0),()=>ie.assign(me,i._`${me} || {}`).code(i._`Object.assign(${me}, ${ae})`))}),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>{!0===ae?ie.assign(me,!0):(ie.assign(me,i._`${me} || {}`),W(ie,me,ae))}),mergeValues:(ie,ae)=>!0===ie||{...ie,...ae},resultToName:K}),items:k({mergeNames:(ie,ae,me)=>ie.if(i._`${me} !== true && ${ae} !== undefined`,()=>ie.assign(me,i._`${ae} === true ? true : ${me} > ${ae} ? ${me} : ${ae}`)),mergeToName:(ie,ae,me)=>ie.if(i._`${me} !== true`,()=>ie.assign(me,!0===ae||i._`${me} > ${ae} ? ${me} : ${ae}`)),mergeValues:(ie,ae)=>!0===ie||Math.max(ie,ae),resultToName:(ie,ae)=>ie.var("items",ae)})},F.evaluatedPropsToName=K,F.setEvaluated=W;const V={};var q,ie;function te(ie,ae,me=ie.opts.strictSchema){if(me){if(ae=`strict mode: ${ae}`,!0===me)throw new Error(ae);ie.self.logger.warn(ae)}}F.useFunc=function Z(ie,ae){return ie.scopeValue("func",{ref:ae,code:V[ae.code]||(V[ae.code]=new c._Code(ae.code))})},(ie=q=F.Type||(F.Type={}))[ie.Num=0]="Num",ie[ie.Str=1]="Str",F.getErrorPath=function ne(ie,ae,me){if(ie instanceof i.Name){const ye=ae===q.Num;return me?ye?i._`"[" + ${ie} + "]"`:i._`"['" + ${ie} + "']"`:ye?i._`"/" + ${ie}`:i._`"/" + ${ie}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return me?(0,i.getProperty)(ie).toString():"/"+E(ie)},F.checkStrictMode=te},22650:(Me,F)=>{"use strict";function i(x,B){return B.rules.some(m=>c(x,m))}function c(x,B){var m;return void 0!==x[B.keyword]||(null===(m=B.definition.implements)||void 0===m?void 0:m.some(S=>void 0!==x[S]))}Object.defineProperty(F,"__esModule",{value:!0}),F.shouldUseRule=F.shouldUseGroup=F.schemaHasRulesForType=void 0,F.schemaHasRulesForType=function f({schema:x,self:B},m){const S=B.RULES.types[m];return S&&!0!==S&&i(x,S)},F.shouldUseGroup=i,F.shouldUseRule=c},37864:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.boolOrEmptySchema=F.topBoolOrEmptySchema=void 0;const i=f(53421),c=f(1038),x=f(23432),B={message:"boolean schema is false"};function g(_,R){const{gen:T,data:E}=_;(0,i.reportError)({gen:T,keyword:"false schema",data:E,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:_},B,void 0,R)}F.topBoolOrEmptySchema=function m(_){const{gen:R,schema:T,validateName:E}=_;!1===T?g(_,!1):"object"==typeof T&&!0===T.$async?R.return(x.default.data):(R.assign(c._`${E}.errors`,null),R.return(!0))},F.boolOrEmptySchema=function S(_,R){const{gen:T,schema:E}=_;!1===E?(T.var(R,!1),g(_)):T.var(R,!0)}},55999:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.reportTypeError=F.checkDataTypes=F.checkDataType=F.coerceAndCheckDataType=F.getJSONTypes=F.getSchemaTypes=F.DataType=void 0;const i=f(32203),c=f(22650),x=f(53421),B=f(1038),m=f(27006);var S,q;function _(q){const ne=Array.isArray(q)?q:q?[q]:[];if(ne.every(i.isJSONType))return ne;throw new Error("type must be JSONType or JSONType[]: "+ne.join(","))}(q=S=F.DataType||(F.DataType={}))[q.Correct=0]="Correct",q[q.Wrong=1]="Wrong",F.getSchemaTypes=function g(q){const ne=_(q.type);if(ne.includes("null")){if(!1===q.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!ne.length&&void 0!==q.nullable)throw new Error('"nullable" cannot be used without "type"');!0===q.nullable&&ne.push("null")}return ne},F.getJSONTypes=_,F.coerceAndCheckDataType=function R(q,ne){const{gen:te,data:ie,opts:ae}=q,me=function E(q,ne){return ne?q.filter(te=>T.has(te)||"array"===ne&&"array"===te):[]}(ne,ae.coerceTypes),ye=ne.length>0&&!(0===me.length&&1===ne.length&&(0,c.schemaHasRulesForType)(q,ne[0]));if(ye){const ue=K(ne,ie,ae.strictNumbers,S.Wrong);te.if(ue,()=>{me.length?function j(q,ne,te){const{gen:ie,data:ae,opts:me}=q,ye=ie.let("dataType",B._`typeof ${ae}`),ue=ie.let("coerced",B._`undefined`);"array"===me.coerceTypes&&ie.if(B._`${ye} == 'object' && Array.isArray(${ae}) && ${ae}.length == 1`,()=>ie.assign(ae,B._`${ae}[0]`).assign(ye,B._`typeof ${ae}`).if(K(ne,ae,me.strictNumbers),()=>ie.assign(ue,ae))),ie.if(B._`${ue} !== undefined`);for(const o of te)(T.has(o)||"array"===o&&"array"===me.coerceTypes)&&$(o);function $(o){switch(o){case"string":return void ie.elseIf(B._`${ye} == "number" || ${ye} == "boolean"`).assign(ue,B._`"" + ${ae}`).elseIf(B._`${ae} === null`).assign(ue,B._`""`);case"number":return void ie.elseIf(B._`${ye} == "boolean" || ${ae} === null || (${ye} == "string" && ${ae} && ${ae} == +${ae})`).assign(ue,B._`+${ae}`);case"integer":return void ie.elseIf(B._`${ye} === "boolean" || ${ae} === null || (${ye} === "string" && ${ae} && ${ae} == +${ae} && !(${ae} % 1))`).assign(ue,B._`+${ae}`);case"boolean":return void ie.elseIf(B._`${ae} === "false" || ${ae} === 0 || ${ae} === null`).assign(ue,!1).elseIf(B._`${ae} === "true" || ${ae} === 1`).assign(ue,!0);case"null":return ie.elseIf(B._`${ae} === "" || ${ae} === 0 || ${ae} === false`),void ie.assign(ue,null);case"array":ie.elseIf(B._`${ye} === "string" || ${ye} === "number" || ${ye} === "boolean" || ${ae} === null`).assign(ue,B._`[${ae}]`)}}ie.else(),V(q),ie.endIf(),ie.if(B._`${ue} !== undefined`,()=>{ie.assign(ae,ue),function M({gen:q,parentData:ne,parentDataProperty:te},ie){q.if(B._`${ne} !== undefined`,()=>q.assign(B._`${ne}[${te}]`,ie))}(q,ue)})}(q,ne,me):V(q)})}return ye};const T=new Set(["string","number","integer","boolean","null"]);function k(q,ne,te,ie=S.Correct){const ae=ie===S.Correct?B.operators.EQ:B.operators.NEQ;let me;switch(q){case"null":return B._`${ne} ${ae} null`;case"array":me=B._`Array.isArray(${ne})`;break;case"object":me=B._`${ne} && typeof ${ne} == "object" && !Array.isArray(${ne})`;break;case"integer":me=ye(B._`!(${ne} % 1) && !isNaN(${ne})`);break;case"number":me=ye();break;default:return B._`typeof ${ne} ${ae} ${q}`}return ie===S.Correct?me:(0,B.not)(me);function ye(ue=B.nil){return(0,B.and)(B._`typeof ${ne} == "number"`,ue,te?B._`isFinite(${ne})`:B.nil)}}function K(q,ne,te,ie){if(1===q.length)return k(q[0],ne,te,ie);let ae;const me=(0,m.toHash)(q);if(me.array&&me.object){const ye=B._`typeof ${ne} != "object"`;ae=me.null?ye:B._`!${ne} || ${ye}`,delete me.null,delete me.array,delete me.object}else ae=B.nil;me.number&&delete me.integer;for(const ye in me)ae=(0,B.and)(ae,k(ye,ne,te,ie));return ae}F.checkDataType=k,F.checkDataTypes=K;const W={message:({schema:q})=>`must be ${q}`,params:({schema:q,schemaValue:ne})=>"string"==typeof q?B._`{type: ${q}}`:B._`{type: ${ne}}`};function V(q){const ne=function Z(q){const{gen:ne,data:te,schema:ie}=q,ae=(0,m.schemaRefOrVal)(q,ie,"type");return{gen:ne,keyword:"type",data:te,schema:ie.type,schemaCode:ae,schemaValue:ae,parentSchema:ie,params:{},it:q}}(q);(0,x.reportError)(ne,W)}F.reportTypeError=V},48733:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.assignDefaults=void 0;const i=f(1038),c=f(27006);function B(m,S,g){const{gen:_,compositeRule:R,data:T,opts:E}=m;if(void 0===g)return;const j=i._`${T}${(0,i.getProperty)(S)}`;if(R)return void(0,c.checkStrictMode)(m,`default is ignored for: ${j}`);let M=i._`${j} === undefined`;"empty"===E.useDefaults&&(M=i._`${M} || ${j} === null || ${j} === ""`),_.if(M,i._`${j} = ${(0,i.stringify)(g)}`)}F.assignDefaults=function x(m,S){const{properties:g,items:_}=m.schema;if("object"===S&&g)for(const R in g)B(m,R,g[R].default);else"array"===S&&Array.isArray(_)&&_.forEach((R,T)=>B(m,T,R.default))}},40339:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.getData=F.KeywordCxt=F.validateFunctionCode=void 0;const i=f(37864),c=f(55999),x=f(22650),B=f(55999),m=f(48733),S=f(76800),g=f(16334),_=f(1038),R=f(23432),T=f(77172),E=f(27006),j=f(53421);function k({gen:Te,validateName:ke,schema:Se,schemaEnv:Ee,opts:ve},De){ve.code.es5?Te.func(ke,_._`${R.default.data}, ${R.default.valCxt}`,Ee.$async,()=>{Te.code(_._`"use strict"; ${q(Se,ve)}`),function W(Te,ke){Te.if(R.default.valCxt,()=>{Te.var(R.default.instancePath,_._`${R.default.valCxt}.${R.default.instancePath}`),Te.var(R.default.parentData,_._`${R.default.valCxt}.${R.default.parentData}`),Te.var(R.default.parentDataProperty,_._`${R.default.valCxt}.${R.default.parentDataProperty}`),Te.var(R.default.rootData,_._`${R.default.valCxt}.${R.default.rootData}`),ke.dynamicRef&&Te.var(R.default.dynamicAnchors,_._`${R.default.valCxt}.${R.default.dynamicAnchors}`)},()=>{Te.var(R.default.instancePath,_._`""`),Te.var(R.default.parentData,_._`undefined`),Te.var(R.default.parentDataProperty,_._`undefined`),Te.var(R.default.rootData,R.default.data),ke.dynamicRef&&Te.var(R.default.dynamicAnchors,_._`{}`)})}(Te,ve),Te.code(De)}):Te.func(ke,_._`${R.default.data}, ${function K(Te){return _._`{${R.default.instancePath}="", ${R.default.parentData}, ${R.default.parentDataProperty}, ${R.default.rootData}=${R.default.data}${Te.dynamicRef?_._`, ${R.default.dynamicAnchors}={}`:_.nil}}={}`}(ve)}`,Ee.$async,()=>Te.code(q(Se,ve)).code(De))}function q(Te,ke){const Se="object"==typeof Te&&Te[ke.schemaId];return Se&&(ke.code.source||ke.code.process)?_._`/*# sourceURL=${Se} */`:_.nil}function te({schema:Te,self:ke}){if("boolean"==typeof Te)return!Te;for(const Se in Te)if(ke.RULES.all[Se])return!0;return!1}function ie(Te){return"boolean"!=typeof Te.schema}function me(Te){(0,E.checkUnknownRules)(Te),function ue(Te){const{schema:ke,errSchemaPath:Se,opts:Ee,self:ve}=Te;ke.$ref&&Ee.ignoreKeywordsWithRef&&(0,E.schemaHasRulesButRef)(ke,ve.RULES)&&ve.logger.warn(`$ref: keywords ignored in schema at path "${Se}"`)}(Te)}function ye(Te,ke){if(Te.opts.jtd)return z(Te,[],!1,ke);const Se=(0,c.getSchemaTypes)(Te.schema);z(Te,Se,!(0,c.coerceAndCheckDataType)(Te,Se),ke)}function A({gen:Te,schemaEnv:ke,schema:Se,errSchemaPath:Ee,opts:ve}){const De=Se.$comment;if(!0===ve.$comment)Te.code(_._`${R.default.self}.logger.log(${De})`);else if("function"==typeof ve.$comment){const Re=_.str`${Ee}/$comment`,Je=Te.scopeValue("root",{ref:ke.root});Te.code(_._`${R.default.self}.opts.$comment(${De}, ${Re}, ${Je}.schema)`)}}function z(Te,ke,Se,Ee){const{gen:ve,schema:De,data:Re,allErrors:Je,opts:$e,self:nt}=Te,{RULES:Qe}=nt;function Tt(ct){(0,x.shouldUseGroup)(De,ct)&&(ct.type?(ve.if((0,B.checkDataType)(ct.type,Re,$e.strictNumbers)),H(Te,ct),1===ke.length&&ke[0]===ct.type&&Se&&(ve.else(),(0,B.reportTypeError)(Te)),ve.endIf()):H(Te,ct),Je||ve.if(_._`${R.default.errors} === ${Ee||0}`))}!De.$ref||!$e.ignoreKeywordsWithRef&&(0,E.schemaHasRulesButRef)(De,Qe)?($e.jtd||function I(Te,ke){Te.schemaEnv.meta||!Te.opts.strictTypes||(function s(Te,ke){if(ke.length){if(!Te.dataTypes.length)return void(Te.dataTypes=ke);ke.forEach(Se=>{se(Te.dataTypes,Se)||Ae(Te,`type "${Se}" not allowed by context "${Te.dataTypes.join(",")}"`)}),function de(Te,ke){const Se=[];for(const Ee of Te.dataTypes)se(ke,Ee)?Se.push(Ee):ke.includes("integer")&&"number"===Ee&&Se.push("integer");Te.dataTypes=Se}(Te,ke)}}(Te,ke),Te.opts.allowUnionTypes||function p(Te,ke){ke.length>1&&(2!==ke.length||!ke.includes("null"))&&Ae(Te,"use allowUnionTypes to allow union type keyword")}(Te,ke),function J(Te,ke){const Se=Te.self.RULES.all;for(const Ee in Se){const ve=Se[Ee];if("object"==typeof ve&&(0,x.shouldUseRule)(Te.schema,ve)){const{type:De}=ve.definition;De.length&&!De.some(Re=>ee(ke,Re))&&Ae(Te,`missing type "${De.join(",")}" for keyword "${Ee}"`)}}}(Te,Te.dataTypes))}(Te,ke),ve.block(()=>{for(const ct of Qe.rules)Tt(ct);Tt(Qe.post)})):ve.block(()=>Le(Te,"$ref",Qe.all.$ref.definition))}function H(Te,ke){const{gen:Se,schema:Ee,opts:{useDefaults:ve}}=Te;ve&&(0,m.assignDefaults)(Te,ke.type),Se.block(()=>{for(const De of ke.rules)(0,x.shouldUseRule)(Ee,De)&&Le(Te,De.keyword,De.definition,ke.type)})}function ee(Te,ke){return Te.includes(ke)||"number"===ke&&Te.includes("integer")}function se(Te,ke){return Te.includes(ke)||"integer"===ke&&Te.includes("number")}function Ae(Te,ke){(0,E.checkStrictMode)(Te,ke+=` at "${Te.schemaEnv.baseId+Te.errSchemaPath}" (strictTypes)`,Te.opts.strictTypes)}F.validateFunctionCode=function M(Te){ie(Te)&&(me(Te),te(Te))?function V(Te){const{schema:ke,opts:Se,gen:Ee}=Te;k(Te,()=>{Se.$comment&&ke.$comment&&A(Te),function $(Te){const{schema:ke,opts:Se}=Te;void 0!==ke.default&&Se.useDefaults&&Se.strictSchema&&(0,E.checkStrictMode)(Te,"default is ignored in the schema root")}(Te),Ee.let(R.default.vErrors,null),Ee.let(R.default.errors,0),Se.unevaluated&&function Z(Te){const{gen:ke,validateName:Se}=Te;Te.evaluated=ke.const("evaluated",_._`${Se}.evaluated`),ke.if(_._`${Te.evaluated}.dynamicProps`,()=>ke.assign(_._`${Te.evaluated}.props`,_._`undefined`)),ke.if(_._`${Te.evaluated}.dynamicItems`,()=>ke.assign(_._`${Te.evaluated}.items`,_._`undefined`))}(Te),ye(Te),function C(Te){const{gen:ke,schemaEnv:Se,validateName:Ee,ValidationError:ve,opts:De}=Te;Se.$async?ke.if(_._`${R.default.errors} === 0`,()=>ke.return(R.default.data),()=>ke.throw(_._`new ${ve}(${R.default.vErrors})`)):(ke.assign(_._`${Ee}.errors`,R.default.vErrors),De.unevaluated&&function O({gen:Te,evaluated:ke,props:Se,items:Ee}){Se instanceof _.Name&&Te.assign(_._`${ke}.props`,Se),Ee instanceof _.Name&&Te.assign(_._`${ke}.items`,Ee)}(Te),ke.return(_._`${R.default.errors} === 0`))}(Te)})}(Te):k(Te,()=>(0,i.topBoolOrEmptySchema)(Te))};class Ie{constructor(ke,Se,Ee){if((0,S.validateKeywordUsage)(ke,Se,Ee),this.gen=ke.gen,this.allErrors=ke.allErrors,this.keyword=Ee,this.data=ke.data,this.schema=ke.schema[Ee],this.$data=Se.$data&&ke.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,E.schemaRefOrVal)(ke,this.schema,Ee,this.$data),this.schemaType=Se.schemaType,this.parentSchema=ke.schema,this.params={},this.it=ke,this.def=Se,this.$data)this.schemaCode=ke.gen.const("vSchema",Xe(this.$data,ke));else if(this.schemaCode=this.schemaValue,!(0,S.validSchemaType)(this.schema,Se.schemaType,Se.allowUndefined))throw new Error(`${Ee} value must be ${JSON.stringify(Se.schemaType)}`);("code"in Se?Se.trackErrors:!1!==Se.errors)&&(this.errsCount=ke.gen.const("_errs",R.default.errors))}result(ke,Se,Ee){this.failResult((0,_.not)(ke),Se,Ee)}failResult(ke,Se,Ee){this.gen.if(ke),Ee?Ee():this.error(),Se?(this.gen.else(),Se(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(ke,Se){this.failResult((0,_.not)(ke),void 0,Se)}fail(ke){if(void 0===ke)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(ke),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(ke){if(!this.$data)return this.fail(ke);const{schemaCode:Se}=this;this.fail(_._`${Se} !== undefined && (${(0,_.or)(this.invalid$data(),ke)})`)}error(ke,Se,Ee){if(Se)return this.setParams(Se),this._error(ke,Ee),void this.setParams({});this._error(ke,Ee)}_error(ke,Se){(ke?j.reportExtraError:j.reportError)(this,this.def.error,Se)}$dataError(){(0,j.reportError)(this,this.def.$dataError||j.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,j.resetErrorsCount)(this.gen,this.errsCount)}ok(ke){this.allErrors||this.gen.if(ke)}setParams(ke,Se){Se?Object.assign(this.params,ke):this.params=ke}block$data(ke,Se,Ee=_.nil){this.gen.block(()=>{this.check$data(ke,Ee),Se()})}check$data(ke=_.nil,Se=_.nil){if(!this.$data)return;const{gen:Ee,schemaCode:ve,schemaType:De,def:Re}=this;Ee.if((0,_.or)(_._`${ve} === undefined`,Se)),ke!==_.nil&&Ee.assign(ke,!0),(De.length||Re.validateSchema)&&(Ee.elseIf(this.invalid$data()),this.$dataError(),ke!==_.nil&&Ee.assign(ke,!1)),Ee.else()}invalid$data(){const{gen:ke,schemaCode:Se,schemaType:Ee,def:ve,it:De}=this;return(0,_.or)(function Re(){if(Ee.length){if(!(Se instanceof _.Name))throw new Error("ajv implementation error");const $e=Array.isArray(Ee)?Ee:[Ee];return _._`${(0,B.checkDataTypes)($e,Se,De.opts.strictNumbers,B.DataType.Wrong)}`}return _.nil}(),function Je(){if(ve.validateSchema){const $e=ke.scopeValue("validate$data",{ref:ve.validateSchema});return _._`!${$e}(${Se})`}return _.nil}())}subschema(ke,Se){const Ee=(0,g.getSubschema)(this.it,ke);(0,g.extendSubschemaData)(Ee,this.it,ke),(0,g.extendSubschemaMode)(Ee,ke);const ve={...this.it,...Ee,items:void 0,props:void 0};return function ne(Te,ke){ie(Te)&&(me(Te),te(Te))?function ae(Te,ke){const{schema:Se,gen:Ee,opts:ve}=Te;ve.$comment&&Se.$comment&&A(Te),function o(Te){const ke=Te.schema[Te.opts.schemaId];ke&&(Te.baseId=(0,T.resolveUrl)(Te.opts.uriResolver,Te.baseId,ke))}(Te),function h(Te){if(Te.schema.$async&&!Te.schemaEnv.$async)throw new Error("async schema in sync schema")}(Te);const De=Ee.const("_errs",R.default.errors);ye(Te,De),Ee.var(ke,_._`${De} === ${R.default.errors}`)}(Te,ke):(0,i.boolOrEmptySchema)(Te,ke)}(ve,Se),ve}mergeEvaluated(ke,Se){const{it:Ee,gen:ve}=this;Ee.opts.unevaluated&&(!0!==Ee.props&&void 0!==ke.props&&(Ee.props=E.mergeEvaluated.props(ve,ke.props,Ee.props,Se)),!0!==Ee.items&&void 0!==ke.items&&(Ee.items=E.mergeEvaluated.items(ve,ke.items,Ee.items,Se)))}mergeValidEvaluated(ke,Se){const{it:Ee,gen:ve}=this;if(Ee.opts.unevaluated&&(!0!==Ee.props||!0!==Ee.items))return ve.if(Se,()=>this.mergeEvaluated(ke,_.Name)),!0}}function Le(Te,ke,Se,Ee){const ve=new Ie(Te,Se,ke);"code"in Se?Se.code(ve,Ee):ve.$data&&Se.validate?(0,S.funcKeywordCode)(ve,Se):"macro"in Se?(0,S.macroKeywordCode)(ve,Se):(Se.compile||Se.validate)&&(0,S.funcKeywordCode)(ve,Se)}F.KeywordCxt=Ie;const xe=/^\/(?:[^~]|~0|~1)*$/,Ce=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Xe(Te,{dataLevel:ke,dataNames:Se,dataPathArr:Ee}){let ve,De;if(""===Te)return R.default.rootData;if("/"===Te[0]){if(!xe.test(Te))throw new Error(`Invalid JSON-pointer: ${Te}`);ve=Te,De=R.default.rootData}else{const nt=Ce.exec(Te);if(!nt)throw new Error(`Invalid JSON-pointer: ${Te}`);const Qe=+nt[1];if(ve=nt[2],"#"===ve){if(Qe>=ke)throw new Error($e("property/index",Qe));return Ee[ke-Qe]}if(Qe>ke)throw new Error($e("data",Qe));if(De=Se[ke-Qe],!ve)return De}let Re=De;const Je=ve.split("/");for(const nt of Je)nt&&(De=_._`${De}${(0,_.getProperty)((0,E.unescapeJsonPointer)(nt))}`,Re=_._`${Re} && ${De}`);return Re;function $e(nt,Qe){return`Cannot access ${nt} ${Qe} levels up, current level is ${ke}`}}F.getData=Xe},76800:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateKeywordUsage=F.validSchemaType=F.funcKeywordCode=F.macroKeywordCode=void 0;const i=f(1038),c=f(23432),x=f(42406),B=f(53421);function g(M){const{gen:k,data:K,it:W}=M;k.if(W.parentData,()=>k.assign(K,i._`${W.parentData}[${W.parentDataProperty}]`))}function T(M,k,K){if(void 0===K)throw new Error(`keyword "${k}" failed to compile`);return M.scopeValue("keyword","function"==typeof K?{ref:K}:{ref:K,code:(0,i.stringify)(K)})}F.macroKeywordCode=function m(M,k){const{gen:K,keyword:W,schema:V,parentSchema:Z,it:q}=M,ne=k.macro.call(q.self,V,Z,q),te=T(K,W,ne);!1!==q.opts.validateSchema&&q.self.validateSchema(ne,!0);const ie=K.name("valid");M.subschema({schema:ne,schemaPath:i.nil,errSchemaPath:`${q.errSchemaPath}/${W}`,topSchemaRef:te,compositeRule:!0},ie),M.pass(ie,()=>M.error(!0))},F.funcKeywordCode=function S(M,k){var K;const{gen:W,keyword:V,schema:Z,parentSchema:q,$data:ne,it:te}=M;!function R({schemaEnv:M},k){if(k.async&&!M.$async)throw new Error("async keyword in sync schema")}(te,k);const ie=!ne&&k.compile?k.compile.call(te.self,Z,q,te):k.validate,ae=T(W,V,ie),me=W.let("valid");function o(A=(k.async?i._`await `:i.nil)){W.assign(me,i._`${A}${(0,x.callValidateCode)(M,ae,te.opts.passContext?c.default.this:c.default.self,!("compile"in k&&!ne||!1===k.schema))}`,k.modifying)}function h(A){var C;W.if((0,i.not)(null!==(C=k.valid)&&void 0!==C?C:me),A)}M.block$data(me,function ye(){if(!1===k.errors)o(),k.modifying&&g(M),h(()=>M.error());else{const A=k.async?function ue(){const A=W.let("ruleErrs",null);return W.try(()=>o(i._`await `),C=>W.assign(me,!1).if(i._`${C} instanceof ${te.ValidationError}`,()=>W.assign(A,i._`${C}.errors`),()=>W.throw(C))),A}():function $(){const A=i._`${ae}.errors`;return W.assign(A,null),o(i.nil),A}();k.modifying&&g(M),h(()=>function _(M,k){const{gen:K}=M;K.if(i._`Array.isArray(${k})`,()=>{K.assign(c.default.vErrors,i._`${c.default.vErrors} === null ? ${k} : ${c.default.vErrors}.concat(${k})`).assign(c.default.errors,i._`${c.default.vErrors}.length`),(0,B.extendErrors)(M)},()=>M.error())}(M,A))}}),M.ok(null!==(K=k.valid)&&void 0!==K?K:me)},F.validSchemaType=function E(M,k,K=!1){return!k.length||k.some(W=>"array"===W?Array.isArray(M):"object"===W?M&&"object"==typeof M&&!Array.isArray(M):typeof M==W||K&&typeof M>"u")},F.validateKeywordUsage=function j({schema:M,opts:k,self:K,errSchemaPath:W},V,Z){if(Array.isArray(V.keyword)?!V.keyword.includes(Z):V.keyword!==Z)throw new Error("ajv implementation error");const q=V.dependencies;if(q?.some(ne=>!Object.prototype.hasOwnProperty.call(M,ne)))throw new Error(`parent schema must have dependencies of ${Z}: ${q.join(",")}`);if(V.validateSchema&&!V.validateSchema(M[Z])){const te=`keyword "${Z}" value is invalid at path "${W}": `+K.errorsText(V.validateSchema.errors);if("log"!==k.validateSchema)throw new Error(te);K.logger.error(te)}}},16334:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.extendSubschemaMode=F.extendSubschemaData=F.getSubschema=void 0;const i=f(1038),c=f(27006);F.getSubschema=function x(S,{keyword:g,schemaProp:_,schema:R,schemaPath:T,errSchemaPath:E,topSchemaRef:j}){if(void 0!==g&&void 0!==R)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==g){const M=S.schema[g];return void 0===_?{schema:M,schemaPath:i._`${S.schemaPath}${(0,i.getProperty)(g)}`,errSchemaPath:`${S.errSchemaPath}/${g}`}:{schema:M[_],schemaPath:i._`${S.schemaPath}${(0,i.getProperty)(g)}${(0,i.getProperty)(_)}`,errSchemaPath:`${S.errSchemaPath}/${g}/${(0,c.escapeFragment)(_)}`}}if(void 0!==R){if(void 0===T||void 0===E||void 0===j)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:R,schemaPath:T,topSchemaRef:j,errSchemaPath:E}}throw new Error('either "keyword" or "schema" must be passed')},F.extendSubschemaData=function B(S,g,{dataProp:_,dataPropType:R,data:T,dataTypes:E,propertyName:j}){if(void 0!==T&&void 0!==_)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:M}=g;if(void 0!==_){const{errorPath:K,dataPathArr:W,opts:V}=g;k(M.let("data",i._`${g.data}${(0,i.getProperty)(_)}`,!0)),S.errorPath=i.str`${K}${(0,c.getErrorPath)(_,R,V.jsPropertySyntax)}`,S.parentDataProperty=i._`${_}`,S.dataPathArr=[...W,S.parentDataProperty]}function k(K){S.data=K,S.dataLevel=g.dataLevel+1,S.dataTypes=[],g.definedProperties=new Set,S.parentData=g.data,S.dataNames=[...g.dataNames,K]}void 0!==T&&(k(T instanceof i.Name?T:M.let("data",T,!0)),void 0!==j&&(S.propertyName=j)),E&&(S.dataTypes=E)},F.extendSubschemaMode=function m(S,{jtdDiscriminator:g,jtdMetadata:_,compositeRule:R,createErrors:T,allErrors:E}){void 0!==R&&(S.compositeRule=R),void 0!==T&&(S.createErrors=T),void 0!==E&&(S.allErrors=E),S.jtdDiscriminator=g,S.jtdMetadata=_}},35419:(Me,F,f)=>{"use strict";var i=f(29293).default;Object.defineProperty(F,"__esModule",{value:!0}),F.CodeGen=F.Name=F.nil=F.stringify=F.str=F._=F.KeywordCxt=void 0;var c=f(40339);Object.defineProperty(F,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var x=f(1038);Object.defineProperty(F,"_",{enumerable:!0,get:function(){return x._}}),Object.defineProperty(F,"str",{enumerable:!0,get:function(){return x.str}}),Object.defineProperty(F,"stringify",{enumerable:!0,get:function(){return x.stringify}}),Object.defineProperty(F,"nil",{enumerable:!0,get:function(){return x.nil}}),Object.defineProperty(F,"Name",{enumerable:!0,get:function(){return x.Name}}),Object.defineProperty(F,"CodeGen",{enumerable:!0,get:function(){return x.CodeGen}});const B=f(42467),m=f(26288),S=f(32203),g=f(97692),_=f(1038),R=f(77172),T=f(55999),E=f(27006),j=f(83813),M=f(13203),k=(p,J)=>new RegExp(p,J);k.code="new RegExp";const K=["removeAdditional","useDefaults","coerceTypes"],W=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),V={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Z={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function ne(p){var J,ee,se,de,Ae,Ie,Le,xe,Ce,Xe,Te,ke,Se,Ee,ve,De,Re,Je,$e,nt,Qe,Tt,ct,ze,St;const re=p.strict,X=null===(J=p.code)||void 0===J?void 0:J.optimize,G=!0===X||void 0===X?1:X||0,he=null!==(se=null===(ee=p.code)||void 0===ee?void 0:ee.regExp)&&void 0!==se?se:k,_e=null!==(de=p.uriResolver)&&void 0!==de?de:M.default;return{strictSchema:null===(Ie=null!==(Ae=p.strictSchema)&&void 0!==Ae?Ae:re)||void 0===Ie||Ie,strictNumbers:null===(xe=null!==(Le=p.strictNumbers)&&void 0!==Le?Le:re)||void 0===xe||xe,strictTypes:null!==(Xe=null!==(Ce=p.strictTypes)&&void 0!==Ce?Ce:re)&&void 0!==Xe?Xe:"log",strictTuples:null!==(ke=null!==(Te=p.strictTuples)&&void 0!==Te?Te:re)&&void 0!==ke?ke:"log",strictRequired:null!==(Ee=null!==(Se=p.strictRequired)&&void 0!==Se?Se:re)&&void 0!==Ee&&Ee,code:p.code?{...p.code,optimize:G,regExp:he}:{optimize:G,regExp:he},loopRequired:null!==(ve=p.loopRequired)&&void 0!==ve?ve:200,loopEnum:null!==(De=p.loopEnum)&&void 0!==De?De:200,meta:null===(Re=p.meta)||void 0===Re||Re,messages:null===(Je=p.messages)||void 0===Je||Je,inlineRefs:null===($e=p.inlineRefs)||void 0===$e||$e,schemaId:null!==(nt=p.schemaId)&&void 0!==nt?nt:"$id",addUsedSchema:null===(Qe=p.addUsedSchema)||void 0===Qe||Qe,validateSchema:null===(Tt=p.validateSchema)||void 0===Tt||Tt,validateFormats:null===(ct=p.validateFormats)||void 0===ct||ct,unicodeRegExp:null===(ze=p.unicodeRegExp)||void 0===ze||ze,int32range:null===(St=p.int32range)||void 0===St||St,uriResolver:_e}}class te{constructor(J={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,J=this.opts={...J,...ne(J)};const{es5:ee,lines:se}=this.opts.code;this.scope=new _.ValueScope({scope:{},prefixes:W,es5:ee,lines:se}),this.logger=function h(p){if(!1===p)return o;if(void 0===p)return console;if(p.log&&p.warn&&p.error)return p;throw new Error("logger must implement log, warn and error methods")}(J.logger);const de=J.validateFormats;J.validateFormats=!1,this.RULES=(0,S.getRules)(),ie.call(this,V,J,"NOT SUPPORTED"),ie.call(this,Z,J,"DEPRECATED","warn"),this._metaOpts=$.call(this),J.formats&&ye.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),J.keywords&&ue.call(this,J.keywords),"object"==typeof J.meta&&this.addMetaSchema(J.meta),me.call(this),J.validateFormats=de}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:J,meta:ee,schemaId:se}=this.opts;let de=j;"id"===se&&(de={...j},de.id=de.$id,delete de.$id),ee&&J&&this.addMetaSchema(de,de[se],!1)}defaultMeta(){const{meta:J,schemaId:ee}=this.opts;return this.opts.defaultMeta="object"==typeof J?J[ee]||J:void 0}validate(J,ee){let se;if("string"==typeof J){if(se=this.getSchema(J),!se)throw new Error(`no schema with key or ref "${J}"`)}else se=this.compile(J);const de=se(ee);return"$async"in se||(this.errors=se.errors),de}compile(J,ee){const se=this._addSchema(J,ee);return se.validate||this._compileSchemaEnv(se)}compileAsync(J,ee){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:se}=this.opts;return de.call(this,J,ee);function de(ve,De){return Ae.apply(this,arguments)}function Ae(){return(Ae=i(function*(ve,De){yield Ie.call(this,ve.$schema);const Re=this._addSchema(ve,De);return Re.validate||xe.call(this,Re)})).apply(this,arguments)}function Ie(ve){return Le.apply(this,arguments)}function Le(){return(Le=i(function*(ve){ve&&!this.getSchema(ve)&&(yield de.call(this,{$ref:ve},!0))})).apply(this,arguments)}function xe(ve){return Ce.apply(this,arguments)}function Ce(){return(Ce=i(function*(ve){try{return this._compileSchemaEnv(ve)}catch(De){if(!(De instanceof m.default))throw De;return Xe.call(this,De),yield Te.call(this,De.missingSchema),xe.call(this,ve)}})).apply(this,arguments)}function Xe({missingSchema:ve,missingRef:De}){if(this.refs[ve])throw new Error(`AnySchema ${ve} is loaded but ${De} cannot be resolved`)}function Te(ve){return ke.apply(this,arguments)}function ke(){return(ke=i(function*(ve){const De=yield Se.call(this,ve);this.refs[ve]||(yield Ie.call(this,De.$schema)),this.refs[ve]||this.addSchema(De,ve,ee)})).apply(this,arguments)}function Se(ve){return Ee.apply(this,arguments)}function Ee(){return(Ee=i(function*(ve){const De=this._loading[ve];if(De)return De;try{return yield this._loading[ve]=se(ve)}finally{delete this._loading[ve]}})).apply(this,arguments)}}addSchema(J,ee,se,de=this.opts.validateSchema){if(Array.isArray(J)){for(const Ie of J)this.addSchema(Ie,void 0,se,de);return this}let Ae;if("object"==typeof J){const{schemaId:Ie}=this.opts;if(Ae=J[Ie],void 0!==Ae&&"string"!=typeof Ae)throw new Error(`schema ${Ie} must be string`)}return ee=(0,R.normalizeId)(ee||Ae),this._checkUnique(ee),this.schemas[ee]=this._addSchema(J,se,ee,de,!0),this}addMetaSchema(J,ee,se=this.opts.validateSchema){return this.addSchema(J,ee,!0,se),this}validateSchema(J,ee){if("boolean"==typeof J)return!0;let se;if(se=J.$schema,void 0!==se&&"string"!=typeof se)throw new Error("$schema must be a string");if(se=se||this.opts.defaultMeta||this.defaultMeta(),!se)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const de=this.validate(se,J);if(!de&&ee){const Ae="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(Ae);this.logger.error(Ae)}return de}getSchema(J){let ee;for(;"string"==typeof(ee=ae.call(this,J));)J=ee;if(void 0===ee){const{schemaId:se}=this.opts,de=new g.SchemaEnv({schema:{},schemaId:se});if(ee=g.resolveSchema.call(this,de,J),!ee)return;this.refs[J]=ee}return ee.validate||this._compileSchemaEnv(ee)}removeSchema(J){if(J instanceof RegExp)return this._removeAllSchemas(this.schemas,J),this._removeAllSchemas(this.refs,J),this;switch(typeof J){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const ee=ae.call(this,J);return"object"==typeof ee&&this._cache.delete(ee.schema),delete this.schemas[J],delete this.refs[J],this}case"object":{this._cache.delete(J);let se=J[this.opts.schemaId];return se&&(se=(0,R.normalizeId)(se),delete this.schemas[se],delete this.refs[se]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(J){for(const ee of J)this.addKeyword(ee);return this}addKeyword(J,ee){let se;if("string"==typeof J)se=J,"object"==typeof ee&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),ee.keyword=se);else{if("object"!=typeof J||void 0!==ee)throw new Error("invalid addKeywords parameters");if(se=(ee=J).keyword,Array.isArray(se)&&!se.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(C.call(this,se,ee),!ee)return(0,E.eachItem)(se,Ae=>O.call(this,Ae)),this;H.call(this,ee);const de={...ee,type:(0,T.getJSONTypes)(ee.type),schemaType:(0,T.getJSONTypes)(ee.schemaType)};return(0,E.eachItem)(se,0===de.type.length?Ae=>O.call(this,Ae,de):Ae=>de.type.forEach(Ie=>O.call(this,Ae,de,Ie))),this}getKeyword(J){const ee=this.RULES.all[J];return"object"==typeof ee?ee.definition:!!ee}removeKeyword(J){const{RULES:ee}=this;delete ee.keywords[J],delete ee.all[J];for(const se of ee.rules){const de=se.rules.findIndex(Ae=>Ae.keyword===J);de>=0&&se.rules.splice(de,1)}return this}addFormat(J,ee){return"string"==typeof ee&&(ee=new RegExp(ee)),this.formats[J]=ee,this}errorsText(J=this.errors,{separator:ee=", ",dataVar:se="data"}={}){return J&&0!==J.length?J.map(de=>`${se}${de.instancePath} ${de.message}`).reduce((de,Ae)=>de+ee+Ae):"No errors"}$dataMetaSchema(J,ee){const se=this.RULES.all;J=JSON.parse(JSON.stringify(J));for(const de of ee){const Ae=de.split("/").slice(1);let Ie=J;for(const Le of Ae)Ie=Ie[Le];for(const Le in se){const xe=se[Le];if("object"!=typeof xe)continue;const{$data:Ce}=xe.definition,Xe=Ie[Le];Ce&&Xe&&(Ie[Le]=s(Xe))}}return J}_removeAllSchemas(J,ee){for(const se in J){const de=J[se];(!ee||ee.test(se))&&("string"==typeof de?delete J[se]:de&&!de.meta&&(this._cache.delete(de.schema),delete J[se]))}}_addSchema(J,ee,se,de=this.opts.validateSchema,Ae=this.opts.addUsedSchema){let Ie;const{schemaId:Le}=this.opts;if("object"==typeof J)Ie=J[Le];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof J)throw new Error("schema must be object or boolean")}let xe=this._cache.get(J);if(void 0!==xe)return xe;se=(0,R.normalizeId)(Ie||se);const Ce=R.getSchemaRefs.call(this,J,se);return xe=new g.SchemaEnv({schema:J,schemaId:Le,meta:ee,baseId:se,localRefs:Ce}),this._cache.set(xe.schema,xe),Ae&&!se.startsWith("#")&&(se&&this._checkUnique(se),this.refs[se]=xe),de&&this.validateSchema(J,!0),xe}_checkUnique(J){if(this.schemas[J]||this.refs[J])throw new Error(`schema with key or id "${J}" already exists`)}_compileSchemaEnv(J){if(J.meta?this._compileMetaSchema(J):g.compileSchema.call(this,J),!J.validate)throw new Error("ajv implementation error");return J.validate}_compileMetaSchema(J){const ee=this.opts;this.opts=this._metaOpts;try{g.compileSchema.call(this,J)}finally{this.opts=ee}}}function ie(p,J,ee,se="error"){for(const de in p)de in J&&this.logger[se](`${ee}: option ${de}. ${p[de]}`)}function ae(p){return p=(0,R.normalizeId)(p),this.schemas[p]||this.refs[p]}function me(){const p=this.opts.schemas;if(p)if(Array.isArray(p))this.addSchema(p);else for(const J in p)this.addSchema(p[J],J)}function ye(){for(const p in this.opts.formats){const J=this.opts.formats[p];J&&this.addFormat(p,J)}}function ue(p){if(Array.isArray(p))this.addVocabulary(p);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const J in p){const ee=p[J];ee.keyword||(ee.keyword=J),this.addKeyword(ee)}}}function $(){const p={...this.opts};for(const J of K)delete p[J];return p}F.default=te,te.ValidationError=B.default,te.MissingRefError=m.default;const o={log(){},warn(){},error(){}},A=/^[a-z_$][a-z0-9_$:-]*$/i;function C(p,J){const{RULES:ee}=this;if((0,E.eachItem)(p,se=>{if(ee.keywords[se])throw new Error(`Keyword ${se} is already defined`);if(!A.test(se))throw new Error(`Keyword ${se} has invalid name`)}),J&&J.$data&&!("code"in J)&&!("validate"in J))throw new Error('$data keyword must have "code" or "validate" function')}function O(p,J,ee){var se;const de=J?.post;if(ee&&de)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:Ae}=this;let Ie=de?Ae.post:Ae.rules.find(({type:xe})=>xe===ee);if(Ie||(Ie={type:ee,rules:[]},Ae.rules.push(Ie)),Ae.keywords[p]=!0,!J)return;const Le={keyword:p,definition:{...J,type:(0,T.getJSONTypes)(J.type),schemaType:(0,T.getJSONTypes)(J.schemaType)}};J.before?z.call(this,Ie,Le,J.before):Ie.rules.push(Le),Ae.all[p]=Le,null===(se=J.implements)||void 0===se||se.forEach(xe=>this.addKeyword(xe))}function z(p,J,ee){const se=p.rules.findIndex(de=>de.keyword===ee);se>=0?p.rules.splice(se,0,J):(p.rules.push(J),this.logger.warn(`rule ${ee} is not defined`))}function H(p){let{metaSchema:J}=p;void 0!==J&&(p.$data&&this.opts.$data&&(J=s(J)),p.validateSchema=this.compile(J,!0))}const I={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function s(p){return{anyOf:[p,I]}}},87577:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(6438),c=f(59608),x=f(8307),B=f(11082),m=f(93406),S=f(14516),g=f(3059),_=f(18738),R=["/properties"];F.default=function T(E){return[i,c,x,B,m,j(this,S),g,j(this,_)].forEach(M=>this.addMetaSchema(M,void 0,!1)),this;function j(M,k){return E?M.$dataMetaSchema(k,R):k}}},92281:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(40362);i.code='require("ajv/dist/runtime/equal").default',F.default=i},26488:(Me,F)=>{"use strict";function f(i){const c=i.length;let m,x=0,B=0;for(;B=55296&&m<=56319&&B{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(95568);i.code='require("ajv/dist/runtime/uri").default',F.default=i},42467:(Me,F)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});class f extends Error{constructor(c){super("validation failed"),this.errors=c,this.ajv=this.validation=!0}}F.default=f},46934:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateAdditionalItems=void 0;const i=f(1038),c=f(27006),B={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:S}})=>i.str`must NOT have more than ${S} items`,params:({params:{len:S}})=>i._`{limit: ${S}}`},code(S){const{parentSchema:g,it:_}=S,{items:R}=g;Array.isArray(R)?m(S,R):(0,c.checkStrictMode)(_,'"additionalItems" is ignored when "items" is not an array of schemas')}};function m(S,g){const{gen:_,schema:R,data:T,keyword:E,it:j}=S;j.items=!0;const M=_.const("len",i._`${T}.length`);if(!1===R)S.setParams({len:g.length}),S.pass(i._`${M} <= ${g.length}`);else if("object"==typeof R&&!(0,c.alwaysValidSchema)(j,R)){const K=_.var("valid",i._`${M} <= ${g.length}`);_.if((0,i.not)(K),()=>function k(K){_.forRange("i",g.length,M,W=>{S.subschema({keyword:E,dataProp:W,dataPropType:c.Type.Num},K),j.allErrors||_.if((0,i.not)(K),()=>_.break())})}(K)),S.ok(K)}}F.validateAdditionalItems=m,F.default=B},18445:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(42406),c=f(1038),x=f(23432),B=f(27006);F.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:g})=>c._`{additionalProperty: ${g.additionalProperty}}`},code(g){const{gen:_,schema:R,parentSchema:T,data:E,errsCount:j,it:M}=g;if(!j)throw new Error("ajv implementation error");const{allErrors:k,opts:K}=M;if(M.props=!0,"all"!==K.removeAdditional&&(0,B.alwaysValidSchema)(M,R))return;const W=(0,i.allSchemaProperties)(T.properties),V=(0,i.allSchemaProperties)(T.patternProperties);function ne(ae){_.code(c._`delete ${E}[${ae}]`)}function te(ae){if("all"===K.removeAdditional||K.removeAdditional&&!1===R)ne(ae);else{if(!1===R)return g.setParams({additionalProperty:ae}),g.error(),void(k||_.break());if("object"==typeof R&&!(0,B.alwaysValidSchema)(M,R)){const me=_.name("valid");"failing"===K.removeAdditional?(ie(ae,me,!1),_.if((0,c.not)(me),()=>{g.reset(),ne(ae)})):(ie(ae,me),k||_.if((0,c.not)(me),()=>_.break()))}}}function ie(ae,me,ye){const ue={keyword:"additionalProperties",dataProp:ae,dataPropType:B.Type.Str};!1===ye&&Object.assign(ue,{compositeRule:!0,createErrors:!1,allErrors:!1}),g.subschema(ue,me)}(function Z(){_.forIn("key",E,ae=>{W.length||V.length?_.if(function q(ae){let me;if(W.length>8){const ye=(0,B.schemaRefOrVal)(M,T.properties,"properties");me=(0,i.isOwnProperty)(_,ye,ae)}else me=W.length?(0,c.or)(...W.map(ye=>c._`${ae} === ${ye}`)):c.nil;return V.length&&(me=(0,c.or)(me,...V.map(ye=>c._`${(0,i.usePattern)(g,ye)}.test(${ae})`))),(0,c.not)(me)}(ae),()=>te(ae)):te(ae)})})(),g.ok(c._`${j} === ${x.default.errors}`)}}},77783:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(27006);F.default={keyword:"allOf",schemaType:"array",code(x){const{gen:B,schema:m,it:S}=x;if(!Array.isArray(m))throw new Error("ajv implementation error");const g=B.name("valid");m.forEach((_,R)=>{if((0,i.alwaysValidSchema)(S,_))return;const T=x.subschema({keyword:"allOf",schemaProp:R},g);x.ok(g),x.mergeEvaluated(T)})}}},60922:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const c={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:f(42406).validateUnion,error:{message:"must match a schema in anyOf"}};F.default=c},57568:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});const i=f(1038),c=f(27006);F.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:m,max:S}})=>void 0===S?i.str`must contain at least ${m} valid item(s)`:i.str`must contain at least ${m} and no more than ${S} valid item(s)`,params:({params:{min:m,max:S}})=>void 0===S?i._`{minContains: ${m}}`:i._`{minContains: ${m}, maxContains: ${S}}`},code(m){const{gen:S,schema:g,parentSchema:_,data:R,it:T}=m;let E,j;const{minContains:M,maxContains:k}=_;T.opts.next?(E=void 0===M?1:M,j=k):E=1;const K=S.const("len",i._`${R}.length`);if(m.setParams({min:E,max:j}),void 0===j&&0===E)return void(0,c.checkStrictMode)(T,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==j&&E>j)return(0,c.checkStrictMode)(T,'"minContains" > "maxContains" is always invalid'),void m.fail();if((0,c.alwaysValidSchema)(T,g)){let ne=i._`${K} >= ${E}`;return void 0!==j&&(ne=i._`${ne} && ${K} <= ${j}`),void m.pass(ne)}T.items=!0;const W=S.name("valid");function V(){const ne=S.name("_valid"),te=S.let("count",0);Z(ne,()=>S.if(ne,()=>function q(ne){S.code(i._`${ne}++`),void 0===j?S.if(i._`${ne} >= ${E}`,()=>S.assign(W,!0).break()):(S.if(i._`${ne} > ${j}`,()=>S.assign(W,!1).break()),1===E?S.assign(W,!0):S.if(i._`${ne} >= ${E}`,()=>S.assign(W,!0)))}(te)))}function Z(ne,te){S.forRange("i",0,K,ie=>{m.subschema({keyword:"contains",dataProp:ie,dataPropType:c.Type.Num,compositeRule:!0},ne),te()})}void 0===j&&1===E?Z(W,()=>S.if(W,()=>S.break())):0===E?(S.let(W,!0),void 0!==j&&S.if(i._`${R}.length > 0`,V)):(S.let(W,!1),V()),m.result(W,()=>m.reset())}}},68032:(Me,F,f)=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0}),F.validateSchemaDeps=F.validatePropertyDeps=F.error=void 0;const i=f(1038),c=f(27006),x=f(42406);F.error={message:({params:{property:_,depsCount:R,deps:T}})=>i.str`must have ${1===R?"property":"properties"} ${T} when property ${_} is present`,params:({params:{property:_,depsCount:R,deps:T,missingProperty:E}})=>i._`{property: ${_}, diff --git a/ngsw.json b/ngsw.json index 75324009..1c7b9e86 100644 --- a/ngsw.json +++ b/ngsw.json @@ -1,6 +1,6 @@ { "configVersion": 1, - "timestamp": 1729708315988, + "timestamp": 1729709661609, "index": "/index.html", "assetGroups": [], "dataGroups": [],