pcm-agents 1.0.18 → 1.0.19

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.
Files changed (214) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/app-globals-BIO4q6tX.js.map +1 -1
  3. package/dist/cjs/components-chat-message_33.cjs.entry.js +54 -2317
  4. package/dist/cjs/components-chat-message_33.cjs.entry.js.map +1 -1
  5. package/dist/cjs/components-oem-virtual-chat-modal.cjs.entry.js +2 -2
  6. package/dist/cjs/{conversation-utils-BmxHPKOt.js → conversation-utils-CKlwCDRf.js} +4 -4
  7. package/dist/cjs/{conversation-utils-BmxHPKOt.js.map → conversation-utils-CKlwCDRf.js.map} +1 -1
  8. package/dist/cjs/{index-BivNZVuE.js → index-DLbq5wiz.js} +3 -3
  9. package/dist/cjs/{index-BivNZVuE.js.map → index-DLbq5wiz.js.map} +1 -1
  10. package/dist/cjs/index.cjs.js +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/markdown-C0QWZi9Q.js +2674 -0
  13. package/dist/cjs/{markdown-D3_atg0b.js.map → markdown-C0QWZi9Q.js.map} +1 -1
  14. package/dist/cjs/oem-cast-modal.cjs.entry.js +1 -1
  15. package/dist/cjs/oem-htws-modal.cjs.entry.js +1 -1
  16. package/dist/cjs/oem-jd-modal.cjs.entry.js +2 -2
  17. package/dist/cjs/oem-jlpp-modal.cjs.entry.js +1 -1
  18. package/dist/cjs/oem-jlzz-modal.cjs.entry.js +1 -1
  19. package/dist/cjs/oem-mnct-modal.cjs.entry.js +1 -1
  20. package/dist/cjs/oem-mnms-modal.cjs.entry.js +1 -1
  21. package/dist/cjs/oem-qgqjl-modal.cjs.entry.js +3 -3
  22. package/dist/cjs/pcm-agents.cjs.js +1 -1
  23. package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +2 -2
  24. package/dist/cjs/pcm-jlsx-modal.cjs.entry.js +3 -3
  25. package/dist/cjs/{sentry-reporter-Ck3EoJAs.js → sentry-reporter-BmrqhSKs.js} +3 -3
  26. package/dist/cjs/{sentry-reporter-Ck3EoJAs.js.map → sentry-reporter-BmrqhSKs.js.map} +1 -1
  27. package/dist/collection/components/components-upload/components-upload.js +1 -1
  28. package/dist/collection/components/components-voice-input-btn/components-voice-input-btn.css +67 -67
  29. package/dist/collection/components/components-voice-input-btn/components-voice-input-btn.js +2 -2
  30. package/dist/collection/components/components-voice-input-btn/components-voice-input-btn.js.map +1 -1
  31. package/dist/collection/components/oem-cast-modal/oem-cast-modal.js +1 -1
  32. package/dist/collection/components/oem-zygh-modal/oem-zygh-modal.js +1 -1
  33. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js +26 -1
  34. package/dist/collection/components/pcm-htws-modal/pcm-htws-modal.js.map +1 -1
  35. package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js +26 -1
  36. package/dist/collection/components/pcm-hyzj-modal/pcm-hyzj-modal.js.map +1 -1
  37. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js +26 -1
  38. package/dist/collection/components/pcm-jd-modal/pcm-jd-modal.js.map +1 -1
  39. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js +26 -1
  40. package/dist/collection/components/pcm-mnct-modal/pcm-mnct-modal.js.map +1 -1
  41. package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js +26 -1
  42. package/dist/collection/components/pcm-msbg-modal/pcm-msbg-modal.js.map +1 -1
  43. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js +26 -1
  44. package/dist/collection/components/pcm-qgqjl-modal/pcm-qgqjl-modal.js.map +1 -1
  45. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +27 -2
  46. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -1
  47. package/dist/collection/components/pcm-zygh-v2-modal/pcm-zygh-v2-modal.js +27 -2
  48. package/dist/collection/components/pcm-zygh-v2-modal/pcm-zygh-v2-modal.js.map +1 -1
  49. package/dist/components/components-chat-message.js +1 -1
  50. package/dist/components/components-digital-human.js +1 -1
  51. package/dist/components/components-export-records-modal.js +1 -1
  52. package/dist/components/components-mobile-input-btn.js +1 -1
  53. package/dist/components/components-mobile-upload-btn.js +1 -1
  54. package/dist/components/components-oem-virtual-chat-modal.js +1 -1
  55. package/dist/components/components-position-selector.js +1 -1
  56. package/dist/components/components-thousand-resume-wrapper.js +1 -1
  57. package/dist/components/components-upload.js +1 -1
  58. package/dist/components/components-voice-input-btn.js +1 -1
  59. package/dist/components/index.js +1 -1
  60. package/dist/components/index.js.map +1 -1
  61. package/dist/components/oem-cast-modal.js +1 -1
  62. package/dist/components/oem-htws-modal.js +5 -5
  63. package/dist/components/oem-jd-modal.js +5 -5
  64. package/dist/components/oem-jlpp-modal.js +7 -7
  65. package/dist/components/oem-jlsx-modal.js +6 -6
  66. package/dist/components/oem-jlzz-modal.js +5 -5
  67. package/dist/components/oem-mnct-modal.js +7 -7
  68. package/dist/components/oem-mnms-modal.js +8 -8
  69. package/dist/components/oem-qgqjl-modal.js +9 -9
  70. package/dist/components/oem-zygh-modal.js +5 -5
  71. package/dist/components/{p-BYD6-WNq.js → p-BFBILVHb.js} +3 -3
  72. package/dist/components/{p-BYD6-WNq.js.map → p-BFBILVHb.js.map} +1 -1
  73. package/dist/components/{p-CyUWH4Mj.js → p-BM8LfA-I.js} +4 -4
  74. package/dist/components/{p-CyUWH4Mj.js.map → p-BM8LfA-I.js.map} +1 -1
  75. package/dist/components/{p-ssn_a1iK.js → p-BMyYj4Nh.js} +3 -3
  76. package/dist/components/{p-ssn_a1iK.js.map → p-BMyYj4Nh.js.map} +1 -1
  77. package/dist/components/{p-BWUzAm4p.js → p-BbgkkZ8z.js} +3 -3
  78. package/dist/components/{p-BWUzAm4p.js.map → p-BbgkkZ8z.js.map} +1 -1
  79. package/dist/components/{p-BG6NTTpT.js → p-BsVthfPT.js} +4 -4
  80. package/dist/components/{p-BG6NTTpT.js.map → p-BsVthfPT.js.map} +1 -1
  81. package/dist/components/{p-A3F6YFmx.js → p-C5cxtSmw.js} +3 -3
  82. package/dist/components/{p-A3F6YFmx.js.map → p-C5cxtSmw.js.map} +1 -1
  83. package/dist/components/{p-Bry80jQE.js → p-CRuYvhDS.js} +3 -3
  84. package/dist/components/{p-Bry80jQE.js.map → p-CRuYvhDS.js.map} +1 -1
  85. package/dist/components/{p-CXalGxO1.js → p-CUgq8UDs.js} +4 -4
  86. package/dist/components/p-CUgq8UDs.js.map +1 -0
  87. package/dist/components/{p-CNf8b_lT.js → p-ChHHPVqa.js} +6 -6
  88. package/dist/components/{p-CNf8b_lT.js.map → p-ChHHPVqa.js.map} +1 -1
  89. package/dist/components/p-CnhOGURu.js +2671 -0
  90. package/dist/components/p-CnhOGURu.js.map +1 -0
  91. package/dist/components/{p-nhuWyXIB.js → p-DMxCytIw.js} +3 -3
  92. package/dist/components/{p-nhuWyXIB.js.map → p-DMxCytIw.js.map} +1 -1
  93. package/dist/components/{p-DLLeEB9s.js → p-DW7If7Qd.js} +4 -5
  94. package/dist/components/p-DW7If7Qd.js.map +1 -0
  95. package/dist/components/{p-0BR5lZiC.js → p-OFgPkEGL.js} +4 -4
  96. package/dist/components/{p-0BR5lZiC.js.map → p-OFgPkEGL.js.map} +1 -1
  97. package/dist/components/{p-CdHCR-Rr.js → p-aK_x2dmu.js} +3 -3
  98. package/dist/components/{p-CdHCR-Rr.js.map → p-aK_x2dmu.js.map} +1 -1
  99. package/dist/components/{p-C-x5thNz.js → p-sXNEbeK0.js} +3 -3
  100. package/dist/components/{p-C-x5thNz.js.map → p-sXNEbeK0.js.map} +1 -1
  101. package/dist/components/pcm-1zhanshi-mnms-modal.js +5 -5
  102. package/dist/components/pcm-app-chat-modal.js +1 -1
  103. package/dist/components/pcm-ats-mnms-modal.js +5 -5
  104. package/dist/components/pcm-card.js +1 -1
  105. package/dist/components/pcm-hr-chat-modal.js +2 -2
  106. package/dist/components/pcm-htws-modal.js +15 -9
  107. package/dist/components/pcm-htws-modal.js.map +1 -1
  108. package/dist/components/pcm-hyzj-modal.js +12 -6
  109. package/dist/components/pcm-hyzj-modal.js.map +1 -1
  110. package/dist/components/pcm-jd-modal.js +13 -7
  111. package/dist/components/pcm-jd-modal.js.map +1 -1
  112. package/dist/components/pcm-jlpp-modal.js +8 -8
  113. package/dist/components/pcm-jlsx-modal.js +6 -6
  114. package/dist/components/pcm-jlzz-modal.js +6 -6
  115. package/dist/components/pcm-mnct-modal.js +14 -8
  116. package/dist/components/pcm-mnct-modal.js.map +1 -1
  117. package/dist/components/pcm-mnms-modal.js +8 -8
  118. package/dist/components/pcm-mnms-zp-modal.js +8 -8
  119. package/dist/components/pcm-msbg-modal.js +12 -6
  120. package/dist/components/pcm-msbg-modal.js.map +1 -1
  121. package/dist/components/pcm-qgqjl-modal.js +16 -10
  122. package/dist/components/pcm-qgqjl-modal.js.map +1 -1
  123. package/dist/components/pcm-virtual-chat-modal.js +1 -1
  124. package/dist/components/pcm-zsk-chat-modal.js +3 -3
  125. package/dist/components/pcm-zygh-modal.js +14 -8
  126. package/dist/components/pcm-zygh-modal.js.map +1 -1
  127. package/dist/components/pcm-zygh-v2-modal.js +14 -8
  128. package/dist/components/pcm-zygh-v2-modal.js.map +1 -1
  129. package/dist/esm/app-globals-Chti62re.js.map +1 -1
  130. package/dist/esm/components-chat-message_33.entry.js +54 -2317
  131. package/dist/esm/components-chat-message_33.entry.js.map +1 -1
  132. package/dist/esm/components-oem-virtual-chat-modal.entry.js +2 -2
  133. package/dist/esm/{conversation-utils-fCK0sgM1.js → conversation-utils-BGcxaSyr.js} +4 -4
  134. package/dist/esm/{conversation-utils-fCK0sgM1.js.map → conversation-utils-BGcxaSyr.js.map} +1 -1
  135. package/dist/esm/{index-D7qB8ZCs.js → index-BaYctFVD.js} +3 -3
  136. package/dist/esm/{index-D7qB8ZCs.js.map → index-BaYctFVD.js.map} +1 -1
  137. package/dist/esm/index.js +1 -1
  138. package/dist/esm/loader.js +1 -1
  139. package/dist/esm/markdown-CnhOGURu.js +2671 -0
  140. package/dist/esm/{markdown-DcmYnk0q.js.map → markdown-CnhOGURu.js.map} +1 -1
  141. package/dist/esm/oem-cast-modal.entry.js +1 -1
  142. package/dist/esm/oem-htws-modal.entry.js +1 -1
  143. package/dist/esm/oem-jd-modal.entry.js +2 -2
  144. package/dist/esm/oem-jlpp-modal.entry.js +1 -1
  145. package/dist/esm/oem-jlzz-modal.entry.js +1 -1
  146. package/dist/esm/oem-mnct-modal.entry.js +1 -1
  147. package/dist/esm/oem-mnms-modal.entry.js +1 -1
  148. package/dist/esm/oem-qgqjl-modal.entry.js +3 -3
  149. package/dist/esm/pcm-agents.js +1 -1
  150. package/dist/esm/pcm-hr-chat-modal.entry.js +2 -2
  151. package/dist/esm/pcm-jlsx-modal.entry.js +3 -3
  152. package/dist/esm/{sentry-reporter-CAPKrssw.js → sentry-reporter-CQ8bX8AM.js} +3 -3
  153. package/dist/esm/{sentry-reporter-CAPKrssw.js.map → sentry-reporter-CQ8bX8AM.js.map} +1 -1
  154. package/dist/pcm-agents/index.esm.js +1 -1
  155. package/dist/pcm-agents/{p-ae9f3219.entry.js → p-07d0bfa5.entry.js} +2 -2
  156. package/dist/pcm-agents/{p-e908843d.entry.js → p-415d021b.entry.js} +2 -2
  157. package/dist/pcm-agents/{p-4a3091a0.entry.js → p-52b8396f.entry.js} +2 -2
  158. package/dist/pcm-agents/{p-713ee0b3.entry.js → p-85b37d21.entry.js} +2 -2
  159. package/dist/pcm-agents/{p-2acf8d44.entry.js → p-86c15766.entry.js} +2 -2
  160. package/dist/pcm-agents/{p-b45645c2.entry.js → p-900ade9f.entry.js} +2 -2
  161. package/dist/pcm-agents/{p-C1T6GEE8.js → p-BUe4kiCQ.js} +2 -2
  162. package/dist/pcm-agents/{p-C1T6GEE8.js.map → p-BUe4kiCQ.js.map} +1 -1
  163. package/dist/pcm-agents/p-CeRTfvY9.js.map +1 -1
  164. package/dist/pcm-agents/p-CnhOGURu.js +2 -0
  165. package/dist/pcm-agents/{p-DcmYnk0q.js.map → p-CnhOGURu.js.map} +1 -1
  166. package/dist/pcm-agents/{p-Cgydfo3f.js → p-DpK1mBu7.js} +2 -2
  167. package/dist/pcm-agents/{p-Cgydfo3f.js.map → p-DpK1mBu7.js.map} +1 -1
  168. package/dist/pcm-agents/{p-MWaXn7-C.js → p-DzZpAxqF.js} +2 -2
  169. package/dist/pcm-agents/{p-MWaXn7-C.js.map → p-DzZpAxqF.js.map} +1 -1
  170. package/dist/pcm-agents/{p-e18cbbc1.entry.js → p-a33ebff7.entry.js} +2 -2
  171. package/dist/pcm-agents/{p-081b9fcf.entry.js → p-be640465.entry.js} +2 -2
  172. package/dist/pcm-agents/{p-19e22dee.entry.js → p-c95e6896.entry.js} +2 -2
  173. package/dist/pcm-agents/{p-50af907f.entry.js → p-cd2844d8.entry.js} +2 -2
  174. package/dist/pcm-agents/{p-08b41c0c.entry.js → p-d25b1c70.entry.js} +2 -2
  175. package/dist/pcm-agents/p-f2445cbd.entry.js +8 -0
  176. package/dist/pcm-agents/p-f2445cbd.entry.js.map +1 -0
  177. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  178. package/dist/types/components/pcm-htws-modal/pcm-htws-modal.d.ts +5 -0
  179. package/dist/types/components/pcm-hyzj-modal/pcm-hyzj-modal.d.ts +5 -0
  180. package/dist/types/components/pcm-jd-modal/pcm-jd-modal.d.ts +5 -0
  181. package/dist/types/components/pcm-mnct-modal/pcm-mnct-modal.d.ts +5 -0
  182. package/dist/types/components/pcm-msbg-modal/pcm-msbg-modal.d.ts +5 -0
  183. package/dist/types/components/pcm-qgqjl-modal/pcm-qgqjl-modal.d.ts +5 -0
  184. package/dist/types/components/pcm-zygh-modal/pcm-zygh-modal.d.ts +5 -0
  185. package/dist/types/components/pcm-zygh-v2-modal/pcm-zygh-v2-modal.d.ts +5 -0
  186. package/dist/types/components.d.ts +64 -0
  187. package/package.json +1 -1
  188. package/readme.md +307 -307
  189. package/dist/cjs/markdown-D3_atg0b.js +0 -2564
  190. package/dist/components/p-B85MJLTf.js +0 -8
  191. package/dist/components/p-B85MJLTf.js.map +0 -1
  192. package/dist/components/p-CXalGxO1.js.map +0 -1
  193. package/dist/components/p-D483moFs.js +0 -2310
  194. package/dist/components/p-D483moFs.js.map +0 -1
  195. package/dist/components/p-DLLeEB9s.js.map +0 -1
  196. package/dist/components/p-DuXrU5Qi.js +0 -2559
  197. package/dist/components/p-DuXrU5Qi.js.map +0 -1
  198. package/dist/esm/markdown-DcmYnk0q.js +0 -2561
  199. package/dist/pcm-agents/p-4c6e5c43.entry.js +0 -8
  200. package/dist/pcm-agents/p-4c6e5c43.entry.js.map +0 -1
  201. package/dist/pcm-agents/p-DcmYnk0q.js +0 -2
  202. /package/dist/pcm-agents/{p-ae9f3219.entry.js.map → p-07d0bfa5.entry.js.map} +0 -0
  203. /package/dist/pcm-agents/{p-e908843d.entry.js.map → p-415d021b.entry.js.map} +0 -0
  204. /package/dist/pcm-agents/{p-4a3091a0.entry.js.map → p-52b8396f.entry.js.map} +0 -0
  205. /package/dist/pcm-agents/{p-713ee0b3.entry.js.map → p-85b37d21.entry.js.map} +0 -0
  206. /package/dist/pcm-agents/{p-2acf8d44.entry.js.map → p-86c15766.entry.js.map} +0 -0
  207. /package/dist/pcm-agents/{p-b45645c2.entry.js.map → p-900ade9f.entry.js.map} +0 -0
  208. /package/dist/pcm-agents/{p-e18cbbc1.entry.js.map → p-a33ebff7.entry.js.map} +0 -0
  209. /package/dist/pcm-agents/{p-081b9fcf.entry.js.map → p-be640465.entry.js.map} +0 -0
  210. /package/dist/pcm-agents/{p-19e22dee.entry.js.map → p-c95e6896.entry.js.map} +0 -0
  211. /package/dist/pcm-agents/{p-50af907f.entry.js.map → p-cd2844d8.entry.js.map} +0 -0
  212. /package/dist/pcm-agents/{p-08b41c0c.entry.js.map → p-d25b1c70.entry.js.map} +0 -0
  213. /package/dist/types/code/{agents-sdk → sdk}/packages/pcm-agents/.stencil/store/auth.store.d.ts +0 -0
  214. /package/dist/types/code/{agents-sdk → sdk}/packages/pcm-agents/.stencil/store/config.store.d.ts +0 -0
