@atooyu/uxto-ui 1.1.28 → 1.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
3
  const vue = require("vue");
7
- const _hoisted_1$I = ["disabled", "hover-class"];
8
- const _hoisted_2$x = {
4
+ const _hoisted_1$H = ["disabled", "hover-class"];
5
+ const _hoisted_2$w = {
9
6
  key: 0,
10
7
  class: "u-button__loading"
11
8
  };
@@ -77,7 +74,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
77
74
  "hover-class": __props.disabled || __props.loading ? "" : "u-button--active",
78
75
  onClick: handleClick
79
76
  }, [
80
- __props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$x, [..._cache[0] || (_cache[0] = [
77
+ __props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$w, [..._cache[0] || (_cache[0] = [
81
78
  vue.createElementVNode("view", { class: "u-button__loading-icon" }, null, -1)
82
79
  ])])) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$q, [
83
80
  __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$h, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
@@ -85,7 +82,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
85
82
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
86
83
  ])
87
84
  ]))
88
- ], 14, _hoisted_1$I);
85
+ ], 14, _hoisted_1$H);
89
86
  };
90
87
  }
91
88
  });
@@ -97,11 +94,11 @@ const _export_sfc = (sfc, props) => {
97
94
  return target;
98
95
  };
99
96
  const uButton = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-a51cb0bf"]]);
100
- const _hoisted_1$H = {
97
+ const _hoisted_1$G = {
101
98
  key: 0,
102
99
  class: "u-input__prefix"
103
100
  };
104
- const _hoisted_2$w = { class: "u-input__icon" };
101
+ const _hoisted_2$v = { class: "u-input__icon" };
105
102
  const _hoisted_3$p = { class: "u-input__body" };
106
103
  const _hoisted_4$g = ["type", "value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "confirm-type", "adjust-position"];
107
104
  const _hoisted_5$c = {
@@ -166,9 +163,9 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
166
163
  "u-input--focus": isFocus.value
167
164
  }])
168
165
  }, [
169
- _ctx.$slots.prefix || __props.prefixIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$H, [
166
+ _ctx.$slots.prefix || __props.prefixIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$G, [
170
167
  vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
171
- vue.createElementVNode("text", _hoisted_2$w, vue.toDisplayString(__props.prefixIcon), 1)
168
+ vue.createElementVNode("text", _hoisted_2$v, vue.toDisplayString(__props.prefixIcon), 1)
172
169
  ], true)
173
170
  ])) : vue.createCommentVNode("", true),
174
171
  vue.createElementVNode("view", _hoisted_3$p, [
@@ -207,8 +204,8 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
207
204
  }
208
205
  });
209
206
  const uInput = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-2f635824"]]);
210
- const _hoisted_1$G = ["hover-class"];
211
- const _hoisted_2$v = {
207
+ const _hoisted_1$F = ["hover-class"];
208
+ const _hoisted_2$u = {
212
209
  key: 0,
213
210
  class: "u-cell__icon"
214
211
  };
@@ -271,7 +268,7 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
271
268
  "hover-class": isClickable.value && !__props.disabled ? "u-cell--active" : "",
272
269
  onClick: handleClick
273
270
  }, [
274
- _ctx.$slots.icon || __props.icon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$v, [
271
+ _ctx.$slots.icon || __props.icon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$u, [
275
272
  vue.renderSlot(_ctx.$slots, "icon", {}, () => [
276
273
  __props.icon ? (vue.openBlock(), vue.createElementBlock("image", {
277
274
  key: 0,
@@ -296,13 +293,13 @@ const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
296
293
  vue.createElementVNode("text", { class: "u-cell__arrow-icon" }, "›", -1)
297
294
  ])])) : vue.createCommentVNode("", true),
298
295
  vue.renderSlot(_ctx.$slots, "right-icon", {}, void 0, true)
299
- ], 10, _hoisted_1$G);
296
+ ], 10, _hoisted_1$F);
300
297
  };
301
298
  }
302
299
  });
303
300
  const uCell = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-c3a35a65"]]);
304
- const _hoisted_1$F = { class: "u-cell-group" };
305
- const _hoisted_2$u = {
301
+ const _hoisted_1$E = { class: "u-cell-group" };
302
+ const _hoisted_2$t = {
306
303
  key: 0,
307
304
  class: "u-cell-group__title"
308
305
  };
@@ -321,8 +318,8 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
321
318
  },
322
319
  setup(__props) {
323
320
  return (_ctx, _cache) => {
324
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$F, [
325
- __props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$u, [
321
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$E, [
322
+ __props.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$t, [
326
323
  vue.renderSlot(_ctx.$slots, "title", {}, () => [
327
324
  vue.createTextVNode(vue.toDisplayString(__props.title), 1)
328
325
  ], true)
@@ -335,11 +332,11 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
335
332
  }
336
333
  });
337
334
  const uCellGroup = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-f529bc69"]]);
338
- const _hoisted_1$E = {
335
+ const _hoisted_1$D = {
339
336
  key: 0,
340
337
  class: "u-modal__header"
341
338
  };
342
- const _hoisted_2$t = { class: "u-modal__title" };
339
+ const _hoisted_2$s = { class: "u-modal__title" };
343
340
  const _hoisted_3$m = { class: "u-modal__body" };
344
341
  const _hoisted_4$e = { class: "u-modal__message" };
345
342
  const _hoisted_5$a = { class: "u-modal__footer" };
@@ -389,8 +386,8 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
389
386
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
390
387
  }, ["stop"]))
391
388
  }, [
392
- __props.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$E, [
393
- vue.createElementVNode("text", _hoisted_2$t, vue.toDisplayString(__props.title), 1)
389
+ __props.title ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$D, [
390
+ vue.createElementVNode("text", _hoisted_2$s, vue.toDisplayString(__props.title), 1)
394
391
  ])) : vue.createCommentVNode("", true),
395
392
  vue.createElementVNode("view", _hoisted_3$m, [
396
393
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
@@ -506,7 +503,7 @@ const chat = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='htt
506
503
  const clipboard = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='currentColor'%20d='M19%203h-4.18C14.4%201.84%2013.3%201%2012%201c-1.3%200-2.4.84-2.82%202H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2zm-7%200c.55%200%201%20.45%201%201s-.45%201-1%201-1-.45-1-1%20.45-1%201-1zm2%2014H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3e%3c/svg%3e";
507
504
  const location = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M12%202C8.13%202%205%205.13%205%209c0%205.25%207%2013%207%2013s7-7.75%207-13c0-3.87-3.13-7-7-7zm0%209.5c-1.38%200-2.5-1.12-2.5-2.5s1.12-2.5%202.5-2.5%202.5%201.12%202.5%202.5-1.12%202.5-2.5%202.5z'/%3e%3c/svg%3e";
508
505
  const scan = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M3%2011h8V3H3v8zm2-6h4v4H5V5zm8-2v8h8V3h-8zm6%206h-4V5h4v4zM3%2021h8v-8H3v8zm2-6h4v4H5v-4zm13-2h-2v3h-3v2h3v3h2v-3h3v-2h-3v-3z'/%3e%3c/svg%3e";
509
- const qrcode = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M3%203h6v6H3V3zm2%202v2h2V5H5zm8-2h6v6h-6V3zm2%202v2h2V5h-2zM3%2013h6v6H3v-6zm2%202v2h2v-2H5zm13-2h3v2h-3v-2zm-3%200h2v4h-2v-4zm-2%202h2v2h-2v-2zm2%202h3v2h-3v-2zm3%202h2v2h-2v-2zm-5%200h2v2h-2v-2z'/%3e%3c/svg%3e";
506
+ const qrcode$1 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M3%203h6v6H3V3zm2%202v2h2V5H5zm8-2h6v6h-6V3zm2%202v2h2V5h-2zM3%2013h6v6H3v-6zm2%202v2h2v-2H5zm13-2h3v2h-3v-2zm-3%200h2v4h-2v-4zm-2%202h2v2h-2v-2zm2%202h3v2h-3v-2zm3%202h2v2h-2v-2zm-5%200h2v2h-2v-2z'/%3e%3c/svg%3e";
510
507
  const moon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='currentColor'%3e%3cpath%20d='M12%203a9%209%200%20109%209c0-.46-.04-.92-.1-1.36a5.389%205.389%200%2001-4.4%202.26%205.403%205.403%200%2001-3.14-9.8c-.44-.06-.9-.1-1.36-.1z'/%3e%3c/svg%3e";
511
508
  const icons = {
512
509
  // 箭头类
@@ -562,7 +559,7 @@ const icons = {
562
559
  "like": like,
563
560
  "like-o": likeO,
564
561
  "share": share,
565
- "qrcode": qrcode,
562
+ "qrcode": qrcode$1,
566
563
  "moon": moon,
567
564
  // 用户类
568
565
  "user": user,
@@ -631,8 +628,8 @@ function getIconNames() {
631
628
  function addIcon(name, svg) {
632
629
  icons[name] = svg;
633
630
  }
634
- const _hoisted_1$D = ["src"];
635
- const _hoisted_2$s = {
631
+ const _hoisted_1$C = ["src"];
632
+ const _hoisted_2$r = {
636
633
  key: 1,
637
634
  class: "u-icon__inner"
638
635
  };
@@ -722,7 +719,7 @@ const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
722
719
  src: iconSrc.value,
723
720
  style: vue.normalizeStyle(svgStyle.value),
724
721
  mode: "aspectFit"
725
- }, null, 12, _hoisted_1$D)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$s, vue.toDisplayString(__props.name), 1))
722
+ }, null, 12, _hoisted_1$C)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$r, vue.toDisplayString(__props.name), 1))
726
723
  ], 6);
727
724
  };
728
725
  }
@@ -774,7 +771,7 @@ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
774
771
  }
775
772
  });
776
773
  const uLoading = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-ce769006"]]);
777
- const _hoisted_1$C = { class: "u-tag__text" };
774
+ const _hoisted_1$B = { class: "u-tag__text" };
778
775
  const __default__$G = {
779
776
  options: {
780
777
  virtualHost: true,
@@ -814,7 +811,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
814
811
  class: vue.normalizeClass(["u-tag", [`u-tag--${__props.type}`, `u-tag--${__props.size}`, { "u-tag--plain": __props.plain, "u-tag--round": __props.round }]]),
815
812
  style: vue.normalizeStyle(tagStyle.value)
816
813
  }, [
817
- vue.createElementVNode("text", _hoisted_1$C, [
814
+ vue.createElementVNode("text", _hoisted_1$B, [
818
815
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
819
816
  ]),
820
817
  __props.closable ? (vue.openBlock(), vue.createElementBlock("view", {
@@ -895,8 +892,8 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
895
892
  }
896
893
  });
897
894
  const uSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-8922fa66"]]);
898
- const _hoisted_1$B = ["src", "mode", "lazy-load", "fade"];
899
- const _hoisted_2$r = {
895
+ const _hoisted_1$A = ["src", "mode", "lazy-load", "fade"];
896
+ const _hoisted_2$q = {
900
897
  key: 0,
901
898
  class: "u-image__loading"
902
899
  };
@@ -949,8 +946,8 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
949
946
  fade: __props.fade,
950
947
  onLoad: handleLoad,
951
948
  onError: handleError
952
- }, null, 40, _hoisted_1$B),
953
- __props.loading && !loaded.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$r, [
949
+ }, null, 40, _hoisted_1$A),
950
+ __props.loading && !loaded.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$q, [
954
951
  vue.renderSlot(_ctx.$slots, "loading", {}, () => [
955
952
  vue.createVNode(_component_u_loading, { size: 20 })
956
953
  ], true)
@@ -965,7 +962,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
965
962
  }
966
963
  });
967
964
  const uImage = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-55a4498e"]]);
968
- const _hoisted_1$A = {
965
+ const _hoisted_1$z = {
969
966
  key: 0,
970
967
  class: "u-divider__text"
971
968
  };
@@ -988,7 +985,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
988
985
  return vue.openBlock(), vue.createElementBlock("view", {
989
986
  class: vue.normalizeClass(["u-divider", { "u-divider--hairline": __props.hairline, "u-divider--dashed": __props.dashed }])
990
987
  }, [
991
- _ctx.$slots.default || __props.content ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$A, [
988
+ _ctx.$slots.default || __props.content ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$z, [
992
989
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
993
990
  vue.createTextVNode(vue.toDisplayString(__props.content), 1)
994
991
  ], true)
@@ -998,11 +995,11 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
998
995
  }
999
996
  });
1000
997
  const uDivider = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-7f88d163"]]);
1001
- const _hoisted_1$z = {
998
+ const _hoisted_1$y = {
1002
999
  key: 0,
1003
1000
  class: "u-notice-bar__left-icon"
1004
1001
  };
1005
- const _hoisted_2$q = { class: "u-notice-bar__text-item" };
1002
+ const _hoisted_2$p = { class: "u-notice-bar__text-item" };
1006
1003
  const _hoisted_3$k = { class: "u-notice-bar__text-item" };
1007
1004
  const _hoisted_4$d = {
1008
1005
  key: 1,
@@ -1038,7 +1035,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
1038
1035
  class: vue.normalizeClass(["u-notice-bar", { "u-notice-bar--wrapable": __props.wrapable }]),
1039
1036
  style: vue.normalizeStyle({ color: __props.color, background: __props.background })
1040
1037
  }, [
1041
- _ctx.$slots.leftIcon || __props.leftIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$z, [
1038
+ _ctx.$slots.leftIcon || __props.leftIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$y, [
1042
1039
  vue.renderSlot(_ctx.$slots, "leftIcon", {}, () => [
1043
1040
  vue.createElementVNode("text", null, vue.toDisplayString(__props.leftIcon), 1)
1044
1041
  ], true)
@@ -1051,7 +1048,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
1051
1048
  class: "u-notice-bar__text",
1052
1049
  style: vue.normalizeStyle({ animationDuration: __props.speed + "s" })
1053
1050
  }, [
1054
- vue.createElementVNode("text", _hoisted_2$q, vue.toDisplayString(__props.text), 1),
1051
+ vue.createElementVNode("text", _hoisted_2$p, vue.toDisplayString(__props.text), 1),
1055
1052
  vue.createElementVNode("text", _hoisted_3$k, vue.toDisplayString(__props.text), 1)
1056
1053
  ], 4)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$d, vue.toDisplayString(__props.text), 1))
1057
1054
  ], 2),
@@ -1069,11 +1066,11 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
1069
1066
  }
1070
1067
  });
1071
1068
  const uNoticeBar = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-f80a744d"]]);
1072
- const _hoisted_1$y = {
1069
+ const _hoisted_1$x = {
1073
1070
  key: 0,
1074
1071
  class: "u-layout__header"
1075
1072
  };
1076
- const _hoisted_2$p = { class: "u-layout__content" };
1073
+ const _hoisted_2$o = { class: "u-layout__content" };
1077
1074
  const _hoisted_3$j = {
1078
1075
  key: 1,
1079
1076
  class: "u-layout__footer"
@@ -1094,10 +1091,10 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
1094
1091
  return vue.openBlock(), vue.createElementBlock("view", {
1095
1092
  class: vue.normalizeClass(["u-layout", { "u-layout--has-footer": hasFooter.value }])
1096
1093
  }, [
1097
- _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$y, [
1094
+ _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$x, [
1098
1095
  vue.renderSlot(_ctx.$slots, "header", {}, void 0, true)
1099
1096
  ])) : vue.createCommentVNode("", true),
1100
- vue.createElementVNode("view", _hoisted_2$p, [
1097
+ vue.createElementVNode("view", _hoisted_2$o, [
1101
1098
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
1102
1099
  ]),
1103
1100
  _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$j, [
@@ -1108,7 +1105,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
1108
1105
  }
1109
1106
  });
1110
1107
  const uLayout = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-1682e77a"]]);
1111
- const _hoisted_1$x = {
1108
+ const _hoisted_1$w = {
1112
1109
  key: 0,
1113
1110
  class: "u-badge__text"
1114
1111
  };
@@ -1164,18 +1161,18 @@ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
1164
1161
  class: vue.normalizeClass(["u-badge__content", [`u-badge__content--${__props.type}`, { "u-badge__content--dot": __props.dot, "u-badge__content--alone": !_ctx.$slots.default }]]),
1165
1162
  style: vue.normalizeStyle(badgeStyle.value)
1166
1163
  }, [
1167
- !__props.dot && displayValue.value ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$x, vue.toDisplayString(displayValue.value), 1)) : vue.createCommentVNode("", true)
1164
+ !__props.dot && displayValue.value ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$w, vue.toDisplayString(displayValue.value), 1)) : vue.createCommentVNode("", true)
1168
1165
  ], 6)) : vue.createCommentVNode("", true)
1169
1166
  ], 2);
1170
1167
  };
1171
1168
  }
1172
1169
  });
1173
1170
  const uBadge = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-56dd42ed"]]);
