jobsys-explore 4.2.2 → 4.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "jobsys-explore": patch
3
+ ---
4
+
5
+ useFormFormat
@@ -0,0 +1,5 @@
1
+ ---
2
+ "jobsys-explore": patch
3
+ ---
4
+
5
+ rate default null
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # jobsys-explore
2
2
 
3
+ ## 4.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - d
8
+ - useFormFormat
9
+ - rate default null
10
+ - use Dayjs
11
+
12
+ ## 4.2.3
13
+
14
+ ### Patch Changes
15
+
16
+ - d
17
+ - useFormFormat
18
+ - use Dayjs
19
+
3
20
  ## 4.2.2
4
21
 
5
22
  ### Patch Changes
@@ -284,6 +284,13 @@ export default defineComponent({
284
284
  let form = cloneDeep(state.submitForm)
285
285
 
286
286
  formItems.value
287
+ .map((item) => {
288
+ if (item.match) {
289
+ // match 的属性需要在这里处理
290
+ return { ...item, ...item.match(form) }
291
+ }
292
+ return item
293
+ })
287
294
  .filter((item) => item.beforeSubmit && isFunction(item.beforeSubmit))
288
295
  .forEach((item) => {
289
296
  form[item.key] = item.beforeSubmit({
@@ -13,7 +13,7 @@ export default defineComponent({
13
13
  props: {
14
14
  ...defaultFieldProps,
15
15
 
16
- modelValue: { type: [Number, String], default: 1 },
16
+ modelValue: { type: [Number, String], default: null },
17
17
  },
18
18
  emits: ["update:modelValue"],
19
19
  setup(props, { emit, slots }) {
@@ -26,6 +26,7 @@ export default defineComponent({
26
26
  )
27
27
 
28
28
  const options = ref([])
29
+
29
30
  useOptionTrait(options, props)
30
31
 
31
32
  const onChange = (value) => {
@@ -13,7 +13,7 @@ export default defineComponent({
13
13
  props: {
14
14
  ...defaultFieldProps,
15
15
 
16
- modelValue: { type: Number, default: 2 },
16
+ modelValue: { type: Number, default: null },
17
17
  },
18
18
  emits: ["update:modelValue"],
19
19
  setup(props, { emit, slots }) {
@@ -54,7 +54,7 @@ export default defineComponent({
54
54
  )
55
55
 
56
56
  const displayText = computed(() => {
57
- if (props.modelValue.length === 0) {
57
+ if (!props.modelValue?.length) {
58
58
  return ""
59
59
  }
60
60
  let modelValue = isArray(props.modelValue) ? props.modelValue : [props.modelValue]
@@ -25,7 +25,7 @@ const initItemDefaultValue = (item, existingData, submitForm, provider) => {
25
25
  }
26
26
 
27
27
  if (item.type === "number" || item.type === "rate") {
28
- value = value ? Number(value) : 0
28
+ value = value ? Number(value) : null
29
29
  } else if (item.type === "slider") {
30
30
  value = item.defaultProps && item.defaultProps.range ? value || [0, 100] : value ? Number(value) : 0
31
31
  } else if (item.type === "switch") {
package/dist/hooks.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-0f6611de.cjs"),r=require("dayjs"),i=require("lodash-es");require("axios");require("vant");function o(e,u,n){return s.sm2_exports.doEncrypt(e,u,n)}function c(e,u){return s.sm32(e,u)}function F(e,u,n){return s.sm4_exports.encrypt(e,u,n)}function a(e,u,n){return s.sm4_exports.encrypt(e,u,n)}function m(e,u){return(/^\d+$/.test(e)||/^-\d+$/.test(e))&&String(e).length<=10&&(e=parseInt(e+"000")),u?r(e,u):r(e)}function t(e,u){return e?(r.isDayjs(e)||(e=r(e)),e.format(u||"YYYY-MM-DD HH:mm")):""}function S(e){return e?(r.isDayjs(e)||(e=r(e)),e.unix()):""}function y(e,u){return e&&i.isString(e)&&(e=parseInt(e)),e<9999999999&&(e*=1e3),t(new Date(e),u)}exports.STATUS=s.STATUS;exports._configStatus=s._configStatus;exports.useCache=s.useCache;exports.useFetch=s.useFetch;exports.useFindLabelsFromPath=s.useFindLabelsFromPath;exports.useFindOptionByValue=s.useFindOptionByValue;exports.useFindParentValues=s.useFindParentValues;exports.useFindPropertyRecursive=s.useFindPropertyRecursive;exports.useFindTextsFromPath=s.useFindTextsFromPath;exports.useFindTextsInValues=s.useFindTextsInValues;exports.useFormFail=s.useFormFail;exports.useFormFormat=s.useFormFormat;exports.useHiddenForm=s.useHiddenForm;exports.useProcessStatus=s.useProcessStatus;exports.useProcessStatusSuccess=s.useProcessStatusSuccess;exports.useTextFromOptionsValue=s.useTextFromOptionsValue;exports.useDateFormat=t;exports.useDateUnix=S;exports.useDayjs=m;exports.useSm2Encrypt=o;exports.useSm3=c;exports.useSm4Decrypt=a;exports.useSm4Encrypt=F;exports.useTimestampFormat=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-0de12d0f.cjs"),r=require("dayjs"),i=require("lodash-es");require("axios");require("vant");function o(e,u,n){return s.sm2_exports.doEncrypt(e,u,n)}function c(e,u){return s.sm32(e,u)}function F(e,u,n){return s.sm4_exports.encrypt(e,u,n)}function a(e,u,n){return s.sm4_exports.encrypt(e,u,n)}function m(e,u){return(/^\d+$/.test(e)||/^-\d+$/.test(e))&&String(e).length<=10&&(e=parseInt(e+"000")),u?r(e,u):r(e)}function t(e,u){return e?(r.isDayjs(e)||(e=r(e)),e.format(u||"YYYY-MM-DD HH:mm")):""}function S(e){return e?(r.isDayjs(e)||(e=r(e)),e.unix()):""}function y(e,u){return e&&i.isString(e)&&(e=parseInt(e)),e<9999999999&&(e*=1e3),t(new Date(e),u)}exports.STATUS=s.STATUS;exports._configStatus=s._configStatus;exports.useCache=s.useCache;exports.useFetch=s.useFetch;exports.useFindLabelsFromPath=s.useFindLabelsFromPath;exports.useFindOptionByValue=s.useFindOptionByValue;exports.useFindParentValues=s.useFindParentValues;exports.useFindPropertyRecursive=s.useFindPropertyRecursive;exports.useFindTextsFromPath=s.useFindTextsFromPath;exports.useFindTextsInValues=s.useFindTextsInValues;exports.useFormFail=s.useFormFail;exports.useFormFormat=s.useFormFormat;exports.useHiddenForm=s.useHiddenForm;exports.useProcessStatus=s.useProcessStatus;exports.useProcessStatusSuccess=s.useProcessStatusSuccess;exports.useTextFromOptionsValue=s.useTextFromOptionsValue;exports.useDateFormat=t;exports.useDateUnix=S;exports.useDayjs=m;exports.useSm2Encrypt=o;exports.useSm3=c;exports.useSm4Decrypt=a;exports.useSm4Encrypt=F;exports.useTimestampFormat=y;
2
2
  //# sourceMappingURL=hooks.cjs.map
package/dist/hooks.js CHANGED
@@ -1,5 +1,5 @@
1
- import { s as t, f as o, g as e } from "./index-817bd90a.js";
2
- import { S as j, _ as V, u as Y, a as _, j as E, k as H, m as I, l as b, b as M, i as O, e as U, d as $, n as k, o as v, c as w, h as A } from "./index-817bd90a.js";
1
+ import { s as t, f as o, g as e } from "./index-5ac7f514.js";
2
+ import { S as j, _ as V, u as Y, a as _, j as E, k as H, m as I, l as b, b as M, i as O, e as U, d as $, n as k, o as v, c as w, h as A } from "./index-5ac7f514.js";
3
3
  import n from "dayjs";
4
4
  import { isString as i } from "lodash-es";
5
5
  import "axios";
@@ -0,0 +1,2 @@
1
+ "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 H=(t,n,e)=>(De(t,typeof n!="symbol"?n+"":n,e),e);const L=require("lodash-es"),ce=require("axios"),X=require("vant"),le=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,c)=>{ce.get(e,o).then(l=>{r(l)}).catch(l=>{c(l)}).finally(()=>{n&&(X.allowMultipleToast(!1),n.close()),t.loading=!1})})},post(e,o,r){return new Promise((c,l)=>{ce.post(e,o,r).then(s=>{c(s)}).catch(s=>{l(s)}).finally(()=>{n&&(X.allowMultipleToast(!1),n.close()),t.loading=!1})})},loading(e){return X.closeToast(!0),X.allowMultipleToast(),L.isString(e)?n=X.showLoadingToast({message:e||"加载中...",duration:0,forbidClick:!0}):L.isObject(e)?n=X.showLoadingToast({duration:0,...e}):n=X.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(c){var l;n.includes(c[e.value])&&o.push(c[e.label]),(l=c[e.children])!=null&&l.length&&c[e.children].forEach(s=>{r(s)})}return t.forEach(c=>{r(c)}),o}function be(t,n,e){e=e||{value:"value",label:"text",children:"children"};let o=[];return L.reduce(n,(r,c)=>{const l=L.find(r,{[e.value]:c});if(l)return o.push(l[e.label]),l[e.children]},t),o}function ve(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=ve(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"},be(t,n,e)}function xe(t,n,e){return L.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(c,l,s){for(const i of c)if(i[e.value]===l){s.unshift(i[e.value]);break}else if(i[e.children]&&r(i[e.children],l,s).length>0){s.unshift(i[e.value]);break}return s}return r(t,n,o)}const ue={},We={setItem(t,n){ue[t]=n},getItem(t){return ue[t]}};function Qe(t,n){const e=n||We;return{get(o){const r=e.getItem(t);return L.isUndefined(r)?o:L.cloneDeep(r)},set(o){e.setItem(t,L.cloneDeep(o))}}}function Xe(t){const{url:n,data:e,csrfToken:o}=t;let{method:r}=t;r=r||"post";const c=document.createElement("form");if(c.action=n,c.method=r,c.target="_blank",c.style.display="none",Object.keys(e).forEach(l=>{const s=document.createElement("input");s.type="hidden",s.name=l,s.value=e[l],c.appendChild(s)}),!o){const l=document.createElement("input");l.type="hidden",l.name="_token",l.value=document.querySelector('meta[name="csrf-token"]').getAttribute("content"),c.appendChild(l)}return document.body.appendChild(c),c}function Se(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 c={[at.STATE_CODE_SUCCESS]:"success"},l=n[e]||n[c[e]]||r[e]||r.default;L.isString(l)?e===at.STATE_CODE_SUCCESS?X.showSuccessToast(l):X.showFailToast(o||l):L.isFunction(l)&&l()}function Je(t,n){Se(t,{success:n})}function tn(t){t&&t.errorFields?t.errorFields.forEach(n=>{X.showFailToast(n.errors.join(" "))}):t&&t.response?X.showFailToast("网络异常"):X.showFailToast("请检查填写项")}function en(t,n){const e=L.cloneDeep(t);n=n||{};const o=(r,c)=>{var l,s;for(let i in r){let u;if(le.isDayjs(r[i])?u=r[i]:L.isDate(r[i])&&(u=le(r[i])),u&&n.date){L.isString(n.date)?r[i]=u.format(n.date):L.isFunction(n.date)?r[i]=n.date(u):r[i]=r[i].unix();continue}if(L.isBoolean(r[i])&&n.boolean){n.boolean===!0?r[i]=r[i]?1:0:Array.isArray(n.boolean)&&(r[i]=r[i]?((l=n.boolean)==null?void 0:l[0])||1:((s=n.boolean)==null?void 0:s[1])||0);continue}if(n.attachment){const a=n.attachment;if(L.isObject(r[i])&&L.isString(a)&&!L.isUndefined(r[i][a])){r[i]=r[i][a];continue}else if(c&&L.isString(r[i])&&L.isString(a)&&a===i){r=r[a];continue}else if(L.isObject(r[i])&&L.isFunction(a)){r[i]=a(r[i]);continue}}if(L.isArray(r[i]))for(let a in r[i])r[i][a]=o(r[i][a],!0)}return r};return o(e)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Be=BigInt(0),qt=BigInt(1),nn=BigInt(2),Rt=t=>t instanceof Uint8Array,rn=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function ot(t){if(!Rt(t))throw new Error("Uint8Array expected");let n="";for(let e=0;e<t.length;e++)n+=rn[t[e]];return n}function $(t){const n=t.toString(16);return n.length&1?`0${n}`:n}function q(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,c=t.slice(r,r+2),l=Number.parseInt(c,16);if(Number.isNaN(l)||l<0)throw new Error("Invalid byte sequence");e[o]=l}return e}function mt(t){return q(ot(t))}function Yt(t){if(!Rt(t))throw new Error("Uint8Array expected");return q(ot(Uint8Array.from(t).reverse()))}function Et(t,n){return At(t.toString(16).padStart(n*2,"0"))}function Ae(t,n){return Et(t,n).reverse()}function on(t){return At($(t))}function G(t,n,e){let o;if(typeof n=="string")try{o=At(n)}catch(c){throw new Error(`${t} must be valid hex string, got "${n}". Cause: ${c}`)}else if(Rt(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(!Rt(o))throw new Error("Uint8Array expected");n.set(o,e),e+=o.length}),n}function sn(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 cn(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ln(t){let n;for(n=0;t>Be;t>>=qt,n+=1);return n}function un(t,n){return t>>BigInt(n)&qt}const fn=(t,n,e)=>t|(e?qt:Be)<<BigInt(n),Mt=t=>(nn<<BigInt(t-1))-qt,$t=t=>new Uint8Array(t),fe=t=>Uint8Array.from(t);function Te(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=$t(t),r=$t(t),c=0;const l=()=>{o.fill(1),r.fill(0),c=0},s=(...f)=>e(r,o,...f),i=(f=$t())=>{r=s(fe([0]),f),o=s(),f.length!==0&&(r=s(fe([1]),f),o=s())},u=()=>{if(c++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const m=[];for(;f<n;){o=s();const b=o.slice();m.push(b),f+=o.length}return Y(...m)};return(f,m)=>{l(),i(f);let b;for(;!(b=m(u()));)i();return l(),b}}const an={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,c,l)=>{const s=an[c];if(typeof s!="function")throw new Error(`Invalid validator "${c}", expected function`);const i=t[r];if(!(l&&i===void 0)&&!s(i,t))throw new Error(`Invalid param ${String(r)}=${i} (${typeof i}), expected ${c}`)};for(const[r,c]of Object.entries(n))o(r,c,!1);for(const[r,c]of Object.entries(e))o(r,c,!0);return t}const hn=Object.freeze(Object.defineProperty({__proto__:null,bitGet:un,bitLen:ln,bitMask:Mt,bitSet:fn,bytesToHex:ot,bytesToNumberBE:mt,bytesToNumberLE:Yt,concatBytes:Y,createHmacDrbg:Te,ensureBytes:G,equalBytes:sn,hexToBytes:At,hexToNumber:q,numberToBytesBE:Et,numberToBytesLE:Ae,numberToHexUnpadded:$,numberToVarBytesBE:on,utf8ToBytes:cn,validateObject:Ut},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const F=BigInt(0),_=BigInt(1),wt=BigInt(2),dn=BigInt(3),zt=BigInt(4),ae=BigInt(5),he=BigInt(8);BigInt(9);BigInt(16);function Z(t,n){const e=t%n;return e>=F?e:n+e}function gn(t,n,e){if(e<=F||n<F)throw new Error("Expected power/modulo > 0");if(e===_)return F;let o=_;for(;n>F;)n&_&&(o=o*t%e),t=t*t%e,n>>=_;return o}function jt(t,n){if(t===F||n<=F)throw new Error(`invert: expected positive integers, got n=${t} mod=${n}`);let e=Z(t,n),o=n,r=F,c=_;for(;e!==F;){const s=o/e,i=o%e,u=r-c*s;o=e,e=i,r=c,c=u}if(o!==_)throw new Error("invert: does not exist");return Z(r,n)}function wn(t){const n=(t-_)/wt;let e,o,r;for(e=t-_,o=0;e%wt===F;e/=wt,o++);for(r=wt;r<t&&gn(r,n,t)!==t-_;r++);if(o===1){const l=(t+_)/zt;return function(i,u){const a=i.pow(u,l);if(!i.eql(i.sqr(a),u))throw new Error("Cannot find square root");return a}}const c=(e+_)/wt;return function(s,i){if(s.pow(i,n)===s.neg(s.ONE))throw new Error("Cannot find square root");let u=o,a=s.pow(s.mul(s.ONE,r),e),f=s.pow(i,c),m=s.pow(i,e);for(;!s.eql(m,s.ONE);){if(s.eql(m,s.ZERO))return s.ZERO;let b=1;for(let h=s.sqr(m);b<u&&!s.eql(h,s.ONE);b++)h=s.sqr(h);const g=s.pow(a,_<<BigInt(u-b-1));a=s.sqr(g),f=s.mul(f,g),m=s.mul(m,a),u=b}return f}}function yn(t){if(t%zt===dn){const n=(t+_)/zt;return function(o,r){const c=o.pow(r,n);if(!o.eql(o.sqr(c),r))throw new Error("Cannot find square root");return c}}if(t%he===ae){const n=(t-ae)/he;return function(o,r){const c=o.mul(r,wt),l=o.pow(c,n),s=o.mul(r,l),i=o.mul(o.mul(s,wt),l),u=o.mul(s,o.sub(i,o.ONE));if(!o.eql(o.sqr(u),r))throw new Error("Cannot find square root");return u}}return wn(t)}const pn=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function mn(t){const n={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=pn.reduce((o,r)=>(o[r]="function",o),n);return Ut(t,e)}function En(t,n,e){if(e<F)throw new Error("Expected power > 0");if(e===F)return t.ONE;if(e===_)return n;let o=t.ONE,r=n;for(;e>F;)e&_&&(o=t.mul(o,r)),r=t.sqr(r),e>>=_;return o}function bn(t,n){const e=new Array(n.length),o=n.reduce((c,l,s)=>t.is0(l)?c:(e[s]=c,t.mul(c,l)),t.ONE),r=t.inv(o);return n.reduceRight((c,l,s)=>t.is0(l)?c:(e[s]=t.mul(c,e[s]),t.mul(c,l)),r),e}function Gt(t,n){const e=n!==void 0?n:t.toString(2).length,o=Math.ceil(e/8);return{nBitLength:e,nByteLength:o}}function Ie(t,n,e=!1,o={}){if(t<=F)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:r,nByteLength:c}=Gt(t,n);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const l=yn(t),s=Object.freeze({ORDER:t,BITS:r,BYTES:c,MASK:Mt(r),ZERO:F,ONE:_,create:i=>Z(i,t),isValid:i=>{if(typeof i!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof i}`);return F<=i&&i<t},is0:i=>i===F,isOdd:i=>(i&_)===_,neg:i=>Z(-i,t),eql:(i,u)=>i===u,sqr:i=>Z(i*i,t),add:(i,u)=>Z(i+u,t),sub:(i,u)=>Z(i-u,t),mul:(i,u)=>Z(i*u,t),pow:(i,u)=>En(s,i,u),div:(i,u)=>Z(i*jt(u,t),t),sqrN:i=>i*i,addN:(i,u)=>i+u,subN:(i,u)=>i-u,mulN:(i,u)=>i*u,inv:i=>jt(i,t),sqrt:o.sqrt||(i=>l(s,i)),invertBatch:i=>bn(s,i),cmov:(i,u,a)=>a?u:i,toBytes:i=>e?Ae(i,c):Et(i,c),fromBytes:i=>{if(i.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${i.length}`);return e?Yt(i):mt(i)}});return Object.freeze(s)}function vn(t,n,e=!1){t=G("privateHash",t);const o=t.length,r=Gt(n).nByteLength+8;if(r<24||o<r||o>1024)throw new Error(`hashToPrivateScalar: expected ${r}-1024 bytes of input, got ${o}`);const c=e?Yt(t):mt(t);return Z(c,n-_)+_}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const xn=BigInt(0),kt=BigInt(1);function Sn(t,n){const e=(r,c)=>{const l=c.negate();return r?l:c},o=r=>{const c=Math.ceil(n/r)+1,l=2**(r-1);return{windows:c,windowSize:l}};return{constTimeNegate:e,unsafeLadder(r,c){let l=t.ZERO,s=r;for(;c>xn;)c&kt&&(l=l.add(s)),s=s.double(),c>>=kt;return l},precomputeWindow(r,c){const{windows:l,windowSize:s}=o(c),i=[];let u=r,a=u;for(let f=0;f<l;f++){a=u,i.push(a);for(let m=1;m<s;m++)a=a.add(u),i.push(a);u=a.double()}return i},wNAF(r,c,l){const{windows:s,windowSize:i}=o(r);let u=t.ZERO,a=t.BASE;const f=BigInt(2**r-1),m=2**r,b=BigInt(r);for(let g=0;g<s;g++){const h=g*i;let w=Number(l&f);l>>=b,w>i&&(w-=m,l+=kt);const y=h,v=h+Math.abs(w)-1,S=g%2!==0,I=w<0;w===0?a=a.add(e(S,c[y])):u=u.add(e(I,c[v]))}return{p:u,f:a}},wNAFCached(r,c,l,s){const i=r._WINDOW_SIZE||1;let u=c.get(r);return u||(u=this.precomputeWindow(r,i),i!==1&&c.set(r,s(u))),this.wNAF(i,u,l)}}}function Oe(t){return mn(t.Fp),Ut(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Gt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Bn(t){const n=Oe(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:An,hexToBytes:Tn}=hn,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:An(o),l:t.subarray(e+2)}},toSig(t){const{Err:n}=yt,e=typeof t=="string"?Tn(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:c}=yt._parseInt(e.subarray(2)),{d:l,l:s}=yt._parseInt(c);if(s.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 a=u.toString(16);return a.length&1?`0${a}`:a},o=n(e(t.s)),r=n(e(t.r)),c=o.length/2,l=r.length/2,s=e(c),i=e(l);return`30${e(l+c+4)}02${i}${r}02${s}${o}`}},rt=BigInt(0),W=BigInt(1);BigInt(2);const de=BigInt(3);BigInt(4);function In(t){const n=Bn(t),{Fp:e}=n,o=n.toBytes||((g,h,w)=>{const y=h.toAffine();return Y(Uint8Array.from([4]),e.toBytes(y.x),e.toBytes(y.y))}),r=n.fromBytes||(g=>{const h=g.subarray(1),w=e.fromBytes(h.subarray(0,e.BYTES)),y=e.fromBytes(h.subarray(e.BYTES,2*e.BYTES));return{x:w,y}});function c(g){const{a:h,b:w}=n,y=e.sqr(g),v=e.mul(y,g);return e.add(e.add(v,e.mul(g,h)),w)}if(!e.eql(e.sqr(n.Gy),c(n.Gx)))throw new Error("bad generator point: equation left != right");function l(g){return typeof g=="bigint"&&rt<g&&g<n.n}function s(g){if(!l(g))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function i(g){const{allowedPrivateKeyLengths:h,nByteLength:w,wrapPrivateKey:y,n:v}=n;if(h&&typeof g!="bigint"){if(g instanceof Uint8Array&&(g=ot(g)),typeof g!="string"||!h.includes(g.length))throw new Error("Invalid key");g=g.padStart(w*2,"0")}let S;try{S=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&&(S=Z(S,v)),s(S),S}const u=new Map;function a(g){if(!(g instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(h,w,y){if(this.px=h,this.py=w,this.pz=y,h==null||!e.isValid(h))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(h){const{x:w,y}=h||{};if(!h||!e.isValid(w)||!e.isValid(y))throw new Error("invalid affine point");if(h instanceof f)throw new Error("projective point not allowed");const v=S=>e.eql(S,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(h){const w=e.invertBatch(h.map(y=>y.pz));return h.map((y,v)=>y.toAffine(w[v])).map(f.fromAffine)}static fromHex(h){const w=f.fromAffine(r(G("pointHex",h)));return w.assertValidity(),w}static fromPrivateKey(h){return f.BASE.multiply(i(h))}_setWindowSize(h){this._WINDOW_SIZE=h,u.delete(this)}assertValidity(){if(this.is0()){if(n.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:h,y:w}=this.toAffine();if(!e.isValid(h)||!e.isValid(w))throw new Error("bad point: x or y not FE");const y=e.sqr(w),v=c(h);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:h}=this.toAffine();if(e.isOdd)return!e.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){a(h);const{px:w,py:y,pz:v}=this,{px:S,py:I,pz:T}=h,E=e.eql(e.mul(w,T),e.mul(S,v)),x=e.eql(e.mul(y,T),e.mul(I,v));return E&&x}negate(){return new f(this.px,e.neg(this.py),this.pz)}double(){const{a:h,b:w}=n,y=e.mul(w,de),{px:v,py:S,pz:I}=this;let T=e.ZERO,E=e.ZERO,x=e.ZERO,A=e.mul(v,v),M=e.mul(S,S),C=e.mul(I,I),O=e.mul(v,S);return O=e.add(O,O),x=e.mul(v,I),x=e.add(x,x),T=e.mul(h,x),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),x=e.mul(y,x),C=e.mul(h,C),O=e.sub(A,C),O=e.mul(h,O),O=e.add(O,x),x=e.add(A,A),A=e.add(x,A),A=e.add(A,C),A=e.mul(A,O),E=e.add(E,A),C=e.mul(S,I),C=e.add(C,C),A=e.mul(C,O),T=e.sub(T,A),x=e.mul(C,M),x=e.add(x,x),x=e.add(x,x),new f(T,E,x)}add(h){a(h);const{px:w,py:y,pz:v}=this,{px:S,py:I,pz:T}=h;let E=e.ZERO,x=e.ZERO,A=e.ZERO;const M=n.a,C=e.mul(n.b,de);let O=e.mul(w,S),D=e.mul(y,I),K=e.mul(v,T),it=e.add(w,y),d=e.add(S,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(S,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),x=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),x=e.add(x,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,x,A)}subtract(h){return this.add(h.negate())}is0(){return this.equals(f.ZERO)}wNAF(h){return b.wNAFCached(this,u,h,w=>{const y=e.invertBatch(w.map(v=>v.pz));return w.map((v,S)=>v.toAffine(y[S])).map(f.fromAffine)})}multiplyUnsafe(h){const w=f.ZERO;if(h===rt)return w;if(s(h),h===W)return this;const{endo:y}=n;if(!y)return b.unsafeLadder(this,h);let{k1neg:v,k1:S,k2neg:I,k2:T}=y.splitScalar(h),E=w,x=w,A=this;for(;S>rt||T>rt;)S&W&&(E=E.add(A)),T&W&&(x=x.add(A)),A=A.double(),S>>=W,T>>=W;return v&&(E=E.negate()),I&&(x=x.negate()),x=new f(e.mul(x.px,y.beta),x.py,x.pz),E.add(x)}multiply(h){s(h);let w=h,y,v;const{endo:S}=n;if(S){const{k1neg:I,k1:T,k2neg:E,k2:x}=S.splitScalar(w);let{p:A,f:M}=this.wNAF(T),{p:C,f:O}=this.wNAF(x);A=b.constTimeNegate(I,A),C=b.constTimeNegate(E,C),C=new f(e.mul(C.px,S.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(h,w,y){const v=f.BASE,S=(T,E)=>E===rt||E===W||!T.equals(v)?T.multiplyUnsafe(E):T.multiply(E),I=S(this,w).add(S(h,y));return I.is0()?void 0:I}toAffine(h){const{px:w,py:y,pz:v}=this,S=this.is0();h==null&&(h=S?e.ONE:e.inv(v));const I=e.mul(w,h),T=e.mul(y,h),E=e.mul(v,h);if(S)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,isTorsionFree:w}=n;if(h===W)return!0;if(w)return w(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h,clearCofactor:w}=n;return h===W?this:w?w(f,this):this.multiplyUnsafe(n.h)}toRawBytes(h=!0){return this.assertValidity(),o(f,this,h)}toHex(h=!0){return ot(this.toRawBytes(h))}}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=Sn(f,n.endo?Math.ceil(m/2):m);return{CURVE:n,ProjectivePoint:f,normPrivateKeyToScalar:i,weierstrassEquation:c,isWithinCurveOrder:l}}function On(t){const n=Oe(t);return Ut(n,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...n})}function Pn(t){const n=On(t),{Fp:e,n:o}=n,r=e.BYTES+1,c=2*e.BYTES+1;function l(d){return rt<d&&d<e.ORDER}function s(d){return Z(d,o)}function i(d){return jt(d,o)}const{ProjectivePoint:u,normPrivateKeyToScalar:a,weierstrassEquation:f,isWithinCurveOrder:m}=In({...n,toBytes(d,p,B){const U=p.toAffine(),P=e.toBytes(U.x),V=Y;return B?V(Uint8Array.from([p.hasEvenY()?2:3]),P):V(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 V=f(P);let z=e.sqrt(V);const j=(z&W)===W;return(B&1)===1!==j&&(z=e.neg(z)),{x:P,y:z}}else if(p===c&&B===4){const P=e.fromBytes(U.subarray(0,e.BYTES)),V=e.fromBytes(U.subarray(e.BYTES,2*e.BYTES));return{x:P,y:V}}else throw new Error(`Point of length ${p} was invalid. Expected ${r} compressed bytes or ${c} uncompressed bytes`)}}),b=d=>ot(Et(d,n.nByteLength));function g(d){const p=o>>W;return d>p}function h(d){return g(d)?s(-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,V=x(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=i(z),bt=s(-V*ct),Ot=s(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,s(-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 a(d),!0}catch{return!1}},normPrivateKeyToScalar:a,randomPrivateKey:()=>{const d=n.randomBytes(e.BYTES+8),p=vn(d,o);return Et(p,n.nByteLength)},precompute(d=8,p=u.BASE){return p._setWindowSize(d),p.multiply(BigInt(3)),p}};function S(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===c:B?U===2*r||U===2*c: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(a(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},x=n.bits2int_modN||function(d){return s(E(d))},A=Mt(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:V,prehash:z,extraEntropy:j}=B;V==null&&(V=!0),d=G("msgHash",d),z&&(d=G("prehashed msgHash",U(d)));const st=x(d),ct=a(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 Ft(dt){const vt=E(dt);if(!m(vt))return;const oe=i(vt),xt=u.BASE.multiply(vt).toAffine(),J=s(xt.x);if(J===rt)return;const St=s(oe*s(lt+J*ct));if(St===rt)return;let ie=(xt.x===J?0:2)|Number(xt.y&W),se=St;return V&&g(St)&&(se=h(St),ie^=1),new y(J,se,ie)}return{seed:Ot,k2sig:Ft}}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),V=n;return Te(V.hash.outputLen,V.nByteLength,V.hmac)(U,P)}u.BASE._setWindowSize(8);function it(d,p,B,U=D){var xt;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:V,prehash:z}=U;let j,st;try{if(typeof P=="string"||P instanceof Uint8Array)try{j=y.fromDER(P)}catch(J){if(!(J instanceof yt.Err))throw J;j=y.fromCompact(P)}else if(typeof P=="object"&&typeof P.r=="bigint"&&typeof P.s=="bigint"){const{r:J,s:St}=P;j=new y(J,St)}else throw new Error("PARSE");st=u.fromHex(B)}catch(J){if(J.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(V&&j.hasHighS())return!1;z&&(p=n.hash(p));const{r:ct,s:bt}=j,Ot=x(p),lt=i(bt),Ft=s(Ot*lt),dt=s(ct*lt),vt=(xt=u.BASE.multiplyAndAddUnsafe(st,Ft,dt))==null?void 0:xt.toAffine();return vt?s(vt.x)===ct:!1}return{CURVE:n,getPublicKey:S,getSharedSecret:T,sign:K,verify:it,ProjectivePoint:u,Signature:y,utils:v}}var Un=Object.defineProperty,Pe=(t,n)=>{for(var e in n)Un(t,e,{get:n[e],enumerable:!0})},Ue={};Pe(Ue,{EmptyArray:()=>ee,arrayToHex:()=>Vt,arrayToUtf8:()=>te,calculateSharedKey:()=>nr,comparePublicKeyHex:()=>tr,compressPublicKeyHex:()=>Xn,doDecrypt:()=>or,doEncrypt:()=>rr,doSignature:()=>ir,doVerifySignature:()=>sr,generateKeyPairHex:()=>Jt,getHash:()=>ne,getPoint:()=>Fe,getPublicKeyFromPrivateKey:()=>Ve,getZ:()=>_t,hexToArray:()=>k,initRNGPool:()=>Wt,leftPad:()=>R,precomputePublicKey:()=>cr,utf8ToHex:()=>It,verifyPublicKey:()=>Jn});var Ht=BigInt(0),Pt=BigInt(1),Cn=BigInt(2);BigInt(3);function Ln(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=((q(o)^t)+Pt).toString(16).replace(/^-/,"")}return n}var Ce=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""}},ge=class extends Ce{constructor(t){super(),this.t="02",t&&(this.v=Ln(t))}getValue(){return this.v}},Nn=class extends Ce{constructor(n){super();H(this,"t","30");this.asn1Array=n}getValue(){return this.v=this.asn1Array.map(n=>n.getEncodedHex()).join(""),this.v}};function Le(t,n){return+t[n+2]<8?1:+t.substring(n+2,n+4)&127+1}function we(t,n){const e=Le(t,n),o=t.substring(n+2,n+2+e*2);return o?+(+o[0]<8?q(o):q(o.substring(2))).toString():-1}function Zt(t,n){const e=Le(t,n);return n+(e+1)*2}function Hn(t,n){const e=new ge(t),o=new ge(n);return new Nn([e,o]).getEncodedHex()}function _n(t){const n=Zt(t,0),e=Zt(t,n),o=we(t,n),r=t.substr(e,o*2),c=e+r.length,l=Zt(t,c),s=we(t,c),i=t.substring(l,l+s*2),u=q(r),a=q(i);return{r:u,s:a}}var Dt=16384,pt=new Uint8Array(0),Bt;async function Wt(){if("crypto"in globalThis){Bt=globalThis.crypto;return}if(!(pt.length>Dt/2))if("wx"in globalThis&&"getRandomValues"in globalThis.wx)pt=await new Promise(t=>{wx.getRandomValues({length:Dt,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(Dt);Bt.getRandomValues(t),pt=t}catch{throw new Error("no available csprng, abort.")}}Wt();function qn(t){if(pt.length>t){const n=pt.slice(0,t);return pt=pt.slice(t),Wt(),n}else throw new Error("random number pool is not ready or insufficient, prevent getting too long random values or too often.")}function Rn(t=0){const n=new Uint8Array(t);return Bt?Bt.getRandomValues(n):qn(t)}var Ne=t=>t instanceof Uint8Array,Kt=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 Fn=Array.from({length:256},(t,n)=>n.toString(16).padStart(2,"0"));function Tt(t){if(!Ne(t))throw new Error("Uint8Array expected");let n="";for(let e=0;e<t.length;e++)n+=Fn[t[e]];return n}function $n(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=$n(t)),!Ne(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}var He=class{clone(){return this._cloneInto()}};function kn(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 Zn=(t,n,e)=>t&n|t&e|n&e,ye=(t,n,e)=>t^n^e,Dn=(t,n,e)=>t&n|~t&e;function Kn(t,n,e,o){if(typeof t.setBigUint64=="function")return t.setBigUint64(n,e,o);const r=BigInt(32),c=BigInt(4294967295),l=Number(e>>r&c),s=Number(e&c),i=o?4:0,u=o?0:4;t.setUint32(n+i,l,o),t.setUint32(n+u,s,o)}function Q(t,n){const e=n&31;return t<<e|t>>>32-e}function zn(t){return t^Q(t,9)^Q(t,17)}function jn(t){return t^Q(t,15)^Q(t,23)}var Yn=class extends He{constructor(n,e,o,r){super();H(this,"buffer");H(this,"view");H(this,"finished",!1);H(this,"length",0);H(this,"pos",0);H(this,"destroyed",!1);this.blockLen=n,this.outputLen=e,this.padOffset=o,this.isLE=r,this.buffer=new Uint8Array(n),this.view=Kt(this.buffer)}update(n){const{view:e,buffer:o,blockLen:r}=this;n=Qt(n);const c=n.length;for(let l=0;l<c;){const s=Math.min(r-this.pos,c-l);if(s===r){const i=Kt(n);for(;r<=c-l;l+=r)this.process(i,l);continue}o.set(n.subarray(l,l+s),this.pos),this.pos+=s,l+=s,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:c}=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;Kn(o,r-8,BigInt(this.length*8),c),this.process(o,0);const s=Kt(n),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=i/4,a=this.get();if(u>a.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)s.setUint32(4*f,a[f],c)}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:c,destroyed:l,pos:s}=this;return n.length=r,n.pos=s,n.finished=c,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),pe=new Uint32Array(64),Mn=2043430169,Gn=2055708042,Wn=class extends Yn{constructor(){super(64,32,8,!1);H(this,"A",ut[0]|0);H(this,"B",ut[1]|0);H(this,"C",ut[2]|0);H(this,"D",ut[3]|0);H(this,"E",ut[4]|0);H(this,"F",ut[5]|0);H(this,"G",ut[6]|0);H(this,"H",ut[7]|0)}get(){const{A:n,B:e,C:o,D:r,E:c,F:l,G:s,H:i}=this;return[n,e,o,r,c,l,s,i]}set(n,e,o,r,c,l,s,i){this.A=n|0,this.B=e|0,this.C=o|0,this.D=r|0,this.E=c|0,this.F=l|0,this.G=s|0,this.H=i|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]=jn(tt[f-16]^tt[f-9]^Q(tt[f-3],15))^Q(tt[f-13],7)^tt[f-6];for(let f=0;f<64;f++)pe[f]=tt[f]^tt[f+4];let{A:o,B:r,C:c,D:l,E:s,F:i,G:u,H:a}=this;for(let f=0;f<64;f++){let m=f>=0&&f<=15,b=m?Mn:Gn,g=Q(Q(o,12)+s+Q(b,f),7),h=g^Q(o,12),w=(m?ye(o,r,c):Zn(o,r,c))+l+h+pe[f]|0,y=(m?ye(s,i,u):Dn(s,i,u))+a+g+tt[f]|0;l=c,c=Q(r,9),r=o,o=w,a=u,u=Q(i,19),i=s,s=zn(y)}o=o^this.A|0,r=r^this.B|0,c=c^this.C|0,l=l^this.D|0,s=s^this.E|0,i=i^this.F|0,u=u^this.G|0,a=a^this.H|0,this.set(o,r,c,l,s,i,u,a)}roundClean(){tt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},nt=kn(()=>new Wn),_e=class extends He{constructor(n,e){super();H(this,"oHash");H(this,"iHash");H(this,"blockLen");H(this,"outputLen");H(this,"finished",!1);H(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,c=new Uint8Array(r);c.set(o.length>r?n.create().update(o).digest():o);for(let l=0;l<c.length;l++)c[l]^=54;this.iHash.update(c),this.oHash=n.create();for(let l=0;l<c.length;l++)c[l]^=106;this.oHash.update(c),c.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:c,blockLen:l,outputLen:s}=this;return n=n,n.finished=r,n.destroyed=c,n.blockLen=l,n.outputLen=s,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 _e(t,n).update(e).digest();Xt.create=(t,n)=>new _e(t,n);var Qn=Ie(BigInt("115792089210356248756420345214020892766250353991924191454421193933289684991999")),N=Pn({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:Rn}),et=Ie(BigInt(N.CURVE.n));function Jt(t){const n=t?Et(Z(BigInt(t),Pt)+Pt,32):N.utils.randomPrivateKey(),e=N.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=q(t.substring(n+2,n+n+2));let r="03";return Z(o,Cn)===Ht&&(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 c=e[r>>>2]>>>24-r%4*8&255;o.push((c>>>4).toString(16)),o.push((c&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 te(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 Jn(t){const n=N.ProjectivePoint.fromHex(t);if(!n)return!1;try{return n.assertValidity(),!0}catch{return!1}}function tr(t,n){const e=N.ProjectivePoint.fromHex(t);if(!e)return!1;const o=N.ProjectivePoint.fromHex(n);return o?e.equals(o):!1}var me=q("80000000000000000000000000000000"),Ee=q("7fffffffffffffffffffffffffffffff");function er(t,n){let e=new Uint8Array(n),o=1,r=0,c=ee;const l=new Uint8Array(4),s=()=>{l[0]=o>>24&255,l[1]=o>>16&255,l[2]=o>>8&255,l[3]=o&255,c=nt(Y(t,l)),o++,r=0};s();for(let i=0,u=e.length;i<u;i++)r===c.length&&s(),e[i]=c[r++]&255;return e}function nr(t,n,e,o,r,c=!1,l="1234567812345678",s="1234567812345678"){const i=N.ProjectivePoint.fromHex(n.publicKey),u=N.ProjectivePoint.fromHex(o),a=N.ProjectivePoint.fromHex(e);let f=_t(t.publicKey,l),m=_t(e,s);c&&([f,m]=[m,f]);const b=q(n.privateKey),g=q(t.privateKey),h=i.x,w=me+(h&Ee),y=et.add(g,et.mulN(w,b)),v=u.x,S=et.add(me,v&Ee),I=u.multiply(S).add(a).multiply(y),T=k(R($(I.x),64)),E=k(R($(I.y),64));return er(Y(T,E,f,m),r)}var qe=0,ee=new Uint8Array;function rr(t,n,e=1){const o=typeof t=="string"?k(It(t)):Uint8Array.from(t),r=typeof n=="string"?N.ProjectivePoint.fromHex(n):n,c=Jt(),l=q(c.privateKey);let s=c.publicKey;s.length>128&&(s=s.substring(s.length-128));const i=r.multiply(l),u=k(R($(i.x),64)),a=k(R($(i.y),64)),f=Tt(nt(Y(u,o,a)));Re(u,a,o);const m=Tt(o);return e===qe?s+m+f:s+f+m}function Re(t,n,e){let o=1,r=0,c=ee;const l=new Uint8Array(4),s=()=>{l[0]=o>>24&255,l[1]=o>>16&255,l[2]=o>>8&255,l[3]=o&255,c=nt(Y(t,n,l)),o++,r=0};s();for(let i=0,u=e.length;i<u;i++)r===c.length&&s(),e[i]^=c[r++]&255}function or(t,n,e=1,{output:o="string"}={}){const r=q(n);let c=t.substring(128,128+64),l=t.substring(128+64);e===qe&&(c=t.substring(t.length-64),l=t.substring(128,t.length-64));const s=k(l),u=N.ProjectivePoint.fromHex("04"+t.substring(0,128)).multiply(r),a=k(R($(u.x),64)),f=k(R($(u.y),64));return Re(a,f,s),Vt(Array.from(nt(Y(a,s,f))))===c.toLowerCase()?o==="array"?s:te(s):o==="array"?[]:""}function ir(t,n,e={}){let{pointPool:o,der:r,hash:c,publicKey:l,userId:s}=e,i=typeof t=="string"?It(t):Vt(Array.from(t));c&&(l=l||Ve(n),i=ne(i,l,s));const u=q(n),a=q(i);let f=null,m=null,b=null;do{do{let g;o&&o.length?g=o.pop():g=Fe(),f=g.k,m=et.add(a,g.x1)}while(m===Ht||m+f===N.CURVE.n);b=et.mul(et.inv(et.addN(u,Pt)),et.subN(f,et.mulN(m,u)))}while(b===Ht);return r?Hn(m,b):R($(m),64)+R($(b),64)}function sr(t,n,e,o={}){let r;const{hash:c,der:l,userId:s}=o,i=typeof e=="string"?e:e.toHex(!1);c?r=ne(typeof t=="string"?It(t):t,i,s):r=typeof t=="string"?It(t):Vt(Array.from(t));let u,a;if(l){const w=_n(n);u=w.r,a=w.s}else u=q(n.substring(0,64)),a=q(n.substring(64));const f=typeof e=="string"?N.ProjectivePoint.fromHex(e):e,m=q(r),b=et.add(u,a);if(b===Ht)return!1;const g=N.ProjectivePoint.BASE.multiply(a).add(f.multiply(b)),h=et.add(m,g.x);return u===h}function _t(t,n="1234567812345678"){n=It(n);const e=R($(N.CURVE.a),64),o=R($(N.CURVE.b),64),r=R($(N.ProjectivePoint.BASE.x),64),c=R($(N.ProjectivePoint.BASE.y),64);let l,s;if(t.length===128)l=t.substring(0,64),s=t.substring(64,128);else{const f=N.ProjectivePoint.fromHex(t);l=R($(f.x),64),s=R($(f.y),64)}const i=k(n+e+o+r+c+l+s),u=n.length*4;return nt(Y(new Uint8Array([u>>8&255,u&255]),i))}function ne(t,n,e="1234567812345678"){const o=_t(n,e);return Tt(nt(Y(o,typeof t=="string"?k(t):t)))}function cr(t,n){const e=N.ProjectivePoint.fromHex(t);return N.utils.precompute(n,e)}function Ve(t){const n=N.getPublicKey(t,!1);return R(ot(n),64)}function Fe(){const t=Jt(),n=N.ProjectivePoint.fromHex(t.publicKey),e=q(t.privateKey);return{...t,k:e,x1:n.x}}function $e(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 lr(t,n){if(t=typeof t=="string"?$e(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 ke={};Pe(ke,{decrypt:()=>dr,encrypt:()=>hr,sm4:()=>re});var ft=0,ur=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 fr(t,n,e){let o=0,r=0,c=0,l=0,s=0,i=0,u=0,a=0;s=t[0]&255,i=t[1]&255,u=t[2]&255,a=t[3]&255,o=s<<24|i<<16|u<<8|a,s=t[4]&255,i=t[5]&255,u=t[6]&255,a=t[7]&255,r=s<<24|i<<16|u<<8|a,s=t[8]&255,i=t[9]&255,u=t[10]&255,a=t[11]&255,c=s<<24|i<<16|u<<8|a,s=t[12]&255,i=t[13]&255,u=t[14]&255,a=t[15]&255,l=s<<24|i<<16|u<<8|a;for(let f=0;f<32;f+=4)s=r^c^l^e[f],s=ht(s),o^=s^(s<<2|s>>>30)^(s<<10|s>>>22)^(s<<18|s>>>14)^(s<<24|s>>>8),i=c^l^o^e[f+1],i=ht(i),r^=i^(i<<2|i>>>30)^(i<<10|i>>>22)^(i<<18|i>>>14)^(i<<24|i>>>8),u=l^o^r^e[f+2],u=ht(u),c^=u^(u<<2|u>>>30)^(u<<10|u>>>22)^(u<<18|u>>>14)^(u<<24|u>>>8),a=o^r^c^e[f+3],a=ht(a),l^=a^(a<<2|a>>>30)^(a<<10|a>>>22)^(a<<18|a>>>14)^(a<<24|a>>>8);n[0]=l>>>24&255,n[1]=l>>>16&255,n[2]=l>>>8&255,n[3]=l&255,n[4]=c>>>24&255,n[5]=c>>>16&255,n[6]=c>>>8&255,n[7]=c&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 ar(t,n,e){let o=0,r=0,c=0,l=0,s=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,c=(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,c^=1736282519,l^=2993693404;for(let i=0;i<32;i+=4)s=r^c^l^Lt[i+0],s=ht(s),o^=s^(s<<13|s>>>19)^(s<<23|s>>>9),n[i+0]=o,s=c^l^o^Lt[i+1],s=ht(s),r^=s^(s<<13|s>>>19)^(s<<23|s>>>9),n[i+1]=r,s=l^o^r^Lt[i+2],s=ht(s),c^=s^(s<<13|s>>>19)^(s<<23|s>>>9),n[i+2]=c,s=o^r^c^Lt[i+3],s=ht(s),l^=s^(s<<13|s>>>19)^(s<<23|s>>>9),n[i+3]=l;if(e===ft)for(let i=0;i<16;i++)[n[i],n[31-i]]=[n[31-i],n[i]]}var Nt=new Uint8Array(16);function re(t,n,e,o={}){let{padding:r="pkcs#7",mode:c,iv:l=new Uint8Array(16),output:s}=o;if(c==="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=$e(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 h=0;h<b;h++)g[t.length+h]=b;t=g}const i=new Uint32Array(ur);ar(n,i,e);let u=new Uint8Array(t.length),a=l,f=t.length,m=0;for(;f>=gt;){const b=t.subarray(m,m+16);if(c==="cbc")for(let g=0;g<gt;g++)e!==ft&&(b[g]^=a[g]);fr(b,Nt,i);for(let g=0;g<gt;g++)c==="cbc"&&e===ft&&(Nt[g]^=a[g]),u[m+g]=Nt[g];c==="cbc"&&(e!==ft?a=Nt:a=b),f-=gt,m+=gt}if((r==="pkcs#5"||r==="pkcs#7")&&e===ft){const b=u.length,g=u[b-1];for(let h=1;h<=g;h++)if(u[b-h]!==g)throw new Error("padding is invalid");u=u.slice(0,b-g)}return s!=="array"?e!==ft?Tt(u):te(u):u}function hr(t,n,e={}){return re(t,n,1,e)}function dr(t,n,e={}){return re(t,n,0,e)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */exports.STATUS=at;exports._configStatus=Ke;exports.sm2_exports=Ue;exports.sm32=lr;exports.sm4_exports=ke;exports.useCache=Qe;exports.useFetch=ze;exports.useFindLabelsFromPath=be;exports.useFindOptionByValue=ve;exports.useFindParentValues=Ge;exports.useFindPropertyRecursive=xe;exports.useFindTextsFromPath=Me;exports.useFindTextsInValues=Ye;exports.useFormFail=tn;exports.useFormFormat=en;exports.useHiddenForm=Xe;exports.useProcessStatus=Se;exports.useProcessStatusSuccess=Je;exports.useTextFromOptionsValue=je;
2
+ //# sourceMappingURL=index-0de12d0f.cjs.map