@@ -1,11 +1,12 @@
1
1
  import { r as registerInstance, c as createEvent, g as getElement, h } from './index-Bq0K-WqZ.js';
2
- import { g as getDefaultExportFromCjs, r as renderMarkdown } from './markdown-DcmYnk0q.js';
3
- import { s as sendHttpRequest, k as getCosPresignedUrl, i as getCosPreviewUrl, c as configStore, P as PCM_DOMAIN, l as getOemPositions, a as authStore, v as verifyApiKey, b as sendSSERequest, F as FileUploadState, u as uploadFileToBackend, m as formatFileSize, n as getSupportedAudioMimeType, e as convertAudioToText, j as uploadFileByUrl, h as verifySmsCode, f as fetchAgentInfo, g as getSupportedMimeType } from './index-D7qB8ZCs.js';
2
+ import { g as getDefaultExportFromCjs, r as renderMarkdown } from './markdown-CnhOGURu.js';
3
+ import { s as sendHttpRequest, k as getCosPresignedUrl, i as getCosPreviewUrl, c as configStore, P as PCM_DOMAIN, l as getOemPositions, a as authStore, v as verifyApiKey, b as sendSSERequest, F as FileUploadState, u as uploadFileToBackend, m as formatFileSize, n as getSupportedAudioMimeType, e as convertAudioToText, j as uploadFileByUrl, h as verifySmsCode, f as fetchAgentInfo, g as getSupportedMimeType } from './index-BaYctFVD.js';
4
4
  import { E as ErrorEventBus } from './error-event-C0FYX2-Z.js';
5
- import { S as SentryReporter } from './sentry-reporter-CAPKrssw.js';
5
+ import { S as SentryReporter } from './sentry-reporter-CQ8bX8AM.js';
6
6
  import { M as Message } from './message.service-D39f_W8k.js';
7
+ import qrcode from 'qrcode-generator';
7
8
  import { s as showMessage } from './message-utils-DnoxSHNP.js';
8
- import { f as fetchHistoryConversations } from './conversation-utils-fCK0sgM1.js';
9
+ import { f as fetchHistoryConversations } from './conversation-utils-BGcxaSyr.js';
9
10
  import './exports-Bs-zO1WZ.js';
10
11
 
11
12
  var clipboard$1 = {exports: {}};
@@ -2264,2310 +2265,6 @@ const ComponentsMessage = class {
2264
2265
  };
2265
2266
  ComponentsMessage.style = componentsMessageCss + hostCss$p;
2266
2267
 