1174
- const _hoisted_1$w = {
1171
+ const _hoisted_1$v = {
1175
1172
  key: 0,
1176
1173
  class: "u-loading-page"
1177
1174
  };
1178
- const _hoisted_2$o = { class: "u-loading-page__content" };
1175
+ const _hoisted_2$n = { class: "u-loading-page__content" };
1179
1176
  const __default__$z = {
1180
1177
  options: {
1181
1178
  virtualHost: true,
@@ -1194,8 +1191,8 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
1194
1191
  },
1195
1192
  setup(__props) {
1196
1193
  return (_ctx, _cache) => {
1197
- return __props.visible ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$w, [
1198
- vue.createElementVNode("view", _hoisted_2$o, [
1194
+ return __props.visible ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$v, [
1195
+ vue.createElementVNode("view", _hoisted_2$n, [
1199
1196
  vue.createElementVNode("view", {
1200
1197
  class: "u-loading-page__spinner",
1201
1198
  style: vue.normalizeStyle({ width: __props.size + "px", height: __props.size + "px" })
@@ -1222,7 +1219,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
1222
1219
  }
1223
1220
  });
1224
1221
  const uLoadingPage = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-ddf92cf6"]]);
1225
- const _hoisted_1$v = { class: "u-parse" };
1222
+ const _hoisted_1$u = { class: "u-parse" };
1226
1223
  const __default__$y = {
1227
1224
  options: {
1228
1225
  virtualHost: true,
@@ -1328,7 +1325,7 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
1328
1325
  };
1329
1326
  return (_ctx, _cache) => {
1330
1327
  const _component_rich_text = vue.resolveComponent("rich-text");
1331
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$v, [
1328
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$u, [
1332
1329
  vue.createVNode(_component_rich_text, {
1333
1330
  nodes: parsedNodes.value,
1334
1331
  selectable: __props.selectable,
@@ -1340,8 +1337,8 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
1340
1337
  }
1341
1338
  });
1342
1339
  const uParse = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-5361245b"]]);
1343
- const _hoisted_1$u = { class: "u-keyboard__header" };
1344
- const _hoisted_2$n = { class: "u-keyboard__title" };
1340
+ const _hoisted_1$t = { class: "u-keyboard__header" };
1341
+ const _hoisted_2$m = { class: "u-keyboard__title" };
1345
1342
  const _hoisted_3$i = ["onClick"];
1346
1343
  const __default__$x = {
1347
1344
  options: {
@@ -1472,8 +1469,8 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
1472
1469
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
1473
1470
  }, ["stop"]))
1474
1471
  }, [
1475
- vue.createElementVNode("view", _hoisted_1$u, [
1476
- vue.createElementVNode("text", _hoisted_2$n, vue.toDisplayString(__props.title), 1),
1472
+ vue.createElementVNode("view", _hoisted_1$t, [
1473
+ vue.createElementVNode("text", _hoisted_2$m, vue.toDisplayString(__props.title), 1),
1477
1474
  vue.createElementVNode("text", {
1478
1475
  class: "u-keyboard__close",
1479
1476
  onClick: handleClose
@@ -1501,8 +1498,8 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
1501
1498
  }
1502
1499
  });
1503
1500
  const uKeyboard = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-b318be29"]]);
1504
- const _hoisted_1$t = { class: "u-picker__toolbar" };
1505
- const _hoisted_2$m = { class: "u-picker__title" };
1501
+ const _hoisted_1$s = { class: "u-picker__toolbar" };
1502
+ const _hoisted_2$l = { class: "u-picker__title" };
1506
1503
  const _hoisted_3$h = {
1507
1504
  key: 0,
1508
1505
  class: "u-picker__loading"
@@ -1599,12 +1596,12 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
1599
1596
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
1600
1597
  }, ["stop"]))
1601
1598
  }, [
1602
- vue.createElementVNode("view", _hoisted_1$t, [
1599
+ vue.createElementVNode("view", _hoisted_1$s, [
1603
1600
  vue.createElementVNode("text", {
1604
1601
  class: "u-picker__action",
1605
1602
  onClick: handleCancel
1606
1603
  }, "取消"),
1607
- vue.createElementVNode("text", _hoisted_2$m, vue.toDisplayString(__props.title), 1),
1604
+ vue.createElementVNode("text", _hoisted_2$l, vue.toDisplayString(__props.title), 1),
1608
1605
  vue.createElementVNode("text", {
1609
1606
  class: "u-picker__action u-picker__action--confirm",
1610
1607
  onClick: handleConfirm
@@ -1644,8 +1641,8 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
1644
1641
  }
1645
1642
  });
1646
1643
  const uPicker = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-54bd44d7"]]);
1647
- const _hoisted_1$s = { class: "u-datetime-picker__toolbar" };
1648
- const _hoisted_2$l = { class: "u-datetime-picker__title" };
1644
+ const _hoisted_1$r = { class: "u-datetime-picker__toolbar" };
1645
+ const _hoisted_2$k = { class: "u-datetime-picker__title" };
1649
1646
  const __default__$v = {
1650
1647
  options: {
1651
1648
  virtualHost: true,
@@ -1873,12 +1870,12 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
1873
1870
  onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
1874
1871
  }, ["stop"]))
1875
1872
  }, [
1876
- vue.createElementVNode("view", _hoisted_1$s, [
1873
+ vue.createElementVNode("view", _hoisted_1$r, [
1877
1874
  vue.createElementVNode("text", {
1878
1875
  class: "u-datetime-picker__action",
1879
1876
  onClick: handleCancel
1880
1877
  }, "取消"),
1881
- vue.createElementVNode("text", _hoisted_2$l, vue.toDisplayString(__props.title), 1),
1878
+ vue.createElementVNode("text", _hoisted_2$k, vue.toDisplayString(__props.title), 1),
1882
1879
  vue.createElementVNode("text", {
1883
1880
  class: "u-datetime-picker__action u-datetime-picker__action--confirm",
1884
1881
  onClick: handleConfirm
@@ -1915,7 +1912,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
1915
1912
  }
1916
1913
  });
1917
1914
  const uDatetimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-45acbf1d"]]);
1918
- const _hoisted_1$r = ["onClick"];
1915
+ const _hoisted_1$q = ["onClick"];
1919
1916
  const __default__$u = {
1920
1917
  options: {
1921
1918
  virtualHost: true,
@@ -2021,14 +2018,14 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
2021
2018
  style: vue.normalizeStyle(activeStyle.value)
2022
2019
  }, "★", 4)
2023
2020
  ], 4)
2024
- ], 12, _hoisted_1$r);
2021
+ ], 12, _hoisted_1$q);
2025
2022
  }), 128))
2026
2023
  ], 2);
2027
2024
  };
2028
2025
  }
2029
2026
  });
2030
2027
  const uRate = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-62d85215"]]);
2031
- const _hoisted_1$q = { class: "u-grid" };
2028
+ const _hoisted_1$p = { class: "u-grid" };
2032
2029
  const __default__$t = {
2033
2030
  options: {
2034
2031
  virtualHost: true,
@@ -2065,18 +2062,18 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
2065
2062
  onItemClick
2066
2063
  });
2067
2064
  return (_ctx, _cache) => {
2068
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$q, [
2065
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$p, [
2069
2066
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
2070
2067
  ]);
2071
2068
  };
2072
2069
  }
2073
2070
  });
2074
2071
  const uGrid = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-d005bea6"]]);
2075
- const _hoisted_1$p = {
2072
+ const _hoisted_1$o = {
2076
2073
  key: 0,
2077
2074
  class: "u-grid-item__icon"
2078
2075
  };
2079
- const _hoisted_2$k = ["src"];
2076
+ const _hoisted_2$j = ["src"];
2080
2077
  const _hoisted_3$g = {
2081
2078
  key: 1,
2082
2079
  class: "u-grid-item__icon-text"
@@ -2145,14 +2142,14 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
2145
2142
  style: vue.normalizeStyle(itemStyle.value),
2146
2143
  onClick: handleClick
2147
2144
  }, [
2148
- _ctx.$slots.icon || __props.icon || __props.iconUrl ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$p, [
2145
+ _ctx.$slots.icon || __props.icon || __props.iconUrl ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$o, [
2149
2146
  vue.renderSlot(_ctx.$slots, "icon", {}, () => [
2150
2147
  __props.iconUrl ? (vue.openBlock(), vue.createElementBlock("image", {
2151
2148
  key: 0,
2152
2149
  class: "u-grid-item__icon-image",
2153
2150
  src: __props.iconUrl,
2154
2151
  mode: "aspectFit"
2155
- }, null, 8, _hoisted_2$k)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$g, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
2152
+ }, null, 8, _hoisted_2$j)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$g, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
2156
2153
  ], true),
2157
2154
  __props.badge !== void 0 && __props.badge !== null && __props.badge !== "" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_4$c, [
2158
2155
  vue.createElementVNode("text", _hoisted_5$9, vue.toDisplayString(__props.badge), 1)
@@ -2168,8 +2165,8 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
2168
2165
  }
2169
2166
  });
2170
2167
  const uGridItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-de6f40c1"]]);
2171
- const _hoisted_1$o = { class: "u-swiper" };
2172
- const _hoisted_2$j = {
2168
+ const _hoisted_1$n = { class: "u-swiper" };
2169
+ const _hoisted_2$i = {
2173
2170
  key: 0,
2174
2171
  class: "u-swiper__loading"
2175
2172
  };
@@ -2281,7 +2278,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
2281
2278
  });
2282
2279
  return (_ctx, _cache) => {
2283
2280
  const _component_swiper = vue.resolveComponent("swiper");
2284
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$o, [
2281
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$n, [
2285
2282
  vue.createVNode(_component_swiper, {
2286
2283
  class: "u-swiper__wrapper",
2287
2284
  style: vue.normalizeStyle({ height: swiperHeight.value }),
@@ -2300,7 +2297,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
2300
2297
  ]),
2301
2298
  _: 3
2302
2299
  }, 8, ["style", "autoplay", "interval", "duration", "circular", "vertical", "current"]),
2303
- __props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$j, [..._cache[0] || (_cache[0] = [
2300
+ __props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$i, [..._cache[0] || (_cache[0] = [
2304
2301
  vue.createElementVNode("view", { class: "u-swiper__loading-icon" }, null, -1)
2305
2302
  ])])) : vue.createCommentVNode("", true),
2306
2303
  __props.showTitle && currentTitle.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$f, [
@@ -2383,11 +2380,11 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
2383
2380
  }
2384
2381
  });
2385
2382
  const uSwiperItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-ef481687"]]);
2386
- const _hoisted_1$n = {
2383
+ const _hoisted_1$m = {
2387
2384
  key: 0,
2388
2385
  class: "u-search__icon"
2389
2386
  };
2390
- const _hoisted_2$i = { class: "u-search__body" };
2387
+ const _hoisted_2$h = { class: "u-search__body" };
2391
2388
  const _hoisted_3$e = ["type", "value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "confirm-type", "adjust-position"];
2392
2389
  const _hoisted_4$a = { class: "u-search__action-text" };
2393
2390
  const __default__$p = {
@@ -2469,10 +2466,10 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
2469
2466
  class: "u-search__content",
2470
2467
  style: vue.normalizeStyle(contentStyle.value)
2471
2468
  }, [
2472
- __props.showSearchIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$n, [..._cache[0] || (_cache[0] = [
2469
+ __props.showSearchIcon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$m, [..._cache[0] || (_cache[0] = [
2473
2470
  vue.createElementVNode("text", { class: "u-search__icon-text" }, "🔍", -1)
2474
2471
  ])])) : vue.createCommentVNode("", true),
2475
- vue.createElementVNode("view", _hoisted_2$i, [
2472
+ vue.createElementVNode("view", _hoisted_2$h, [
2476
2473
  vue.createElementVNode("input", {
2477
2474
  class: "u-search__control",
2478
2475
  type: __props.type,
@@ -2513,7 +2510,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
2513
2510
  }
2514
2511
  });
2515
2512
  const uSearch = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-223b845c"]]);
2516
- const _hoisted_1$m = ["type", "value", "disabled"];
2513
+ const _hoisted_1$l = ["type", "value", "disabled"];
2517
2514
  const __default__$o = {
2518
2515
  options: {
2519
2516
  virtualHost: true,
@@ -2661,7 +2658,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
2661
2658
  onInput: handleInput,
2662
2659
  onBlur: handleBlur,
2663
2660
  onFocus: handleFocus
2664
- }, null, 46, _hoisted_1$m),
2661
+ }, null, 46, _hoisted_1$l),
2665
2662
  vue.createElementVNode("view", {
2666
2663
  class: vue.normalizeClass(["u-number-box__btn u-number-box__btn--plus", {
2667
2664
  "u-number-box__btn--disabled": plusDisabled.value
@@ -2679,8 +2676,8 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
2679
2676
  }
2680
2677
  });
2681
2678
  const uNumberBox = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-86153bb8"]]);
2682
- const _hoisted_1$l = { class: "u-upload" };
2683
- const _hoisted_2$h = { class: "u-upload__list" };
2679
+ const _hoisted_1$k = { class: "u-upload" };
2680
+ const _hoisted_2$g = { class: "u-upload__list" };
2684
2681
  const _hoisted_3$d = ["src", "onClick"];
2685
2682
  const _hoisted_4$9 = {
2686
2683
  key: 1,
@@ -2810,8 +2807,8 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
2810
2807
  fileList
2811
2808
  });
2812
2809
  return (_ctx, _cache) => {
2813
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$l, [
2814
- vue.createElementVNode("view", _hoisted_2$h, [
2810
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$k, [
2811
+ vue.createElementVNode("view", _hoisted_2$g, [
2815
2812
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fileList.value, (file, index) => {
2816
2813
  return vue.openBlock(), vue.createElementBlock("view", {
2817
2814
  key: index,
@@ -2882,8 +2879,8 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
2882
2879
  }
2883
2880
  });
2884
2881
  const uUpload = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-172bcb23"]]);
2885
- const _hoisted_1$k = ["value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "auto-height", "fixed", "cursor-spacing", "show-confirm-bar", "adjust-position"];
2886
- const _hoisted_2$g = {
2882
+ const _hoisted_1$j = ["value", "placeholder", "placeholder-style", "disabled", "maxlength", "focus", "auto-height", "fixed", "cursor-spacing", "show-confirm-bar", "adjust-position"];
2883
+ const _hoisted_2$f = {
2887
2884
  key: 0,
2888
2885
  class: "u-textarea__limit"
2889
2886
  };
@@ -2974,8 +2971,8 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
2974
2971
  onBlur: handleBlur,
2975
2972
  onConfirm: handleConfirm,
2976
2973
  onLinechange: handleLineChange
2977
- }, null, 44, _hoisted_1$k),
2978
- __props.showWordLimit && __props.maxlength ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$g, [
2974
+ }, null, 44, _hoisted_1$j),
2975
+ __props.showWordLimit && __props.maxlength ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$f, [
2979
2976
  vue.createElementVNode("text", _hoisted_3$c, vue.toDisplayString(currentLength.value) + "/" + vue.toDisplayString(__props.maxlength), 1)
2980
2977
  ])) : vue.createCommentVNode("", true)
2981
2978
  ], 2);
@@ -2983,11 +2980,11 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
2983
2980
  }
2984
2981
  });
2985
2982
  const uTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-82478b77"]]);
2986
- const _hoisted_1$j = {
2983
+ const _hoisted_1$i = {
2987
2984
  key: 0,
2988
2985
  class: "u-slider__min"
2989
2986
  };
2990
- const _hoisted_2$f = { class: "u-slider__label" };
2987
+ const _hoisted_2$e = { class: "u-slider__label" };
2991
2988
  const _hoisted_3$b = {
2992
2989
  key: 0,
2993
2990
  class: "u-slider__tooltip"
@@ -3232,8 +3229,8 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
3232
3229
  "u-slider--disabled": __props.disabled
3233
3230
  }])
3234
3231
  }, [
3235
- __props.showMinMax ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$j, [
3236
- vue.createElementVNode("text", _hoisted_2$f, vue.toDisplayString(__props.min), 1)
3232
+ __props.showMinMax ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$i, [
3233
+ vue.createElementVNode("text", _hoisted_2$e, vue.toDisplayString(__props.min), 1)
3237
3234
  ])) : vue.createCommentVNode("", true),
3238
3235
  vue.createElementVNode("view", {
3239
3236
  class: "u-slider__track",
@@ -3302,8 +3299,8 @@ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
3302
3299
  }
3303
3300
  });
3304
3301
  const uSlider = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-c099c413"]]);
3305
- const _hoisted_1$i = { class: "u-list" };
3306
- const _hoisted_2$e = {
3302
+ const _hoisted_1$h = { class: "u-list" };
3303
+ const _hoisted_2$d = {
3307
3304
  key: 0,
3308
3305
  class: "u-list__header"
3309
3306
  };
@@ -3353,8 +3350,8 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
3353
3350
  emit("load");
3354
3351
  };
3355
3352
  return (_ctx, _cache) => {
3356
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$i, [
3357
- _ctx.$slots.header || __props.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$e, [
3353
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$h, [
3354
+ _ctx.$slots.header || __props.header ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$d, [
3358
3355
  vue.renderSlot(_ctx.$slots, "header", {}, () => [
3359
3356
  vue.createTextVNode(vue.toDisplayString(__props.header), 1)
3360
3357
  ], true)
@@ -3386,11 +3383,11 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
3386
3383
  }
3387
3384
  });
3388
3385
  const uList = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-6d331927"]]);
3389
- const _hoisted_1$h = {
3386
+ const _hoisted_1$g = {
3390
3387
  key: 0,
3391
3388
  class: "u-list-item__icon"
3392
3389
  };
3393
- const _hoisted_2$d = ["src"];
3390
+ const _hoisted_2$c = ["src"];
3394
3391
  const _hoisted_3$9 = {
3395
3392
  key: 1,
3396
3393
  class: "u-list-item__icon-text"
@@ -3460,14 +3457,14 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
3460
3457
  }]),
3461
3458
  onClick: handleClick
3462
3459
  }, [
3463
- _ctx.$slots.icon || __props.icon || __props.thumb ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$h, [
3460
+ _ctx.$slots.icon || __props.icon || __props.thumb ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$g, [
3464
3461
  vue.renderSlot(_ctx.$slots, "icon", {}, () => [
3465
3462
  __props.thumb ? (vue.openBlock(), vue.createElementBlock("image", {
3466
3463
  key: 0,
3467
3464
  class: "u-list-item__thumb",
3468
3465
  src: __props.thumb,
3469
3466
  mode: "aspectFill"
3470
- }, null, 8, _hoisted_2$d)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$9, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
3467
+ }, null, 8, _hoisted_2$c)) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$9, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true)
3471
3468
  ], true)
3472
3469
  ])) : vue.createCommentVNode("", true),
