@verdocs/web-sdk 1.9.10 → 1.9.14

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 (398) hide show
  1. package/dist/cjs/{Envelopes-22a0c02f.js → Envelopes-aec4ee3d.js} +4 -15
  2. package/dist/cjs/Envelopes-aec4ee3d.js.map +1 -0
  3. package/dist/cjs/{Templates-399073ea.js → Templates-0051d647.js} +2 -2
  4. package/dist/cjs/{Templates-399073ea.js.map → Templates-0051d647.js.map} +1 -1
  5. package/dist/cjs/VerdocsEndpoint-8c408e5b.js +3569 -0
  6. package/dist/cjs/VerdocsEndpoint-8c408e5b.js.map +1 -0
  7. package/dist/cjs/{templateStore-92828c3c.js → index-eb130f52.js} +2 -41
  8. package/dist/cjs/index-eb130f52.js.map +1 -0
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/templateStore-974781a8.js +46 -0
  11. package/dist/cjs/templateStore-974781a8.js.map +1 -0
  12. package/dist/cjs/{utils-84236321.js → utils-e0f38696.js} +23 -3
  13. package/dist/cjs/utils-e0f38696.js.map +1 -0
  14. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-build.cjs.entry.js +5 -4
  16. package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
  17. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-document-page_2.cjs.entry.js +94 -0
  19. package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -0
  20. package/dist/cjs/verdocs-dropdown_3.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
  24. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  25. package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +1 -1
  26. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  27. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -2
  28. package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
  29. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
  30. package/dist/cjs/verdocs-preview.cjs.entry.js +17 -11
  31. package/dist/cjs/verdocs-preview.cjs.entry.js.map +1 -1
  32. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
  33. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  34. package/dist/cjs/verdocs-send.cjs.entry.js +2 -2
  35. package/dist/cjs/verdocs-sign.cjs.entry.js +91 -22
  36. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  37. package/dist/cjs/verdocs-template-create_4.cjs.entry.js +52 -36
  38. package/dist/cjs/verdocs-template-create_4.cjs.entry.js.map +1 -1
  39. package/dist/cjs/verdocs-view.cjs.entry.js +331 -0
  40. package/dist/cjs/verdocs-view.cjs.entry.js.map +1 -0
  41. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  42. package/dist/collection/collection-manifest.json +1 -3
  43. package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js +1 -4
  44. package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js.map +1 -1
  45. package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.css +14 -1
  46. package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.js +17 -30
  47. package/dist/collection/components/elements/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  48. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.css +15 -0
  49. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +14 -7
  50. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js.map +1 -1
  51. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +124 -47
  52. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  53. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +122 -175
  54. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
  55. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js +2 -3
  56. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js.map +1 -1
  57. package/dist/collection/utils/Envelopes.js +31 -0
  58. package/dist/collection/utils/Envelopes.js.map +1 -0
  59. package/dist/collection/utils/envelopeStore.js +28 -0
  60. package/dist/collection/utils/envelopeStore.js.map +1 -0
  61. package/dist/collection/utils/utils.js +21 -2
  62. package/dist/collection/utils/utils.js.map +1 -1
  63. package/dist/{esm/Envelopes-df05b3c7.js → components/Envelopes.js} +5 -15
  64. package/dist/components/Envelopes.js.map +1 -0
  65. package/dist/components/VerdocsEndpoint.js +2185 -1051
  66. package/dist/components/VerdocsEndpoint.js.map +1 -1
  67. package/dist/components/index.d.ts +0 -2
  68. package/dist/components/index.js +0 -2
  69. package/dist/components/index.js.map +1 -1
  70. package/dist/components/index2.js +196 -0
  71. package/dist/components/index2.js.map +1 -0
  72. package/dist/components/templateStore.js +1 -192
  73. package/dist/components/templateStore.js.map +1 -1
  74. package/dist/components/utils.js +22 -3
  75. package/dist/components/utils.js.map +1 -1
  76. package/dist/components/verdocs-build.js +34 -52
  77. package/dist/components/verdocs-build.js.map +1 -1
  78. package/dist/components/verdocs-document-page2.js +1 -4
  79. package/dist/components/verdocs-document-page2.js.map +1 -1
  80. package/dist/components/verdocs-preview.js +16 -29
  81. package/dist/components/verdocs-preview.js.map +1 -1
  82. package/dist/components/verdocs-sign.js +100 -57
  83. package/dist/components/verdocs-sign.js.map +1 -1
  84. package/dist/components/verdocs-template-create2.js +29 -1
  85. package/dist/components/verdocs-template-create2.js.map +1 -1
  86. package/dist/components/verdocs-template-fields2.js +36 -67
  87. package/dist/components/verdocs-template-fields2.js.map +1 -1
  88. package/dist/components/verdocs-view.js +353 -1
  89. package/dist/components/verdocs-view.js.map +1 -1
  90. package/dist/docs.json +38 -568
  91. package/dist/esm/Envelopes-b031f847.js +93 -0
  92. package/dist/esm/Envelopes-b031f847.js.map +1 -0
  93. package/dist/esm/{Templates-91922342.js → Templates-1034fade.js} +2 -2
  94. package/dist/esm/{Templates-91922342.js.map → Templates-1034fade.js.map} +1 -1
  95. package/dist/esm/VerdocsEndpoint-dac04424.js +3566 -0
  96. package/dist/esm/VerdocsEndpoint-dac04424.js.map +1 -0
  97. package/dist/esm/{templateStore-3b26e38d.js → index-fd7b8a34.js} +2 -41
  98. package/dist/esm/index-fd7b8a34.js.map +1 -0
  99. package/dist/esm/loader.js +1 -1
  100. package/dist/esm/templateStore-96a39844.js +44 -0
  101. package/dist/esm/templateStore-96a39844.js.map +1 -0
  102. package/dist/esm/{utils-3f23facc.js → utils-99a3c1f0.js} +23 -4
  103. package/dist/esm/utils-99a3c1f0.js.map +1 -0
  104. package/dist/esm/verdocs-auth.entry.js +1 -1
  105. package/dist/esm/verdocs-build.entry.js +5 -4
  106. package/dist/esm/verdocs-build.entry.js.map +1 -1
  107. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  108. package/dist/esm/verdocs-document-page_2.entry.js +89 -0
  109. package/dist/esm/verdocs-document-page_2.entry.js.map +1 -0
  110. package/dist/esm/verdocs-dropdown_3.entry.js +1 -1
  111. package/dist/esm/verdocs-field-date.entry.js +1 -1
  112. package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
  113. package/dist/esm/verdocs-field-initial.entry.js +1 -1
  114. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  115. package/dist/esm/verdocs-field-signature_3.entry.js +1 -1
  116. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  117. package/dist/esm/verdocs-field-textbox.entry.js +3 -2
  118. package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
  119. package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
  120. package/dist/esm/verdocs-preview.entry.js +17 -11
  121. package/dist/esm/verdocs-preview.entry.js.map +1 -1
  122. package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
  123. package/dist/esm/verdocs-search.entry.js +1 -1
  124. package/dist/esm/verdocs-send.entry.js +2 -2
  125. package/dist/esm/verdocs-sign.entry.js +92 -23
  126. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  127. package/dist/esm/verdocs-template-create_4.entry.js +50 -34
  128. package/dist/esm/verdocs-template-create_4.entry.js.map +1 -1
  129. package/dist/esm/verdocs-view.entry.js +327 -0
  130. package/dist/esm/verdocs-view.entry.js.map +1 -0
  131. package/dist/esm/verdocs-web-sdk.js +1 -1
  132. package/dist/esm-es5/Envelopes-b031f847.js +2 -0
  133. package/dist/esm-es5/Envelopes-b031f847.js.map +1 -0
  134. package/dist/esm-es5/{Templates-91922342.js → Templates-1034fade.js} +2 -2
  135. package/dist/esm-es5/{Templates-91922342.js.map → Templates-1034fade.js.map} +0 -0
  136. package/dist/esm-es5/VerdocsEndpoint-dac04424.js +2 -0
  137. package/dist/esm-es5/VerdocsEndpoint-dac04424.js.map +1 -0
  138. package/dist/esm-es5/index-fd7b8a34.js +2 -0
  139. package/dist/esm-es5/index-fd7b8a34.js.map +1 -0
  140. package/dist/esm-es5/loader.js +1 -1
  141. package/dist/esm-es5/loader.js.map +1 -1
  142. package/dist/esm-es5/templateStore-96a39844.js +2 -0
  143. package/dist/esm-es5/templateStore-96a39844.js.map +1 -0
  144. package/dist/esm-es5/utils-99a3c1f0.js +2 -0
  145. package/dist/esm-es5/utils-99a3c1f0.js.map +1 -0
  146. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  147. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  148. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  149. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  150. package/dist/esm-es5/verdocs-document-page_2.entry.js +2 -0
  151. package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -0
  152. package/dist/esm-es5/verdocs-dropdown_3.entry.js +1 -1
  153. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  154. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  155. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  156. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  157. package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
  158. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  159. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  160. package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
  161. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  162. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  163. package/dist/esm-es5/verdocs-preview.entry.js.map +1 -1
  164. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  165. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  166. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  167. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  168. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  169. package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
  170. package/dist/esm-es5/verdocs-template-create_4.entry.js.map +1 -1
  171. package/dist/esm-es5/verdocs-view.entry.js +2 -0
  172. package/dist/esm-es5/verdocs-view.entry.js.map +1 -0
  173. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  174. package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
  175. package/dist/types/components/embeds/verdocs-preview/verdocs-preview.d.ts +3 -1
  176. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +23 -8
  177. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +5 -40
  178. package/dist/types/components/embeds/verdocs-view/verdocs-view.stories.d.ts +1 -2
  179. package/dist/types/components.d.ts +6 -219
  180. package/dist/types/utils/Envelopes.d.ts +2 -0
  181. package/dist/types/utils/envelopeStore.d.ts +10 -0
  182. package/dist/types/utils/utils.d.ts +10 -2
  183. package/dist/verdocs-web-sdk/{p-ff4840d2.system.entry.js → p-0a2efec0.system.entry.js} +2 -2
  184. package/dist/verdocs-web-sdk/{p-ff4840d2.system.entry.js.map → p-0a2efec0.system.entry.js.map} +0 -0
  185. package/dist/verdocs-web-sdk/p-0a3d0ca9.js +2 -0
  186. package/dist/verdocs-web-sdk/{p-36700fe4.js.map → p-0a3d0ca9.js.map} +0 -0
  187. package/dist/verdocs-web-sdk/p-0f6da8c7.system.js +2 -0
  188. package/dist/verdocs-web-sdk/p-0f6da8c7.system.js.map +1 -0
  189. package/dist/verdocs-web-sdk/{p-d2d3b56d.system.entry.js → p-112c8e05.system.entry.js} +2 -2
  190. package/dist/verdocs-web-sdk/{p-d2d3b56d.system.entry.js.map → p-112c8e05.system.entry.js.map} +0 -0
  191. package/dist/verdocs-web-sdk/p-1cd2f7dc.system.js +2 -0
  192. package/dist/verdocs-web-sdk/p-1cd2f7dc.system.js.map +1 -0
  193. package/dist/verdocs-web-sdk/p-21ec6ff0.system.js +2 -0
  194. package/dist/verdocs-web-sdk/p-21ec6ff0.system.js.map +1 -0
  195. package/dist/verdocs-web-sdk/p-2cf3843a.entry.js +2 -0
  196. package/dist/verdocs-web-sdk/{p-e47e3154.entry.js.map → p-2cf3843a.entry.js.map} +1 -1
  197. package/dist/verdocs-web-sdk/{p-f11b14a1.entry.js → p-2fe5b678.entry.js} +2 -2
  198. package/dist/verdocs-web-sdk/{p-f11b14a1.entry.js.map → p-2fe5b678.entry.js.map} +0 -0
  199. package/dist/verdocs-web-sdk/p-30424967.entry.js +2 -0
  200. package/dist/verdocs-web-sdk/p-30424967.entry.js.map +1 -0
  201. package/dist/verdocs-web-sdk/p-32c7bce8.system.entry.js +2 -0
  202. package/dist/verdocs-web-sdk/p-32c7bce8.system.entry.js.map +1 -0
  203. package/dist/verdocs-web-sdk/{p-63d01d16.system.js → p-32da34af.system.js} +2 -2
  204. package/dist/verdocs-web-sdk/{p-63d01d16.system.js.map → p-32da34af.system.js.map} +0 -0
  205. package/dist/verdocs-web-sdk/{p-2510c268.entry.js → p-32e3a428.entry.js} +2 -2
  206. package/dist/verdocs-web-sdk/{p-2510c268.entry.js.map → p-32e3a428.entry.js.map} +0 -0
  207. package/dist/verdocs-web-sdk/{p-f5eb353f.system.entry.js → p-3585534a.system.entry.js} +2 -2
  208. package/dist/verdocs-web-sdk/{p-f5eb353f.system.entry.js.map → p-3585534a.system.entry.js.map} +0 -0
  209. package/dist/verdocs-web-sdk/{p-c37ea778.system.entry.js → p-35fec075.system.entry.js} +2 -2
  210. package/dist/verdocs-web-sdk/{p-c37ea778.system.entry.js.map → p-35fec075.system.entry.js.map} +0 -0
  211. package/dist/verdocs-web-sdk/{p-ab23a9d1.entry.js → p-4b4c610f.entry.js} +2 -2
  212. package/dist/verdocs-web-sdk/{p-ab23a9d1.entry.js.map → p-4b4c610f.entry.js.map} +0 -0
  213. package/dist/verdocs-web-sdk/{p-8c549b7f.entry.js → p-5b636344.entry.js} +2 -2
  214. package/dist/verdocs-web-sdk/{p-8c549b7f.entry.js.map → p-5b636344.entry.js.map} +0 -0
  215. package/dist/verdocs-web-sdk/p-5bb42252.system.entry.js +2 -0
  216. package/dist/verdocs-web-sdk/{p-508192bb.system.entry.js.map → p-5bb42252.system.entry.js.map} +1 -1
  217. package/dist/verdocs-web-sdk/p-5d341c89.system.entry.js +2 -0
  218. package/dist/verdocs-web-sdk/p-5d341c89.system.entry.js.map +1 -0
  219. package/dist/verdocs-web-sdk/p-5ea05a1d.js +2 -0
  220. package/dist/verdocs-web-sdk/p-5ea05a1d.js.map +1 -0
  221. package/dist/verdocs-web-sdk/p-6802bdd2.system.entry.js +2 -0
  222. package/dist/verdocs-web-sdk/{p-ccf983c7.system.entry.js.map → p-6802bdd2.system.entry.js.map} +1 -1
  223. package/dist/verdocs-web-sdk/{p-dee9037d.system.entry.js → p-6a8ac53e.system.entry.js} +2 -2
  224. package/dist/verdocs-web-sdk/{p-dee9037d.system.entry.js.map → p-6a8ac53e.system.entry.js.map} +0 -0
  225. package/dist/verdocs-web-sdk/{p-2bb98709.system.entry.js → p-78ec7db1.system.entry.js} +2 -2
  226. package/dist/verdocs-web-sdk/{p-2bb98709.system.entry.js.map → p-78ec7db1.system.entry.js.map} +0 -0
  227. package/dist/verdocs-web-sdk/{p-04708900.system.entry.js → p-8095fab3.system.entry.js} +2 -2
  228. package/dist/verdocs-web-sdk/{p-04708900.system.entry.js.map → p-8095fab3.system.entry.js.map} +0 -0
  229. package/dist/verdocs-web-sdk/{p-036fc9f9.entry.js → p-868f497f.entry.js} +2 -2
  230. package/dist/verdocs-web-sdk/{p-036fc9f9.entry.js.map → p-868f497f.entry.js.map} +0 -0
  231. package/dist/verdocs-web-sdk/p-9236d9df.entry.js +2 -0
  232. package/dist/verdocs-web-sdk/{p-f06218ed.entry.js.map → p-9236d9df.entry.js.map} +1 -1
  233. package/dist/verdocs-web-sdk/p-92b0fc42.js +2 -0
  234. package/dist/verdocs-web-sdk/p-92b0fc42.js.map +1 -0
  235. package/dist/verdocs-web-sdk/{p-d6390915.entry.js → p-a59f1f82.entry.js} +2 -2
  236. package/dist/verdocs-web-sdk/{p-d6390915.entry.js.map → p-a59f1f82.entry.js.map} +0 -0
  237. package/dist/verdocs-web-sdk/p-a760546b.entry.js +2 -0
  238. package/dist/verdocs-web-sdk/p-a760546b.entry.js.map +1 -0
  239. package/dist/verdocs-web-sdk/p-a7ac4da8.system.entry.js +2 -0
  240. package/dist/verdocs-web-sdk/p-a7ac4da8.system.entry.js.map +1 -0
  241. package/dist/verdocs-web-sdk/{p-8574c48b.system.entry.js → p-a8c25a4a.system.entry.js} +2 -2
  242. package/dist/verdocs-web-sdk/{p-8574c48b.system.entry.js.map → p-a8c25a4a.system.entry.js.map} +0 -0
  243. package/dist/verdocs-web-sdk/{p-bcae2278.entry.js → p-a9068845.entry.js} +2 -2
  244. package/dist/verdocs-web-sdk/{p-bcae2278.entry.js.map → p-a9068845.entry.js.map} +0 -0
  245. package/dist/verdocs-web-sdk/{p-0d12be64.system.entry.js → p-aa2d9932.system.entry.js} +2 -2
  246. package/dist/verdocs-web-sdk/{p-0d12be64.system.entry.js.map → p-aa2d9932.system.entry.js.map} +0 -0
  247. package/dist/verdocs-web-sdk/{p-ffff808d.entry.js → p-af1063e3.entry.js} +2 -2
  248. package/dist/verdocs-web-sdk/{p-ffff808d.entry.js.map → p-af1063e3.entry.js.map} +0 -0
  249. package/dist/verdocs-web-sdk/{p-cf8ecaaf.system.entry.js → p-b5882803.system.entry.js} +2 -2
  250. package/dist/verdocs-web-sdk/{p-cf8ecaaf.system.entry.js.map → p-b5882803.system.entry.js.map} +0 -0
  251. package/dist/verdocs-web-sdk/{p-68319ca5.system.entry.js → p-b6c24f97.system.entry.js} +2 -2
  252. package/dist/verdocs-web-sdk/{p-68319ca5.system.entry.js.map → p-b6c24f97.system.entry.js.map} +0 -0
  253. package/dist/verdocs-web-sdk/{p-2da21c85.entry.js → p-baa985a4.entry.js} +2 -2
  254. package/dist/verdocs-web-sdk/{p-2da21c85.entry.js.map → p-baa985a4.entry.js.map} +0 -0
  255. package/dist/verdocs-web-sdk/{p-650e0b71.entry.js → p-be8004c0.entry.js} +2 -2
  256. package/dist/verdocs-web-sdk/{p-650e0b71.entry.js.map → p-be8004c0.entry.js.map} +0 -0
  257. package/dist/verdocs-web-sdk/p-becd8d7e.js +2 -0
  258. package/dist/verdocs-web-sdk/p-becd8d7e.js.map +1 -0
  259. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
  260. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js.map +1 -1
  261. package/dist/verdocs-web-sdk/p-c4357387.entry.js +2 -0
  262. package/dist/verdocs-web-sdk/p-c4357387.entry.js.map +1 -0
  263. package/dist/verdocs-web-sdk/{p-6f1440dd.js → p-c5a43bb3.js} +2 -2
  264. package/dist/verdocs-web-sdk/p-c5a43bb3.js.map +1 -0
  265. package/dist/verdocs-web-sdk/p-cb7d9ff5.js +2 -0
  266. package/dist/verdocs-web-sdk/p-cb7d9ff5.js.map +1 -0
  267. package/dist/verdocs-web-sdk/{p-f9901184.system.js → p-cd7b475a.system.js} +2 -2
  268. package/dist/verdocs-web-sdk/p-cd7b475a.system.js.map +1 -0
  269. package/dist/verdocs-web-sdk/p-d1a97a03.system.js +2 -0
  270. package/dist/verdocs-web-sdk/p-d1a97a03.system.js.map +1 -0
  271. package/dist/verdocs-web-sdk/{p-473165ae.system.entry.js → p-dd864f36.system.entry.js} +2 -2
  272. package/dist/verdocs-web-sdk/{p-473165ae.system.entry.js.map → p-dd864f36.system.entry.js.map} +0 -0
  273. package/dist/verdocs-web-sdk/p-e4569806.system.entry.js +2 -0
  274. package/dist/verdocs-web-sdk/p-e4569806.system.entry.js.map +1 -0
  275. package/dist/verdocs-web-sdk/p-e4fa4969.entry.js +2 -0
  276. package/dist/verdocs-web-sdk/p-e4fa4969.entry.js.map +1 -0
  277. package/dist/verdocs-web-sdk/{p-932571a1.entry.js → p-f19e600e.entry.js} +2 -2
  278. package/dist/verdocs-web-sdk/{p-932571a1.entry.js.map → p-f19e600e.entry.js.map} +0 -0
  279. package/dist/verdocs-web-sdk/p-f8c49765.system.entry.js +2 -0
  280. package/dist/verdocs-web-sdk/p-f8c49765.system.entry.js.map +1 -0
  281. package/dist/verdocs-web-sdk/{p-6f938ce3.entry.js → p-f9a9b3a2.entry.js} +2 -2
  282. package/dist/verdocs-web-sdk/{p-6f938ce3.entry.js.map → p-f9a9b3a2.entry.js.map} +0 -0
  283. package/dist/verdocs-web-sdk/{p-259fd8de.entry.js → p-fac05414.entry.js} +2 -2
  284. package/dist/verdocs-web-sdk/{p-259fd8de.entry.js.map → p-fac05414.entry.js.map} +0 -0
  285. package/dist/verdocs-web-sdk/p-fc93f2f3.entry.js +2 -0
  286. package/dist/verdocs-web-sdk/p-fc93f2f3.entry.js.map +1 -0
  287. package/dist/verdocs-web-sdk/{p-ed8e3256.system.entry.js → p-ff0b44f9.system.entry.js} +2 -2
  288. package/dist/verdocs-web-sdk/{p-ed8e3256.system.entry.js.map → p-ff0b44f9.system.entry.js.map} +0 -0
  289. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  290. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
  291. package/package.json +2 -2
  292. package/dist/cjs/Envelopes-22a0c02f.js.map +0 -1
  293. package/dist/cjs/TemplateDocuments-01c6e570.js +0 -45
  294. package/dist/cjs/TemplateDocuments-01c6e570.js.map +0 -1
  295. package/dist/cjs/VerdocsEndpoint-db38e942.js +0 -2435
  296. package/dist/cjs/VerdocsEndpoint-db38e942.js.map +0 -1
  297. package/dist/cjs/templateStore-92828c3c.js.map +0 -1
  298. package/dist/cjs/utils-84236321.js.map +0 -1
  299. package/dist/cjs/verdocs-document-page.cjs.entry.js +0 -84
  300. package/dist/cjs/verdocs-document-page.cjs.entry.js.map +0 -1
  301. package/dist/cjs/verdocs-loader_4.cjs.entry.js +0 -553
  302. package/dist/cjs/verdocs-loader_4.cjs.entry.js.map +0 -1
  303. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.css +0 -16
  304. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.js +0 -390
  305. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.js.map +0 -1
  306. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.stories.js +0 -15
  307. package/dist/collection/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.stories.js.map +0 -1
  308. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.css +0 -16
  309. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.js +0 -388
  310. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.js.map +0 -1
  311. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.stories.js +0 -15
  312. package/dist/collection/components/elements/verdocs-view-template-document/verdocs-view-template-document.stories.js.map +0 -1
  313. package/dist/components/TemplateDocuments.js +0 -42
  314. package/dist/components/TemplateDocuments.js.map +0 -1
  315. package/dist/components/verdocs-view-envelope-document.d.ts +0 -11
  316. package/dist/components/verdocs-view-envelope-document.js +0 -8
  317. package/dist/components/verdocs-view-envelope-document.js.map +0 -1
  318. package/dist/components/verdocs-view-envelope-document2.js +0 -306
  319. package/dist/components/verdocs-view-envelope-document2.js.map +0 -1
  320. package/dist/components/verdocs-view-template-document.d.ts +0 -11
  321. package/dist/components/verdocs-view-template-document.js +0 -8
  322. package/dist/components/verdocs-view-template-document.js.map +0 -1
  323. package/dist/components/verdocs-view-template-document2.js +0 -209
  324. package/dist/components/verdocs-view-template-document2.js.map +0 -1
  325. package/dist/components/verdocs-view2.js +0 -229
  326. package/dist/components/verdocs-view2.js.map +0 -1
  327. package/dist/esm/Envelopes-df05b3c7.js.map +0 -1
  328. package/dist/esm/TemplateDocuments-89ba2276.js +0 -42
  329. package/dist/esm/TemplateDocuments-89ba2276.js.map +0 -1
  330. package/dist/esm/VerdocsEndpoint-82f4600d.js +0 -2432
  331. package/dist/esm/VerdocsEndpoint-82f4600d.js.map +0 -1
  332. package/dist/esm/templateStore-3b26e38d.js.map +0 -1
  333. package/dist/esm/utils-3f23facc.js.map +0 -1
  334. package/dist/esm/verdocs-document-page.entry.js +0 -80
  335. package/dist/esm/verdocs-document-page.entry.js.map +0 -1
  336. package/dist/esm/verdocs-loader_4.entry.js +0 -546
  337. package/dist/esm/verdocs-loader_4.entry.js.map +0 -1
  338. package/dist/esm-es5/Envelopes-df05b3c7.js +0 -2
  339. package/dist/esm-es5/Envelopes-df05b3c7.js.map +0 -1
  340. package/dist/esm-es5/TemplateDocuments-89ba2276.js +0 -2
  341. package/dist/esm-es5/TemplateDocuments-89ba2276.js.map +0 -1
  342. package/dist/esm-es5/VerdocsEndpoint-82f4600d.js +0 -2
  343. package/dist/esm-es5/VerdocsEndpoint-82f4600d.js.map +0 -1
  344. package/dist/esm-es5/templateStore-3b26e38d.js +0 -2
  345. package/dist/esm-es5/templateStore-3b26e38d.js.map +0 -1
  346. package/dist/esm-es5/utils-3f23facc.js +0 -2
  347. package/dist/esm-es5/utils-3f23facc.js.map +0 -1
  348. package/dist/esm-es5/verdocs-document-page.entry.js +0 -2
  349. package/dist/esm-es5/verdocs-document-page.entry.js.map +0 -1
  350. package/dist/esm-es5/verdocs-loader_4.entry.js +0 -2
  351. package/dist/esm-es5/verdocs-loader_4.entry.js.map +0 -1
  352. package/dist/types/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.d.ts +0 -79
  353. package/dist/types/components/elements/verdocs-view-envelope-document/verdocs-view-envelope-document.stories.d.ts +0 -7
  354. package/dist/types/components/elements/verdocs-view-template-document/verdocs-view-template-document.d.ts +0 -77
  355. package/dist/types/components/elements/verdocs-view-template-document/verdocs-view-template-document.stories.d.ts +0 -7
  356. package/dist/verdocs-web-sdk/p-142295dd.system.entry.js +0 -2
  357. package/dist/verdocs-web-sdk/p-142295dd.system.entry.js.map +0 -1
  358. package/dist/verdocs-web-sdk/p-2fbd4e25.entry.js +0 -2
  359. package/dist/verdocs-web-sdk/p-2fbd4e25.entry.js.map +0 -1
  360. package/dist/verdocs-web-sdk/p-3035b6c5.system.js +0 -2
  361. package/dist/verdocs-web-sdk/p-3035b6c5.system.js.map +0 -1
  362. package/dist/verdocs-web-sdk/p-36700fe4.js +0 -2
  363. package/dist/verdocs-web-sdk/p-3a4126d5.system.entry.js +0 -2
  364. package/dist/verdocs-web-sdk/p-3a4126d5.system.entry.js.map +0 -1
  365. package/dist/verdocs-web-sdk/p-48d9e0d6.entry.js +0 -2
  366. package/dist/verdocs-web-sdk/p-48d9e0d6.entry.js.map +0 -1
  367. package/dist/verdocs-web-sdk/p-508192bb.system.entry.js +0 -2
  368. package/dist/verdocs-web-sdk/p-629237fc.js +0 -2
  369. package/dist/verdocs-web-sdk/p-629237fc.js.map +0 -1
  370. package/dist/verdocs-web-sdk/p-6e1ada33.system.js +0 -2
  371. package/dist/verdocs-web-sdk/p-6e1ada33.system.js.map +0 -1
  372. package/dist/verdocs-web-sdk/p-6f1440dd.js.map +0 -1
  373. package/dist/verdocs-web-sdk/p-70c732b7.js +0 -2
  374. package/dist/verdocs-web-sdk/p-70c732b7.js.map +0 -1
  375. package/dist/verdocs-web-sdk/p-7ce27ce2.js +0 -2
  376. package/dist/verdocs-web-sdk/p-7ce27ce2.js.map +0 -1
  377. package/dist/verdocs-web-sdk/p-8fd9dc5a.js +0 -2
  378. package/dist/verdocs-web-sdk/p-8fd9dc5a.js.map +0 -1
  379. package/dist/verdocs-web-sdk/p-a4041773.system.js +0 -2
  380. package/dist/verdocs-web-sdk/p-a4041773.system.js.map +0 -1
  381. package/dist/verdocs-web-sdk/p-b348e0ee.entry.js +0 -2
  382. package/dist/verdocs-web-sdk/p-b348e0ee.entry.js.map +0 -1
  383. package/dist/verdocs-web-sdk/p-b95cb372.entry.js +0 -2
  384. package/dist/verdocs-web-sdk/p-b95cb372.entry.js.map +0 -1
  385. package/dist/verdocs-web-sdk/p-c827cc19.system.js +0 -2
  386. package/dist/verdocs-web-sdk/p-c827cc19.system.js.map +0 -1
  387. package/dist/verdocs-web-sdk/p-ca6a1398.system.entry.js +0 -2
  388. package/dist/verdocs-web-sdk/p-ca6a1398.system.entry.js.map +0 -1
  389. package/dist/verdocs-web-sdk/p-ccf983c7.system.entry.js +0 -2
  390. package/dist/verdocs-web-sdk/p-cf2d7761.system.entry.js +0 -2
  391. package/dist/verdocs-web-sdk/p-cf2d7761.system.entry.js.map +0 -1
  392. package/dist/verdocs-web-sdk/p-e47e3154.entry.js +0 -2
  393. package/dist/verdocs-web-sdk/p-f06218ed.entry.js +0 -2
  394. package/dist/verdocs-web-sdk/p-f9901184.system.js.map +0 -1
  395. package/dist/verdocs-web-sdk/p-fc3a0e2d.system.entry.js +0 -2
  396. package/dist/verdocs-web-sdk/p-fc3a0e2d.system.entry.js.map +0 -1
  397. package/dist/verdocs-web-sdk/p-fe512c19.entry.js +0 -2
  398. package/dist/verdocs-web-sdk/p-fe512c19.entry.js.map +0 -1