2267
- var qrcode$1 = {exports: {}};
2268
-
2269
- var hasRequiredQrcode;
2270
-
2271
- function requireQrcode () {
2272
- if (hasRequiredQrcode) return qrcode$1.exports;
2273
- hasRequiredQrcode = 1;
2274
- (function (module, exports) {
2275
- //---------------------------------------------------------------------
2276
- //
2277
- // QR Code Generator for JavaScript
2278
- //
2279
- // Copyright (c) 2009 Kazuhiko Arase
2280
- //
2281
- // URL: http://www.d-project.com/
2282
- //
2283
- // Licensed under the MIT license:
2284
- // http://www.opensource.org/licenses/mit-license.php
2285
- //
2286
- // The word 'QR Code' is registered trademark of
2287
- // DENSO WAVE INCORPORATED
2288
- // http://www.denso-wave.com/qrcode/faqpatent-e.html
2289
- //
2290
- //---------------------------------------------------------------------
2291
-
2292
- var qrcode = function() {
2293
-
2294
- //---------------------------------------------------------------------
2295
- // qrcode
2296
- //---------------------------------------------------------------------
2297
-
2298
- /**
2299
- * qrcode
2300
- * @param typeNumber 1 to 40
2301
- * @param errorCorrectionLevel 'L','M','Q','H'
2302
- */
2303
- var qrcode = function(typeNumber, errorCorrectionLevel) {
2304
-
2305
- var PAD0 = 0xEC;
2306
- var PAD1 = 0x11;
2307
-
2308
- var _typeNumber = typeNumber;
2309
- var _errorCorrectionLevel = QRErrorCorrectionLevel[errorCorrectionLevel];
2310
- var _modules = null;
2311
- var _moduleCount = 0;
2312
- var _dataCache = null;
2313
- var _dataList = [];
2314
-
2315
- var _this = {};
2316
-
2317
- var makeImpl = function(test, maskPattern) {
2318
-
2319
- _moduleCount = _typeNumber * 4 + 17;
2320
- _modules = function(moduleCount) {
2321
- var modules = new Array(moduleCount);
2322
- for (var row = 0; row < moduleCount; row += 1) {
2323
- modules[row] = new Array(moduleCount);
2324
- for (var col = 0; col < moduleCount; col += 1) {
2325
- modules[row][col] = null;
2326
- }
2327
- }
2328
- return modules;
2329
- }(_moduleCount);
2330
-
2331
- setupPositionProbePattern(0, 0);
2332
- setupPositionProbePattern(_moduleCount - 7, 0);
2333
- setupPositionProbePattern(0, _moduleCount - 7);
2334
- setupPositionAdjustPattern();
2335
- setupTimingPattern();
2336
- setupTypeInfo(test, maskPattern);
2337
-
2338
- if (_typeNumber >= 7) {
2339
- setupTypeNumber(test);
2340
- }
2341
-
2342
- if (_dataCache == null) {
2343
- _dataCache = createData(_typeNumber, _errorCorrectionLevel, _dataList);
2344
- }
2345
-
2346
- mapData(_dataCache, maskPattern);
2347
- };
2348
-
2349
- var setupPositionProbePattern = function(row, col) {
2350
-
2351
- for (var r = -1; r <= 7; r += 1) {
2352
-
2353
- if (row + r <= -1 || _moduleCount <= row + r) continue;
2354
-
2355
- for (var c = -1; c <= 7; c += 1) {
2356
-
2357
- if (col + c <= -1 || _moduleCount <= col + c) continue;
2358
-
2359
- if ( (0 <= r && r <= 6 && (c == 0 || c == 6) )
2360
- || (0 <= c && c <= 6 && (r == 0 || r == 6) )
2361
- || (2 <= r && r <= 4 && 2 <= c && c <= 4) ) {
2362
- _modules[row + r][col + c] = true;
2363
- } else {
2364
- _modules[row + r][col + c] = false;
2365
- }
2366
- }
2367
- }
2368
- };
2369
-
2370
- var getBestMaskPattern = function() {
2371
-
2372
- var minLostPoint = 0;
2373
- var pattern = 0;
2374
-
2375
- for (var i = 0; i < 8; i += 1) {
2376
-
2377
- makeImpl(true, i);
2378
-
2379
- var lostPoint = QRUtil.getLostPoint(_this);
2380
-
2381
- if (i == 0 || minLostPoint > lostPoint) {
2382
- minLostPoint = lostPoint;
2383
- pattern = i;
2384
- }
2385
- }
2386
-
2387
- return pattern;
2388
- };
2389
-
2390
- var setupTimingPattern = function() {
2391
-
2392
- for (var r = 8; r < _moduleCount - 8; r += 1) {
2393
- if (_modules[r][6] != null) {
2394
- continue;
2395
- }
2396
- _modules[r][6] = (r % 2 == 0);
2397
- }
2398
-
2399
- for (var c = 8; c < _moduleCount - 8; c += 1) {
2400
- if (_modules[6][c] != null) {
2401
- continue;
2402
- }
2403
- _modules[6][c] = (c % 2 == 0);
2404
- }
2405
- };
2406
-
2407
- var setupPositionAdjustPattern = function() {
2408
-
2409
- var pos = QRUtil.getPatternPosition(_typeNumber);
2410
-
2411
- for (var i = 0; i < pos.length; i += 1) {
2412
-
2413
- for (var j = 0; j < pos.length; j += 1) {
2414
-
2415
- var row = pos[i];
2416
- var col = pos[j];
2417
-
2418
- if (_modules[row][col] != null) {
2419
- continue;
2420
- }
2421
-
2422
- for (var r = -2; r <= 2; r += 1) {
2423
-
2424
- for (var c = -2; c <= 2; c += 1) {
2425
-
2426
- if (r == -2 || r == 2 || c == -2 || c == 2
2427
- || (r == 0 && c == 0) ) {
2428
- _modules[row + r][col + c] = true;
2429
- } else {
2430
- _modules[row + r][col + c] = false;
2431
- }
2432
- }
2433
- }
2434
- }
2435
- }
2436
- };
2437
-
2438
- var setupTypeNumber = function(test) {
2439
-
2440
- var bits = QRUtil.getBCHTypeNumber(_typeNumber);
2441
-
2442
- for (var i = 0; i < 18; i += 1) {
2443
- var mod = (!test && ( (bits >> i) & 1) == 1);
2444
- _modules[Math.floor(i / 3)][i % 3 + _moduleCount - 8 - 3] = mod;
2445
- }
2446
-
2447
- for (var i = 0; i < 18; i += 1) {
2448
- var mod = (!test && ( (bits >> i) & 1) == 1);
2449
- _modules[i % 3 + _moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
2450
- }
2451
- };
2452
-
2453
- var setupTypeInfo = function(test, maskPattern) {
2454
-
2455
- var data = (_errorCorrectionLevel << 3) | maskPattern;
2456
- var bits = QRUtil.getBCHTypeInfo(data);
2457
-
2458
- // vertical
2459
- for (var i = 0; i < 15; i += 1) {
2460
-
2461
- var mod = (!test && ( (bits >> i) & 1) == 1);
2462
-
2463
- if (i < 6) {
2464
- _modules[i][8] = mod;
2465
- } else if (i < 8) {
2466
- _modules[i + 1][8] = mod;
2467
- } else {
2468
- _modules[_moduleCount - 15 + i][8] = mod;
2469
- }
2470
- }
2471
-
2472
- // horizontal
2473
- for (var i = 0; i < 15; i += 1) {
2474
-
2475
- var mod = (!test && ( (bits >> i) & 1) == 1);
2476
-
2477
- if (i < 8) {
2478
- _modules[8][_moduleCount - i - 1] = mod;
2479
- } else if (i < 9) {
2480
- _modules[8][15 - i - 1 + 1] = mod;
2481
- } else {
2482
- _modules[8][15 - i - 1] = mod;
2483
- }
2484
- }
2485
-
2486
- // fixed module
2487
- _modules[_moduleCount - 8][8] = (!test);
2488
- };
2489
-
2490
- var mapData = function(data, maskPattern) {
2491
-
2492
- var inc = -1;
2493
- var row = _moduleCount - 1;
2494
- var bitIndex = 7;
2495
- var byteIndex = 0;
2496
- var maskFunc = QRUtil.getMaskFunction(maskPattern);
2497
-
2498
- for (var col = _moduleCount - 1; col > 0; col -= 2) {
2499
-
2500
- if (col == 6) col -= 1;
2501
-
2502
- while (true) {
2503
-
2504
- for (var c = 0; c < 2; c += 1) {
2505
-
2506
- if (_modules[row][col - c] == null) {
2507
-
2508
- var dark = false;
2509
-
2510
- if (byteIndex < data.length) {
2511
- dark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);
2512
- }
2513
-
2514
- var mask = maskFunc(row, col - c);
2515
-
2516
- if (mask) {
2517
- dark = !dark;
2518
- }
2519
-
2520
- _modules[row][col - c] = dark;
2521
- bitIndex -= 1;
2522
-
2523
- if (bitIndex == -1) {
2524
- byteIndex += 1;
2525
- bitIndex = 7;
2526
- }
2527
- }
2528
- }
2529
-
2530
- row += inc;
2531
-
2532
- if (row < 0 || _moduleCount <= row) {
2533
- row -= inc;
2534
- inc = -inc;
2535
- break;
2536
- }
2537
- }
2538
- }
2539
- };
2540
-
2541
- var createBytes = function(buffer, rsBlocks) {
2542
-
2543
- var offset = 0;
2544
-
2545
- var maxDcCount = 0;
2546
- var maxEcCount = 0;
2547
-
2548
- var dcdata = new Array(rsBlocks.length);
2549
- var ecdata = new Array(rsBlocks.length);
2550
-
2551
- for (var r = 0; r < rsBlocks.length; r += 1) {
2552
-
2553
- var dcCount = rsBlocks[r].dataCount;
2554
- var ecCount = rsBlocks[r].totalCount - dcCount;
2555
-
2556
- maxDcCount = Math.max(maxDcCount, dcCount);
2557
- maxEcCount = Math.max(maxEcCount, ecCount);
2558
-
2559
- dcdata[r] = new Array(dcCount);
2560
-
2561
- for (var i = 0; i < dcdata[r].length; i += 1) {
2562
- dcdata[r][i] = 0xff & buffer.getBuffer()[i + offset];
2563
- }
2564
- offset += dcCount;
2565
-
2566
- var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
2567
- var rawPoly = qrPolynomial(dcdata[r], rsPoly.getLength() - 1);
2568
-
2569
- var modPoly = rawPoly.mod(rsPoly);
2570
- ecdata[r] = new Array(rsPoly.getLength() - 1);
2571
- for (var i = 0; i < ecdata[r].length; i += 1) {
2572
- var modIndex = i + modPoly.getLength() - ecdata[r].length;
2573
- ecdata[r][i] = (modIndex >= 0)? modPoly.getAt(modIndex) : 0;
2574
- }
2575
- }
2576
-
2577
- var totalCodeCount = 0;
2578
- for (var i = 0; i < rsBlocks.length; i += 1) {
2579
- totalCodeCount += rsBlocks[i].totalCount;
2580
- }
2581
-
2582
- var data = new Array(totalCodeCount);
2583
- var index = 0;
2584
-
2585
- for (var i = 0; i < maxDcCount; i += 1) {
2586
- for (var r = 0; r < rsBlocks.length; r += 1) {
2587
- if (i < dcdata[r].length) {
2588
- data[index] = dcdata[r][i];
2589
- index += 1;
2590
- }
2591
- }
2592
- }
2593
-
2594
- for (var i = 0; i < maxEcCount; i += 1) {
2595
- for (var r = 0; r < rsBlocks.length; r += 1) {
2596
- if (i < ecdata[r].length) {
2597
- data[index] = ecdata[r][i];
2598
- index += 1;
2599
- }
2600
- }
2601
- }
2602
-
2603
- return data;
2604
- };
2605
-
2606
- var createData = function(typeNumber, errorCorrectionLevel, dataList) {
2607
-
2608
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectionLevel);
2609
-
2610
- var buffer = qrBitBuffer();
2611
-
2612
- for (var i = 0; i < dataList.length; i += 1) {
2613
- var data = dataList[i];
2614
- buffer.put(data.getMode(), 4);
2615
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
2616
- data.write(buffer);
2617
- }
2618
-
2619
- // calc num max data.
2620
- var totalDataCount = 0;
2621
- for (var i = 0; i < rsBlocks.length; i += 1) {
2622
- totalDataCount += rsBlocks[i].dataCount;
2623
- }
2624
-
2625
- if (buffer.getLengthInBits() > totalDataCount * 8) {
2626
- throw 'code length overflow. ('
2627
- + buffer.getLengthInBits()
2628
- + '>'
2629
- + totalDataCount * 8
2630
- + ')';
2631
- }
2632
-
2633
- // end code
2634
- if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
2635
- buffer.put(0, 4);
2636
- }
2637
-
2638
- // padding
2639
- while (buffer.getLengthInBits() % 8 != 0) {
2640
- buffer.putBit(false);
2641
- }
2642
-
2643
- // padding
2644
- while (true) {
2645
-
2646
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
2647
- break;
2648
- }
2649
- buffer.put(PAD0, 8);
2650
-
2651
- if (buffer.getLengthInBits() >= totalDataCount * 8) {
2652
- break;
2653
- }
2654
- buffer.put(PAD1, 8);
2655
- }
2656
-
2657
- return createBytes(buffer, rsBlocks);
2658
- };
2659
-
2660
- _this.addData = function(data, mode) {
2661
-
2662
- mode = mode || 'Byte';
2663
-
2664
- var newData = null;
2665
-
2666
- switch(mode) {
2667
- case 'Numeric' :
2668
- newData = qrNumber(data);
2669
- break;
2670
- case 'Alphanumeric' :
2671
- newData = qrAlphaNum(data);
2672
- break;
2673
- case 'Byte' :
2674
- newData = qr8BitByte(data);
2675
- break;
2676
- case 'Kanji' :
2677
- newData = qrKanji(data);
2678
- break;
2679
- default :
2680
- throw 'mode:' + mode;
2681
- }
2682
-
2683
- _dataList.push(newData);
2684
- _dataCache = null;
2685
- };
2686
-
2687
- _this.isDark = function(row, col) {
2688
- if (row < 0 || _moduleCount <= row || col < 0 || _moduleCount <= col) {
2689
- throw row + ',' + col;
2690
- }
2691
- return _modules[row][col];
2692
- };
2693
-
2694
- _this.getModuleCount = function() {
2695
- return _moduleCount;
2696
- };
2697
-
2698
- _this.make = function() {
2699
- if (_typeNumber < 1) {
2700
- var typeNumber = 1;
2701
-
2702
- for (; typeNumber < 40; typeNumber++) {
2703
- var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, _errorCorrectionLevel);
2704
- var buffer = qrBitBuffer();
2705
-
2706
- for (var i = 0; i < _dataList.length; i++) {
2707
- var data = _dataList[i];
2708
- buffer.put(data.getMode(), 4);
2709
- buffer.put(data.getLength(), QRUtil.getLengthInBits(data.getMode(), typeNumber) );
2710
- data.write(buffer);
2711
- }
2712
-
2713
- var totalDataCount = 0;
2714
- for (var i = 0; i < rsBlocks.length; i++) {
2715
- totalDataCount += rsBlocks[i].dataCount;
2716
- }
2717
-
2718
- if (buffer.getLengthInBits() <= totalDataCount * 8) {
2719
- break;
2720
- }
2721
- }
2722
-
2723
- _typeNumber = typeNumber;
2724
- }
2725
-
2726
- makeImpl(false, getBestMaskPattern() );
2727
- };
2728
-
2729
- _this.createTableTag = function(cellSize, margin) {
2730
-
2731
- cellSize = cellSize || 2;
2732
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
2733
-
2734
- var qrHtml = '';
2735
-
2736
- qrHtml += '<table style="';
2737
- qrHtml += ' border-width: 0px; border-style: none;';
2738
- qrHtml += ' border-collapse: collapse;';
2739
- qrHtml += ' padding: 0px; margin: ' + margin + 'px;';
2740
- qrHtml += '">';
2741
- qrHtml += '<tbody>';
2742
-
2743
- for (var r = 0; r < _this.getModuleCount(); r += 1) {
2744
-
2745
- qrHtml += '<tr>';
2746
-
2747
- for (var c = 0; c < _this.getModuleCount(); c += 1) {
2748
- qrHtml += '<td style="';
2749
- qrHtml += ' border-width: 0px; border-style: none;';
2750
- qrHtml += ' border-collapse: collapse;';
2751
- qrHtml += ' padding: 0px; margin: 0px;';
2752
- qrHtml += ' width: ' + cellSize + 'px;';
2753
- qrHtml += ' height: ' + cellSize + 'px;';
2754
- qrHtml += ' background-color: ';
2755
- qrHtml += _this.isDark(r, c)? '#000000' : '#ffffff';
2756
- qrHtml += ';';
2757
- qrHtml += '"/>';
2758
- }
2759
-
2760
- qrHtml += '</tr>';
2761
- }
2762
-
2763
- qrHtml += '</tbody>';
2764
- qrHtml += '</table>';
2765
-
2766
- return qrHtml;
2767
- };
2768
-
2769
- _this.createSvgTag = function(cellSize, margin, alt, title) {
2770
-
2771
- var opts = {};
2772
- if (typeof arguments[0] == 'object') {
2773
- // Called by options.
2774
- opts = arguments[0];
2775
- // overwrite cellSize and margin.
2776
- cellSize = opts.cellSize;
2777
- margin = opts.margin;
2778
- alt = opts.alt;
2779
- title = opts.title;
2780
- }
2781
-
2782
- cellSize = cellSize || 2;
2783
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
2784
-
2785
- // Compose alt property surrogate
2786
- alt = (typeof alt === 'string') ? {text: alt} : alt || {};
2787
- alt.text = alt.text || null;
2788
- alt.id = (alt.text) ? alt.id || 'qrcode-description' : null;
2789
-
2790
- // Compose title property surrogate
2791
- title = (typeof title === 'string') ? {text: title} : title || {};
2792
- title.text = title.text || null;
2793
- title.id = (title.text) ? title.id || 'qrcode-title' : null;
2794
-
2795
- var size = _this.getModuleCount() * cellSize + margin * 2;
2796
- var c, mc, r, mr, qrSvg='', rect;
2797
-
2798
- rect = 'l' + cellSize + ',0 0,' + cellSize +
2799
- ' -' + cellSize + ',0 0,-' + cellSize + 'z ';
2800
-
2801
- qrSvg += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"';
2802
- qrSvg += !opts.scalable ? ' width="' + size + 'px" height="' + size + 'px"' : '';
2803
- qrSvg += ' viewBox="0 0 ' + size + ' ' + size + '" ';
2804
- qrSvg += ' preserveAspectRatio="xMinYMin meet"';
2805
- qrSvg += (title.text || alt.text) ? ' role="img" aria-labelledby="' +
2806
- escapeXml([title.id, alt.id].join(' ').trim() ) + '"' : '';
2807
- qrSvg += '>';
2808
- qrSvg += (title.text) ? '<title id="' + escapeXml(title.id) + '">' +
2809
- escapeXml(title.text) + '</title>' : '';
2810
- qrSvg += (alt.text) ? '<description id="' + escapeXml(alt.id) + '">' +
2811
- escapeXml(alt.text) + '</description>' : '';
2812
- qrSvg += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>';
2813
- qrSvg += '<path d="';
2814
-
2815
- for (r = 0; r < _this.getModuleCount(); r += 1) {
2816
- mr = r * cellSize + margin;
2817
- for (c = 0; c < _this.getModuleCount(); c += 1) {
2818
- if (_this.isDark(r, c) ) {
2819
- mc = c*cellSize+margin;
2820
- qrSvg += 'M' + mc + ',' + mr + rect;
2821
- }
2822
- }
2823
- }
2824
-
2825
- qrSvg += '" stroke="transparent" fill="black"/>';
2826
- qrSvg += '</svg>';
2827
-
2828
- return qrSvg;
2829
- };
2830
-
2831
- _this.createDataURL = function(cellSize, margin) {
2832
-
2833
- cellSize = cellSize || 2;
2834
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
2835
-
2836
- var size = _this.getModuleCount() * cellSize + margin * 2;
2837
- var min = margin;
2838
- var max = size - margin;
2839
-
2840
- return createDataURL(size, size, function(x, y) {
2841
- if (min <= x && x < max && min <= y && y < max) {
2842
- var c = Math.floor( (x - min) / cellSize);
2843
- var r = Math.floor( (y - min) / cellSize);
2844
- return _this.isDark(r, c)? 0 : 1;
2845
- } else {
2846
- return 1;
2847
- }
2848
- } );
2849
- };
2850
-
2851
- _this.createImgTag = function(cellSize, margin, alt) {
2852
-
2853
- cellSize = cellSize || 2;
2854
- margin = (typeof margin == 'undefined')? cellSize * 4 : margin;
2855
-
2856
- var size = _this.getModuleCount() * cellSize + margin * 2;
2857
-
2858
- var img = '';
2859
- img += '<img';
2860
- img += '\u0020src="';
2861
- img += _this.createDataURL(cellSize, margin);
2862
- img += '"';
2863
- img += '\u0020width="';
2864
- img += size;
2865
- img += '"';
2866
- img += '\u0020height="';
2867
- img += size;
2868
- img += '"';
2869
- if (alt) {
2870
- img += '\u0020alt="';
2871
- img += escapeXml(alt);
2872
- img += '"';
2873
- }
2874
- img += '/>';
2875
-
2876
- return img;
2877
- };
2878
-
2879
- var escapeXml = function(s) {
2880
- var escaped = '';
2881
- for (var i = 0; i < s.length; i += 1) {
2882
- var c = s.charAt(i);
2883
- switch(c) {
2884
- case '<': escaped += '&lt;'; break;
2885
- case '>': escaped += '&gt;'; break;
2886
- case '&': escaped += '&amp;'; break;
2887
- case '"': escaped += '&quot;'; break;
2888
- default : escaped += c; break;
2889
- }
2890
- }
2891
- return escaped;
2892
- };
2893
-
2894
- var _createHalfASCII = function(margin) {
2895
- var cellSize = 1;
2896
- margin = (typeof margin == 'undefined')? cellSize * 2 : margin;
2897
-
2898
- var size = _this.getModuleCount() * cellSize + margin * 2;
2899
- var min = margin;
2900
- var max = size - margin;
2901
-
2902
- var y, x, r1, r2, p;
2903
-
2904
- var blocks = {
2905
- '██': '█',
2906
- '█ ': '▀',
2907
- ' █': '▄',
2908
- ' ': ' '
2909
- };
2910
-
2911
- var blocksLastLineNoMargin = {
2912
- '██': '▀',
2913
- '█ ': '▀',
2914
- ' █': ' ',
2915
- ' ': ' '
2916
- };
2917
-
2918
- var ascii = '';
2919
- for (y = 0; y < size; y += 2) {
2920
- r1 = Math.floor((y - min) / cellSize);
2921
- r2 = Math.floor((y + 1 - min) / cellSize);
2922
- for (x = 0; x < size; x += 1) {
2923
- p = '█';
2924
-
2925
- if (min <= x && x < max && min <= y && y < max && _this.isDark(r1, Math.floor((x - min) / cellSize))) {
2926
- p = ' ';
2927
- }
2928
-
2929
- if (min <= x && x < max && min <= y+1 && y+1 < max && _this.isDark(r2, Math.floor((x - min) / cellSize))) {
2930
- p += ' ';
2931
- }
2932
- else {
2933
- p += '█';
2934
- }
2935
-
2936
- // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square.
2937
- ascii += (margin < 1 && y+1 >= max) ? blocksLastLineNoMargin[p] : blocks[p];
2938
- }
2939
-
2940
- ascii += '\n';
2941
- }
2942
-
2943
- if (size % 2 && margin > 0) {
2944
- return ascii.substring(0, ascii.length - size - 1) + Array(size+1).join('▀');
2945
- }
2946
-
2947
- return ascii.substring(0, ascii.length-1);
2948
- };
2949
-
2950
- _this.createASCII = function(cellSize, margin) {
2951
- cellSize = cellSize || 1;
2952
-
2953
- if (cellSize < 2) {
2954
- return _createHalfASCII(margin);
2955
- }
2956
-
2957
- cellSize -= 1;
2958
- margin = (typeof margin == 'undefined')? cellSize * 2 : margin;
2959
-
2960
- var size = _this.getModuleCount() * cellSize + margin * 2;
2961
- var min = margin;
2962
- var max = size - margin;
2963
-
2964
- var y, x, r, p;
2965
-
2966
- var white = Array(cellSize+1).join('██');
2967
- var black = Array(cellSize+1).join(' ');
2968
-
2969
- var ascii = '';
2970
- var line = '';
2971
- for (y = 0; y < size; y += 1) {
2972
- r = Math.floor( (y - min) / cellSize);
2973
- line = '';
2974
- for (x = 0; x < size; x += 1) {
2975
- p = 1;
2976
-
2977
- if (min <= x && x < max && min <= y && y < max && _this.isDark(r, Math.floor((x - min) / cellSize))) {
2978
- p = 0;
2979
- }
2980
-
2981
- // Output 2 characters per pixel, to create full square. 1 character per pixels gives only half width of square.
2982
- line += p ? white : black;
2983
- }
2984
-
2985
- for (r = 0; r < cellSize; r += 1) {
2986
- ascii += line + '\n';
2987
- }
2988
- }
2989
-
2990
- return ascii.substring(0, ascii.length-1);
2991
- };
2992
-
2993
- _this.renderTo2dContext = function(context, cellSize) {
2994
- cellSize = cellSize || 2;
2995
- var length = _this.getModuleCount();
2996
- for (var row = 0; row < length; row++) {
2997
- for (var col = 0; col < length; col++) {
2998
- context.fillStyle = _this.isDark(row, col) ? 'black' : 'white';
2999
- context.fillRect(col * cellSize, row * cellSize, cellSize, cellSize);
3000
- }
3001
- }
3002
- };
3003
-
3004
- return _this;
3005
- };
3006
-
3007
- //---------------------------------------------------------------------
3008
- // qrcode.stringToBytes
3009
- //---------------------------------------------------------------------
3010
-
3011
- qrcode.stringToBytesFuncs = {
3012
- 'default' : function(s) {
3013
- var bytes = [];
3014
- for (var i = 0; i < s.length; i += 1) {
3015
- var c = s.charCodeAt(i);
3016
- bytes.push(c & 0xff);
3017
- }
3018
- return bytes;
3019
- }
3020
- };
3021
-
3022
- qrcode.stringToBytes = qrcode.stringToBytesFuncs['default'];
3023
-
3024
- //---------------------------------------------------------------------
3025
- // qrcode.createStringToBytes
3026
- //---------------------------------------------------------------------
3027
-
3028
- /**
3029
- * @param unicodeData base64 string of byte array.
3030
- * [16bit Unicode],[16bit Bytes], ...
3031
- * @param numChars
3032
- */
3033
- qrcode.createStringToBytes = function(unicodeData, numChars) {
3034
-
3035
- // create conversion map.
3036
-
3037
- var unicodeMap = function() {
3038
-
3039
- var bin = base64DecodeInputStream(unicodeData);
3040
- var read = function() {
3041
- var b = bin.read();
3042
- if (b == -1) throw 'eof';
3043
- return b;
3044
- };
3045
-
3046
- var count = 0;
3047
- var unicodeMap = {};
3048
- while (true) {
3049
- var b0 = bin.read();
3050
- if (b0 == -1) break;
3051
- var b1 = read();
3052
- var b2 = read();
3053
- var b3 = read();
3054
- var k = String.fromCharCode( (b0 << 8) | b1);
3055
- var v = (b2 << 8) | b3;
3056
- unicodeMap[k] = v;
3057
- count += 1;
3058
- }
3059
- if (count != numChars) {
3060
- throw count + ' != ' + numChars;
3061
- }
3062
-
3063
- return unicodeMap;
3064
- }();
3065
-
3066
- var unknownChar = '?'.charCodeAt(0);
3067
-
3068
- return function(s) {
3069
- var bytes = [];
3070
- for (var i = 0; i < s.length; i += 1) {
3071
- var c = s.charCodeAt(i);
3072
- if (c < 128) {
3073
- bytes.push(c);
3074
- } else {
3075
- var b = unicodeMap[s.charAt(i)];
3076
- if (typeof b == 'number') {
3077
- if ( (b & 0xff) == b) {
3078
- // 1byte
3079
- bytes.push(b);
3080
- } else {
3081
- // 2bytes
3082
- bytes.push(b >>> 8);
3083
- bytes.push(b & 0xff);
3084
- }
3085
- } else {
3086
- bytes.push(unknownChar);
3087
- }
3088
- }
3089
- }
3090
- return bytes;
3091
- };
3092
- };
3093
-
3094
- //---------------------------------------------------------------------
3095
- // QRMode
3096
- //---------------------------------------------------------------------
3097
-
3098
- var QRMode = {
3099
- MODE_NUMBER : 1 << 0,
3100
- MODE_ALPHA_NUM : 1 << 1,
3101
- MODE_8BIT_BYTE : 1 << 2,
3102
- MODE_KANJI : 1 << 3
3103
- };
3104
-
3105
- //---------------------------------------------------------------------
3106
- // QRErrorCorrectionLevel
3107
- //---------------------------------------------------------------------
3108
-
3109
- var QRErrorCorrectionLevel = {
3110
- L : 1,
3111
- M : 0,
3112
- Q : 3,
3113
- H : 2
3114
- };
3115
-
3116
- //---------------------------------------------------------------------
3117
- // QRMaskPattern
3118
- //---------------------------------------------------------------------
3119
-
3120
- var QRMaskPattern = {
3121
- PATTERN000 : 0,
3122
- PATTERN001 : 1,
3123
- PATTERN010 : 2,
3124
- PATTERN011 : 3,
3125
- PATTERN100 : 4,
3126
- PATTERN101 : 5,
3127
- PATTERN110 : 6,
3128
- PATTERN111 : 7
3129
- };
3130
-
3131
- //---------------------------------------------------------------------
3132
- // QRUtil
3133
- //---------------------------------------------------------------------
3134
-
3135
- var QRUtil = function() {
3136
-
3137
- var PATTERN_POSITION_TABLE = [
3138
- [],
3139
- [6, 18],
3140
- [6, 22],
3141
- [6, 26],
3142
- [6, 30],
3143
- [6, 34],
3144
- [6, 22, 38],
3145
- [6, 24, 42],
3146
- [6, 26, 46],
3147
- [6, 28, 50],
3148
- [6, 30, 54],
3149
- [6, 32, 58],
3150
- [6, 34, 62],
3151
- [6, 26, 46, 66],
3152
- [6, 26, 48, 70],
3153
- [6, 26, 50, 74],
3154
- [6, 30, 54, 78],
3155
- [6, 30, 56, 82],
3156
- [6, 30, 58, 86],
3157
- [6, 34, 62, 90],
3158
- [6, 28, 50, 72, 94],
3159
- [6, 26, 50, 74, 98],
3160
- [6, 30, 54, 78, 102],
3161
- [6, 28, 54, 80, 106],
3162
- [6, 32, 58, 84, 110],
3163
- [6, 30, 58, 86, 114],
3164
- [6, 34, 62, 90, 118],
3165
- [6, 26, 50, 74, 98, 122],
3166
- [6, 30, 54, 78, 102, 126],
3167
- [6, 26, 52, 78, 104, 130],
3168
- [6, 30, 56, 82, 108, 134],
3169
- [6, 34, 60, 86, 112, 138],
3170
- [6, 30, 58, 86, 114, 142],
3171
- [6, 34, 62, 90, 118, 146],
3172
- [6, 30, 54, 78, 102, 126, 150],
3173
- [6, 24, 50, 76, 102, 128, 154],
3174
- [6, 28, 54, 80, 106, 132, 158],
3175
- [6, 32, 58, 84, 110, 136, 162],
3176
- [6, 26, 54, 82, 110, 138, 166],
3177
- [6, 30, 58, 86, 114, 142, 170]
3178
- ];
3179
- var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0);
3180
- var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0);
3181
- var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1);
3182
-
3183
- var _this = {};
3184
-
3185
- var getBCHDigit = function(data) {
3186
- var digit = 0;
3187
- while (data != 0) {
3188
- digit += 1;
3189
- data >>>= 1;
3190
- }
3191
- return digit;
3192
- };
3193
-
3194
- _this.getBCHTypeInfo = function(data) {
3195
- var d = data << 10;
3196
- while (getBCHDigit(d) - getBCHDigit(G15) >= 0) {
3197
- d ^= (G15 << (getBCHDigit(d) - getBCHDigit(G15) ) );
3198
- }
3199
- return ( (data << 10) | d) ^ G15_MASK;
3200
- };
3201
-
3202
- _this.getBCHTypeNumber = function(data) {
3203
- var d = data << 12;
3204
- while (getBCHDigit(d) - getBCHDigit(G18) >= 0) {
3205
- d ^= (G18 << (getBCHDigit(d) - getBCHDigit(G18) ) );
3206
- }
3207
- return (data << 12) | d;
3208
- };
3209
-
3210
- _this.getPatternPosition = function(typeNumber) {
3211
- return PATTERN_POSITION_TABLE[typeNumber - 1];
3212
- };
3213
-
3214
- _this.getMaskFunction = function(maskPattern) {
3215
-
3216
- switch (maskPattern) {
3217
-
3218
- case QRMaskPattern.PATTERN000 :
3219
- return function(i, j) { return (i + j) % 2 == 0; };
3220
- case QRMaskPattern.PATTERN001 :
3221
- return function(i, j) { return i % 2 == 0; };
3222
- case QRMaskPattern.PATTERN010 :
3223
- return function(i, j) { return j % 3 == 0; };
3224
- case QRMaskPattern.PATTERN011 :
3225
- return function(i, j) { return (i + j) % 3 == 0; };
3226
- case QRMaskPattern.PATTERN100 :
3227
- return function(i, j) { return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0; };
3228
- case QRMaskPattern.PATTERN101 :
3229
- return function(i, j) { return (i * j) % 2 + (i * j) % 3 == 0; };
3230
- case QRMaskPattern.PATTERN110 :
3231
- return function(i, j) { return ( (i * j) % 2 + (i * j) % 3) % 2 == 0; };
3232
- case QRMaskPattern.PATTERN111 :
3233
- return function(i, j) { return ( (i * j) % 3 + (i + j) % 2) % 2 == 0; };
3234
-
3235
- default :
3236
- throw 'bad maskPattern:' + maskPattern;
3237
- }
3238
- };
3239
-
3240
- _this.getErrorCorrectPolynomial = function(errorCorrectLength) {
3241
- var a = qrPolynomial([1], 0);
3242
- for (var i = 0; i < errorCorrectLength; i += 1) {
3243
- a = a.multiply(qrPolynomial([1, QRMath.gexp(i)], 0) );
3244
- }
3245
- return a;
3246
- };
3247
-
3248
- _this.getLengthInBits = function(mode, type) {
3249
-
3250
- if (1 <= type && type < 10) {
3251
-
3252
- // 1 - 9
3253
-
3254
- switch(mode) {
3255
- case QRMode.MODE_NUMBER : return 10;
3256
- case QRMode.MODE_ALPHA_NUM : return 9;
3257
- case QRMode.MODE_8BIT_BYTE : return 8;
3258
- case QRMode.MODE_KANJI : return 8;
3259
- default :
3260
- throw 'mode:' + mode;
3261
- }
3262
-
3263
- } else if (type < 27) {
3264
-
3265
- // 10 - 26
3266
-
3267
- switch(mode) {
3268
- case QRMode.MODE_NUMBER : return 12;
3269
- case QRMode.MODE_ALPHA_NUM : return 11;
3270
- case QRMode.MODE_8BIT_BYTE : return 16;
3271
- case QRMode.MODE_KANJI : return 10;
3272
- default :
3273
- throw 'mode:' + mode;
3274
- }
3275
-
3276
- } else if (type < 41) {
3277
-
3278
- // 27 - 40
3279
-
3280
- switch(mode) {
3281
- case QRMode.MODE_NUMBER : return 14;
3282
- case QRMode.MODE_ALPHA_NUM : return 13;
3283
- case QRMode.MODE_8BIT_BYTE : return 16;
3284
- case QRMode.MODE_KANJI : return 12;
3285
- default :
3286
- throw 'mode:' + mode;
3287
- }
3288
-
3289
- } else {
3290
- throw 'type:' + type;
3291
- }
3292
- };
3293
-
3294
- _this.getLostPoint = function(qrcode) {
3295
-
3296
- var moduleCount = qrcode.getModuleCount();
3297
-
3298
- var lostPoint = 0;
3299
-
3300
- // LEVEL1
3301
-
3302
- for (var row = 0; row < moduleCount; row += 1) {
3303
- for (var col = 0; col < moduleCount; col += 1) {
3304
-
3305
- var sameCount = 0;
3306
- var dark = qrcode.isDark(row, col);
3307
-
3308
- for (var r = -1; r <= 1; r += 1) {
3309
-
3310
- if (row + r < 0 || moduleCount <= row + r) {
3311
- continue;
3312
- }
3313
-
3314
- for (var c = -1; c <= 1; c += 1) {
3315
-
3316
- if (col + c < 0 || moduleCount <= col + c) {
3317
- continue;
3318
- }
3319
-
3320
- if (r == 0 && c == 0) {
3321
- continue;
3322
- }
3323
-
3324
- if (dark == qrcode.isDark(row + r, col + c) ) {
3325
- sameCount += 1;
3326
- }
3327
- }
3328
- }
3329
-
3330
- if (sameCount > 5) {
3331
- lostPoint += (3 + sameCount - 5);
3332
- }
3333
- }
3334
- }
3335
- // LEVEL2
3336
-
3337
- for (var row = 0; row < moduleCount - 1; row += 1) {
3338
- for (var col = 0; col < moduleCount - 1; col += 1) {
3339
- var count = 0;
3340
- if (qrcode.isDark(row, col) ) count += 1;
3341
- if (qrcode.isDark(row + 1, col) ) count += 1;
3342
- if (qrcode.isDark(row, col + 1) ) count += 1;
3343
- if (qrcode.isDark(row + 1, col + 1) ) count += 1;
3344
- if (count == 0 || count == 4) {
3345
- lostPoint += 3;
3346
- }
3347
- }
3348
- }
3349
-
3350
- // LEVEL3
3351
-
3352
- for (var row = 0; row < moduleCount; row += 1) {
3353
- for (var col = 0; col < moduleCount - 6; col += 1) {
3354
- if (qrcode.isDark(row, col)
3355
- && !qrcode.isDark(row, col + 1)
3356
- && qrcode.isDark(row, col + 2)
3357
- && qrcode.isDark(row, col + 3)
3358
- && qrcode.isDark(row, col + 4)
3359
- && !qrcode.isDark(row, col + 5)
3360
- && qrcode.isDark(row, col + 6) ) {
3361
- lostPoint += 40;
3362
- }
3363
- }
3364
- }
3365
-
3366
- for (var col = 0; col < moduleCount; col += 1) {
3367
- for (var row = 0; row < moduleCount - 6; row += 1) {
3368
- if (qrcode.isDark(row, col)
3369
- && !qrcode.isDark(row + 1, col)
3370
- && qrcode.isDark(row + 2, col)
3371
- && qrcode.isDark(row + 3, col)
3372
- && qrcode.isDark(row + 4, col)
3373
- && !qrcode.isDark(row + 5, col)
3374
- && qrcode.isDark(row + 6, col) ) {
3375
- lostPoint += 40;
3376
- }
3377
- }
3378
- }
3379
-
3380
- // LEVEL4
3381
-
3382
- var darkCount = 0;
3383
-
3384
- for (var col = 0; col < moduleCount; col += 1) {
3385
- for (var row = 0; row < moduleCount; row += 1) {
3386
- if (qrcode.isDark(row, col) ) {
3387
- darkCount += 1;
3388
- }
3389
- }
3390
- }
3391
-
3392
- var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
3393
- lostPoint += ratio * 10;
3394
-
3395
- return lostPoint;
3396
- };
3397
-
3398
- return _this;
3399
- }();
3400
-
3401
- //---------------------------------------------------------------------
3402
- // QRMath
3403
- //---------------------------------------------------------------------
3404
-
3405
- var QRMath = function() {
3406
-
3407
- var EXP_TABLE = new Array(256);
3408
- var LOG_TABLE = new Array(256);
3409
-
3410
- // initialize tables
3411
- for (var i = 0; i < 8; i += 1) {
3412
- EXP_TABLE[i] = 1 << i;
3413
- }
3414
- for (var i = 8; i < 256; i += 1) {
3415
- EXP_TABLE[i] = EXP_TABLE[i - 4]
3416
- ^ EXP_TABLE[i - 5]
3417
- ^ EXP_TABLE[i - 6]
3418
- ^ EXP_TABLE[i - 8];
3419
- }
3420
- for (var i = 0; i < 255; i += 1) {
3421
- LOG_TABLE[EXP_TABLE[i] ] = i;
3422
- }
3423
-
3424
- var _this = {};
3425
-
3426
- _this.glog = function(n) {
3427
-
3428
- if (n < 1) {
3429
- throw 'glog(' + n + ')';
3430
- }
3431
-
3432
- return LOG_TABLE[n];
3433
- };
3434
-
3435
- _this.gexp = function(n) {
3436
-
3437
- while (n < 0) {
3438
- n += 255;
3439
- }
3440
-
3441
- while (n >= 256) {
3442
- n -= 255;
3443
- }
3444
-
3445
- return EXP_TABLE[n];
3446
- };
3447
-
3448
- return _this;
3449
- }();
3450
-
3451
- //---------------------------------------------------------------------
3452
- // qrPolynomial
3453
- //---------------------------------------------------------------------
3454
-
3455
- function qrPolynomial(num, shift) {
3456
-
3457
- if (typeof num.length == 'undefined') {
3458
- throw num.length + '/' + shift;
3459
- }
3460
-
3461
- var _num = function() {
3462
- var offset = 0;
3463
- while (offset < num.length && num[offset] == 0) {
3464
- offset += 1;
3465
- }
3466
- var _num = new Array(num.length - offset + shift);
3467
- for (var i = 0; i < num.length - offset; i += 1) {
3468
- _num[i] = num[i + offset];
3469
- }
3470
- return _num;
3471
- }();
3472
-
3473
- var _this = {};
3474
-
3475
- _this.getAt = function(index) {
3476
- return _num[index];
3477
- };
3478
-
3479
- _this.getLength = function() {
3480
- return _num.length;
3481
- };
3482
-
3483
- _this.multiply = function(e) {
3484
-
3485
- var num = new Array(_this.getLength() + e.getLength() - 1);
3486
-
3487
- for (var i = 0; i < _this.getLength(); i += 1) {
3488
- for (var j = 0; j < e.getLength(); j += 1) {
3489
- num[i + j] ^= QRMath.gexp(QRMath.glog(_this.getAt(i) ) + QRMath.glog(e.getAt(j) ) );
3490
- }
3491
- }
3492
-
3493
- return qrPolynomial(num, 0);
3494
- };
3495
-
3496
- _this.mod = function(e) {
3497
-
3498
- if (_this.getLength() - e.getLength() < 0) {
3499
- return _this;
3500
- }
3501
-
3502
- var ratio = QRMath.glog(_this.getAt(0) ) - QRMath.glog(e.getAt(0) );
3503
-
3504
- var num = new Array(_this.getLength() );
3505
- for (var i = 0; i < _this.getLength(); i += 1) {
3506
- num[i] = _this.getAt(i);
3507
- }
3508
-
3509
- for (var i = 0; i < e.getLength(); i += 1) {
3510
- num[i] ^= QRMath.gexp(QRMath.glog(e.getAt(i) ) + ratio);
3511
- }
3512
-
3513
- // recursive call
3514
- return qrPolynomial(num, 0).mod(e);
3515
- };
3516
-
3517
- return _this;
3518
- }
3519
- //---------------------------------------------------------------------
3520
- // QRRSBlock
3521
- //---------------------------------------------------------------------
3522
-
3523
- var QRRSBlock = function() {
3524
-
3525
- var RS_BLOCK_TABLE = [
3526
-
3527
- // L
3528
- // M
3529
- // Q
3530
- // H
3531
-
3532
- // 1
3533
- [1, 26, 19],
3534
- [1, 26, 16],
3535
- [1, 26, 13],
3536
- [1, 26, 9],
3537
-
3538
- // 2
3539
- [1, 44, 34],
3540
- [1, 44, 28],
3541
- [1, 44, 22],
3542
- [1, 44, 16],
3543
-
3544
- // 3
3545
- [1, 70, 55],
3546
- [1, 70, 44],
3547
- [2, 35, 17],
3548
- [2, 35, 13],
3549
-
3550
- // 4
3551
- [1, 100, 80],
3552
- [2, 50, 32],
3553
- [2, 50, 24],
3554
- [4, 25, 9],
3555
-
3556
- // 5
3557
- [1, 134, 108],
3558
- [2, 67, 43],
3559
- [2, 33, 15, 2, 34, 16],
3560
- [2, 33, 11, 2, 34, 12],
3561
-
3562
- // 6
3563
- [2, 86, 68],
3564
- [4, 43, 27],
3565
- [4, 43, 19],
3566
- [4, 43, 15],
3567
-
3568
- // 7
3569
- [2, 98, 78],
3570
- [4, 49, 31],
3571
- [2, 32, 14, 4, 33, 15],
3572
- [4, 39, 13, 1, 40, 14],
3573
-
3574
- // 8
3575
- [2, 121, 97],
3576
- [2, 60, 38, 2, 61, 39],
3577
- [4, 40, 18, 2, 41, 19],
3578
- [4, 40, 14, 2, 41, 15],
3579
-
3580
- // 9
3581
- [2, 146, 116],
3582
- [3, 58, 36, 2, 59, 37],
3583
- [4, 36, 16, 4, 37, 17],
3584
- [4, 36, 12, 4, 37, 13],
3585
-
3586
- // 10
3587
- [2, 86, 68, 2, 87, 69],
3588
- [4, 69, 43, 1, 70, 44],
3589
- [6, 43, 19, 2, 44, 20],
3590
- [6, 43, 15, 2, 44, 16],
3591
-
3592
- // 11
3593
- [4, 101, 81],
3594
- [1, 80, 50, 4, 81, 51],
3595
- [4, 50, 22, 4, 51, 23],
3596
- [3, 36, 12, 8, 37, 13],
3597
-
3598
- // 12
3599
- [2, 116, 92, 2, 117, 93],
3600
- [6, 58, 36, 2, 59, 37],
3601
- [4, 46, 20, 6, 47, 21],
3602
- [7, 42, 14, 4, 43, 15],
3603
-
3604
- // 13
3605
- [4, 133, 107],
3606
- [8, 59, 37, 1, 60, 38],
3607
- [8, 44, 20, 4, 45, 21],
3608
- [12, 33, 11, 4, 34, 12],
3609
-
3610
- // 14
3611
- [3, 145, 115, 1, 146, 116],
3612
- [4, 64, 40, 5, 65, 41],
3613
- [11, 36, 16, 5, 37, 17],
3614
- [11, 36, 12, 5, 37, 13],
3615
-
3616
- // 15
3617
- [5, 109, 87, 1, 110, 88],
3618
- [5, 65, 41, 5, 66, 42],
3619
- [5, 54, 24, 7, 55, 25],
3620
- [11, 36, 12, 7, 37, 13],
3621
-
3622
- // 16
3623
- [5, 122, 98, 1, 123, 99],
3624
- [7, 73, 45, 3, 74, 46],
3625
- [15, 43, 19, 2, 44, 20],
3626
- [3, 45, 15, 13, 46, 16],
3627
-
3628
- // 17
3629
- [1, 135, 107, 5, 136, 108],
3630
- [10, 74, 46, 1, 75, 47],
3631
- [1, 50, 22, 15, 51, 23],
3632
- [2, 42, 14, 17, 43, 15],
3633
-
3634
- // 18
3635
- [5, 150, 120, 1, 151, 121],
3636
- [9, 69, 43, 4, 70, 44],
3637
- [17, 50, 22, 1, 51, 23],
3638
- [2, 42, 14, 19, 43, 15],
3639
-
3640
- // 19
3641
- [3, 141, 113, 4, 142, 114],
3642
- [3, 70, 44, 11, 71, 45],
3643
- [17, 47, 21, 4, 48, 22],
3644
- [9, 39, 13, 16, 40, 14],
3645
-
3646
- // 20
3647
- [3, 135, 107, 5, 136, 108],
3648
- [3, 67, 41, 13, 68, 42],
3649
- [15, 54, 24, 5, 55, 25],
3650
- [15, 43, 15, 10, 44, 16],
3651
-
3652
- // 21
3653
- [4, 144, 116, 4, 145, 117],
3654
- [17, 68, 42],
3655
- [17, 50, 22, 6, 51, 23],
3656
- [19, 46, 16, 6, 47, 17],
3657
-
3658
- // 22
3659
- [2, 139, 111, 7, 140, 112],
3660
- [17, 74, 46],
3661
- [7, 54, 24, 16, 55, 25],
3662
- [34, 37, 13],
3663
-
3664
- // 23
3665
- [4, 151, 121, 5, 152, 122],
3666
- [4, 75, 47, 14, 76, 48],
3667
- [11, 54, 24, 14, 55, 25],
3668
- [16, 45, 15, 14, 46, 16],
3669
-
3670
- // 24
3671
- [6, 147, 117, 4, 148, 118],
3672
- [6, 73, 45, 14, 74, 46],
3673
- [11, 54, 24, 16, 55, 25],
3674
- [30, 46, 16, 2, 47, 17],
3675
-
3676
- // 25
3677
- [8, 132, 106, 4, 133, 107],
3678
- [8, 75, 47, 13, 76, 48],
3679
- [7, 54, 24, 22, 55, 25],
3680
- [22, 45, 15, 13, 46, 16],
3681
-
3682
- // 26
3683
- [10, 142, 114, 2, 143, 115],
3684
- [19, 74, 46, 4, 75, 47],
3685
- [28, 50, 22, 6, 51, 23],
3686
- [33, 46, 16, 4, 47, 17],
3687
-
3688
- // 27
3689
- [8, 152, 122, 4, 153, 123],
3690
- [22, 73, 45, 3, 74, 46],
3691
- [8, 53, 23, 26, 54, 24],
3692
- [12, 45, 15, 28, 46, 16],
3693
-
3694
- // 28
3695
- [3, 147, 117, 10, 148, 118],
3696
- [3, 73, 45, 23, 74, 46],
3697
- [4, 54, 24, 31, 55, 25],
3698
- [11, 45, 15, 31, 46, 16],
3699
-
3700
- // 29
3701
- [7, 146, 116, 7, 147, 117],
3702
- [21, 73, 45, 7, 74, 46],
3703
- [1, 53, 23, 37, 54, 24],
3704
- [19, 45, 15, 26, 46, 16],
3705
-
3706
- // 30
3707
- [5, 145, 115, 10, 146, 116],
3708
- [19, 75, 47, 10, 76, 48],
3709
- [15, 54, 24, 25, 55, 25],
3710
- [23, 45, 15, 25, 46, 16],
3711
-
3712
- // 31
3713
- [13, 145, 115, 3, 146, 116],
3714
- [2, 74, 46, 29, 75, 47],
3715
- [42, 54, 24, 1, 55, 25],
3716
- [23, 45, 15, 28, 46, 16],
3717
-
3718
- // 32
3719
- [17, 145, 115],
3720
- [10, 74, 46, 23, 75, 47],
3721
- [10, 54, 24, 35, 55, 25],
3722
- [19, 45, 15, 35, 46, 16],
3723
-
3724
- // 33
3725
- [17, 145, 115, 1, 146, 116],
3726
- [14, 74, 46, 21, 75, 47],
3727
- [29, 54, 24, 19, 55, 25],
3728
- [11, 45, 15, 46, 46, 16],
3729
-
3730
- // 34
3731
- [13, 145, 115, 6, 146, 116],
3732
- [14, 74, 46, 23, 75, 47],
3733
- [44, 54, 24, 7, 55, 25],
3734
- [59, 46, 16, 1, 47, 17],
3735
-
3736
- // 35
3737
- [12, 151, 121, 7, 152, 122],
3738
- [12, 75, 47, 26, 76, 48],
3739
- [39, 54, 24, 14, 55, 25],
3740
- [22, 45, 15, 41, 46, 16],
3741
-
3742
- // 36
3743
- [6, 151, 121, 14, 152, 122],
3744
- [6, 75, 47, 34, 76, 48],
3745
- [46, 54, 24, 10, 55, 25],
3746
- [2, 45, 15, 64, 46, 16],
3747
-
3748
- // 37
3749
- [17, 152, 122, 4, 153, 123],
3750
- [29, 74, 46, 14, 75, 47],
3751
- [49, 54, 24, 10, 55, 25],
3752
- [24, 45, 15, 46, 46, 16],
3753
-
3754
- // 38
3755
- [4, 152, 122, 18, 153, 123],
3756
- [13, 74, 46, 32, 75, 47],
3757
- [48, 54, 24, 14, 55, 25],
3758
- [42, 45, 15, 32, 46, 16],
3759
-
3760
- // 39
3761
- [20, 147, 117, 4, 148, 118],
3762
- [40, 75, 47, 7, 76, 48],
3763
- [43, 54, 24, 22, 55, 25],
3764
- [10, 45, 15, 67, 46, 16],
3765
-
3766
- // 40
3767
- [19, 148, 118, 6, 149, 119],
3768
- [18, 75, 47, 31, 76, 48],
3769
- [34, 54, 24, 34, 55, 25],
3770
- [20, 45, 15, 61, 46, 16]
3771
- ];
3772
-
3773
- var qrRSBlock = function(totalCount, dataCount) {
3774
- var _this = {};
3775
- _this.totalCount = totalCount;
3776
- _this.dataCount = dataCount;
3777
- return _this;
3778
- };
3779
-
3780
- var _this = {};
3781
-
3782
- var getRsBlockTable = function(typeNumber, errorCorrectionLevel) {
3783
-
3784
- switch(errorCorrectionLevel) {
3785
- case QRErrorCorrectionLevel.L :
3786
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];
3787
- case QRErrorCorrectionLevel.M :
3788
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
3789
- case QRErrorCorrectionLevel.Q :
3790
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
3791
- case QRErrorCorrectionLevel.H :
3792
- return RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
3793
- default :
3794
- return undefined;
3795
- }
3796
- };
3797
-
3798
- _this.getRSBlocks = function(typeNumber, errorCorrectionLevel) {
3799
-
3800
- var rsBlock = getRsBlockTable(typeNumber, errorCorrectionLevel);
3801
-
3802
- if (typeof rsBlock == 'undefined') {
3803
- throw 'bad rs block @ typeNumber:' + typeNumber +
3804
- '/errorCorrectionLevel:' + errorCorrectionLevel;
3805
- }
3806
-
3807
- var length = rsBlock.length / 3;
3808
-
3809
- var list = [];
3810
-
3811
- for (var i = 0; i < length; i += 1) {
3812
-
3813
- var count = rsBlock[i * 3 + 0];
3814
- var totalCount = rsBlock[i * 3 + 1];
3815
- var dataCount = rsBlock[i * 3 + 2];
3816
-
3817
- for (var j = 0; j < count; j += 1) {
3818
- list.push(qrRSBlock(totalCount, dataCount) );
3819
- }
3820
- }
3821
-
3822
- return list;
3823
- };
3824
-
3825
- return _this;
3826
- }();
3827
-
3828
- //---------------------------------------------------------------------
3829
- // qrBitBuffer
3830
- //---------------------------------------------------------------------
3831
-
3832
- var qrBitBuffer = function() {
3833
-
3834
- var _buffer = [];
3835
- var _length = 0;
3836
-
3837
- var _this = {};
3838
-
3839
- _this.getBuffer = function() {
3840
- return _buffer;
3841
- };
3842
-
3843
- _this.getAt = function(index) {
3844
- var bufIndex = Math.floor(index / 8);
3845
- return ( (_buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;
3846
- };
3847
-
3848
- _this.put = function(num, length) {
3849
- for (var i = 0; i < length; i += 1) {
3850
- _this.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);
3851
- }
3852
- };
3853
-
3854
- _this.getLengthInBits = function() {
3855
- return _length;
3856
- };
3857
-
3858
- _this.putBit = function(bit) {
3859
-
3860
- var bufIndex = Math.floor(_length / 8);
3861
- if (_buffer.length <= bufIndex) {
3862
- _buffer.push(0);
3863
- }
3864
-
3865
- if (bit) {
3866
- _buffer[bufIndex] |= (0x80 >>> (_length % 8) );
3867
- }
3868
-
3869
- _length += 1;
3870
- };
3871
-
3872
- return _this;
3873
- };
3874
-
3875
- //---------------------------------------------------------------------
3876
- // qrNumber
3877
- //---------------------------------------------------------------------
3878
-
3879
- var qrNumber = function(data) {
3880
-
3881
- var _mode = QRMode.MODE_NUMBER;
3882
- var _data = data;
3883
-
3884
- var _this = {};
3885
-
3886
- _this.getMode = function() {
3887
- return _mode;
3888
- };
3889
-
3890
- _this.getLength = function(buffer) {
3891
- return _data.length;
3892
- };
3893
-
3894
- _this.write = function(buffer) {
3895
-
3896
- var data = _data;
3897
-
3898
- var i = 0;
3899
-
3900
- while (i + 2 < data.length) {
3901
- buffer.put(strToNum(data.substring(i, i + 3) ), 10);
3902
- i += 3;
3903
- }
3904
-
3905
- if (i < data.length) {
3906
- if (data.length - i == 1) {
3907
- buffer.put(strToNum(data.substring(i, i + 1) ), 4);
3908
- } else if (data.length - i == 2) {
3909
- buffer.put(strToNum(data.substring(i, i + 2) ), 7);
3910
- }
3911
- }
3912
- };
3913
-
3914
- var strToNum = function(s) {
3915
- var num = 0;
3916
- for (var i = 0; i < s.length; i += 1) {
3917
- num = num * 10 + chatToNum(s.charAt(i) );
3918
- }
3919
- return num;
3920
- };
3921
-
3922
- var chatToNum = function(c) {
3923
- if ('0' <= c && c <= '9') {
3924
- return c.charCodeAt(0) - '0'.charCodeAt(0);
3925
- }
3926
- throw 'illegal char :' + c;
3927
- };
3928
-
3929
- return _this;
3930
- };
3931
-
3932
- //---------------------------------------------------------------------
3933
- // qrAlphaNum
3934
- //---------------------------------------------------------------------
3935
-
3936
- var qrAlphaNum = function(data) {
3937
-
3938
- var _mode = QRMode.MODE_ALPHA_NUM;
3939
- var _data = data;
3940
-
3941
- var _this = {};
3942
-
3943
- _this.getMode = function() {
3944
- return _mode;
3945
- };
3946
-
3947
- _this.getLength = function(buffer) {
3948
- return _data.length;
3949
- };
3950
-
3951
- _this.write = function(buffer) {
3952
-
3953
- var s = _data;
3954
-
3955
- var i = 0;
3956
-
3957
- while (i + 1 < s.length) {
3958
- buffer.put(
3959
- getCode(s.charAt(i) ) * 45 +
3960
- getCode(s.charAt(i + 1) ), 11);
3961
- i += 2;
3962
- }
3963
-
3964
- if (i < s.length) {
3965
- buffer.put(getCode(s.charAt(i) ), 6);
3966
- }
3967
- };
3968
-
3969
- var getCode = function(c) {
3970
-
3971
- if ('0' <= c && c <= '9') {
3972
- return c.charCodeAt(0) - '0'.charCodeAt(0);
3973
- } else if ('A' <= c && c <= 'Z') {
3974
- return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10;
3975
- } else {
3976
- switch (c) {
3977
- case ' ' : return 36;
3978
- case '$' : return 37;
3979
- case '%' : return 38;
3980
- case '*' : return 39;
3981
- case '+' : return 40;
3982
- case '-' : return 41;
3983
- case '.' : return 42;
3984
- case '/' : return 43;
3985
- case ':' : return 44;
3986
- default :
3987
- throw 'illegal char :' + c;
3988
- }
3989
- }
3990
- };
3991
-
3992
- return _this;
3993
- };
3994
-
3995
- //---------------------------------------------------------------------
3996
- // qr8BitByte
3997
- //---------------------------------------------------------------------
3998
-
3999
- var qr8BitByte = function(data) {
4000
-
4001
- var _mode = QRMode.MODE_8BIT_BYTE;
4002
- var _bytes = qrcode.stringToBytes(data);
4003
-
4004
- var _this = {};
4005
-
4006
- _this.getMode = function() {
4007
- return _mode;
4008
- };
4009
-
4010
- _this.getLength = function(buffer) {
4011
- return _bytes.length;
4012
- };
4013
-
4014
- _this.write = function(buffer) {
4015
- for (var i = 0; i < _bytes.length; i += 1) {
4016
- buffer.put(_bytes[i], 8);
4017
- }
4018
- };
4019
-
4020
- return _this;
4021
- };
4022
-
4023
- //---------------------------------------------------------------------
4024
- // qrKanji
4025
- //---------------------------------------------------------------------
4026
-
4027
- var qrKanji = function(data) {
4028
-
4029
- var _mode = QRMode.MODE_KANJI;
4030
-
4031
- var stringToBytes = qrcode.stringToBytesFuncs['SJIS'];
4032
- if (!stringToBytes) {
4033
- throw 'sjis not supported.';
4034
- }
4035
- !function(c, code) {
4036
- // self test for sjis support.
4037
- var test = stringToBytes(c);
4038
- if (test.length != 2 || ( (test[0] << 8) | test[1]) != code) {
4039
- throw 'sjis not supported.';
4040
- }
4041
- }('\u53cb', 0x9746);
4042
-
4043
- var _bytes = stringToBytes(data);
4044
-
4045
- var _this = {};
4046
-
4047
- _this.getMode = function() {
4048
- return _mode;
4049
- };
4050
-
4051
- _this.getLength = function(buffer) {
4052
- return ~~(_bytes.length / 2);
4053
- };
4054
-
4055
- _this.write = function(buffer) {
4056
-
4057
- var data = _bytes;
4058
-
4059
- var i = 0;
4060
-
4061
- while (i + 1 < data.length) {
4062
-
4063
- var c = ( (0xff & data[i]) << 8) | (0xff & data[i + 1]);
4064
-
4065
- if (0x8140 <= c && c <= 0x9FFC) {
4066
- c -= 0x8140;
4067
- } else if (0xE040 <= c && c <= 0xEBBF) {
4068
- c -= 0xC140;
4069
- } else {
4070
- throw 'illegal char at ' + (i + 1) + '/' + c;
4071
- }
4072
-
4073
- c = ( (c >>> 8) & 0xff) * 0xC0 + (c & 0xff);
4074
-
4075
- buffer.put(c, 13);
4076
-
4077
- i += 2;
4078
- }
4079
-
4080
- if (i < data.length) {
4081
- throw 'illegal char at ' + (i + 1);
4082
- }
4083
- };
4084
-
4085
- return _this;
4086
- };
4087
-
4088
- //=====================================================================
4089
- // GIF Support etc.
4090
- //
4091
-
4092
- //---------------------------------------------------------------------
4093
- // byteArrayOutputStream
4094
- //---------------------------------------------------------------------
4095
-
4096
- var byteArrayOutputStream = function() {
4097
-
4098
- var _bytes = [];
4099
-
4100
- var _this = {};
4101
-
4102
- _this.writeByte = function(b) {
4103
- _bytes.push(b & 0xff);
4104
- };
4105
-
4106
- _this.writeShort = function(i) {
4107
- _this.writeByte(i);
4108
- _this.writeByte(i >>> 8);
4109
- };
4110
-
4111
- _this.writeBytes = function(b, off, len) {
4112
- off = off || 0;
4113
- len = len || b.length;
4114
- for (var i = 0; i < len; i += 1) {
4115
- _this.writeByte(b[i + off]);
4116
- }
4117
- };
4118
-
4119
- _this.writeString = function(s) {
4120
- for (var i = 0; i < s.length; i += 1) {
4121
- _this.writeByte(s.charCodeAt(i) );
4122
- }
4123
- };
4124
-
4125
- _this.toByteArray = function() {
4126
- return _bytes;
4127
- };
4128
-
4129
- _this.toString = function() {
4130
- var s = '';
4131
- s += '[';
4132
- for (var i = 0; i < _bytes.length; i += 1) {
4133
- if (i > 0) {
4134
- s += ',';
4135
- }
4136
- s += _bytes[i];
4137
- }
4138
- s += ']';
4139
- return s;
4140
- };
4141
-
4142
- return _this;
4143
- };
4144
-
4145
- //---------------------------------------------------------------------
4146
- // base64EncodeOutputStream
4147
- //---------------------------------------------------------------------
4148
-
4149
- var base64EncodeOutputStream = function() {
4150
-
4151
- var _buffer = 0;
4152
- var _buflen = 0;
4153
- var _length = 0;
4154
- var _base64 = '';
4155
-
4156
- var _this = {};
4157
-
4158
- var writeEncoded = function(b) {
4159
- _base64 += String.fromCharCode(encode(b & 0x3f) );
4160
- };
4161
-
4162
- var encode = function(n) {
4163
- if (n < 0) ; else if (n < 26) {
4164
- return 0x41 + n;
4165
- } else if (n < 52) {
4166
- return 0x61 + (n - 26);
4167
- } else if (n < 62) {
4168
- return 0x30 + (n - 52);
4169
- } else if (n == 62) {
4170
- return 0x2b;
4171
- } else if (n == 63) {
4172
- return 0x2f;
4173
- }
4174
- throw 'n:' + n;
4175
- };
4176
-
4177
- _this.writeByte = function(n) {
4178
-
4179
- _buffer = (_buffer << 8) | (n & 0xff);
4180
- _buflen += 8;
4181
- _length += 1;
4182
-
4183
- while (_buflen >= 6) {
4184
- writeEncoded(_buffer >>> (_buflen - 6) );
4185
- _buflen -= 6;
4186
- }
4187
- };
4188
-
4189
- _this.flush = function() {
4190
-
4191
- if (_buflen > 0) {
4192
- writeEncoded(_buffer << (6 - _buflen) );
4193
- _buffer = 0;
4194
- _buflen = 0;
4195
- }
4196
-
4197
- if (_length % 3 != 0) {
4198
- // padding
4199
- var padlen = 3 - _length % 3;
4200
- for (var i = 0; i < padlen; i += 1) {
4201
- _base64 += '=';
4202
- }
4203
- }
4204
- };
4205
-
4206
- _this.toString = function() {
4207
- return _base64;
4208
- };
4209
-
4210
- return _this;
4211
- };
4212
-
4213
- //---------------------------------------------------------------------
4214
- // base64DecodeInputStream
4215
- //---------------------------------------------------------------------
4216
-
4217
- var base64DecodeInputStream = function(str) {
4218
-
4219
- var _str = str;
4220
- var _pos = 0;
4221
- var _buffer = 0;
4222
- var _buflen = 0;
4223
-
4224
- var _this = {};
4225
-
4226
- _this.read = function() {
4227
-
4228
- while (_buflen < 8) {
4229
-
4230
- if (_pos >= _str.length) {
4231
- if (_buflen == 0) {
4232
- return -1;
4233
- }
4234
- throw 'unexpected end of file./' + _buflen;
4235
- }
4236
-
4237
- var c = _str.charAt(_pos);
4238
- _pos += 1;
4239
-
4240
- if (c == '=') {
4241
- _buflen = 0;
4242
- return -1;
4243
- } else if (c.match(/^\s$/) ) {
4244
- // ignore if whitespace.
4245
- continue;
4246
- }
4247
-
4248
- _buffer = (_buffer << 6) | decode(c.charCodeAt(0) );
4249
- _buflen += 6;
4250
- }
4251
-
4252
- var n = (_buffer >>> (_buflen - 8) ) & 0xff;
4253
- _buflen -= 8;
4254
- return n;
4255
- };
4256
-
4257
- var decode = function(c) {
4258
- if (0x41 <= c && c <= 0x5a) {
4259
- return c - 0x41;
4260
- } else if (0x61 <= c && c <= 0x7a) {
4261
- return c - 0x61 + 26;
4262
- } else if (0x30 <= c && c <= 0x39) {
4263
- return c - 0x30 + 52;
4264
- } else if (c == 0x2b) {
4265
- return 62;
4266
- } else if (c == 0x2f) {
4267
- return 63;
4268
- } else {
4269
- throw 'c:' + c;
4270
- }
4271
- };
4272
-
4273
- return _this;
4274
- };
4275
-
4276
- //---------------------------------------------------------------------
4277
- // gifImage (B/W)
4278
- //---------------------------------------------------------------------
4279
-
4280
- var gifImage = function(width, height) {
4281
-
4282
- var _width = width;
4283
- var _height = height;
4284
- var _data = new Array(width * height);
4285
-
4286
- var _this = {};
4287
-
4288
- _this.setPixel = function(x, y, pixel) {
4289
- _data[y * _width + x] = pixel;
4290
- };
4291
-
4292
- _this.write = function(out) {
4293
-
4294
- //---------------------------------
4295
- // GIF Signature
4296
-
4297
- out.writeString('GIF87a');
4298
-
4299
- //---------------------------------
4300
- // Screen Descriptor
4301
-
4302
- out.writeShort(_width);
4303
- out.writeShort(_height);
4304
-
4305
- out.writeByte(0x80); // 2bit
4306
- out.writeByte(0);
4307
- out.writeByte(0);
4308
-
4309
- //---------------------------------
4310
- // Global Color Map
4311
-
4312
- // black
4313
- out.writeByte(0x00);
4314
- out.writeByte(0x00);
4315
- out.writeByte(0x00);
4316
-
4317
- // white
4318
- out.writeByte(0xff);
4319
- out.writeByte(0xff);
4320
- out.writeByte(0xff);
4321
-
4322
- //---------------------------------
4323
- // Image Descriptor
4324
-
4325
- out.writeString(',');
4326
- out.writeShort(0);
4327
- out.writeShort(0);
4328
- out.writeShort(_width);
4329
- out.writeShort(_height);
4330
- out.writeByte(0);
4331
-
4332
- //---------------------------------
4333
- // Local Color Map
4334
-
4335
- //---------------------------------
4336
- // Raster Data
4337
-
4338
- var lzwMinCodeSize = 2;
4339
- var raster = getLZWRaster(lzwMinCodeSize);
4340
-
4341
- out.writeByte(lzwMinCodeSize);
4342
-
4343
- var offset = 0;
4344
-
4345
- while (raster.length - offset > 255) {
4346
- out.writeByte(255);
4347
- out.writeBytes(raster, offset, 255);
4348
- offset += 255;
4349
- }
4350
-
4351
- out.writeByte(raster.length - offset);
4352
- out.writeBytes(raster, offset, raster.length - offset);
4353
- out.writeByte(0x00);
4354
-
4355
- //---------------------------------
4356
- // GIF Terminator
4357
- out.writeString(';');
4358
- };
4359
-
4360
- var bitOutputStream = function(out) {
4361
-
4362
- var _out = out;
4363
- var _bitLength = 0;
4364
- var _bitBuffer = 0;
4365
-
4366
- var _this = {};
4367
-
4368
- _this.write = function(data, length) {
4369
-
4370
- if ( (data >>> length) != 0) {
4371
- throw 'length over';
4372
- }
4373
-
4374
- while (_bitLength + length >= 8) {
4375
- _out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) );
4376
- length -= (8 - _bitLength);
4377
- data >>>= (8 - _bitLength);
4378
- _bitBuffer = 0;
4379
- _bitLength = 0;
4380
- }
4381
-
4382
- _bitBuffer = (data << _bitLength) | _bitBuffer;
4383
- _bitLength = _bitLength + length;
4384
- };
4385
-
4386
- _this.flush = function() {
4387
- if (_bitLength > 0) {
4388
- _out.writeByte(_bitBuffer);
4389
- }
4390
- };
4391
-
4392
- return _this;
4393
- };
4394
-
4395
- var getLZWRaster = function(lzwMinCodeSize) {
4396
-
4397
- var clearCode = 1 << lzwMinCodeSize;
4398
- var endCode = (1 << lzwMinCodeSize) + 1;
4399
- var bitLength = lzwMinCodeSize + 1;
4400
-
4401
- // Setup LZWTable
4402
- var table = lzwTable();
4403
-
4404
- for (var i = 0; i < clearCode; i += 1) {
4405
- table.add(String.fromCharCode(i) );
4406
- }
4407
- table.add(String.fromCharCode(clearCode) );
4408
- table.add(String.fromCharCode(endCode) );
4409
-
4410
- var byteOut = byteArrayOutputStream();
4411
- var bitOut = bitOutputStream(byteOut);
4412
-
4413
- // clear code
4414
- bitOut.write(clearCode, bitLength);
4415
-
4416
- var dataIndex = 0;
4417
-
4418
- var s = String.fromCharCode(_data[dataIndex]);
4419
- dataIndex += 1;
4420
-
4421
- while (dataIndex < _data.length) {
4422
-
4423
- var c = String.fromCharCode(_data[dataIndex]);
4424
- dataIndex += 1;
4425
-
4426
- if (table.contains(s + c) ) {
4427
-
4428
- s = s + c;
4429
-
4430
- } else {
4431
-
4432
- bitOut.write(table.indexOf(s), bitLength);
4433
-
4434
- if (table.size() < 0xfff) {
4435
-
4436
- if (table.size() == (1 << bitLength) ) {
4437
- bitLength += 1;
4438
- }
4439
-
4440
- table.add(s + c);
4441
- }
4442
-
4443
- s = c;
4444
- }
4445
- }
4446
-
4447
- bitOut.write(table.indexOf(s), bitLength);
4448
-
4449
- // end code
4450
- bitOut.write(endCode, bitLength);
4451
-
4452
- bitOut.flush();
4453
-
4454
- return byteOut.toByteArray();
4455
- };
4456
-
4457
- var lzwTable = function() {
4458
-
4459
- var _map = {};
4460
- var _size = 0;
4461
-
4462
- var _this = {};
4463
-
4464
- _this.add = function(key) {
4465
- if (_this.contains(key) ) {
4466
- throw 'dup key:' + key;
4467
- }
4468
- _map[key] = _size;
4469
- _size += 1;
4470
- };
4471
-
4472
- _this.size = function() {
4473
- return _size;
4474
- };
4475
-
4476
- _this.indexOf = function(key) {
4477
- return _map[key];
4478
- };
4479
-
4480
- _this.contains = function(key) {
4481
- return typeof _map[key] != 'undefined';
4482
- };
4483
-
4484
- return _this;
4485
- };
4486
-
4487
- return _this;
4488
- };
4489
-
4490
- var createDataURL = function(width, height, getPixel) {
4491
- var gif = gifImage(width, height);
4492
- for (var y = 0; y < height; y += 1) {
4493
- for (var x = 0; x < width; x += 1) {
4494
- gif.setPixel(x, y, getPixel(x, y) );
4495
- }
4496
- }
4497
-
4498
- var b = byteArrayOutputStream();
4499
- gif.write(b);
4500
-
4501
- var base64 = base64EncodeOutputStream();
4502
- var bytes = b.toByteArray();
4503
- for (var i = 0; i < bytes.length; i += 1) {
4504
- base64.writeByte(bytes[i]);
4505
- }
4506
- base64.flush();
4507
-
4508
- return 'data:image/gif;base64,' + base64;
4509
- };
4510
-
4511
- //---------------------------------------------------------------------
4512
- // returns qrcode function.
4513
-
4514
- return qrcode;
4515
- }();
4516
-
4517
- // multibyte support
4518
- !function() {
4519
-
4520
- qrcode.stringToBytesFuncs['UTF-8'] = function(s) {
4521
- // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array
4522
- function toUTF8Array(str) {
4523
- var utf8 = [];
4524
- for (var i=0; i < str.length; i++) {
4525
- var charcode = str.charCodeAt(i);
4526
- if (charcode < 0x80) utf8.push(charcode);
4527
- else if (charcode < 0x800) {
4528
- utf8.push(0xc0 | (charcode >> 6),
4529
- 0x80 | (charcode & 0x3f));
4530
- }
4531
- else if (charcode < 0xd800 || charcode >= 0xe000) {
4532
- utf8.push(0xe0 | (charcode >> 12),
4533
- 0x80 | ((charcode>>6) & 0x3f),
4534
- 0x80 | (charcode & 0x3f));
4535
- }
4536
- // surrogate pair
4537
- else {
4538
- i++;
4539
- // UTF-16 encodes 0x10000-0x10FFFF by
4540
- // subtracting 0x10000 and splitting the
4541
- // 20 bits of 0x0-0xFFFFF into two halves
4542
- charcode = 0x10000 + (((charcode & 0x3ff)<<10)
4543
- | (str.charCodeAt(i) & 0x3ff));
4544
- utf8.push(0xf0 | (charcode >>18),
4545
- 0x80 | ((charcode>>12) & 0x3f),
4546
- 0x80 | ((charcode>>6) & 0x3f),
4547
- 0x80 | (charcode & 0x3f));
4548
- }
4549
- }
4550
- return utf8;
4551
- }
4552
- return toUTF8Array(s);
4553
- };
4554
-
4555
- }();
4556
-
4557
- (function (factory) {
4558
- {
4559
- module.exports = factory();
4560
- }
4561
- }(function () {
4562
- return qrcode;
4563
- }));
4564
- } (qrcode$1));
4565
- return qrcode$1.exports;
4566
- }
4567
-
4568
- var qrcodeExports = requireQrcode();
4569
- var qrcode = /*@__PURE__*/getDefaultExportFromCjs(qrcodeExports);
4570
-
4571
2268
  // 文件上传流水号SDK
