UNPKG

jobsys-explore

Version:

Enhanced component based on vant

3 lines (2 loc) 45.6 kB
"use strict";var Ze=Object.defineProperty;var De=(t,n,e)=>n in t?Ze(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var N=(t,n,e)=>(De(t,typeof n!="symbol"?n+"":n,e),e);const q=require("lodash-es"),ue=require("axios"),Q=require("vant"),fe=require("dayjs"),at={STATE_CODE_SUCCESS:"SUCCESS",STATE_CODE_FAIL:"FAIL",STATE_CODE_NOT_FOUND:"NOT_FOUND",STATE_CODE_INFO_NOT_COMPLETE:"INCOMPLETE",STATE_CODE_NOT_ALLOWED:"NOT_ALLOWED"};function Ke(t){Object.keys(t).forEach(n=>{at[n]=t[n]})}function ze(t){let n=null;return t||(t={}),t.loading=!0,{get(e,o){return new Promise((r,s)=>{ue.get(e,o).then(l=>{r(l)}).catch(l=>{s(l)}).finally(()=>{n&&(Q.allowMultipleToast(!1),n.close()),t.loading=!1})})},post(e,o,r){return new Promise((s,l)=>{ue.post(e,o,r).then(i=>{s(i)}).catch(i=>{l(i)}).finally(()=>{n&&(Q.allowMultipleToast(!1),n.close()),t.loading=!1})})},loading(e){return Q.closeToast(!0),Q.allowMultipleToast(),q.isString(e)?n=Q.showLoadingToast({message:e||"加载中...",duration:0,forbidClick:!0}):q.isObject(e)?n=Q.showLoadingToast({duration:0,...e}):n=Q.showLoadingToast({message:"加载中...",duration:0,forbidClick:!0}),this}}}function je(t,n,e){if(!n)return"";e=e||{value:"value",label:"text"};const o=n.find(r=>r[e.value]===t);return o?o[e.label]:""}function Ye(t,n,e){e=e||{value:"value",label:"text",children:"children"};const o=[];function r(s){var l;n.includes(s[e.value])&&o.push(s[e.label]),(l=s[e.children])!=null&&l.length&&s[e.children].forEach(i=>{r(i)})}return t.forEach(s=>{r(s)}),o}function ve(t,n,e){e=e||{value:"value",label:"text",children:"children"};let o=[];return q.reduce(n,(r,s)=>{const l=q.find(r,{[e.value]:s});if(l)return o.push(l[e.label]),l[e.children]},t),o}function Se(t,n,e){e=e||{value:"value",label:"text",children:"children"};for(let o of t){if(o[e.value]===n)return o;if(o[e.children]&&o[e.children].length){const r=Se(o[e.children],n,e);if(r)return r}}return null}function Me(t,n,e){return e=e||{value:"value",label:"text",children:"children"},ve(t,n,e)}function xe(t,n,e){return q.flatMapDeep(t,(o,r)=>r===n?o:r===e?xe(o,n,e):[])}function Ge(t,n,e){e=e||{value:"value",label:"text",children:"children"};const o=[];function r(s,l,i){for(const c of s)if(c[e.value]===l){i.unshift(c[e.label]);break}else if(c[e.children]&&r(c[e.children],l,i).length>0){i.unshift(c[e.label]);break}return i}return r(t,n,o)}function We(t,n,e){e=e||{value:"value",label:"text",children:"children"};const o=[];function r(s,l,i){for(const c of s)if(c[e.value]===l){i.unshift(c[e.value]);break}else if(c[e.children]&&r(c[e.children],l,i).length>0){i.unshift(c[e.value]);break}return i}return r(t,n,o)}const Ht={},Je={setItem(t,n){Ht[t]=n},getItem(t){return Ht[t]},removeItem(t){delete Ht[t]}};window._printCache=()=>{console.log(JSON.parse(JSON.stringify(Ht,null,2)))};function Qe(t,n){const e=n||Je,o=!!n;return{get(r){const s=e.getItem(t);return q.isNull(s)||q.isUndefined(s)?r:o?JSON.parse(s):s},set(r){e.setItem(t,o?JSON.stringify(r):r)},remove(){e.removeItem(t)}}}function Xe(t){const{url:n,data:e,csrfToken:o}=t;let{method:r}=t;r=r||"post";const s=document.createElement("form");if(s.action=n,s.method=r,s.target="_blank",s.style.display="none",Object.keys(e).forEach(l=>{const i=document.createElement("input");i.type="hidden",i.name=l,i.value=e[l],s.appendChild(i)}),!o){const l=document.createElement("input");l.type="hidden",l.name="_token",l.value=document.querySelector('meta[name="csrf-token"]').getAttribute("content"),s.appendChild(l)}return document.body.appendChild(s),s}function Be(t,n){const{status:e}=t,o=t.result,r={};r.default="请求失败, 请检查数据并重试",r[at.STATE_CODE_FAIL]="系统错误,请稍候再试",r[at.STATE_CODE_NOT_FOUND]="请求的内容不存在",r[at.STATE_CODE_INFO_NOT_COMPLETE]="信息不完整",r[at.STATE_CODE_NOT_ALLOWED]="没有权限";const s={[at.STATE_CODE_SUCCESS]:"success"},l=n[e]||n[s[e]]||r[e]||r.default;q.isString(l)?e===at.STATE_CODE_SUCCESS?Q.showSuccessToast(l):Q.showFailToast(o||l):q.isFunction(l)&&l()}function tn(t,n){Be(t,{success:n})}function en(t){t&&t.errorFields?t.errorFields.forEach(n=>{Q.showFailToast(n.errors.join(" "))}):t&&t.response?Q.showFailToast("网络异常"):Q.showFailToast("请检查填写项")}function nn(t,n){const e=q.cloneDeep(t);n=n||{};const o=r=>{var s,l;for(let i in r){let c;if(fe.isDayjs(r[i])?c=r[i]:q.isDate(r[i])&&(c=fe(r[i])),c&&n.date){q.isString(n.date)?r[i]=c.format(n.date):q.isFunction(n.date)?r[i]=n.date(c):r[i]=c.unix();continue}if(q.isBoolean(r[i])&&n.boolean){n.boolean===!0?r[i]=r[i]?1:0:Array.isArray(n.boolean)&&(r[i]=r[i]?((s=n.boolean)==null?void 0:s[0])||1:((l=n.boolean)==null?void 0:l[1])||0);continue}if(n.attachment){const u=n.attachment;if(q.isObject(r[i])&&r[i]._type==="file"&&q.isString(u)&&!q.isUndefined(r[i][u])){r[i]=r[i][u];continue}else if(q.isObject(r[i])&&q.isFunction(u)&&r[i]._type==="file"){r[i]=u(r[i]);continue}}q.isArray(r[i])&&(r[i]=o(r[i]))}return r};return o(e)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ae=BigInt(0),Rt=BigInt(1),rn=BigInt(2),Ft=t=>t instanceof Uint8Array,on=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function ot(t){if(!Ft(t))throw new Error("Uint8Array expected");let n="";for(let e=0;e<t.length;e++)n+=on[t[e]];return n}function $(t){const n=t.toString(16);return n.length&1?`0${n}`:n}function _(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function At(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const n=t.length;if(n%2)throw new Error("padded hex string expected, got unpadded hex of length "+n);const e=new Uint8Array(n/2);for(let o=0;o<e.length;o++){const r=o*2,s=t.slice(r,r+2),l=Number.parseInt(s,16);if(Number.isNaN(l)||l<0)throw new Error("Invalid byte sequence");e[o]=l}return e}function mt(t){return _(ot(t))}function Mt(t){if(!Ft(t))throw new Error("Uint8Array expected");return _(ot(Uint8Array.from(t).reverse()))}function Et(t,n){return At(t.toString(16).padStart(n*2,"0"))}function Te(t,n){return Et(t,n).reverse()}function sn(t){return At($(t))}function G(t,n,e){let o;if(typeof n=="string")try{o=At(n)}catch(s){throw new Error(`${t} must be valid hex string, got "${n}". Cause: ${s}`)}else if(Ft(n))o=Uint8Array.from(n);else throw new Error(`${t} must be hex string or Uint8Array`);const r=o.length;if(typeof e=="number"&&r!==e)throw new Error(`${t} expected ${e} bytes, got ${r}`);return o}function Y(...t){const n=new Uint8Array(t.reduce((o,r)=>o+r.length,0));let e=0;return t.forEach(o=>{if(!Ft(o))throw new Error("Uint8Array expected");n.set(o,e),e+=o.length}),n}function cn(t,n){if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==n[e])return!1;return!0}function ln(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function un(t){let n;for(n=0;t>Ae;t>>=Rt,n+=1);return n}function fn(t,n){return t>>BigInt(n)&Rt}const an=(t,n,e)=>t|(e?Rt:Ae)<<BigInt(n),Gt=t=>(rn<<BigInt(t-1))-Rt,kt=t=>new Uint8Array(t),ae=t=>Uint8Array.from(t);function Ie(t,n,e){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof n!="number"||n<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let o=kt(t),r=kt(t),s=0;const l=()=>{o.fill(1),r.fill(0),s=0},i=(...f)=>e(r,o,...f),c=(f=kt())=>{r=i(ae([0]),f),o=i(),f.length!==0&&(r=i(ae([1]),f),o=i())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const m=[];for(;f<n;){o=i();const b=o.slice();m.push(b),f+=o.length}return Y(...m)};return(f,m)=>{l(),c(f);let b;for(;!(b=m(u()));)c();return l(),b}}const hn={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,n)=>n.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Ut(t,n,e={}){const o=(r,s,l)=>{const i=hn[s];if(typeof i!="function")throw new Error(`Invalid validator "${s}", expected function`);const c=t[r];if(!(l&&c===void 0)&&!i(c,t))throw new Error(`Invalid param ${String(r)}=${c} (${typeof c}), expected ${s}`)};for(const[r,s]of Object.entries(n))o(r,s,!1);for(const[r,s]of Object.entries(e))o(r,s,!0);return t}const dn=Object.freeze(Object.defineProperty({__proto__:null,bitGet:fn,bitLen:un,bitMask:Gt,bitSet:an,bytesToHex:ot,bytesToNumberBE:mt,bytesToNumberLE:Mt,concatBytes:Y,createHmacDrbg:Ie,ensureBytes:G,equalBytes:cn,hexToBytes:At,hexToNumber:_,numberToBytesBE:Et,numberToBytesLE:Te,numberToHexUnpadded:$,numberToVarBytesBE:sn,utf8ToBytes:ln,validateObject:Ut},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const V=BigInt(0),H=BigInt(1),wt=BigInt(2),gn=BigInt(3),jt=BigInt(4),he=BigInt(5),de=BigInt(8);BigInt(9);BigInt(16);function Z(t,n){const e=t%n;return e>=V?e:n+e}function wn(t,n,e){if(e<=V||n<V)throw new Error("Expected power/modulo > 0");if(e===H)return V;let o=H;for(;n>V;)n&H&&(o=o*t%e),t=t*t%e,n>>=H;return o}function Yt(t,n){if(t===V||n<=V)throw new Error(`invert: expected positive integers, got n=${t} mod=${n}`);let e=Z(t,n),o=n,r=V,s=H;for(;e!==V;){const i=o/e,c=o%e,u=r-s*i;o=e,e=c,r=s,s=u}if(o!==H)throw new Error("invert: does not exist");return Z(r,n)}function yn(t){const n=(t-H)/wt;let e,o,r;for(e=t-H,o=0;e%wt===V;e/=wt,o++);for(r=wt;r<t&&wn(r,n,t)!==t-H;r++);if(o===1){const l=(t+H)/jt;return function(c,u){const h=c.pow(u,l);if(!c.eql(c.sqr(h),u))throw new Error("Cannot find square root");return h}}const s=(e+H)/wt;return function(i,c){if(i.pow(c,n)===i.neg(i.ONE))throw new Error("Cannot find square root");let u=o,h=i.pow(i.mul(i.ONE,r),e),f=i.pow(c,s),m=i.pow(c,e);for(;!i.eql(m,i.ONE);){if(i.eql(m,i.ZERO))return i.ZERO;let b=1;for(let a=i.sqr(m);b<u&&!i.eql(a,i.ONE);b++)a=i.sqr(a);const g=i.pow(h,H<<BigInt(u-b-1));h=i.sqr(g),f=i.mul(f,g),m=i.mul(m,h),u=b}return f}}function pn(t){if(t%jt===gn){const n=(t+H)/jt;return function(o,r){const s=o.pow(r,n);if(!o.eql(o.sqr(s),r))throw new Error("Cannot find square root");return s}}if(t%de===he){const n=(t-he)/de;return function(o,r){const s=o.mul(r,wt),l=o.pow(s,n),i=o.mul(r,l),c=o.mul(o.mul(i,wt),l),u=o.mul(i,o.sub(c,o.ONE));if(!o.eql(o.sqr(u),r))throw new Error("Cannot find square root");return u}}return yn(t)}const mn=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function En(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=mn.reduce((o,r)=>(o[r]="function",o),n);return Ut(t,e)}function bn(t,n,e){if(e<V)throw new Error("Expected power > 0");if(e===V)return t.ONE;if(e===H)return n;let o=t.ONE,r=n;for(;e>V;)e&H&&(o=t.mul(o,r)),r=t.sqr(r),e>>=H;return o}function vn(t,n){const e=new Array(n.length),o=n.reduce((s,l,i)=>t.is0(l)?s:(e[i]=s,t.mul(s,l)),t.ONE),r=t.inv(o);return n.reduceRight((s,l,i)=>t.is0(l)?s:(e[i]=t.mul(s,e[i]),t.mul(s,l)),r),e}function Wt(t,n){const e=n!==void 0?n:t.toString(2).length,o=Math.ceil(e/8);return{nBitLength:e,nByteLength:o}}function Oe(t,n,e=!1,o={}){if(t<=V)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:r,nByteLength:s}=Wt(t,n);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=pn(t),i=Object.freeze({ORDER:t,BITS:r,BYTES:s,MASK:Gt(r),ZERO:V,ONE:H,create:c=>Z(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return V<=c&&c<t},is0:c=>c===V,isOdd:c=>(c&H)===H,neg:c=>Z(-c,t),eql:(c,u)=>c===u,sqr:c=>Z(c*c,t),add:(c,u)=>Z(c+u,t),sub:(c,u)=>Z(c-u,t),mul:(c,u)=>Z(c*u,t),pow:(c,u)=>bn(i,c,u),div:(c,u)=>Z(c*Yt(u,t),t),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Yt(c,t),sqrt:o.sqrt||(c=>l(i,c)),invertBatch:c=>vn(i,c),cmov:(c,u,h)=>h?u:c,toBytes:c=>e?Te(c,s):Et(c,s),fromBytes:c=>{if(c.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);return e?Mt(c):mt(c)}});return Object.freeze(i)}function Sn(t,n,e=!1){t=G("privateHash",t);const o=t.length,r=Wt(n).nByteLength+8;if(r<24||o<r||o>1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${o}`);const s=e?Mt(t):mt(t);return Z(s,n-H)+H}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const xn=BigInt(0),Zt=BigInt(1);function Bn(t,n){const e=(r,s)=>{const l=s.negate();return r?l:s},o=r=>{const s=Math.ceil(n/r)+1,l=2**(r-1);return{windows:s,windowSize:l}};return{constTimeNegate:e,unsafeLadder(r,s){let l=t.ZERO,i=r;for(;s>xn;)s&Zt&&(l=l.add(i)),i=i.double(),s>>=Zt;return l},precomputeWindow(r,s){const{windows:l,windowSize:i}=o(s),c=[];let u=r,h=u;for(let f=0;f<l;f++){h=u,c.push(h);for(let m=1;m<i;m++)h=h.add(u),c.push(h);u=h.double()}return c},wNAF(r,s,l){const{windows:i,windowSize:c}=o(r);let u=t.ZERO,h=t.BASE;const f=BigInt(2**r-1),m=2**r,b=BigInt(r);for(let g=0;g<i;g++){const a=g*c;let w=Number(l&f);l>>=b,w>c&&(w-=m,l+=Zt);const y=a,v=a+Math.abs(w)-1,x=g%2!==0,I=w<0;w===0?h=h.add(e(x,s[y])):u=u.add(e(I,s[v]))}return{p:u,f:h}},wNAFCached(r,s,l,i){const c=r._WINDOW_SIZE||1;let u=s.get(r);return u||(u=this.precomputeWindow(r,c),c!==1&&s.set(r,i(u))),this.wNAF(c,u,l)}}}function Pe(t){return En(t.Fp),Ut(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Wt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function An(t){const n=Pe(t);Ut(n,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:e,Fp:o,a:r}=n;if(e){if(!o.eql(r,o.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...n})}const{bytesToNumberBE:Tn,hexToBytes:In}=dn,yt={Err:class extends Error{constructor(n=""){super(n)}},_parseInt(t){const{Err:n}=yt;if(t.length<2||t[0]!==2)throw new n("Invalid signature integer tag");const e=t[1],o=t.subarray(2,e+2);if(!e||o.length!==e)throw new n("Invalid signature integer: wrong length");if(o[0]&128)throw new n("Invalid signature integer: negative");if(o[0]===0&&!(o[1]&128))throw new n("Invalid signature integer: unnecessary leading zero");return{d:Tn(o),l:t.subarray(e+2)}},toSig(t){const{Err:n}=yt,e=typeof t=="string"?In(t):t;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let o=e.length;if(o<2||e[0]!=48)throw new n("Invalid signature tag");if(e[1]!==o-2)throw new n("Invalid signature: incorrect length");const{d:r,l:s}=yt._parseInt(e.subarray(2)),{d:l,l:i}=yt._parseInt(s);if(i.length)throw new n("Invalid signature: left bytes after parsing");return{r,s:l}},hexFromSig(t){const n=u=>Number.parseInt(u[0],16)&8?"00"+u:u,e=u=>{const h=u.toString(16);return h.length&1?`0${h}`:h},o=n(e(t.s)),r=n(e(t.r)),s=o.length/2,l=r.length/2,i=e(s),c=e(l);return`30${e(l+s+4)}02${c}${r}02${i}${o}`}},rt=BigInt(0),W=BigInt(1);BigInt(2);const ge=BigInt(3);BigInt(4);function On(t){const n=An(t),{Fp:e}=n,o=n.toBytes||((g,a,w)=>{const y=a.toAffine();return Y(Uint8Array.from([4]),e.toBytes(y.x),e.toBytes(y.y))}),r=n.fromBytes||(g=>{const a=g.subarray(1),w=e.fromBytes(a.subarray(0,e.BYTES)),y=e.fromBytes(a.subarray(e.BYTES,2*e.BYTES));return{x:w,y}});function s(g){const{a,b:w}=n,y=e.sqr(g),v=e.mul(y,g);return e.add(e.add(v,e.mul(g,a)),w)}if(!e.eql(e.sqr(n.Gy),s(n.Gx)))throw new Error("bad generator point: equation left != right");function l(g){return typeof g=="bigint"&&rt<g&&g<n.n}function i(g){if(!l(g))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(g){const{allowedPrivateKeyLengths:a,nByteLength:w,wrapPrivateKey:y,n:v}=n;if(a&&typeof g!="bigint"){if(g instanceof Uint8Array&&(g=ot(g)),typeof g!="string"||!a.includes(g.length))throw new Error("Invalid key");g=g.padStart(w*2,"0")}let x;try{x=typeof g=="bigint"?g:mt(G("private key",g,w))}catch{throw new Error(`private key must be ${w} bytes, hex or bigint, not ${typeof g}`)}return y&&(x=Z(x,v)),i(x),x}const u=new Map;function h(g){if(!(g instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(a,w,y){if(this.px=a,this.py=w,this.pz=y,a==null||!e.isValid(a))throw new Error("x required");if(w==null||!e.isValid(w))throw new Error("y required");if(y==null||!e.isValid(y))throw new Error("z required")}static fromAffine(a){const{x:w,y}=a||{};if(!a||!e.isValid(w)||!e.isValid(y))throw new Error("invalid affine point");if(a instanceof f)throw new Error("projective point not allowed");const v=x=>e.eql(x,e.ZERO);return v(w)&&v(y)?f.ZERO:new f(w,y,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(a){const w=e.invertBatch(a.map(y=>y.pz));return a.map((y,v)=>y.toAffine(w[v])).map(f.fromAffine)}static fromHex(a){const w=f.fromAffine(r(G("pointHex",a)));return w.assertValidity(),w}static fromPrivateKey(a){return f.BASE.multiply(c(a))}_setWindowSize(a){this._WINDOW_SIZE=a,u.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:a,y:w}=this.toAffine();if(!e.isValid(a)||!e.isValid(w))throw new Error("bad point: x or y not FE");const y=e.sqr(w),v=s(a);if(!e.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:a}=this.toAffine();if(e.isOdd)return!e.isOdd(a);throw new Error("Field doesn't support isOdd")}equals(a){h(a);const{px:w,py:y,pz:v}=this,{px:x,py:I,pz:T}=a,E=e.eql(e.mul(w,T),e.mul(x,v)),S=e.eql(e.mul(y,T),e.mul(I,v));return E&&S}negate(){return new f(this.px,e.neg(this.py),this.pz)}double(){const{a,b:w}=n,y=e.mul(w,ge),{px:v,py:x,pz:I}=this;let T=e.ZERO,E=e.ZERO,S=e.ZERO,A=e.mul(v,v),M=e.mul(x,x),C=e.mul(I,I),O=e.mul(v,x);return O=e.add(O,O),S=e.mul(v,I),S=e.add(S,S),T=e.mul(a,S),E=e.mul(y,C),E=e.add(T,E),T=e.sub(M,E),E=e.add(M,E),E=e.mul(T,E),T=e.mul(O,T),S=e.mul(y,S),C=e.mul(a,C),O=e.sub(A,C),O=e.mul(a,O),O=e.add(O,S),S=e.add(A,A),A=e.add(S,A),A=e.add(A,C),A=e.mul(A,O),E=e.add(E,A),C=e.mul(x,I),C=e.add(C,C),A=e.mul(C,O),T=e.sub(T,A),S=e.mul(C,M),S=e.add(S,S),S=e.add(S,S),new f(T,E,S)}add(a){h(a);const{px:w,py:y,pz:v}=this,{px:x,py:I,pz:T}=a;let E=e.ZERO,S=e.ZERO,A=e.ZERO;const M=n.a,C=e.mul(n.b,ge);let O=e.mul(w,x),D=e.mul(y,I),K=e.mul(v,T),it=e.add(w,y),d=e.add(x,I);it=e.mul(it,d),d=e.add(O,D),it=e.sub(it,d),d=e.add(w,v);let p=e.add(x,T);return d=e.mul(d,p),p=e.add(O,K),d=e.sub(d,p),p=e.add(y,v),E=e.add(I,T),p=e.mul(p,E),E=e.add(D,K),p=e.sub(p,E),A=e.mul(M,d),E=e.mul(C,K),A=e.add(E,A),E=e.sub(D,A),A=e.add(D,A),S=e.mul(E,A),D=e.add(O,O),D=e.add(D,O),K=e.mul(M,K),d=e.mul(C,d),D=e.add(D,K),K=e.sub(O,K),K=e.mul(M,K),d=e.add(d,K),O=e.mul(D,d),S=e.add(S,O),O=e.mul(p,d),E=e.mul(it,E),E=e.sub(E,O),O=e.mul(it,D),A=e.mul(p,A),A=e.add(A,O),new f(E,S,A)}subtract(a){return this.add(a.negate())}is0(){return this.equals(f.ZERO)}wNAF(a){return b.wNAFCached(this,u,a,w=>{const y=e.invertBatch(w.map(v=>v.pz));return w.map((v,x)=>v.toAffine(y[x])).map(f.fromAffine)})}multiplyUnsafe(a){const w=f.ZERO;if(a===rt)return w;if(i(a),a===W)return this;const{endo:y}=n;if(!y)return b.unsafeLadder(this,a);let{k1neg:v,k1:x,k2neg:I,k2:T}=y.splitScalar(a),E=w,S=w,A=this;for(;x>rt||T>rt;)x&W&&(E=E.add(A)),T&W&&(S=S.add(A)),A=A.double(),x>>=W,T>>=W;return v&&(E=E.negate()),I&&(S=S.negate()),S=new f(e.mul(S.px,y.beta),S.py,S.pz),E.add(S)}multiply(a){i(a);let w=a,y,v;const{endo:x}=n;if(x){const{k1neg:I,k1:T,k2neg:E,k2:S}=x.splitScalar(w);let{p:A,f:M}=this.wNAF(T),{p:C,f:O}=this.wNAF(S);A=b.constTimeNegate(I,A),C=b.constTimeNegate(E,C),C=new f(e.mul(C.px,x.beta),C.py,C.pz),y=A.add(C),v=M.add(O)}else{const{p:I,f:T}=this.wNAF(w);y=I,v=T}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(a,w,y){const v=f.BASE,x=(T,E)=>E===rt||E===W||!T.equals(v)?T.multiplyUnsafe(E):T.multiply(E),I=x(this,w).add(x(a,y));return I.is0()?void 0:I}toAffine(a){const{px:w,py:y,pz:v}=this,x=this.is0();a==null&&(a=x?e.ONE:e.inv(v));const I=e.mul(w,a),T=e.mul(y,a),E=e.mul(v,a);if(x)return{x:e.ZERO,y:e.ZERO};if(!e.eql(E,e.ONE))throw new Error("invZ was invalid");return{x:I,y:T}}isTorsionFree(){const{h:a,isTorsionFree:w}=n;if(a===W)return!0;if(w)return w(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:a,clearCofactor:w}=n;return a===W?this:w?w(f,this):this.multiplyUnsafe(n.h)}toRawBytes(a=!0){return this.assertValidity(),o(f,this,a)}toHex(a=!0){return ot(this.toRawBytes(a))}}f.BASE=new f(n.Gx,n.Gy,e.ONE),f.ZERO=new f(e.ZERO,e.ONE,e.ZERO);const m=n.nBitLength,b=Bn(f,n.endo?Math.ceil(m/2):m);return{CURVE:n,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:l}}function Pn(t){const n=Pe(t);return Ut(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function Un(t){const n=Pn(t),{Fp:e,n:o}=n,r=e.BYTES+1,s=2*e.BYTES+1;function l(d){return rt<d&&d<e.ORDER}function i(d){return Z(d,o)}function c(d){return Yt(d,o)}const{ProjectivePoint:u,normPrivateKeyToScalar:h,weierstrassEquation:f,isWithinCurveOrder:m}=On({...n,toBytes(d,p,B){const U=p.toAffine(),P=e.toBytes(U.x),F=Y;return B?F(Uint8Array.from([p.hasEvenY()?2:3]),P):F(Uint8Array.from([4]),P,e.toBytes(U.y))},fromBytes(d){const p=d.length,B=d[0],U=d.subarray(1);if(p===r&&(B===2||B===3)){const P=mt(U);if(!l(P))throw new Error("Point is not on curve");const F=f(P);let z=e.sqrt(F);const j=(z&W)===W;return(B&1)===1!==j&&(z=e.neg(z)),{x:P,y:z}}else if(p===s&&B===4){const P=e.fromBytes(U.subarray(0,e.BYTES)),F=e.fromBytes(U.subarray(e.BYTES,2*e.BYTES));return{x:P,y:F}}else throw new Error(`Point of length ${p} was invalid. Expected ${r} compressed bytes or ${s} uncompressed bytes`)}}),b=d=>ot(Et(d,n.nByteLength));function g(d){const p=o>>W;return d>p}function a(d){return g(d)?i(-d):d}const w=(d,p,B)=>mt(d.slice(p,B));class y{constructor(p,B,U){this.r=p,this.s=B,this.recovery=U,this.assertValidity()}static fromCompact(p){const B=n.nByteLength;return p=G("compactSignature",p,B*2),new y(w(p,0,B),w(p,B,2*B))}static fromDER(p){const{r:B,s:U}=yt.toSig(G("DER",p));return new y(B,U)}assertValidity(){if(!m(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!m(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(p){return new y(this.r,this.s,p)}recoverPublicKey(p){const{r:B,s:U,recovery:P}=this,F=S(G("msgHash",p));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");const z=P===2||P===3?B+n.n:B;if(z>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");const j=P&1?"03":"02",st=u.fromHex(j+b(z)),ct=c(z),bt=i(-F*ct),Ot=i(U*ct),lt=u.BASE.multiplyAndAddUnsafe(st,bt,Ot);if(!lt)throw new Error("point at infinify");return lt.assertValidity(),lt}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,i(-this.s),this.recovery):this}toDERRawBytes(){return At(this.toDERHex())}toDERHex(){return yt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return At(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}const v={isValidPrivateKey(d){try{return h(d),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const d=n.randomBytes(e.BYTES+8),p=Sn(d,o);return Et(p,n.nByteLength)},precompute(d=8,p=u.BASE){return p._setWindowSize(d),p.multiply(BigInt(3)),p}};function x(d,p=!0){return u.fromPrivateKey(d).toRawBytes(p)}function I(d){const p=d instanceof Uint8Array,B=typeof d=="string",U=(p||B)&&d.length;return p?U===r||U===s:B?U===2*r||U===2*s:d instanceof u}function T(d,p,B=!0){if(I(d))throw new Error("first arg must be private key");if(!I(p))throw new Error("second arg must be public key");return u.fromHex(p).multiply(h(d)).toRawBytes(B)}const E=n.bits2int||function(d){const p=mt(d),B=d.length*8-n.nBitLength;return B>0?p>>BigInt(B):p},S=n.bits2int_modN||function(d){return i(E(d))},A=Gt(n.nBitLength);function M(d){if(typeof d!="bigint")throw new Error("bigint expected");if(!(rt<=d&&d<A))throw new Error(`bigint expected < 2^${n.nBitLength}`);return Et(d,n.nByteLength)}function C(d,p,B=O){if(["recovered","canonical"].some(dt=>dt in B))throw new Error("sign() legacy options not supported");const{hash:U,randomBytes:P}=n;let{lowS:F,prehash:z,extraEntropy:j}=B;F==null&&(F=!0),d=G("msgHash",d),z&&(d=G("prehashed msgHash",U(d)));const st=S(d),ct=h(p),bt=[M(ct),M(st)];if(j!=null){const dt=j===!0?P(e.BYTES):j;bt.push(G("extraEntropy",dt,e.BYTES))}const Ot=Y(...bt),lt=st;function $t(dt){const vt=E(dt);if(!m(vt))return;const se=c(vt),St=u.BASE.multiply(vt).toAffine(),X=i(St.x);if(X===rt)return;const xt=i(se*i(lt+X*ct));if(xt===rt)return;let ce=(St.x===X?0:2)|Number(St.y&W),le=xt;return F&&g(xt)&&(le=a(xt),ce^=1),new y(X,le,ce)}return{seed:Ot,k2sig:$t}}const O={lowS:n.lowS,prehash:!1},D={lowS:n.lowS,prehash:!1};function K(d,p,B=O){const{seed:U,k2sig:P}=C(d,p,B),F=n;return Ie(F.hash.outputLen,F.nByteLength,F.hmac)(U,P)}u.BASE._setWindowSize(8);function it(d,p,B,U=D){var St;const P=d;if(p=G("msgHash",p),B=G("publicKey",B),"strict"in U)throw new Error("options.strict was renamed to lowS");const{lowS:F,prehash:z}=U;let j,st;try{if(typeof P=="string"||P instanceof Uint8Array)try{j=y.fromDER(P)}catch(X){if(!(X instanceof yt.Err))throw X;j=y.fromCompact(P)}else if(typeof P=="object"&&typeof P.r=="bigint"&&typeof P.s=="bigint"){const{r:X,s:xt}=P;j=new y(X,xt)}else throw new Error("PARSE");st=u.fromHex(B)}catch(X){if(X.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(F&&j.hasHighS())return!1;z&&(p=n.hash(p));const{r:ct,s:bt}=j,Ot=S(p),lt=c(bt),$t=i(Ot*lt),dt=i(ct*lt),vt=(St=u.BASE.multiplyAndAddUnsafe(st,$t,dt))==null?void 0:St.toAffine();return vt?i(vt.x)===ct:!1}return{CURVE:n,getPublicKey:x,getSharedSecret:T,sign:K,verify:it,ProjectivePoint:u,Signature:y,utils:v}}var Cn=Object.defineProperty,Ue=(t,n)=>{for(var e in n)Cn(t,e,{get:n[e],enumerable:!0})},Ce={};Ue(Ce,{EmptyArray:()=>ne,arrayToHex:()=>Vt,arrayToUtf8:()=>ee,calculateSharedKey:()=>rr,comparePublicKeyHex:()=>er,compressPublicKeyHex:()=>Xn,doDecrypt:()=>ir,doEncrypt:()=>or,doSignature:()=>sr,doVerifySignature:()=>cr,generateKeyPairHex:()=>te,getHash:()=>re,getPoint:()=>$e,getPublicKeyFromPrivateKey:()=>Ve,getZ:()=>qt,hexToArray:()=>k,initRNGPool:()=>Jt,leftPad:()=>R,precomputePublicKey:()=>lr,utf8ToHex:()=>It,verifyPublicKey:()=>tr});var _t=BigInt(0),Pt=BigInt(1),Ln=BigInt(2);BigInt(3);function Nn(t){let n=t.toString(16);if(n[0]!=="-")n.length%2===1?n="0"+n:n.match(/^[0-7]/)||(n="00"+n);else{n=n.substring(1);let e=n.length;e%2===1?e+=1:n.match(/^[0-7]/)||(e+=2);let o="";for(let l=0;l<e;l++)o+="f";n=((_(o)^t)+Pt).toString(16).replace(/^-/,"")}return n}var Le=class{constructor(t=null,n="00",e="00",o=""){this.tlv=t,this.t=n,this.l=e,this.v=o}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const t=this.v.length/2;let n=t.toString(16);return n.length%2===1&&(n="0"+n),t<128?n:(128+n.length/2).toString(16)+n}getValue(){return""}},we=class extends Le{constructor(t){super(),this.t="02",t&&(this.v=Nn(t))}getValue(){return this.v}},Hn=class extends Le{constructor(n){super();N(this,"t","30");this.asn1Array=n}getValue(){return this.v=this.asn1Array.map(n=>n.getEncodedHex()).join(""),this.v}};function Ne(t,n){return+t[n+2]<8?1:+t.substring(n+2,n+4)&127+1}function ye(t,n){const e=Ne(t,n),o=t.substring(n+2,n+2+e*2);return o?+(+o[0]<8?_(o):_(o.substring(2))).toString():-1}function Dt(t,n){const e=Ne(t,n);return n+(e+1)*2}function _n(t,n){const e=new we(t),o=new we(n);return new Hn([e,o]).getEncodedHex()}function qn(t){const n=Dt(t,0),e=Dt(t,n),o=ye(t,n),r=t.substr(e,o*2),s=e+r.length,l=Dt(t,s),i=ye(t,s),c=t.substring(l,l+i*2),u=_(r),h=_(c);return{r:u,s:h}}var Kt=16384,pt=new Uint8Array(0),Bt;async function Jt(){if("crypto"in globalThis){Bt=globalThis.crypto;return}if(!(pt.length>Kt/2))if("wx"in globalThis&&"getRandomValues"in globalThis.wx)pt=await new Promise(t=>{wx.getRandomValues({length:Kt,success(n){t(new Uint8Array(n.randomValues))}})});else try{globalThis.crypto?Bt=globalThis.crypto:Bt=(await Promise.resolve().then(()=>require("./__vite-browser-external-b3701507.cjs"))).webcrypto;const t=new Uint8Array(Kt);Bt.getRandomValues(t),pt=t}catch{throw new Error("no available csprng, abort.")}}Jt();function Rn(t){if(pt.length>t){const n=pt.slice(0,t);return pt=pt.slice(t),Jt(),n}else throw new Error("random number pool is not ready or insufficient, prevent getting too long random values or too often.")}function Fn(t=0){const n=new Uint8Array(t);return Bt?Bt.getRandomValues(n):Rn(t)}var He=t=>t instanceof Uint8Array,zt=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Vn=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Vn)throw new Error("Non little-endian hardware is not supported");var $n=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function Tt(t){if(!He(t))throw new Error("Uint8Array expected");let n="";for(let e=0;e<t.length;e++)n+=$n[t[e]];return n}function kn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Qt(t){if(typeof t=="string"&&(t=kn(t)),!He(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var _e=class{clone(){return this._cloneInto()}};function Zn(t){const n=o=>t().update(Qt(o)).digest(),e=t();return n.outputLen=e.outputLen,n.blockLen=e.blockLen,n.create=()=>t(),n}var Dn=(t,n,e)=>t&n|t&e|n&e,pe=(t,n,e)=>t^n^e,Kn=(t,n,e)=>t&n|~t&e;function zn(t,n,e,o){if(typeof t.setBigUint64=="function")return t.setBigUint64(n,e,o);const r=BigInt(32),s=BigInt(4294967295),l=Number(e>>r&s),i=Number(e&s),c=o?4:0,u=o?0:4;t.setUint32(n+c,l,o),t.setUint32(n+u,i,o)}function J(t,n){const e=n&31;return t<<e|t>>>32-e}function jn(t){return t^J(t,9)^J(t,17)}function Yn(t){return t^J(t,15)^J(t,23)}var Mn=class extends _e{constructor(n,e,o,r){super();N(this,"buffer");N(this,"view");N(this,"finished",!1);N(this,"length",0);N(this,"pos",0);N(this,"destroyed",!1);this.blockLen=n,this.outputLen=e,this.padOffset=o,this.isLE=r,this.buffer=new Uint8Array(n),this.view=zt(this.buffer)}update(n){const{view:e,buffer:o,blockLen:r}=this;n=Qt(n);const s=n.length;for(let l=0;l<s;){const i=Math.min(r-this.pos,s-l);if(i===r){const c=zt(n);for(;r<=s-l;l+=r)this.process(c,l);continue}o.set(n.subarray(l,l+i),this.pos),this.pos+=i,l+=i,this.pos===r&&(this.process(e,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){this.finished=!0;const{buffer:e,view:o,blockLen:r,isLE:s}=this;let{pos:l}=this;e[l++]=128,this.buffer.subarray(l).fill(0),this.padOffset>r-l&&(this.process(o,0),l=0);for(let f=l;f<r;f++)e[f]=0;zn(o,r-8,BigInt(this.length*8),s),this.process(o,0);const i=zt(n),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,h=this.get();if(u>h.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)i.setUint32(4*f,h[f],s)}digest(){const{buffer:n,outputLen:e}=this;this.digestInto(n);const o=n.slice(0,e);return this.destroy(),o}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:e,buffer:o,length:r,finished:s,destroyed:l,pos:i}=this;return n.length=r,n.pos=i,n.finished=s,n.destroyed=l,r%e&&n.buffer.set(o),n}},ut=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),tt=new Uint32Array(68),me=new Uint32Array(64),Gn=2043430169,Wn=2055708042,Jn=class extends Mn{constructor(){super(64,32,8,!1);N(this,"A",ut[0]|0);N(this,"B",ut[1]|0);N(this,"C",ut[2]|0);N(this,"D",ut[3]|0);N(this,"E",ut[4]|0);N(this,"F",ut[5]|0);N(this,"G",ut[6]|0);N(this,"H",ut[7]|0)}get(){const{A:n,B:e,C:o,D:r,E:s,F:l,G:i,H:c}=this;return[n,e,o,r,s,l,i,c]}set(n,e,o,r,s,l,i,c){this.A=n|0,this.B=e|0,this.C=o|0,this.D=r|0,this.E=s|0,this.F=l|0,this.G=i|0,this.H=c|0}process(n,e){for(let f=0;f<16;f++,e+=4)tt[f]=n.getUint32(e,!1);for(let f=16;f<68;f++)tt[f]=Yn(tt[f-16]^tt[f-9]^J(tt[f-3],15))^J(tt[f-13],7)^tt[f-6];for(let f=0;f<64;f++)me[f]=tt[f]^tt[f+4];let{A:o,B:r,C:s,D:l,E:i,F:c,G:u,H:h}=this;for(let f=0;f<64;f++){let m=f>=0&&f<=15,b=m?Gn:Wn,g=J(J(o,12)+i+J(b,f),7),a=g^J(o,12),w=(m?pe(o,r,s):Dn(o,r,s))+l+a+me[f]|0,y=(m?pe(i,c,u):Kn(i,c,u))+h+g+tt[f]|0;l=s,s=J(r,9),r=o,o=w,h=u,u=J(c,19),c=i,i=jn(y)}o=o^this.A|0,r=r^this.B|0,s=s^this.C|0,l=l^this.D|0,i=i^this.E|0,c=c^this.F|0,u=u^this.G|0,h=h^this.H|0,this.set(o,r,s,l,i,c,u,h)}roundClean(){tt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},nt=Zn(()=>new Jn),qe=class extends _e{constructor(n,e){super();N(this,"oHash");N(this,"iHash");N(this,"blockLen");N(this,"outputLen");N(this,"finished",!1);N(this,"destroyed",!1);const o=Qt(e);if(this.iHash=n.create(),typeof this.iHash.update!="function")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,s=new Uint8Array(r);s.set(o.length>r?n.create().update(o).digest():o);for(let l=0;l<s.length;l++)s[l]^=54;this.iHash.update(s),this.oHash=n.create();for(let l=0;l<s.length;l++)s[l]^=106;this.oHash.update(s),s.fill(0)}update(n){return this.iHash.update(n),this}digestInto(n){this.finished=!0,this.iHash.digestInto(n),this.oHash.update(n),this.oHash.digestInto(n),this.destroy()}digest(){const n=new Uint8Array(this.oHash.outputLen);return this.digestInto(n),n}_cloneInto(n){n||(n=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:o,finished:r,destroyed:s,blockLen:l,outputLen:i}=this;return n=n,n.finished=r,n.destroyed=s,n.blockLen=l,n.outputLen=i,n.oHash=e._cloneInto(n.oHash),n.iHash=o._cloneInto(n.iHash),n}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Xt=(t,n,e)=>new qe(t,n).update(e).digest();Xt.create=(t,n)=>new qe(t,n);var Qn=Oe(BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991999")),L=Un({a:BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991996"),b:BigInt("18505919022281880113072981827955639221458448578012075254857346196103069175443"),Fp:Qn,h:Pt,n:BigInt("115792089210356248756420345214020892766061623724957744567843809356293439045923"),Gx:BigInt("22963146547237050559479531362550074578802567295341616970375194840604139615431"),Gy:BigInt("85132369209828568825618990617112496413088388631904505083283536607588877201568"),hash:nt,hmac:(t,...n)=>Xt(nt,t,Y(...n)),randomBytes:Fn}),et=Oe(BigInt(L.CURVE.n));function te(t){const n=t?Et(Z(BigInt(t),Pt)+Pt,32):L.utils.randomPrivateKey(),e=L.getPublicKey(n,!1),o=R(ot(n),64),r=R(ot(e),64);return{privateKey:o,publicKey:r}}function Xn(t){if(t.length!==130)throw new Error("Invalid public key to compress");const n=(t.length-2)/2,e=t.substring(2,2+n),o=_(t.substring(n+2,n+n+2));let r="03";return Z(o,Ln)===_t&&(r="02"),r+e}function It(t){t=decodeURIComponent(encodeURIComponent(t));const n=t.length,e=new Uint32Array((n>>>2)+1);for(let r=0;r<n;r++)e[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;const o=[];for(let r=0;r<n;r++){const s=e[r>>>2]>>>24-r%4*8&255;o.push((s>>>4).toString(16)),o.push((s&15).toString(16))}return o.join("")}function R(t,n){return t.length>=n?t:new Array(n-t.length+1).join("0")+t}function Vt(t){return t.map(n=>{const e=n.toString(16);return e.length===1?"0"+e:e}).join("")}function ee(t){const n=[];for(let e=0,o=t.length;e<o;e++)t[e]>=240&&t[e]<=247?(n.push(String.fromCodePoint(((t[e]&7)<<18)+((t[e+1]&63)<<12)+((t[e+2]&63)<<6)+(t[e+3]&63))),e+=3):t[e]>=224&&t[e]<=239?(n.push(String.fromCodePoint(((t[e]&15)<<12)+((t[e+1]&63)<<6)+(t[e+2]&63))),e+=2):t[e]>=192&&t[e]<=223?(n.push(String.fromCodePoint(((t[e]&31)<<6)+(t[e+1]&63))),e++):n.push(String.fromCodePoint(t[e]));return n.join("")}function k(t){let n=t.length;n%2!==0&&(t=R(t,n+1)),n=t.length;const e=n/2,o=new Uint8Array(e);for(let r=0;r<e;r++)o[r]=parseInt(t.substring(r*2,r*2+2),16);return o}function tr(t){const n=L.ProjectivePoint.fromHex(t);if(!n)return!1;try{return n.assertValidity(),!0}catch{return!1}}function er(t,n){const e=L.ProjectivePoint.fromHex(t);if(!e)return!1;const o=L.ProjectivePoint.fromHex(n);return o?e.equals(o):!1}var Ee=_("80000000000000000000000000000000"),be=_("7fffffffffffffffffffffffffffffff");function nr(t,n){let e=new Uint8Array(n),o=1,r=0,s=ne;const l=new Uint8Array(4),i=()=>{l[0]=o>>24&255,l[1]=o>>16&255,l[2]=o>>8&255,l[3]=o&255,s=nt(Y(t,l)),o++,r=0};i();for(let c=0,u=e.length;c<u;c++)r===s.length&&i(),e[c]=s[r++]&255;return e}function rr(t,n,e,o,r,s=!1,l="1234567812345678",i="1234567812345678"){const c=L.ProjectivePoint.fromHex(n.publicKey),u=L.ProjectivePoint.fromHex(o),h=L.ProjectivePoint.fromHex(e);let f=qt(t.publicKey,l),m=qt(e,i);s&&([f,m]=[m,f]);const b=_(n.privateKey),g=_(t.privateKey),a=c.x,w=Ee+(a&be),y=et.add(g,et.mulN(w,b)),v=u.x,x=et.add(Ee,v&be),I=u.multiply(x).add(h).multiply(y),T=k(R($(I.x),64)),E=k(R($(I.y),64));return nr(Y(T,E,f,m),r)}var Re=0,ne=new Uint8Array;function or(t,n,e=1){const o=typeof t=="string"?k(It(t)):Uint8Array.from(t),r=typeof n=="string"?L.ProjectivePoint.fromHex(n):n,s=te(),l=_(s.privateKey);let i=s.publicKey;i.length>128&&(i=i.substring(i.length-128));const c=r.multiply(l),u=k(R($(c.x),64)),h=k(R($(c.y),64)),f=Tt(nt(Y(u,o,h)));Fe(u,h,o);const m=Tt(o);return e===Re?i+m+f:i+f+m}function Fe(t,n,e){let o=1,r=0,s=ne;const l=new Uint8Array(4),i=()=>{l[0]=o>>24&255,l[1]=o>>16&255,l[2]=o>>8&255,l[3]=o&255,s=nt(Y(t,n,l)),o++,r=0};i();for(let c=0,u=e.length;c<u;c++)r===s.length&&i(),e[c]^=s[r++]&255}function ir(t,n,e=1,{output:o="string"}={}){const r=_(n);let s=t.substring(128,128+64),l=t.substring(128+64);e===Re&&(s=t.substring(t.length-64),l=t.substring(128,t.length-64));const i=k(l),u=L.ProjectivePoint.fromHex("04"+t.substring(0,128)).multiply(r),h=k(R($(u.x),64)),f=k(R($(u.y),64));return Fe(h,f,i),Vt(Array.from(nt(Y(h,i,f))))===s.toLowerCase()?o==="array"?i:ee(i):o==="array"?[]:""}function sr(t,n,e={}){let{pointPool:o,der:r,hash:s,publicKey:l,userId:i}=e,c=typeof t=="string"?It(t):Vt(Array.from(t));s&&(l=l||Ve(n),c=re(c,l,i));const u=_(n),h=_(c);let f=null,m=null,b=null;do{do{let g;o&&o.length?g=o.pop():g=$e(),f=g.k,m=et.add(h,g.x1)}while(m===_t||m+f===L.CURVE.n);b=et.mul(et.inv(et.addN(u,Pt)),et.subN(f,et.mulN(m,u)))}while(b===_t);return r?_n(m,b):R($(m),64)+R($(b),64)}function cr(t,n,e,o={}){let r;const{hash:s,der:l,userId:i}=o,c=typeof e=="string"?e:e.toHex(!1);s?r=re(typeof t=="string"?It(t):t,c,i):r=typeof t=="string"?It(t):Vt(Array.from(t));let u,h;if(l){const w=qn(n);u=w.r,h=w.s}else u=_(n.substring(0,64)),h=_(n.substring(64));const f=typeof e=="string"?L.ProjectivePoint.fromHex(e):e,m=_(r),b=et.add(u,h);if(b===_t)return!1;const g=L.ProjectivePoint.BASE.multiply(h).add(f.multiply(b)),a=et.add(m,g.x);return u===a}function qt(t,n="1234567812345678"){n=It(n);const e=R($(L.CURVE.a),64),o=R($(L.CURVE.b),64),r=R($(L.ProjectivePoint.BASE.x),64),s=R($(L.ProjectivePoint.BASE.y),64);let l,i;if(t.length===128)l=t.substring(0,64),i=t.substring(64,128);else{const f=L.ProjectivePoint.fromHex(t);l=R($(f.x),64),i=R($(f.y),64)}const c=k(n+e+o+r+s+l+i),u=n.length*4;return nt(Y(new Uint8Array([u>>8&255,u&255]),c))}function re(t,n,e="1234567812345678"){const o=qt(n,e);return Tt(nt(Y(o,typeof t=="string"?k(t):t)))}function lr(t,n){const e=L.ProjectivePoint.fromHex(t);return L.utils.precompute(n,e)}function Ve(t){const n=L.getPublicKey(t,!1);return R(ot(n),64)}function $e(){const t=te(),n=L.ProjectivePoint.fromHex(t.publicKey),e=_(t.privateKey);return{...t,k:e,x1:n.x}}function ke(t){const n=[];for(let e=0,o=t.length;e<o;e++){const r=t.codePointAt(e);if(r<=127)n.push(r);else if(r<=2047)n.push(192|r>>>6),n.push(128|r&63);else if(r<=55295||r>=57344&&r<=65535)n.push(224|r>>>12),n.push(128|r>>>6&63),n.push(128|r&63);else if(r>=65536&&r<=1114111)e++,n.push(240|r>>>18&28),n.push(128|r>>>12&63),n.push(128|r>>>6&63),n.push(128|r&63);else throw n.push(r),new Error("input is not supported")}return new Uint8Array(n)}function ur(t,n){if(t=typeof t=="string"?ke(t):t,n){if((n.mode||"hmac")!=="hmac")throw new Error("invalid mode");let o=n.key;if(!o)throw new Error("invalid key");return o=typeof o=="string"?k(o):o,Tt(Xt(nt,o,t))}return Tt(nt(t))}var oe={};Ue(oe,{decrypt:()=>gr,encrypt:()=>dr,sm4:()=>ie});var ft=0,fr=32,gt=16,Ct=Uint8Array.from([214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72]),Lt=new Uint32Array([462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257]);function ht(t){return(Ct[t>>>24&255]&255)<<24|(Ct[t>>>16&255]&255)<<16|(Ct[t>>>8&255]&255)<<8|Ct[t&255]&255}function ar(t,n,e){let o=0,r=0,s=0,l=0,i=0,c=0,u=0,h=0;i=t[0]&255,c=t[1]&255,u=t[2]&255,h=t[3]&255,o=i<<24|c<<16|u<<8|h,i=t[4]&255,c=t[5]&255,u=t[6]&255,h=t[7]&255,r=i<<24|c<<16|u<<8|h,i=t[8]&255,c=t[9]&255,u=t[10]&255,h=t[11]&255,s=i<<24|c<<16|u<<8|h,i=t[12]&255,c=t[13]&255,u=t[14]&255,h=t[15]&255,l=i<<24|c<<16|u<<8|h;for(let f=0;f<32;f+=4)i=r^s^l^e[f],i=ht(i),o^=i^(i<<2|i>>>30)^(i<<10|i>>>22)^(i<<18|i>>>14)^(i<<24|i>>>8),c=s^l^o^e[f+1],c=ht(c),r^=c^(c<<2|c>>>30)^(c<<10|c>>>22)^(c<<18|c>>>14)^(c<<24|c>>>8),u=l^o^r^e[f+2],u=ht(u),s^=u^(u<<2|u>>>30)^(u<<10|u>>>22)^(u<<18|u>>>14)^(u<<24|u>>>8),h=o^r^s^e[f+3],h=ht(h),l^=h^(h<<2|h>>>30)^(h<<10|h>>>22)^(h<<18|h>>>14)^(h<<24|h>>>8);n[0]=l>>>24&255,n[1]=l>>>16&255,n[2]=l>>>8&255,n[3]=l&255,n[4]=s>>>24&255,n[5]=s>>>16&255,n[6]=s>>>8&255,n[7]=s&255,n[8]=r>>>24&255,n[9]=r>>>16&255,n[10]=r>>>8&255,n[11]=r&255,n[12]=o>>>24&255,n[13]=o>>>16&255,n[14]=o>>>8&255,n[15]=o&255}function hr(t,n,e){let o=0,r=0,s=0,l=0,i=0;o=(t[0]&255)<<24|(t[1]&255)<<16|(t[2]&255)<<8|t[3]&255,r=(t[4]&255)<<24|(t[5]&255)<<16|(t[6]&255)<<8|t[7]&255,s=(t[8]&255)<<24|(t[9]&255)<<16|(t[10]&255)<<8|t[11]&255,l=(t[12]&255)<<24|(t[13]&255)<<16|(t[14]&255)<<8|t[15]&255,o^=2746333894,r^=1453994832,s^=1736282519,l^=2993693404;for(let c=0;c<32;c+=4)i=r^s^l^Lt[c+0],i=ht(i),o^=i^(i<<13|i>>>19)^(i<<23|i>>>9),n[c+0]=o,i=s^l^o^Lt[c+1],i=ht(i),r^=i^(i<<13|i>>>19)^(i<<23|i>>>9),n[c+1]=r,i=l^o^r^Lt[c+2],i=ht(i),s^=i^(i<<13|i>>>19)^(i<<23|i>>>9),n[c+2]=s,i=o^r^s^Lt[c+3],i=ht(i),l^=i^(i<<13|i>>>19)^(i<<23|i>>>9),n[c+3]=l;if(e===ft)for(let c=0;c<16;c++)[n[c],n[31-c]]=[n[31-c],n[c]]}var Nt=new Uint8Array(16);function ie(t,n,e,o={}){let{padding:r="pkcs#7",mode:s,iv:l=new Uint8Array(16),output:i}=o;if(s==="cbc"&&(typeof l=="string"&&(l=k(l)),l.length!==128/8))throw new Error("iv is invalid");if(typeof n=="string"&&(n=k(n)),n.length!==128/8)throw new Error("key is invalid");if(typeof t=="string"?e!==ft?t=ke(t):t=k(t):t=Uint8Array.from(t),(r==="pkcs#5"||r==="pkcs#7")&&e!==ft){const b=gt-t.length%gt,g=new Uint8Array(t.length+b);g.set(t,0);for(let a=0;a<b;a++)g[t.length+a]=b;t=g}const c=new Uint32Array(fr);hr(n,c,e);let u=new Uint8Array(t.length),h=l,f=t.length,m=0;for(;f>=gt;){const b=t.subarray(m,m+16);if(s==="cbc")for(let g=0;g<gt;g++)e!==ft&&(b[g]^=h[g]);ar(b,Nt,c);for(let g=0;g<gt;g++)s==="cbc"&&e===ft&&(Nt[g]^=h[g]),u[m+g]=Nt[g];s==="cbc"&&(e!==ft?h=Nt:h=b),f-=gt,m+=gt}if((r==="pkcs#5"||r==="pkcs#7")&&e===ft){const b=u.length,g=u[b-1];for(let a=1;a<=g;a++)if(u[b-a]!==g)throw new Error("padding is invalid");u=u.slice(0,b-g)}return i!=="array"?e!==ft?Tt(u):ee(u):u}function dr(t,n,e={}){return ie(t,n,1,e)}function gr(t,n,e={}){return ie(t,n,0,e)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function wr(t,n,e){return Ce.doEncrypt(t,n,e)}function yr(t,n){return ur(t,n)}function pr(t,n,e){return oe.encrypt(t,n,e)}function mr(t,n,e){return oe.encrypt(t,n,e)}exports.STATUS=at;exports._configStatus=Ke;exports.useCache=Qe;exports.useFetch=ze;exports.useFindLabelsFromPath=ve;exports.useFindOptionByValue=Se;exports.useFindParentLabels=Ge;exports.useFindParentValues=We;exports.useFindPropertyRecursive=xe;exports.useFindTextsFromPath=Me;exports.useFindTextsInValues=Ye;exports.useFormFail=en;exports.useFormFormat=nn;exports.useHiddenForm=Xe;exports.useProcessStatus=Be;exports.useProcessStatusSuccess=tn;exports.useSm2Encrypt=wr;exports.useSm3=yr;exports.useSm4Decrypt=mr;exports.useSm4Encrypt=pr;exports.useTextFromOptionsValue=je; //# sourceMappingURL=cipher-98df1050.cjs.map