@@ -1,2435 +0,0 @@
1
- 'use strict';
2
-
3
- /* tslint:disable:no-bitwise */
4
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
5
- // Regular expression to check formal correctness of base64 encoded strings
6
- var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
7
- /**
8
- * Simplified, Node/Browser-safe alternative to atob() for base64 decoding.
9
- * Modified from https://github.com/MaxArt2501/base64-js/blob/master/base64.js
10
- */
11
- var AtoB = function (str) {
12
- // atob can work with strings with whitespaces, even inside the encoded part,
13
- // but only \t, \n, \f, \r and ' ', which can be stripped.
14
- str = String(str).replace(/[\t\n\f\r ]+/g, '');
15
- if (!b64re.test(str))
16
- throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
17
- // Adding the padding if missing, for semplicity
18
- str += '=='.slice(2 - (str.length & 3));
19
- var bitmap;
20
- var result = '';
21
- var r1;
22
- var r2;
23
- var i = 0;
24
- for (; i < str.length;) {
25
- bitmap =
26
- (b64.indexOf(str.charAt(i++)) << 18) |
27
- (b64.indexOf(str.charAt(i++)) << 12) |
28
- ((r1 = b64.indexOf(str.charAt(i++))) << 6) |
29
- (r2 = b64.indexOf(str.charAt(i++)));
30
- result +=
31
- r1 === 64
32
- ? String.fromCharCode((bitmap >> 16) & 255)
33
- : r2 === 64
34
- ? String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255)
35
- : String.fromCharCode((bitmap >> 16) & 255, (bitmap >> 8) & 255, bitmap & 255);
36
- }
37
- return result;
38
- };
39
- /**
40
- * Decode the body of a JWT. This helper may allow front-end applications to avoid a dependency on `jsonwebtoken` in
41
- * many cases. Note that this should only be used for true JWTs. Opaque tokens will cause this to throw.
42
- */
43
- var decodeJWTBody = function (token) { return JSON.parse(AtoB((token || '').split('.')[1] || '')); };
44
- /**
45
- * Decode the body of an Verdocs access token. Note that raw tokens contain namespaced fields, e.g.
46
- * `https://verdocs.com/profile_id`. To make these tokens easier to use in front-end code, this name-spacing
47
- * will be removed. Note that user and signing sessions have different access token formats. The calling
48
- * application should distinguish between the two based on the context of the authenticated session, or by
49
- * the presence of the `document_id` field, which will only be present for signing sessions.
50
- */
51
- var decodeAccessTokenBody = function (token) {
52
- var decoded;
53
- try {
54
- decoded = decodeJWTBody(token);
55
- if (decoded === null) {
56
- return null;
57
- }
58
- }
59
- catch (e) {
60
- return null;
61
- }
62
- Object.keys(decoded).forEach(function (key) {
63
- if (typeof key === 'string' && key.startsWith('https://verdocs.com/')) {
64
- decoded[key.replace('https://verdocs.com/', '')] = decoded[key];
65
- delete decoded[key];
66
- }
67
- });
68
- return decoded;
69
- };
70
-
71
- var bind = function bind(fn, thisArg) {
72
- return function wrap() {
73
- var args = new Array(arguments.length);
74
- for (var i = 0; i < args.length; i++) {
75
- args[i] = arguments[i];
76
- }
77
- return fn.apply(thisArg, args);
78
- };
79
- };
80
-
81
- // utils is a library of generic helper functions non-specific to axios
82
-
83
- var toString = Object.prototype.toString;
84
-
85
- // eslint-disable-next-line func-names
86
- var kindOf = (function(cache) {
87
- // eslint-disable-next-line func-names
88
- return function(thing) {
89
- var str = toString.call(thing);
90
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
91
- };
92
- })(Object.create(null));
93
-
94
- function kindOfTest(type) {
95
- type = type.toLowerCase();
96
- return function isKindOf(thing) {
97
- return kindOf(thing) === type;
98
- };
99
- }
100
-
101
- /**
102
- * Determine if a value is an Array
103
- *
104
- * @param {Object} val The value to test
105
- * @returns {boolean} True if value is an Array, otherwise false
106
- */
107
- function isArray(val) {
108
- return Array.isArray(val);
109
- }
110
-
111
- /**
112
- * Determine if a value is undefined
113
- *
114
- * @param {Object} val The value to test
115
- * @returns {boolean} True if the value is undefined, otherwise false
116
- */
117
- function isUndefined(val) {
118
- return typeof val === 'undefined';
119
- }
120
-
121
- /**
122
- * Determine if a value is a Buffer
123
- *
124
- * @param {Object} val The value to test
125
- * @returns {boolean} True if value is a Buffer, otherwise false
126
- */
127
- function isBuffer(val) {
128
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
129
- && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
130
- }
131
-
132
- /**
133
- * Determine if a value is an ArrayBuffer
134
- *
135
- * @function
136
- * @param {Object} val The value to test
137
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
138
- */
139
- var isArrayBuffer = kindOfTest('ArrayBuffer');
140
-
141
-
142
- /**
143
- * Determine if a value is a view on an ArrayBuffer
144
- *
145
- * @param {Object} val The value to test
146
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
147
- */
148
- function isArrayBufferView(val) {
149
- var result;
150
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
151
- result = ArrayBuffer.isView(val);
152
- } else {
153
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
154
- }
155
- return result;
156
- }
157
-
158
- /**
159
- * Determine if a value is a String
160
- *
161
- * @param {Object} val The value to test
162
- * @returns {boolean} True if value is a String, otherwise false
163
- */
164
- function isString(val) {
165
- return typeof val === 'string';
166
- }
167
-
168
- /**
169
- * Determine if a value is a Number
170
- *
171
- * @param {Object} val The value to test
172
- * @returns {boolean} True if value is a Number, otherwise false
173
- */
174
- function isNumber(val) {
175
- return typeof val === 'number';
176
- }
177
-
178
- /**
179
- * Determine if a value is an Object
180
- *
181
- * @param {Object} val The value to test
182
- * @returns {boolean} True if value is an Object, otherwise false
183
- */
184
- function isObject(val) {
185
- return val !== null && typeof val === 'object';
186
- }
187
-
188
- /**
189
- * Determine if a value is a plain Object
190
- *
191
- * @param {Object} val The value to test
192
- * @return {boolean} True if value is a plain Object, otherwise false
193
- */
194
- function isPlainObject(val) {
195
- if (kindOf(val) !== 'object') {
196
- return false;
197
- }
198
-
199
- var prototype = Object.getPrototypeOf(val);
200
- return prototype === null || prototype === Object.prototype;
201
- }
202
-
203
- /**
204
- * Determine if a value is a Date
205
- *
206
- * @function
207
- * @param {Object} val The value to test
208
- * @returns {boolean} True if value is a Date, otherwise false
209
- */
210
- var isDate = kindOfTest('Date');
211
-
212
- /**
213
- * Determine if a value is a File
214
- *
215
- * @function
216
- * @param {Object} val The value to test
217
- * @returns {boolean} True if value is a File, otherwise false
218
- */
219
- var isFile = kindOfTest('File');
220
-
221
- /**
222
- * Determine if a value is a Blob
223
- *
224
- * @function
225
- * @param {Object} val The value to test
226
- * @returns {boolean} True if value is a Blob, otherwise false
227
- */
228
- var isBlob = kindOfTest('Blob');
229
-
230
- /**
231
- * Determine if a value is a FileList
232
- *
233
- * @function
234
- * @param {Object} val The value to test
235
- * @returns {boolean} True if value is a File, otherwise false
236
- */
237
- var isFileList = kindOfTest('FileList');
238
-
239
- /**
240
- * Determine if a value is a Function
241
- *
242
- * @param {Object} val The value to test
243
- * @returns {boolean} True if value is a Function, otherwise false
244
- */
245
- function isFunction(val) {
246
- return toString.call(val) === '[object Function]';
247
- }
248
-
249
- /**
250
- * Determine if a value is a Stream
251
- *
252
- * @param {Object} val The value to test
253
- * @returns {boolean} True if value is a Stream, otherwise false
254
- */
255
- function isStream(val) {
256
- return isObject(val) && isFunction(val.pipe);
257
- }
258
-
259
- /**
260
- * Determine if a value is a FormData
261
- *
262
- * @param {Object} thing The value to test
263
- * @returns {boolean} True if value is an FormData, otherwise false
264
- */
265
- function isFormData(thing) {
266
- var pattern = '[object FormData]';
267
- return thing && (
268
- (typeof FormData === 'function' && thing instanceof FormData) ||
269
- toString.call(thing) === pattern ||
270
- (isFunction(thing.toString) && thing.toString() === pattern)
271
- );
272
- }
273
-
274
- /**
275
- * Determine if a value is a URLSearchParams object
276
- * @function
277
- * @param {Object} val The value to test
278
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
279
- */
280
- var isURLSearchParams = kindOfTest('URLSearchParams');
281
-
282
- /**
283
- * Trim excess whitespace off the beginning and end of a string
284
- *
285
- * @param {String} str The String to trim
286
- * @returns {String} The String freed of excess whitespace
287
- */
288
- function trim(str) {
289
- return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
290
- }
291
-
292
- /**
293
- * Determine if we're running in a standard browser environment
294
- *
295
- * This allows axios to run in a web worker, and react-native.
296
- * Both environments support XMLHttpRequest, but not fully standard globals.
297
- *
298
- * web workers:
299
- * typeof window -> undefined
300
- * typeof document -> undefined
301
- *
302
- * react-native:
303
- * navigator.product -> 'ReactNative'
304
- * nativescript
305
- * navigator.product -> 'NativeScript' or 'NS'
306
- */
307
- function isStandardBrowserEnv() {
308
- if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
309
- navigator.product === 'NativeScript' ||
310
- navigator.product === 'NS')) {
311
- return false;
312
- }
313
- return (
314
- typeof window !== 'undefined' &&
315
- typeof document !== 'undefined'
316
- );
317
- }
318
-
319
- /**
320
- * Iterate over an Array or an Object invoking a function for each item.
321
- *
322
- * If `obj` is an Array callback will be called passing
323
- * the value, index, and complete array for each item.
324
- *
325
- * If 'obj' is an Object callback will be called passing
326
- * the value, key, and complete object for each property.
327
- *
328
- * @param {Object|Array} obj The object to iterate
329
- * @param {Function} fn The callback to invoke for each item
330
- */
331
- function forEach(obj, fn) {
332
- // Don't bother if no value provided
333
- if (obj === null || typeof obj === 'undefined') {
334
- return;
335
- }
336
-
337
- // Force an array if not already something iterable
338
- if (typeof obj !== 'object') {
339
- /*eslint no-param-reassign:0*/
340
- obj = [obj];
341
- }
342
-
343
- if (isArray(obj)) {
344
- // Iterate over array values
345
- for (var i = 0, l = obj.length; i < l; i++) {
346
- fn.call(null, obj[i], i, obj);
347
- }
348
- } else {
349
- // Iterate over object keys
350
- for (var key in obj) {
351
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
352
- fn.call(null, obj[key], key, obj);
353
- }
354
- }
355
- }
356
- }
357
-
358
- /**
359
- * Accepts varargs expecting each argument to be an object, then
360
- * immutably merges the properties of each object and returns result.
361
- *
362
- * When multiple objects contain the same key the later object in
363
- * the arguments list will take precedence.
364
- *
365
- * Example:
366
- *
367
- * ```js
368
- * var result = merge({foo: 123}, {foo: 456});
369
- * console.log(result.foo); // outputs 456
370
- * ```
371
- *
372
- * @param {Object} obj1 Object to merge
373
- * @returns {Object} Result of all merge properties
374
- */
375
- function merge(/* obj1, obj2, obj3, ... */) {
376
- var result = {};
377
- function assignValue(val, key) {
378
- if (isPlainObject(result[key]) && isPlainObject(val)) {
379
- result[key] = merge(result[key], val);
380
- } else if (isPlainObject(val)) {
381
- result[key] = merge({}, val);
382
- } else if (isArray(val)) {
383
- result[key] = val.slice();
384
- } else {
385
- result[key] = val;
386
- }
387
- }
388
-
389
- for (var i = 0, l = arguments.length; i < l; i++) {
390
- forEach(arguments[i], assignValue);
391
- }
392
- return result;
393
- }
394
-
395
- /**
396
- * Extends object a by mutably adding to it the properties of object b.
397
- *
398
- * @param {Object} a The object to be extended
399
- * @param {Object} b The object to copy properties from
400
- * @param {Object} thisArg The object to bind function to
401
- * @return {Object} The resulting value of object a
402
- */
403
- function extend(a, b, thisArg) {
404
- forEach(b, function assignValue(val, key) {
405
- if (thisArg && typeof val === 'function') {
406
- a[key] = bind(val, thisArg);
407
- } else {
408
- a[key] = val;
409
- }
410
- });
411
- return a;
412
- }
413
-
414
- /**
415
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
416
- *
417
- * @param {string} content with BOM
418
- * @return {string} content value without BOM
419
- */
420
- function stripBOM(content) {
421
- if (content.charCodeAt(0) === 0xFEFF) {
422
- content = content.slice(1);
423
- }
424
- return content;
425
- }
426
-
427
- /**
428
- * Inherit the prototype methods from one constructor into another
429
- * @param {function} constructor
430
- * @param {function} superConstructor
431
- * @param {object} [props]
432
- * @param {object} [descriptors]
433
- */
434
-
435
- function inherits(constructor, superConstructor, props, descriptors) {
436
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
437
- constructor.prototype.constructor = constructor;
438
- props && Object.assign(constructor.prototype, props);
439
- }
440
-
441
- /**
442
- * Resolve object with deep prototype chain to a flat object
443
- * @param {Object} sourceObj source object
444
- * @param {Object} [destObj]
445
- * @param {Function} [filter]
446
- * @returns {Object}
447
- */
448
-
449
- function toFlatObject(sourceObj, destObj, filter) {
450
- var props;
451
- var i;
452
- var prop;
453
- var merged = {};
454
-
455
- destObj = destObj || {};
456
-
457
- do {
458
- props = Object.getOwnPropertyNames(sourceObj);
459
- i = props.length;
460
- while (i-- > 0) {
461
- prop = props[i];
462
- if (!merged[prop]) {
463
- destObj[prop] = sourceObj[prop];
464
- merged[prop] = true;
465
- }
466
- }
467
- sourceObj = Object.getPrototypeOf(sourceObj);
468
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
469
-
470
- return destObj;
471
- }
472
-
473
- /*
474
- * determines whether a string ends with the characters of a specified string
475
- * @param {String} str
476
- * @param {String} searchString
477
- * @param {Number} [position= 0]
478
- * @returns {boolean}
479
- */
480
- function endsWith(str, searchString, position) {
481
- str = String(str);
482
- if (position === undefined || position > str.length) {
483
- position = str.length;
484
- }
485
- position -= searchString.length;
486
- var lastIndex = str.indexOf(searchString, position);
487
- return lastIndex !== -1 && lastIndex === position;
488
- }
489
-
490
-
491
- /**
492
- * Returns new array from array like object
493
- * @param {*} [thing]
494
- * @returns {Array}
495
- */
496
- function toArray(thing) {
497
- if (!thing) return null;
498
- var i = thing.length;
499
- if (isUndefined(i)) return null;
500
- var arr = new Array(i);
501
- while (i-- > 0) {
502
- arr[i] = thing[i];
503
- }
504
- return arr;
505
- }
506
-
507
- // eslint-disable-next-line func-names
508
- var isTypedArray = (function(TypedArray) {
509
- // eslint-disable-next-line func-names
510
- return function(thing) {
511
- return TypedArray && thing instanceof TypedArray;
512
- };
513
- })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
514
-
515
- var utils = {
516
- isArray: isArray,
517
- isArrayBuffer: isArrayBuffer,
518
- isBuffer: isBuffer,
519
- isFormData: isFormData,
520
- isArrayBufferView: isArrayBufferView,
521
- isString: isString,
522
- isNumber: isNumber,
523
- isObject: isObject,
524
- isPlainObject: isPlainObject,
525
- isUndefined: isUndefined,
526
- isDate: isDate,
527
- isFile: isFile,
528
- isBlob: isBlob,
529
- isFunction: isFunction,
530
- isStream: isStream,
531
- isURLSearchParams: isURLSearchParams,
532
- isStandardBrowserEnv: isStandardBrowserEnv,
533
- forEach: forEach,
534
- merge: merge,
535
- extend: extend,
536
- trim: trim,
537
- stripBOM: stripBOM,
538
- inherits: inherits,
539
- toFlatObject: toFlatObject,
540
- kindOf: kindOf,
541
- kindOfTest: kindOfTest,
542
- endsWith: endsWith,
543
- toArray: toArray,
544
- isTypedArray: isTypedArray,
545
- isFileList: isFileList
546
- };
547
-
548
- function encode(val) {
549
- return encodeURIComponent(val).
550
- replace(/%3A/gi, ':').
551
- replace(/%24/g, '$').
552
- replace(/%2C/gi, ',').
553
- replace(/%20/g, '+').
554
- replace(/%5B/gi, '[').
555
- replace(/%5D/gi, ']');
556
- }
557
-
558
- /**
559
- * Build a URL by appending params to the end
560
- *
561
- * @param {string} url The base of the url (e.g., http://www.google.com)
562
- * @param {object} [params] The params to be appended
563
- * @returns {string} The formatted url
564
- */
565
- var buildURL = function buildURL(url, params, paramsSerializer) {
566
- /*eslint no-param-reassign:0*/
567
- if (!params) {
568
- return url;
569
- }
570
-
571
- var serializedParams;
572
- if (paramsSerializer) {
573
- serializedParams = paramsSerializer(params);
574
- } else if (utils.isURLSearchParams(params)) {
575
- serializedParams = params.toString();
576
- } else {
577
- var parts = [];
578
-
579
- utils.forEach(params, function serialize(val, key) {
580
- if (val === null || typeof val === 'undefined') {
581
- return;
582
- }
583
-
584
- if (utils.isArray(val)) {
585
- key = key + '[]';
586
- } else {
587
- val = [val];
588
- }
589
-
590
- utils.forEach(val, function parseValue(v) {
591
- if (utils.isDate(v)) {
592
- v = v.toISOString();
593
- } else if (utils.isObject(v)) {
594
- v = JSON.stringify(v);
595
- }
596
- parts.push(encode(key) + '=' + encode(v));
597
- });
598
- });
599
-
600
- serializedParams = parts.join('&');
601
- }
602
-
603
- if (serializedParams) {
604
- var hashmarkIndex = url.indexOf('#');
605
- if (hashmarkIndex !== -1) {
606
- url = url.slice(0, hashmarkIndex);
607
- }
608
-
609
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
610
- }
611
-
612
- return url;
613
- };
614
-
615
- function InterceptorManager() {
616
- this.handlers = [];
617
- }
618
-
619
- /**
620
- * Add a new interceptor to the stack
621
- *
622
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
623
- * @param {Function} rejected The function to handle `reject` for a `Promise`
624
- *
625
- * @return {Number} An ID used to remove interceptor later
626
- */
627
- InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
628
- this.handlers.push({
629
- fulfilled: fulfilled,
630
- rejected: rejected,
631
- synchronous: options ? options.synchronous : false,
632
- runWhen: options ? options.runWhen : null
633
- });
634
- return this.handlers.length - 1;
635
- };
636
-
637
- /**
638
- * Remove an interceptor from the stack
639
- *
640
- * @param {Number} id The ID that was returned by `use`
641
- */
642
- InterceptorManager.prototype.eject = function eject(id) {
643
- if (this.handlers[id]) {
644
- this.handlers[id] = null;
645
- }
646
- };
647
-
648
- /**
649
- * Iterate over all the registered interceptors
650
- *
651
- * This method is particularly useful for skipping over any
652
- * interceptors that may have become `null` calling `eject`.
653
- *
654
- * @param {Function} fn The function to call for each interceptor
655
- */
656
- InterceptorManager.prototype.forEach = function forEach(fn) {
657
- utils.forEach(this.handlers, function forEachHandler(h) {
658
- if (h !== null) {
659
- fn(h);
660
- }
661
- });
662
- };
663
-
664
- var InterceptorManager_1 = InterceptorManager;
665
-
666
- var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
667
- utils.forEach(headers, function processHeader(value, name) {
668
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
669
- headers[normalizedName] = value;
670
- delete headers[name];
671
- }
672
- });
673
- };
674
-
675
- /**
676
- * Create an Error with the specified message, config, error code, request and response.
677
- *
678
- * @param {string} message The error message.
679
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
680
- * @param {Object} [config] The config.
681
- * @param {Object} [request] The request.
682
- * @param {Object} [response] The response.
683
- * @returns {Error} The created error.
684
- */
685
- function AxiosError(message, code, config, request, response) {
686
- Error.call(this);
687
- this.message = message;
688
- this.name = 'AxiosError';
689
- code && (this.code = code);
690
- config && (this.config = config);
691
- request && (this.request = request);
692
- response && (this.response = response);
693
- }
694
-
695
- utils.inherits(AxiosError, Error, {
696
- toJSON: function toJSON() {
697
- return {
698
- // Standard
699
- message: this.message,
700
- name: this.name,
701
- // Microsoft
702
- description: this.description,
703
- number: this.number,
704
- // Mozilla
705
- fileName: this.fileName,
706
- lineNumber: this.lineNumber,
707
- columnNumber: this.columnNumber,
708
- stack: this.stack,
709
- // Axios
710
- config: this.config,
711
- code: this.code,
712
- status: this.response && this.response.status ? this.response.status : null
713
- };
714
- }
715
- });
716
-
717
- var prototype = AxiosError.prototype;
718
- var descriptors = {};
719
-
720
- [
721
- 'ERR_BAD_OPTION_VALUE',
722
- 'ERR_BAD_OPTION',
723
- 'ECONNABORTED',
724
- 'ETIMEDOUT',
725
- 'ERR_NETWORK',
726
- 'ERR_FR_TOO_MANY_REDIRECTS',
727
- 'ERR_DEPRECATED',
728
- 'ERR_BAD_RESPONSE',
729
- 'ERR_BAD_REQUEST',
730
- 'ERR_CANCELED'
731
- // eslint-disable-next-line func-names
732
- ].forEach(function(code) {
733
- descriptors[code] = {value: code};
734
- });
735
-
736
- Object.defineProperties(AxiosError, descriptors);
737
- Object.defineProperty(prototype, 'isAxiosError', {value: true});
738
-
739
- // eslint-disable-next-line func-names
740
- AxiosError.from = function(error, code, config, request, response, customProps) {
741
- var axiosError = Object.create(prototype);
742
-
743
- utils.toFlatObject(error, axiosError, function filter(obj) {
744
- return obj !== Error.prototype;
745
- });
746
-
747
- AxiosError.call(axiosError, error.message, code, config, request, response);
748
-
749
- axiosError.name = error.name;
750
-
751
- customProps && Object.assign(axiosError, customProps);
752
-
753
- return axiosError;
754
- };
755
-
756
- var AxiosError_1 = AxiosError;
757
-
758
- var transitional = {
759
- silentJSONParsing: true,
760
- forcedJSONParsing: true,
761
- clarifyTimeoutError: false
762
- };
763
-
764
- /**
765
- * Convert a data object to FormData
766
- * @param {Object} obj
767
- * @param {?Object} [formData]
768
- * @returns {Object}
769
- **/
770
-
771
- function toFormData(obj, formData) {
772
- // eslint-disable-next-line no-param-reassign
773
- formData = formData || new FormData();
774
-
775
- var stack = [];
776
-
777
- function convertValue(value) {
778
- if (value === null) return '';
779
-
780
- if (utils.isDate(value)) {
781
- return value.toISOString();
782
- }
783
-
784
- if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
785
- return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
786
- }
787
-
788
- return value;
789
- }
790
-
791
- function build(data, parentKey) {
792
- if (utils.isPlainObject(data) || utils.isArray(data)) {
793
- if (stack.indexOf(data) !== -1) {
794
- throw Error('Circular reference detected in ' + parentKey);
795
- }
796
-
797
- stack.push(data);
798
-
799
- utils.forEach(data, function each(value, key) {
800
- if (utils.isUndefined(value)) return;
801
- var fullKey = parentKey ? parentKey + '.' + key : key;
802
- var arr;
803
-
804
- if (value && !parentKey && typeof value === 'object') {
805
- if (utils.endsWith(key, '{}')) {
806
- // eslint-disable-next-line no-param-reassign
807
- value = JSON.stringify(value);
808
- } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
809
- // eslint-disable-next-line func-names
810
- arr.forEach(function(el) {
811
- !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
812
- });
813
- return;
814
- }
815
- }
816
-
817
- build(value, fullKey);
818
- });
819
-
820
- stack.pop();
821
- } else {
822
- formData.append(parentKey, convertValue(data));
823
- }
824
- }
825
-
826
- build(obj);
827
-
828
- return formData;
829
- }
830
-
831
- var toFormData_1 = toFormData;
832
-
833
- /**
834
- * Resolve or reject a Promise based on response status.
835
- *
836
- * @param {Function} resolve A function that resolves the promise.
837
- * @param {Function} reject A function that rejects the promise.
838
- * @param {object} response The response.
839
- */
840
- var settle = function settle(resolve, reject, response) {
841
- var validateStatus = response.config.validateStatus;
842
- if (!response.status || !validateStatus || validateStatus(response.status)) {
843
- resolve(response);
844
- } else {
845
- reject(new AxiosError_1(
846
- 'Request failed with status code ' + response.status,
847
- [AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
848
- response.config,
849
- response.request,
850
- response
851
- ));
852
- }
853
- };
854
-
855
- var cookies = (
856
- utils.isStandardBrowserEnv() ?
857
-
858
- // Standard browser envs support document.cookie
859
- (function standardBrowserEnv() {
860
- return {
861
- write: function write(name, value, expires, path, domain, secure) {
862
- var cookie = [];
863
- cookie.push(name + '=' + encodeURIComponent(value));
864
-
865
- if (utils.isNumber(expires)) {
866
- cookie.push('expires=' + new Date(expires).toGMTString());
867
- }
868
-
869
- if (utils.isString(path)) {
870
- cookie.push('path=' + path);
871
- }
872
-
873
- if (utils.isString(domain)) {
874
- cookie.push('domain=' + domain);
875
- }
876
-
877
- if (secure === true) {
878
- cookie.push('secure');
879
- }
880
-
881
- document.cookie = cookie.join('; ');
882
- },
883
-
884
- read: function read(name) {
885
- var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
886
- return (match ? decodeURIComponent(match[3]) : null);
887
- },
888
-
889
- remove: function remove(name) {
890
- this.write(name, '', Date.now() - 86400000);
891
- }
892
- };
893
- })() :
894
-
895
- // Non standard browser env (web workers, react-native) lack needed support.
896
- (function nonStandardBrowserEnv() {
897
- return {
898
- write: function write() {},
899
- read: function read() { return null; },
900
- remove: function remove() {}
901
- };
902
- })()
903
- );
904
-
905
- /**
906
- * Determines whether the specified URL is absolute
907
- *
908
- * @param {string} url The URL to test
909
- * @returns {boolean} True if the specified URL is absolute, otherwise false
910
- */
911
- var isAbsoluteURL = function isAbsoluteURL(url) {
912
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
913
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
914
- // by any combination of letters, digits, plus, period, or hyphen.
915
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
916
- };
917
-
918
- /**
919
- * Creates a new URL by combining the specified URLs
920
- *
921
- * @param {string} baseURL The base URL
922
- * @param {string} relativeURL The relative URL
923
- * @returns {string} The combined URL
924
- */
925
- var combineURLs = function combineURLs(baseURL, relativeURL) {
926
- return relativeURL
927
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
928
- : baseURL;
929
- };
930
-
931
- /**
932
- * Creates a new URL by combining the baseURL with the requestedURL,
933
- * only when the requestedURL is not already an absolute URL.
934
- * If the requestURL is absolute, this function returns the requestedURL untouched.
935
- *
936
- * @param {string} baseURL The base URL
937
- * @param {string} requestedURL Absolute or relative URL to combine
938
- * @returns {string} The combined full path
939
- */
940
- var buildFullPath = function buildFullPath(baseURL, requestedURL) {
941
- if (baseURL && !isAbsoluteURL(requestedURL)) {
942
- return combineURLs(baseURL, requestedURL);
943
- }
944
- return requestedURL;
945
- };
946
-
947
- // Headers whose duplicates are ignored by node
948
- // c.f. https://nodejs.org/api/http.html#http_message_headers
949
- var ignoreDuplicateOf = [
950
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
951
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
952
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
953
- 'referer', 'retry-after', 'user-agent'
954
- ];
955
-
956
- /**
957
- * Parse headers into an object
958
- *
959
- * ```
960
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
961
- * Content-Type: application/json
962
- * Connection: keep-alive
963
- * Transfer-Encoding: chunked
964
- * ```
965
- *
966
- * @param {String} headers Headers needing to be parsed
967
- * @returns {Object} Headers parsed into an object
968
- */
969
- var parseHeaders = function parseHeaders(headers) {
970
- var parsed = {};
971
- var key;
972
- var val;
973
- var i;
974
-
975
- if (!headers) { return parsed; }
976
-
977
- utils.forEach(headers.split('\n'), function parser(line) {
978
- i = line.indexOf(':');
979
- key = utils.trim(line.substr(0, i)).toLowerCase();
980
- val = utils.trim(line.substr(i + 1));
981
-
982
- if (key) {
983
- if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
984
- return;
985
- }
986
- if (key === 'set-cookie') {
987
- parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
988
- } else {
989
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
990
- }
991
- }
992
- });
993
-
994
- return parsed;
995
- };
996
-
997
- var isURLSameOrigin = (
998
- utils.isStandardBrowserEnv() ?
999
-
1000
- // Standard browser envs have full support of the APIs needed to test
1001
- // whether the request URL is of the same origin as current location.
1002
- (function standardBrowserEnv() {
1003
- var msie = /(msie|trident)/i.test(navigator.userAgent);
1004
- var urlParsingNode = document.createElement('a');
1005
- var originURL;
1006
-
1007
- /**
1008
- * Parse a URL to discover it's components
1009
- *
1010
- * @param {String} url The URL to be parsed
1011
- * @returns {Object}
1012
- */
1013
- function resolveURL(url) {
1014
- var href = url;
1015
-
1016
- if (msie) {
1017
- // IE needs attribute set twice to normalize properties
1018
- urlParsingNode.setAttribute('href', href);
1019
- href = urlParsingNode.href;
1020
- }
1021
-
1022
- urlParsingNode.setAttribute('href', href);
1023
-
1024
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
1025
- return {
1026
- href: urlParsingNode.href,
1027
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
1028
- host: urlParsingNode.host,
1029
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
1030
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
1031
- hostname: urlParsingNode.hostname,
1032
- port: urlParsingNode.port,
1033
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
1034
- urlParsingNode.pathname :
1035
- '/' + urlParsingNode.pathname
1036
- };
1037
- }
1038
-
1039
- originURL = resolveURL(window.location.href);
1040
-
1041
- /**
1042
- * Determine if a URL shares the same origin as the current location
1043
- *
1044
- * @param {String} requestURL The URL to test
1045
- * @returns {boolean} True if URL shares the same origin, otherwise false
1046
- */
1047
- return function isURLSameOrigin(requestURL) {
1048
- var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
1049
- return (parsed.protocol === originURL.protocol &&
1050
- parsed.host === originURL.host);
1051
- };
1052
- })() :
1053
-
1054
- // Non standard browser envs (web workers, react-native) lack needed support.
1055
- (function nonStandardBrowserEnv() {
1056
- return function isURLSameOrigin() {
1057
- return true;
1058
- };
1059
- })()
1060
- );
1061
-
1062
- /**
1063
- * A `CanceledError` is an object that is thrown when an operation is canceled.
1064
- *
1065
- * @class
1066
- * @param {string=} message The message.
1067
- */
1068
- function CanceledError(message) {
1069
- // eslint-disable-next-line no-eq-null,eqeqeq
1070
- AxiosError_1.call(this, message == null ? 'canceled' : message, AxiosError_1.ERR_CANCELED);
1071
- this.name = 'CanceledError';
1072
- }
1073
-
1074
- utils.inherits(CanceledError, AxiosError_1, {
1075
- __CANCEL__: true
1076
- });
1077
-
1078
- var CanceledError_1 = CanceledError;
1079
-
1080
- var parseProtocol = function parseProtocol(url) {
1081
- var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1082
- return match && match[1] || '';
1083
- };
1084
-
1085
- var xhr = function xhrAdapter(config) {
1086
- return new Promise(function dispatchXhrRequest(resolve, reject) {
1087
- var requestData = config.data;
1088
- var requestHeaders = config.headers;
1089
- var responseType = config.responseType;
1090
- var onCanceled;
1091
- function done() {
1092
- if (config.cancelToken) {
1093
- config.cancelToken.unsubscribe(onCanceled);
1094
- }
1095
-
1096
- if (config.signal) {
1097
- config.signal.removeEventListener('abort', onCanceled);
1098
- }
1099
- }
1100
-
1101
- if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
1102
- delete requestHeaders['Content-Type']; // Let the browser set it
1103
- }
1104
-
1105
- var request = new XMLHttpRequest();
1106
-
1107
- // HTTP basic authentication
1108
- if (config.auth) {
1109
- var username = config.auth.username || '';
1110
- var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
1111
- requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
1112
- }
1113
-
1114
- var fullPath = buildFullPath(config.baseURL, config.url);
1115
-
1116
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
1117
-
1118
- // Set the request timeout in MS
1119
- request.timeout = config.timeout;
1120
-
1121
- function onloadend() {
1122
- if (!request) {
1123
- return;
1124
- }
1125
- // Prepare the response
1126
- var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
1127
- var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
1128
- request.responseText : request.response;
1129
- var response = {
1130
- data: responseData,
1131
- status: request.status,
1132
- statusText: request.statusText,
1133
- headers: responseHeaders,
1134
- config: config,
1135
- request: request
1136
- };
1137
-
1138
- settle(function _resolve(value) {
1139
- resolve(value);
1140
- done();
1141
- }, function _reject(err) {
1142
- reject(err);
1143
- done();
1144
- }, response);
1145
-
1146
- // Clean up request
1147
- request = null;
1148
- }
1149
-
1150
- if ('onloadend' in request) {
1151
- // Use onloadend if available
1152
- request.onloadend = onloadend;
1153
- } else {
1154
- // Listen for ready state to emulate onloadend
1155
- request.onreadystatechange = function handleLoad() {
1156
- if (!request || request.readyState !== 4) {
1157
- return;
1158
- }
1159
-
1160
- // The request errored out and we didn't get a response, this will be
1161
- // handled by onerror instead
1162
- // With one exception: request that using file: protocol, most browsers
1163
- // will return status as 0 even though it's a successful request
1164
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
1165
- return;
1166
- }
1167
- // readystate handler is calling before onerror or ontimeout handlers,
1168
- // so we should call onloadend on the next 'tick'
1169
- setTimeout(onloadend);
1170
- };
1171
- }
1172
-
1173
- // Handle browser request cancellation (as opposed to a manual cancellation)
1174
- request.onabort = function handleAbort() {
1175
- if (!request) {
1176
- return;
1177
- }
1178
-
1179
- reject(new AxiosError_1('Request aborted', AxiosError_1.ECONNABORTED, config, request));
1180
-
1181
- // Clean up request
1182
- request = null;
1183
- };
1184
-
1185
- // Handle low level network errors
1186
- request.onerror = function handleError() {
1187
- // Real errors are hidden from us by the browser
1188
- // onerror should only fire if it's a network error
1189
- reject(new AxiosError_1('Network Error', AxiosError_1.ERR_NETWORK, config, request, request));
1190
-
1191
- // Clean up request
1192
- request = null;
1193
- };
1194
-
1195
- // Handle timeout
1196
- request.ontimeout = function handleTimeout() {
1197
- var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
1198
- var transitional$1 = config.transitional || transitional;
1199
- if (config.timeoutErrorMessage) {
1200
- timeoutErrorMessage = config.timeoutErrorMessage;
1201
- }
1202
- reject(new AxiosError_1(
1203
- timeoutErrorMessage,
1204
- transitional$1.clarifyTimeoutError ? AxiosError_1.ETIMEDOUT : AxiosError_1.ECONNABORTED,
1205
- config,
1206
- request));
1207
-
1208
- // Clean up request
1209
- request = null;
1210
- };
1211
-
1212
- // Add xsrf header
1213
- // This is only done if running in a standard browser environment.
1214
- // Specifically not if we're in a web worker, or react-native.
1215
- if (utils.isStandardBrowserEnv()) {
1216
- // Add xsrf header
1217
- var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
1218
- cookies.read(config.xsrfCookieName) :
1219
- undefined;
1220
-
1221
- if (xsrfValue) {
1222
- requestHeaders[config.xsrfHeaderName] = xsrfValue;
1223
- }
1224
- }
1225
-
1226
- // Add headers to the request
1227
- if ('setRequestHeader' in request) {
1228
- utils.forEach(requestHeaders, function setRequestHeader(val, key) {
1229
- if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
1230
- // Remove Content-Type if data is undefined
1231
- delete requestHeaders[key];
1232
- } else {
1233
- // Otherwise add header to the request
1234
- request.setRequestHeader(key, val);
1235
- }
1236
- });
1237
- }
1238
-
1239
- // Add withCredentials to request if needed
1240
- if (!utils.isUndefined(config.withCredentials)) {
1241
- request.withCredentials = !!config.withCredentials;
1242
- }
1243
-
1244
- // Add responseType to request if needed
1245
- if (responseType && responseType !== 'json') {
1246
- request.responseType = config.responseType;
1247
- }
1248
-
1249
- // Handle progress if needed
1250
- if (typeof config.onDownloadProgress === 'function') {
1251
- request.addEventListener('progress', config.onDownloadProgress);
1252
- }
1253
-
1254
- // Not all browsers support upload events
1255
- if (typeof config.onUploadProgress === 'function' && request.upload) {
1256
- request.upload.addEventListener('progress', config.onUploadProgress);
1257
- }
1258
-
1259
- if (config.cancelToken || config.signal) {
1260
- // Handle cancellation
1261
- // eslint-disable-next-line func-names
1262
- onCanceled = function(cancel) {
1263
- if (!request) {
1264
- return;
1265
- }
1266
- reject(!cancel || (cancel && cancel.type) ? new CanceledError_1() : cancel);
1267
- request.abort();
1268
- request = null;
1269
- };
1270
-
1271
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
1272
- if (config.signal) {
1273
- config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
1274
- }
1275
- }
1276
-
1277
- if (!requestData) {
1278
- requestData = null;
1279
- }
1280
-
1281
- var protocol = parseProtocol(fullPath);
1282
-
1283
- if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
1284
- reject(new AxiosError_1('Unsupported protocol ' + protocol + ':', AxiosError_1.ERR_BAD_REQUEST, config));
1285
- return;
1286
- }
1287
-
1288
-
1289
- // Send the request
1290
- request.send(requestData);
1291
- });
1292
- };
1293
-
1294
- // eslint-disable-next-line strict
1295
- var _null = null;
1296
-
1297
- var DEFAULT_CONTENT_TYPE = {
1298
- 'Content-Type': 'application/x-www-form-urlencoded'
1299
- };
1300
-
1301
- function setContentTypeIfUnset(headers, value) {
1302
- if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
1303
- headers['Content-Type'] = value;
1304
- }
1305
- }
1306
-
1307
- function getDefaultAdapter() {
1308
- var adapter;
1309
- if (typeof XMLHttpRequest !== 'undefined') {
1310
- // For browsers use XHR adapter
1311
- adapter = xhr;
1312
- } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
1313
- // For node use HTTP adapter
1314
- adapter = xhr;
1315
- }
1316
- return adapter;
1317
- }
1318
-
1319
- function stringifySafely(rawValue, parser, encoder) {
1320
- if (utils.isString(rawValue)) {
1321
- try {
1322
- (parser || JSON.parse)(rawValue);
1323
- return utils.trim(rawValue);
1324
- } catch (e) {
1325
- if (e.name !== 'SyntaxError') {
1326
- throw e;
1327
- }
1328
- }
1329
- }
1330
-
1331
- return (encoder || JSON.stringify)(rawValue);
1332
- }
1333
-
1334
- var defaults = {
1335
-
1336
- transitional: transitional,
1337
-
1338
- adapter: getDefaultAdapter(),
1339
-
1340
- transformRequest: [function transformRequest(data, headers) {
1341
- normalizeHeaderName(headers, 'Accept');
1342
- normalizeHeaderName(headers, 'Content-Type');
1343
-
1344
- if (utils.isFormData(data) ||
1345
- utils.isArrayBuffer(data) ||
1346
- utils.isBuffer(data) ||
1347
- utils.isStream(data) ||
1348
- utils.isFile(data) ||
1349
- utils.isBlob(data)
1350
- ) {
1351
- return data;
1352
- }
1353
- if (utils.isArrayBufferView(data)) {
1354
- return data.buffer;
1355
- }
1356
- if (utils.isURLSearchParams(data)) {
1357
- setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
1358
- return data.toString();
1359
- }
1360
-
1361
- var isObjectPayload = utils.isObject(data);
1362
- var contentType = headers && headers['Content-Type'];
1363
-
1364
- var isFileList;
1365
-
1366
- if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
1367
- var _FormData = this.env && this.env.FormData;
1368
- return toFormData_1(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
1369
- } else if (isObjectPayload || contentType === 'application/json') {
1370
- setContentTypeIfUnset(headers, 'application/json');
1371
- return stringifySafely(data);
1372
- }
1373
-
1374
- return data;
1375
- }],
1376
-
1377
- transformResponse: [function transformResponse(data) {
1378
- var transitional = this.transitional || defaults.transitional;
1379
- var silentJSONParsing = transitional && transitional.silentJSONParsing;
1380
- var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
1381
- var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
1382
-
1383
- if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
1384
- try {
1385
- return JSON.parse(data);
1386
- } catch (e) {
1387
- if (strictJSONParsing) {
1388
- if (e.name === 'SyntaxError') {
1389
- throw AxiosError_1.from(e, AxiosError_1.ERR_BAD_RESPONSE, this, null, this.response);
1390
- }
1391
- throw e;
1392
- }
1393
- }
1394
- }
1395
-
1396
- return data;
1397
- }],
1398
-
1399
- /**
1400
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1401
- * timeout is not created.
1402
- */
1403
- timeout: 0,
1404
-
1405
- xsrfCookieName: 'XSRF-TOKEN',
1406
- xsrfHeaderName: 'X-XSRF-TOKEN',
1407
-
1408
- maxContentLength: -1,
1409
- maxBodyLength: -1,
1410
-
1411
- env: {
1412
- FormData: _null
1413
- },
1414
-
1415
- validateStatus: function validateStatus(status) {
1416
- return status >= 200 && status < 300;
1417
- },
1418
-
1419
- headers: {
1420
- common: {
1421
- 'Accept': 'application/json, text/plain, */*'
1422
- }
1423
- }
1424
- };
1425
-
1426
- utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
1427
- defaults.headers[method] = {};
1428
- });
1429
-
1430
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1431
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
1432
- });
1433
-
1434
- var defaults_1 = defaults;
1435
-
1436
- /**
1437
- * Transform the data for a request or a response
1438
- *
1439
- * @param {Object|String} data The data to be transformed
1440
- * @param {Array} headers The headers for the request or response
1441
- * @param {Array|Function} fns A single function or Array of functions
1442
- * @returns {*} The resulting transformed data
1443
- */
1444
- var transformData = function transformData(data, headers, fns) {
1445
- var context = this || defaults_1;
1446
- /*eslint no-param-reassign:0*/
1447
- utils.forEach(fns, function transform(fn) {
1448
- data = fn.call(context, data, headers);
1449
- });
1450
-
1451
- return data;
1452
- };
1453
-
1454
- var isCancel = function isCancel(value) {
1455
- return !!(value && value.__CANCEL__);
1456
- };
1457
-
1458
- /**
1459
- * Throws a `CanceledError` if cancellation has been requested.
1460
- */
1461
- function throwIfCancellationRequested(config) {
1462
- if (config.cancelToken) {
1463
- config.cancelToken.throwIfRequested();
1464
- }
1465
-
1466
- if (config.signal && config.signal.aborted) {
1467
- throw new CanceledError_1();
1468
- }
1469
- }
1470
-
1471
- /**
1472
- * Dispatch a request to the server using the configured adapter.
1473
- *
1474
- * @param {object} config The config that is to be used for the request
1475
- * @returns {Promise} The Promise to be fulfilled
1476
- */
1477
- var dispatchRequest = function dispatchRequest(config) {
1478
- throwIfCancellationRequested(config);
1479
-
1480
- // Ensure headers exist
1481
- config.headers = config.headers || {};
1482
-
1483
- // Transform request data
1484
- config.data = transformData.call(
1485
- config,
1486
- config.data,
1487
- config.headers,
1488
- config.transformRequest
1489
- );
1490
-
1491
- // Flatten headers
1492
- config.headers = utils.merge(
1493
- config.headers.common || {},
1494
- config.headers[config.method] || {},
1495
- config.headers
1496
- );
1497
-
1498
- utils.forEach(
1499
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
1500
- function cleanHeaderConfig(method) {
1501
- delete config.headers[method];
1502
- }
1503
- );
1504
-
1505
- var adapter = config.adapter || defaults_1.adapter;
1506
-
1507
- return adapter(config).then(function onAdapterResolution(response) {
1508
- throwIfCancellationRequested(config);
1509
-
1510
- // Transform response data
1511
- response.data = transformData.call(
1512
- config,
1513
- response.data,
1514
- response.headers,
1515
- config.transformResponse
1516
- );
1517
-
1518
- return response;
1519
- }, function onAdapterRejection(reason) {
1520
- if (!isCancel(reason)) {
1521
- throwIfCancellationRequested(config);
1522
-
1523
- // Transform response data
1524
- if (reason && reason.response) {
1525
- reason.response.data = transformData.call(
1526
- config,
1527
- reason.response.data,
1528
- reason.response.headers,
1529
- config.transformResponse
1530
- );
1531
- }
1532
- }
1533
-
1534
- return Promise.reject(reason);
1535
- });
1536
- };
1537
-
1538
- /**
1539
- * Config-specific merge-function which creates a new config-object
1540
- * by merging two configuration objects together.
1541
- *
1542
- * @param {Object} config1
1543
- * @param {Object} config2
1544
- * @returns {Object} New object resulting from merging config2 to config1
1545
- */
1546
- var mergeConfig = function mergeConfig(config1, config2) {
1547
- // eslint-disable-next-line no-param-reassign
1548
- config2 = config2 || {};
1549
- var config = {};
1550
-
1551
- function getMergedValue(target, source) {
1552
- if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
1553
- return utils.merge(target, source);
1554
- } else if (utils.isPlainObject(source)) {
1555
- return utils.merge({}, source);
1556
- } else if (utils.isArray(source)) {
1557
- return source.slice();
1558
- }
1559
- return source;
1560
- }
1561
-
1562
- // eslint-disable-next-line consistent-return
1563
- function mergeDeepProperties(prop) {
1564
- if (!utils.isUndefined(config2[prop])) {
1565
- return getMergedValue(config1[prop], config2[prop]);
1566
- } else if (!utils.isUndefined(config1[prop])) {
1567
- return getMergedValue(undefined, config1[prop]);
1568
- }
1569
- }
1570
-
1571
- // eslint-disable-next-line consistent-return
1572
- function valueFromConfig2(prop) {
1573
- if (!utils.isUndefined(config2[prop])) {
1574
- return getMergedValue(undefined, config2[prop]);
1575
- }
1576
- }
1577
-
1578
- // eslint-disable-next-line consistent-return
1579
- function defaultToConfig2(prop) {
1580
- if (!utils.isUndefined(config2[prop])) {
1581
- return getMergedValue(undefined, config2[prop]);
1582
- } else if (!utils.isUndefined(config1[prop])) {
1583
- return getMergedValue(undefined, config1[prop]);
1584
- }
1585
- }
1586
-
1587
- // eslint-disable-next-line consistent-return
1588
- function mergeDirectKeys(prop) {
1589
- if (prop in config2) {
1590
- return getMergedValue(config1[prop], config2[prop]);
1591
- } else if (prop in config1) {
1592
- return getMergedValue(undefined, config1[prop]);
1593
- }
1594
- }
1595
-
1596
- var mergeMap = {
1597
- 'url': valueFromConfig2,
1598
- 'method': valueFromConfig2,
1599
- 'data': valueFromConfig2,
1600
- 'baseURL': defaultToConfig2,
1601
- 'transformRequest': defaultToConfig2,
1602
- 'transformResponse': defaultToConfig2,
1603
- 'paramsSerializer': defaultToConfig2,
1604
- 'timeout': defaultToConfig2,
1605
- 'timeoutMessage': defaultToConfig2,
1606
- 'withCredentials': defaultToConfig2,
1607
- 'adapter': defaultToConfig2,
1608
- 'responseType': defaultToConfig2,
1609
- 'xsrfCookieName': defaultToConfig2,
1610
- 'xsrfHeaderName': defaultToConfig2,
1611
- 'onUploadProgress': defaultToConfig2,
1612
- 'onDownloadProgress': defaultToConfig2,
1613
- 'decompress': defaultToConfig2,
1614
- 'maxContentLength': defaultToConfig2,
1615
- 'maxBodyLength': defaultToConfig2,
1616
- 'beforeRedirect': defaultToConfig2,
1617
- 'transport': defaultToConfig2,
1618
- 'httpAgent': defaultToConfig2,
1619
- 'httpsAgent': defaultToConfig2,
1620
- 'cancelToken': defaultToConfig2,
1621
- 'socketPath': defaultToConfig2,
1622
- 'responseEncoding': defaultToConfig2,
1623
- 'validateStatus': mergeDirectKeys
1624
- };
1625
-
1626
- utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
1627
- var merge = mergeMap[prop] || mergeDeepProperties;
1628
- var configValue = merge(prop);
1629
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
1630
- });
1631
-
1632
- return config;
1633
- };
1634
-
1635
- var data = {
1636
- "version": "0.27.2"
1637
- };
1638
-
1639
- var VERSION = data.version;
1640
-
1641
-
1642
- var validators$1 = {};
1643
-
1644
- // eslint-disable-next-line func-names
1645
- ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
1646
- validators$1[type] = function validator(thing) {
1647
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
1648
- };
1649
- });
1650
-
1651
- var deprecatedWarnings = {};
1652
-
1653
- /**
1654
- * Transitional option validator
1655
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
1656
- * @param {string?} version - deprecated version / removed since version
1657
- * @param {string?} message - some message with additional info
1658
- * @returns {function}
1659
- */
1660
- validators$1.transitional = function transitional(validator, version, message) {
1661
- function formatMessage(opt, desc) {
1662
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
1663
- }
1664
-
1665
- // eslint-disable-next-line func-names
1666
- return function(value, opt, opts) {
1667
- if (validator === false) {
1668
- throw new AxiosError_1(
1669
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
1670
- AxiosError_1.ERR_DEPRECATED
1671
- );
1672
- }
1673
-
1674
- if (version && !deprecatedWarnings[opt]) {
1675
- deprecatedWarnings[opt] = true;
1676
- // eslint-disable-next-line no-console
1677
- console.warn(
1678
- formatMessage(
1679
- opt,
1680
- ' has been deprecated since v' + version + ' and will be removed in the near future'
1681
- )
1682
- );
1683
- }
1684
-
1685
- return validator ? validator(value, opt, opts) : true;
1686
- };
1687
- };
1688
-
1689
- /**
1690
- * Assert object's properties type
1691
- * @param {object} options
1692
- * @param {object} schema
1693
- * @param {boolean?} allowUnknown
1694
- */
1695
-
1696
- function assertOptions(options, schema, allowUnknown) {
1697
- if (typeof options !== 'object') {
1698
- throw new AxiosError_1('options must be an object', AxiosError_1.ERR_BAD_OPTION_VALUE);
1699
- }
1700
- var keys = Object.keys(options);
1701
- var i = keys.length;
1702
- while (i-- > 0) {
1703
- var opt = keys[i];
1704
- var validator = schema[opt];
1705
- if (validator) {
1706
- var value = options[opt];
1707
- var result = value === undefined || validator(value, opt, options);
1708
- if (result !== true) {
1709
- throw new AxiosError_1('option ' + opt + ' must be ' + result, AxiosError_1.ERR_BAD_OPTION_VALUE);
1710
- }
1711
- continue;
1712
- }
1713
- if (allowUnknown !== true) {
1714
- throw new AxiosError_1('Unknown option ' + opt, AxiosError_1.ERR_BAD_OPTION);
1715
- }
1716
- }
1717
- }
1718
-
1719
- var validator = {
1720
- assertOptions: assertOptions,
1721
- validators: validators$1
1722
- };
1723
-
1724
- var validators = validator.validators;
1725
- /**
1726
- * Create a new instance of Axios
1727
- *
1728
- * @param {Object} instanceConfig The default config for the instance
1729
- */
1730
- function Axios(instanceConfig) {
1731
- this.defaults = instanceConfig;
1732
- this.interceptors = {
1733
- request: new InterceptorManager_1(),
1734
- response: new InterceptorManager_1()
1735
- };
1736
- }
1737
-
1738
- /**
1739
- * Dispatch a request
1740
- *
1741
- * @param {Object} config The config specific for this request (merged with this.defaults)
1742
- */
1743
- Axios.prototype.request = function request(configOrUrl, config) {
1744
- /*eslint no-param-reassign:0*/
1745
- // Allow for axios('example/url'[, config]) a la fetch API
1746
- if (typeof configOrUrl === 'string') {
1747
- config = config || {};
1748
- config.url = configOrUrl;
1749
- } else {
1750
- config = configOrUrl || {};
1751
- }
1752
-
1753
- config = mergeConfig(this.defaults, config);
1754
-
1755
- // Set config.method
1756
- if (config.method) {
1757
- config.method = config.method.toLowerCase();
1758
- } else if (this.defaults.method) {
1759
- config.method = this.defaults.method.toLowerCase();
1760
- } else {
1761
- config.method = 'get';
1762
- }
1763
-
1764
- var transitional = config.transitional;
1765
-
1766
- if (transitional !== undefined) {
1767
- validator.assertOptions(transitional, {
1768
- silentJSONParsing: validators.transitional(validators.boolean),
1769
- forcedJSONParsing: validators.transitional(validators.boolean),
1770
- clarifyTimeoutError: validators.transitional(validators.boolean)
1771
- }, false);
1772
- }
1773
-
1774
- // filter out skipped interceptors
1775
- var requestInterceptorChain = [];
1776
- var synchronousRequestInterceptors = true;
1777
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1778
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
1779
- return;
1780
- }
1781
-
1782
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1783
-
1784
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1785
- });
1786
-
1787
- var responseInterceptorChain = [];
1788
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1789
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1790
- });
1791
-
1792
- var promise;
1793
-
1794
- if (!synchronousRequestInterceptors) {
1795
- var chain = [dispatchRequest, undefined];
1796
-
1797
- Array.prototype.unshift.apply(chain, requestInterceptorChain);
1798
- chain = chain.concat(responseInterceptorChain);
1799
-
1800
- promise = Promise.resolve(config);
1801
- while (chain.length) {
1802
- promise = promise.then(chain.shift(), chain.shift());
1803
- }
1804
-
1805
- return promise;
1806
- }
1807
-
1808
-
1809
- var newConfig = config;
1810
- while (requestInterceptorChain.length) {
1811
- var onFulfilled = requestInterceptorChain.shift();
1812
- var onRejected = requestInterceptorChain.shift();
1813
- try {
1814
- newConfig = onFulfilled(newConfig);
1815
- } catch (error) {
1816
- onRejected(error);
1817
- break;
1818
- }
1819
- }
1820
-
1821
- try {
1822
- promise = dispatchRequest(newConfig);
1823
- } catch (error) {
1824
- return Promise.reject(error);
1825
- }
1826
-
1827
- while (responseInterceptorChain.length) {
1828
- promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
1829
- }
1830
-
1831
- return promise;
1832
- };
1833
-
1834
- Axios.prototype.getUri = function getUri(config) {
1835
- config = mergeConfig(this.defaults, config);
1836
- var fullPath = buildFullPath(config.baseURL, config.url);
1837
- return buildURL(fullPath, config.params, config.paramsSerializer);
1838
- };
1839
-
1840
- // Provide aliases for supported request methods
1841
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
1842
- /*eslint func-names:0*/
1843
- Axios.prototype[method] = function(url, config) {
1844
- return this.request(mergeConfig(config || {}, {
1845
- method: method,
1846
- url: url,
1847
- data: (config || {}).data
1848
- }));
1849
- };
1850
- });
1851
-
1852
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1853
- /*eslint func-names:0*/
1854
-
1855
- function generateHTTPMethod(isForm) {
1856
- return function httpMethod(url, data, config) {
1857
- return this.request(mergeConfig(config || {}, {
1858
- method: method,
1859
- headers: isForm ? {
1860
- 'Content-Type': 'multipart/form-data'
1861
- } : {},
1862
- url: url,
1863
- data: data
1864
- }));
1865
- };
1866
- }
1867
-
1868
- Axios.prototype[method] = generateHTTPMethod();
1869
-
1870
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
1871
- });
1872
-
1873
- var Axios_1 = Axios;
1874
-
1875
- /**
1876
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
1877
- *
1878
- * @class
1879
- * @param {Function} executor The executor function.
1880
- */
1881
- function CancelToken(executor) {
1882
- if (typeof executor !== 'function') {
1883
- throw new TypeError('executor must be a function.');
1884
- }
1885
-
1886
- var resolvePromise;
1887
-
1888
- this.promise = new Promise(function promiseExecutor(resolve) {
1889
- resolvePromise = resolve;
1890
- });
1891
-
1892
- var token = this;
1893
-
1894
- // eslint-disable-next-line func-names
1895
- this.promise.then(function(cancel) {
1896
- if (!token._listeners) return;
1897
-
1898
- var i;
1899
- var l = token._listeners.length;
1900
-
1901
- for (i = 0; i < l; i++) {
1902
- token._listeners[i](cancel);
1903
- }
1904
- token._listeners = null;
1905
- });
1906
-
1907
- // eslint-disable-next-line func-names
1908
- this.promise.then = function(onfulfilled) {
1909
- var _resolve;
1910
- // eslint-disable-next-line func-names
1911
- var promise = new Promise(function(resolve) {
1912
- token.subscribe(resolve);
1913
- _resolve = resolve;
1914
- }).then(onfulfilled);
1915
-
1916
- promise.cancel = function reject() {
1917
- token.unsubscribe(_resolve);
1918
- };
1919
-
1920
- return promise;
1921
- };
1922
-
1923
- executor(function cancel(message) {
1924
- if (token.reason) {
1925
- // Cancellation has already been requested
1926
- return;
1927
- }
1928
-
1929
- token.reason = new CanceledError_1(message);
1930
- resolvePromise(token.reason);
1931
- });
1932
- }
1933
-
1934
- /**
1935
- * Throws a `CanceledError` if cancellation has been requested.
1936
- */
1937
- CancelToken.prototype.throwIfRequested = function throwIfRequested() {
1938
- if (this.reason) {
1939
- throw this.reason;
1940
- }
1941
- };
1942
-
1943
- /**
1944
- * Subscribe to the cancel signal
1945
- */
1946
-
1947
- CancelToken.prototype.subscribe = function subscribe(listener) {
1948
- if (this.reason) {
1949
- listener(this.reason);
1950
- return;
1951
- }
1952
-
1953
- if (this._listeners) {
1954
- this._listeners.push(listener);
1955
- } else {
1956
- this._listeners = [listener];
1957
- }
1958
- };
1959
-
1960
- /**
1961
- * Unsubscribe from the cancel signal
1962
- */
1963
-
1964
- CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
1965
- if (!this._listeners) {
1966
- return;
1967
- }
1968
- var index = this._listeners.indexOf(listener);
1969
- if (index !== -1) {
1970
- this._listeners.splice(index, 1);
1971
- }
1972
- };
1973
-
1974
- /**
1975
- * Returns an object that contains a new `CancelToken` and a function that, when called,
1976
- * cancels the `CancelToken`.
1977
- */
1978
- CancelToken.source = function source() {
1979
- var cancel;
1980
- var token = new CancelToken(function executor(c) {
1981
- cancel = c;
1982
- });
1983
- return {
1984
- token: token,
1985
- cancel: cancel
1986
- };
1987
- };
1988
-
1989
- var CancelToken_1 = CancelToken;
1990
-
1991
- /**
1992
- * Syntactic sugar for invoking a function and expanding an array for arguments.
1993
- *
1994
- * Common use case would be to use `Function.prototype.apply`.
1995
- *
1996
- * ```js
1997
- * function f(x, y, z) {}
1998
- * var args = [1, 2, 3];
1999
- * f.apply(null, args);
2000
- * ```
2001
- *
2002
- * With `spread` this example can be re-written.
2003
- *
2004
- * ```js
2005
- * spread(function(x, y, z) {})([1, 2, 3]);
2006
- * ```
2007
- *
2008
- * @param {Function} callback
2009
- * @returns {Function}
2010
- */
2011
- var spread = function spread(callback) {
2012
- return function wrap(arr) {
2013
- return callback.apply(null, arr);
2014
- };
2015
- };
2016
-
2017
- /**
2018
- * Determines whether the payload is an error thrown by Axios
2019
- *
2020
- * @param {*} payload The value to test
2021
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
2022
- */
2023
- var isAxiosError = function isAxiosError(payload) {
2024
- return utils.isObject(payload) && (payload.isAxiosError === true);
2025
- };
2026
-
2027
- /**
2028
- * Create an instance of Axios
2029
- *
2030
- * @param {Object} defaultConfig The default config for the instance
2031
- * @return {Axios} A new instance of Axios
2032
- */
2033
- function createInstance(defaultConfig) {
2034
- var context = new Axios_1(defaultConfig);
2035
- var instance = bind(Axios_1.prototype.request, context);
2036
-
2037
- // Copy axios.prototype to instance
2038
- utils.extend(instance, Axios_1.prototype, context);
2039
-
2040
- // Copy context to instance
2041
- utils.extend(instance, context);
2042
-
2043
- // Factory for creating new instances
2044
- instance.create = function create(instanceConfig) {
2045
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
2046
- };
2047
-
2048
- return instance;
2049
- }
2050
-
2051
- // Create the default instance to be exported
2052
- var axios$1 = createInstance(defaults_1);
2053
-
2054
- // Expose Axios class to allow class inheritance
2055
- axios$1.Axios = Axios_1;
2056
-
2057
- // Expose Cancel & CancelToken
2058
- axios$1.CanceledError = CanceledError_1;
2059
- axios$1.CancelToken = CancelToken_1;
2060
- axios$1.isCancel = isCancel;
2061
- axios$1.VERSION = data.version;
2062
- axios$1.toFormData = toFormData_1;
2063
-
2064
- // Expose AxiosError class
2065
- axios$1.AxiosError = AxiosError_1;
2066
-
2067
- // alias for CanceledError for backward compatibility
2068
- axios$1.Cancel = axios$1.CanceledError;
2069
-
2070
- // Expose all/spread
2071
- axios$1.all = function all(promises) {
2072
- return Promise.all(promises);
2073
- };
2074
- axios$1.spread = spread;
2075
-
2076
- // Expose isAxiosError
2077
- axios$1.isAxiosError = isAxiosError;
2078
-
2079
- var axios_1 = axios$1;
2080
-
2081
- // Allow use of default import syntax in TypeScript
2082
- var _default = axios$1;
2083
- axios_1.default = _default;
2084
-
2085
- var axios = axios_1;
2086
-
2087
- // This file provides a polyfill for managing globals in both NodeJS and browser environments. This is
2088
- // an anti-pattern we'd hoped to avoid, but we have several projects dependending on one common library
2089
- // (this js-sdk) and we want that library to provide a common endpoint to all callers (so authentication
2090
- // tokens only need to be tracked in one place). The trouble is, one of those libraries is based on
2091
- // StencilJS and is compiling its modules into Web Components. Because of how module resolution works,
2092
- // when those Components load js-sdk they get a separate instance. Without messy options like having to
2093
- // pass raw data from the caller to each Component, or pass around references to a common Endpoint, they
2094
- // have no way to access authenticated sessions unless we make the Endpoint a true global.
2095
- //
2096
- // @credit https://github.com/medikoo/es5-ext/blob/master/global.js
2097
- // @credit https://mathiasbynens.be/notes/globalthis
2098
- var naiveFallback = function () {
2099
- if (typeof self === 'object' && self)
2100
- return self;
2101
- if (typeof window === 'object' && window)
2102
- return window;
2103
- throw new Error('Unable to resolve global `this`');
2104
- };
2105
- var globalThis_1 = (function () {
2106
- if (this)
2107
- return this;
2108
- // Unexpected strict mode (may happen if e.g. bundled into ESM module)
2109
- // Fallback to standard globalThis if available
2110
- if (typeof globalThis === 'object' && globalThis)
2111
- return globalThis;
2112
- // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
2113
- // In all ES5+ engines global object inherits from Object.prototype
2114
- // (if you approached one that doesn't please report)
2115
- try {
2116
- Object.defineProperty(Object.prototype, '__global__', {
2117
- get: function () {
2118
- return this;
2119
- },
2120
- configurable: true,
2121
- });
2122
- }
2123
- catch (error) {
2124
- // Unfortunate case of updates to Object.prototype being restricted
2125
- // via preventExtensions, seal or freeze
2126
- return naiveFallback();
2127
- }
2128
- try {
2129
- // Safari case (window.__global__ works, but __global__ does not)
2130
- if (!__global__)
2131
- return naiveFallback();
2132
- return __global__;
2133
- }
2134
- finally {
2135
- delete Object.prototype.__global__;
2136
- }
2137
- })();
2138
-
2139
- // @credit https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/
2140
- // Also see globalThis for comments about why we're doing this in the first place.
2141
- var ENDPOINT_KEY = Symbol.for('verdocs-default-endpoint');
2142
- var requestLogger = function (r) {
2143
- // tslint:disable-next-line
2144
- console.debug("[JS-SDK] ".concat(r.method.toUpperCase(), " ").concat(r.baseURL).concat(r.url), r.data ? JSON.stringify(r.data) : '');
2145
- return r;
2146
- };
2147
- /**
2148
- * VerdocsEndpoint is a class wrapper for a specific connection and authorization context for calling the Verdocs APIs.
2149
- * Endpoints can be used for isolated session tasks.
2150
- *
2151
- * For instance, ephemeral signing sessions may be created independently of a caller's status as an authenticated user.
2152
- * In that case, an Endpoint can be created and authenticated, used for calls related to signing operations, then
2153
- * discarded once signing is complete.
2154
- *
2155
- * Note that endpoint configuration functions return the instance, so they can be chained, e.g.
2156
- *
2157
- * ```typescript
2158
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2159
- *
2160
- * const endpoint = new VerdocsEndpoint();
2161
- * endpoint
2162
- * .setSessionType('signing')
2163
- * .logRequests(true)
2164
- * .setClientID('1234)
2165
- * .setTimeout(5000);
2166
- * ```
2167
- */
2168
- var VerdocsEndpoint = /** @class */ (function () {
2169
- /**
2170
- * Create a new VerdocsEndpoint to call Verdocs platform services.
2171
- *
2172
- * ```typescript
2173
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2174
- * const endpoint = new VerdocsEndpoint();
2175
- * ```
2176
- */
2177
- function VerdocsEndpoint(options) {
2178
- this.environment = 'verdocs';
2179
- this.sessionType = 'user';
2180
- this.baseURL = 'https://api.verdocs.com';
2181
- this.clientID = 'not-set';
2182
- this.timeout = 3000;
2183
- this.token = null;
2184
- this.nextListenerId = 0;
2185
- this.sessionListeners = new Map();
2186
- this.requestLoggerId = null;
2187
- /**
2188
- * The current user session, or null if not authenticated. May be either a User or Signing session. If set, the
2189
- * presence of the `document_id` field can be used to differentiate the types. Only signing sessions are associated
2190
- * with Documents.
2191
- */
2192
- this.session = null;
2193
- this.baseURL = (options === null || options === void 0 ? void 0 : options.baseURL) || 'https://api.verdocs.com';
2194
- this.timeout = (options === null || options === void 0 ? void 0 : options.timeout) || 3000;
2195
- this.environment = (options === null || options === void 0 ? void 0 : options.environment) || 'verdocs';
2196
- this.sessionType = (options === null || options === void 0 ? void 0 : options.sessionType) || 'user';
2197
- this.clientID = (options === null || options === void 0 ? void 0 : options.clientID) || 'not-set';
2198
- this.api = axios.create({ baseURL: this.baseURL, timeout: this.timeout });
2199
- }
2200
- VerdocsEndpoint.prototype.setDefault = function () {
2201
- globalThis_1[ENDPOINT_KEY] = this;
2202
- };
2203
- VerdocsEndpoint.getDefault = function () {
2204
- if (!globalThis_1[ENDPOINT_KEY]) {
2205
- globalThis_1[ENDPOINT_KEY] = new VerdocsEndpoint();
2206
- window.console.debug('[JS_SDK] Created default endpoint', globalThis_1[ENDPOINT_KEY]);
2207
- }
2208
- return globalThis_1[ENDPOINT_KEY];
2209
- };
2210
- /**
2211
- * Get the current environment.
2212
- */
2213
- VerdocsEndpoint.prototype.getEnvironment = function () {
2214
- return this.environment;
2215
- };
2216
- /**
2217
- * Get the current session type.
2218
- */
2219
- VerdocsEndpoint.prototype.getSessionType = function () {
2220
- return this.sessionType;
2221
- };
2222
- /**
2223
- * Get the current base URL. This should rarely be anything other than 'https://api.verdocs.com'.
2224
- */
2225
- VerdocsEndpoint.prototype.getBaseURL = function () {
2226
- return this.baseURL;
2227
- };
2228
- /**
2229
- * Get the current client ID, if set.
2230
- */
2231
- VerdocsEndpoint.prototype.getClientID = function () {
2232
- return this.clientID;
2233
- };
2234
- /**
2235
- * Get the current timeout.
2236
- */
2237
- VerdocsEndpoint.prototype.getTimeout = function () {
2238
- return this.timeout;
2239
- };
2240
- /**
2241
- * Get the current session, if any.
2242
- */
2243
- VerdocsEndpoint.prototype.getSession = function () {
2244
- return this.session;
2245
- };
2246
- /**
2247
- * Set the operating environment. This should rarely be anything other than 'verdocs'.
2248
- *
2249
- * ```typescript
2250
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2251
- *
2252
- * const endpoint = new VerdocsEndpoint();
2253
- * endpoint.setEnvironment('verdocs-stage');
2254
- * ```
2255
- */
2256
- VerdocsEndpoint.prototype.setEnvironment = function (environment) {
2257
- this.environment = environment;
2258
- return this;
2259
- };
2260
- /**
2261
- * Set the session type. In general this should be done immediately when the endpoint is created. Changing the
2262
- * session type may be done at any time, but may have unintended consequences if the endpoint is shared between
2263
- * multiple widgets.
2264
- *
2265
- * Changing the session type will clear/reload the action session. This may trigger notifications to session state
2266
- * observers. Apps that use observers to trigger UI updates such as logging the user out should be prepared to
2267
- * handle this event.
2268
- *
2269
- * ```typescript
2270
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2271
- *
2272
- * const endpoint = new VerdocsEndpoint();
2273
- * endpoint.setEnvironment('verdocs-stage');
2274
- * ```
2275
- */
2276
- VerdocsEndpoint.prototype.setSessionType = function (sessionType) {
2277
- this.sessionType = sessionType;
2278
- return this;
2279
- };
2280
- /**
2281
- * Set the base URL for API calls. Should be called only upon direction from Verdocs Customer Solutions Engineering.
2282
- *
2283
- * ```typescript
2284
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2285
- *
2286
- * const endpoint = new VerdocsEndpoint();
2287
- * endpoint.setBaseURL('https://api.verdocs.com');
2288
- * ```
2289
- */
2290
- VerdocsEndpoint.prototype.setBaseURL = function (url) {
2291
- this.api.defaults.baseURL = url;
2292
- return this;
2293
- };
2294
- /**
2295
- * Set the Client ID for Verdocs API calls.
2296
- *
2297
- * ```typescript
2298
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2299
- *
2300
- * const endpoint = new VerdocsEndpoint();
2301
- * endpoint.setClientID('1234);
2302
- * ```
2303
- */
2304
- VerdocsEndpoint.prototype.setClientID = function (clientID) {
2305
- this.clientID = clientID;
2306
- this.api.defaults.headers.common['X-Client-ID'] = clientID;
2307
- return this;
2308
- };
2309
- /**
2310
- * Set the timeout for API calls in milliseconds. 2000-4000ms is recommended for most purposes. 3000ms is the default.
2311
- *
2312
- * ```typescript
2313
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2314
- *
2315
- * const endpoint = new VerdocsEndpoint();
2316
- * endpoint.setTimeout(3000);
2317
- * ```
2318
- */
2319
- VerdocsEndpoint.prototype.setTimeout = function (timeout) {
2320
- this.timeout = timeout;
2321
- this.api.defaults.timeout = timeout;
2322
- return this;
2323
- };
2324
- /**
2325
- * Enable or disable request logging. This may expose sensitive data in the console log, so it should only be used for debugging.
2326
- *
2327
- * ```typescript
2328
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2329
- *
2330
- * const endpoint = new VerdocsEndpoint();
2331
- * endpoint.logRequests(true);
2332
- * ```
2333
- */
2334
- VerdocsEndpoint.prototype.logRequests = function (enable) {
2335
- if (enable && this.requestLoggerId === null) {
2336
- this.requestLoggerId = this.api.interceptors.request.use(requestLogger);
2337
- }
2338
- else if (!enable && this.requestLoggerId !== null) {
2339
- this.api.interceptors.request.eject(this.requestLoggerId);
2340
- }
2341
- return this;
2342
- };
2343
- /**
2344
- * Set the authorization token that will be used for Verdocs API calls. This will also set the session metadata
2345
- * and notify any listeners of the new data.
2346
- *
2347
- * If this Endpoint will be used for non-default purposes (e.g. signing, or in an alternate environment) those
2348
- * settings should be made before calling this. Sessions are persisted to localStorage, and the environment and
2349
- * type become part of the storage key.
2350
- *
2351
- * ```typescript
2352
- * import {VerdocsEndpoint} from '@verdocs/js-sdk/HTTP';
2353
- *
2354
- * const endpoint = new VerdocsEndpoint();
2355
- * endpoint.setToken(accessToken);
2356
- * ```
2357
- */
2358
- VerdocsEndpoint.prototype.setToken = function (token) {
2359
- if (!token) {
2360
- return this.clearSession();
2361
- }
2362
- var session = decodeAccessTokenBody(token);
2363
- if (session === null || (session.exp && session.exp * 1000 < new Date().getTime())) {
2364
- return this.clearSession();
2365
- }
2366
- this.token = token;
2367
- this.session = session;
2368
- this.api.defaults.headers.common.Authorization = "Bearer ".concat(token);
2369
- localStorage.setItem(this.sessionStorageKey(), token);
2370
- this.notifySessionListeners();
2371
- return this;
2372
- };
2373
- /**
2374
- * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is
2375
- * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.
2376
- */
2377
- VerdocsEndpoint.prototype.getToken = function () {
2378
- return this.token;
2379
- };
2380
- VerdocsEndpoint.prototype.sessionStorageKey = function () {
2381
- return "verdocs-session-".concat(this.getSessionType(), "-").concat(this.getEnvironment());
2382
- };
2383
- /**
2384
- * Clear the active session.
2385
- */
2386
- VerdocsEndpoint.prototype.clearSession = function () {
2387
- localStorage.removeItem(this.sessionStorageKey());
2388
- delete this.api.defaults.headers.common.Authorization;
2389
- this.session = null;
2390
- this.token = null;
2391
- this.notifySessionListeners();
2392
- return this;
2393
- };
2394
- VerdocsEndpoint.prototype.notifySessionListeners = function () {
2395
- var _this = this;
2396
- this.sessionListeners.forEach(function (listener) {
2397
- try {
2398
- listener(_this, _this.session);
2399
- }
2400
- catch (e) {
2401
- // NOOP
2402
- }
2403
- });
2404
- };
2405
- /**
2406
- * Subscribe to session state change events.
2407
- */
2408
- VerdocsEndpoint.prototype.onSessionChanged = function (listener) {
2409
- var _this = this;
2410
- // There's no value in randomizing this, a simple counter is fine
2411
- this.nextListenerId++;
2412
- var listenerSymbol = Symbol.for('' + this.nextListenerId);
2413
- this.sessionListeners.set(listenerSymbol, listener);
2414
- return function () {
2415
- _this.sessionListeners.delete(listenerSymbol);
2416
- };
2417
- };
2418
- /**
2419
- * Load a persisted session from localStorage. Typically called once after the endpoint is configured when the app
2420
- * or component starts.
2421
- */
2422
- VerdocsEndpoint.prototype.loadSession = function () {
2423
- var token = localStorage.getItem(this.sessionStorageKey());
2424
- if (!token) {
2425
- return this.clearSession();
2426
- }
2427
- return this.setToken(token);
2428
- };
2429
- return VerdocsEndpoint;
2430
- }());
2431
-
2432
- exports.VerdocsEndpoint = VerdocsEndpoint;
2433
- exports.decodeAccessTokenBody = decodeAccessTokenBody;
2434
-
2435
- //# sourceMappingURL=VerdocsEndpoint-db38e942.js.map