4572
2269
  const uploadNumberSDK$1 = {
4573
2270
  number: '',
@@ -5974,7 +3671,7 @@ const ComponentsVoiceInputBtn = class {
5974
3671
  : isConverting
5975
3672
  ? this._getText('正在识别语音...', 'Recognizing speech...')
5976
3673
  : this._getText('语音输入', 'Voice input');
5977
- return (h("button", { key: '61026d7314566e475e9a0ba2102e504d7a276b9e', type: "button", class: {
3674
+ return (h("button", { key: 'dc6874de2dfc7b9f5a5b65bc001fe8f580738231', type: "button", class: {
5978
3675
  'voice-input-button': true,
5979
3676
  'recording': isRecording,
5980
3677
  'converting': isConverting,
@@ -10787,6 +8484,11 @@ const HtwsModal = class {
10787
8484
  * 是否显示工作区历史会话按钮
10788
8485
  */
10789
8486
  showWorkspaceHistory = false;
8487
+ /**
8488
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
8489
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
8490
+ */
8491
+ showChatInput = true;
10790
8492
  /**
10791
8493
  * 是否展示 SSE 节点 title 状态,默认开启。
10792
8494
  */
@@ -11006,7 +8708,7 @@ const HtwsModal = class {
11006
8708
  } })), h("div", { class: "textarea-container" }, h("textarea", { id: "free-input-text", placeholder: "\u8BF7\u8F93\u5165\u5408\u540C\u5185\u5BB9", rows: 8, value: this.freeInputText, onInput: this.handleFreeInputChange })), h("div", { class: "input-guide" }, h("div", { class: "guide-title" }, "\u8F93\u5165\u63D0\u793A\uFF1A"), h("div", { class: "guide-content" }, h("div", null, "\u2022 \u8BF7\u8F93\u5165\u5B8C\u6574\u7684\u52B3\u52A8\u5408\u540C\u5185\u5BB9"), h("div", null, "\u2022 \u5305\u62EC\u7532\u65B9\uFF08\u516C\u53F8\uFF09\u3001\u4E59\u65B9\uFF08\u5458\u5DE5\uFF09\u4FE1\u606F"), h("div", null, "\u2022 \u5408\u540C\u671F\u9650\u3001\u5DE5\u4F5C\u5185\u5BB9\u3001\u5DE5\u4F5C\u5730\u70B9"), h("div", null, "\u2022 \u5DE5\u4F5C\u65F6\u95F4\u3001\u4F11\u606F\u4F11\u5047\u3001\u52B3\u52A8\u62A5\u916C"), h("div", null, "\u2022 \u793E\u4F1A\u4FDD\u9669\u3001\u52B3\u52A8\u4FDD\u62A4\u3001\u52B3\u52A8\u6761\u4EF6"), h("div", null, "\u2022 \u5408\u540C\u53D8\u66F4\u3001\u89E3\u9664\u548C\u7EC8\u6B62\u6761\u4EF6\u7B49"))))), h("button", { class: "submit-button", disabled: (this.inputMode === 'upload' && !this.uploadedFileInfo?.length) ||
11007
8709
  (this.inputMode === 'free' && !this.freeInputText.trim()) ||
11008
8710
  this.isUploading ||
11009
- this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showNodeStatus: this.showNodeStatus, botId: "3022316191018882", conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
8711
+ this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, showNodeStatus: this.showNodeStatus, botId: "3022316191018882", conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
11010
8712
  ...this.customInputs,
11011
8713
  file_url: this.inputMode === 'upload' ? this.uploadedFileInfo?.map?.((item) => item.cos_key)?.join(",") : undefined,
11012
8714
  file_name: this.uploadedFileInfo?.map?.((item) => item.file_name)?.join(","),
@@ -11090,6 +8792,11 @@ const HyzjModal = class {
11090
8792
  * 是否显示工作区历史会话按钮
11091
8793
  */
11092
8794
  showWorkspaceHistory = false;
8795
+ /**
8796
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
8797
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
8798
+ */
8799
+ showChatInput = true;
11093
8800
  /**
11094
8801
  * 是否在上传界面显示历史会话按钮
11095
8802
  */
@@ -11339,7 +9046,7 @@ const HyzjModal = class {
11339
9046
  } }, conversation.status))))))))), !this.isLoadingConversations && (this.historyConversationPageIndex > 0 || this.hasMoreHistoryConversations) && (h("div", { class: "history-pagination" }, h("button", { type: "button", class: "history-pagination-button", disabled: this.historyConversationPageIndex === 0, onClick: () => this.handleHistoryConversationPageChange('prev') }, "\u4E0A\u4E00\u9875"), h("span", { class: "history-pagination-info" }, "\u7B2C ", this.historyConversationPageIndex + 1, " \u9875"), h("button", { type: "button", class: "history-pagination-button", disabled: !this.hasMoreHistoryConversations, onClick: () => this.handleHistoryConversationPageChange('next') }, "\u4E0B\u4E00\u9875")))))), !this.showChatModal && !this.conversationId && !hideFileUpload && (h("div", { class: "input-container" }, h("div", { class: "resume-upload-section" }, h("label", null, "\u4E0A\u4F20\u4F1A\u8BAE\u7EAA\u8981"), h("div", { class: "upload-area", onClick: this.handleUploadClick }, this.selectedFile ? (h("div", { class: "file-item" }, h("div", { class: "file-item-content" }, h("span", { class: "file-icon" }, "\uD83D\uDCDD"), h("span", { class: "file-name" }, this.selectedFile.name)), h("button", { class: "remove-file", onClick: (e) => {
11340
9047
  e.stopPropagation();
11341
9048
  this.clearSelectedFile();
11342
- } }, "\u00D7"))) : (h("div", { class: "upload-placeholder" }, h("img", { src: 'https://pub.pincaimao.com/static/web/images/home/i_upload.png' }), h("p", { class: 'upload-text' }, "\u70B9\u51FB\u4E0A\u4F20\u4F1A\u8BAE\u7EAA\u8981"), h("p", { class: "upload-hint" }, "\u652F\u6301 mp3\u3001markdown\u3001pdf\u3001docx\u3001doc\u3001md \u683C\u5F0F"))))), h("button", { class: "submit-button", disabled: !this.selectedFile || this.isUploading || this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))), h("input", { type: "file", class: "file-input", onChange: this.handleFileChange }))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, botId: "3022316191018885", conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
9049
+ } }, "\u00D7"))) : (h("div", { class: "upload-placeholder" }, h("img", { src: 'https://pub.pincaimao.com/static/web/images/home/i_upload.png' }), h("p", { class: 'upload-text' }, "\u70B9\u51FB\u4E0A\u4F20\u4F1A\u8BAE\u7EAA\u8981"), h("p", { class: "upload-hint" }, "\u652F\u6301 mp3\u3001markdown\u3001pdf\u3001docx\u3001doc\u3001md \u683C\u5F0F"))))), h("button", { class: "submit-button", disabled: !this.selectedFile || this.isUploading || this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))), h("input", { type: "file", class: "file-input", onChange: this.handleFileChange }))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: "3022316191018885", conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
11343
9050
  ...this.customInputs,
