@learncard/react 2.5.15 → 2.5.17

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 (462) hide show
  1. package/package.json +2 -2
  2. package/dist/base.css +0 -1
  3. package/dist/base.js +0 -3
  4. package/dist/cjs/AchievementCard-f0130caa.js +0 -67
  5. package/dist/cjs/AchievementCard-f0130caa.js.map +0 -1
  6. package/dist/cjs/ArrowArcLeft.svg +0 -4
  7. package/dist/cjs/ArrowArcRight.svg +0 -4
  8. package/dist/cjs/AwardRibbon-14ba45fb.js +0 -33
  9. package/dist/cjs/AwardRibbon-14ba45fb.js.map +0 -1
  10. package/dist/cjs/BoostGenericCard-315c6b82.js +0 -77
  11. package/dist/cjs/BoostGenericCard-315c6b82.js.map +0 -1
  12. package/dist/cjs/BoostSmallCard-30f75abb.js +0 -117
  13. package/dist/cjs/BoostSmallCard-30f75abb.js.map +0 -1
  14. package/dist/cjs/Button-a7af702b.js +0 -18
  15. package/dist/cjs/Button-a7af702b.js.map +0 -1
  16. package/dist/cjs/CaretRightFilled.svg +0 -3
  17. package/dist/cjs/Checkmark-f611aa4d.js +0 -58
  18. package/dist/cjs/Checkmark-f611aa4d.js.map +0 -1
  19. package/dist/cjs/CircleCheckButton-43c96841.js +0 -30
  20. package/dist/cjs/CircleCheckButton-43c96841.js.map +0 -1
  21. package/dist/cjs/CircleIcon-a45953f5.js +0 -1083
  22. package/dist/cjs/CircleIcon-a45953f5.js.map +0 -1
  23. package/dist/cjs/CircleSpinner-093cce04.js +0 -49
  24. package/dist/cjs/CircleSpinner-093cce04.js.map +0 -1
  25. package/dist/cjs/CourseCard-338a32ee.js +0 -92
  26. package/dist/cjs/CourseCard-338a32ee.js.map +0 -1
  27. package/dist/cjs/CourseVerticalCard-b76f5407.js +0 -98
  28. package/dist/cjs/CourseVerticalCard-b76f5407.js.map +0 -1
  29. package/dist/cjs/FlippyCard-209549c5.js +0 -34
  30. package/dist/cjs/FlippyCard-209549c5.js.map +0 -1
  31. package/dist/cjs/GenericArrow-8dfb261d.js +0 -27
  32. package/dist/cjs/GenericArrow-8dfb261d.js.map +0 -1
  33. package/dist/cjs/GenericCard-9674fcc0.js +0 -61
  34. package/dist/cjs/GenericCard-9674fcc0.js.map +0 -1
  35. package/dist/cjs/GreenCheckCircle.svg +0 -4
  36. package/dist/cjs/JobHistoryCard-05a3f98b.js +0 -43
  37. package/dist/cjs/JobHistoryCard-05a3f98b.js.map +0 -1
  38. package/dist/cjs/JobListCard-c662e649.js +0 -127
  39. package/dist/cjs/JobListCard-c662e649.js.map +0 -1
  40. package/dist/cjs/LearnCardCreditCardBackFace-87cc8b9f.js +0 -72
  41. package/dist/cjs/LearnCardCreditCardBackFace-87cc8b9f.js.map +0 -1
  42. package/dist/cjs/LearnCardCreditCardFrontFace-4452fd7a.js +0 -78
  43. package/dist/cjs/LearnCardCreditCardFrontFace-4452fd7a.js.map +0 -1
  44. package/dist/cjs/LearnPill-5c9bf172.js +0 -40
  45. package/dist/cjs/LearnPill-5c9bf172.js.map +0 -1
  46. package/dist/cjs/Lightbulb-1c28af02.js +0 -22
  47. package/dist/cjs/Lightbulb-1c28af02.js.map +0 -1
  48. package/dist/cjs/MiniVCThumbnail-a78e44f2.js +0 -69
  49. package/dist/cjs/MiniVCThumbnail-a78e44f2.js.map +0 -1
  50. package/dist/cjs/Notification-9d230f1b.js +0 -94
  51. package/dist/cjs/Notification-9d230f1b.js.map +0 -1
  52. package/dist/cjs/NotificationBoostCard-3b3bd47d.js +0 -121
  53. package/dist/cjs/NotificationBoostCard-3b3bd47d.js.map +0 -1
  54. package/dist/cjs/NotificationUserAcceptedBoostCard-423b9320.js +0 -74
  55. package/dist/cjs/NotificationUserAcceptedBoostCard-423b9320.js.map +0 -1
  56. package/dist/cjs/NotificationUserCard-d4dab06c.js +0 -94
  57. package/dist/cjs/NotificationUserCard-d4dab06c.js.map +0 -1
  58. package/dist/cjs/QRCodeCard-efaa58e1.js +0 -42
  59. package/dist/cjs/QRCodeCard-efaa58e1.js.map +0 -1
  60. package/dist/cjs/RedXCircle.svg +0 -5
  61. package/dist/cjs/RoundedPill-85e7ed68.js +0 -106
  62. package/dist/cjs/RoundedPill-85e7ed68.js.map +0 -1
  63. package/dist/cjs/SchoolIDCard-1baf77e8.js +0 -4728
  64. package/dist/cjs/SchoolIDCard-1baf77e8.js.map +0 -1
  65. package/dist/cjs/SkillTabCard-14ba0618.js +0 -42
  66. package/dist/cjs/SkillTabCard-14ba0618.js.map +0 -1
  67. package/dist/cjs/SkillVerticalCard-3eb3a8e9.js +0 -35
  68. package/dist/cjs/SkillVerticalCard-3eb3a8e9.js.map +0 -1
  69. package/dist/cjs/SkillsCard-4b6dbb4f.js +0 -66
  70. package/dist/cjs/SkillsCard-4b6dbb4f.js.map +0 -1
  71. package/dist/cjs/SkillsStatsCard-97a35a88.js +0 -77
  72. package/dist/cjs/SkillsStatsCard-97a35a88.js.map +0 -1
  73. package/dist/cjs/SmallAchievementCard-c76701ce.js +0 -43
  74. package/dist/cjs/SmallAchievementCard-c76701ce.js.map +0 -1
  75. package/dist/cjs/Trophy-9ede7f2b.js +0 -25
  76. package/dist/cjs/Trophy-9ede7f2b.js.map +0 -1
  77. package/dist/cjs/User-92f9cf40.js +0 -91
  78. package/dist/cjs/User-92f9cf40.js.map +0 -1
  79. package/dist/cjs/VCCard-b6ddea8f.js +0 -79
  80. package/dist/cjs/VCCard-b6ddea8f.js.map +0 -1
  81. package/dist/cjs/VCDisplayBackFace-7000dc04.js +0 -87
  82. package/dist/cjs/VCDisplayBackFace-7000dc04.js.map +0 -1
  83. package/dist/cjs/VCDisplayCard-043dc048.js +0 -191
  84. package/dist/cjs/VCDisplayCard-043dc048.js.map +0 -1
  85. package/dist/cjs/VCDisplayCard2-3a96dc6a.js +0 -1005
  86. package/dist/cjs/VCDisplayCard2-3a96dc6a.js.map +0 -1
  87. package/dist/cjs/VCThumbnail-6bf86bb2.js +0 -143
  88. package/dist/cjs/VCThumbnail-6bf86bb2.js.map +0 -1
  89. package/dist/cjs/VCVerificationCheck-46fa75d3.js +0 -81
  90. package/dist/cjs/VCVerificationCheck-46fa75d3.js.map +0 -1
  91. package/dist/cjs/VCVerificationPill-f270da3c.js +0 -75
  92. package/dist/cjs/VCVerificationPill-f270da3c.js.map +0 -1
  93. package/dist/cjs/X.svg +0 -4
  94. package/dist/cjs/YellowWarningCircle.svg +0 -4
  95. package/dist/cjs/addawardlight.svg +0 -8
  96. package/dist/cjs/award.svg +0 -3
  97. package/dist/cjs/badge.png +0 -0
  98. package/dist/cjs/briefcase.svg +0 -6
  99. package/dist/cjs/card-chip.svg +0 -26
  100. package/dist/cjs/coins.svg +0 -3
  101. package/dist/cjs/constants-35d9ebc6.js +0 -109
  102. package/dist/cjs/constants-35d9ebc6.js.map +0 -1
  103. package/dist/cjs/contactless-symbol.svg +0 -3
  104. package/dist/cjs/credential.helpers-86774cc9.js +0 -2188
  105. package/dist/cjs/credential.helpers-86774cc9.js.map +0 -1
  106. package/dist/cjs/default-face.jpeg +0 -0
  107. package/dist/cjs/gradcaplight.svg +0 -3
  108. package/dist/cjs/graduation.svg +0 -3
  109. package/dist/cjs/icon.green.fat-arrow.png +0 -0
  110. package/dist/cjs/icons-ac6eb6ec.js +0 -48
  111. package/dist/cjs/icons-ac6eb6ec.js.map +0 -1
  112. package/dist/cjs/index-82de573c.js +0 -774
  113. package/dist/cjs/index-82de573c.js.map +0 -1
  114. package/dist/cjs/index-83152f8d.js +0 -74
  115. package/dist/cjs/index-83152f8d.js.map +0 -1
  116. package/dist/cjs/index-a961acab.js +0 -3538
  117. package/dist/cjs/index-a961acab.js.map +0 -1
  118. package/dist/cjs/index-d836b84d.js +0 -51
  119. package/dist/cjs/index-d836b84d.js.map +0 -1
  120. package/dist/cjs/index.js +0 -161
  121. package/dist/cjs/index.js.map +0 -1
  122. package/dist/cjs/index10.js +0 -11
  123. package/dist/cjs/index10.js.map +0 -1
  124. package/dist/cjs/index11.js +0 -36
  125. package/dist/cjs/index11.js.map +0 -1
  126. package/dist/cjs/index12.js +0 -161
  127. package/dist/cjs/index12.js.map +0 -1
  128. package/dist/cjs/index13.js +0 -12
  129. package/dist/cjs/index13.js.map +0 -1
  130. package/dist/cjs/index14.js +0 -24
  131. package/dist/cjs/index14.js.map +0 -1
  132. package/dist/cjs/index15.js +0 -12
  133. package/dist/cjs/index15.js.map +0 -1
  134. package/dist/cjs/index16.js +0 -14
  135. package/dist/cjs/index16.js.map +0 -1
  136. package/dist/cjs/index17.js +0 -23
  137. package/dist/cjs/index17.js.map +0 -1
  138. package/dist/cjs/index18.js +0 -11
  139. package/dist/cjs/index18.js.map +0 -1
  140. package/dist/cjs/index19.js +0 -12
  141. package/dist/cjs/index19.js.map +0 -1
  142. package/dist/cjs/index2.js +0 -37
  143. package/dist/cjs/index2.js.map +0 -1
  144. package/dist/cjs/index20.js +0 -17
  145. package/dist/cjs/index20.js.map +0 -1
  146. package/dist/cjs/index21.js +0 -19
  147. package/dist/cjs/index21.js.map +0 -1
  148. package/dist/cjs/index22.js +0 -15
  149. package/dist/cjs/index22.js.map +0 -1
  150. package/dist/cjs/index23.js +0 -17
  151. package/dist/cjs/index23.js.map +0 -1
  152. package/dist/cjs/index24.js +0 -12
  153. package/dist/cjs/index24.js.map +0 -1
  154. package/dist/cjs/index25.js +0 -24
  155. package/dist/cjs/index25.js.map +0 -1
  156. package/dist/cjs/index26.js +0 -40
  157. package/dist/cjs/index26.js.map +0 -1
  158. package/dist/cjs/index27.js +0 -11
  159. package/dist/cjs/index27.js.map +0 -1
  160. package/dist/cjs/index28.js +0 -12
  161. package/dist/cjs/index28.js.map +0 -1
  162. package/dist/cjs/index29.js +0 -12
  163. package/dist/cjs/index29.js.map +0 -1
  164. package/dist/cjs/index3.js +0 -36
  165. package/dist/cjs/index3.js.map +0 -1
  166. package/dist/cjs/index30.js +0 -25
  167. package/dist/cjs/index30.js.map +0 -1
  168. package/dist/cjs/index31.js +0 -12
  169. package/dist/cjs/index31.js.map +0 -1
  170. package/dist/cjs/index32.js +0 -12
  171. package/dist/cjs/index32.js.map +0 -1
  172. package/dist/cjs/index33.js +0 -24
  173. package/dist/cjs/index33.js.map +0 -1
  174. package/dist/cjs/index34.js +0 -31
  175. package/dist/cjs/index34.js.map +0 -1
  176. package/dist/cjs/index35.js +0 -22
  177. package/dist/cjs/index35.js.map +0 -1
  178. package/dist/cjs/index36.js +0 -26
  179. package/dist/cjs/index36.js.map +0 -1
  180. package/dist/cjs/index37.js +0 -20
  181. package/dist/cjs/index37.js.map +0 -1
  182. package/dist/cjs/index38.js +0 -10
  183. package/dist/cjs/index38.js.map +0 -1
  184. package/dist/cjs/index39.js +0 -13
  185. package/dist/cjs/index39.js.map +0 -1
  186. package/dist/cjs/index4.js +0 -39
  187. package/dist/cjs/index4.js.map +0 -1
  188. package/dist/cjs/index40.js +0 -15
  189. package/dist/cjs/index40.js.map +0 -1
  190. package/dist/cjs/index41.js +0 -15
  191. package/dist/cjs/index41.js.map +0 -1
  192. package/dist/cjs/index5.js +0 -11
  193. package/dist/cjs/index5.js.map +0 -1
  194. package/dist/cjs/index6.js +0 -24
  195. package/dist/cjs/index6.js.map +0 -1
  196. package/dist/cjs/index7.js +0 -24
  197. package/dist/cjs/index7.js.map +0 -1
  198. package/dist/cjs/index8.js +0 -15
  199. package/dist/cjs/index8.js.map +0 -1
  200. package/dist/cjs/index9.js +0 -27
  201. package/dist/cjs/index9.js.map +0 -1
  202. package/dist/cjs/lhplaceholder.png +0 -0
  203. package/dist/cjs/lightbulb.svg +0 -3
  204. package/dist/cjs/master-card-logo.svg +0 -20
  205. package/dist/cjs/minigradcapcolored.svg +0 -3
  206. package/dist/cjs/minijob.svg +0 -5
  207. package/dist/cjs/minipuzzle.svg +0 -3
  208. package/dist/cjs/minipuzzlecolored.svg +0 -3
  209. package/dist/cjs/minitrophy.svg +0 -3
  210. package/dist/cjs/minitrophycolored.svg +0 -3
  211. package/dist/cjs/notifications-56c6fc94.js +0 -21
  212. package/dist/cjs/notifications-56c6fc94.js.map +0 -1
  213. package/dist/cjs/skillgraph.svg +0 -29
  214. package/dist/cjs/skillplaceholder.png +0 -0
  215. package/dist/cjs/social-badge.png +0 -0
  216. package/dist/cjs/trophy.svg +0 -3
  217. package/dist/cjs/types-c83b33ec.js +0 -115
  218. package/dist/cjs/types-c83b33ec.js.map +0 -1
  219. package/dist/cjs/types-e4d9a257.js +0 -25
  220. package/dist/cjs/types-e4d9a257.js.map +0 -1
  221. package/dist/cjs/types.esm-6fa436eb.js +0 -4080
  222. package/dist/cjs/types.esm-6fa436eb.js.map +0 -1
  223. package/dist/cjs/user.svg +0 -4
  224. package/dist/cjs/vc.check.svg +0 -10
  225. package/dist/cjs/verified-check.png +0 -0
  226. package/dist/cjs/walletTrophy.webp +0 -0
  227. package/dist/cjs/walletcurrency.webp +0 -0
  228. package/dist/cjs/walletids.webp +0 -0
  229. package/dist/cjs/walletjobhistory.webp +0 -0
  230. package/dist/cjs/walletlearninghistory.webp +0 -0
  231. package/dist/cjs/walletskills.webp +0 -0
  232. package/dist/esm/AchievementCard-b9eb551c.js +0 -61
  233. package/dist/esm/AchievementCard-b9eb551c.js.map +0 -1
  234. package/dist/esm/ArrowArcLeft.svg +0 -4
  235. package/dist/esm/ArrowArcRight.svg +0 -4
  236. package/dist/esm/AwardRibbon-3e682281.js +0 -27
  237. package/dist/esm/AwardRibbon-3e682281.js.map +0 -1
  238. package/dist/esm/BoostGenericCard-9c14e541.js +0 -71
  239. package/dist/esm/BoostGenericCard-9c14e541.js.map +0 -1
  240. package/dist/esm/BoostSmallCard-e42ec5ed.js +0 -108
  241. package/dist/esm/BoostSmallCard-e42ec5ed.js.map +0 -1
  242. package/dist/esm/Button-5f805204.js +0 -12
  243. package/dist/esm/Button-5f805204.js.map +0 -1
  244. package/dist/esm/CaretRightFilled.svg +0 -3
  245. package/dist/esm/Checkmark-d8b8f43d.js +0 -52
  246. package/dist/esm/Checkmark-d8b8f43d.js.map +0 -1
  247. package/dist/esm/CircleCheckButton-551054f6.js +0 -24
  248. package/dist/esm/CircleCheckButton-551054f6.js.map +0 -1
  249. package/dist/esm/CircleIcon-38b874e2.js +0 -1076
  250. package/dist/esm/CircleIcon-38b874e2.js.map +0 -1
  251. package/dist/esm/CircleSpinner-9b8b1a6b.js +0 -42
  252. package/dist/esm/CircleSpinner-9b8b1a6b.js.map +0 -1
  253. package/dist/esm/CourseCard-663ff174.js +0 -82
  254. package/dist/esm/CourseCard-663ff174.js.map +0 -1
  255. package/dist/esm/CourseVerticalCard-922a0860.js +0 -88
  256. package/dist/esm/CourseVerticalCard-922a0860.js.map +0 -1
  257. package/dist/esm/FlippyCard-a2de5cf1.js +0 -28
  258. package/dist/esm/FlippyCard-a2de5cf1.js.map +0 -1
  259. package/dist/esm/GenericArrow-0dba1707.js +0 -21
  260. package/dist/esm/GenericArrow-0dba1707.js.map +0 -1
  261. package/dist/esm/GenericCard-eaab7759.js +0 -55
  262. package/dist/esm/GenericCard-eaab7759.js.map +0 -1
  263. package/dist/esm/GreenCheckCircle.svg +0 -4
  264. package/dist/esm/JobHistoryCard-80d4ef27.js +0 -37
  265. package/dist/esm/JobHistoryCard-80d4ef27.js.map +0 -1
  266. package/dist/esm/JobListCard-5e3879ea.js +0 -120
  267. package/dist/esm/JobListCard-5e3879ea.js.map +0 -1
  268. package/dist/esm/LearnCardCreditCardBackFace-9baa9e6b.js +0 -65
  269. package/dist/esm/LearnCardCreditCardBackFace-9baa9e6b.js.map +0 -1
  270. package/dist/esm/LearnCardCreditCardFrontFace-cf793917.js +0 -70
  271. package/dist/esm/LearnCardCreditCardFrontFace-cf793917.js.map +0 -1
  272. package/dist/esm/LearnPill-3d9564d4.js +0 -34
  273. package/dist/esm/LearnPill-3d9564d4.js.map +0 -1
  274. package/dist/esm/Lightbulb-a3c1679f.js +0 -16
  275. package/dist/esm/Lightbulb-a3c1679f.js.map +0 -1
  276. package/dist/esm/MiniVCThumbnail-6a07e810.js +0 -62
  277. package/dist/esm/MiniVCThumbnail-6a07e810.js.map +0 -1
  278. package/dist/esm/Notification-0f58ef6a.js +0 -88
  279. package/dist/esm/Notification-0f58ef6a.js.map +0 -1
  280. package/dist/esm/NotificationBoostCard-134edf94.js +0 -112
  281. package/dist/esm/NotificationBoostCard-134edf94.js.map +0 -1
  282. package/dist/esm/NotificationUserAcceptedBoostCard-8c13bd3f.js +0 -66
  283. package/dist/esm/NotificationUserAcceptedBoostCard-8c13bd3f.js.map +0 -1
  284. package/dist/esm/NotificationUserCard-dbcc80f9.js +0 -86
  285. package/dist/esm/NotificationUserCard-dbcc80f9.js.map +0 -1
  286. package/dist/esm/QRCodeCard-c57e2067.js +0 -36
  287. package/dist/esm/QRCodeCard-c57e2067.js.map +0 -1
  288. package/dist/esm/RedXCircle.svg +0 -5
  289. package/dist/esm/RoundedPill-731211b3.js +0 -99
  290. package/dist/esm/RoundedPill-731211b3.js.map +0 -1
  291. package/dist/esm/SchoolIDCard-3b746226.js +0 -4722
  292. package/dist/esm/SchoolIDCard-3b746226.js.map +0 -1
  293. package/dist/esm/SkillTabCard-d86c6452.js +0 -36
  294. package/dist/esm/SkillTabCard-d86c6452.js.map +0 -1
  295. package/dist/esm/SkillVerticalCard-108f49bb.js +0 -28
  296. package/dist/esm/SkillVerticalCard-108f49bb.js.map +0 -1
  297. package/dist/esm/SkillsCard-92a51db2.js +0 -59
  298. package/dist/esm/SkillsCard-92a51db2.js.map +0 -1
  299. package/dist/esm/SkillsStatsCard-1628fe9c.js +0 -70
  300. package/dist/esm/SkillsStatsCard-1628fe9c.js.map +0 -1
  301. package/dist/esm/SmallAchievementCard-2d87ac82.js +0 -37
  302. package/dist/esm/SmallAchievementCard-2d87ac82.js.map +0 -1
  303. package/dist/esm/Trophy-702610b8.js +0 -19
  304. package/dist/esm/Trophy-702610b8.js.map +0 -1
  305. package/dist/esm/User-fd276ad5.js +0 -82
  306. package/dist/esm/User-fd276ad5.js.map +0 -1
  307. package/dist/esm/VCCard-ef720e3a.js +0 -73
  308. package/dist/esm/VCCard-ef720e3a.js.map +0 -1
  309. package/dist/esm/VCDisplayBackFace-927c7c9e.js +0 -80
  310. package/dist/esm/VCDisplayBackFace-927c7c9e.js.map +0 -1
  311. package/dist/esm/VCDisplayCard-aea6b2e1.js +0 -183
  312. package/dist/esm/VCDisplayCard-aea6b2e1.js.map +0 -1
  313. package/dist/esm/VCDisplayCard2-04aa53e0.js +0 -998
  314. package/dist/esm/VCDisplayCard2-04aa53e0.js.map +0 -1
  315. package/dist/esm/VCThumbnail-3c254bda.js +0 -135
  316. package/dist/esm/VCThumbnail-3c254bda.js.map +0 -1
  317. package/dist/esm/VCVerificationCheck-80249524.js +0 -72
  318. package/dist/esm/VCVerificationCheck-80249524.js.map +0 -1
  319. package/dist/esm/VCVerificationPill-2c7fa3de.js +0 -65
  320. package/dist/esm/VCVerificationPill-2c7fa3de.js.map +0 -1
  321. package/dist/esm/X.svg +0 -4
  322. package/dist/esm/YellowWarningCircle.svg +0 -4
  323. package/dist/esm/addawardlight.svg +0 -8
  324. package/dist/esm/award.svg +0 -3
  325. package/dist/esm/badge.png +0 -0
  326. package/dist/esm/briefcase.svg +0 -6
  327. package/dist/esm/card-chip.svg +0 -26
  328. package/dist/esm/coins.svg +0 -3
  329. package/dist/esm/constants-db0e356b.js +0 -89
  330. package/dist/esm/constants-db0e356b.js.map +0 -1
  331. package/dist/esm/contactless-symbol.svg +0 -3
  332. package/dist/esm/credential.helpers-d440380c.js +0 -2182
  333. package/dist/esm/credential.helpers-d440380c.js.map +0 -1
  334. package/dist/esm/default-face.jpeg +0 -0
  335. package/dist/esm/gradcaplight.svg +0 -3
  336. package/dist/esm/graduation.svg +0 -3
  337. package/dist/esm/icon.green.fat-arrow.png +0 -0
  338. package/dist/esm/icons-9d160530.js +0 -32
  339. package/dist/esm/icons-9d160530.js.map +0 -1
  340. package/dist/esm/index-7103ad3c.js +0 -46
  341. package/dist/esm/index-7103ad3c.js.map +0 -1
  342. package/dist/esm/index-7dcfe90e.js +0 -56
  343. package/dist/esm/index-7dcfe90e.js.map +0 -1
  344. package/dist/esm/index-aa1098e1.js +0 -768
  345. package/dist/esm/index-aa1098e1.js.map +0 -1
  346. package/dist/esm/index-e1f279c6.js +0 -3529
  347. package/dist/esm/index-e1f279c6.js.map +0 -1
  348. package/dist/esm/index.js +0 -96
  349. package/dist/esm/index.js.map +0 -1
  350. package/dist/esm/index10.js +0 -3
  351. package/dist/esm/index10.js.map +0 -1
  352. package/dist/esm/index11.js +0 -28
  353. package/dist/esm/index11.js.map +0 -1
  354. package/dist/esm/index12.js +0 -96
  355. package/dist/esm/index12.js.map +0 -1
  356. package/dist/esm/index13.js +0 -4
  357. package/dist/esm/index13.js.map +0 -1
  358. package/dist/esm/index14.js +0 -15
  359. package/dist/esm/index14.js.map +0 -1
  360. package/dist/esm/index15.js +0 -4
  361. package/dist/esm/index15.js.map +0 -1
  362. package/dist/esm/index16.js +0 -6
  363. package/dist/esm/index16.js.map +0 -1
  364. package/dist/esm/index17.js +0 -15
  365. package/dist/esm/index17.js.map +0 -1
  366. package/dist/esm/index18.js +0 -3
  367. package/dist/esm/index18.js.map +0 -1
  368. package/dist/esm/index19.js +0 -4
  369. package/dist/esm/index19.js.map +0 -1
  370. package/dist/esm/index2.js +0 -29
  371. package/dist/esm/index2.js.map +0 -1
  372. package/dist/esm/index20.js +0 -8
  373. package/dist/esm/index20.js.map +0 -1
  374. package/dist/esm/index21.js +0 -11
  375. package/dist/esm/index21.js.map +0 -1
  376. package/dist/esm/index22.js +0 -7
  377. package/dist/esm/index22.js.map +0 -1
  378. package/dist/esm/index23.js +0 -8
  379. package/dist/esm/index23.js.map +0 -1
  380. package/dist/esm/index24.js +0 -4
  381. package/dist/esm/index24.js.map +0 -1
  382. package/dist/esm/index25.js +0 -15
  383. package/dist/esm/index25.js.map +0 -1
  384. package/dist/esm/index26.js +0 -28
  385. package/dist/esm/index26.js.map +0 -1
  386. package/dist/esm/index27.js +0 -3
  387. package/dist/esm/index27.js.map +0 -1
  388. package/dist/esm/index28.js +0 -3
  389. package/dist/esm/index28.js.map +0 -1
  390. package/dist/esm/index29.js +0 -4
  391. package/dist/esm/index29.js.map +0 -1
  392. package/dist/esm/index3.js +0 -28
  393. package/dist/esm/index3.js.map +0 -1
  394. package/dist/esm/index30.js +0 -17
  395. package/dist/esm/index30.js.map +0 -1
  396. package/dist/esm/index31.js +0 -4
  397. package/dist/esm/index31.js.map +0 -1
  398. package/dist/esm/index32.js +0 -4
  399. package/dist/esm/index32.js.map +0 -1
  400. package/dist/esm/index33.js +0 -8
  401. package/dist/esm/index33.js.map +0 -1
  402. package/dist/esm/index34.js +0 -23
  403. package/dist/esm/index34.js.map +0 -1
  404. package/dist/esm/index35.js +0 -14
  405. package/dist/esm/index35.js.map +0 -1
  406. package/dist/esm/index36.js +0 -18
  407. package/dist/esm/index36.js.map +0 -1
  408. package/dist/esm/index37.js +0 -12
  409. package/dist/esm/index37.js.map +0 -1
  410. package/dist/esm/index38.js +0 -7
  411. package/dist/esm/index38.js.map +0 -1
  412. package/dist/esm/index39.js +0 -5
  413. package/dist/esm/index39.js.map +0 -1
  414. package/dist/esm/index4.js +0 -31
  415. package/dist/esm/index4.js.map +0 -1
  416. package/dist/esm/index40.js +0 -5
  417. package/dist/esm/index40.js.map +0 -1
  418. package/dist/esm/index41.js +0 -7
  419. package/dist/esm/index41.js.map +0 -1
  420. package/dist/esm/index5.js +0 -3
  421. package/dist/esm/index5.js.map +0 -1
  422. package/dist/esm/index6.js +0 -16
  423. package/dist/esm/index6.js.map +0 -1
  424. package/dist/esm/index7.js +0 -15
  425. package/dist/esm/index7.js.map +0 -1
  426. package/dist/esm/index8.js +0 -7
  427. package/dist/esm/index8.js.map +0 -1
  428. package/dist/esm/index9.js +0 -19
  429. package/dist/esm/index9.js.map +0 -1
  430. package/dist/esm/lhplaceholder.png +0 -0
  431. package/dist/esm/lightbulb.svg +0 -3
  432. package/dist/esm/master-card-logo.svg +0 -20
  433. package/dist/esm/minigradcapcolored.svg +0 -3
  434. package/dist/esm/minijob.svg +0 -5
  435. package/dist/esm/minipuzzle.svg +0 -3
  436. package/dist/esm/minipuzzlecolored.svg +0 -3
  437. package/dist/esm/minitrophy.svg +0 -3
  438. package/dist/esm/minitrophycolored.svg +0 -3
  439. package/dist/esm/notifications-009bbd80.js +0 -18
  440. package/dist/esm/notifications-009bbd80.js.map +0 -1
  441. package/dist/esm/skillgraph.svg +0 -29
  442. package/dist/esm/skillplaceholder.png +0 -0
  443. package/dist/esm/social-badge.png +0 -0
  444. package/dist/esm/trophy.svg +0 -3
  445. package/dist/esm/types-7081a9e5.js +0 -109
  446. package/dist/esm/types-7081a9e5.js.map +0 -1
  447. package/dist/esm/types-b32d28d5.js +0 -23
  448. package/dist/esm/types-b32d28d5.js.map +0 -1
  449. package/dist/esm/types.esm-ee6b190e.js +0 -4078
  450. package/dist/esm/types.esm-ee6b190e.js.map +0 -1
  451. package/dist/esm/user.svg +0 -4
  452. package/dist/esm/vc.check.svg +0 -10
  453. package/dist/esm/verified-check.png +0 -0
  454. package/dist/esm/walletTrophy.webp +0 -0
  455. package/dist/esm/walletcurrency.webp +0 -0
  456. package/dist/esm/walletids.webp +0 -0
  457. package/dist/esm/walletjobhistory.webp +0 -0
  458. package/dist/esm/walletlearninghistory.webp +0 -0
  459. package/dist/esm/walletskills.webp +0 -0
  460. package/dist/index.d.ts +0 -856
  461. package/dist/main.css +0 -1
  462. package/dist/main.js +0 -3