3473
3470
  vue.createElementVNode("view", _hoisted_4$6, [
@@ -3499,11 +3496,11 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
3499
3496
  }
3500
3497
  });
3501
3498
  const uListItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-8c31b17c"]]);
3502
- const _hoisted_1$g = {
3499
+ const _hoisted_1$f = {
3503
3500
  key: 0,
3504
3501
  class: "u-line-progress__text u-line-progress__text--inside"
3505
3502
  };
3506
- const _hoisted_2$c = {
3503
+ const _hoisted_2$b = {
3507
3504
  key: 0,
3508
3505
  class: "u-line-progress__text"
3509
3506
  };
@@ -3572,16 +3569,16 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
3572
3569
  }]),
3573
3570
  style: vue.normalizeStyle(barStyle.value)
3574
3571
  }, [
3575
- __props.showText && __props.textInside && __props.percentage <= 100 ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$g, vue.toDisplayString(textContent.value), 1)) : vue.createCommentVNode("", true)
3572
+ __props.showText && __props.textInside && __props.percentage <= 100 ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$f, vue.toDisplayString(textContent.value), 1)) : vue.createCommentVNode("", true)
3576
3573
  ], 6)
3577
3574
  ], 4),
3578
- __props.showText && !__props.textInside ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$c, vue.toDisplayString(textContent.value), 1)) : vue.createCommentVNode("", true)
3575
+ __props.showText && !__props.textInside ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$b, vue.toDisplayString(textContent.value), 1)) : vue.createCommentVNode("", true)
3579
3576
  ], 4);
3580
3577
  };
3581
3578
  }
3582
3579
  });
3583
3580
  const uLineProgress = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-99121563"]]);
3584
- const _hoisted_1$f = { class: "u-count-down" };
3581
+ const _hoisted_1$e = { class: "u-count-down" };
3585
3582
  const __default__$h = {
3586
3583
  options: {
3587
3584
  virtualHost: true,
@@ -3704,7 +3701,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
3704
3701
  timeData
3705
3702
  });
3706
3703
  return (_ctx, _cache) => {
3707
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$f, [
3704
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$e, [
3708
3705
  vue.renderSlot(_ctx.$slots, "default", {
3709
3706
  time: timeData.value,
3710
3707
  current: current.value
@@ -3719,8 +3716,8 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
3719
3716
  }
3720
3717
  });
3721
3718
  const uCountDown = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-da70e500"]]);
3722
- const _hoisted_1$e = { class: "u-tooltip__content" };
3723
- const _hoisted_2$b = {
3719
+ const _hoisted_1$d = { class: "u-tooltip__content" };
3720
+ const _hoisted_2$a = {
3724
3721
  key: 0,
3725
3722
  class: "u-tooltip__actions"
3726
3723
  };
@@ -3897,8 +3894,8 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
3897
3894
  vue.createElementVNode("view", {
3898
3895
  class: vue.normalizeClass(["u-tooltip__arrow", `u-tooltip__arrow--${actualPlacement.value}`])
3899
3896
  }, null, 2),
3900
- vue.createElementVNode("view", _hoisted_1$e, [
3901
- __props.actions.length ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$b, [
3897
+ vue.createElementVNode("view", _hoisted_1$d, [
3898
+ __props.actions.length ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$a, [
3902
3899
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.actions, (action, index) => {
3903
3900
  return vue.openBlock(), vue.createElementBlock("view", {
3904
3901
  key: index,
@@ -3918,8 +3915,8 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
3918
3915
  }
3919
3916
  });
3920
3917
  const uTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-dd1bff02"]]);
3921
- const _hoisted_1$d = ["src"];
3922
- const _hoisted_2$a = {
3918
+ const _hoisted_1$c = ["src"];
3919
+ const _hoisted_2$9 = {
3923
3920
  key: 1,
3924
3921
  class: "u-avatar__text"
3925
3922
  };
@@ -4017,7 +4014,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
4017
4014
  src: __props.src,
4018
4015
  mode: "aspectFill",
4019
4016
  onError: handleError
4020
- }, null, 40, _hoisted_1$d)) : __props.text ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$a, vue.toDisplayString(displayText.value), 1)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$7, vue.toDisplayString(__props.icon || "👤"), 1))
4017
+ }, null, 40, _hoisted_1$c)) : __props.text ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_2$9, vue.toDisplayString(displayText.value), 1)) : (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$7, vue.toDisplayString(__props.icon || "👤"), 1))
4021
4018
  ], true),
4022
4019
  __props.badge && !badgeSlot.value ? (vue.openBlock(), vue.createElementBlock("view", {
4023
4020
  key: 0,
@@ -4031,8 +4028,8 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
4031
4028
  }
4032
4029
  });
4033
4030
  const uAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-10f478fe"]]);
4034
- const _hoisted_1$c = { class: "u-empty__image" };
4035
- const _hoisted_2$9 = ["src"];
4031
+ const _hoisted_1$b = { class: "u-empty__image" };
4032
+ const _hoisted_2$8 = ["src"];
4036
4033
  const _hoisted_3$6 = {
4037
4034
  key: 1,
4038
4035
  class: "u-empty__image-default"
@@ -4064,14 +4061,14 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
4064
4061
  return vue.openBlock(), vue.createElementBlock("view", {
4065
4062
  class: vue.normalizeClass(["u-empty", { "u-empty--inline": __props.inline }])
4066
4063
  }, [
4067
- vue.createElementVNode("view", _hoisted_1$c, [
4064
+ vue.createElementVNode("view", _hoisted_1$b, [
4068
4065
  vue.renderSlot(_ctx.$slots, "image", {}, () => [
4069
4066
  __props.image ? (vue.openBlock(), vue.createElementBlock("image", {
4070
4067
  key: 0,
4071
4068
  class: "u-empty__image-src",
4072
4069
  src: __props.image,
4073
4070
  mode: "aspectFit"
4074
- }, null, 8, _hoisted_2$9)) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$6, [..._cache[0] || (_cache[0] = [
4071
+ }, null, 8, _hoisted_2$8)) : (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$6, [..._cache[0] || (_cache[0] = [
4075
4072
  vue.createElementVNode("text", { class: "u-empty__icon" }, "📭", -1)
4076
4073
  ])]))
4077
4074
  ], true)
@@ -4089,11 +4086,11 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
4089
4086
  }
4090
4087
  });
4091
4088
  const uEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-853e089d"]]);
4092
- const _hoisted_1$b = {
4089
+ const _hoisted_1$a = {
4093
4090
  key: 0,
4094
4091
  class: "u-checkbox__check"
4095
4092
  };
4096
- const _hoisted_2$8 = {
4093
+ const _hoisted_2$7 = {
4097
4094
  key: 0,
4098
4095
  class: "u-checkbox__label"
4099
4096
  };
@@ -4172,9 +4169,9 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
4172
4169
  class: vue.normalizeClass(["u-checkbox__icon", iconClass.value]),
4173
4170
  style: vue.normalizeStyle(iconStyle.value)
4174
4171
  }, [
4175
- checked.value ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$b, "✓")) : vue.createCommentVNode("", true)
4172
+ checked.value ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_1$a, "✓")) : vue.createCommentVNode("", true)
4176
4173
  ], 6),
4177
- __props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$8, [
4174
+ __props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$7, [
4178
4175
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
4179
4176
  vue.createTextVNode(vue.toDisplayString(__props.label), 1)
4180
4177
  ], true)
@@ -4184,7 +4181,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
4184
4181
  }
4185
4182
  });
4186
4183
  const uCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-6f3ea0c6"]]);
4187
- const _hoisted_1$a = { class: "u-checkbox-group" };
4184
+ const _hoisted_1$9 = { class: "u-checkbox-group" };
4188
4185
  const __default__$c = {
4189
4186
  options: {
4190
4187
  virtualHost: true,
@@ -4227,18 +4224,18 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
4227
4224
  toggle
4228
4225
  });
4229
4226
  return (_ctx, _cache) => {
4230
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$a, [
4227
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$9, [
4231
4228
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
4232
4229
  ]);
4233
4230
  };
4234
4231
  }
4235
4232
  });
4236
4233
  const uCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-4e51c49e"]]);
4237
- const _hoisted_1$9 = {
4234
+ const _hoisted_1$8 = {
4238
4235
  key: 0,
4239
4236
  class: "u-radio__dot"
4240
4237
  };
4241
- const _hoisted_2$7 = {
4238
+ const _hoisted_2$6 = {
4242
4239
  key: 0,
4243
4240
  class: "u-radio__label"
4244
4241
  };
@@ -4314,9 +4311,9 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
4314
4311
  class: vue.normalizeClass(["u-radio__icon", iconClass.value]),
4315
4312
  style: vue.normalizeStyle(iconStyle.value)
4316
4313
  }, [
4317
- checked.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$9)) : vue.createCommentVNode("", true)
4314
+ checked.value ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$8)) : vue.createCommentVNode("", true)
4318
4315
  ], 6),
4319
- __props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$7, [
4316
+ __props.label || _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$6, [
4320
4317
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
4321
4318
  vue.createTextVNode(vue.toDisplayString(__props.label), 1)
4322
4319
  ], true)
@@ -4326,7 +4323,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
4326
4323
  }
4327
4324
  });
4328
4325
  const uRadio = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-3b4f8627"]]);
4329
- const _hoisted_1$8 = { class: "u-radio-group" };
4326
+ const _hoisted_1$7 = { class: "u-radio-group" };
4330
4327
  const __default__$a = {
4331
4328
  options: {
4332
4329
  virtualHost: true,
@@ -4360,15 +4357,15 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
4360
4357
  select
4361
4358
  });
4362
4359
  return (_ctx, _cache) => {
4363
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$8, [
4360
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$7, [
4364
4361
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
4365
4362
  ]);
4366
4363
  };
4367
4364
  }
4368
4365
  });
4369
4366
  const uRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-04ea4949"]]);