11344
9051
  file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,
11345
9052
  file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name
@@ -11634,6 +9341,11 @@ const PcmJdModal = class {
11634
9341
  * 是否显示工作区历史会话按钮
11635
9342
  */
11636
9343
  showWorkspaceHistory = false;
9344
+ /**
9345
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
9346
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
9347
+ */
9348
+ showChatInput = true;
11637
9349
  /**
11638
9350
  * 是否在上传界面显示历史会话按钮
11639
9351
  */
@@ -12145,7 +9857,7 @@ const PcmJdModal = class {
12145
9857
  'conversation-status': true,
12146
9858
  'completed': conversation.status === '结束',
12147
9859
  'running': conversation.status === '进行中',
12148
- } }, conversation.status))))))))), !this.isLoadingConversations && (this.historyConversationPageIndex > 0 || this.hasMoreHistoryConversations) && (h("div", { class: "history-pagination" }, h("button", { type: "button", class: "history-pagination-button", disabled: this.historyConversationPageIndex === 0, onClick: () => this.handleHistoryConversationPageChange('prev') }, "\u4E0A\u4E00\u9875"), h("span", { class: "history-pagination-info" }, "\u7B2C ", this.historyConversationPageIndex + 1, " \u9875"), h("button", { type: "button", class: "history-pagination-button", disabled: !this.hasMoreHistoryConversations, onClick: () => this.handleHistoryConversationPageChange('next') }, "\u4E0B\u4E00\u9875")))))), !this.showChatModal && !this.conversationId && true && (h("div", { class: "input-container" }, h("div", { class: "input-mode-toggle" }, h("span", null, this.strings.jobRequirementInfo), h("button", { class: "toggle-button", onClick: this.handleToggleInput, disabled: this.isLoading || this.isVoiceInputActive }, h("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M4 6h16M4 12h16M4 18h16" })), this.strings.toggleInput)), this.inputMode === 'structured' && (h("div", { class: "structured-input" }, this.step === 'input' && (h("div", { class: "job-name-input" }, h("label", { htmlFor: "job-name" }, this.strings.jobName, " ", h("span", { class: "required" }, this.strings.required)), h("input", { id: "job-name", type: "text", placeholder: this.strings.jobNamePlaceholder, value: this.jobName, onInput: this.handleJobNameChange, disabled: this.isLoading }), h("div", { class: "button-container" }, h("button", { class: "submit-button next-button", onClick: this.handleNextStep, disabled: !this.jobName.trim() || this.isLoading }, this.strings.nextStep)))), this.step === 'review' && (h("div", { class: "tag-selection" }, this.isLoading ? (this.renderLoadingState()) : (h("div", { class: "tag-selection-content" }, this.tagGroups.length > 0 && (h("div", { class: "ai-tags-section" }, h("div", { class: "section-title" }, this.strings.aiRecommendedTags), this.renderAITagGroups())), this.tagGroups.length > 0 && (h("div", { class: "basic-tags-section" }, this.renderTagGroup(this.strings.salaryRange, this.getSalaryRanges(), 'salary'), this.renderTagGroup(this.strings.benefits, this.getBenefits(), 'benefits'), this.renderTagGroup(this.strings.education, this.getEducationRequirements(), 'education'))), h("div", { class: "button-container" }, h("button", { class: "submit-button prev-button", onClick: this.handlePrevStep }, this.strings.prevStep), h("button", { class: "submit-button", onClick: this.handleSubmitStructured, disabled: this.isSubmitting }, this.isSubmitting ? this.strings.processing : this.strings.generateJD)))))))), this.inputMode === 'free' && (h("div", { class: "free-input" }, h("div", { class: "textarea-container" }, h("label", { htmlFor: "free-input-text" }, this.strings.jdInfo, " ", h("span", { class: "required" }, this.strings.required)), h("div", { class: "voice-textarea-wrapper" }, h("textarea", { id: "free-input-text", placeholder: this.strings.jdInfoPlaceholder, rows: 8, value: this.freeInputText, onInput: this.handleFreeInputChange, disabled: this.isVoiceInputActive }), h("div", { class: "voice-input-entry" }, h("components-voice-input-btn", { locale: this.locale === 'en' ? 'en' : 'zh', disabled: this.isSubmitting, onVoiceRecognized: this.handleVoiceRecognized, onVoiceStatusChange: this.handleVoiceStatusChange, onSomeErrorEvent: this.handleVoiceInputError })))), h("div", { class: "input-guide" }, h("div", { class: "guide-title" }, this.strings.inputGuideTitle), h("div", { class: "guide-content" }, h("div", null, this.strings.inputGuide.jobTitle), h("div", null, this.strings.inputGuide.salary), h("div", null, this.strings.inputGuide.benefits), h("div", null, this.strings.inputGuide.responsibilities), h("div", null, this.strings.inputGuide.qualifications), h("div", null, this.strings.inputGuide.location))), h("div", { class: "button-container" }, h("button", { class: "submit-button", onClick: this.handleSubmitFree, disabled: !this.freeInputText.trim() || this.isSubmitting || this.isVoiceInputActive }, this.isSubmitting ? this.strings.processing : this.strings.generateJD)))), h("div", { class: "ai-disclaimer" }, h("p", null, this.strings.aiDisclaimer), h("p", { class: "beian-info" }, h("span", null, this.strings.beianLabel), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, this.strings.beianNumber))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, this.strings.loadingConversation))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { locale: this.locale, isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, botId: this.getBotId(), conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
9860
+ } }, conversation.status))))))))), !this.isLoadingConversations && (this.historyConversationPageIndex > 0 || this.hasMoreHistoryConversations) && (h("div", { class: "history-pagination" }, h("button", { type: "button", class: "history-pagination-button", disabled: this.historyConversationPageIndex === 0, onClick: () => this.handleHistoryConversationPageChange('prev') }, "\u4E0A\u4E00\u9875"), h("span", { class: "history-pagination-info" }, "\u7B2C ", this.historyConversationPageIndex + 1, " \u9875"), h("button", { type: "button", class: "history-pagination-button", disabled: !this.hasMoreHistoryConversations, onClick: () => this.handleHistoryConversationPageChange('next') }, "\u4E0B\u4E00\u9875")))))), !this.showChatModal && !this.conversationId && true && (h("div", { class: "input-container" }, h("div", { class: "input-mode-toggle" }, h("span", null, this.strings.jobRequirementInfo), h("button", { class: "toggle-button", onClick: this.handleToggleInput, disabled: this.isLoading || this.isVoiceInputActive }, h("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M4 6h16M4 12h16M4 18h16" })), this.strings.toggleInput)), this.inputMode === 'structured' && (h("div", { class: "structured-input" }, this.step === 'input' && (h("div", { class: "job-name-input" }, h("label", { htmlFor: "job-name" }, this.strings.jobName, " ", h("span", { class: "required" }, this.strings.required)), h("input", { id: "job-name", type: "text", placeholder: this.strings.jobNamePlaceholder, value: this.jobName, onInput: this.handleJobNameChange, disabled: this.isLoading }), h("div", { class: "button-container" }, h("button", { class: "submit-button next-button", onClick: this.handleNextStep, disabled: !this.jobName.trim() || this.isLoading }, this.strings.nextStep)))), this.step === 'review' && (h("div", { class: "tag-selection" }, this.isLoading ? (this.renderLoadingState()) : (h("div", { class: "tag-selection-content" }, this.tagGroups.length > 0 && (h("div", { class: "ai-tags-section" }, h("div", { class: "section-title" }, this.strings.aiRecommendedTags), this.renderAITagGroups())), this.tagGroups.length > 0 && (h("div", { class: "basic-tags-section" }, this.renderTagGroup(this.strings.salaryRange, this.getSalaryRanges(), 'salary'), this.renderTagGroup(this.strings.benefits, this.getBenefits(), 'benefits'), this.renderTagGroup(this.strings.education, this.getEducationRequirements(), 'education'))), h("div", { class: "button-container" }, h("button", { class: "submit-button prev-button", onClick: this.handlePrevStep }, this.strings.prevStep), h("button", { class: "submit-button", onClick: this.handleSubmitStructured, disabled: this.isSubmitting }, this.isSubmitting ? this.strings.processing : this.strings.generateJD)))))))), this.inputMode === 'free' && (h("div", { class: "free-input" }, h("div", { class: "textarea-container" }, h("label", { htmlFor: "free-input-text" }, this.strings.jdInfo, " ", h("span", { class: "required" }, this.strings.required)), h("div", { class: "voice-textarea-wrapper" }, h("textarea", { id: "free-input-text", placeholder: this.strings.jdInfoPlaceholder, rows: 8, value: this.freeInputText, onInput: this.handleFreeInputChange, disabled: this.isVoiceInputActive }), h("div", { class: "voice-input-entry" }, h("components-voice-input-btn", { locale: this.locale === 'en' ? 'en' : 'zh', disabled: this.isSubmitting, onVoiceRecognized: this.handleVoiceRecognized, onVoiceStatusChange: this.handleVoiceStatusChange, onSomeErrorEvent: this.handleVoiceInputError })))), h("div", { class: "input-guide" }, h("div", { class: "guide-title" }, this.strings.inputGuideTitle), h("div", { class: "guide-content" }, h("div", null, this.strings.inputGuide.jobTitle), h("div", null, this.strings.inputGuide.salary), h("div", null, this.strings.inputGuide.benefits), h("div", null, this.strings.inputGuide.responsibilities), h("div", null, this.strings.inputGuide.qualifications), h("div", null, this.strings.inputGuide.location))), h("div", { class: "button-container" }, h("button", { class: "submit-button", onClick: this.handleSubmitFree, disabled: !this.freeInputText.trim() || this.isSubmitting || this.isVoiceInputActive }, this.isSubmitting ? this.strings.processing : this.strings.generateJD)))), h("div", { class: "ai-disclaimer" }, h("p", null, this.strings.aiDisclaimer), h("p", { class: "beian-info" }, h("span", null, this.strings.beianLabel), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, this.strings.beianNumber))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, this.strings.loadingConversation))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { locale: this.locale, isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: this.getBotId(), conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
12149
9861
  ...this.customInputs,
12150
9862
  job_info: this.customInputs?.job_info || this.jobDescription
12151
9863
  }, interviewMode: "text", showSaveJdButton: this.showSaveJdButton, saveJdButtonText: this.saveJdButtonText }))))));