@@ -1,4722 +0,0 @@
1
- import React from 'react';
2
-
3
- var barcodes = {};
4
-
5
- var CODE39$1 = {};
6
-
7
- var Barcode$2 = {};
8
-
9
- Object.defineProperty(Barcode$2, "__esModule", {
10
- value: true
11
- });
12
-
13
- function _classCallCheck$t(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
14
-
15
- var Barcode$1 = function Barcode(data, options) {
16
- _classCallCheck$t(this, Barcode);
17
-
18
- this.data = data;
19
- this.text = options.text || data;
20
- this.options = options;
21
- };
22
-
23
- Barcode$2.default = Barcode$1;
24
-
25
- Object.defineProperty(CODE39$1, "__esModule", {
26
- value: true
27
- });
28
- CODE39$1.CODE39 = undefined;
29
-
30
- var _createClass$m = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
31
-
32
- var _Barcode2$b = Barcode$2;
33
-
34
- var _Barcode3$b = _interopRequireDefault$y(_Barcode2$b);
35
-
36
- function _interopRequireDefault$y(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37
-
38
- function _classCallCheck$s(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
39
-
40
- function _possibleConstructorReturn$o(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
41
-
42
- function _inherits$o(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
43
- // https://en.wikipedia.org/wiki/Code_39#Encoding
44
-
45
- var CODE39 = function (_Barcode) {
46
- _inherits$o(CODE39, _Barcode);
47
-
48
- function CODE39(data, options) {
49
- _classCallCheck$s(this, CODE39);
50
-
51
- data = data.toUpperCase();
52
-
53
- // Calculate mod43 checksum if enabled
54
- if (options.mod43) {
55
- data += getCharacter(mod43checksum(data));
56
- }
57
-
58
- return _possibleConstructorReturn$o(this, (CODE39.__proto__ || Object.getPrototypeOf(CODE39)).call(this, data, options));
59
- }
60
-
61
- _createClass$m(CODE39, [{
62
- key: "encode",
63
- value: function encode() {
64
- // First character is always a *
65
- var result = getEncoding("*");
66
-
67
- // Take every character and add the binary representation to the result
68
- for (var i = 0; i < this.data.length; i++) {
69
- result += getEncoding(this.data[i]) + "0";
70
- }
71
-
72
- // Last character is always a *
73
- result += getEncoding("*");
74
-
75
- return {
76
- data: result,
77
- text: this.text
78
- };
79
- }
80
- }, {
81
- key: "valid",
82
- value: function valid() {
83
- return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1;
84
- }
85
- }]);
86
-
87
- return CODE39;
88
- }(_Barcode3$b.default);
89
-
90
- // All characters. The position in the array is the (checksum) value
91
-
92
-
93
- var characters = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "-", ".", " ", "$", "/", "+", "%", "*"];
94
-
95
- // The decimal representation of the characters, is converted to the
96
- // corresponding binary with the getEncoding function
97
- var encodings = [20957, 29783, 23639, 30485, 20951, 29813, 23669, 20855, 29789, 23645, 29975, 23831, 30533, 22295, 30149, 24005, 21623, 29981, 23837, 22301, 30023, 23879, 30545, 22343, 30161, 24017, 21959, 30065, 23921, 22385, 29015, 18263, 29141, 17879, 29045, 18293, 17783, 29021, 18269, 17477, 17489, 17681, 20753, 35770];
98
-
99
- // Get the binary representation of a character by converting the encodings
100
- // from decimal to binary
101
- function getEncoding(character) {
102
- return getBinary(characterValue(character));
103
- }
104
-
105
- function getBinary(characterValue) {
106
- return encodings[characterValue].toString(2);
107
- }
108
-
109
- function getCharacter(characterValue) {
110
- return characters[characterValue];
111
- }
112
-
113
- function characterValue(character) {
114
- return characters.indexOf(character);
115
- }
116
-
117
- function mod43checksum(data) {
118
- var checksum = 0;
119
- for (var i = 0; i < data.length; i++) {
120
- checksum += characterValue(data[i]);
121
- }
122
-
123
- checksum = checksum % 43;
124
- return checksum;
125
- }
126
-
127
- CODE39$1.CODE39 = CODE39;
128
-
129
- var CODE128$2 = {};
130
-
131
- var CODE128_AUTO = {};
132
-
133
- var CODE128$1 = {};
134
-
135
- var constants$2 = {};
136
-
137
- Object.defineProperty(constants$2, "__esModule", {
138
- value: true
139
- });
140
-
141
- var _SET_BY_CODE;
142
-
143
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
144
-
145
- // constants for internal usage
146
- var SET_A = constants$2.SET_A = 0;
147
- var SET_B = constants$2.SET_B = 1;
148
- var SET_C = constants$2.SET_C = 2;
149
-
150
- // Special characters
151
- constants$2.SHIFT = 98;
152
- var START_A = constants$2.START_A = 103;
153
- var START_B = constants$2.START_B = 104;
154
- var START_C = constants$2.START_C = 105;
155
- constants$2.MODULO = 103;
156
- constants$2.STOP = 106;
157
- constants$2.FNC1 = 207;
158
-
159
- // Get set by start code
160
- constants$2.SET_BY_CODE = (_SET_BY_CODE = {}, _defineProperty(_SET_BY_CODE, START_A, SET_A), _defineProperty(_SET_BY_CODE, START_B, SET_B), _defineProperty(_SET_BY_CODE, START_C, SET_C), _SET_BY_CODE);
161
-
162
- // Get next set by code
163
- constants$2.SWAP = {
164
- 101: SET_A,
165
- 100: SET_B,
166
- 99: SET_C
167
- };
168
-
169
- constants$2.A_START_CHAR = String.fromCharCode(208); // START_A + 105
170
- constants$2.B_START_CHAR = String.fromCharCode(209); // START_B + 105
171
- constants$2.C_START_CHAR = String.fromCharCode(210); // START_C + 105
172
-
173
- // 128A (Code Set A)
174
- // ASCII characters 00 to 95 (0–9, A–Z and control codes), special characters, and FNC 1–4
175
- constants$2.A_CHARS = "[\x00-\x5F\xC8-\xCF]";
176
-
177
- // 128B (Code Set B)
178
- // ASCII characters 32 to 127 (0–9, A–Z, a–z), special characters, and FNC 1–4
179
- constants$2.B_CHARS = "[\x20-\x7F\xC8-\xCF]";
180
-
181
- // 128C (Code Set C)
182
- // 00–99 (encodes two digits with a single code point) and FNC1
183
- constants$2.C_CHARS = "(\xCF*[0-9]{2}\xCF*)";
184
-
185
- // CODE128 includes 107 symbols:
186
- // 103 data symbols, 3 start symbols (A, B and C), and 1 stop symbol (the last one)
187
- // Each symbol consist of three black bars (1) and three white spaces (0).
188
- constants$2.BARS = [11011001100, 11001101100, 11001100110, 10010011000, 10010001100, 10001001100, 10011001000, 10011000100, 10001100100, 11001001000, 11001000100, 11000100100, 10110011100, 10011011100, 10011001110, 10111001100, 10011101100, 10011100110, 11001110010, 11001011100, 11001001110, 11011100100, 11001110100, 11101101110, 11101001100, 11100101100, 11100100110, 11101100100, 11100110100, 11100110010, 11011011000, 11011000110, 11000110110, 10100011000, 10001011000, 10001000110, 10110001000, 10001101000, 10001100010, 11010001000, 11000101000, 11000100010, 10110111000, 10110001110, 10001101110, 10111011000, 10111000110, 10001110110, 11101110110, 11010001110, 11000101110, 11011101000, 11011100010, 11011101110, 11101011000, 11101000110, 11100010110, 11101101000, 11101100010, 11100011010, 11101111010, 11001000010, 11110001010, 10100110000, 10100001100, 10010110000, 10010000110, 10000101100, 10000100110, 10110010000, 10110000100, 10011010000, 10011000010, 10000110100, 10000110010, 11000010010, 11001010000, 11110111010, 11000010100, 10001111010, 10100111100, 10010111100, 10010011110, 10111100100, 10011110100, 10011110010, 11110100100, 11110010100, 11110010010, 11011011110, 11011110110, 11110110110, 10101111000, 10100011110, 10001011110, 10111101000, 10111100010, 11110101000, 11110100010, 10111011110, 10111101110, 11101011110, 11110101110, 11010000100, 11010010000, 11010011100, 1100011101011];
189
-
190
- Object.defineProperty(CODE128$1, "__esModule", {
191
- value: true
192
- });
193
-
194
- var _createClass$l = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
195
-
196
- var _Barcode2$a = Barcode$2;
197
-
198
- var _Barcode3$a = _interopRequireDefault$x(_Barcode2$a);
199
-
200
- var _constants$a = constants$2;
201
-
202
- function _interopRequireDefault$x(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
203
-
204
- function _classCallCheck$r(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
205
-
206
- function _possibleConstructorReturn$n(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
207
-
208
- function _inherits$n(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
209
-
210
- // This is the master class,
211
- // it does require the start code to be included in the string
212
- var CODE128 = function (_Barcode) {
213
- _inherits$n(CODE128, _Barcode);
214
-
215
- function CODE128(data, options) {
216
- _classCallCheck$r(this, CODE128);
217
-
218
- // Get array of ascii codes from data
219
- var _this = _possibleConstructorReturn$n(this, (CODE128.__proto__ || Object.getPrototypeOf(CODE128)).call(this, data.substring(1), options));
220
-
221
- _this.bytes = data.split('').map(function (char) {
222
- return char.charCodeAt(0);
223
- });
224
- return _this;
225
- }
226
-
227
- _createClass$l(CODE128, [{
228
- key: 'valid',
229
- value: function valid() {
230
- // ASCII value ranges 0-127, 200-211
231
- return (/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)
232
- );
233
- }
234
-
235
- // The public encoding function
236
-
237
- }, {
238
- key: 'encode',
239
- value: function encode() {
240
- var bytes = this.bytes;
241
- // Remove the start code from the bytes and set its index
242
- var startIndex = bytes.shift() - 105;
243
- // Get start set by index
244
- var startSet = _constants$a.SET_BY_CODE[startIndex];
245
-
246
- if (startSet === undefined) {
247
- throw new RangeError('The encoding does not start with a start character.');
248
- }
249
-
250
- if (this.shouldEncodeAsEan128() === true) {
251
- bytes.unshift(_constants$a.FNC1);
252
- }
253
-
254
- // Start encode with the right type
255
- var encodingResult = CODE128.next(bytes, 1, startSet);
256
-
257
- return {
258
- text: this.text === this.data ? this.text.replace(/[^\x20-\x7E]/g, '') : this.text,
259
- data:
260
- // Add the start bits
261
- CODE128.getBar(startIndex) +
262
- // Add the encoded bits
263
- encodingResult.result +
264
- // Add the checksum
265
- CODE128.getBar((encodingResult.checksum + startIndex) % _constants$a.MODULO) +
266
- // Add the end bits
267
- CODE128.getBar(_constants$a.STOP)
268
- };
269
- }
270
-
271
- // GS1-128/EAN-128
272
-
273
- }, {
274
- key: 'shouldEncodeAsEan128',
275
- value: function shouldEncodeAsEan128() {
276
- var isEAN128 = this.options.ean128 || false;
277
- if (typeof isEAN128 === 'string') {
278
- isEAN128 = isEAN128.toLowerCase() === 'true';
279
- }
280
- return isEAN128;
281
- }
282
-
283
- // Get a bar symbol by index
284
-
285
- }], [{
286
- key: 'getBar',
287
- value: function getBar(index) {
288
- return _constants$a.BARS[index] ? _constants$a.BARS[index].toString() : '';
289
- }
290
-
291
- // Correct an index by a set and shift it from the bytes array
292
-
293
- }, {
294
- key: 'correctIndex',
295
- value: function correctIndex(bytes, set) {
296
- if (set === _constants$a.SET_A) {
297
- var charCode = bytes.shift();
298
- return charCode < 32 ? charCode + 64 : charCode - 32;
299
- } else if (set === _constants$a.SET_B) {
300
- return bytes.shift() - 32;
301
- } else {
302
- return (bytes.shift() - 48) * 10 + bytes.shift() - 48;
303
- }
304
- }
305
- }, {
306
- key: 'next',
307
- value: function next(bytes, pos, set) {
308
- if (!bytes.length) {
309
- return { result: '', checksum: 0 };
310
- }
311
-
312
- var nextCode = void 0,
313
- index = void 0;
314
-
315
- // Special characters
316
- if (bytes[0] >= 200) {
317
- index = bytes.shift() - 105;
318
- var nextSet = _constants$a.SWAP[index];
319
-
320
- // Swap to other set
321
- if (nextSet !== undefined) {
322
- nextCode = CODE128.next(bytes, pos + 1, nextSet);
323
- }
324
- // Continue on current set but encode a special character
325
- else {
326
- // Shift
327
- if ((set === _constants$a.SET_A || set === _constants$a.SET_B) && index === _constants$a.SHIFT) {
328
- // Convert the next character so that is encoded correctly
329
- bytes[0] = set === _constants$a.SET_A ? bytes[0] > 95 ? bytes[0] - 96 : bytes[0] : bytes[0] < 32 ? bytes[0] + 96 : bytes[0];
330
- }
331
- nextCode = CODE128.next(bytes, pos + 1, set);
332
- }
333
- }
334
- // Continue encoding
335
- else {
336
- index = CODE128.correctIndex(bytes, set);
337
- nextCode = CODE128.next(bytes, pos + 1, set);
338
- }
339
-
340
- // Get the correct binary encoding and calculate the weight
341
- var enc = CODE128.getBar(index);
342
- var weight = index * pos;
343
-
344
- return {
345
- result: enc + nextCode.result,
346
- checksum: weight + nextCode.checksum
347
- };
348
- }
349
- }]);
350
-
351
- return CODE128;
352
- }(_Barcode3$a.default);
353
-
354
- CODE128$1.default = CODE128;
355
-
356
- var auto = {};
357
-
358
- Object.defineProperty(auto, "__esModule", {
359
- value: true
360
- });
361
-
362
- var _constants$9 = constants$2;
363
-
364
- // Match Set functions
365
- var matchSetALength = function matchSetALength(string) {
366
- return string.match(new RegExp('^' + _constants$9.A_CHARS + '*'))[0].length;
367
- };
368
- var matchSetBLength = function matchSetBLength(string) {
369
- return string.match(new RegExp('^' + _constants$9.B_CHARS + '*'))[0].length;
370
- };
371
- var matchSetC = function matchSetC(string) {
372
- return string.match(new RegExp('^' + _constants$9.C_CHARS + '*'))[0];
373
- };
374
-
375
- // CODE128A or CODE128B
376
- function autoSelectFromAB(string, isA) {
377
- var ranges = isA ? _constants$9.A_CHARS : _constants$9.B_CHARS;
378
- var untilC = string.match(new RegExp('^(' + ranges + '+?)(([0-9]{2}){2,})([^0-9]|$)'));
379
-
380
- if (untilC) {
381
- return untilC[1] + String.fromCharCode(204) + autoSelectFromC(string.substring(untilC[1].length));
382
- }
383
-
384
- var chars = string.match(new RegExp('^' + ranges + '+'))[0];
385
-
386
- if (chars.length === string.length) {
387
- return string;
388
- }
389
-
390
- return chars + String.fromCharCode(isA ? 205 : 206) + autoSelectFromAB(string.substring(chars.length), !isA);
391
- }
392
-
393
- // CODE128C
394
- function autoSelectFromC(string) {
395
- var cMatch = matchSetC(string);
396
- var length = cMatch.length;
397
-
398
- if (length === string.length) {
399
- return string;
400
- }
401
-
402
- string = string.substring(length);
403
-
404
- // Select A/B depending on the longest match
405
- var isA = matchSetALength(string) >= matchSetBLength(string);
406
- return cMatch + String.fromCharCode(isA ? 206 : 205) + autoSelectFromAB(string, isA);
407
- }
408
-
409
- // Detect Code Set (A, B or C) and format the string
410
-
411
- auto.default = function (string) {
412
- var newString = void 0;
413
- var cLength = matchSetC(string).length;
414
-
415
- // Select 128C if the string start with enough digits
416
- if (cLength >= 2) {
417
- newString = _constants$9.C_START_CHAR + autoSelectFromC(string);
418
- } else {
419
- // Select A/B depending on the longest match
420
- var isA = matchSetALength(string) > matchSetBLength(string);
421
- newString = (isA ? _constants$9.A_START_CHAR : _constants$9.B_START_CHAR) + autoSelectFromAB(string, isA);
422
- }
423
-
424
- return newString.replace(/[\xCD\xCE]([^])[\xCD\xCE]/, // Any sequence between 205 and 206 characters
425
- function (match, char) {
426
- return String.fromCharCode(203) + char;
427
- });
428
- };
429
-
430
- Object.defineProperty(CODE128_AUTO, "__esModule", {
431
- value: true
432
- });
433
-
434
- var _CODE2$4 = CODE128$1;
435
-
436
- var _CODE3$3 = _interopRequireDefault$w(_CODE2$4);
437
-
438
- var _auto = auto;
439
-
440
- var _auto2 = _interopRequireDefault$w(_auto);
441
-
442
- function _interopRequireDefault$w(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
443
-
444
- function _classCallCheck$q(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
445
-
446
- function _possibleConstructorReturn$m(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
447
-
448
- function _inherits$m(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
449
-
450
- var CODE128AUTO = function (_CODE) {
451
- _inherits$m(CODE128AUTO, _CODE);
452
-
453
- function CODE128AUTO(data, options) {
454
- _classCallCheck$q(this, CODE128AUTO);
455
-
456
- // ASCII value ranges 0-127, 200-211
457
- if (/^[\x00-\x7F\xC8-\xD3]+$/.test(data)) {
458
- var _this = _possibleConstructorReturn$m(this, (CODE128AUTO.__proto__ || Object.getPrototypeOf(CODE128AUTO)).call(this, (0, _auto2.default)(data), options));
459
- } else {
460
- var _this = _possibleConstructorReturn$m(this, (CODE128AUTO.__proto__ || Object.getPrototypeOf(CODE128AUTO)).call(this, data, options));
461
- }
462
- return _possibleConstructorReturn$m(_this);
463
- }
464
-
465
- return CODE128AUTO;
466
- }(_CODE3$3.default);
467
-
468
- CODE128_AUTO.default = CODE128AUTO;
469
-
470
- var CODE128A$1 = {};
471
-
472
- Object.defineProperty(CODE128A$1, "__esModule", {
473
- value: true
474
- });
475
-
476
- var _createClass$k = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
477
-
478
- var _CODE2$3 = CODE128$1;
479
-
480
- var _CODE3$2 = _interopRequireDefault$v(_CODE2$3);
481
-
482
- var _constants$8 = constants$2;
483
-
484
- function _interopRequireDefault$v(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
485
-
486
- function _classCallCheck$p(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
487
-
488
- function _possibleConstructorReturn$l(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
489
-
490
- function _inherits$l(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
491
-
492
- var CODE128A = function (_CODE) {
493
- _inherits$l(CODE128A, _CODE);
494
-
495
- function CODE128A(string, options) {
496
- _classCallCheck$p(this, CODE128A);
497
-
498
- return _possibleConstructorReturn$l(this, (CODE128A.__proto__ || Object.getPrototypeOf(CODE128A)).call(this, _constants$8.A_START_CHAR + string, options));
499
- }
500
-
501
- _createClass$k(CODE128A, [{
502
- key: 'valid',
503
- value: function valid() {
504
- return new RegExp('^' + _constants$8.A_CHARS + '+$').test(this.data);
505
- }
506
- }]);
507
-
508
- return CODE128A;
509
- }(_CODE3$2.default);
510
-
511
- CODE128A$1.default = CODE128A;
512
-
513
- var CODE128B$1 = {};
514
-
515
- Object.defineProperty(CODE128B$1, "__esModule", {
516
- value: true
517
- });
518
-
519
- var _createClass$j = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
520
-
521
- var _CODE2$2 = CODE128$1;
522
-
523
- var _CODE3$1 = _interopRequireDefault$u(_CODE2$2);
524
-
525
- var _constants$7 = constants$2;
526
-
527
- function _interopRequireDefault$u(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
528
-
529
- function _classCallCheck$o(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
530
-
531
- function _possibleConstructorReturn$k(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
532
-
533
- function _inherits$k(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
534
-
535
- var CODE128B = function (_CODE) {
536
- _inherits$k(CODE128B, _CODE);
537
-
538
- function CODE128B(string, options) {
539
- _classCallCheck$o(this, CODE128B);
540
-
541
- return _possibleConstructorReturn$k(this, (CODE128B.__proto__ || Object.getPrototypeOf(CODE128B)).call(this, _constants$7.B_START_CHAR + string, options));
542
- }
543
-
544
- _createClass$j(CODE128B, [{
545
- key: 'valid',
546
- value: function valid() {
547
- return new RegExp('^' + _constants$7.B_CHARS + '+$').test(this.data);
548
- }
549
- }]);
550
-
551
- return CODE128B;
552
- }(_CODE3$1.default);
553
-
554
- CODE128B$1.default = CODE128B;
555
-
556
- var CODE128C$1 = {};
557
-
558
- Object.defineProperty(CODE128C$1, "__esModule", {
559
- value: true
560
- });
561
-
562
- var _createClass$i = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
563
-
564
- var _CODE2$1 = CODE128$1;
565
-
566
- var _CODE3 = _interopRequireDefault$t(_CODE2$1);
567
-
568
- var _constants$6 = constants$2;
569
-
570
- function _interopRequireDefault$t(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
571
-
572
- function _classCallCheck$n(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
573
-
574
- function _possibleConstructorReturn$j(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
575
-
576
- function _inherits$j(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
577
-
578
- var CODE128C = function (_CODE) {
579
- _inherits$j(CODE128C, _CODE);
580
-
581
- function CODE128C(string, options) {
582
- _classCallCheck$n(this, CODE128C);
583
-
584
- return _possibleConstructorReturn$j(this, (CODE128C.__proto__ || Object.getPrototypeOf(CODE128C)).call(this, _constants$6.C_START_CHAR + string, options));
585
- }
586
-
587
- _createClass$i(CODE128C, [{
588
- key: 'valid',
589
- value: function valid() {
590
- return new RegExp('^' + _constants$6.C_CHARS + '+$').test(this.data);
591
- }
592
- }]);
593
-
594
- return CODE128C;
595
- }(_CODE3.default);
596
-
597
- CODE128C$1.default = CODE128C;
598
-
599
- Object.defineProperty(CODE128$2, "__esModule", {
600
- value: true
601
- });
602
- CODE128$2.CODE128C = CODE128$2.CODE128B = CODE128$2.CODE128A = CODE128$2.CODE128 = undefined;
603
-
604
- var _CODE128_AUTO = CODE128_AUTO;
605
-
606
- var _CODE128_AUTO2 = _interopRequireDefault$s(_CODE128_AUTO);
607
-
608
- var _CODE128A = CODE128A$1;
609
-
610
- var _CODE128A2 = _interopRequireDefault$s(_CODE128A);
611
-
612
- var _CODE128B = CODE128B$1;
613
-
614
- var _CODE128B2 = _interopRequireDefault$s(_CODE128B);
615
-
616
- var _CODE128C = CODE128C$1;
617
-
618
- var _CODE128C2 = _interopRequireDefault$s(_CODE128C);
619
-
620
- function _interopRequireDefault$s(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
621
-
622
- CODE128$2.CODE128 = _CODE128_AUTO2.default;
623
- CODE128$2.CODE128A = _CODE128A2.default;
624
- CODE128$2.CODE128B = _CODE128B2.default;
625
- CODE128$2.CODE128C = _CODE128C2.default;
626
-
627
- var EAN_UPC = {};
628
-
629
- var EAN13$1 = {};
630
-
631
- var constants$1 = {};
632
-
633
- Object.defineProperty(constants$1, "__esModule", {
634
- value: true
635
- });
636
- // Standard start end and middle bits
637
- constants$1.SIDE_BIN = '101';
638
- constants$1.MIDDLE_BIN = '01010';
639
-
640
- constants$1.BINARIES = {
641
- 'L': [// The L (left) type of encoding
642
- '0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011'],
643
- 'G': [// The G type of encoding
644
- '0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111'],
645
- 'R': [// The R (right) type of encoding
646
- '1110010', '1100110', '1101100', '1000010', '1011100', '1001110', '1010000', '1000100', '1001000', '1110100'],
647
- 'O': [// The O (odd) encoding for UPC-E
648
- '0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011'],
649
- 'E': [// The E (even) encoding for UPC-E
650
- '0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']
651
- };
652
-
653
- // Define the EAN-2 structure
654
- constants$1.EAN2_STRUCTURE = ['LL', 'LG', 'GL', 'GG'];
655
-
656
- // Define the EAN-5 structure
657
- constants$1.EAN5_STRUCTURE = ['GGLLL', 'GLGLL', 'GLLGL', 'GLLLG', 'LGGLL', 'LLGGL', 'LLLGG', 'LGLGL', 'LGLLG', 'LLGLG'];
658
-
659
- // Define the EAN-13 structure
660
- constants$1.EAN13_STRUCTURE = ['LLLLLL', 'LLGLGG', 'LLGGLG', 'LLGGGL', 'LGLLGG', 'LGGLLG', 'LGGGLL', 'LGLGLG', 'LGLGGL', 'LGGLGL'];
661
-
662
- var EAN$1 = {};
663
-
664
- var encoder = {};
665
-
666
- Object.defineProperty(encoder, "__esModule", {
667
- value: true
668
- });
669
-
670
- var _constants$5 = constants$1;
671
-
672
- // Encode data string
673
- var encode$1 = function encode(data, structure, separator) {
674
- var encoded = data.split('').map(function (val, idx) {
675
- return _constants$5.BINARIES[structure[idx]];
676
- }).map(function (val, idx) {
677
- return val ? val[data[idx]] : '';
678
- });
679
-
680
- if (separator) {
681
- var last = data.length - 1;
682
- encoded = encoded.map(function (val, idx) {
683
- return idx < last ? val + separator : val;
684
- });
685
- }
686
-
687
- return encoded.join('');
688
- };
689
-
690
- encoder.default = encode$1;
691
-
692
- Object.defineProperty(EAN$1, "__esModule", {
693
- value: true
694
- });
695
-
696
- var _createClass$h = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
697
-
698
- var _constants$4 = constants$1;
699
-
700
- var _encoder$4 = encoder;
701
-
702
- var _encoder2$4 = _interopRequireDefault$r(_encoder$4);
703
-
704
- var _Barcode2$9 = Barcode$2;
705
-
706
- var _Barcode3$9 = _interopRequireDefault$r(_Barcode2$9);
707
-
708
- function _interopRequireDefault$r(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
709
-
710
- function _classCallCheck$m(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
711
-
712
- function _possibleConstructorReturn$i(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
713
-
714
- function _inherits$i(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
715
-
716
- // Base class for EAN8 & EAN13
717
- var EAN = function (_Barcode) {
718
- _inherits$i(EAN, _Barcode);
719
-
720
- function EAN(data, options) {
721
- _classCallCheck$m(this, EAN);
722
-
723
- // Make sure the font is not bigger than the space between the guard bars
724
- var _this = _possibleConstructorReturn$i(this, (EAN.__proto__ || Object.getPrototypeOf(EAN)).call(this, data, options));
725
-
726
- _this.fontSize = !options.flat && options.fontSize > options.width * 10 ? options.width * 10 : options.fontSize;
727
-
728
- // Make the guard bars go down half the way of the text
729
- _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
730
- return _this;
731
- }
732
-
733
- _createClass$h(EAN, [{
734
- key: 'encode',
735
- value: function encode() {
736
- return this.options.flat ? this.encodeFlat() : this.encodeGuarded();
737
- }
738
- }, {
739
- key: 'leftText',
740
- value: function leftText(from, to) {
741
- return this.text.substr(from, to);
742
- }
743
- }, {
744
- key: 'leftEncode',
745
- value: function leftEncode(data, structure) {
746
- return (0, _encoder2$4.default)(data, structure);
747
- }
748
- }, {
749
- key: 'rightText',
750
- value: function rightText(from, to) {
751
- return this.text.substr(from, to);
752
- }
753
- }, {
754
- key: 'rightEncode',
755
- value: function rightEncode(data, structure) {
756
- return (0, _encoder2$4.default)(data, structure);
757
- }
758
- }, {
759
- key: 'encodeGuarded',
760
- value: function encodeGuarded() {
761
- var textOptions = { fontSize: this.fontSize };
762
- var guardOptions = { height: this.guardHeight };
763
-
764
- return [{ data: _constants$4.SIDE_BIN, options: guardOptions }, { data: this.leftEncode(), text: this.leftText(), options: textOptions }, { data: _constants$4.MIDDLE_BIN, options: guardOptions }, { data: this.rightEncode(), text: this.rightText(), options: textOptions }, { data: _constants$4.SIDE_BIN, options: guardOptions }];
765
- }
766
- }, {
767
- key: 'encodeFlat',
768
- value: function encodeFlat() {
769
- var data = [_constants$4.SIDE_BIN, this.leftEncode(), _constants$4.MIDDLE_BIN, this.rightEncode(), _constants$4.SIDE_BIN];
770
-
771
- return {
772
- data: data.join(''),
773
- text: this.text
774
- };
775
- }
776
- }]);
777
-
778
- return EAN;
779
- }(_Barcode3$9.default);
780
-
781
- EAN$1.default = EAN;
782
-
783
- Object.defineProperty(EAN13$1, "__esModule", {
784
- value: true
785
- });
786
-
787
- var _createClass$g = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
788
-
789
- var _get$1 = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
790
-
791
- var _constants$3 = constants$1;
792
-
793
- var _EAN2$2 = EAN$1;
794
-
795
- var _EAN3$2 = _interopRequireDefault$q(_EAN2$2);
796
-
797
- function _interopRequireDefault$q(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
798
-
799
- function _classCallCheck$l(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
800
-
801
- function _possibleConstructorReturn$h(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
802
-
803
- function _inherits$h(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
804
- // https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Binary_encoding_of_data_digits_into_EAN-13_barcode
805
-
806
- // Calculate the checksum digit
807
- // https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Calculation_of_checksum_digit
808
- var checksum$4 = function checksum(number) {
809
- var res = number.substr(0, 12).split('').map(function (n) {
810
- return +n;
811
- }).reduce(function (sum, a, idx) {
812
- return idx % 2 ? sum + a * 3 : sum + a;
813
- }, 0);
814
-
815
- return (10 - res % 10) % 10;
816
- };
817
-
818
- var EAN13 = function (_EAN) {
819
- _inherits$h(EAN13, _EAN);
820
-
821
- function EAN13(data, options) {
822
- _classCallCheck$l(this, EAN13);
823
-
824
- // Add checksum if it does not exist
825
- if (data.search(/^[0-9]{12}$/) !== -1) {
826
- data += checksum$4(data);
827
- }
828
-
829
- // Adds a last character to the end of the barcode
830
- var _this = _possibleConstructorReturn$h(this, (EAN13.__proto__ || Object.getPrototypeOf(EAN13)).call(this, data, options));
831
-
832
- _this.lastChar = options.lastChar;
833
- return _this;
834
- }
835
-
836
- _createClass$g(EAN13, [{
837
- key: 'valid',
838
- value: function valid() {
839
- return this.data.search(/^[0-9]{13}$/) !== -1 && +this.data[12] === checksum$4(this.data);
840
- }
841
- }, {
842
- key: 'leftText',
843
- value: function leftText() {
844
- return _get$1(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'leftText', this).call(this, 1, 6);
845
- }
846
- }, {
847
- key: 'leftEncode',
848
- value: function leftEncode() {
849
- var data = this.data.substr(1, 6);
850
- var structure = _constants$3.EAN13_STRUCTURE[this.data[0]];
851
- return _get$1(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'leftEncode', this).call(this, data, structure);
852
- }
853
- }, {
854
- key: 'rightText',
855
- value: function rightText() {
856
- return _get$1(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'rightText', this).call(this, 7, 6);
857
- }
858
- }, {
859
- key: 'rightEncode',
860
- value: function rightEncode() {
861
- var data = this.data.substr(7, 6);
862
- return _get$1(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'rightEncode', this).call(this, data, 'RRRRRR');
863
- }
864
-
865
- // The "standard" way of printing EAN13 barcodes with guard bars
866
-
867
- }, {
868
- key: 'encodeGuarded',
869
- value: function encodeGuarded() {
870
- var data = _get$1(EAN13.prototype.__proto__ || Object.getPrototypeOf(EAN13.prototype), 'encodeGuarded', this).call(this);
871
-
872
- // Extend data with left digit & last character
873
- if (this.options.displayValue) {
874
- data.unshift({
875
- data: '000000000000',
876
- text: this.text.substr(0, 1),
877
- options: { textAlign: 'left', fontSize: this.fontSize }
878
- });
879
-
880
- if (this.options.lastChar) {
881
- data.push({
882
- data: '00'
883
- });
884
- data.push({
885
- data: '00000',
886
- text: this.options.lastChar,
887
- options: { fontSize: this.fontSize }
888
- });
889
- }
890
- }
891
-
892
- return data;
893
- }
894
- }]);
895
-
896
- return EAN13;
897
- }(_EAN3$2.default);
898
-
899
- EAN13$1.default = EAN13;
900
-
901
- var EAN8$1 = {};
902
-
903
- Object.defineProperty(EAN8$1, "__esModule", {
904
- value: true
905
- });
906
-
907
- var _createClass$f = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
908
-
909
- var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
910
-
911
- var _EAN2$1 = EAN$1;
912
-
913
- var _EAN3$1 = _interopRequireDefault$p(_EAN2$1);
914
-
915
- function _interopRequireDefault$p(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
916
-
917
- function _classCallCheck$k(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
918
-
919
- function _possibleConstructorReturn$g(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
920
-
921
- function _inherits$g(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
922
- // http://www.barcodeisland.com/ean8.phtml
923
-
924
- // Calculate the checksum digit
925
- var checksum$3 = function checksum(number) {
926
- var res = number.substr(0, 7).split('').map(function (n) {
927
- return +n;
928
- }).reduce(function (sum, a, idx) {
929
- return idx % 2 ? sum + a : sum + a * 3;
930
- }, 0);
931
-
932
- return (10 - res % 10) % 10;
933
- };
934
-
935
- var EAN8 = function (_EAN) {
936
- _inherits$g(EAN8, _EAN);
937
-
938
- function EAN8(data, options) {
939
- _classCallCheck$k(this, EAN8);
940
-
941
- // Add checksum if it does not exist
942
- if (data.search(/^[0-9]{7}$/) !== -1) {
943
- data += checksum$3(data);
944
- }
945
-
946
- return _possibleConstructorReturn$g(this, (EAN8.__proto__ || Object.getPrototypeOf(EAN8)).call(this, data, options));
947
- }
948
-
949
- _createClass$f(EAN8, [{
950
- key: 'valid',
951
- value: function valid() {
952
- return this.data.search(/^[0-9]{8}$/) !== -1 && +this.data[7] === checksum$3(this.data);
953
- }
954
- }, {
955
- key: 'leftText',
956
- value: function leftText() {
957
- return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'leftText', this).call(this, 0, 4);
958
- }
959
- }, {
960
- key: 'leftEncode',
961
- value: function leftEncode() {
962
- var data = this.data.substr(0, 4);
963
- return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'leftEncode', this).call(this, data, 'LLLL');
964
- }
965
- }, {
966
- key: 'rightText',
967
- value: function rightText() {
968
- return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'rightText', this).call(this, 4, 4);
969
- }
970
- }, {
971
- key: 'rightEncode',
972
- value: function rightEncode() {
973
- var data = this.data.substr(4, 4);
974
- return _get(EAN8.prototype.__proto__ || Object.getPrototypeOf(EAN8.prototype), 'rightEncode', this).call(this, data, 'RRRR');
975
- }
976
- }]);
977
-
978
- return EAN8;
979
- }(_EAN3$1.default);
980
-
981
- EAN8$1.default = EAN8;
982
-
983
- var EAN5$1 = {};
984
-
985
- Object.defineProperty(EAN5$1, "__esModule", {
986
- value: true
987
- });
988
-
989
- var _createClass$e = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
990
-
991
- var _constants$2 = constants$1;
992
-
993
- var _encoder$3 = encoder;
994
-
995
- var _encoder2$3 = _interopRequireDefault$o(_encoder$3);
996
-
997
- var _Barcode2$8 = Barcode$2;
998
-
999
- var _Barcode3$8 = _interopRequireDefault$o(_Barcode2$8);
1000
-
1001
- function _interopRequireDefault$o(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1002
-
1003
- function _classCallCheck$j(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1004
-
1005
- function _possibleConstructorReturn$f(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1006
-
1007
- function _inherits$f(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
1008
- // https://en.wikipedia.org/wiki/EAN_5#Encoding
1009
-
1010
- var checksum$2 = function checksum(data) {
1011
- var result = data.split('').map(function (n) {
1012
- return +n;
1013
- }).reduce(function (sum, a, idx) {
1014
- return idx % 2 ? sum + a * 9 : sum + a * 3;
1015
- }, 0);
1016
- return result % 10;
1017
- };
1018
-
1019
- var EAN5 = function (_Barcode) {
1020
- _inherits$f(EAN5, _Barcode);
1021
-
1022
- function EAN5(data, options) {
1023
- _classCallCheck$j(this, EAN5);
1024
-
1025
- return _possibleConstructorReturn$f(this, (EAN5.__proto__ || Object.getPrototypeOf(EAN5)).call(this, data, options));
1026
- }
1027
-
1028
- _createClass$e(EAN5, [{
1029
- key: 'valid',
1030
- value: function valid() {
1031
- return this.data.search(/^[0-9]{5}$/) !== -1;
1032
- }
1033
- }, {
1034
- key: 'encode',
1035
- value: function encode() {
1036
- var structure = _constants$2.EAN5_STRUCTURE[checksum$2(this.data)];
1037
- return {
1038
- data: '1011' + (0, _encoder2$3.default)(this.data, structure, '01'),
1039
- text: this.text
1040
- };
1041
- }
1042
- }]);
1043
-
1044
- return EAN5;
1045
- }(_Barcode3$8.default);
1046
-
1047
- EAN5$1.default = EAN5;
1048
-
1049
- var EAN2$1 = {};
1050
-
1051
- Object.defineProperty(EAN2$1, "__esModule", {
1052
- value: true
1053
- });
1054
-
1055
- var _createClass$d = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1056
-
1057
- var _constants$1 = constants$1;
1058
-
1059
- var _encoder$2 = encoder;
1060
-
1061
- var _encoder2$2 = _interopRequireDefault$n(_encoder$2);
1062
-
1063
- var _Barcode2$7 = Barcode$2;
1064
-
1065
- var _Barcode3$7 = _interopRequireDefault$n(_Barcode2$7);
1066
-
1067
- function _interopRequireDefault$n(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1068
-
1069
- function _classCallCheck$i(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1070
-
1071
- function _possibleConstructorReturn$e(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1072
-
1073
- function _inherits$e(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
1074
- // https://en.wikipedia.org/wiki/EAN_2#Encoding
1075
-
1076
- var EAN2 = function (_Barcode) {
1077
- _inherits$e(EAN2, _Barcode);
1078
-
1079
- function EAN2(data, options) {
1080
- _classCallCheck$i(this, EAN2);
1081
-
1082
- return _possibleConstructorReturn$e(this, (EAN2.__proto__ || Object.getPrototypeOf(EAN2)).call(this, data, options));
1083
- }
1084
-
1085
- _createClass$d(EAN2, [{
1086
- key: 'valid',
1087
- value: function valid() {
1088
- return this.data.search(/^[0-9]{2}$/) !== -1;
1089
- }
1090
- }, {
1091
- key: 'encode',
1092
- value: function encode() {
1093
- // Choose the structure based on the number mod 4
1094
- var structure = _constants$1.EAN2_STRUCTURE[parseInt(this.data) % 4];
1095
- return {
1096
- // Start bits + Encode the two digits with 01 in between
1097
- data: '1011' + (0, _encoder2$2.default)(this.data, structure, '01'),
1098
- text: this.text
1099
- };
1100
- }
1101
- }]);
1102
-
1103
- return EAN2;
1104
- }(_Barcode3$7.default);
1105
-
1106
- EAN2$1.default = EAN2;
1107
-
1108
- var UPC$1 = {};
1109
-
1110
- Object.defineProperty(UPC$1, "__esModule", {
1111
- value: true
1112
- });
1113
-
1114
- var _createClass$c = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1115
-
1116
- UPC$1.checksum = checksum$1;
1117
-
1118
- var _encoder$1 = encoder;
1119
-
1120
- var _encoder2$1 = _interopRequireDefault$m(_encoder$1);
1121
-
1122
- var _Barcode2$6 = Barcode$2;
1123
-
1124
- var _Barcode3$6 = _interopRequireDefault$m(_Barcode2$6);
1125
-
1126
- function _interopRequireDefault$m(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1127
-
1128
- function _classCallCheck$h(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1129
-
1130
- function _possibleConstructorReturn$d(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1131
-
1132
- function _inherits$d(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
1133
- // https://en.wikipedia.org/wiki/Universal_Product_Code#Encoding
1134
-
1135
- var UPC = function (_Barcode) {
1136
- _inherits$d(UPC, _Barcode);
1137
-
1138
- function UPC(data, options) {
1139
- _classCallCheck$h(this, UPC);
1140
-
1141
- // Add checksum if it does not exist
1142
- if (data.search(/^[0-9]{11}$/) !== -1) {
1143
- data += checksum$1(data);
1144
- }
1145
-
1146
- var _this = _possibleConstructorReturn$d(this, (UPC.__proto__ || Object.getPrototypeOf(UPC)).call(this, data, options));
1147
-
1148
- _this.displayValue = options.displayValue;
1149
-
1150
- // Make sure the font is not bigger than the space between the guard bars
1151
- if (options.fontSize > options.width * 10) {
1152
- _this.fontSize = options.width * 10;
1153
- } else {
1154
- _this.fontSize = options.fontSize;
1155
- }
1156
-
1157
- // Make the guard bars go down half the way of the text
1158
- _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
1159
- return _this;
1160
- }
1161
-
1162
- _createClass$c(UPC, [{
1163
- key: "valid",
1164
- value: function valid() {
1165
- return this.data.search(/^[0-9]{12}$/) !== -1 && this.data[11] == checksum$1(this.data);
1166
- }
1167
- }, {
1168
- key: "encode",
1169
- value: function encode() {
1170
- if (this.options.flat) {
1171
- return this.flatEncoding();
1172
- } else {
1173
- return this.guardedEncoding();
1174
- }
1175
- }
1176
- }, {
1177
- key: "flatEncoding",
1178
- value: function flatEncoding() {
1179
- var result = "";
1180
-
1181
- result += "101";
1182
- result += (0, _encoder2$1.default)(this.data.substr(0, 6), "LLLLLL");
1183
- result += "01010";
1184
- result += (0, _encoder2$1.default)(this.data.substr(6, 6), "RRRRRR");
1185
- result += "101";
1186
-
1187
- return {
1188
- data: result,
1189
- text: this.text
1190
- };
1191
- }
1192
- }, {
1193
- key: "guardedEncoding",
1194
- value: function guardedEncoding() {
1195
- var result = [];
1196
-
1197
- // Add the first digit
1198
- if (this.displayValue) {
1199
- result.push({
1200
- data: "00000000",
1201
- text: this.text.substr(0, 1),
1202
- options: { textAlign: "left", fontSize: this.fontSize }
1203
- });
1204
- }
1205
-
1206
- // Add the guard bars
1207
- result.push({
1208
- data: "101" + (0, _encoder2$1.default)(this.data[0], "L"),
1209
- options: { height: this.guardHeight }
1210
- });
1211
-
1212
- // Add the left side
1213
- result.push({
1214
- data: (0, _encoder2$1.default)(this.data.substr(1, 5), "LLLLL"),
1215
- text: this.text.substr(1, 5),
1216
- options: { fontSize: this.fontSize }
1217
- });
1218
-
1219
- // Add the middle bits
1220
- result.push({
1221
- data: "01010",
1222
- options: { height: this.guardHeight }
1223
- });
1224
-
1225
- // Add the right side
1226
- result.push({
1227
- data: (0, _encoder2$1.default)(this.data.substr(6, 5), "RRRRR"),
1228
- text: this.text.substr(6, 5),
1229
- options: { fontSize: this.fontSize }
1230
- });
1231
-
1232
- // Add the end bits
1233
- result.push({
1234
- data: (0, _encoder2$1.default)(this.data[11], "R") + "101",
1235
- options: { height: this.guardHeight }
1236
- });
1237
-
1238
- // Add the last digit
1239
- if (this.displayValue) {
1240
- result.push({
1241
- data: "00000000",
1242
- text: this.text.substr(11, 1),
1243
- options: { textAlign: "right", fontSize: this.fontSize }
1244
- });
1245
- }
1246
-
1247
- return result;
1248
- }
1249
- }]);
1250
-
1251
- return UPC;
1252
- }(_Barcode3$6.default);
1253
-
1254
- // Calulate the checksum digit
1255
- // https://en.wikipedia.org/wiki/International_Article_Number_(EAN)#Calculation_of_checksum_digit
1256
-
1257
-
1258
- function checksum$1(number) {
1259
- var result = 0;
1260
-
1261
- var i;
1262
- for (i = 1; i < 11; i += 2) {
1263
- result += parseInt(number[i]);
1264
- }
1265
- for (i = 0; i < 11; i += 2) {
1266
- result += parseInt(number[i]) * 3;
1267
- }
1268
-
1269
- return (10 - result % 10) % 10;
1270
- }
1271
-
1272
- UPC$1.default = UPC;
1273
-
1274
- var UPCE$1 = {};
1275
-
1276
- Object.defineProperty(UPCE$1, "__esModule", {
1277
- value: true
1278
- });
1279
-
1280
- var _createClass$b = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1281
-
1282
- var _encoder = encoder;
1283
-
1284
- var _encoder2 = _interopRequireDefault$l(_encoder);
1285
-
1286
- var _Barcode2$5 = Barcode$2;
1287
-
1288
- var _Barcode3$5 = _interopRequireDefault$l(_Barcode2$5);
1289
-
1290
- var _UPC$1 = UPC$1;
1291
-
1292
- function _interopRequireDefault$l(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1293
-
1294
- function _classCallCheck$g(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1295
-
1296
- function _possibleConstructorReturn$c(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1297
-
1298
- function _inherits$c(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation:
1299
- // https://en.wikipedia.org/wiki/Universal_Product_Code#Encoding
1300
- //
1301
- // UPC-E documentation:
1302
- // https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E
1303
-
1304
- var EXPANSIONS = ["XX00000XXX", "XX10000XXX", "XX20000XXX", "XXX00000XX", "XXXX00000X", "XXXXX00005", "XXXXX00006", "XXXXX00007", "XXXXX00008", "XXXXX00009"];
1305
-
1306
- var PARITIES = [["EEEOOO", "OOOEEE"], ["EEOEOO", "OOEOEE"], ["EEOOEO", "OOEEOE"], ["EEOOOE", "OOEEEO"], ["EOEEOO", "OEOOEE"], ["EOOEEO", "OEEOOE"], ["EOOOEE", "OEEEOO"], ["EOEOEO", "OEOEOE"], ["EOEOOE", "OEOEEO"], ["EOOEOE", "OEEOEO"]];
1307
-
1308
- var UPCE = function (_Barcode) {
1309
- _inherits$c(UPCE, _Barcode);
1310
-
1311
- function UPCE(data, options) {
1312
- _classCallCheck$g(this, UPCE);
1313
-
1314
- var _this = _possibleConstructorReturn$c(this, (UPCE.__proto__ || Object.getPrototypeOf(UPCE)).call(this, data, options));
1315
- // Code may be 6 or 8 digits;
1316
- // A 7 digit code is ambiguous as to whether the extra digit
1317
- // is a UPC-A check or number system digit.
1318
-
1319
-
1320
- _this.isValid = false;
1321
- if (data.search(/^[0-9]{6}$/) !== -1) {
1322
- _this.middleDigits = data;
1323
- _this.upcA = expandToUPCA(data, "0");
1324
- _this.text = options.text || '' + _this.upcA[0] + data + _this.upcA[_this.upcA.length - 1];
1325
- _this.isValid = true;
1326
- } else if (data.search(/^[01][0-9]{7}$/) !== -1) {
1327
- _this.middleDigits = data.substring(1, data.length - 1);
1328
- _this.upcA = expandToUPCA(_this.middleDigits, data[0]);
1329
-
1330
- if (_this.upcA[_this.upcA.length - 1] === data[data.length - 1]) {
1331
- _this.isValid = true;
1332
- } else {
1333
- // checksum mismatch
1334
- return _possibleConstructorReturn$c(_this);
1335
- }
1336
- } else {
1337
- return _possibleConstructorReturn$c(_this);
1338
- }
1339
-
1340
- _this.displayValue = options.displayValue;
1341
-
1342
- // Make sure the font is not bigger than the space between the guard bars
1343
- if (options.fontSize > options.width * 10) {
1344
- _this.fontSize = options.width * 10;
1345
- } else {
1346
- _this.fontSize = options.fontSize;
1347
- }
1348
-
1349
- // Make the guard bars go down half the way of the text
1350
- _this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
1351
- return _this;
1352
- }
1353
-
1354
- _createClass$b(UPCE, [{
1355
- key: 'valid',
1356
- value: function valid() {
1357
- return this.isValid;
1358
- }
1359
- }, {
1360
- key: 'encode',
1361
- value: function encode() {
1362
- if (this.options.flat) {
1363
- return this.flatEncoding();
1364
- } else {
1365
- return this.guardedEncoding();
1366
- }
1367
- }
1368
- }, {
1369
- key: 'flatEncoding',
1370
- value: function flatEncoding() {
1371
- var result = "";
1372
-
1373
- result += "101";
1374
- result += this.encodeMiddleDigits();
1375
- result += "010101";
1376
-
1377
- return {
1378
- data: result,
1379
- text: this.text
1380
- };
1381
- }
1382
- }, {
1383
- key: 'guardedEncoding',
1384
- value: function guardedEncoding() {
1385
- var result = [];
1386
-
1387
- // Add the UPC-A number system digit beneath the quiet zone
1388
- if (this.displayValue) {
1389
- result.push({
1390
- data: "00000000",
1391
- text: this.text[0],
1392
- options: { textAlign: "left", fontSize: this.fontSize }
1393
- });
1394
- }
1395
-
1396
- // Add the guard bars
1397
- result.push({
1398
- data: "101",
1399
- options: { height: this.guardHeight }
1400
- });
1401
-
1402
- // Add the 6 UPC-E digits
1403
- result.push({
1404
- data: this.encodeMiddleDigits(),
1405
- text: this.text.substring(1, 7),
1406
- options: { fontSize: this.fontSize }
1407
- });
1408
-
1409
- // Add the end bits
1410
- result.push({
1411
- data: "010101",
1412
- options: { height: this.guardHeight }
1413
- });
1414
-
1415
- // Add the UPC-A check digit beneath the quiet zone
1416
- if (this.displayValue) {
1417
- result.push({
1418
- data: "00000000",
1419
- text: this.text[7],
1420
- options: { textAlign: "right", fontSize: this.fontSize }
1421
- });
1422
- }
1423
-
1424
- return result;
1425
- }
1426
- }, {
1427
- key: 'encodeMiddleDigits',
1428
- value: function encodeMiddleDigits() {
1429
- var numberSystem = this.upcA[0];
1430
- var checkDigit = this.upcA[this.upcA.length - 1];
1431
- var parity = PARITIES[parseInt(checkDigit)][parseInt(numberSystem)];
1432
- return (0, _encoder2.default)(this.middleDigits, parity);
1433
- }
1434
- }]);
1435
-
1436
- return UPCE;
1437
- }(_Barcode3$5.default);
1438
-
1439
- function expandToUPCA(middleDigits, numberSystem) {
1440
- var lastUpcE = parseInt(middleDigits[middleDigits.length - 1]);
1441
- var expansion = EXPANSIONS[lastUpcE];
1442
-
1443
- var result = "";
1444
- var digitIndex = 0;
1445
- for (var i = 0; i < expansion.length; i++) {
1446
- var c = expansion[i];
1447
- if (c === 'X') {
1448
- result += middleDigits[digitIndex++];
1449
- } else {
1450
- result += c;
1451
- }
1452
- }
1453
-
1454
- result = '' + numberSystem + result;
1455
- return '' + result + (0, _UPC$1.checksum)(result);
1456
- }
1457
-
1458
- UPCE$1.default = UPCE;
1459
-
1460
- Object.defineProperty(EAN_UPC, "__esModule", {
1461
- value: true
1462
- });
1463
- EAN_UPC.UPCE = EAN_UPC.UPC = EAN_UPC.EAN2 = EAN_UPC.EAN5 = EAN_UPC.EAN8 = EAN_UPC.EAN13 = undefined;
1464
-
1465
- var _EAN = EAN13$1;
1466
-
1467
- var _EAN2 = _interopRequireDefault$k(_EAN);
1468
-
1469
- var _EAN3 = EAN8$1;
1470
-
1471
- var _EAN4 = _interopRequireDefault$k(_EAN3);
1472
-
1473
- var _EAN5 = EAN5$1;
1474
-
1475
- var _EAN6 = _interopRequireDefault$k(_EAN5);
1476
-
1477
- var _EAN7 = EAN2$1;
1478
-
1479
- var _EAN8 = _interopRequireDefault$k(_EAN7);
1480
-
1481
- var _UPC = UPC$1;
1482
-
1483
- var _UPC2 = _interopRequireDefault$k(_UPC);
1484
-
1485
- var _UPCE = UPCE$1;
1486
-
1487
- var _UPCE2 = _interopRequireDefault$k(_UPCE);
1488
-
1489
- function _interopRequireDefault$k(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1490
-
1491
- EAN_UPC.EAN13 = _EAN2.default;
1492
- EAN_UPC.EAN8 = _EAN4.default;
1493
- EAN_UPC.EAN5 = _EAN6.default;
1494
- EAN_UPC.EAN2 = _EAN8.default;
1495
- EAN_UPC.UPC = _UPC2.default;
1496
- EAN_UPC.UPCE = _UPCE2.default;
1497
-
1498
- var ITF$2 = {};
1499
-
1500
- var ITF$1 = {};
1501
-
1502
- var constants = {};
1503
-
1504
- Object.defineProperty(constants, "__esModule", {
1505
- value: true
1506
- });
1507
- constants.START_BIN = '1010';
1508
- constants.END_BIN = '11101';
1509
-
1510
- constants.BINARIES = ['00110', '10001', '01001', '11000', '00101', '10100', '01100', '00011', '10010', '01010'];
1511
-
1512
- Object.defineProperty(ITF$1, "__esModule", {
1513
- value: true
1514
- });
1515
-
1516
- var _createClass$a = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1517
-
1518
- var _constants = constants;
1519
-
1520
- var _Barcode2$4 = Barcode$2;
1521
-
1522
- var _Barcode3$4 = _interopRequireDefault$j(_Barcode2$4);
1523
-
1524
- function _interopRequireDefault$j(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1525
-
1526
- function _classCallCheck$f(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1527
-
1528
- function _possibleConstructorReturn$b(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1529
-
1530
- function _inherits$b(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1531
-
1532
- var ITF = function (_Barcode) {
1533
- _inherits$b(ITF, _Barcode);
1534
-
1535
- function ITF() {
1536
- _classCallCheck$f(this, ITF);
1537
-
1538
- return _possibleConstructorReturn$b(this, (ITF.__proto__ || Object.getPrototypeOf(ITF)).apply(this, arguments));
1539
- }
1540
-
1541
- _createClass$a(ITF, [{
1542
- key: 'valid',
1543
- value: function valid() {
1544
- return this.data.search(/^([0-9]{2})+$/) !== -1;
1545
- }
1546
- }, {
1547
- key: 'encode',
1548
- value: function encode() {
1549
- var _this2 = this;
1550
-
1551
- // Calculate all the digit pairs
1552
- var encoded = this.data.match(/.{2}/g).map(function (pair) {
1553
- return _this2.encodePair(pair);
1554
- }).join('');
1555
-
1556
- return {
1557
- data: _constants.START_BIN + encoded + _constants.END_BIN,
1558
- text: this.text
1559
- };
1560
- }
1561
-
1562
- // Calculate the data of a number pair
1563
-
1564
- }, {
1565
- key: 'encodePair',
1566
- value: function encodePair(pair) {
1567
- var second = _constants.BINARIES[pair[1]];
1568
-
1569
- return _constants.BINARIES[pair[0]].split('').map(function (first, idx) {
1570
- return (first === '1' ? '111' : '1') + (second[idx] === '1' ? '000' : '0');
1571
- }).join('');
1572
- }
1573
- }]);
1574
-
1575
- return ITF;
1576
- }(_Barcode3$4.default);
1577
-
1578
- ITF$1.default = ITF;
1579
-
1580
- var ITF14$1 = {};
1581
-
1582
- Object.defineProperty(ITF14$1, "__esModule", {
1583
- value: true
1584
- });
1585
-
1586
- var _createClass$9 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1587
-
1588
- var _ITF2$1 = ITF$1;
1589
-
1590
- var _ITF3$1 = _interopRequireDefault$i(_ITF2$1);
1591
-
1592
- function _interopRequireDefault$i(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1593
-
1594
- function _classCallCheck$e(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1595
-
1596
- function _possibleConstructorReturn$a(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1597
-
1598
- function _inherits$a(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1599
-
1600
- // Calculate the checksum digit
1601
- var checksum = function checksum(data) {
1602
- var res = data.substr(0, 13).split('').map(function (num) {
1603
- return parseInt(num, 10);
1604
- }).reduce(function (sum, n, idx) {
1605
- return sum + n * (3 - idx % 2 * 2);
1606
- }, 0);
1607
-
1608
- return Math.ceil(res / 10) * 10 - res;
1609
- };
1610
-
1611
- var ITF14 = function (_ITF) {
1612
- _inherits$a(ITF14, _ITF);
1613
-
1614
- function ITF14(data, options) {
1615
- _classCallCheck$e(this, ITF14);
1616
-
1617
- // Add checksum if it does not exist
1618
- if (data.search(/^[0-9]{13}$/) !== -1) {
1619
- data += checksum(data);
1620
- }
1621
- return _possibleConstructorReturn$a(this, (ITF14.__proto__ || Object.getPrototypeOf(ITF14)).call(this, data, options));
1622
- }
1623
-
1624
- _createClass$9(ITF14, [{
1625
- key: 'valid',
1626
- value: function valid() {
1627
- return this.data.search(/^[0-9]{14}$/) !== -1 && +this.data[13] === checksum(this.data);
1628
- }
1629
- }]);
1630
-
1631
- return ITF14;
1632
- }(_ITF3$1.default);
1633
-
1634
- ITF14$1.default = ITF14;
1635
-
1636
- Object.defineProperty(ITF$2, "__esModule", {
1637
- value: true
1638
- });
1639
- ITF$2.ITF14 = ITF$2.ITF = undefined;
1640
-
1641
- var _ITF$1 = ITF$1;
1642
-
1643
- var _ITF2 = _interopRequireDefault$h(_ITF$1);
1644
-
1645
- var _ITF3 = ITF14$1;
1646
-
1647
- var _ITF4 = _interopRequireDefault$h(_ITF3);
1648
-
1649
- function _interopRequireDefault$h(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1650
-
1651
- ITF$2.ITF = _ITF2.default;
1652
- ITF$2.ITF14 = _ITF4.default;
1653
-
1654
- var MSI$2 = {};
1655
-
1656
- var MSI$1 = {};
1657
-
1658
- Object.defineProperty(MSI$1, "__esModule", {
1659
- value: true
1660
- });
1661
-
1662
- var _createClass$8 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1663
-
1664
- var _Barcode2$3 = Barcode$2;
1665
-
1666
- var _Barcode3$3 = _interopRequireDefault$g(_Barcode2$3);
1667
-
1668
- function _interopRequireDefault$g(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1669
-
1670
- function _classCallCheck$d(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1671
-
1672
- function _possibleConstructorReturn$9(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1673
-
1674
- function _inherits$9(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation
1675
- // https://en.wikipedia.org/wiki/MSI_Barcode#Character_set_and_binary_lookup
1676
-
1677
- var MSI = function (_Barcode) {
1678
- _inherits$9(MSI, _Barcode);
1679
-
1680
- function MSI(data, options) {
1681
- _classCallCheck$d(this, MSI);
1682
-
1683
- return _possibleConstructorReturn$9(this, (MSI.__proto__ || Object.getPrototypeOf(MSI)).call(this, data, options));
1684
- }
1685
-
1686
- _createClass$8(MSI, [{
1687
- key: "encode",
1688
- value: function encode() {
1689
- // Start bits
1690
- var ret = "110";
1691
-
1692
- for (var i = 0; i < this.data.length; i++) {
1693
- // Convert the character to binary (always 4 binary digits)
1694
- var digit = parseInt(this.data[i]);
1695
- var bin = digit.toString(2);
1696
- bin = addZeroes(bin, 4 - bin.length);
1697
-
1698
- // Add 100 for every zero and 110 for every 1
1699
- for (var b = 0; b < bin.length; b++) {
1700
- ret += bin[b] == "0" ? "100" : "110";
1701
- }
1702
- }
1703
-
1704
- // End bits
1705
- ret += "1001";
1706
-
1707
- return {
1708
- data: ret,
1709
- text: this.text
1710
- };
1711
- }
1712
- }, {
1713
- key: "valid",
1714
- value: function valid() {
1715
- return this.data.search(/^[0-9]+$/) !== -1;
1716
- }
1717
- }]);
1718
-
1719
- return MSI;
1720
- }(_Barcode3$3.default);
1721
-
1722
- function addZeroes(number, n) {
1723
- for (var i = 0; i < n; i++) {
1724
- number = "0" + number;
1725
- }
1726
- return number;
1727
- }
1728
-
1729
- MSI$1.default = MSI;
1730
-
1731
- var MSI10$1 = {};
1732
-
1733
- var checksums = {};
1734
-
1735
- Object.defineProperty(checksums, "__esModule", {
1736
- value: true
1737
- });
1738
- checksums.mod10 = mod10;
1739
- checksums.mod11 = mod11;
1740
- function mod10(number) {
1741
- var sum = 0;
1742
- for (var i = 0; i < number.length; i++) {
1743
- var n = parseInt(number[i]);
1744
- if ((i + number.length) % 2 === 0) {
1745
- sum += n;
1746
- } else {
1747
- sum += n * 2 % 10 + Math.floor(n * 2 / 10);
1748
- }
1749
- }
1750
- return (10 - sum % 10) % 10;
1751
- }
1752
-
1753
- function mod11(number) {
1754
- var sum = 0;
1755
- var weights = [2, 3, 4, 5, 6, 7];
1756
- for (var i = 0; i < number.length; i++) {
1757
- var n = parseInt(number[number.length - 1 - i]);
1758
- sum += weights[i % weights.length] * n;
1759
- }
1760
- return (11 - sum % 11) % 11;
1761
- }
1762
-
1763
- Object.defineProperty(MSI10$1, "__esModule", {
1764
- value: true
1765
- });
1766
-
1767
- var _MSI2$4 = MSI$1;
1768
-
1769
- var _MSI3$4 = _interopRequireDefault$f(_MSI2$4);
1770
-
1771
- var _checksums$3 = checksums;
1772
-
1773
- function _interopRequireDefault$f(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1774
-
1775
- function _classCallCheck$c(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1776
-
1777
- function _possibleConstructorReturn$8(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1778
-
1779
- function _inherits$8(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1780
-
1781
- var MSI10 = function (_MSI) {
1782
- _inherits$8(MSI10, _MSI);
1783
-
1784
- function MSI10(data, options) {
1785
- _classCallCheck$c(this, MSI10);
1786
-
1787
- return _possibleConstructorReturn$8(this, (MSI10.__proto__ || Object.getPrototypeOf(MSI10)).call(this, data + (0, _checksums$3.mod10)(data), options));
1788
- }
1789
-
1790
- return MSI10;
1791
- }(_MSI3$4.default);
1792
-
1793
- MSI10$1.default = MSI10;
1794
-
1795
- var MSI11$1 = {};
1796
-
1797
- Object.defineProperty(MSI11$1, "__esModule", {
1798
- value: true
1799
- });
1800
-
1801
- var _MSI2$3 = MSI$1;
1802
-
1803
- var _MSI3$3 = _interopRequireDefault$e(_MSI2$3);
1804
-
1805
- var _checksums$2 = checksums;
1806
-
1807
- function _interopRequireDefault$e(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1808
-
1809
- function _classCallCheck$b(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1810
-
1811
- function _possibleConstructorReturn$7(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1812
-
1813
- function _inherits$7(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1814
-
1815
- var MSI11 = function (_MSI) {
1816
- _inherits$7(MSI11, _MSI);
1817
-
1818
- function MSI11(data, options) {
1819
- _classCallCheck$b(this, MSI11);
1820
-
1821
- return _possibleConstructorReturn$7(this, (MSI11.__proto__ || Object.getPrototypeOf(MSI11)).call(this, data + (0, _checksums$2.mod11)(data), options));
1822
- }
1823
-
1824
- return MSI11;
1825
- }(_MSI3$3.default);
1826
-
1827
- MSI11$1.default = MSI11;
1828
-
1829
- var MSI1010$1 = {};
1830
-
1831
- Object.defineProperty(MSI1010$1, "__esModule", {
1832
- value: true
1833
- });
1834
-
1835
- var _MSI2$2 = MSI$1;
1836
-
1837
- var _MSI3$2 = _interopRequireDefault$d(_MSI2$2);
1838
-
1839
- var _checksums$1 = checksums;
1840
-
1841
- function _interopRequireDefault$d(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1842
-
1843
- function _classCallCheck$a(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1844
-
1845
- function _possibleConstructorReturn$6(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1846
-
1847
- function _inherits$6(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1848
-
1849
- var MSI1010 = function (_MSI) {
1850
- _inherits$6(MSI1010, _MSI);
1851
-
1852
- function MSI1010(data, options) {
1853
- _classCallCheck$a(this, MSI1010);
1854
-
1855
- data += (0, _checksums$1.mod10)(data);
1856
- data += (0, _checksums$1.mod10)(data);
1857
- return _possibleConstructorReturn$6(this, (MSI1010.__proto__ || Object.getPrototypeOf(MSI1010)).call(this, data, options));
1858
- }
1859
-
1860
- return MSI1010;
1861
- }(_MSI3$2.default);
1862
-
1863
- MSI1010$1.default = MSI1010;
1864
-
1865
- var MSI1110$1 = {};
1866
-
1867
- Object.defineProperty(MSI1110$1, "__esModule", {
1868
- value: true
1869
- });
1870
-
1871
- var _MSI2$1 = MSI$1;
1872
-
1873
- var _MSI3$1 = _interopRequireDefault$c(_MSI2$1);
1874
-
1875
- var _checksums = checksums;
1876
-
1877
- function _interopRequireDefault$c(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1878
-
1879
- function _classCallCheck$9(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1880
-
1881
- function _possibleConstructorReturn$5(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1882
-
1883
- function _inherits$5(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
1884
-
1885
- var MSI1110 = function (_MSI) {
1886
- _inherits$5(MSI1110, _MSI);
1887
-
1888
- function MSI1110(data, options) {
1889
- _classCallCheck$9(this, MSI1110);
1890
-
1891
- data += (0, _checksums.mod11)(data);
1892
- data += (0, _checksums.mod10)(data);
1893
- return _possibleConstructorReturn$5(this, (MSI1110.__proto__ || Object.getPrototypeOf(MSI1110)).call(this, data, options));
1894
- }
1895
-
1896
- return MSI1110;
1897
- }(_MSI3$1.default);
1898
-
1899
- MSI1110$1.default = MSI1110;
1900
-
1901
- Object.defineProperty(MSI$2, "__esModule", {
1902
- value: true
1903
- });
1904
- MSI$2.MSI1110 = MSI$2.MSI1010 = MSI$2.MSI11 = MSI$2.MSI10 = MSI$2.MSI = undefined;
1905
-
1906
- var _MSI$1 = MSI$1;
1907
-
1908
- var _MSI2 = _interopRequireDefault$b(_MSI$1);
1909
-
1910
- var _MSI3 = MSI10$1;
1911
-
1912
- var _MSI4 = _interopRequireDefault$b(_MSI3);
1913
-
1914
- var _MSI5 = MSI11$1;
1915
-
1916
- var _MSI6 = _interopRequireDefault$b(_MSI5);
1917
-
1918
- var _MSI7 = MSI1010$1;
1919
-
1920
- var _MSI8 = _interopRequireDefault$b(_MSI7);
1921
-
1922
- var _MSI9 = MSI1110$1;
1923
-
1924
- var _MSI10 = _interopRequireDefault$b(_MSI9);
1925
-
1926
- function _interopRequireDefault$b(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1927
-
1928
- MSI$2.MSI = _MSI2.default;
1929
- MSI$2.MSI10 = _MSI4.default;
1930
- MSI$2.MSI11 = _MSI6.default;
1931
- MSI$2.MSI1010 = _MSI8.default;
1932
- MSI$2.MSI1110 = _MSI10.default;
1933
-
1934
- var pharmacode$1 = {};
1935
-
1936
- Object.defineProperty(pharmacode$1, "__esModule", {
1937
- value: true
1938
- });
1939
- pharmacode$1.pharmacode = undefined;
1940
-
1941
- var _createClass$7 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
1942
-
1943
- var _Barcode2$2 = Barcode$2;
1944
-
1945
- var _Barcode3$2 = _interopRequireDefault$a(_Barcode2$2);
1946
-
1947
- function _interopRequireDefault$a(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1948
-
1949
- function _classCallCheck$8(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1950
-
1951
- function _possibleConstructorReturn$4(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
1952
-
1953
- function _inherits$4(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding documentation
1954
- // http://www.gomaro.ch/ftproot/Laetus_PHARMA-CODE.pdf
1955
-
1956
- var pharmacode = function (_Barcode) {
1957
- _inherits$4(pharmacode, _Barcode);
1958
-
1959
- function pharmacode(data, options) {
1960
- _classCallCheck$8(this, pharmacode);
1961
-
1962
- var _this = _possibleConstructorReturn$4(this, (pharmacode.__proto__ || Object.getPrototypeOf(pharmacode)).call(this, data, options));
1963
-
1964
- _this.number = parseInt(data, 10);
1965
- return _this;
1966
- }
1967
-
1968
- _createClass$7(pharmacode, [{
1969
- key: "encode",
1970
- value: function encode() {
1971
- var z = this.number;
1972
- var result = "";
1973
-
1974
- // http://i.imgur.com/RMm4UDJ.png
1975
- // (source: http://www.gomaro.ch/ftproot/Laetus_PHARMA-CODE.pdf, page: 34)
1976
- while (!isNaN(z) && z != 0) {
1977
- if (z % 2 === 0) {
1978
- // Even
1979
- result = "11100" + result;
1980
- z = (z - 2) / 2;
1981
- } else {
1982
- // Odd
1983
- result = "100" + result;
1984
- z = (z - 1) / 2;
1985
- }
1986
- }
1987
-
1988
- // Remove the two last zeroes
1989
- result = result.slice(0, -2);
1990
-
1991
- return {
1992
- data: result,
1993
- text: this.text
1994
- };
1995
- }
1996
- }, {
1997
- key: "valid",
1998
- value: function valid() {
1999
- return this.number >= 3 && this.number <= 131070;
2000
- }
2001
- }]);
2002
-
2003
- return pharmacode;
2004
- }(_Barcode3$2.default);
2005
-
2006
- pharmacode$1.pharmacode = pharmacode;
2007
-
2008
- var codabar$1 = {};
2009
-
2010
- Object.defineProperty(codabar$1, "__esModule", {
2011
- value: true
2012
- });
2013
- codabar$1.codabar = undefined;
2014
-
2015
- var _createClass$6 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2016
-
2017
- var _Barcode2$1 = Barcode$2;
2018
-
2019
- var _Barcode3$1 = _interopRequireDefault$9(_Barcode2$1);
2020
-
2021
- function _interopRequireDefault$9(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2022
-
2023
- function _classCallCheck$7(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2024
-
2025
- function _possibleConstructorReturn$3(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
2026
-
2027
- function _inherits$3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Encoding specification:
2028
- // http://www.barcodeisland.com/codabar.phtml
2029
-
2030
- var codabar = function (_Barcode) {
2031
- _inherits$3(codabar, _Barcode);
2032
-
2033
- function codabar(data, options) {
2034
- _classCallCheck$7(this, codabar);
2035
-
2036
- if (data.search(/^[0-9\-\$\:\.\+\/]+$/) === 0) {
2037
- data = "A" + data + "A";
2038
- }
2039
-
2040
- var _this = _possibleConstructorReturn$3(this, (codabar.__proto__ || Object.getPrototypeOf(codabar)).call(this, data.toUpperCase(), options));
2041
-
2042
- _this.text = _this.options.text || _this.text.replace(/[A-D]/g, '');
2043
- return _this;
2044
- }
2045
-
2046
- _createClass$6(codabar, [{
2047
- key: "valid",
2048
- value: function valid() {
2049
- return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/) !== -1;
2050
- }
2051
- }, {
2052
- key: "encode",
2053
- value: function encode() {
2054
- var result = [];
2055
- var encodings = this.getEncodings();
2056
- for (var i = 0; i < this.data.length; i++) {
2057
- result.push(encodings[this.data.charAt(i)]);
2058
- // for all characters except the last, append a narrow-space ("0")
2059
- if (i !== this.data.length - 1) {
2060
- result.push("0");
2061
- }
2062
- }
2063
- return {
2064
- text: this.text,
2065
- data: result.join('')
2066
- };
2067
- }
2068
- }, {
2069
- key: "getEncodings",
2070
- value: function getEncodings() {
2071
- return {
2072
- "0": "101010011",
2073
- "1": "101011001",
2074
- "2": "101001011",
2075
- "3": "110010101",
2076
- "4": "101101001",
2077
- "5": "110101001",
2078
- "6": "100101011",
2079
- "7": "100101101",
2080
- "8": "100110101",
2081
- "9": "110100101",
2082
- "-": "101001101",
2083
- "$": "101100101",
2084
- ":": "1101011011",
2085
- "/": "1101101011",
2086
- ".": "1101101101",
2087
- "+": "1011011011",
2088
- "A": "1011001001",
2089
- "B": "1001001011",
2090
- "C": "1010010011",
2091
- "D": "1010011001"
2092
- };
2093
- }
2094
- }]);
2095
-
2096
- return codabar;
2097
- }(_Barcode3$1.default);
2098
-
2099
- codabar$1.codabar = codabar;
2100
-
2101
- var GenericBarcode$1 = {};
2102
-
2103
- Object.defineProperty(GenericBarcode$1, "__esModule", {
2104
- value: true
2105
- });
2106
- GenericBarcode$1.GenericBarcode = undefined;
2107
-
2108
- var _createClass$5 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2109
-
2110
- var _Barcode2 = Barcode$2;
2111
-
2112
- var _Barcode3 = _interopRequireDefault$8(_Barcode2);
2113
-
2114
- function _interopRequireDefault$8(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2115
-
2116
- function _classCallCheck$6(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2117
-
2118
- function _possibleConstructorReturn$2(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
2119
-
2120
- function _inherits$2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
2121
-
2122
- var GenericBarcode = function (_Barcode) {
2123
- _inherits$2(GenericBarcode, _Barcode);
2124
-
2125
- function GenericBarcode(data, options) {
2126
- _classCallCheck$6(this, GenericBarcode);
2127
-
2128
- return _possibleConstructorReturn$2(this, (GenericBarcode.__proto__ || Object.getPrototypeOf(GenericBarcode)).call(this, data, options)); // Sets this.data and this.text
2129
- }
2130
-
2131
- // Return the corresponding binary numbers for the data provided
2132
-
2133
-
2134
- _createClass$5(GenericBarcode, [{
2135
- key: "encode",
2136
- value: function encode() {
2137
- return {
2138
- data: "10101010101010101010101010101010101010101",
2139
- text: this.text
2140
- };
2141
- }
2142
-
2143
- // Resturn true/false if the string provided is valid for this encoder
2144
-
2145
- }, {
2146
- key: "valid",
2147
- value: function valid() {
2148
- return true;
2149
- }
2150
- }]);
2151
-
2152
- return GenericBarcode;
2153
- }(_Barcode3.default);
2154
-
2155
- GenericBarcode$1.GenericBarcode = GenericBarcode;
2156
-
2157
- Object.defineProperty(barcodes, "__esModule", {
2158
- value: true
2159
- });
2160
-
2161
- var _CODE = CODE39$1;
2162
-
2163
- var _CODE2 = CODE128$2;
2164
-
2165
- var _EAN_UPC = EAN_UPC;
2166
-
2167
- var _ITF = ITF$2;
2168
-
2169
- var _MSI = MSI$2;
2170
-
2171
- var _pharmacode = pharmacode$1;
2172
-
2173
- var _codabar = codabar$1;
2174
-
2175
- var _GenericBarcode = GenericBarcode$1;
2176
-
2177
- barcodes.default = {
2178
- CODE39: _CODE.CODE39,
2179
- CODE128: _CODE2.CODE128, CODE128A: _CODE2.CODE128A, CODE128B: _CODE2.CODE128B, CODE128C: _CODE2.CODE128C,
2180
- EAN13: _EAN_UPC.EAN13, EAN8: _EAN_UPC.EAN8, EAN5: _EAN_UPC.EAN5, EAN2: _EAN_UPC.EAN2, UPC: _EAN_UPC.UPC, UPCE: _EAN_UPC.UPCE,
2181
- ITF14: _ITF.ITF14,
2182
- ITF: _ITF.ITF,
2183
- MSI: _MSI.MSI, MSI10: _MSI.MSI10, MSI11: _MSI.MSI11, MSI1010: _MSI.MSI1010, MSI1110: _MSI.MSI1110,
2184
- pharmacode: _pharmacode.pharmacode,
2185
- codabar: _codabar.codabar,
2186
- GenericBarcode: _GenericBarcode.GenericBarcode
2187
- };
2188
-
2189
- var merge = {};
2190
-
2191
- Object.defineProperty(merge, "__esModule", {
2192
- value: true
2193
- });
2194
-
2195
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
2196
-
2197
- merge.default = function (old, replaceObj) {
2198
- return _extends({}, old, replaceObj);
2199
- };
2200
-
2201
- var linearizeEncodings$1 = {};
2202
-
2203
- Object.defineProperty(linearizeEncodings$1, "__esModule", {
2204
- value: true
2205
- });
2206
- linearizeEncodings$1.default = linearizeEncodings;
2207
-
2208
- // Encodings can be nestled like [[1-1, 1-2], 2, [3-1, 3-2]
2209
- // Convert to [1-1, 1-2, 2, 3-1, 3-2]
2210
-
2211
- function linearizeEncodings(encodings) {
2212
- var linearEncodings = [];
2213
- function nextLevel(encoded) {
2214
- if (Array.isArray(encoded)) {
2215
- for (var i = 0; i < encoded.length; i++) {
2216
- nextLevel(encoded[i]);
2217
- }
2218
- } else {
2219
- encoded.text = encoded.text || "";
2220
- encoded.data = encoded.data || "";
2221
- linearEncodings.push(encoded);
2222
- }
2223
- }
2224
- nextLevel(encodings);
2225
-
2226
- return linearEncodings;
2227
- }
2228
-
2229
- var fixOptions$1 = {};
2230
-
2231
- Object.defineProperty(fixOptions$1, "__esModule", {
2232
- value: true
2233
- });
2234
- fixOptions$1.default = fixOptions;
2235
-
2236
-
2237
- function fixOptions(options) {
2238
- // Fix the margins
2239
- options.marginTop = options.marginTop || options.margin;
2240
- options.marginBottom = options.marginBottom || options.margin;
2241
- options.marginRight = options.marginRight || options.margin;
2242
- options.marginLeft = options.marginLeft || options.margin;
2243
-
2244
- return options;
2245
- }
2246
-
2247
- var getRenderProperties$1 = {};
2248
-
2249
- var getOptionsFromElement$1 = {};
2250
-
2251
- var optionsFromStrings$1 = {};
2252
-
2253
- Object.defineProperty(optionsFromStrings$1, "__esModule", {
2254
- value: true
2255
- });
2256
- optionsFromStrings$1.default = optionsFromStrings;
2257
-
2258
- // Convert string to integers/booleans where it should be
2259
-
2260
- function optionsFromStrings(options) {
2261
- var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];
2262
-
2263
- for (var intOption in intOptions) {
2264
- if (intOptions.hasOwnProperty(intOption)) {
2265
- intOption = intOptions[intOption];
2266
- if (typeof options[intOption] === "string") {
2267
- options[intOption] = parseInt(options[intOption], 10);
2268
- }
2269
- }
2270
- }
2271
-
2272
- if (typeof options["displayValue"] === "string") {
2273
- options["displayValue"] = options["displayValue"] != "false";
2274
- }
2275
-
2276
- return options;
2277
- }
2278
-
2279
- var defaults$1 = {};
2280
-
2281
- Object.defineProperty(defaults$1, "__esModule", {
2282
- value: true
2283
- });
2284
- var defaults = {
2285
- width: 2,
2286
- height: 100,
2287
- format: "auto",
2288
- displayValue: true,
2289
- fontOptions: "",
2290
- font: "monospace",
2291
- text: undefined,
2292
- textAlign: "center",
2293
- textPosition: "bottom",
2294
- textMargin: 2,
2295
- fontSize: 20,
2296
- background: "#ffffff",
2297
- lineColor: "#000000",
2298
- margin: 10,
2299
- marginTop: undefined,
2300
- marginBottom: undefined,
2301
- marginLeft: undefined,
2302
- marginRight: undefined,
2303
- valid: function valid() {}
2304
- };
2305
-
2306
- defaults$1.default = defaults;
2307
-
2308
- Object.defineProperty(getOptionsFromElement$1, "__esModule", {
2309
- value: true
2310
- });
2311
-
2312
- var _optionsFromStrings$1 = optionsFromStrings$1;
2313
-
2314
- var _optionsFromStrings2$1 = _interopRequireDefault$7(_optionsFromStrings$1);
2315
-
2316
- var _defaults$1 = defaults$1;
2317
-
2318
- var _defaults2$1 = _interopRequireDefault$7(_defaults$1);
2319
-
2320
- function _interopRequireDefault$7(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2321
-
2322
- function getOptionsFromElement(element) {
2323
- var options = {};
2324
- for (var property in _defaults2$1.default) {
2325
- if (_defaults2$1.default.hasOwnProperty(property)) {
2326
- // jsbarcode-*
2327
- if (element.hasAttribute("jsbarcode-" + property.toLowerCase())) {
2328
- options[property] = element.getAttribute("jsbarcode-" + property.toLowerCase());
2329
- }
2330
-
2331
- // data-*
2332
- if (element.hasAttribute("data-" + property.toLowerCase())) {
2333
- options[property] = element.getAttribute("data-" + property.toLowerCase());
2334
- }
2335
- }
2336
- }
2337
-
2338
- options["value"] = element.getAttribute("jsbarcode-value") || element.getAttribute("data-value");
2339
-
2340
- // Since all atributes are string they need to be converted to integers
2341
- options = (0, _optionsFromStrings2$1.default)(options);
2342
-
2343
- return options;
2344
- }
2345
-
2346
- getOptionsFromElement$1.default = getOptionsFromElement;
2347
-
2348
- var renderers = {};
2349
-
2350
- var canvas = {};
2351
-
2352
- var shared = {};
2353
-
2354
- Object.defineProperty(shared, "__esModule", {
2355
- value: true
2356
- });
2357
- shared.getTotalWidthOfEncodings = shared.calculateEncodingAttributes = shared.getBarcodePadding = shared.getEncodingHeight = shared.getMaximumHeightOfEncodings = undefined;
2358
-
2359
- var _merge$3 = merge;
2360
-
2361
- var _merge2$3 = _interopRequireDefault$6(_merge$3);
2362
-
2363
- function _interopRequireDefault$6(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2364
-
2365
- function getEncodingHeight(encoding, options) {
2366
- return options.height + (options.displayValue && encoding.text.length > 0 ? options.fontSize + options.textMargin : 0) + options.marginTop + options.marginBottom;
2367
- }
2368
-
2369
- function getBarcodePadding(textWidth, barcodeWidth, options) {
2370
- if (options.displayValue && barcodeWidth < textWidth) {
2371
- if (options.textAlign == "center") {
2372
- return Math.floor((textWidth - barcodeWidth) / 2);
2373
- } else if (options.textAlign == "left") {
2374
- return 0;
2375
- } else if (options.textAlign == "right") {
2376
- return Math.floor(textWidth - barcodeWidth);
2377
- }
2378
- }
2379
- return 0;
2380
- }
2381
-
2382
- function calculateEncodingAttributes(encodings, barcodeOptions, context) {
2383
- for (var i = 0; i < encodings.length; i++) {
2384
- var encoding = encodings[i];
2385
- var options = (0, _merge2$3.default)(barcodeOptions, encoding.options);
2386
-
2387
- // Calculate the width of the encoding
2388
- var textWidth;
2389
- if (options.displayValue) {
2390
- textWidth = messureText(encoding.text, options, context);
2391
- } else {
2392
- textWidth = 0;
2393
- }
2394
-
2395
- var barcodeWidth = encoding.data.length * options.width;
2396
- encoding.width = Math.ceil(Math.max(textWidth, barcodeWidth));
2397
-
2398
- encoding.height = getEncodingHeight(encoding, options);
2399
-
2400
- encoding.barcodePadding = getBarcodePadding(textWidth, barcodeWidth, options);
2401
- }
2402
- }
2403
-
2404
- function getTotalWidthOfEncodings(encodings) {
2405
- var totalWidth = 0;
2406
- for (var i = 0; i < encodings.length; i++) {
2407
- totalWidth += encodings[i].width;
2408
- }
2409
- return totalWidth;
2410
- }
2411
-
2412
- function getMaximumHeightOfEncodings(encodings) {
2413
- var maxHeight = 0;
2414
- for (var i = 0; i < encodings.length; i++) {
2415
- if (encodings[i].height > maxHeight) {
2416
- maxHeight = encodings[i].height;
2417
- }
2418
- }
2419
- return maxHeight;
2420
- }
2421
-
2422
- function messureText(string, options, context) {
2423
- var ctx;
2424
-
2425
- if (context) {
2426
- ctx = context;
2427
- } else if (typeof document !== "undefined") {
2428
- ctx = document.createElement("canvas").getContext("2d");
2429
- } else {
2430
- // If the text cannot be messured we will return 0.
2431
- // This will make some barcode with big text render incorrectly
2432
- return 0;
2433
- }
2434
- ctx.font = options.fontOptions + " " + options.fontSize + "px " + options.font;
2435
-
2436
- // Calculate the width of the encoding
2437
- var measureTextResult = ctx.measureText(string);
2438
- if (!measureTextResult) {
2439
- // Some implementations don't implement measureText and return undefined.
2440
- // If the text cannot be measured we will return 0.
2441
- // This will make some barcode with big text render incorrectly
2442
- return 0;
2443
- }
2444
- var size = measureTextResult.width;
2445
- return size;
2446
- }
2447
-
2448
- shared.getMaximumHeightOfEncodings = getMaximumHeightOfEncodings;
2449
- shared.getEncodingHeight = getEncodingHeight;
2450
- shared.getBarcodePadding = getBarcodePadding;
2451
- shared.calculateEncodingAttributes = calculateEncodingAttributes;
2452
- shared.getTotalWidthOfEncodings = getTotalWidthOfEncodings;
2453
-
2454
- Object.defineProperty(canvas, "__esModule", {
2455
- value: true
2456
- });
2457
-
2458
- var _createClass$4 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2459
-
2460
- var _merge$2 = merge;
2461
-
2462
- var _merge2$2 = _interopRequireDefault$5(_merge$2);
2463
-
2464
- var _shared$1 = shared;
2465
-
2466
- function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2467
-
2468
- function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2469
-
2470
- var CanvasRenderer = function () {
2471
- function CanvasRenderer(canvas, encodings, options) {
2472
- _classCallCheck$5(this, CanvasRenderer);
2473
-
2474
- this.canvas = canvas;
2475
- this.encodings = encodings;
2476
- this.options = options;
2477
- }
2478
-
2479
- _createClass$4(CanvasRenderer, [{
2480
- key: "render",
2481
- value: function render() {
2482
- // Abort if the browser does not support HTML5 canvas
2483
- if (!this.canvas.getContext) {
2484
- throw new Error('The browser does not support canvas.');
2485
- }
2486
-
2487
- this.prepareCanvas();
2488
- for (var i = 0; i < this.encodings.length; i++) {
2489
- var encodingOptions = (0, _merge2$2.default)(this.options, this.encodings[i].options);
2490
-
2491
- this.drawCanvasBarcode(encodingOptions, this.encodings[i]);
2492
- this.drawCanvasText(encodingOptions, this.encodings[i]);
2493
-
2494
- this.moveCanvasDrawing(this.encodings[i]);
2495
- }
2496
-
2497
- this.restoreCanvas();
2498
- }
2499
- }, {
2500
- key: "prepareCanvas",
2501
- value: function prepareCanvas() {
2502
- // Get the canvas context
2503
- var ctx = this.canvas.getContext("2d");
2504
-
2505
- ctx.save();
2506
-
2507
- (0, _shared$1.calculateEncodingAttributes)(this.encodings, this.options, ctx);
2508
- var totalWidth = (0, _shared$1.getTotalWidthOfEncodings)(this.encodings);
2509
- var maxHeight = (0, _shared$1.getMaximumHeightOfEncodings)(this.encodings);
2510
-
2511
- this.canvas.width = totalWidth + this.options.marginLeft + this.options.marginRight;
2512
-
2513
- this.canvas.height = maxHeight;
2514
-
2515
- // Paint the canvas
2516
- ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
2517
- if (this.options.background) {
2518
- ctx.fillStyle = this.options.background;
2519
- ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
2520
- }
2521
-
2522
- ctx.translate(this.options.marginLeft, 0);
2523
- }
2524
- }, {
2525
- key: "drawCanvasBarcode",
2526
- value: function drawCanvasBarcode(options, encoding) {
2527
- // Get the canvas context
2528
- var ctx = this.canvas.getContext("2d");
2529
-
2530
- var binary = encoding.data;
2531
-
2532
- // Creates the barcode out of the encoded binary
2533
- var yFrom;
2534
- if (options.textPosition == "top") {
2535
- yFrom = options.marginTop + options.fontSize + options.textMargin;
2536
- } else {
2537
- yFrom = options.marginTop;
2538
- }
2539
-
2540
- ctx.fillStyle = options.lineColor;
2541
-
2542
- for (var b = 0; b < binary.length; b++) {
2543
- var x = b * options.width + encoding.barcodePadding;
2544
-
2545
- if (binary[b] === "1") {
2546
- ctx.fillRect(x, yFrom, options.width, options.height);
2547
- } else if (binary[b]) {
2548
- ctx.fillRect(x, yFrom, options.width, options.height * binary[b]);
2549
- }
2550
- }
2551
- }
2552
- }, {
2553
- key: "drawCanvasText",
2554
- value: function drawCanvasText(options, encoding) {
2555
- // Get the canvas context
2556
- var ctx = this.canvas.getContext("2d");
2557
-
2558
- var font = options.fontOptions + " " + options.fontSize + "px " + options.font;
2559
-
2560
- // Draw the text if displayValue is set
2561
- if (options.displayValue) {
2562
- var x, y;
2563
-
2564
- if (options.textPosition == "top") {
2565
- y = options.marginTop + options.fontSize - options.textMargin;
2566
- } else {
2567
- y = options.height + options.textMargin + options.marginTop + options.fontSize;
2568
- }
2569
-
2570
- ctx.font = font;
2571
-
2572
- // Draw the text in the correct X depending on the textAlign option
2573
- if (options.textAlign == "left" || encoding.barcodePadding > 0) {
2574
- x = 0;
2575
- ctx.textAlign = 'left';
2576
- } else if (options.textAlign == "right") {
2577
- x = encoding.width - 1;
2578
- ctx.textAlign = 'right';
2579
- }
2580
- // In all other cases, center the text
2581
- else {
2582
- x = encoding.width / 2;
2583
- ctx.textAlign = 'center';
2584
- }
2585
-
2586
- ctx.fillText(encoding.text, x, y);
2587
- }
2588
- }
2589
- }, {
2590
- key: "moveCanvasDrawing",
2591
- value: function moveCanvasDrawing(encoding) {
2592
- var ctx = this.canvas.getContext("2d");
2593
-
2594
- ctx.translate(encoding.width, 0);
2595
- }
2596
- }, {
2597
- key: "restoreCanvas",
2598
- value: function restoreCanvas() {
2599
- // Get the canvas context
2600
- var ctx = this.canvas.getContext("2d");
2601
-
2602
- ctx.restore();
2603
- }
2604
- }]);
2605
-
2606
- return CanvasRenderer;
2607
- }();
2608
-
2609
- canvas.default = CanvasRenderer;
2610
-
2611
- var svg = {};
2612
-
2613
- Object.defineProperty(svg, "__esModule", {
2614
- value: true
2615
- });
2616
-
2617
- var _createClass$3 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2618
-
2619
- var _merge$1 = merge;
2620
-
2621
- var _merge2$1 = _interopRequireDefault$4(_merge$1);
2622
-
2623
- var _shared = shared;
2624
-
2625
- function _interopRequireDefault$4(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2626
-
2627
- function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2628
-
2629
- var svgns = "http://www.w3.org/2000/svg";
2630
-
2631
- var SVGRenderer = function () {
2632
- function SVGRenderer(svg, encodings, options) {
2633
- _classCallCheck$4(this, SVGRenderer);
2634
-
2635
- this.svg = svg;
2636
- this.encodings = encodings;
2637
- this.options = options;
2638
- this.document = options.xmlDocument || document;
2639
- }
2640
-
2641
- _createClass$3(SVGRenderer, [{
2642
- key: "render",
2643
- value: function render() {
2644
- var currentX = this.options.marginLeft;
2645
-
2646
- this.prepareSVG();
2647
- for (var i = 0; i < this.encodings.length; i++) {
2648
- var encoding = this.encodings[i];
2649
- var encodingOptions = (0, _merge2$1.default)(this.options, encoding.options);
2650
-
2651
- var group = this.createGroup(currentX, encodingOptions.marginTop, this.svg);
2652
-
2653
- this.setGroupOptions(group, encodingOptions);
2654
-
2655
- this.drawSvgBarcode(group, encodingOptions, encoding);
2656
- this.drawSVGText(group, encodingOptions, encoding);
2657
-
2658
- currentX += encoding.width;
2659
- }
2660
- }
2661
- }, {
2662
- key: "prepareSVG",
2663
- value: function prepareSVG() {
2664
- // Clear the SVG
2665
- while (this.svg.firstChild) {
2666
- this.svg.removeChild(this.svg.firstChild);
2667
- }
2668
-
2669
- (0, _shared.calculateEncodingAttributes)(this.encodings, this.options);
2670
- var totalWidth = (0, _shared.getTotalWidthOfEncodings)(this.encodings);
2671
- var maxHeight = (0, _shared.getMaximumHeightOfEncodings)(this.encodings);
2672
-
2673
- var width = totalWidth + this.options.marginLeft + this.options.marginRight;
2674
- this.setSvgAttributes(width, maxHeight);
2675
-
2676
- if (this.options.background) {
2677
- this.drawRect(0, 0, width, maxHeight, this.svg).setAttribute("style", "fill:" + this.options.background + ";");
2678
- }
2679
- }
2680
- }, {
2681
- key: "drawSvgBarcode",
2682
- value: function drawSvgBarcode(parent, options, encoding) {
2683
- var binary = encoding.data;
2684
-
2685
- // Creates the barcode out of the encoded binary
2686
- var yFrom;
2687
- if (options.textPosition == "top") {
2688
- yFrom = options.fontSize + options.textMargin;
2689
- } else {
2690
- yFrom = 0;
2691
- }
2692
-
2693
- var barWidth = 0;
2694
- var x = 0;
2695
- for (var b = 0; b < binary.length; b++) {
2696
- x = b * options.width + encoding.barcodePadding;
2697
-
2698
- if (binary[b] === "1") {
2699
- barWidth++;
2700
- } else if (barWidth > 0) {
2701
- this.drawRect(x - options.width * barWidth, yFrom, options.width * barWidth, options.height, parent);
2702
- barWidth = 0;
2703
- }
2704
- }
2705
-
2706
- // Last draw is needed since the barcode ends with 1
2707
- if (barWidth > 0) {
2708
- this.drawRect(x - options.width * (barWidth - 1), yFrom, options.width * barWidth, options.height, parent);
2709
- }
2710
- }
2711
- }, {
2712
- key: "drawSVGText",
2713
- value: function drawSVGText(parent, options, encoding) {
2714
- var textElem = this.document.createElementNS(svgns, 'text');
2715
-
2716
- // Draw the text if displayValue is set
2717
- if (options.displayValue) {
2718
- var x, y;
2719
-
2720
- textElem.setAttribute("style", "font:" + options.fontOptions + " " + options.fontSize + "px " + options.font);
2721
-
2722
- if (options.textPosition == "top") {
2723
- y = options.fontSize - options.textMargin;
2724
- } else {
2725
- y = options.height + options.textMargin + options.fontSize;
2726
- }
2727
-
2728
- // Draw the text in the correct X depending on the textAlign option
2729
- if (options.textAlign == "left" || encoding.barcodePadding > 0) {
2730
- x = 0;
2731
- textElem.setAttribute("text-anchor", "start");
2732
- } else if (options.textAlign == "right") {
2733
- x = encoding.width - 1;
2734
- textElem.setAttribute("text-anchor", "end");
2735
- }
2736
- // In all other cases, center the text
2737
- else {
2738
- x = encoding.width / 2;
2739
- textElem.setAttribute("text-anchor", "middle");
2740
- }
2741
-
2742
- textElem.setAttribute("x", x);
2743
- textElem.setAttribute("y", y);
2744
-
2745
- textElem.appendChild(this.document.createTextNode(encoding.text));
2746
-
2747
- parent.appendChild(textElem);
2748
- }
2749
- }
2750
- }, {
2751
- key: "setSvgAttributes",
2752
- value: function setSvgAttributes(width, height) {
2753
- var svg = this.svg;
2754
- svg.setAttribute("width", width + "px");
2755
- svg.setAttribute("height", height + "px");
2756
- svg.setAttribute("x", "0px");
2757
- svg.setAttribute("y", "0px");
2758
- svg.setAttribute("viewBox", "0 0 " + width + " " + height);
2759
-
2760
- svg.setAttribute("xmlns", svgns);
2761
- svg.setAttribute("version", "1.1");
2762
-
2763
- svg.setAttribute("style", "transform: translate(0,0)");
2764
- }
2765
- }, {
2766
- key: "createGroup",
2767
- value: function createGroup(x, y, parent) {
2768
- var group = this.document.createElementNS(svgns, 'g');
2769
- group.setAttribute("transform", "translate(" + x + ", " + y + ")");
2770
-
2771
- parent.appendChild(group);
2772
-
2773
- return group;
2774
- }
2775
- }, {
2776
- key: "setGroupOptions",
2777
- value: function setGroupOptions(group, options) {
2778
- group.setAttribute("style", "fill:" + options.lineColor + ";");
2779
- }
2780
- }, {
2781
- key: "drawRect",
2782
- value: function drawRect(x, y, width, height, parent) {
2783
- var rect = this.document.createElementNS(svgns, 'rect');
2784
-
2785
- rect.setAttribute("x", x);
2786
- rect.setAttribute("y", y);
2787
- rect.setAttribute("width", width);
2788
- rect.setAttribute("height", height);
2789
-
2790
- parent.appendChild(rect);
2791
-
2792
- return rect;
2793
- }
2794
- }]);
2795
-
2796
- return SVGRenderer;
2797
- }();
2798
-
2799
- svg.default = SVGRenderer;
2800
-
2801
- var object = {};
2802
-
2803
- Object.defineProperty(object, "__esModule", {
2804
- value: true
2805
- });
2806
-
2807
- var _createClass$2 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2808
-
2809
- function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2810
-
2811
- var ObjectRenderer = function () {
2812
- function ObjectRenderer(object, encodings, options) {
2813
- _classCallCheck$3(this, ObjectRenderer);
2814
-
2815
- this.object = object;
2816
- this.encodings = encodings;
2817
- this.options = options;
2818
- }
2819
-
2820
- _createClass$2(ObjectRenderer, [{
2821
- key: "render",
2822
- value: function render() {
2823
- this.object.encodings = this.encodings;
2824
- }
2825
- }]);
2826
-
2827
- return ObjectRenderer;
2828
- }();
2829
-
2830
- object.default = ObjectRenderer;
2831
-
2832
- Object.defineProperty(renderers, "__esModule", {
2833
- value: true
2834
- });
2835
-
2836
- var _canvas = canvas;
2837
-
2838
- var _canvas2 = _interopRequireDefault$3(_canvas);
2839
-
2840
- var _svg = svg;
2841
-
2842
- var _svg2 = _interopRequireDefault$3(_svg);
2843
-
2844
- var _object = object;
2845
-
2846
- var _object2 = _interopRequireDefault$3(_object);
2847
-
2848
- function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2849
-
2850
- renderers.default = { CanvasRenderer: _canvas2.default, SVGRenderer: _svg2.default, ObjectRenderer: _object2.default };
2851
-
2852
- var exceptions = {};
2853
-
2854
- Object.defineProperty(exceptions, "__esModule", {
2855
- value: true
2856
- });
2857
-
2858
- function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2859
-
2860
- function _possibleConstructorReturn$1(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
2861
-
2862
- function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
2863
-
2864
- var InvalidInputException = function (_Error) {
2865
- _inherits$1(InvalidInputException, _Error);
2866
-
2867
- function InvalidInputException(symbology, input) {
2868
- _classCallCheck$2(this, InvalidInputException);
2869
-
2870
- var _this = _possibleConstructorReturn$1(this, (InvalidInputException.__proto__ || Object.getPrototypeOf(InvalidInputException)).call(this));
2871
-
2872
- _this.name = "InvalidInputException";
2873
-
2874
- _this.symbology = symbology;
2875
- _this.input = input;
2876
-
2877
- _this.message = '"' + _this.input + '" is not a valid input for ' + _this.symbology;
2878
- return _this;
2879
- }
2880
-
2881
- return InvalidInputException;
2882
- }(Error);
2883
-
2884
- var InvalidElementException = function (_Error2) {
2885
- _inherits$1(InvalidElementException, _Error2);
2886
-
2887
- function InvalidElementException() {
2888
- _classCallCheck$2(this, InvalidElementException);
2889
-
2890
- var _this2 = _possibleConstructorReturn$1(this, (InvalidElementException.__proto__ || Object.getPrototypeOf(InvalidElementException)).call(this));
2891
-
2892
- _this2.name = "InvalidElementException";
2893
- _this2.message = "Not supported type to render on";
2894
- return _this2;
2895
- }
2896
-
2897
- return InvalidElementException;
2898
- }(Error);
2899
-
2900
- var NoElementException = function (_Error3) {
2901
- _inherits$1(NoElementException, _Error3);
2902
-
2903
- function NoElementException() {
2904
- _classCallCheck$2(this, NoElementException);
2905
-
2906
- var _this3 = _possibleConstructorReturn$1(this, (NoElementException.__proto__ || Object.getPrototypeOf(NoElementException)).call(this));
2907
-
2908
- _this3.name = "NoElementException";
2909
- _this3.message = "No element to render on.";
2910
- return _this3;
2911
- }
2912
-
2913
- return NoElementException;
2914
- }(Error);
2915
-
2916
- exceptions.InvalidInputException = InvalidInputException;
2917
- exceptions.InvalidElementException = InvalidElementException;
2918
- exceptions.NoElementException = NoElementException;
2919
-
2920
- Object.defineProperty(getRenderProperties$1, "__esModule", {
2921
- value: true
2922
- });
2923
-
2924
- var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* global HTMLImageElement */
2925
- /* global HTMLCanvasElement */
2926
- /* global SVGElement */
2927
-
2928
- var _getOptionsFromElement = getOptionsFromElement$1;
2929
-
2930
- var _getOptionsFromElement2 = _interopRequireDefault$2(_getOptionsFromElement);
2931
-
2932
- var _renderers = renderers;
2933
-
2934
- var _renderers2 = _interopRequireDefault$2(_renderers);
2935
-
2936
- var _exceptions$1 = exceptions;
2937
-
2938
- function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2939
-
2940
- // Takes an element and returns an object with information about how
2941
- // it should be rendered
2942
- // This could also return an array with these objects
2943
- // {
2944
- // element: The element that the renderer should draw on
2945
- // renderer: The name of the renderer
2946
- // afterRender (optional): If something has to done after the renderer
2947
- // completed, calls afterRender (function)
2948
- // options (optional): Options that can be defined in the element
2949
- // }
2950
-
2951
- function getRenderProperties(element) {
2952
- // If the element is a string, query select call again
2953
- if (typeof element === "string") {
2954
- return querySelectedRenderProperties(element);
2955
- }
2956
- // If element is array. Recursivly call with every object in the array
2957
- else if (Array.isArray(element)) {
2958
- var returnArray = [];
2959
- for (var i = 0; i < element.length; i++) {
2960
- returnArray.push(getRenderProperties(element[i]));
2961
- }
2962
- return returnArray;
2963
- }
2964
- // If element, render on canvas and set the uri as src
2965
- else if (typeof HTMLCanvasElement !== 'undefined' && element instanceof HTMLImageElement) {
2966
- return newCanvasRenderProperties(element);
2967
- }
2968
- // If SVG
2969
- else if (element && element.nodeName && element.nodeName.toLowerCase() === 'svg' || typeof SVGElement !== 'undefined' && element instanceof SVGElement) {
2970
- return {
2971
- element: element,
2972
- options: (0, _getOptionsFromElement2.default)(element),
2973
- renderer: _renderers2.default.SVGRenderer
2974
- };
2975
- }
2976
- // If canvas (in browser)
2977
- else if (typeof HTMLCanvasElement !== 'undefined' && element instanceof HTMLCanvasElement) {
2978
- return {
2979
- element: element,
2980
- options: (0, _getOptionsFromElement2.default)(element),
2981
- renderer: _renderers2.default.CanvasRenderer
2982
- };
2983
- }
2984
- // If canvas (in node)
2985
- else if (element && element.getContext) {
2986
- return {
2987
- element: element,
2988
- renderer: _renderers2.default.CanvasRenderer
2989
- };
2990
- } else if (element && (typeof element === "undefined" ? "undefined" : _typeof$1(element)) === 'object' && !element.nodeName) {
2991
- return {
2992
- element: element,
2993
- renderer: _renderers2.default.ObjectRenderer
2994
- };
2995
- } else {
2996
- throw new _exceptions$1.InvalidElementException();
2997
- }
2998
- }
2999
-
3000
- function querySelectedRenderProperties(string) {
3001
- var selector = document.querySelectorAll(string);
3002
- if (selector.length === 0) {
3003
- return undefined;
3004
- } else {
3005
- var returnArray = [];
3006
- for (var i = 0; i < selector.length; i++) {
3007
- returnArray.push(getRenderProperties(selector[i]));
3008
- }
3009
- return returnArray;
3010
- }
3011
- }
3012
-
3013
- function newCanvasRenderProperties(imgElement) {
3014
- var canvas = document.createElement('canvas');
3015
- return {
3016
- element: canvas,
3017
- options: (0, _getOptionsFromElement2.default)(imgElement),
3018
- renderer: _renderers2.default.CanvasRenderer,
3019
- afterRender: function afterRender() {
3020
- imgElement.setAttribute("src", canvas.toDataURL());
3021
- }
3022
- };
3023
- }
3024
-
3025
- getRenderProperties$1.default = getRenderProperties;
3026
-
3027
- var ErrorHandler$1 = {};
3028
-
3029
- Object.defineProperty(ErrorHandler$1, "__esModule", {
3030
- value: true
3031
- });
3032
-
3033
- var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3034
-
3035
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3036
-
3037
- /*eslint no-console: 0 */
3038
-
3039
- var ErrorHandler = function () {
3040
- function ErrorHandler(api) {
3041
- _classCallCheck$1(this, ErrorHandler);
3042
-
3043
- this.api = api;
3044
- }
3045
-
3046
- _createClass$1(ErrorHandler, [{
3047
- key: "handleCatch",
3048
- value: function handleCatch(e) {
3049
- // If babel supported extending of Error in a correct way instanceof would be used here
3050
- if (e.name === "InvalidInputException") {
3051
- if (this.api._options.valid !== this.api._defaults.valid) {
3052
- this.api._options.valid(false);
3053
- } else {
3054
- throw e.message;
3055
- }
3056
- } else {
3057
- throw e;
3058
- }
3059
-
3060
- this.api.render = function () {};
3061
- }
3062
- }, {
3063
- key: "wrapBarcodeCall",
3064
- value: function wrapBarcodeCall(func) {
3065
- try {
3066
- var result = func.apply(undefined, arguments);
3067
- this.api._options.valid(true);
3068
- return result;
3069
- } catch (e) {
3070
- this.handleCatch(e);
3071
-
3072
- return this.api;
3073
- }
3074
- }
3075
- }]);
3076
-
3077
- return ErrorHandler;
3078
- }();
3079
-
3080
- ErrorHandler$1.default = ErrorHandler;
3081
-
3082
- var _barcodes = barcodes;
3083
-
3084
- var _barcodes2 = _interopRequireDefault$1(_barcodes);
3085
-
3086
- var _merge = merge;
3087
-
3088
- var _merge2 = _interopRequireDefault$1(_merge);
3089
-
3090
- var _linearizeEncodings = linearizeEncodings$1;
3091
-
3092
- var _linearizeEncodings2 = _interopRequireDefault$1(_linearizeEncodings);
3093
-
3094
- var _fixOptions = fixOptions$1;
3095
-
3096
- var _fixOptions2 = _interopRequireDefault$1(_fixOptions);
3097
-
3098
- var _getRenderProperties = getRenderProperties$1;
3099
-
3100
- var _getRenderProperties2 = _interopRequireDefault$1(_getRenderProperties);
3101
-
3102
- var _optionsFromStrings = optionsFromStrings$1;
3103
-
3104
- var _optionsFromStrings2 = _interopRequireDefault$1(_optionsFromStrings);
3105
-
3106
- var _ErrorHandler = ErrorHandler$1;
3107
-
3108
- var _ErrorHandler2 = _interopRequireDefault$1(_ErrorHandler);
3109
-
3110
- var _exceptions = exceptions;
3111
-
3112
- var _defaults = defaults$1;
3113
-
3114
- var _defaults2 = _interopRequireDefault$1(_defaults);
3115
-
3116
- function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3117
-
3118
- // The protype of the object returned from the JsBarcode() call
3119
-
3120
-
3121
- // Help functions
3122
- var API = function API() {};
3123
-
3124
- // The first call of the library API
3125
- // Will return an object with all barcodes calls and the data that is used
3126
- // by the renderers
3127
-
3128
-
3129
- // Default values
3130
-
3131
-
3132
- // Exceptions
3133
- // Import all the barcodes
3134
- var JsBarcode = function JsBarcode(element, text, options) {
3135
- var api = new API();
3136
-
3137
- if (typeof element === "undefined") {
3138
- throw Error("No element to render on was provided.");
3139
- }
3140
-
3141
- // Variables that will be pased through the API calls
3142
- api._renderProperties = (0, _getRenderProperties2.default)(element);
3143
- api._encodings = [];
3144
- api._options = _defaults2.default;
3145
- api._errorHandler = new _ErrorHandler2.default(api);
3146
-
3147
- // If text is set, use the simple syntax (render the barcode directly)
3148
- if (typeof text !== "undefined") {
3149
- options = options || {};
3150
-
3151
- if (!options.format) {
3152
- options.format = autoSelectBarcode();
3153
- }
3154
-
3155
- api.options(options)[options.format](text, options).render();
3156
- }
3157
-
3158
- return api;
3159
- };
3160
-
3161
- // To make tests work TODO: remove
3162
- JsBarcode.getModule = function (name) {
3163
- return _barcodes2.default[name];
3164
- };
3165
-
3166
- // Register all barcodes
3167
- for (var name in _barcodes2.default) {
3168
- if (_barcodes2.default.hasOwnProperty(name)) {
3169
- // Security check if the propery is a prototype property
3170
- registerBarcode(_barcodes2.default, name);
3171
- }
3172
- }
3173
- function registerBarcode(barcodes, name) {
3174
- API.prototype[name] = API.prototype[name.toUpperCase()] = API.prototype[name.toLowerCase()] = function (text, options) {
3175
- var api = this;
3176
- return api._errorHandler.wrapBarcodeCall(function () {
3177
- // Ensure text is options.text
3178
- options.text = typeof options.text === 'undefined' ? undefined : '' + options.text;
3179
-
3180
- var newOptions = (0, _merge2.default)(api._options, options);
3181
- newOptions = (0, _optionsFromStrings2.default)(newOptions);
3182
- var Encoder = barcodes[name];
3183
- var encoded = encode(text, Encoder, newOptions);
3184
- api._encodings.push(encoded);
3185
-
3186
- return api;
3187
- });
3188
- };
3189
- }
3190
-
3191
- // encode() handles the Encoder call and builds the binary string to be rendered
3192
- function encode(text, Encoder, options) {
3193
- // Ensure that text is a string
3194
- text = "" + text;
3195
-
3196
- var encoder = new Encoder(text, options);
3197
-
3198
- // If the input is not valid for the encoder, throw error.
3199
- // If the valid callback option is set, call it instead of throwing error
3200
- if (!encoder.valid()) {
3201
- throw new _exceptions.InvalidInputException(encoder.constructor.name, text);
3202
- }
3203
-
3204
- // Make a request for the binary data (and other infromation) that should be rendered
3205
- var encoded = encoder.encode();
3206
-
3207
- // Encodings can be nestled like [[1-1, 1-2], 2, [3-1, 3-2]
3208
- // Convert to [1-1, 1-2, 2, 3-1, 3-2]
3209
- encoded = (0, _linearizeEncodings2.default)(encoded);
3210
-
3211
- // Merge
3212
- for (var i = 0; i < encoded.length; i++) {
3213
- encoded[i].options = (0, _merge2.default)(options, encoded[i].options);
3214
- }
3215
-
3216
- return encoded;
3217
- }
3218
-
3219
- function autoSelectBarcode() {
3220
- // If CODE128 exists. Use it
3221
- if (_barcodes2.default["CODE128"]) {
3222
- return "CODE128";
3223
- }
3224
-
3225
- // Else, take the first (probably only) barcode
3226
- return Object.keys(_barcodes2.default)[0];
3227
- }
3228
-
3229
- // Sets global encoder options
3230
- // Added to the api by the JsBarcode function
3231
- API.prototype.options = function (options) {
3232
- this._options = (0, _merge2.default)(this._options, options);
3233
- return this;
3234
- };
3235
-
3236
- // Will create a blank space (usually in between barcodes)
3237
- API.prototype.blank = function (size) {
3238
- var zeroes = new Array(size + 1).join("0");
3239
- this._encodings.push({ data: zeroes });
3240
- return this;
3241
- };
3242
-
3243
- // Initialize JsBarcode on all HTML elements defined.
3244
- API.prototype.init = function () {
3245
- // Should do nothing if no elements where found
3246
- if (!this._renderProperties) {
3247
- return;
3248
- }
3249
-
3250
- // Make sure renderProperies is an array
3251
- if (!Array.isArray(this._renderProperties)) {
3252
- this._renderProperties = [this._renderProperties];
3253
- }
3254
-
3255
- var renderProperty;
3256
- for (var i in this._renderProperties) {
3257
- renderProperty = this._renderProperties[i];
3258
- var options = (0, _merge2.default)(this._options, renderProperty.options);
3259
-
3260
- if (options.format == "auto") {
3261
- options.format = autoSelectBarcode();
3262
- }
3263
-
3264
- this._errorHandler.wrapBarcodeCall(function () {
3265
- var text = options.value;
3266
- var Encoder = _barcodes2.default[options.format.toUpperCase()];
3267
- var encoded = encode(text, Encoder, options);
3268
-
3269
- render(renderProperty, encoded, options);
3270
- });
3271
- }
3272
- };
3273
-
3274
- // The render API call. Calls the real render function.
3275
- API.prototype.render = function () {
3276
- if (!this._renderProperties) {
3277
- throw new _exceptions.NoElementException();
3278
- }
3279
-
3280
- if (Array.isArray(this._renderProperties)) {
3281
- for (var i = 0; i < this._renderProperties.length; i++) {
3282
- render(this._renderProperties[i], this._encodings, this._options);
3283
- }
3284
- } else {
3285
- render(this._renderProperties, this._encodings, this._options);
3286
- }
3287
-
3288
- return this;
3289
- };
3290
-
3291
- API.prototype._defaults = _defaults2.default;
3292
-
3293
- // Prepares the encodings and calls the renderer
3294
- function render(renderProperties, encodings, options) {
3295
- encodings = (0, _linearizeEncodings2.default)(encodings);
3296
-
3297
- for (var i = 0; i < encodings.length; i++) {
3298
- encodings[i].options = (0, _merge2.default)(options, encodings[i].options);
3299
- (0, _fixOptions2.default)(encodings[i].options);
3300
- }
3301
-
3302
- (0, _fixOptions2.default)(options);
3303
-
3304
- var Renderer = renderProperties.renderer;
3305
- var renderer = new Renderer(renderProperties.element, encodings, options);
3306
- renderer.render();
3307
-
3308
- if (renderProperties.afterRender) {
3309
- renderProperties.afterRender();
3310
- }
3311
- }
3312
-
3313
- // Export to browser
3314
- if (typeof window !== "undefined") {
3315
- window.JsBarcode = JsBarcode;
3316
- }
3317
-
3318
- // Export to jQuery
3319
- /*global jQuery */
3320
- if (typeof jQuery !== 'undefined') {
3321
- jQuery.fn.JsBarcode = function (content, options) {
3322
- var elementArray = [];
3323
- jQuery(this).each(function () {
3324
- elementArray.push(this);
3325
- });
3326
- return JsBarcode(elementArray, content, options);
3327
- };
3328
- }
3329
-
3330
- // Export to commonJS
3331
- var JsBarcode_1 = JsBarcode;
3332
-
3333
- var propTypes = {exports: {}};
3334
-
3335
- var reactIs = {exports: {}};
3336
-
3337
- var reactIs_production_min = {};
3338
-
3339
- /** @license React v16.13.1
3340
- * react-is.production.min.js
3341
- *
3342
- * Copyright (c) Facebook, Inc. and its affiliates.
3343
- *
3344
- * This source code is licensed under the MIT license found in the
3345
- * LICENSE file in the root directory of this source tree.
3346
- */
3347
-
3348
- var hasRequiredReactIs_production_min;
3349
-
3350
- function requireReactIs_production_min () {
3351
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
3352
- hasRequiredReactIs_production_min = 1;
3353
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
3354
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
3355
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
3356
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
3357
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
3358
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
3359
- return reactIs_production_min;
3360
- }
3361
-
3362
- var reactIs_development = {};
3363
-
3364
- /** @license React v16.13.1
3365
- * react-is.development.js
3366
- *
3367
- * Copyright (c) Facebook, Inc. and its affiliates.
3368
- *
3369
- * This source code is licensed under the MIT license found in the
3370
- * LICENSE file in the root directory of this source tree.
3371
- */
3372
-
3373
- var hasRequiredReactIs_development;
3374
-
3375
- function requireReactIs_development () {
3376
- if (hasRequiredReactIs_development) return reactIs_development;
3377
- hasRequiredReactIs_development = 1;
3378
-
3379
-
3380
-
3381
- if (process.env.NODE_ENV !== "production") {
3382
- (function() {
3383
-
3384
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
3385
- // nor polyfill, then a plain number is used for performance.
3386
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
3387
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
3388
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
3389
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
3390
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
3391
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
3392
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
3393
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
3394
- // (unstable) APIs that have been removed. Can we remove the symbols?
3395
-
3396
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
3397
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
3398
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
3399
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
3400
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
3401
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
3402
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
3403
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
3404
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
3405
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
3406
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
3407
-
3408
- function isValidElementType(type) {
3409
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
3410
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
3411
- }
3412
-
3413
- function typeOf(object) {
3414
- if (typeof object === 'object' && object !== null) {
3415
- var $$typeof = object.$$typeof;
3416
-
3417
- switch ($$typeof) {
3418
- case REACT_ELEMENT_TYPE:
3419
- var type = object.type;
3420
-
3421
- switch (type) {
3422
- case REACT_ASYNC_MODE_TYPE:
3423
- case REACT_CONCURRENT_MODE_TYPE:
3424
- case REACT_FRAGMENT_TYPE:
3425
- case REACT_PROFILER_TYPE:
3426
- case REACT_STRICT_MODE_TYPE:
3427
- case REACT_SUSPENSE_TYPE:
3428
- return type;
3429
-
3430
- default:
3431
- var $$typeofType = type && type.$$typeof;
3432
-
3433
- switch ($$typeofType) {
3434
- case REACT_CONTEXT_TYPE:
3435
- case REACT_FORWARD_REF_TYPE:
3436
- case REACT_LAZY_TYPE:
3437
- case REACT_MEMO_TYPE:
3438
- case REACT_PROVIDER_TYPE:
3439
- return $$typeofType;
3440
-
3441
- default:
3442
- return $$typeof;
3443
- }
3444
-
3445
- }
3446
-
3447
- case REACT_PORTAL_TYPE:
3448
- return $$typeof;
3449
- }
3450
- }
3451
-
3452
- return undefined;
3453
- } // AsyncMode is deprecated along with isAsyncMode
3454
-
3455
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
3456
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
3457
- var ContextConsumer = REACT_CONTEXT_TYPE;
3458
- var ContextProvider = REACT_PROVIDER_TYPE;
3459
- var Element = REACT_ELEMENT_TYPE;
3460
- var ForwardRef = REACT_FORWARD_REF_TYPE;
3461
- var Fragment = REACT_FRAGMENT_TYPE;
3462
- var Lazy = REACT_LAZY_TYPE;
3463
- var Memo = REACT_MEMO_TYPE;
3464
- var Portal = REACT_PORTAL_TYPE;
3465
- var Profiler = REACT_PROFILER_TYPE;
3466
- var StrictMode = REACT_STRICT_MODE_TYPE;
3467
- var Suspense = REACT_SUSPENSE_TYPE;
3468
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
3469
-
3470
- function isAsyncMode(object) {
3471
- {
3472
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
3473
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
3474
-
3475
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
3476
- }
3477
- }
3478
-
3479
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
3480
- }
3481
- function isConcurrentMode(object) {
3482
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
3483
- }
3484
- function isContextConsumer(object) {
3485
- return typeOf(object) === REACT_CONTEXT_TYPE;
3486
- }
3487
- function isContextProvider(object) {
3488
- return typeOf(object) === REACT_PROVIDER_TYPE;
3489
- }
3490
- function isElement(object) {
3491
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
3492
- }
3493
- function isForwardRef(object) {
3494
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
3495
- }
3496
- function isFragment(object) {
3497
- return typeOf(object) === REACT_FRAGMENT_TYPE;
3498
- }
3499
- function isLazy(object) {
3500
- return typeOf(object) === REACT_LAZY_TYPE;
3501
- }
3502
- function isMemo(object) {
3503
- return typeOf(object) === REACT_MEMO_TYPE;
3504
- }
3505
- function isPortal(object) {
3506
- return typeOf(object) === REACT_PORTAL_TYPE;
3507
- }
3508
- function isProfiler(object) {
3509
- return typeOf(object) === REACT_PROFILER_TYPE;
3510
- }
3511
- function isStrictMode(object) {
3512
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
3513
- }
3514
- function isSuspense(object) {
3515
- return typeOf(object) === REACT_SUSPENSE_TYPE;
3516
- }
3517
-
3518
- reactIs_development.AsyncMode = AsyncMode;
3519
- reactIs_development.ConcurrentMode = ConcurrentMode;
3520
- reactIs_development.ContextConsumer = ContextConsumer;
3521
- reactIs_development.ContextProvider = ContextProvider;
3522
- reactIs_development.Element = Element;
3523
- reactIs_development.ForwardRef = ForwardRef;
3524
- reactIs_development.Fragment = Fragment;
3525
- reactIs_development.Lazy = Lazy;
3526
- reactIs_development.Memo = Memo;
3527
- reactIs_development.Portal = Portal;
3528
- reactIs_development.Profiler = Profiler;
3529
- reactIs_development.StrictMode = StrictMode;
3530
- reactIs_development.Suspense = Suspense;
3531
- reactIs_development.isAsyncMode = isAsyncMode;
3532
- reactIs_development.isConcurrentMode = isConcurrentMode;
3533
- reactIs_development.isContextConsumer = isContextConsumer;
3534
- reactIs_development.isContextProvider = isContextProvider;
3535
- reactIs_development.isElement = isElement;
3536
- reactIs_development.isForwardRef = isForwardRef;
3537
- reactIs_development.isFragment = isFragment;
3538
- reactIs_development.isLazy = isLazy;
3539
- reactIs_development.isMemo = isMemo;
3540
- reactIs_development.isPortal = isPortal;
3541
- reactIs_development.isProfiler = isProfiler;
3542
- reactIs_development.isStrictMode = isStrictMode;
3543
- reactIs_development.isSuspense = isSuspense;
3544
- reactIs_development.isValidElementType = isValidElementType;
3545
- reactIs_development.typeOf = typeOf;
3546
- })();
3547
- }
3548
- return reactIs_development;
3549
- }
3550
-
3551
- var hasRequiredReactIs;
3552
-
3553
- function requireReactIs () {
3554
- if (hasRequiredReactIs) return reactIs.exports;
3555
- hasRequiredReactIs = 1;
3556
- (function (module) {
3557
-
3558
- if (process.env.NODE_ENV === 'production') {
3559
- module.exports = requireReactIs_production_min();
3560
- } else {
3561
- module.exports = requireReactIs_development();
3562
- }
3563
- } (reactIs));
3564
- return reactIs.exports;
3565
- }
3566
-
3567
- /*
3568
- object-assign
3569
- (c) Sindre Sorhus
3570
- @license MIT
3571
- */
3572
-
3573
- var objectAssign;
3574
- var hasRequiredObjectAssign;
3575
-
3576
- function requireObjectAssign () {
3577
- if (hasRequiredObjectAssign) return objectAssign;
3578
- hasRequiredObjectAssign = 1;
3579
- /* eslint-disable no-unused-vars */
3580
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3581
- var hasOwnProperty = Object.prototype.hasOwnProperty;
3582
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
3583
-
3584
- function toObject(val) {
3585
- if (val === null || val === undefined) {
3586
- throw new TypeError('Object.assign cannot be called with null or undefined');
3587
- }
3588
-
3589
- return Object(val);
3590
- }
3591
-
3592
- function shouldUseNative() {
3593
- try {
3594
- if (!Object.assign) {
3595
- return false;
3596
- }
3597
-
3598
- // Detect buggy property enumeration order in older V8 versions.
3599
-
3600
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
3601
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
3602
- test1[5] = 'de';
3603
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
3604
- return false;
3605
- }
3606
-
3607
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3608
- var test2 = {};
3609
- for (var i = 0; i < 10; i++) {
3610
- test2['_' + String.fromCharCode(i)] = i;
3611
- }
3612
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
3613
- return test2[n];
3614
- });
3615
- if (order2.join('') !== '0123456789') {
3616
- return false;
3617
- }
3618
-
3619
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3620
- var test3 = {};
3621
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
3622
- test3[letter] = letter;
3623
- });
3624
- if (Object.keys(Object.assign({}, test3)).join('') !==
3625
- 'abcdefghijklmnopqrst') {
3626
- return false;
3627
- }
3628
-
3629
- return true;
3630
- } catch (err) {
3631
- // We don't expect any of the above to throw, but better to be safe.
3632
- return false;
3633
- }
3634
- }
3635
-
3636
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
3637
- var from;
3638
- var to = toObject(target);
3639
- var symbols;
3640
-
3641
- for (var s = 1; s < arguments.length; s++) {
3642
- from = Object(arguments[s]);
3643
-
3644
- for (var key in from) {
3645
- if (hasOwnProperty.call(from, key)) {
3646
- to[key] = from[key];
3647
- }
3648
- }
3649
-
3650
- if (getOwnPropertySymbols) {
3651
- symbols = getOwnPropertySymbols(from);
3652
- for (var i = 0; i < symbols.length; i++) {
3653
- if (propIsEnumerable.call(from, symbols[i])) {
3654
- to[symbols[i]] = from[symbols[i]];
3655
- }
3656
- }
3657
- }
3658
- }
3659
-
3660
- return to;
3661
- };
3662
- return objectAssign;
3663
- }
3664
-
3665
- /**
3666
- * Copyright (c) 2013-present, Facebook, Inc.
3667
- *
3668
- * This source code is licensed under the MIT license found in the
3669
- * LICENSE file in the root directory of this source tree.
3670
- */
3671
-
3672
- var ReactPropTypesSecret_1;
3673
- var hasRequiredReactPropTypesSecret;
3674
-
3675
- function requireReactPropTypesSecret () {
3676
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
3677
- hasRequiredReactPropTypesSecret = 1;
3678
-
3679
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
3680
-
3681
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
3682
- return ReactPropTypesSecret_1;
3683
- }
3684
-
3685
- var has;
3686
- var hasRequiredHas;
3687
-
3688
- function requireHas () {
3689
- if (hasRequiredHas) return has;
3690
- hasRequiredHas = 1;
3691
- has = Function.call.bind(Object.prototype.hasOwnProperty);
3692
- return has;
3693
- }
3694
-
3695
- /**
3696
- * Copyright (c) 2013-present, Facebook, Inc.
3697
- *
3698
- * This source code is licensed under the MIT license found in the
3699
- * LICENSE file in the root directory of this source tree.
3700
- */
3701
-
3702
- var checkPropTypes_1;
3703
- var hasRequiredCheckPropTypes;
3704
-
3705
- function requireCheckPropTypes () {
3706
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
3707
- hasRequiredCheckPropTypes = 1;
3708
-
3709
- var printWarning = function() {};
3710
-
3711
- if (process.env.NODE_ENV !== 'production') {
3712
- var ReactPropTypesSecret = requireReactPropTypesSecret();
3713
- var loggedTypeFailures = {};
3714
- var has = requireHas();
3715
-
3716
- printWarning = function(text) {
3717
- var message = 'Warning: ' + text;
3718
- if (typeof console !== 'undefined') {
3719
- console.error(message);
3720
- }
3721
- try {
3722
- // --- Welcome to debugging React ---
3723
- // This error was thrown as a convenience so that you can use this stack
3724
- // to find the callsite that caused this warning to fire.
3725
- throw new Error(message);
3726
- } catch (x) { /**/ }
3727
- };
3728
- }
3729
-
3730
- /**
3731
- * Assert that the values match with the type specs.
3732
- * Error messages are memorized and will only be shown once.
3733
- *
3734
- * @param {object} typeSpecs Map of name to a ReactPropType
3735
- * @param {object} values Runtime values that need to be type-checked
3736
- * @param {string} location e.g. "prop", "context", "child context"
3737
- * @param {string} componentName Name of the component for error messages.
3738
- * @param {?Function} getStack Returns the component stack.
3739
- * @private
3740
- */
3741
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
3742
- if (process.env.NODE_ENV !== 'production') {
3743
- for (var typeSpecName in typeSpecs) {
3744
- if (has(typeSpecs, typeSpecName)) {
3745
- var error;
3746
- // Prop type validation may throw. In case they do, we don't want to
3747
- // fail the render phase where it didn't fail before. So we log it.
3748
- // After these have been cleaned up, we'll let them throw.
3749
- try {
3750
- // This is intentionally an invariant that gets caught. It's the same
3751
- // behavior as without this statement except with a better message.
3752
- if (typeof typeSpecs[typeSpecName] !== 'function') {
3753
- var err = Error(
3754
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
3755
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
3756
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
3757
- );
3758
- err.name = 'Invariant Violation';
3759
- throw err;
3760
- }
3761
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
3762
- } catch (ex) {
3763
- error = ex;
3764
- }
3765
- if (error && !(error instanceof Error)) {
3766
- printWarning(
3767
- (componentName || 'React class') + ': type specification of ' +
3768
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
3769
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
3770
- 'You may have forgotten to pass an argument to the type checker ' +
3771
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
3772
- 'shape all require an argument).'
3773
- );
3774
- }
3775
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3776
- // Only monitor this failure once because there tends to be a lot of the
3777
- // same error.
3778
- loggedTypeFailures[error.message] = true;
3779
-
3780
- var stack = getStack ? getStack() : '';
3781
-
3782
- printWarning(
3783
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
3784
- );
3785
- }
3786
- }
3787
- }
3788
- }
3789
- }
3790
-
3791
- /**
3792
- * Resets warning cache when testing.
3793
- *
3794
- * @private
3795
- */
3796
- checkPropTypes.resetWarningCache = function() {
3797
- if (process.env.NODE_ENV !== 'production') {
3798
- loggedTypeFailures = {};
3799
- }
3800
- };
3801
-
3802
- checkPropTypes_1 = checkPropTypes;
3803
- return checkPropTypes_1;
3804
- }
3805
-
3806
- /**
3807
- * Copyright (c) 2013-present, Facebook, Inc.
3808
- *
3809
- * This source code is licensed under the MIT license found in the
3810
- * LICENSE file in the root directory of this source tree.
3811
- */
3812
-
3813
- var factoryWithTypeCheckers;
3814
- var hasRequiredFactoryWithTypeCheckers;
3815
-
3816
- function requireFactoryWithTypeCheckers () {
3817
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
3818
- hasRequiredFactoryWithTypeCheckers = 1;
3819
-
3820
- var ReactIs = requireReactIs();
3821
- var assign = requireObjectAssign();
3822
-
3823
- var ReactPropTypesSecret = requireReactPropTypesSecret();
3824
- var has = requireHas();
3825
- var checkPropTypes = requireCheckPropTypes();
3826
-
3827
- var printWarning = function() {};
3828
-
3829
- if (process.env.NODE_ENV !== 'production') {
3830
- printWarning = function(text) {
3831
- var message = 'Warning: ' + text;
3832
- if (typeof console !== 'undefined') {
3833
- console.error(message);
3834
- }
3835
- try {
3836
- // --- Welcome to debugging React ---
3837
- // This error was thrown as a convenience so that you can use this stack
3838
- // to find the callsite that caused this warning to fire.
3839
- throw new Error(message);
3840
- } catch (x) {}
3841
- };
3842
- }
3843
-
3844
- function emptyFunctionThatReturnsNull() {
3845
- return null;
3846
- }
3847
-
3848
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3849
- /* global Symbol */
3850
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
3851
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
3852
-
3853
- /**
3854
- * Returns the iterator method function contained on the iterable object.
3855
- *
3856
- * Be sure to invoke the function with the iterable as context:
3857
- *
3858
- * var iteratorFn = getIteratorFn(myIterable);
3859
- * if (iteratorFn) {
3860
- * var iterator = iteratorFn.call(myIterable);
3861
- * ...
3862
- * }
3863
- *
3864
- * @param {?object} maybeIterable
3865
- * @return {?function}
3866
- */
3867
- function getIteratorFn(maybeIterable) {
3868
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
3869
- if (typeof iteratorFn === 'function') {
3870
- return iteratorFn;
3871
- }
3872
- }
3873
-
3874
- /**
3875
- * Collection of methods that allow declaration and validation of props that are
3876
- * supplied to React components. Example usage:
3877
- *
3878
- * var Props = require('ReactPropTypes');
3879
- * var MyArticle = React.createClass({
3880
- * propTypes: {
3881
- * // An optional string prop named "description".
3882
- * description: Props.string,
3883
- *
3884
- * // A required enum prop named "category".
3885
- * category: Props.oneOf(['News','Photos']).isRequired,
3886
- *
3887
- * // A prop named "dialog" that requires an instance of Dialog.
3888
- * dialog: Props.instanceOf(Dialog).isRequired
3889
- * },
3890
- * render: function() { ... }
3891
- * });
3892
- *
3893
- * A more formal specification of how these methods are used:
3894
- *
3895
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
3896
- * decl := ReactPropTypes.{type}(.isRequired)?
3897
- *
3898
- * Each and every declaration produces a function with the same signature. This
3899
- * allows the creation of custom validation functions. For example:
3900
- *
3901
- * var MyLink = React.createClass({
3902
- * propTypes: {
3903
- * // An optional string or URI prop named "href".
3904
- * href: function(props, propName, componentName) {
3905
- * var propValue = props[propName];
3906
- * if (propValue != null && typeof propValue !== 'string' &&
3907
- * !(propValue instanceof URI)) {
3908
- * return new Error(
3909
- * 'Expected a string or an URI for ' + propName + ' in ' +
3910
- * componentName
3911
- * );
3912
- * }
3913
- * }
3914
- * },
3915
- * render: function() {...}
3916
- * });
3917
- *
3918
- * @internal
3919
- */
3920
-
3921
- var ANONYMOUS = '<<anonymous>>';
3922
-
3923
- // Important!
3924
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
3925
- var ReactPropTypes = {
3926
- array: createPrimitiveTypeChecker('array'),
3927
- bigint: createPrimitiveTypeChecker('bigint'),
3928
- bool: createPrimitiveTypeChecker('boolean'),
3929
- func: createPrimitiveTypeChecker('function'),
3930
- number: createPrimitiveTypeChecker('number'),
3931
- object: createPrimitiveTypeChecker('object'),
3932
- string: createPrimitiveTypeChecker('string'),
3933
- symbol: createPrimitiveTypeChecker('symbol'),
3934
-
3935
- any: createAnyTypeChecker(),
3936
- arrayOf: createArrayOfTypeChecker,
3937
- element: createElementTypeChecker(),
3938
- elementType: createElementTypeTypeChecker(),
3939
- instanceOf: createInstanceTypeChecker,
3940
- node: createNodeChecker(),
3941
- objectOf: createObjectOfTypeChecker,
3942
- oneOf: createEnumTypeChecker,
3943
- oneOfType: createUnionTypeChecker,
3944
- shape: createShapeTypeChecker,
3945
- exact: createStrictShapeTypeChecker,
3946
- };
3947
-
3948
- /**
3949
- * inlined Object.is polyfill to avoid requiring consumers ship their own
3950
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
3951
- */
3952
- /*eslint-disable no-self-compare*/
3953
- function is(x, y) {
3954
- // SameValue algorithm
3955
- if (x === y) {
3956
- // Steps 1-5, 7-10
3957
- // Steps 6.b-6.e: +0 != -0
3958
- return x !== 0 || 1 / x === 1 / y;
3959
- } else {
3960
- // Step 6.a: NaN == NaN
3961
- return x !== x && y !== y;
3962
- }
3963
- }
3964
- /*eslint-enable no-self-compare*/
3965
-
3966
- /**
3967
- * We use an Error-like object for backward compatibility as people may call
3968
- * PropTypes directly and inspect their output. However, we don't use real
3969
- * Errors anymore. We don't inspect their stack anyway, and creating them
3970
- * is prohibitively expensive if they are created too often, such as what
3971
- * happens in oneOfType() for any type before the one that matched.
3972
- */
3973
- function PropTypeError(message, data) {
3974
- this.message = message;
3975
- this.data = data && typeof data === 'object' ? data: {};
3976
- this.stack = '';
3977
- }
3978
- // Make `instanceof Error` still work for returned errors.
3979
- PropTypeError.prototype = Error.prototype;
3980
-
3981
- function createChainableTypeChecker(validate) {
3982
- if (process.env.NODE_ENV !== 'production') {
3983
- var manualPropTypeCallCache = {};
3984
- var manualPropTypeWarningCount = 0;
3985
- }
3986
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
3987
- componentName = componentName || ANONYMOUS;
3988
- propFullName = propFullName || propName;
3989
-
3990
- if (secret !== ReactPropTypesSecret) {
3991
- if (throwOnDirectAccess) {
3992
- // New behavior only for users of `prop-types` package
3993
- var err = new Error(
3994
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
3995
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
3996
- 'Read more at http://fb.me/use-check-prop-types'
3997
- );
3998
- err.name = 'Invariant Violation';
3999
- throw err;
4000
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
4001
- // Old behavior for people using React.PropTypes
4002
- var cacheKey = componentName + ':' + propName;
4003
- if (
4004
- !manualPropTypeCallCache[cacheKey] &&
4005
- // Avoid spamming the console because they are often not actionable except for lib authors
4006
- manualPropTypeWarningCount < 3
4007
- ) {
4008
- printWarning(
4009
- 'You are manually calling a React.PropTypes validation ' +
4010
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
4011
- 'and will throw in the standalone `prop-types` package. ' +
4012
- 'You may be seeing this warning due to a third-party PropTypes ' +
4013
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
4014
- );
4015
- manualPropTypeCallCache[cacheKey] = true;
4016
- manualPropTypeWarningCount++;
4017
- }
4018
- }
4019
- }
4020
- if (props[propName] == null) {
4021
- if (isRequired) {
4022
- if (props[propName] === null) {
4023
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
4024
- }
4025
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
4026
- }
4027
- return null;
4028
- } else {
4029
- return validate(props, propName, componentName, location, propFullName);
4030
- }
4031
- }
4032
-
4033
- var chainedCheckType = checkType.bind(null, false);
4034
- chainedCheckType.isRequired = checkType.bind(null, true);
4035
-
4036
- return chainedCheckType;
4037
- }
4038
-
4039
- function createPrimitiveTypeChecker(expectedType) {
4040
- function validate(props, propName, componentName, location, propFullName, secret) {
4041
- var propValue = props[propName];
4042
- var propType = getPropType(propValue);
4043
- if (propType !== expectedType) {
4044
- // `propValue` being instance of, say, date/regexp, pass the 'object'
4045
- // check, but we can offer a more precise error message here rather than
4046
- // 'of type `object`'.
4047
- var preciseType = getPreciseType(propValue);
4048
-
4049
- return new PropTypeError(
4050
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
4051
- {expectedType: expectedType}
4052
- );
4053
- }
4054
- return null;
4055
- }
4056
- return createChainableTypeChecker(validate);
4057
- }
4058
-
4059
- function createAnyTypeChecker() {
4060
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
4061
- }
4062
-
4063
- function createArrayOfTypeChecker(typeChecker) {
4064
- function validate(props, propName, componentName, location, propFullName) {
4065
- if (typeof typeChecker !== 'function') {
4066
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
4067
- }
4068
- var propValue = props[propName];
4069
- if (!Array.isArray(propValue)) {
4070
- var propType = getPropType(propValue);
4071
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
4072
- }
4073
- for (var i = 0; i < propValue.length; i++) {
4074
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
4075
- if (error instanceof Error) {
4076
- return error;
4077
- }
4078
- }
4079
- return null;
4080
- }
4081
- return createChainableTypeChecker(validate);
4082
- }
4083
-
4084
- function createElementTypeChecker() {
4085
- function validate(props, propName, componentName, location, propFullName) {
4086
- var propValue = props[propName];
4087
- if (!isValidElement(propValue)) {
4088
- var propType = getPropType(propValue);
4089
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
4090
- }
4091
- return null;
4092
- }
4093
- return createChainableTypeChecker(validate);
4094
- }
4095
-
4096
- function createElementTypeTypeChecker() {
4097
- function validate(props, propName, componentName, location, propFullName) {
4098
- var propValue = props[propName];
4099
- if (!ReactIs.isValidElementType(propValue)) {
4100
- var propType = getPropType(propValue);
4101
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
4102
- }
4103
- return null;
4104
- }
4105
- return createChainableTypeChecker(validate);
4106
- }
4107
-
4108
- function createInstanceTypeChecker(expectedClass) {
4109
- function validate(props, propName, componentName, location, propFullName) {
4110
- if (!(props[propName] instanceof expectedClass)) {
4111
- var expectedClassName = expectedClass.name || ANONYMOUS;
4112
- var actualClassName = getClassName(props[propName]);
4113
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
4114
- }
4115
- return null;
4116
- }
4117
- return createChainableTypeChecker(validate);
4118
- }
4119
-
4120
- function createEnumTypeChecker(expectedValues) {
4121
- if (!Array.isArray(expectedValues)) {
4122
- if (process.env.NODE_ENV !== 'production') {
4123
- if (arguments.length > 1) {
4124
- printWarning(
4125
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
4126
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
4127
- );
4128
- } else {
4129
- printWarning('Invalid argument supplied to oneOf, expected an array.');
4130
- }
4131
- }
4132
- return emptyFunctionThatReturnsNull;
4133
- }
4134
-
4135
- function validate(props, propName, componentName, location, propFullName) {
4136
- var propValue = props[propName];
4137
- for (var i = 0; i < expectedValues.length; i++) {
4138
- if (is(propValue, expectedValues[i])) {
4139
- return null;
4140
- }
4141
- }
4142
-
4143
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
4144
- var type = getPreciseType(value);
4145
- if (type === 'symbol') {
4146
- return String(value);
4147
- }
4148
- return value;
4149
- });
4150
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
4151
- }
4152
- return createChainableTypeChecker(validate);
4153
- }
4154
-
4155
- function createObjectOfTypeChecker(typeChecker) {
4156
- function validate(props, propName, componentName, location, propFullName) {
4157
- if (typeof typeChecker !== 'function') {
4158
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
4159
- }
4160
- var propValue = props[propName];
4161
- var propType = getPropType(propValue);
4162
- if (propType !== 'object') {
4163
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
4164
- }
4165
- for (var key in propValue) {
4166
- if (has(propValue, key)) {
4167
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4168
- if (error instanceof Error) {
4169
- return error;
4170
- }
4171
- }
4172
- }
4173
- return null;
4174
- }
4175
- return createChainableTypeChecker(validate);
4176
- }
4177
-
4178
- function createUnionTypeChecker(arrayOfTypeCheckers) {
4179
- if (!Array.isArray(arrayOfTypeCheckers)) {
4180
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
4181
- return emptyFunctionThatReturnsNull;
4182
- }
4183
-
4184
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
4185
- var checker = arrayOfTypeCheckers[i];
4186
- if (typeof checker !== 'function') {
4187
- printWarning(
4188
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
4189
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
4190
- );
4191
- return emptyFunctionThatReturnsNull;
4192
- }
4193
- }
4194
-
4195
- function validate(props, propName, componentName, location, propFullName) {
4196
- var expectedTypes = [];
4197
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
4198
- var checker = arrayOfTypeCheckers[i];
4199
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
4200
- if (checkerResult == null) {
4201
- return null;
4202
- }
4203
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
4204
- expectedTypes.push(checkerResult.data.expectedType);
4205
- }
4206
- }
4207
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
4208
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
4209
- }
4210
- return createChainableTypeChecker(validate);
4211
- }
4212
-
4213
- function createNodeChecker() {
4214
- function validate(props, propName, componentName, location, propFullName) {
4215
- if (!isNode(props[propName])) {
4216
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
4217
- }
4218
- return null;
4219
- }
4220
- return createChainableTypeChecker(validate);
4221
- }
4222
-
4223
- function invalidValidatorError(componentName, location, propFullName, key, type) {
4224
- return new PropTypeError(
4225
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
4226
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
4227
- );
4228
- }
4229
-
4230
- function createShapeTypeChecker(shapeTypes) {
4231
- function validate(props, propName, componentName, location, propFullName) {
4232
- var propValue = props[propName];
4233
- var propType = getPropType(propValue);
4234
- if (propType !== 'object') {
4235
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
4236
- }
4237
- for (var key in shapeTypes) {
4238
- var checker = shapeTypes[key];
4239
- if (typeof checker !== 'function') {
4240
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
4241
- }
4242
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4243
- if (error) {
4244
- return error;
4245
- }
4246
- }
4247
- return null;
4248
- }
4249
- return createChainableTypeChecker(validate);
4250
- }
4251
-
4252
- function createStrictShapeTypeChecker(shapeTypes) {
4253
- function validate(props, propName, componentName, location, propFullName) {
4254
- var propValue = props[propName];
4255
- var propType = getPropType(propValue);
4256
- if (propType !== 'object') {
4257
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
4258
- }
4259
- // We need to check all keys in case some are required but missing from props.
4260
- var allKeys = assign({}, props[propName], shapeTypes);
4261
- for (var key in allKeys) {
4262
- var checker = shapeTypes[key];
4263
- if (has(shapeTypes, key) && typeof checker !== 'function') {
4264
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
4265
- }
4266
- if (!checker) {
4267
- return new PropTypeError(
4268
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
4269
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
4270
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
4271
- );
4272
- }
4273
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4274
- if (error) {
4275
- return error;
4276
- }
4277
- }
4278
- return null;
4279
- }
4280
-
4281
- return createChainableTypeChecker(validate);
4282
- }
4283
-
4284
- function isNode(propValue) {
4285
- switch (typeof propValue) {
4286
- case 'number':
4287
- case 'string':
4288
- case 'undefined':
4289
- return true;
4290
- case 'boolean':
4291
- return !propValue;
4292
- case 'object':
4293
- if (Array.isArray(propValue)) {
4294
- return propValue.every(isNode);
4295
- }
4296
- if (propValue === null || isValidElement(propValue)) {
4297
- return true;
4298
- }
4299
-
4300
- var iteratorFn = getIteratorFn(propValue);
4301
- if (iteratorFn) {
4302
- var iterator = iteratorFn.call(propValue);
4303
- var step;
4304
- if (iteratorFn !== propValue.entries) {
4305
- while (!(step = iterator.next()).done) {
4306
- if (!isNode(step.value)) {
4307
- return false;
4308
- }
4309
- }
4310
- } else {
4311
- // Iterator will provide entry [k,v] tuples rather than values.
4312
- while (!(step = iterator.next()).done) {
4313
- var entry = step.value;
4314
- if (entry) {
4315
- if (!isNode(entry[1])) {
4316
- return false;
4317
- }
4318
- }
4319
- }
4320
- }
4321
- } else {
4322
- return false;
4323
- }
4324
-
4325
- return true;
4326
- default:
4327
- return false;
4328
- }
4329
- }
4330
-
4331
- function isSymbol(propType, propValue) {
4332
- // Native Symbol.
4333
- if (propType === 'symbol') {
4334
- return true;
4335
- }
4336
-
4337
- // falsy value can't be a Symbol
4338
- if (!propValue) {
4339
- return false;
4340
- }
4341
-
4342
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
4343
- if (propValue['@@toStringTag'] === 'Symbol') {
4344
- return true;
4345
- }
4346
-
4347
- // Fallback for non-spec compliant Symbols which are polyfilled.
4348
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
4349
- return true;
4350
- }
4351
-
4352
- return false;
4353
- }
4354
-
4355
- // Equivalent of `typeof` but with special handling for array and regexp.
4356
- function getPropType(propValue) {
4357
- var propType = typeof propValue;
4358
- if (Array.isArray(propValue)) {
4359
- return 'array';
4360
- }
4361
- if (propValue instanceof RegExp) {
4362
- // Old webkits (at least until Android 4.0) return 'function' rather than
4363
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
4364
- // passes PropTypes.object.
4365
- return 'object';
4366
- }
4367
- if (isSymbol(propType, propValue)) {
4368
- return 'symbol';
4369
- }
4370
- return propType;
4371
- }
4372
-
4373
- // This handles more types than `getPropType`. Only used for error messages.
4374
- // See `createPrimitiveTypeChecker`.
4375
- function getPreciseType(propValue) {
4376
- if (typeof propValue === 'undefined' || propValue === null) {
4377
- return '' + propValue;
4378
- }
4379
- var propType = getPropType(propValue);
4380
- if (propType === 'object') {
4381
- if (propValue instanceof Date) {
4382
- return 'date';
4383
- } else if (propValue instanceof RegExp) {
4384
- return 'regexp';
4385
- }
4386
- }
4387
- return propType;
4388
- }
4389
-
4390
- // Returns a string that is postfixed to a warning about an invalid type.
4391
- // For example, "undefined" or "of type array"
4392
- function getPostfixForTypeWarning(value) {
4393
- var type = getPreciseType(value);
4394
- switch (type) {
4395
- case 'array':
4396
- case 'object':
4397
- return 'an ' + type;
4398
- case 'boolean':
4399
- case 'date':
4400
- case 'regexp':
4401
- return 'a ' + type;
4402
- default:
4403
- return type;
4404
- }
4405
- }
4406
-
4407
- // Returns class name of the object, if any.
4408
- function getClassName(propValue) {
4409
- if (!propValue.constructor || !propValue.constructor.name) {
4410
- return ANONYMOUS;
4411
- }
4412
- return propValue.constructor.name;
4413
- }
4414
-
4415
- ReactPropTypes.checkPropTypes = checkPropTypes;
4416
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
4417
- ReactPropTypes.PropTypes = ReactPropTypes;
4418
-
4419
- return ReactPropTypes;
4420
- };
4421
- return factoryWithTypeCheckers;
4422
- }
4423
-
4424
- /**
4425
- * Copyright (c) 2013-present, Facebook, Inc.
4426
- *
4427
- * This source code is licensed under the MIT license found in the
4428
- * LICENSE file in the root directory of this source tree.
4429
- */
4430
-
4431
- var factoryWithThrowingShims;
4432
- var hasRequiredFactoryWithThrowingShims;
4433
-
4434
- function requireFactoryWithThrowingShims () {
4435
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
4436
- hasRequiredFactoryWithThrowingShims = 1;
4437
-
4438
- var ReactPropTypesSecret = requireReactPropTypesSecret();
4439
-
4440
- function emptyFunction() {}
4441
- function emptyFunctionWithReset() {}
4442
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
4443
-
4444
- factoryWithThrowingShims = function() {
4445
- function shim(props, propName, componentName, location, propFullName, secret) {
4446
- if (secret === ReactPropTypesSecret) {
4447
- // It is still safe when called from React.
4448
- return;
4449
- }
4450
- var err = new Error(
4451
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
4452
- 'Use PropTypes.checkPropTypes() to call them. ' +
4453
- 'Read more at http://fb.me/use-check-prop-types'
4454
- );
4455
- err.name = 'Invariant Violation';
4456
- throw err;
4457
- } shim.isRequired = shim;
4458
- function getShim() {
4459
- return shim;
4460
- } // Important!
4461
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
4462
- var ReactPropTypes = {
4463
- array: shim,
4464
- bigint: shim,
4465
- bool: shim,
4466
- func: shim,
4467
- number: shim,
4468
- object: shim,
4469
- string: shim,
4470
- symbol: shim,
4471
-
4472
- any: shim,
4473
- arrayOf: getShim,
4474
- element: shim,
4475
- elementType: shim,
4476
- instanceOf: getShim,
4477
- node: shim,
4478
- objectOf: getShim,
4479
- oneOf: getShim,
4480
- oneOfType: getShim,
4481
- shape: getShim,
4482
- exact: getShim,
4483
-
4484
- checkPropTypes: emptyFunctionWithReset,
4485
- resetWarningCache: emptyFunction
4486
- };
4487
-
4488
- ReactPropTypes.PropTypes = ReactPropTypes;
4489
-
4490
- return ReactPropTypes;
4491
- };
4492
- return factoryWithThrowingShims;
4493
- }
4494
-
4495
- /**
4496
- * Copyright (c) 2013-present, Facebook, Inc.
4497
- *
4498
- * This source code is licensed under the MIT license found in the
4499
- * LICENSE file in the root directory of this source tree.
4500
- */
4501
-
4502
- if (process.env.NODE_ENV !== 'production') {
4503
- var ReactIs = requireReactIs();
4504
-
4505
- // By explicitly using `prop-types` you are opting into new development behavior.
4506
- // http://fb.me/prop-types-in-prod
4507
- var throwOnDirectAccess = true;
4508
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
4509
- } else {
4510
- // By explicitly using `prop-types` you are opting into new production behavior.
4511
- // http://fb.me/prop-types-in-prod
4512
- propTypes.exports = requireFactoryWithThrowingShims()();
4513
- }
4514
-
4515
- var _react = _interopRequireDefault(React);
4516
-
4517
- var _jsbarcode = _interopRequireDefault(JsBarcode_1);
4518
-
4519
- var _propTypes = _interopRequireDefault(propTypes.exports);
4520
-
4521
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4522
-
4523
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4524
-
4525
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4526
-
4527
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4528
-
4529
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
4530
-
4531
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
4532
-
4533
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4534
-
4535
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4536
-
4537
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
4538
-
4539
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4540
-
4541
- var getDOMNode; // Super naive semver detection but it's good enough. We support 0.12, 0.13
4542
- // which both have getDOMNode on the ref. 0.14 and 15 make the DOM node the ref.
4543
-
4544
- var version = _react["default"].version.split(/[.-]/);
4545
-
4546
- if (version[0] === '0' && (version[1] === '13' || version[1] === '12')) {
4547
- getDOMNode = function getDOMNode(ref) {
4548
- return ref.getDOMNode();
4549
- };
4550
- } else {
4551
- getDOMNode = function getDOMNode(ref) {
4552
- return ref;
4553
- };
4554
- }
4555
-
4556
- var Barcode =
4557
- /*#__PURE__*/
4558
- function (_React$Component) {
4559
- _inherits(Barcode, _React$Component);
4560
-
4561
- function Barcode(props) {
4562
- var _this;
4563
-
4564
- _classCallCheck(this, Barcode);
4565
-
4566
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Barcode).call(this, props));
4567
- _this.renderElementRef = _react["default"].createRef();
4568
- _this.update = _this.update.bind(_assertThisInitialized(_this));
4569
- return _this;
4570
- }
4571
-
4572
- _createClass(Barcode, [{
4573
- key: "shouldComponentUpdate",
4574
- value: function shouldComponentUpdate(nextProps) {
4575
- var _this2 = this;
4576
-
4577
- return Object.keys(Barcode.propTypes).some(function (k) {
4578
- return _this2.props[k] !== nextProps[k];
4579
- });
4580
- }
4581
- }, {
4582
- key: "componentDidMount",
4583
- value: function componentDidMount() {
4584
- this.update();
4585
- }
4586
- }, {
4587
- key: "componentDidUpdate",
4588
- value: function componentDidUpdate() {
4589
- this.update();
4590
- }
4591
- }, {
4592
- key: "update",
4593
- value: function update() {
4594
- var renderElement = getDOMNode(this.renderElementRef.current);
4595
-
4596
- try {
4597
- new _jsbarcode["default"](renderElement, this.props.value, Object.assign({}, this.props));
4598
- } catch (e) {
4599
- // prevent stop the parent process
4600
- window.console.error(e);
4601
- }
4602
- }
4603
- }, {
4604
- key: "render",
4605
- value: function render() {
4606
- if (this.props.renderer === 'svg') {
4607
- return _react["default"].createElement("svg", {
4608
- ref: this.renderElementRef
4609
- });
4610
- } else if (this.props.renderer === 'canvas') {
4611
- return _react["default"].createElement("canvas", {
4612
- ref: this.renderElementRef
4613
- });
4614
- } else if (this.props.renderer === 'img') {
4615
- return _react["default"].createElement("img", {
4616
- ref: this.renderElementRef
4617
- });
4618
- }
4619
- }
4620
- }]);
4621
-
4622
- return Barcode;
4623
- }(_react["default"].Component);
4624
-
4625
- Barcode.propTypes = {
4626
- value: _propTypes["default"].string.isRequired,
4627
- renderer: _propTypes["default"].string,
4628
- format: _propTypes["default"].string,
4629
- width: _propTypes["default"].number,
4630
- height: _propTypes["default"].number,
4631
- displayValue: _propTypes["default"].bool,
4632
- fontOptions: _propTypes["default"].string,
4633
- font: _propTypes["default"].string,
4634
- textAlign: _propTypes["default"].string,
4635
- textPosition: _propTypes["default"].string,
4636
- textMargin: _propTypes["default"].number,
4637
- fontSize: _propTypes["default"].number,
4638
- background: _propTypes["default"].string,
4639
- lineColor: _propTypes["default"].string,
4640
- margin: _propTypes["default"].number,
4641
- marginTop: _propTypes["default"].number,
4642
- marginBottom: _propTypes["default"].number,
4643
- marginLeft: _propTypes["default"].number,
4644
- marginRight: _propTypes["default"].number
4645
- };
4646
- Barcode.defaultProps = {
4647
- format: 'CODE128',
4648
- renderer: 'svg',
4649
- width: 2,
4650
- height: 100,
4651
- displayValue: true,
4652
- fontOptions: '',
4653
- font: 'monospace',
4654
- textAlign: 'center',
4655
- textPosition: 'bottom',
4656
- textMargin: 2,
4657
- fontSize: 20,
4658
- background: '#ffffff',
4659
- lineColor: '#000000',
4660
- margin: 10
4661
- };
4662
- var reactBarcode = Barcode;
4663
-
4664
- const SchoolIDCard = ({
4665
- userImage,
4666
- userName,
4667
- text = null,
4668
- extraText,
4669
- subjectInitials,
4670
- subjectInitialsClass,
4671
- showBarcode = true,
4672
- backgroundImage,
4673
- className,
4674
- containerClassName
4675
- }) => {
4676
- let textEl = null;
4677
- if (typeof text === "string") {
4678
- textEl = /* @__PURE__ */ React.createElement("h3", {
4679
- className: "text-xs font-bold uppercase text-black"
4680
- }, text);
4681
- } else {
4682
- textEl = text;
4683
- }
4684
- let issueeImageEl = null;
4685
- const initialsClass = `subject-initials h-[70px] w-[70px] rounded-full mr-[10px] flex flex-row items-center justify-center h-full w-full overflow-hidden bg-emerald-700 text-white font-medium text-3xl ${subjectInitialsClass}`;
4686
- if (userImage && (userImage == null ? void 0 : userImage.trim()) !== "") {
4687
- issueeImageEl = /* @__PURE__ */ React.createElement("div", {
4688
- className: "h-[80px] w-[80px] rounded-full overflow-hidden bg-no-repeat bg-cover bg-center border-solid border-[2px] border-white mr-2",
4689
- style: { backgroundImage: `url(${userImage})` }
4690
- });
4691
- } else if (subjectInitials && (!userImage || (userImage == null ? void 0 : userImage.trim()) === "")) {
4692
- issueeImageEl = /* @__PURE__ */ React.createElement("div", {
4693
- className: initialsClass
4694
- }, subjectInitials);
4695
- }
4696
- return /* @__PURE__ */ React.createElement("div", {
4697
- style: { backgroundImage: `url(${backgroundImage})` },
4698
- className: `h-[200px] w-[320px] rounded-[20px] overflow-hidden ${className}`
4699
- }, /* @__PURE__ */ React.createElement("div", {
4700
- className: `h-full w-full flex items-center justify-start relative ${containerClassName}`
4701
- }, /* @__PURE__ */ React.createElement("div", {
4702
- className: "w-full flex justify-start items-center pl-3 mt-10"
4703
- }, issueeImageEl, /* @__PURE__ */ React.createElement("div", {
4704
- className: "h-full flex items-start justify-center flex-col mt-7"
4705
- }, userName && /* @__PURE__ */ React.createElement("p", {
4706
- className: "text-sm text-black font-light"
4707
- }, userName), textEl && textEl)), showBarcode && /* @__PURE__ */ React.createElement("div", {
4708
- className: "barcode-container"
4709
- }, /* @__PURE__ */ React.createElement("div", {
4710
- className: "barcode-wrap"
4711
- }, /* @__PURE__ */ React.createElement(reactBarcode, {
4712
- value: "barcode-example",
4713
- height: "22px",
4714
- width: "1px",
4715
- fontSize: 0
4716
- }))), extraText && /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", {
4717
- className: "absolute bottom-3 left-0 w-full flex items-center justify-center text-white text-xs font-semibold"
4718
- }, extraText))));
4719
- };
4720
-
4721
- export { SchoolIDCard as S };
4722
- //# sourceMappingURL=SchoolIDCard-3b746226.js.map