4370
- const _hoisted_1$7 = { class: "u-toast__content" };
4371
- const _hoisted_2$6 = {
4367
+ const _hoisted_1$6 = { class: "u-toast__content" };
4368
+ const _hoisted_2$5 = {
4372
4369
  key: 0,
4373
4370
  class: "u-toast__loading"
4374
4371
  };
@@ -4451,8 +4448,8 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
4451
4448
  class: vue.normalizeClass(["u-toast", toastClass.value]),
4452
4449
  style: vue.normalizeStyle(toastStyle.value)
4453
4450
  }, [
4454
- vue.createElementVNode("view", _hoisted_1$7, [
4455
- __props.type === "loading" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$6, [..._cache[0] || (_cache[0] = [
4451
+ vue.createElementVNode("view", _hoisted_1$6, [
4452
+ __props.type === "loading" ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$5, [..._cache[0] || (_cache[0] = [
4456
4453
  vue.createElementVNode("view", { class: "u-toast__loading-icon" }, null, -1)
4457
4454
  ])])) : __props.icon ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_3$5, vue.toDisplayString(__props.icon), 1)) : vue.createCommentVNode("", true),
4458
4455
  __props.message ? (vue.openBlock(), vue.createElementBlock("text", _hoisted_4$2, vue.toDisplayString(__props.message), 1)) : vue.createCommentVNode("", true)
@@ -4462,7 +4459,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
4462
4459
  }
4463
4460
  });
4464
4461
  const uToast = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-ffefead4"]]);
4465
- const _hoisted_1$6 = {
4462
+ const _hoisted_1$5 = {
4466
4463
  key: 0,
4467
4464
  class: "u-popup"
4468
4465
  };
@@ -4497,7 +4494,7 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
4497
4494
  emit("close");
4498
4495
  };
4499
4496
  return (_ctx, _cache) => {
4500
- return __props.visible ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$6, [
4497
+ return __props.visible ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$5, [
4501
4498
  vue.createElementVNode("view", {
4502
4499
  class: "u-popup__overlay",
4503
4500
  onClick: handleOverlayClick
@@ -4519,8 +4516,8 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
4519
4516
  }
4520
4517
  });
4521
4518
  const uPopup = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-dc430e12"]]);
4522
- const _hoisted_1$5 = { class: "u-code-input" };
4523
- const _hoisted_2$5 = { class: "u-code-input__wrapper" };
4519
+ const _hoisted_1$4 = { class: "u-code-input" };
4520
+ const _hoisted_2$4 = { class: "u-code-input__wrapper" };
4524
4521
  const _hoisted_3$4 = {
4525
4522
  key: 0,
4526
4523
  class: "u-code-input__char"
@@ -4618,8 +4615,8 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
4618
4615
  emit("blur");
4619
4616
  };
4620
4617
  return (_ctx, _cache) => {
4621
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$5, [
4622
- vue.createElementVNode("view", _hoisted_2$5, [
4618
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$4, [
4619
+ vue.createElementVNode("view", _hoisted_2$4, [
4623
4620
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.length, (i) => {
4624
4621
  return vue.openBlock(), vue.createElementBlock("view", {
4625
4622
  key: i,
@@ -4648,11 +4645,11 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
4648
4645
  }
4649
4646
  });
4650
4647
  const uCodeInput = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-9fffa23f"]]);
4651
- const _hoisted_1$4 = {
4648
+ const _hoisted_1$3 = {
4652
4649
  key: 0,
4653
4650
  class: "u-skeleton__content"
4654
4651
  };
4655
- const _hoisted_2$4 = { class: "u-skeleton__content" };
4652
+ const _hoisted_2$3 = { class: "u-skeleton__content" };
4656
4653
  const _hoisted_3$3 = { class: "u-skeleton__paragraphs" };
4657
4654
  const __default__$6 = {
4658
4655
  options: {
@@ -4714,7 +4711,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
4714
4711
  return style;
4715
4712
  };
4716
4713
  return (_ctx, _cache) => {
4717
- return !__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$4, [
4714
+ return !__props.loading ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$3, [
4718
4715
  vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
4719
4716
  ])) : (vue.openBlock(), vue.createElementBlock("view", {
4720
4717
  key: 1,
@@ -4725,7 +4722,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
4725
4722
  class: vue.normalizeClass(["u-skeleton__avatar", `u-skeleton__avatar--${__props.avatarShape}`]),
4726
4723
  style: vue.normalizeStyle(avatarStyle.value)
4727
4724
  }, null, 6)) : vue.createCommentVNode("", true),
4728
- vue.createElementVNode("view", _hoisted_2$4, [
4725
+ vue.createElementVNode("view", _hoisted_2$3, [
4729
4726
  __props.title ? (vue.openBlock(), vue.createElementBlock("view", {
4730
4727
  key: 0,
4731
4728
  class: "u-skeleton__title",
@@ -4879,8 +4876,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
4879
4876
  }
4880
4877
  });
4881
4878
  const uLink = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f60d6c27"]]);
4882
- const _hoisted_1$3 = { class: "u-read-more" };
4883
- const _hoisted_2$3 = { class: "u-read-more__toggle-text" };
4879
+ const _hoisted_1$2 = { class: "u-read-more" };
4880
+ const _hoisted_2$2 = { class: "u-read-more__toggle-text" };
4884
4881
  const _hoisted_3$2 = { class: "u-read-more__toggle-icon" };
4885
4882
  const __default__$3 = {
4886
4883
  options: {
@@ -4928,7 +4925,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
4928
4925
  }
4929
4926
  };
4930
4927
  return (_ctx, _cache) => {
4931
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$3, [
4928
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$2, [
4932
4929
  vue.createElementVNode("view", {
4933
4930
  class: "u-read-more__content",
4934
4931
  style: vue.normalizeStyle(contentStyle.value)
@@ -4940,7 +4937,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
4940
4937
  class: "u-read-more__toggle",
4941
4938
  onClick: handleToggle
4942
4939
  }, [
4943
- vue.createElementVNode("text", _hoisted_2$3, vue.toDisplayString(toggleText.value), 1),
4940
+ vue.createElementVNode("text", _hoisted_2$2, vue.toDisplayString(toggleText.value), 1),
4944
4941
  vue.createElementVNode("text", _hoisted_3$2, vue.toDisplayString(expanded.value ? "↑" : "↓"), 1)
4945
4942
  ])) : vue.createCommentVNode("", true)
4946
4943
  ]);
@@ -4948,8 +4945,8 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
4948
4945
  }
4949
4946
  });
4950
4947
  const uReadMore = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-b31720eb"]]);
4951
- const _hoisted_1$2 = { class: "u-tabbar" };
4952
- const _hoisted_2$2 = { class: "u-tabbar__nav-wrap" };
4948
+ const _hoisted_1$1 = { class: "u-tabbar" };
4949
+ const _hoisted_2$1 = { class: "u-tabbar__nav-wrap" };
4953
4950
  const _hoisted_3$1 = { class: "u-tabbar__center" };
4954
4951
  const _hoisted_4 = { class: "u-tabbar__center-brand" };
4955
4952
  const _hoisted_5 = { class: "u-tabbar__center-text" };
@@ -4980,8 +4977,8 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
4980
4977
  emit("tab-change", tab);
4981
4978
  };
4982
4979
  return (_ctx, _cache) => {
4983
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$2, [
4984
- vue.createElementVNode("view", _hoisted_2$2, [
4980
+ return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$1, [
4981
+ vue.createElementVNode("view", _hoisted_2$1, [
4985
4982
  vue.createElementVNode("view", {
4986
4983
  class: vue.normalizeClass(["u-tabbar__tab-btn", { "u-tabbar__tab-btn--active": __props.modelValue === __props.leftTab.value }]),
4987
4984
  onClick: _cache[0] || (_cache[0] = ($event) => switchTab(__props.leftTab.value))
@@ -5030,472 +5027,1723 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
5030
5027
  }
5031
5028
  });
5032
5029
  const uTabbar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-10cb84bc"]]);
5033
- const _hoisted_1$1 = { class: "u-qrcode" };
5034
- const _hoisted_2$1 = ["canvas-id", "id"];
5035
- const __default__$1 = {
5036
- options: {
5037
- virtualHost: true,
5038
- styleIsolation: "shared"
5039
- }
5040
- };
5041
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
5042
- ...__default__$1,
5043
- __name: "u-qrcode",
5044
- props: {
5045
- value: { default: "" },
5046
- size: { default: 200 },
5047
- color: { default: "#000000" },
5048
- bgColor: { default: "#ffffff" },
5049
- errorCorrectLevel: { default: "M" }
5050
- },
5051
- setup(__props) {
5052
- const props = __props;
5053
- const canvasId = vue.ref(`qrcode_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`);
5054
- class QRCode {
5055
- // 获取版本
5056
- static getVersion(dataLength) {
5057
- for (let v = 1; v <= 40; v++) {
5058
- if (this.CAPACITY[v] >= dataLength) return v;
5030
+ const qrcode = function(typeNumber, errorCorrectionLevel) {
5031
+ const PAD0 = 236;
5032
+ const PAD1 = 17;
5033
+ let _typeNumber = typeNumber;
5034
+ const _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
5035
+ let _modules = null;
5036
+ let _moduleCount = 0;
5037
+ let _dataCache = null;
5038
+ const _dataList = [];
5039
+ const _this = {};
5040
+ const makeImpl = function(test, maskPattern) {
5041
+ _moduleCount = _typeNumber * 4 + 17;
5042
+ _modules = function(moduleCount) {
5043
+ const modules = new Array(moduleCount);
5044
+ for (let row = 0; row < moduleCount; row += 1) {
5045
+ modules[row] = new Array(moduleCount);
5046
+ for (let col = 0; col < moduleCount; col += 1) {
5047
+ modules[row][col] = null;
5059
5048
  }
5060
- return 40;
5061
- }
5062
- // 生成二维码数据
5063
- static generate(data, ecl) {
5064
- const version = this.getVersion(data.length);
5065
- const size = version * 4 + 17;
5066
- const modules = [];
5067
- for (let i = 0; i < size; i++) {
5068
- modules[i] = new Array(size).fill(0);
5049
+ }
5050
+ return modules;
5051
+ }(_moduleCount);
5052
+ setupPositionProbePattern(0, 0);
5053
+ setupPositionProbePattern(_moduleCount - 7, 0);
5054
+ setupPositionProbePattern(0, _moduleCount - 7);
5055
+ setupPositionAdjustPattern();
5056
+ setupTimingPattern();
5057
+ setupTypeInfo(test, maskPattern);
5058
+ if (_typeNumber >= 7) {
5059
+ setupTypeNumber(test);
5060
+ }
5061
+ if (_dataCache == null) {
5062
+ _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
5063
+ }
5064
+ mapData(_dataCache, maskPattern);
5065
+ };
5066
+ const setupPositionProbePattern = function(row, col) {
5067
+ for (let r = -1; r <= 7; r += 1) {
5068
+ if (row + r <= -1 || _moduleCount <= row + r) continue;
5069
+ for (let c = -1; c <= 7; c += 1) {
5070
+ if (col + c <= -1 || _moduleCount <= col + c) continue;
5071
+ if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
5072
+ _modules[row + r][col + c] = true;
5073
+ } else {
5074
+ _modules[row + r][col + c] = false;
5069
5075
  }
5070
- this.addFinderPatterns(modules, size);
5071
- this.addTimingPatterns(modules, size);
5072
- if (version >= 2) {
5073
- this.addAlignmentPatterns(modules, version, size);
5076
+ }
5077
+ }
5078
+ };
5079
+ const getBestMaskPattern = function() {
5080
+ let minLostPoint = 0;
5081
+ let pattern = 0;
5082
+ for (let i = 0; i < 8; i += 1) {
5083
+ makeImpl(true, i);
5084
+ const lostPoint = QRUtil.getLostPoint(_this);
5085
+ if (i == 0 || minLostPoint > lostPoint) {
5086
+ minLostPoint = lostPoint;
5087
+ pattern = i;
5088
+ }
5089
+ }
5090
+ return pattern;
5091
+ };
5092
+ const setupTimingPattern = function() {
5093
+ for (let r = 8; r < _moduleCount - 8; r += 1) {
5094
+ if (_modules[r][6] != null) {
5095
+ continue;
5096
+ }
5097
+ _modules[r][6] = r % 2 == 0;
5098
+ }
5099
+ for (let c = 8; c < _moduleCount - 8; c += 1) {
5100
+ if (_modules[6][c] != null) {
5101
+ continue;
5102
+ }
5103
+ _modules[6][c] = c % 2 == 0;
5104
+ }
5105
+ };
5106
+ const setupPositionAdjustPattern = function() {
5107
+ const pos = QRUtil.getPatternPosition(_typeNumber);
5108
+ for (let i = 0; i < pos.length; i += 1) {
5109
+ for (let j = 0; j < pos.length; j += 1) {
5110
+ const row = pos[i];
5111
+ const col = pos[j];
5112
+ if (_modules[row][col] != null) {
5113
+ continue;
5074
5114
  }
5075
- this.addDarkModule(modules, size);
5076
- const codewords = this.encodeCodewords(data, version, ecl);
5077
- this.fillData(modules, codewords, size);
5078
- const bestMask = this.findBestMask(modules, size);
5079
- this.applyMask(modules, size, bestMask);
5080
- this.addFormatInfo(modules, size, ecl, bestMask);
5081
- return { version, size, modules };
5082
- }
5083
- // 添加定位图案
5084
- static addFinderPatterns(modules, size) {
5085
- const positions = [[0, 0], [size - 7, 0], [0, size - 7]];
5086
- for (const [row, col] of positions) {
5087
- for (let r = 0; r < 7; r++) {
5088
- for (let c = 0; c < 7; c++) {
5089
- if (r === 0 || r === 6 || c === 0 || c === 6 || r >= 2 && r <= 4 && c >= 2 && c <= 4) {
5090
- modules[row + r][col + c] = 1;
5091
- }
5115
+ for (let r = -2; r <= 2; r += 1) {
5116
+ for (let c = -2; c <= 2; c += 1) {
5117
+ if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
5118
+ _modules[row + r][col + c] = true;
5119
+ } else {
5120
+ _modules[row + r][col + c] = false;
5092
5121
  }
5093
5122
  }
5094
- for (let i = 0; i < 8; i++) {
5095
- if (row === 0 && i < size && modules[7]) modules[7][i] = 0;
5096
- if (row === 0 && i < size && modules[i]) modules[i][7] = 0;
5097
- if (row === size - 7 && i < size && modules[7]) modules[7][size - 8 + i] = 0;
5098
- if (row === size - 7 && i < size && modules[i]) modules[i][size - 8] = 0;
5099
- if (row === 0 && col === size - 7 && i < size && modules[size - 8]) modules[size - 8][i] = 0;
5100
- if (row === 0 && col === size - 7 && i < size && modules[size - 1 - i]) modules[size - 1 - i][7] = 0;
5101
- }
5102
5123
  }
5103
5124
  }
5104
- // 添加时序图案
5105
- static addTimingPatterns(modules, size) {
5106
- for (let i = 8; i < size - 8; i++) {
5107
- modules[6][i] = i % 2 === 0 ? 1 : 0;
5108
- modules[i][6] = i % 2 === 0 ? 1 : 0;
5109
- }
5125
+ }
5126
+ };
5127
+ const setupTypeNumber = function(test) {
5128
+ const bits = QRUtil.getBCHTypeNumber(_typeNumber);
5129
+ for (let i = 0; i < 18; i += 1) {
5130
+ const mod = !test && (bits >> i & 1) == 1;
5131
+ _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
5132
+ }
5133
+ for (let i = 0; i < 18; i += 1) {
5134
+ const mod = !test && (bits >> i & 1) == 1;
5135
+ _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
5136
+ }
5137
+ };
5138
+ const setupTypeInfo = function(test, maskPattern) {
5139
+ const data = _errorCorrectionLevel << 3 | maskPattern;
5140
+ const bits = QRUtil.getBCHTypeInfo(data);
5141
+ for (let i = 0; i < 15; i += 1) {
5142
+ const mod = !test && (bits >> i & 1) == 1;
5143
+ if (i < 6) {
5144
+ _modules[i][8] = mod;
5145
+ } else if (i < 8) {
5146
+ _modules[i + 1][8] = mod;
5147
+ } else {
5148
+ _modules[_moduleCount - 15 + i][8] = mod;
5110
5149
  }
5111
- // 添加定位图案
5112
- static addAlignmentPatterns(modules, version, size) {
5113
- const positions = this.getAlignmentPositions(version, size);
5114
- for (const row of positions) {
5115
- for (const col of positions) {
5116
- if (modules[row][col] !== 0) continue;
5117
- for (let r = -2; r <= 2; r++) {
5118
- for (let c = -2; c <= 2; c++) {
5119
- if (row + r >= 0 && row + r < size && col + c >= 0 && col + c < size) {
5120
- if (Math.abs(r) === 2 || Math.abs(c) === 2 || r === 0 && c === 0) {
5121
- modules[row + r][col + c] = 1;
5122
- } else {
5123
- modules[row + r][col + c] = 0;
5124
- }
5125
- }
5126
- }
5150
+ }
5151
+ for (let i = 0; i < 15; i += 1) {
5152
+ const mod = !test && (bits >> i & 1) == 1;
5153
+ if (i < 8) {
5154
+ _modules[8][_moduleCount - i - 1] = mod;
5155
+ } else if (i < 9) {
5156
+ _modules[8][15 - i - 1 + 1] = mod;
5157
+ } else {
5158
+ _modules[8][15 - i - 1] = mod;
5159
+ }
5160
+ }
5161
+ _modules[_moduleCount - 8][8] = !test;
5162
+ };
5163
+ const mapData = function(data, maskPattern) {
5164
+ let inc = -1;
5165
+ let row = _moduleCount - 1;
5166
+ let bitIndex = 7;
5167
+ let byteIndex = 0;
5168
+ const maskFunc = QRUtil.getMaskFunction(maskPattern);
5169
+ for (let col = _moduleCount - 1; col > 0; col -= 2) {
5170
+ if (col == 6) col -= 1;
5171
+ while (true) {
5172
+ for (let c = 0; c < 2; c += 1) {
5173
+ if (_modules[row][col - c] == null) {
5174
+ let dark = false;
5175
+ if (byteIndex < data.length) {
5176
+ dark = (data[byteIndex] >>> bitIndex & 1) == 1;
5177
+ }
5178
+ const mask = maskFunc(row, col - c);
5179
+ if (mask) {
5180
+ dark = !dark;
5181
+ }
5182
+ _modules[row][col - c] = dark;
5183
+ bitIndex -= 1;
5184
+ if (bitIndex == -1) {
5185
+ byteIndex += 1;
5186
+ bitIndex = 7;
5127
5187
  }
5128
5188
  }
5129
5189
  }
5130
- }
5131
- // 获取定位图案位置
5132
- static getAlignmentPositions(version, size) {
5133
- if (version === 1) return [];
5134
- const positions = [6];
5135
- const step = version === 32 ? 26 : Math.ceil((size - 13) / (Math.floor(version / 7) + 1));
5136
- let pos = size - 7;
5137
- while (pos > 6) {
5138
- positions.unshift(pos);
5139
- pos -= step;
5140
- }
5141
- return positions;
5142
- }
5143
- // 添加暗模块
5144
- static addDarkModule(modules, size) {
5145
- modules[size - 8][8] = 1;
5146
- }
5147
- // 编码码字
5148
- static encodeCodewords(data, version, ecl) {
5149
- const bits = [];
5150
- bits.push(0, 1, 0, 0);
5151
- const cciBits = version <= 9 ? 8 : 16;
5152
- for (let i = cciBits - 1; i >= 0; i--) {
5153
- bits.push(data.length >> i & 1);
5154
- }
5155
- for (const char of data) {
5156
- const code2 = char.charCodeAt(0);
5157
- for (let i = 7; i >= 0; i--) {
5158
- bits.push(code2 >> i & 1);
5159
- }
5190
+ row += inc;
5191
+ if (row < 0 || _moduleCount <= row) {
5192
+ row -= inc;
5193
+ inc = -inc;
5194
+ break;
5160
5195
  }
5161
- const totalDataBits = (this.TOTAL_CODEWORDS[version] - this.ECC_CODEWORDS[version]) * 8;
5162
- const termLen = Math.min(4, totalDataBits - bits.length);
5163
- for (let i = 0; i < termLen; i++) bits.push(0);
5164
- while (bits.length % 8 !== 0) bits.push(0);
5165
- const padBytes = [236, 17];
5166
- let padIdx = 0;
5167
- while (bits.length < totalDataBits) {
5168
- for (let i = 7; i >= 0; i--) {
5169
- bits.push(padBytes[padIdx] >> i & 1);
5170
- }
5171
- padIdx = (padIdx + 1) % 2;
5196
+ }
5197
+ }
5198
+ };
5199
+ const createBytes = function(buffer, rsBlocks) {
5200
+ let offset = 0;
5201
+ let maxDcCount = 0;
5202
+ let maxEcCount = 0;
5203
+ const dcdata = new Array(rsBlocks.length);
5204
+ const ecdata = new Array(rsBlocks.length);
5205
+ for (let r = 0; r < rsBlocks.length; r += 1) {
5206
+ const dcCount = rsBlocks[r].dataCount;
5207
+ const ecCount = rsBlocks[r].totalCount - dcCount;
5208
+ maxDcCount = Math.max(maxDcCount, dcCount);
5209
+ maxEcCount = Math.max(maxEcCount, ecCount);
5210
+ dcdata[r] = new Array(dcCount);
5211
+ for (let i = 0; i < dcdata[r].length; i += 1) {
5212
+ dcdata[r][i] = 255 & buffer.getBuffer()[i + offset];
5213
+ }
5214
+ offset += dcCount;
5215
+ const rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
5216
+ const rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
5217
+ const modPoly = rawPoly.mod(rsPoly);
5218
+ ecdata[r] = new Array(rsPoly.getLength() - 1);
5219
+ for (let i = 0; i < ecdata[r].length; i += 1) {
5220
+ const modIndex = i + modPoly.getLength() - ecdata[r].length;
5221
+ ecdata[r][i] = modIndex >= 0 ? modPoly.getAt(modIndex) : 0;
5222
+ }
5223
+ }
5224
+ let totalCodeCount = 0;
5225
+ for (let i = 0; i < rsBlocks.length; i += 1) {
5226
+ totalCodeCount += rsBlocks[i].totalCount;
5227
+ }
5228
+ const data = new Array(totalCodeCount);
5229
+ let index = 0;
5230
+ for (let i = 0; i < maxDcCount; i += 1) {
5231
+ for (let r = 0; r < rsBlocks.length; r += 1) {
5232
+ if (i < dcdata[r].length) {
5233
+ data[index] = dcdata[r][i];
5234
+ index += 1;
5172
5235
  }
5173
- const bytes = [];
5174
- for (let i = 0; i < bits.length; i += 8) {
5175
- let b = 0;
5176
- for (let j = 0; j < 8; j++) b = b << 1 | bits[i + j];
5177
- bytes.push(b);
5236
+ }
5237
+ }
5238
+ for (let i = 0; i < maxEcCount; i += 1) {
5239
+ for (let r = 0; r < rsBlocks.length; r += 1) {
5240
+ if (i < ecdata[r].length) {
5241
+ data[index] = ecdata[r][i];
5242
+ index += 1;
5178
5243
  }
5179
- const eccBytes = this.generateECC(bytes, this.ECC_CODEWORDS[version]);
5180
- return [...bytes, ...eccBytes];
5181
- }
5182
- // Reed-Solomon 纠错码生成
5183
- static generateECC(data, eccCount) {
5184
- const GF_EXP = new Array(512);
5185
- const GF_LOG = new Array(256);
5186
- let x = 1;
5187
- for (let i = 0; i < 255; i++) {
5188
- GF_EXP[i] = x;
5189
- GF_LOG[x] = i;
5190
- x = x * 2;
5191
- if (x >= 256) x ^= 285;
5244
+ }
5245
+ }
5246
+ return data;
5247
+ };
5248
+ const createData = function(typeNumber2, errorCorrectionLevel2, dataList) {
5249
+ const rsBlocks = QRRSBlock.getRSBlocks(typeNumber2, errorCorrectionLevel2);
5250
+ const buffer = qrBitBuffer();
5251
+ for (let i = 0; i < dataList.length; i += 1) {
5252
+ const data = dataList[i];
5253
+ buffer.put(data.getMode(), 4);
5254
+ buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber2));
5255
+ data.write(buffer);
5256
+ }
5257
+ let totalDataCount = 0;
5258
+ for (let i = 0; i < rsBlocks.length; i += 1) {
5259
+ totalDataCount += rsBlocks[i].dataCount;
5260
+ }
5261
+ if (buffer.getLengthInBits() > totalDataCount * 8) {
5262
+ throw "code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")";
5263
+ }
5264
+ if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
5265
+ buffer.put(0, 4);
5266
+ }
5267
+ while (buffer.getLengthInBits() % 8 != 0) {
5268
+ buffer.putBit(false);
5269
+ }
5270
+ while (true) {
5271
+ if (buffer.getLengthInBits() >= totalDataCount * 8) {
5272
+ break;
5273
+ }
5274
+ buffer.put(PAD0, 8);
5275
+ if (buffer.getLengthInBits() >= totalDataCount * 8) {
5276
+ break;
5277
+ }
5278
+ buffer.put(PAD1, 8);
5279
+ }
5280
+ return createBytes(buffer, rsBlocks);
5281
+ };
5282
+ _this.addData = function(data, mode) {
5283
+ mode = mode || "Byte";
5284
+ let newData = null;
5285
+ switch (mode) {
5286
+ case "Numeric":
5287
+ newData = qrNumber(data);
5288
+ break;
5289
+ case "Alphanumeric":
5290
+ newData = qrAlphaNum(data);
5291
+ break;
5292
+ case "Byte":
5293
+ newData = qr8BitByte(data);
5294
+ break;
5295
+ case "Kanji":
5296
+ newData = qrKanji(data);
5297
+ break;
5298
+ default:
5299
+ throw "mode:" + mode;
5300
+ }
5301
+ _dataList.push(newData);
5302
+ _dataCache = null;
5303
+ };
5304
+ _this.isDark = function(row, col) {
5305
+ if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
5306
+ throw row + "," + col;
5307
+ }
5308
+ return _modules[row][col];
5309
+ };
5310
+ _this.getModuleCount = function() {
5311
+ return _moduleCount;
5312
+ };
5313
+ _this.make = function() {
5314
+ if (_typeNumber < 1) {
5315
+ let typeNumber2 = 1;
5316
+ for (; typeNumber2 < 40; typeNumber2++) {
5317
+ const rsBlocks = QRRSBlock.getRSBlocks(typeNumber2, _errorCorrectionLevel);
5318
+ const buffer = qrBitBuffer();
5319
+ for (let i = 0; i < _dataList.length; i++) {
5320
+ const data = _dataList[i];
5321
+ buffer.put(data.getMode(), 4);
5322
+ buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber2));
5323
+ data.write(buffer);
5192
5324
  }
5193
- for (let i = 255; i < 512; i++) {
5194
- GF_EXP[i] = GF_EXP[i - 255];
5325
+ let totalDataCount = 0;
5326
+ for (let i = 0; i < rsBlocks.length; i++) {
5327
+ totalDataCount += rsBlocks[i].dataCount;
5195
5328
  }
5196
- const gfMul = (a, b) => {
5197
- if (a === 0 || b === 0) return 0;
5198
- return GF_EXP[GF_LOG[a] + GF_LOG[b]];
5199
- };
5200
- const genPoly = [1];
5201
- for (let i = 0; i < eccCount; i++) {
5202
- const newPoly = new Array(genPoly.length + 1).fill(0);
5203
- for (let j = 0; j < genPoly.length; j++) {
5204
- newPoly[j] ^= genPoly[j];
5205
- newPoly[j + 1] ^= gfMul(genPoly[j], GF_EXP[i]);
5206
- }
5207
- genPoly = newPoly;
5329
+ if (buffer.getLengthInBits() <= totalDataCount * 8) {
5330
+ break;
5208
5331
  }
5209
- const ecc = new Array(eccCount).fill(0);
5210
- for (const byte of data) {
5211
- const factor = byte ^ ecc[0];
5212
- ecc.shift();
5213
- ecc.push(0);
5214
- for (let i = 0; i < ecc.length; i++) {
5215
- ecc[i] ^= gfMul(genPoly[i], factor);
5216
- }
5332
+ }
5333
+ _typeNumber = typeNumber2;
5334
+ }
5335
+ makeImpl(false, getBestMaskPattern());
5336
+ };
5337
+ _this.createTableTag = function(cellSize, margin) {
5338
+ cellSize = cellSize || 2;
5339
+ margin = typeof margin == "undefined" ? cellSize * 4 : margin;
5340
+ let qrHtml = "";
5341
+ qrHtml += '<table style="';
5342
+ qrHtml += " border-width: 0px; border-style: none;";
5343
+ qrHtml += " border-collapse: collapse;";
5344
+ qrHtml += " padding: 0px; margin: " + margin + "px;";
5345
+ qrHtml += '">';
5346
+ qrHtml += "<tbody>";
5347
+ for (let r = 0; r < _this.getModuleCount(); r += 1) {
5348
+ qrHtml += "<tr>";
5349
+ for (let c = 0; c < _this.getModuleCount(); c += 1) {
5350
+ qrHtml += '<td style="';
5351
+ qrHtml += " border-width: 0px; border-style: none;";
5352
+ qrHtml += " border-collapse: collapse;";
5353
+ qrHtml += " padding: 0px; margin: 0px;";
5354
+ qrHtml += " width: " + cellSize + "px;";
5355
+ qrHtml += " height: " + cellSize + "px;";
5356
+ qrHtml += " background-color: ";
5357
+ qrHtml += _this.isDark(r, c) ? "#000000" : "#ffffff";
5358
+ qrHtml += ";";
5359
+ qrHtml += '"/>';
5360
+ }
5361
+ qrHtml += "</tr>";
5362
+ }
5363
+ qrHtml += "</tbody>";
5364
+ qrHtml += "</table>";
5365
+ return qrHtml;
5366
+ };
5367
+ _this.createSvgTag = function(cellSize, margin, alt, title) {
5368
+ let opts = {};
5369
+ if (typeof arguments[0] == "object") {
5370
+ opts = arguments[0];
5371
+ cellSize = opts.cellSize;
5372
+ margin = opts.margin;
5373
+ alt = opts.alt;
5374
+ title = opts.title;
5375
+ }
5376
+ cellSize = cellSize || 2;
5377
+ margin = typeof margin == "undefined" ? cellSize * 4 : margin;
5378
+ alt = typeof alt === "string" ? { text: alt } : alt || {};
5379
+ alt.text = alt.text || null;
5380
+ alt.id = alt.text ? alt.id || "qrcode-description" : null;
5381
+ title = typeof title === "string" ? { text: title } : title || {};
5382
+ title.text = title.text || null;
5383
+ title.id = title.text ? title.id || "qrcode-title" : null;
5384
+ const size = _this.getModuleCount() * cellSize + margin * 2;
5385
+ let c, mc, r, mr, qrSvg = "", rect;
5386
+ rect = "l" + cellSize + ",0 0," + cellSize + " -" + cellSize + ",0 0,-" + cellSize + "z ";
5387
+ qrSvg += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"';
5388
+ qrSvg += !opts.scalable ? ' width="' + size + 'px" height="' + size + 'px"' : "";
5389
+ qrSvg += ' viewBox="0 0 ' + size + " " + size + '" ';
5390
+ qrSvg += ' preserveAspectRatio="xMinYMin meet"';
5391
+ qrSvg += title.text || alt.text ? ' role="img" aria-labelledby="' + escapeXml([title.id, alt.id].join(" ").trim()) + '"' : "";
5392
+ qrSvg += ">";
5393
+ qrSvg += title.text ? '<title id="' + escapeXml(title.id) + '">' + escapeXml(title.text) + "</title>" : "";
5394
+ qrSvg += alt.text ? '<description id="' + escapeXml(alt.id) + '">' + escapeXml(alt.text) + "</description>" : "";
5395
+ qrSvg += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';
5396
+ qrSvg += '<path d="';
5397
+ for (r = 0; r < _this.getModuleCount(); r += 1) {
5398
+ mr = r * cellSize + margin;
5399
+ for (c = 0; c < _this.getModuleCount(); c += 1) {
5400
+ if (_this.isDark(r, c)) {
5401
+ mc = c * cellSize + margin;
5402
+ qrSvg += "M" + mc + "," + mr + rect;
5217
5403
  }
5218
- return ecc;
5219
- }
5220
- // 填充数据到矩阵
5221
- static fillData(modules, codewords, size) {
5222
- for (let row = 0; row < size; row++) {
5223
- for (let col = 0; col < size; col++) {
5224
- if (modules[row][col] !== 0) {
5225
- modules[row][col] = -1;
5226
- }
5227
- }
5404
+ }
5405
+ }
5406
+ qrSvg += '" stroke="transparent" fill="black"/>';
5407
+ qrSvg += "</svg>";
5408
+ return qrSvg;
5409
+ };
5410
+ _this.createDataURL = function(cellSize, margin) {
5411
+ cellSize = cellSize || 2;
5412
+ margin = typeof margin == "undefined" ? cellSize * 4 : margin;
5413
+ const size = _this.getModuleCount() * cellSize + margin * 2;
5414
+ const min = margin;
5415
+ const max = size - margin;
5416
+ return createDataURL(size, size, function(x, y) {
5417
+ if (min <= x && x < max && min <= y && y < max) {
5418
+ const c = Math.floor((x - min) / cellSize);
5419
+ const r = Math.floor((y - min) / cellSize);
5420
+ return _this.isDark(r, c) ? 0 : 1;
5421
+ } else {
5422
+ return 1;
5423
+ }
5424
+ });
5425
+ };
5426
+ _this.createImgTag = function(cellSize, margin, alt) {
5427
+ cellSize = cellSize || 2;
5428
+ margin = typeof margin == "undefined" ? cellSize * 4 : margin;
5429
+ const size = _this.getModuleCount() * cellSize + margin * 2;
5430
+ let img = "";
5431
+ img += "<img";
5432
+ img += ' src="';
5433
+ img += _this.createDataURL(cellSize, margin);
5434
+ img += '"';
5435
+ img += ' width="';
5436
+ img += size;
5437
+ img += '"';
5438
+ img += ' height="';
5439
+ img += size;
5440
+ img += '"';
5441
+ if (alt) {
5442
+ img += ' alt="';
5443
+ img += escapeXml(alt);
5444
+ img += '"';
5445
+ }
5446
+ img += "/>";
5447
+ return img;
5448
+ };
5449
+ const escapeXml = function(s) {
5450
+ let escaped = "";
5451
+ for (let i = 0; i < s.length; i += 1) {
5452
+ const c = s.charAt(i);
5453
+ switch (c) {
5454
+ case "<":
5455
+ escaped += "&lt;";
5456
+ break;
5457
+ case ">":
5458
+ escaped += "&gt;";
5459
+ break;
5460
+ case "&":
5461
+ escaped += "&amp;";
5462
+ break;
5463
+ case '"':
5464
+ escaped += "&quot;";
5465
+ break;
5466
+ default:
5467
+ escaped += c;
5468
+ break;
5469
+ }
5470
+ }
5471
+ return escaped;
5472
+ };
5473
+ const _createHalfASCII = function(margin) {
5474
+ const cellSize = 1;
5475
+ margin = typeof margin == "undefined" ? cellSize * 2 : margin;
5476
+ const size = _this.getModuleCount() * cellSize + margin * 2;
5477
+ const min = margin;
5478
+ const max = size - margin;
5479
+ let y, x, r1, r2, p;
5480
+ const blocks = {
5481
+ "██": "█",
5482
+ "█ ": "▀",
5483
+ " █": "▄",
5484
+ " ": " "
5485
+ };
5486
+ const blocksLastLineNoMargin = {
5487
+ "██": "▀",
5488
+ "█ ": "▀",
5489
+ " █": " ",
5490
+ " ": " "
5491
+ };
5492
+ let ascii = "";
5493
+ for (y = 0; y < size; y += 2) {
5494
+ r1 = Math.floor((y - min) / cellSize);
5495
+ r2 = Math.floor((y + 1 - min) / cellSize);
5496
+ for (x = 0; x < size; x += 1) {
5497
+ p = "█";
5498
+ if (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) {
5499
+ p = " ";
5228
5500
  }
5229
- for (let i = 0; i < 9; i++) {
5230
- if (modules[8][i] === 0) modules[8][i] = -1;
5231
- if (modules[i][8] === 0) modules[i][8] = -1;
5501
+ if (min <= x && x < max && min <= y + 1 && y + 1 < max && _this.isDark(r2, Math.floor((x - min) / cellSize))) {
5502
+ p += " ";
5503
+ } else {
5504
+ p += "█";
5232
5505
  }
5233
- for (let i = 0; i < 8; i++) {
5234
- if (modules[8][size - 1 - i] === 0) modules[8][size - 1 - i] = -1;
5235
- if (modules[size - 1 - i][8] === 0) modules[size - 1 - i][8] = -1;
5506
+ ascii += margin < 1 && y + 1 >= max ? blocksLastLineNoMargin[p] : blocks[p];
5507
+ }
5508
+ ascii += "\n";
5509
+ }
5510
+ if (size % 2 && margin > 0) {
5511
+ return ascii.substring(0, ascii.length - size - 1) + Array(size + 1).join("▀");
5512
+ }
5513
+ return ascii.substring(0, ascii.length - 1);
5514
+ };
5515
+ _this.createASCII = function(cellSize, margin) {
5516
+ cellSize = cellSize || 1;
5517
+ if (cellSize < 2) {
5518
+ return _createHalfASCII(margin);
5519
+ }
5520
+ cellSize -= 1;
5521
+ margin = typeof margin == "undefined" ? cellSize * 2 : margin;
5522
+ const size = _this.getModuleCount() * cellSize + margin * 2;
5523
+ const min = margin;
5524
+ const max = size - margin;
5525
+ let y, x, r, p;
5526
+ const white = Array(cellSize + 1).join("██");
5527
+ const black = Array(cellSize + 1).join(" ");
5528
+ let ascii = "";
5529
+ let line = "";
5530
+ for (y = 0; y < size; y += 1) {
5531
+ r = Math.floor((y - min) / cellSize);
5532
+ line = "";
5533
+ for (x = 0; x < size; x += 1) {
5534
+ p = 1;
5535
+ if (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) {
5536
+ p = 0;
5236
5537
  }
5237
- let bitIdx = 0;
5238
- let upward = true;
5239
- for (let col = size - 1; col >= 0; col -= 2) {
5240
- if (col === 6) col = 5;
5241
- for (let row = upward ? size - 1 : 0; upward ? row >= 0 : row < size; upward ? row-- : row++) {
5242
- for (let c = 0; c < 2; c++) {
5243
- const tc = col - c;
5244
- if (tc >= 0 && modules[row][tc] === 0) {
5245
- let bit = 0;
5246
- if (bitIdx < codewords.length * 8) {
5247
- bit = codewords[Math.floor(bitIdx / 8)] >> 7 - bitIdx % 8 & 1;
5248
- }
5249
- modules[row][tc] = bit;
5250
- bitIdx++;
5251
- }
5252
- }
5538
+ line += p ? white : black;
5539
+ }
5540
+ for (r = 0; r < cellSize; r += 1) {
5541
+ ascii += line + "\n";
5542
+ }
5543
+ }
5544
+ return ascii.substring(0, ascii.length - 1);
5545
+ };
5546
+ _this.renderTo2dContext = function(context, cellSize) {
5547
+ cellSize = cellSize || 2;
5548
+ const length = _this.getModuleCount();
5549
+ for (let row = 0; row < length; row++) {
5550
+ for (let col = 0; col < length; col++) {
5551
+ context.fillStyle = _this.isDark(row, col) ? "black" : "white";
5552
+ context.fillRect(col * cellSize, row * cellSize, cellSize, cellSize);
5553
+ }
5554
+ }
5555
+ };
5556
+ return _this;
5557
+ };
5558
+ qrcode.stringToBytes = function(s) {
5559
+ const bytes = [];
5560
+ for (let i = 0; i < s.length; i += 1) {
5561
+ const c = s.charCodeAt(i);
5562
+ bytes.push(c & 255);
5563
+ }
5564
+ return bytes;
5565
+ };
5566
+ qrcode.createStringToBytes = function(unicodeData, numChars) {
5567
+ const unicodeMap = function() {
5568
+ const bin = base64DecodeInputStream(unicodeData);
5569
+ const read = function() {
5570
+ const b = bin.read();
5571
+ if (b == -1) throw "eof";
5572
+ return b;
5573
+ };
5574
+ let count = 0;
5575
+ const unicodeMap2 = {};
5576
+ while (true) {
5577
+ const b0 = bin.read();
5578
+ if (b0 == -1) break;
5579
+ const b1 = read();
5580
+ const b2 = read();
5581
+ const b3 = read();
5582
+ const k = String.fromCharCode(b0 << 8 | b1);
5583
+ const v = b2 << 8 | b3;
5584
+ unicodeMap2[k] = v;
5585
+ count += 1;
5586
+ }
5587
+ if (count != numChars) {
5588
+ throw count + " != " + numChars;
5589
+ }
5590
+ return unicodeMap2;
5591
+ }();
5592
+ const unknownChar = "?".charCodeAt(0);
5593
+ return function(s) {
5594
+ const bytes = [];
5595
+ for (let i = 0; i < s.length; i += 1) {
5596
+ const c = s.charCodeAt(i);
5597
+ if (c < 128) {
5598
+ bytes.push(c);
5599
+ } else {
5600
+ const b = unicodeMap[s.charAt(i)];
5601
+ if (typeof b == "number") {
5602
+ if ((b & 255) == b) {
5603
+ bytes.push(b);
5604
+ } else {
5605
+ bytes.push(b >>> 8);
5606
+ bytes.push(b & 255);
5253
5607
  }
5254
- upward = !upward;
5608
+ } else {
5609
+ bytes.push(unknownChar);
5255
5610
  }
5256
5611
  }
5257
- // 寻找最佳掩码
5258
- static findBestMask(modules, size) {
5259
- let bestMask = 0;
5260
- let bestScore = Infinity;
5261
- for (let mask = 0; mask < 8; mask++) {
5262
- const testModules = modules.map((row) => [...row]);
5263
- this.applyMask(testModules, size, mask);
5264
- const score = this.evaluateMask(testModules, size);
5265
- if (score < bestScore) {
5266
- bestScore = score;
5267
- bestMask = mask;
5612
+ }
5613
+ return bytes;
5614
+ };
5615
+ };
5616
+ const QRMode = {
5617
+ MODE_NUMBER: 1 << 0,
5618
+ MODE_ALPHA_NUM: 1 << 1,
5619
+ MODE_8BIT_BYTE: 1 << 2,
5620
+ MODE_KANJI: 1 << 3
5621
+ };
5622
+ const QRErrorCorrectionLevel = {
5623
+ L: 1,
5624
+ M: 0,
5625
+ Q: 3,
5626
+ H: 2
5627
+ };
5628
+ const QRMaskPattern = {
5629
+ PATTERN000: 0,
5630
+ PATTERN001: 1,
5631
+ PATTERN010: 2,
5632
+ PATTERN011: 3,
5633
+ PATTERN100: 4,
5634
+ PATTERN101: 5,
5635
+ PATTERN110: 6,
5636
+ PATTERN111: 7
5637
+ };
5638
+ const QRUtil = function() {
5639
+ const PATTERN_POSITION_TABLE = [
5640
+ [],
5641
+ [6, 18],
5642
+ [6, 22],
5643
+ [6, 26],
5644
+ [6, 30],
5645
+ [6, 34],
5646
+ [6, 22, 38],
5647
+ [6, 24, 42],
5648
+ [6, 26, 46],
5649
+ [6, 28, 50],
5650
+ [6, 30, 54],
5651
+ [6, 32, 58],
5652
+ [6, 34, 62],
5653
+ [6, 26, 46, 66],
5654
+ [6, 26, 48, 70],
5655
+ [6, 26, 50, 74],
5656
+ [6, 30, 54, 78],
5657
+ [6, 30, 56, 82],
5658
+ [6, 30, 58, 86],
5659
+ [6, 34, 62, 90],
5660
+ [6, 28, 50, 72, 94],
5661
+ [6, 26, 50, 74, 98],
5662
+ [6, 30, 54, 78, 102],
5663
+ [6, 28, 54, 80, 106],
5664
+ [6, 32, 58, 84, 110],
5665
+ [6, 30, 58, 86, 114],
5666
+ [6, 34, 62, 90, 118],
5667
+ [6, 26, 50, 74, 98, 122],
5668
+ [6, 30, 54, 78, 102, 126],
5669
+ [6, 26, 52, 78, 104, 130],
5670
+ [6, 30, 56, 82, 108, 134],
5671
+ [6, 34, 60, 86, 112, 138],
5672
+ [6, 30, 58, 86, 114, 142],
5673
+ [6, 34, 62, 90, 118, 146],
5674
+ [6, 30, 54, 78, 102, 126, 150],
5675
+ [6, 24, 50, 76, 102, 128, 154],
5676
+ [6, 28, 54, 80, 106, 132, 158],
5677
+ [6, 32, 58, 84, 110, 136, 162],
5678
+ [6, 26, 54, 82, 110, 138, 166],
5679
+ [6, 30, 58, 86, 114, 142, 170]
5680
+ ];
5681
+ const G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
5682
+ const G18 = 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0;
5683
+ const G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
5684
+ const _this = {};
5685
+ const getBCHDigit = function(data) {
5686
+ let digit = 0;
5687
+ while (data != 0) {
5688
+ digit += 1;
5689
+ data >>>= 1;
5690
+ }
5691
+ return digit;
5692
+ };
5693
+ _this.getBCHTypeInfo = function(data) {
5694
+ let d = data << 10;
5695
+ while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
5696
+ d ^= G15 << getBCHDigit(d) - getBCHDigit(G15);
5697
+ }
5698
+ return (data << 10 | d) ^ G15_MASK;
5699
+ };
5700
+ _this.getBCHTypeNumber = function(data) {
5701
+ let d = data << 12;
5702
+ while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
5703
+ d ^= G18 << getBCHDigit(d) - getBCHDigit(G18);
5704
+ }
5705
+ return data << 12 | d;
5706
+ };
5707
+ _this.getPatternPosition = function(typeNumber) {
5708
+ return PATTERN_POSITION_TABLE[typeNumber - 1];
5709
+ };
5710
+ _this.getMaskFunction = function(maskPattern) {
5711
+ switch (maskPattern) {
5712
+ case QRMaskPattern.PATTERN000:
5713
+ return function(i, j) {
5714
+ return (i + j) % 2 == 0;
5715
+ };
5716
+ case QRMaskPattern.PATTERN001:
5717
+ return function(i, j) {
5718
+ return i % 2 == 0;
5719
+ };
5720
+ case QRMaskPattern.PATTERN010:
5721
+ return function(i, j) {
5722
+ return j % 3 == 0;
5723
+ };
5724
+ case QRMaskPattern.PATTERN011:
5725
+ return function(i, j) {
5726
+ return (i + j) % 3 == 0;
5727
+ };
5728
+ case QRMaskPattern.PATTERN100:
5729
+ return function(i, j) {
5730
+ return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
5731
+ };
5732
+ case QRMaskPattern.PATTERN101:
5733
+ return function(i, j) {
5734
+ return i * j % 2 + i * j % 3 == 0;
5735
+ };
5736
+ case QRMaskPattern.PATTERN110:
5737
+ return function(i, j) {
5738
+ return (i * j % 2 + i * j % 3) % 2 == 0;
5739
+ };
5740
+ case QRMaskPattern.PATTERN111:
5741
+ return function(i, j) {
5742
+ return (i * j % 3 + (i + j) % 2) % 2 == 0;
5743
+ };
5744
+ default:
5745
+ throw "bad maskPattern:" + maskPattern;
5746
+ }
5747
+ };
5748
+ _this.getErrorCorrectPolynomial = function(errorCorrectLength) {
5749
+ let a = qrPolynomial([1], 0);
5750
+ for (let i = 0; i < errorCorrectLength; i += 1) {
5751
+ a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0));
5752
+ }
5753
+ return a;
5754
+ };
5755
+ _this.getLengthInBits = function(mode, type) {
5756
+ if (1 <= type && type < 10) {
5757
+ switch (mode) {
5758
+ case QRMode.MODE_NUMBER:
5759
+ return 10;
5760
+ case QRMode.MODE_ALPHA_NUM:
5761
+ return 9;
5762
+ case QRMode.MODE_8BIT_BYTE:
5763
+ return 8;
5764
+ case QRMode.MODE_KANJI:
5765
+ return 8;
5766
+ default:
5767
+ throw "mode:" + mode;
5768
+ }
5769
+ } else if (type < 27) {
5770
+ switch (mode) {
5771
+ case QRMode.MODE_NUMBER:
5772
+ return 12;
5773
+ case QRMode.MODE_ALPHA_NUM:
5774
+ return 11;
5775
+ case QRMode.MODE_8BIT_BYTE:
5776
+ return 16;
5777
+ case QRMode.MODE_KANJI:
5778
+ return 10;
5779
+ default:
5780
+ throw "mode:" + mode;
5781
+ }
5782
+ } else if (type < 41) {
5783
+ switch (mode) {
5784
+ case QRMode.MODE_NUMBER:
5785
+ return 14;
5786
+ case QRMode.MODE_ALPHA_NUM:
5787
+ return 13;
5788
+ case QRMode.MODE_8BIT_BYTE:
5789
+ return 16;
5790
+ case QRMode.MODE_KANJI:
5791
+ return 12;
5792
+ default:
5793
+ throw "mode:" + mode;
5794
+ }
5795
+ } else {
5796
+ throw "type:" + type;
5797
+ }
5798
+ };
5799
+ _this.getLostPoint = function(qrcode2) {
5800
+ const moduleCount = qrcode2.getModuleCount();
5801
+ let lostPoint = 0;
5802
+ for (let row = 0; row < moduleCount; row += 1) {
5803
+ for (let col = 0; col < moduleCount; col += 1) {
5804
+ let sameCount = 0;
5805
+ const dark = qrcode2.isDark(row, col);
5806
+ for (let r = -1; r <= 1; r += 1) {
5807
+ if (row + r < 0 || moduleCount <= row + r) {
5808
+ continue;
5268
5809
  }
5269
- }
5270
- return bestMask;
5271
- }
5272
- // 应用掩码
5273
- static applyMask(modules, size, mask) {
5274
- for (let row = 0; row < size; row++) {
5275
- for (let col = 0; col < size; col++) {
5276
- if (modules[row][col] >= 0) {
5277
- if (this.getMaskBit(row, col, mask)) {
5278
- modules[row][col] = modules[row][col] === 1 ? 0 : 1;
5279
- }
5810
+ for (let c = -1; c <= 1; c += 1) {
5811
+ if (col + c < 0 || moduleCount <= col + c) {
5812
+ continue;
5813
+ }
5814
+ if (r == 0 && c == 0) {
5815
+ continue;
5816
+ }
5817
+ if (dark == qrcode2.isDark(row + r, col + c)) {
5818
+ sameCount += 1;
5280
5819
  }
5281
5820
  }
5282
5821
  }
5283
- }
5284
- // 掩码函数
5285
- static getMaskBit(row, col, mask) {
5286
- switch (mask) {
5287
- case 0:
5288
- return (row + col) % 2 === 0;
5289
- case 1:
5290
- return row % 2 === 0;
5291
- case 2:
5292
- return col % 3 === 0;
5293
- case 3:
5294
- return (row + col) % 3 === 0;
5295
- case 4:
5296
- return (Math.floor(row / 2) + Math.floor(col / 3)) % 2 === 0;
5297
- case 5:
5298
- return row * col % 2 + row * col % 3 === 0;
5299
- case 6:
5300
- return (row * col % 2 + row * col % 3) % 2 === 0;
5301
- case 7:
5302
- return ((row + col) % 2 + row * col % 3) % 2 === 0;
5303
- default:
5304
- return false;
5822
+ if (sameCount > 5) {
5823
+ lostPoint += 3 + sameCount - 5;
5305
5824
  }
5306
5825
  }
5307
- // 评估掩码质量
5308
- static evaluateMask(modules, size) {
5309
- let score = 0;
5310
- for (let row = 0; row < size; row++) {
5311
- let count = 1;
5312
- for (let col = 1; col < size; col++) {
5313
- if (modules[row][col] === modules[row][col - 1]) {
5314
- count++;
5315
- } else {
5316
- if (count >= 5) score += count - 2;
5317
- count = 1;
5318
- }
5319
- }
5320
- if (count >= 5) score += count - 2;
5826
+ }
5827
+ for (let row = 0; row < moduleCount - 1; row += 1) {
5828
+ for (let col = 0; col < moduleCount - 1; col += 1) {
5829
+ let count = 0;
5830
+ if (qrcode2.isDark(row, col)) count += 1;
5831
+ if (qrcode2.isDark(row + 1, col)) count += 1;
5832
+ if (qrcode2.isDark(row, col + 1)) count += 1;
5833
+ if (qrcode2.isDark(row + 1, col + 1)) count += 1;
5834
+ if (count == 0 || count == 4) {
5835
+ lostPoint += 3;
5321
5836
  }
5322
- for (let col = 0; col < size; col++) {
5323
- let count = 1;
5324
- for (let row = 1; row < size; row++) {
5325
- if (modules[row][col] === modules[row - 1][col]) {
5326
- count++;
5327
- } else {
5328
- if (count >= 5) score += count - 2;
5329
- count = 1;
5330
- }
5331
- }
5332
- if (count >= 5) score += count - 2;
5837
+ }
5838
+ }
5839
+ for (let row = 0; row < moduleCount; row += 1) {
5840
+ for (let col = 0; col < moduleCount - 6; col += 1) {
5841
+ if (qrcode2.isDark(row, col) && !qrcode2.isDark(row, col + 1) && qrcode2.isDark(row, col + 2) && qrcode2.isDark(row, col + 3) && qrcode2.isDark(row, col + 4) && !qrcode2.isDark(row, col + 5) && qrcode2.isDark(row, col + 6)) {
5842
+ lostPoint += 40;
5333
5843
  }
5334
- return score;
5335
- }
5336
- // 添加格式信息
5337
- static addFormatInfo(modules, size, ecl, mask) {
5338
- const eclBits = this.ECC_LEVEL[ecl];
5339
- const data = eclBits << 3 | mask;
5340
- let rem = data;
5341
- for (let i = 0; i < 10; i++) {
5342
- rem = rem << 1 ^ (rem >> 14) * 1335;
5844
+ }
5845
+ }
5846
+ for (let col = 0; col < moduleCount; col += 1) {
5847
+ for (let row = 0; row < moduleCount - 6; row += 1) {
5848
+ if (qrcode2.isDark(row, col) && !qrcode2.isDark(row + 1, col) && qrcode2.isDark(row + 2, col) && qrcode2.isDark(row + 3, col) && qrcode2.isDark(row + 4, col) && !qrcode2.isDark(row + 5, col) && qrcode2.isDark(row + 6, col)) {
5849
+ lostPoint += 40;
5343
5850
  }
5344
- const format = (data << 10 | rem) ^ 21522;
5345
- const bits = [];
5346
- for (let i = 14; i >= 0; i--) {
5347
- bits.push(format >> i & 1);
5851
+ }
5852
+ }
5853
+ let darkCount = 0;
5854
+ for (let col = 0; col < moduleCount; col += 1) {
5855
+ for (let row = 0; row < moduleCount; row += 1) {
5856
+ if (qrcode2.isDark(row, col)) {
5857
+ darkCount += 1;
5348
5858
  }
5349
- for (let i = 0; i < 6; i++) modules[8][i] = bits[i];
5350
- modules[8][7] = bits[6];
5351
- modules[8][8] = bits[7];
5352
- modules[7][8] = bits[8];
5353
- for (let i = 9; i < 15; i++) modules[14 - i][8] = bits[i];
5354
- for (let i = 0; i < 8; i++) modules[8][size - 1 - i] = bits[14 - i];
5355
- for (let i = 8; i < 15; i++) modules[size - 15 + i][8] = bits[14 - i];
5356
5859
  }
5357
5860
  }
5358
- // 纠错级别
5359
- __publicField(QRCode, "ECC_LEVEL", { L: 1, M: 0, Q: 3, H: 2 });
5360
- // 每个版本的纠错码字数(M级别)
5361
- __publicField(QRCode, "ECC_CODEWORDS", [
5362
- 0,
5363
- 10,
5364
- 16,
5365
- 22,
5366
- 28,
5367
- 36,
5368
- 44,
5369
- 52,
5370
- 64,
5371
- 72,
5372
- 80,
5373
- 96,
5374
- 108,
5375
- 120,
5376
- 132,
5377
- 144,
5378
- 168,
5379
- 180,
5380
- 196,
5381
- 216,
5382
- 240,
5383
- 260,
5384
- 288,
5385
- 320,
5386
- 344,
5387
- 376,
5388
- 412,
5389
- 452,
5390
- 492,
5391
- 536
5392
- ]);
5393
- // 每个版本的总码字数
5394
- __publicField(QRCode, "TOTAL_CODEWORDS", [
5395
- 0,
5396
- 26,
5397
- 44,
5398
- 70,
5399
- 100,
5400
- 134,
5401
- 172,
5402
- 196,
5403
- 242,
5404
- 292,
5405
- 346,
5406
- 404,
5407
- 466,
5408
- 532,
5409
- 581,
5410
- 625,
5411
- 733,
5412
- 815,
5413
- 901,
5414
- 993,
5415
- 1079,
5416
- 1157,
5417
- 1253,
5418
- 1353,
5419
- 1453,
5420
- 1553,
5421
- 1673,
5422
- 1793,
5423
- 1913,
5424
- 2033
5425
- ]);
5426
- // 每个版本的容量(字节模式,M级别)
5427
- __publicField(QRCode, "CAPACITY", [
5428
- 0,
5429
- 16,
5430
- 28,
5431
- 44,
5432
- 64,
5433
- 86,
5434
- 108,
5435
- 124,
5436
- 154,
5437
- 186,
5438
- 216,
5439
- 252,
5440
- 290,
5441
- 334,
5442
- 365,
5443
- 415,
5444
- 453,
5445
- 507,
5446
- 563,
5447
- 623,
5448
- 669,
5449
- 719,
5450
- 783,
5451
- 843,
5452
- 909,
5453
- 969,
5454
- 1047,
5455
- 1119,
5456
- 1193,
5457
- 1273
5458
- ]);
5459
- const drawQRCode = () => {
5460
- if (!props.value) return;
5461
- vue.nextTick(() => {
5462
- const result = QRCode.generate(props.value, props.errorCorrectLevel);
5463
- const cellSize = props.size / result.size;
5464
- const ctx = uni.createCanvasContext(canvasId.value);
5465
- ctx.setFillStyle(props.bgColor);
5466
- ctx.fillRect(0, 0, props.size, props.size);
5467
- ctx.setFillStyle(props.color);
5468
- for (let row = 0; row < result.size; row++) {
5469
- for (let col = 0; col < result.size; col++) {
5470
- if (result.modules[row][col] === 1) {
5471
- ctx.fillRect(col * cellSize, row * cellSize, cellSize, cellSize);
5472
- }
5861
+ const ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
5862
+ lostPoint += ratio * 10;
5863
+ return lostPoint;
5864
+ };
5865
+ return _this;
5866
+ }();
5867
+ const QRMath = function() {
5868
+ const EXP_TABLE = new Array(256);
5869
+ const LOG_TABLE = new Array(256);
5870
+ for (let i = 0; i < 8; i += 1) {
5871
+ EXP_TABLE[i] = 1 << i;
5872
+ }
5873
+ for (let i = 8; i < 256; i += 1) {
5874
+ EXP_TABLE[i] = EXP_TABLE[i - 4] ^ EXP_TABLE[i - 5] ^ EXP_TABLE[i - 6] ^ EXP_TABLE[i - 8];
5875
+ }
5876
+ for (let i = 0; i < 255; i += 1) {
5877
+ LOG_TABLE[EXP_TABLE[i]] = i;
5878
+ }
5879
+ const _this = {};
5880
+ _this.glog = function(n) {
5881
+ if (n < 1) {
5882
+ throw "glog(" + n + ")";
5883
+ }
5884
+ return LOG_TABLE[n];
5885
+ };
5886
+ _this.gexp = function(n) {
5887
+ while (n < 0) {
5888
+ n += 255;
5889
+ }
5890
+ while (n >= 256) {
5891
+ n -= 255;
5892
+ }
5893
+ return EXP_TABLE[n];
5894
+ };
5895
+ return _this;
5896
+ }();
5897
+ const qrPolynomial = function(num, shift) {
5898
+ if (typeof num.length == "undefined") {
5899
+ throw num.length + "/" + shift;
5900
+ }
5901
+ const _num = function() {
5902
+ let offset = 0;
5903
+ while (offset < num.length && num[offset] == 0) {
5904
+ offset += 1;
5905
+ }
5906
+ const _num2 = new Array(num.length - offset + shift);
5907
+ for (let i = 0; i < num.length - offset; i += 1) {
5908
+ _num2[i] = num[i + offset];
5909
+ }
5910
+ return _num2;
5911
+ }();
5912
+ const _this = {};
5913
+ _this.getAt = function(index) {
5914
+ return _num[index];
5915
+ };
5916
+ _this.getLength = function() {
5917
+ return _num.length;
5918
+ };
5919
+ _this.multiply = function(e) {
5920
+ const num2 = new Array(_this.getLength() + e.getLength() - 1);
5921
+ for (let i = 0; i < _this.getLength(); i += 1) {
5922
+ for (let j = 0; j < e.getLength(); j += 1) {
5923
+ num2[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i)) + QRMath.glog(e.getAt(j)));
5924
+ }
5925
+ }
5926
+ return qrPolynomial(num2, 0);
5927
+ };
5928
+ _this.mod = function(e) {
5929
+ if (_this.getLength() - e.getLength() < 0) {
5930
+ return _this;
5931
+ }
5932
+ const ratio = QRMath.glog(_this.getAt(0)) - QRMath.glog(e.getAt(0));
5933
+ const num2 = new Array(_this.getLength());
5934
+ for (let i = 0; i < _this.getLength(); i += 1) {
5935
+ num2[i] = _this.getAt(i);
5936
+ }
5937
+ for (let i = 0; i < e.getLength(); i += 1) {
5938
+ num2[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i)) + ratio);
5939
+ }
5940
+ return qrPolynomial(num2, 0).mod(e);
5941
+ };
5942
+ return _this;
5943
+ };
5944
+ const QRRSBlock = function() {
5945
+ const RS_BLOCK_TABLE = [
5946
+ // L
5947
+ // M
5948
+ // Q
5949
+ // H
5950
+ // 1
5951
+ [1, 26, 19],
5952
+ [1, 26, 16],
5953
+ [1, 26, 13],
5954
+ [1, 26, 9],
5955
+ // 2
5956
+ [1, 44, 34],
5957
+ [1, 44, 28],
5958
+ [1, 44, 22],
5959
+ [1, 44, 16],
5960
+ // 3
5961
+ [1, 70, 55],
5962
+ [1, 70, 44],
5963
+ [2, 35, 17],
5964
+ [2, 35, 13],
5965
+ // 4
5966
+ [1, 100, 80],
5967
+ [2, 50, 32],
5968
+ [2, 50, 24],
5969
+ [4, 25, 9],
5970
+ // 5
5971
+ [1, 134, 108],
5972
+ [2, 67, 43],
5973
+ [2, 33, 15, 2, 34, 16],
5974
+ [2, 33, 11, 2, 34, 12],
5975
+ // 6
5976
+ [2, 86, 68],
5977
+ [4, 43, 27],
5978
+ [4, 43, 19],
5979
+ [4, 43, 15],
5980
+ // 7
5981
+ [2, 98, 78],
5982
+ [4, 49, 31],
5983
+ [2, 32, 14, 4, 33, 15],
5984
+ [4, 39, 13, 1, 40, 14],
5985
+ // 8
5986
+ [2, 121, 97],
5987
+ [2, 60, 38, 2, 61, 39],
5988
+ [4, 40, 18, 2, 41, 19],
5989
+ [4, 40, 14, 2, 41, 15],
5990
+ // 9
5991
+ [2, 146, 116],
5992
+ [3, 58, 36, 2, 59, 37],
5993
+ [4, 36, 16, 4, 37, 17],
5994
+ [4, 36, 12, 4, 37, 13],
5995
+ // 10
5996
+ [2, 86, 68, 2, 87, 69],
5997
+ [4, 69, 43, 1, 70, 44],
5998
+ [6, 43, 19, 2, 44, 20],
5999
+ [6, 43, 15, 2, 44, 16],
6000
+ // 11
6001
+ [4, 101, 81],
6002
+ [1, 80, 50, 4, 81, 51],
6003
+ [4, 50, 22, 4, 51, 23],
6004
+ [3, 36, 12, 8, 37, 13],
6005
+ // 12
6006
+ [2, 116, 92, 2, 117, 93],
6007
+ [6, 58, 36, 2, 59, 37],
6008
+ [4, 46, 20, 6, 47, 21],
6009
+ [7, 42, 14, 4, 43, 15],
6010
+ // 13
6011
+ [4, 133, 107],
6012
+ [8, 59, 37, 1, 60, 38],
6013
+ [8, 44, 20, 4, 45, 21],
6014
+ [12, 33, 11, 4, 34, 12],
6015
+ // 14
6016
+ [3, 145, 115, 1, 146, 116],
6017
+ [4, 64, 40, 5, 65, 41],
6018
+ [11, 36, 16, 5, 37, 17],
6019
+ [11, 36, 12, 5, 37, 13],
6020
+ // 15
6021
+ [5, 109, 87, 1, 110, 88],
6022
+ [5, 65, 41, 5, 66, 42],
6023
+ [5, 54, 24, 7, 55, 25],
6024
+ [11, 36, 12, 7, 37, 13],
6025
+ // 16
6026
+ [5, 122, 98, 1, 123, 99],
6027
+ [7, 73, 45, 3, 74, 46],
6028
+ [15, 43, 19, 2, 44, 20],
6029
+ [3, 45, 15, 13, 46, 16],
6030
+ // 17
6031
+ [1, 135, 107, 5, 136, 108],
6032
+ [10, 74, 46, 1, 75, 47],
6033
+ [1, 50, 22, 15, 51, 23],
6034
+ [2, 42, 14, 17, 43, 15],
6035
+ // 18
6036
+ [5, 150, 120, 1, 151, 121],
6037
+ [9, 69, 43, 4, 70, 44],
6038
+ [17, 50, 22, 1, 51, 23],
6039
+ [2, 42, 14, 19, 43, 15],
6040
+ // 19
6041
+ [3, 141, 113, 4, 142, 114],
6042
+ [3, 70, 44, 11, 71, 45],
6043
+ [17, 47, 21, 4, 48, 22],
6044
+ [9, 39, 13, 16, 40, 14],
6045
+ // 20
6046
+ [3, 135, 107, 5, 136, 108],
6047
+ [3, 67, 41, 13, 68, 42],
6048
+ [15, 54, 24, 5, 55, 25],
6049
+ [15, 43, 15, 10, 44, 16],
6050
+ // 21
6051
+ [4, 144, 116, 4, 145, 117],
6052
+ [17, 68, 42],
6053
+ [17, 50, 22, 6, 51, 23],
6054
+ [19, 46, 16, 6, 47, 17],
6055
+ // 22
6056
+ [2, 139, 111, 7, 140, 112],
6057
+ [17, 74, 46],
6058
+ [7, 54, 24, 16, 55, 25],
6059
+ [34, 37, 13],
6060
+ // 23
6061
+ [4, 151, 121, 5, 152, 122],
6062
+ [4, 75, 47, 14, 76, 48],
6063
+ [11, 54, 24, 14, 55, 25],
6064
+ [16, 45, 15, 14, 46, 16],
6065
+ // 24
6066
+ [6, 147, 117, 4, 148, 118],
6067
+ [6, 73, 45, 14, 74, 46],
6068
+ [11, 54, 24, 16, 55, 25],
6069
+ [30, 46, 16, 2, 47, 17],
6070
+ // 25
6071
+ [8, 132, 106, 4, 133, 107],
6072
+ [8, 75, 47, 13, 76, 48],
6073
+ [7, 54, 24, 22, 55, 25],
6074
+ [22, 45, 15, 13, 46, 16],
6075
+ // 26
6076
+ [10, 142, 114, 2, 143, 115],
6077
+ [19, 74, 46, 4, 75, 47],
6078
+ [28, 50, 22, 6, 51, 23],
6079
+ [33, 46, 16, 4, 47, 17],
6080
+ // 27
6081
+ [8, 152, 122, 4, 153, 123],
6082
+ [22, 73, 45, 3, 74, 46],
6083
+ [8, 53, 23, 26, 54, 24],
6084
+ [12, 45, 15, 28, 46, 16],
6085
+ // 28
6086
+ [3, 147, 117, 10, 148, 118],
6087
+ [3, 73, 45, 23, 74, 46],
6088
+ [4, 54, 24, 31, 55, 25],
6089
+ [11, 45, 15, 31, 46, 16],
6090
+ // 29
6091
+ [7, 146, 116, 7, 147, 117],
6092
+ [21, 73, 45, 7, 74, 46],
6093
+ [1, 53, 23, 37, 54, 24],
6094
+ [19, 45, 15, 26, 46, 16],
6095
+ // 30
6096
+ [5, 145, 115, 10, 146, 116],
6097
+ [19, 75, 47, 10, 76, 48],
6098
+ [15, 54, 24, 25, 55, 25],
6099
+ [23, 45, 15, 25, 46, 16],
6100
+ // 31
6101
+ [13, 145, 115, 3, 146, 116],
6102
+ [2, 74, 46, 29, 75, 47],
6103
+ [42, 54, 24, 1, 55, 25],
6104
+ [23, 45, 15, 28, 46, 16],
6105
+ // 32
6106
+ [17, 145, 115],
6107
+ [10, 74, 46, 23, 75, 47],
6108
+ [10, 54, 24, 35, 55, 25],
6109
+ [19, 45, 15, 35, 46, 16],
6110
+ // 33
6111
+ [17, 145, 115, 1, 146, 116],
6112
+ [14, 74, 46, 21, 75, 47],
6113
+ [29, 54, 24, 19, 55, 25],
6114
+ [11, 45, 15, 46, 46, 16],
6115
+ // 34
6116
+ [13, 145, 115, 6, 146, 116],
6117
+ [14, 74, 46, 23, 75, 47],
6118
+ [44, 54, 24, 7, 55, 25],
6119
+ [59, 46, 16, 1, 47, 17],
6120
+ // 35
6121
+ [12, 151, 121, 7, 152, 122],
6122
+ [12, 75, 47, 26, 76, 48],
6123
+ [39, 54, 24, 14, 55, 25],
6124
+ [22, 45, 15, 41, 46, 16],
6125
+ // 36
6126
+ [6, 151, 121, 14, 152, 122],
6127
+ [6, 75, 47, 34, 76, 48],
6128
+ [46, 54, 24, 10, 55, 25],
6129
+ [2, 45, 15, 64, 46, 16],
6130
+ // 37
6131
+ [17, 152, 122, 4, 153, 123],
6132
+ [29, 74, 46, 14, 75, 47],
6133
+ [49, 54, 24, 10, 55, 25],
6134
+ [24, 45, 15, 46, 46, 16],
6135
+ // 38
6136
+ [4, 152, 122, 18, 153, 123],
6137
+ [13, 74, 46, 32, 75, 47],
6138
+ [48, 54, 24, 14, 55, 25],
6139
+ [42, 45, 15, 32, 46, 16],
6140
+ // 39
6141
+ [20, 147, 117, 4, 148, 118],
6142
+ [40, 75, 47, 7, 76, 48],
6143
+ [43, 54, 24, 22, 55, 25],
6144
+ [10, 45, 15, 67, 46, 16],
6145
+ // 40
6146
+ [19, 148, 118, 6, 149, 119],
6147
+ [18, 75, 47, 31, 76, 48],
6148
+ [34, 54, 24, 34, 55, 25],
6149
+ [20, 45, 15, 61, 46, 16]
6150
+ ];
6151
+ const qrRSBlock = function(totalCount, dataCount) {
6152
+ const _this2 = {};
6153
+ _this2.totalCount = totalCount;
6154
+ _this2.dataCount = dataCount;
6155
+ return _this2;
6156
+ };
6157
+ const _this = {};
6158
+ const getRsBlockTable = function(typeNumber, errorCorrectionLevel) {
6159
+ switch (errorCorrectionLevel) {
6160
+ case QRErrorCorrectionLevel.L:
6161
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
6162
+ case QRErrorCorrectionLevel.M:
6163
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
6164
+ case QRErrorCorrectionLevel.Q:
6165
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
6166
+ case QRErrorCorrectionLevel.H:
6167
+ return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
6168
+ default:
6169
+ return void 0;
6170
+ }
6171
+ };
6172
+ _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) {
6173
+ const rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel);
6174
+ if (typeof rsBlock == "undefined") {
6175
+ throw "bad rs block @ typeNumber:" + typeNumber + "/errorCorrectionLevel:" + errorCorrectionLevel;
6176
+ }
6177
+ const length = rsBlock.length / 3;
6178
+ const list2 = [];
6179
+ for (let i = 0; i < length; i += 1) {
6180
+ const count = rsBlock[i * 3 + 0];
6181
+ const totalCount = rsBlock[i * 3 + 1];
6182
+ const dataCount = rsBlock[i * 3 + 2];
6183
+ for (let j = 0; j < count; j += 1) {
6184
+ list2.push(qrRSBlock(totalCount, dataCount));
6185
+ }
6186
+ }
6187
+ return list2;
6188
+ };
6189
+ return _this;
6190
+ }();
6191
+ const qrBitBuffer = function() {
6192
+ const _buffer = [];
6193
+ let _length = 0;
6194
+ const _this = {};
6195
+ _this.getBuffer = function() {
6196
+ return _buffer;
6197
+ };
6198
+ _this.getAt = function(index) {
6199
+ const bufIndex = Math.floor(index / 8);
6200
+ return (_buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
6201
+ };
6202
+ _this.put = function(num, length) {
6203
+ for (let i = 0; i < length; i += 1) {
6204
+ _this.putBit((num >>> length - i - 1 & 1) == 1);
6205
+ }
6206
+ };
6207
+ _this.getLengthInBits = function() {
6208
+ return _length;
6209
+ };
6210
+ _this.putBit = function(bit) {
6211
+ const bufIndex = Math.floor(_length / 8);
6212
+ if (_buffer.length <= bufIndex) {
6213
+ _buffer.push(0);
6214
+ }
6215
+ if (bit) {
6216
+ _buffer[bufIndex] |= 128 >>> _length % 8;
6217
+ }
6218
+ _length += 1;
6219
+ };
6220
+ return _this;
6221
+ };
6222
+ const qrNumber = function(data) {
6223
+ const _mode = QRMode.MODE_NUMBER;
6224
+ const _data = data;
6225
+ const _this = {};
6226
+ _this.getMode = function() {
6227
+ return _mode;
6228
+ };
6229
+ _this.getLength = function(buffer) {
6230
+ return _data.length;
6231
+ };
6232
+ _this.write = function(buffer) {
6233
+ const data2 = _data;
6234
+ let i = 0;
6235
+ while (i + 2 < data2.length) {
6236
+ buffer.put(strToNum(data2.substring(i, i + 3)), 10);
6237
+ i += 3;
6238
+ }
6239
+ if (i < data2.length) {
6240
+ if (data2.length - i == 1) {
6241
+ buffer.put(strToNum(data2.substring(i, i + 1)), 4);
6242
+ } else if (data2.length - i == 2) {
6243
+ buffer.put(strToNum(data2.substring(i, i + 2)), 7);
6244
+ }
6245
+ }
6246
+ };
6247
+ const strToNum = function(s) {
6248
+ let num = 0;
6249
+ for (let i = 0; i < s.length; i += 1) {
6250
+ num = num * 10 + chatToNum(s.charAt(i));
6251
+ }
6252
+ return num;
6253
+ };
6254
+ const chatToNum = function(c) {
6255
+ if ("0" <= c && c <= "9") {
6256
+ return c.charCodeAt(0) - "0".charCodeAt(0);
6257
+ }
6258
+ throw "illegal char :" + c;
6259
+ };
6260
+ return _this;
6261
+ };
6262
+ const qrAlphaNum = function(data) {
6263
+ const _mode = QRMode.MODE_ALPHA_NUM;
6264
+ const _data = data;
6265
+ const _this = {};
6266
+ _this.getMode = function() {
6267
+ return _mode;
6268
+ };
6269
+ _this.getLength = function(buffer) {
6270
+ return _data.length;
6271
+ };
6272
+ _this.write = function(buffer) {
6273
+ const s = _data;
6274
+ let i = 0;
6275
+ while (i + 1 < s.length) {
6276
+ buffer.put(
6277
+ getCode(s.charAt(i)) * 45 + getCode(s.charAt(i + 1)),
6278
+ 11
6279
+ );
6280
+ i += 2;
6281
+ }
6282
+ if (i < s.length) {
6283
+ buffer.put(getCode(s.charAt(i)), 6);
6284
+ }
6285
+ };
6286
+ const getCode = function(c) {
6287
+ if ("0" <= c && c <= "9") {
6288
+ return c.charCodeAt(0) - "0".charCodeAt(0);
6289
+ } else if ("A" <= c && c <= "Z") {
6290
+ return c.charCodeAt(0) - "A".charCodeAt(0) + 10;
6291
+ } else {
6292
+ switch (c) {
6293
+ case " ":
6294
+ return 36;
6295
+ case "$":
6296
+ return 37;
6297
+ case "%":
6298
+ return 38;
6299
+ case "*":
6300
+ return 39;
6301
+ case "+":
6302
+ return 40;
6303
+ case "-":
6304
+ return 41;
6305
+ case ".":
6306
+ return 42;
6307
+ case "/":
6308
+ return 43;
6309
+ case ":":
6310
+ return 44;
6311
+ default:
6312
+ throw "illegal char :" + c;
6313
+ }
6314
+ }
6315
+ };
6316
+ return _this;
6317
+ };
6318
+ const qr8BitByte = function(data) {
6319
+ const _mode = QRMode.MODE_8BIT_BYTE;
6320
+ const _bytes = qrcode.stringToBytes(data);
6321
+ const _this = {};
6322
+ _this.getMode = function() {
6323
+ return _mode;
6324
+ };
6325
+ _this.getLength = function(buffer) {
6326
+ return _bytes.length;
6327
+ };
6328
+ _this.write = function(buffer) {
6329
+ for (let i = 0; i < _bytes.length; i += 1) {
6330
+ buffer.put(_bytes[i], 8);
6331
+ }
6332
+ };
6333
+ return _this;
6334
+ };
6335
+ const qrKanji = function(data) {
6336
+ const _mode = QRMode.MODE_KANJI;
6337
+ const stringToBytes = qrcode.stringToBytes;
6338
+ !function(c, code2) {
6339
+ const test = stringToBytes(c);
6340
+ if (test.length != 2 || (test[0] << 8 | test[1]) != code2) {
6341
+ throw "sjis not supported.";
6342
+ }
6343
+ }("友", 38726);
6344
+ const _bytes = stringToBytes(data);
6345
+ const _this = {};
6346
+ _this.getMode = function() {
6347
+ return _mode;
6348
+ };
6349
+ _this.getLength = function(buffer) {
6350
+ return ~~(_bytes.length / 2);
6351
+ };
6352
+ _this.write = function(buffer) {
6353
+ const data2 = _bytes;
6354
+ let i = 0;
6355
+ while (i + 1 < data2.length) {
6356
+ let c = (255 & data2[i]) << 8 | 255 & data2[i + 1];
6357
+ if (33088 <= c && c <= 40956) {
6358
+ c -= 33088;
6359
+ } else if (57408 <= c && c <= 60351) {
6360
+ c -= 49472;
6361
+ } else {
6362
+ throw "illegal char at " + (i + 1) + "/" + c;
6363
+ }
6364
+ c = (c >>> 8 & 255) * 192 + (c & 255);
6365
+ buffer.put(c, 13);
6366
+ i += 2;
6367
+ }
6368
+ if (i < data2.length) {
6369
+ throw "illegal char at " + (i + 1);
6370
+ }
6371
+ };
6372
+ return _this;
6373
+ };
6374
+ const byteArrayOutputStream = function() {
6375
+ const _bytes = [];
6376
+ const _this = {};
6377
+ _this.writeByte = function(b) {
6378
+ _bytes.push(b & 255);
6379
+ };
6380
+ _this.writeShort = function(i) {
6381
+ _this.writeByte(i);
6382
+ _this.writeByte(i >>> 8);
6383
+ };
6384
+ _this.writeBytes = function(b, off, len) {
6385
+ off = off || 0;
6386
+ len = len || b.length;
6387
+ for (let i = 0; i < len; i += 1) {
6388
+ _this.writeByte(b[i + off]);
6389
+ }
6390
+ };
6391
+ _this.writeString = function(s) {
6392
+ for (let i = 0; i < s.length; i += 1) {
6393
+ _this.writeByte(s.charCodeAt(i));
6394
+ }
6395
+ };
6396
+ _this.toByteArray = function() {
6397
+ return _bytes;
6398
+ };
6399
+ _this.toString = function() {
6400
+ let s = "";
6401
+ s += "[";
6402
+ for (let i = 0; i < _bytes.length; i += 1) {
6403
+ if (i > 0) {
6404
+ s += ",";
6405
+ }
6406
+ s += _bytes[i];
6407
+ }
6408
+ s += "]";
6409
+ return s;
6410
+ };
6411
+ return _this;
6412
+ };
6413
+ const base64EncodeOutputStream = function() {
6414
+ let _buffer = 0;
6415
+ let _buflen = 0;
6416
+ let _length = 0;
6417
+ let _base64 = "";
6418
+ const _this = {};
6419
+ const writeEncoded = function(b) {
6420
+ _base64 += String.fromCharCode(encode(b & 63));
6421
+ };
6422
+ const encode = function(n) {
6423
+ if (n < 0) {
6424
+ throw "n:" + n;
6425
+ } else if (n < 26) {
6426
+ return 65 + n;
6427
+ } else if (n < 52) {
6428
+ return 97 + (n - 26);
6429
+ } else if (n < 62) {
6430
+ return 48 + (n - 52);
6431
+ } else if (n == 62) {
6432
+ return 43;
6433
+ } else if (n == 63) {
6434
+ return 47;
6435
+ } else {
6436
+ throw "n:" + n;
6437
+ }
6438
+ };
6439
+ _this.writeByte = function(n) {
6440
+ _buffer = _buffer << 8 | n & 255;
6441
+ _buflen += 8;
6442
+ _length += 1;
6443
+ while (_buflen >= 6) {
6444
+ writeEncoded(_buffer >>> _buflen - 6);
6445
+ _buflen -= 6;
6446
+ }
6447
+ };
6448
+ _this.flush = function() {
6449
+ if (_buflen > 0) {
6450
+ writeEncoded(_buffer << 6 - _buflen);
6451
+ _buffer = 0;
6452
+ _buflen = 0;
6453
+ }
6454
+ if (_length % 3 != 0) {
6455
+ const padlen = 3 - _length % 3;
6456
+ for (let i = 0; i < padlen; i += 1) {
6457
+ _base64 += "=";
6458
+ }
6459
+ }
6460
+ };
6461
+ _this.toString = function() {
6462
+ return _base64;
6463
+ };
6464
+ return _this;
6465
+ };
6466
+ const base64DecodeInputStream = function(str) {
6467
+ const _str = str;
6468
+ let _pos = 0;
6469
+ let _buffer = 0;
6470
+ let _buflen = 0;
6471
+ const _this = {};
6472
+ _this.read = function() {
6473
+ while (_buflen < 8) {
6474
+ if (_pos >= _str.length) {
6475
+ if (_buflen == 0) {
6476
+ return -1;
6477
+ }
6478
+ throw "unexpected end of file./" + _buflen;
6479
+ }
6480
+ const c = _str.charAt(_pos);
6481
+ _pos += 1;
6482
+ if (c == "=") {
6483
+ _buflen = 0;
6484
+ return -1;
6485
+ } else if (c.match(/^\s$/)) {
6486
+ continue;
6487
+ }
6488
+ _buffer = _buffer << 6 | decode(c.charCodeAt(0));
6489
+ _buflen += 6;
6490
+ }
6491
+ const n = _buffer >>> _buflen - 8 & 255;
6492
+ _buflen -= 8;
6493
+ return n;
6494
+ };
6495
+ const decode = function(c) {
6496
+ if (65 <= c && c <= 90) {
6497
+ return c - 65;
6498
+ } else if (97 <= c && c <= 122) {
6499
+ return c - 97 + 26;
6500
+ } else if (48 <= c && c <= 57) {
6501
+ return c - 48 + 52;
6502
+ } else if (c == 43) {
6503
+ return 62;
6504
+ } else if (c == 47) {
6505
+ return 63;
6506
+ } else {
6507
+ throw "c:" + c;
6508
+ }
6509
+ };
6510
+ return _this;
6511
+ };
6512
+ const gifImage = function(width, height) {
6513
+ const _width = width;
6514
+ const _height = height;
6515
+ const _data = new Array(width * height);
6516
+ const _this = {};
6517
+ _this.setPixel = function(x, y, pixel) {
6518
+ _data[y * _width + x] = pixel;
6519
+ };
6520
+ _this.write = function(out) {
6521
+ out.writeString("GIF87a");
6522
+ out.writeShort(_width);
6523
+ out.writeShort(_height);
6524
+ out.writeByte(128);
6525
+ out.writeByte(0);
6526
+ out.writeByte(0);
6527
+ out.writeByte(0);
6528
+ out.writeByte(0);
6529
+ out.writeByte(0);
6530
+ out.writeByte(255);
6531
+ out.writeByte(255);
6532
+ out.writeByte(255);
6533
+ out.writeString(",");
6534
+ out.writeShort(0);
6535
+ out.writeShort(0);
6536
+ out.writeShort(_width);
6537
+ out.writeShort(_height);
6538
+ out.writeByte(0);
6539
+ const lzwMinCodeSize = 2;
6540
+ const raster = getLZWRaster(lzwMinCodeSize);
6541
+ out.writeByte(lzwMinCodeSize);
6542
+ let offset = 0;
6543
+ while (raster.length - offset > 255) {
6544
+ out.writeByte(255);
6545
+ out.writeBytes(raster, offset, 255);
6546
+ offset += 255;
6547
+ }
6548
+ out.writeByte(raster.length - offset);
6549
+ out.writeBytes(raster, offset, raster.length - offset);
6550
+ out.writeByte(0);
6551
+ out.writeString(";");
6552
+ };
6553
+ const bitOutputStream = function(out) {
6554
+ const _out = out;
6555
+ let _bitLength = 0;
6556
+ let _bitBuffer = 0;
6557
+ const _this2 = {};
6558
+ _this2.write = function(data, length) {
6559
+ if (data >>> length != 0) {
6560
+ throw "length over";
6561
+ }
6562
+ while (_bitLength + length >= 8) {
6563
+ _out.writeByte(255 & (data << _bitLength | _bitBuffer));
6564
+ length -= 8 - _bitLength;
6565
+ data >>>= 8 - _bitLength;
6566
+ _bitBuffer = 0;
6567
+ _bitLength = 0;
6568
+ }
6569
+ _bitBuffer = data << _bitLength | _bitBuffer;
6570
+ _bitLength = _bitLength + length;
6571
+ };
6572
+ _this2.flush = function() {
6573
+ if (_bitLength > 0) {
6574
+ _out.writeByte(_bitBuffer);
6575
+ }
6576
+ };
6577
+ return _this2;
6578
+ };
6579
+ const getLZWRaster = function(lzwMinCodeSize) {
6580
+ const clearCode = 1 << lzwMinCodeSize;
6581
+ const endCode = (1 << lzwMinCodeSize) + 1;
6582
+ let bitLength = lzwMinCodeSize + 1;
6583
+ const table = lzwTable();
6584
+ for (let i = 0; i < clearCode; i += 1) {
6585
+ table.add(String.fromCharCode(i));
6586
+ }
6587
+ table.add(String.fromCharCode(clearCode));
6588
+ table.add(String.fromCharCode(endCode));
6589
+ const byteOut = byteArrayOutputStream();
6590
+ const bitOut = bitOutputStream(byteOut);
6591
+ bitOut.write(clearCode, bitLength);
6592
+ let dataIndex = 0;
6593
+ let s = String.fromCharCode(_data[dataIndex]);
6594
+ dataIndex += 1;
6595
+ while (dataIndex < _data.length) {
6596
+ const c = String.fromCharCode(_data[dataIndex]);
6597
+ dataIndex += 1;
6598
+ if (table.contains(s + c)) {
6599
+ s = s + c;
6600
+ } else {
6601
+ bitOut.write(table.indexOf(s), bitLength);
6602
+ if (table.size() < 4095) {
6603
+ if (table.size() == 1 << bitLength) {
6604
+ bitLength += 1;
5473
6605
  }
6606
+ table.add(s + c);
5474
6607
  }
5475
- ctx.draw();
5476
- });
5477
- };
5478
- vue.watch(() => props.value, drawQRCode);
5479
- vue.watch(() => props.size, drawQRCode);
5480
- vue.watch(() => props.color, drawQRCode);
5481
- vue.watch(() => props.bgColor, drawQRCode);
6608
+ s = c;
6609
+ }
6610
+ }
6611
+ bitOut.write(table.indexOf(s), bitLength);
6612
+ bitOut.write(endCode, bitLength);
6613
+ bitOut.flush();
6614
+ return byteOut.toByteArray();
6615
+ };
6616
+ const lzwTable = function() {
6617
+ const _map = {};
6618
+ let _size = 0;
6619
+ const _this2 = {};
6620
+ _this2.add = function(key) {
6621
+ if (_this2.contains(key)) {
6622
+ throw "dup key:" + key;
6623
+ }
6624
+ _map[key] = _size;
6625
+ _size += 1;
6626
+ };
6627
+ _this2.size = function() {
6628
+ return _size;
6629
+ };
6630
+ _this2.indexOf = function(key) {
6631
+ return _map[key];
6632
+ };
6633
+ _this2.contains = function(key) {
6634
+ return typeof _map[key] != "undefined";
6635
+ };
6636
+ return _this2;
6637
+ };
6638
+ return _this;
6639
+ };
6640
+ const createDataURL = function(width, height, getPixel) {
6641
+ const gif = gifImage(width, height);
6642
+ for (let y = 0; y < height; y += 1) {
6643
+ for (let x = 0; x < width; x += 1) {
6644
+ gif.setPixel(x, y, getPixel(x, y));
6645
+ }
6646
+ }
6647
+ const b = byteArrayOutputStream();
6648
+ gif.write(b);
6649
+ const base64 = base64EncodeOutputStream();
6650
+ const bytes = b.toByteArray();
6651
+ for (let i = 0; i < bytes.length; i += 1) {
6652
+ base64.writeByte(bytes[i]);
6653
+ }
6654
+ base64.flush();
6655
+ return "data:image/gif;base64," + base64;
6656
+ };
6657
+ qrcode.stringToBytes;
6658
+ const __default__$1 = {
6659
+ options: {
6660
+ virtualHost: true,
6661
+ styleIsolation: "shared"
6662
+ }
6663
+ };
6664
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
6665
+ ...__default__$1,
6666
+ __name: "u-qrcode",
6667
+ props: {
6668
+ value: { default: "" },
6669
+ size: { default: 200 },
6670
+ color: { default: "#000000" },
6671
+ bgColor: { default: "#ffffff" },
6672
+ errorCorrectLevel: { default: "M" }
6673
+ },
6674
+ setup(__props) {
6675
+ const props = __props;
6676
+ const qrInstance = vue.ref(null);
6677
+ const moduleCount = vue.ref(0);
6678
+ const cellSize = vue.computed(() => {
6679
+ if (moduleCount.value === 0) return 0;
6680
+ return props.size / moduleCount.value;
6681
+ });
6682
+ const isDark = (row, col) => {
6683
+ if (!qrInstance.value) return false;
6684
+ try {
6685
+ return qrInstance.value.isDark(row, col);
6686
+ } catch {
6687
+ return false;
6688
+ }
6689
+ };
6690
+ const generateQRCode = () => {
6691
+ if (!props.value) {
6692
+ qrInstance.value = null;
6693
+ moduleCount.value = 0;
6694
+ return;
6695
+ }
6696
+ try {
6697
+ const typeNumber = 0;
6698
+ const qr = qrcode(typeNumber, props.errorCorrectLevel);
6699
+ qr.addData(props.value);
6700
+ qr.make();
6701
+ qrInstance.value = qr;
6702
+ moduleCount.value = qr.getModuleCount();
6703
+ } catch (e) {
6704
+ console.error("QR Code generation failed:", e);
6705
+ qrInstance.value = null;
6706
+ moduleCount.value = 0;
6707
+ }
6708
+ };
6709
+ vue.watch(() => props.value, generateQRCode);
6710
+ vue.watch(() => props.errorCorrectLevel, generateQRCode);
5482
6711
  vue.onMounted(() => {
5483
- drawQRCode();
6712
+ generateQRCode();
5484
6713
  });
5485
6714
  return (_ctx, _cache) => {
5486
- return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$1, [
5487
- canvasId.value ? (vue.openBlock(), vue.createElementBlock("canvas", {
5488
- key: 0,
5489
- "canvas-id": canvasId.value,
5490
- id: canvasId.value,
5491
- class: "u-qrcode__canvas",
5492
- style: vue.normalizeStyle({ width: `${__props.size}px`, height: `${__props.size}px` })
5493
- }, null, 12, _hoisted_2$1)) : vue.createCommentVNode("", true)
5494
- ]);
6715
+ return vue.openBlock(), vue.createElementBlock("view", {
6716
+ class: "u-qrcode",
6717
+ style: vue.normalizeStyle({ width: `${__props.size}px`, height: `${__props.size}px` })
6718
+ }, [
6719
+ vue.createElementVNode("view", {
6720
+ class: "u-qrcode__matrix",
6721
+ style: vue.normalizeStyle({ backgroundColor: __props.bgColor })
6722
+ }, [
6723
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(moduleCount.value, (row, rowIndex) => {
6724
+ return vue.openBlock(), vue.createElementBlock("view", {
6725
+ key: rowIndex,
6726
+ class: "u-qrcode__row"
6727
+ }, [
6728
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(moduleCount.value, (col, colIndex) => {
6729
+ return vue.openBlock(), vue.createElementBlock("view", {
6730
+ key: colIndex,
6731
+ class: "u-qrcode__cell",
6732
+ style: vue.normalizeStyle({
6733
+ width: `${cellSize.value}px`,
6734
+ height: `${cellSize.value}px`,
6735
+ backgroundColor: isDark(rowIndex, colIndex) ? __props.color : __props.bgColor
6736
+ })
6737
+ }, null, 4);
6738
+ }), 128))
6739
+ ]);
6740
+ }), 128))
6741
+ ], 4)
6742
+ ], 4);
5495
6743
  };
5496
6744
  }
5497
6745
  });
5498
- const uQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ff93204c"]]);
6746
+ const uQrcode = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d5a07c6c"]]);
5499
6747
  const _hoisted_1 = { class: "u-barcode" };
5500
6748
  const _hoisted_2 = ["canvas-id"];
5501
6749
  const _hoisted_3 = ["src"];