@@ -13165,6 +10877,11 @@ const MnctModal = class {
13165
10877
  * 是否显示工作区历史会话按钮
13166
10878
  */
13167
10879
  showWorkspaceHistory = false;
10880
+ /**
10881
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
10882
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
10883
+ */
10884
+ showChatInput = true;
13168
10885
  /**
13169
10886
  * 是否在上传界面显示历史会话按钮
13170
10887
  */
@@ -13401,7 +11118,7 @@ const MnctModal = class {
13401
11118
  'conversation-status': true,
13402
11119
  'completed': conversation.status === '结束',
13403
11120
  'running': conversation.status === '进行中',
13404
- } }, conversation.status))))))))), !this.isLoadingConversations && (this.historyConversationPageIndex > 0 || this.hasMoreHistoryConversations) && (h("div", { class: "history-pagination" }, h("button", { type: "button", class: "history-pagination-button", disabled: this.historyConversationPageIndex === 0, onClick: () => this.handleHistoryConversationPageChange('prev') }, "\u4E0A\u4E00\u9875"), h("span", { class: "history-pagination-info" }, "\u7B2C ", this.historyConversationPageIndex + 1, " \u9875"), h("button", { type: "button", class: "history-pagination-button", disabled: !this.hasMoreHistoryConversations, onClick: () => this.handleHistoryConversationPageChange('next') }, "\u4E0B\u4E00\u9875")))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, this.strings.loadingConversation))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { locale: this.locale, isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, botId: this.getBotId(), conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
11121
+ } }, conversation.status))))))))), !this.isLoadingConversations && (this.historyConversationPageIndex > 0 || this.hasMoreHistoryConversations) && (h("div", { class: "history-pagination" }, h("button", { type: "button", class: "history-pagination-button", disabled: this.historyConversationPageIndex === 0, onClick: () => this.handleHistoryConversationPageChange('prev') }, "\u4E0A\u4E00\u9875"), h("span", { class: "history-pagination-info" }, "\u7B2C ", this.historyConversationPageIndex + 1, " \u9875"), h("button", { type: "button", class: "history-pagination-button", disabled: !this.hasMoreHistoryConversations, onClick: () => this.handleHistoryConversationPageChange('next') }, "\u4E0B\u4E00\u9875")))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, this.strings.loadingConversation))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { locale: this.locale, isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: this.getBotId(), conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
13405
11122
  ...this.customInputs,
13406
11123
  file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,
13407
11124
  file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name,
@@ -14112,6 +11829,11 @@ const MsbgModal = class {
14112
11829
  * 是否显示工作区历史会话按钮
14113
11830
  */
14114
11831
  showWorkspaceHistory = false;
11832
+ /**
11833
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
11834
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
11835
+ */
11836
+ showChatInput = true;
14115
11837
  /**
14116
11838
  * 是否在上传界面显示历史会话按钮
14117
11839
  */
@@ -14379,7 +12101,7 @@ const MsbgModal = class {
14379
12101
  } }, conversation.status))))))))), !this.isLoadingConversations && (this.historyConversationPageIndex > 0 || this.hasMoreHistoryConversations) && (h("div", { class: "history-pagination" }, h("button", { type: "button", class: "history-pagination-button", disabled: this.historyConversationPageIndex === 0, onClick: () => this.handleHistoryConversationPageChange('prev') }, "\u4E0A\u4E00\u9875"), h("span", { class: "history-pagination-info" }, "\u7B2C ", this.historyConversationPageIndex + 1, " \u9875"), h("button", { type: "button", class: "history-pagination-button", disabled: !this.hasMoreHistoryConversations, onClick: () => this.handleHistoryConversationPageChange('next') }, "\u4E0B\u4E00\u9875")))))), !this.showChatModal && !this.conversationId && !hasFileAndJob && (h("div", { class: "input-container" }, !hideJdInput && (h("div", { class: "jd-input-section" }, h("label", { htmlFor: "job-description" }, "\u8BF7\u8F93\u5165\u804C\u4F4D\u63CF\u8FF0 (JD)"), h("textarea", { id: "job-description", class: "job-description-textarea", placeholder: "\u8BF7\u8F93\u5165\u804C\u4F4D\u63CF\u8FF0\uFF0C\u5305\u62EC\u804C\u8D23\u3001\u8981\u6C42\u7B49\u4FE1\u606F...", rows: 6, value: this.jobDescription, onInput: this.handleJobDescriptionChange }))), !hideFileUpload && (h("div", { class: "resume-upload-section" }, h("label", null, "\u4E0A\u4F20\u9762\u8BD5\u5185\u5BB9"), h("div", { class: "upload-area", onClick: this.handleUploadClick }, this.selectedFile ? (h("div", { class: "file-item" }, h("div", { class: "file-item-content" }, h("span", { class: "file-icon" }, "\uD83D\uDCDD"), h("span", { class: "file-name" }, this.selectedFile.name)), h("button", { class: "remove-file", onClick: (e) => {
14380
12102
  e.stopPropagation();
14381
12103
  this.clearSelectedFile();
14382
- } }, "\u00D7"))) : (h("div", { class: "upload-placeholder" }, h("img", { src: 'https://pub.pincaimao.com/static/web/images/home/i_upload.png' }), h("p", { class: 'upload-text' }, "\u70B9\u51FB\u4E0A\u4F20\u9762\u8BD5\u5185\u5BB9"), h("p", { class: "upload-hint" }, "\u652F\u6301 mp3\u3001markdown\u3001pdf\u3001docx\u3001doc\u3001md \u683C\u5F0F")))))), h("button", { class: "submit-button", disabled: (!hideFileUpload && !this.selectedFile) || (!hideJdInput && !this.jobDescription.trim()) || this.isUploading || this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))), h("input", { type: "file", class: "file-input", onChange: this.handleFileChange }))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, botId: "3022316191018877", conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
12104
+ } }, "\u00D7"))) : (h("div", { class: "upload-placeholder" }, h("img", { src: 'https://pub.pincaimao.com/static/web/images/home/i_upload.png' }), h("p", { class: 'upload-text' }, "\u70B9\u51FB\u4E0A\u4F20\u9762\u8BD5\u5185\u5BB9"), h("p", { class: "upload-hint" }, "\u652F\u6301 mp3\u3001markdown\u3001pdf\u3001docx\u3001doc\u3001md \u683C\u5F0F")))))), h("button", { class: "submit-button", disabled: (!hideFileUpload && !this.selectedFile) || (!hideJdInput && !this.jobDescription.trim()) || this.isUploading || this.isSubmitting, onClick: this.handleStartInterview }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始分析'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))), h("input", { type: "file", class: "file-input", onChange: this.handleFileChange }))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: "3022316191018877", conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
14383
12105
  ...this.customInputs,
14384
12106
  file_urls: this.customInputs?.file_urls || this.uploadedFileInfo?.cos_key,
14385
12107
  file_names: this.customInputs?.file_names || this.uploadedFileInfo?.file_name,
@@ -14478,6 +12200,11 @@ const QgqjlModal = class {
14478
12200
  * 是否显示工作区历史会话按钮
14479
12201
  */
14480
12202
  showWorkspaceHistory = false;
12203
+ /**
12204
+ * 是否显示分析后的聊天输入区,默认显示,仅对聊天分支生效,不影响初始表单及 optimizationType 为 1 或 2 的简历优化流程。
12205
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
12206
+ */
12207
+ showChatInput = true;
14481
12208
  /**
14482
12209
  * 是否在上传界面显示历史会话按钮
14483
12210
  */
@@ -14903,7 +12630,7 @@ const QgqjlModal = class {
14903
12630
  job_info: this.customInputs?.job_info || (this.selectedOptimizationMode === 'targeted' ? this.jobDescription : ''),
14904
12631
  job_title: this.customInputs?.job_title || '',
14905
12632
  optimization_type: this.getEffectiveOptimizationType(),
14906
- }, defaultQuery: this.defaultQuery, modalTitle: this.modalTitle, icon: this.icon, fullscreen: this.fullscreen, zIndex: this.zIndex, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, onModalClosed: this.handleClose, onConversationStart: (e) => this.handleStreamComplete(e), onStreamComplete: (e) => this.handleStreamComplete(e), onInterviewComplete: (e) => this.handleStreamComplete(e) })) : (h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, botId: "45444431062634496", conversationId: this.currentConversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, closeResume: this.closeResumeChat, customInputs: {
12633
+ }, defaultQuery: this.defaultQuery, modalTitle: this.modalTitle, icon: this.icon, fullscreen: this.fullscreen, zIndex: this.zIndex, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, onModalClosed: this.handleClose, onConversationStart: (e) => this.handleStreamComplete(e), onStreamComplete: (e) => this.handleStreamComplete(e), onInterviewComplete: (e) => this.handleStreamComplete(e) })) : (h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, fullscreen: this.fullscreen, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: "45444431062634496", conversationId: this.currentConversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, closeResume: this.closeResumeChat, customInputs: {
14907
12634
  ...this.customInputs,
14908
12635
  file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,
14909
12636
  file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name,
@@ -17807,6 +15534,11 @@ const ZyghModal = class {
17807
15534
  * 是否显示工作区历史会话按钮
17808
15535
  */
17809
15536
  showWorkspaceHistory = false;
15537
+ /**
15538
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
15539
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
15540
+ */
15541
+ showChatInput = true;
17810
15542
  /**
17811
15543
  * 是否在上传界面显示历史会话按钮
17812
15544
  */
@@ -18016,7 +15748,7 @@ const ZyghModal = class {
18016
15748
  const result = e.detail ?? [];
18017
15749
  this.uploadedFileInfo = result[0];
18018
15750
  this.uploadSuccess.emit(this.uploadedFileInfo);
18019
- } }))), h("button", { class: "submit-button", disabled: (!this.customInputs?.file_url && !this.customInputs?.resume_content && !this.uploadedFileInfo) || this.isUploading || this.isSubmitting, onClick: this.handleStartPlanning }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始规划'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, showWorkspaceHistory: this.showWorkspaceHistory, botId: "3022316191018898", fullscreen: this.fullscreen, conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
15751
+ } }))), h("button", { class: "submit-button", disabled: (!this.customInputs?.file_url && !this.customInputs?.resume_content && !this.uploadedFileInfo) || this.isUploading || this.isSubmitting, onClick: this.handleStartPlanning }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始规划'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: "3022316191018898", fullscreen: this.fullscreen, conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
18020
15752
  ...this.customInputs,
18021
15753
  file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,
18022
15754
  file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name,
@@ -18102,6 +15834,11 @@ const ZyghV2Modal = class {
18102
15834
  * 是否显示工作区历史会话按钮
18103
15835
  */
18104
15836
  showWorkspaceHistory = false;
15837
+ /**
15838
+ * 是否显示分析后的聊天输入区,默认显示,不影响初始表单。
15839
+ * 可通过 JS 动态设置 element.showChatInput = false 隐藏文字输入、语音和发送按钮,设为 true 恢复。
15840
+ */
15841
+ showChatInput = true;
18105
15842
  /**
18106
15843
  * 是否在上传界面显示历史会话按钮
18107
15844
  */
@@ -18330,7 +16067,7 @@ const ZyghV2Modal = class {
18330
16067
  const result = e.detail ?? [];
18331
16068
  this.uploadedFileInfo = result[0];
18332
16069
  this.uploadSuccess.emit(this.uploadedFileInfo);
18333
- } }))), h("button", { class: "submit-button", disabled: (!this.customInputs?.file_url && !this.customInputs?.resume_content && !this.uploadedFileInfo) || this.isUploading || this.isSubmitting, onClick: this.handleStartPlanning }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始规划'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, showWorkspaceHistory: this.showWorkspaceHistory, botId: "121182005294690304", fullscreen: this.fullscreen, conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
16070
+ } }))), h("button", { class: "submit-button", disabled: (!this.customInputs?.file_url && !this.customInputs?.resume_content && !this.uploadedFileInfo) || this.isUploading || this.isSubmitting, onClick: this.handleStartPlanning }, this.isUploading ? '上传中...' : this.isSubmitting ? '处理中...' : '开始规划'), h("div", { class: "ai-disclaimer" }, h("p", null, "\u6240\u6709\u5185\u5BB9\u5747\u7531AI\u751F\u6210\u4EC5\u4F9B\u53C2\u8003"), h("p", { class: "beian-info" }, h("span", null, "\u4E2D\u592E\u7F51\u4FE1\u529E\u751F\u6210\u5F0F\u4EBA\u5DE5\u667A\u80FD\u670D\u52A1\u5907\u6848\u53F7"), "\uFF1A", h("a", { href: "https://www.pincaimao.com", target: "_blank", rel: "noopener noreferrer" }, "Hunan-PinCaiMao-202412310003"))))), isLoading && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", { class: "loading-text" }, "\u6B63\u5728\u52A0\u8F7D\u5BF9\u8BDD..."))), this.showChatModal && (h("div", null, h("pcm-app-chat-modal", { isOpen: true, modalTitle: this.modalTitle, icon: this.icon, isShowHeader: this.isShowHeader, isNeedClose: this.isNeedClose, showWorkspaceHistory: this.showWorkspaceHistory, showChatInput: this.showChatInput, botId: "121182005294690304", fullscreen: this.fullscreen, conversationId: this.conversationId, defaultQuery: this.defaultQuery, filePreviewMode: this.filePreviewMode, customInputs: {
18334
16071
  ...this.customInputs,
18335
16072
  file_url: this.customInputs?.file_url || this.uploadedFileInfo?.cos_key,
18336
16073
  file_name: this.customInputs?.file_name || this.uploadedFileInfo?.file_name,