notebook 7.3.2__py3-none-any.whl → 7.3.3__py3-none-any.whl

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.

Potentially problematic release.


This version of notebook might be problematic. Click here for more details.

Files changed (134) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/{131.ae628045345ebd7a085c.js → 131.c84ccc55b083d2f63eb5.js} +31 -22
  3. notebook/static/131.c84ccc55b083d2f63eb5.js.map +1 -0
  4. notebook/static/{1326.9297038a97bfe38e02c5.js → 1326.ca053a9d8b69ac8e5d07.js} +2 -2
  5. notebook/static/{1326.9297038a97bfe38e02c5.js.map → 1326.ca053a9d8b69ac8e5d07.js.map} +1 -1
  6. notebook/static/{1650.8d7f95fed9378b01c97b.js → 1650.9ab35c6f8bc364d9c496.js} +4 -4
  7. notebook/static/{1650.8d7f95fed9378b01c97b.js.map → 1650.9ab35c6f8bc364d9c496.js.map} +1 -1
  8. notebook/static/{1684.17fc47c7fb30c0a8e713.js → 1684.181d3587b40531824b89.js} +5 -5
  9. notebook/static/{1684.17fc47c7fb30c0a8e713.js.map → 1684.181d3587b40531824b89.js.map} +1 -1
  10. notebook/static/{1871.29951b77779d94d726d1.js → 1871.bbb388c6015b8490c010.js} +4 -4
  11. notebook/static/{1871.29951b77779d94d726d1.js.map → 1871.bbb388c6015b8490c010.js.map} +1 -1
  12. notebook/static/{3146.0525c8e3f0097710544e.js → 3146.5a2c9c57f0ee140a9853.js} +3 -3
  13. notebook/static/{3146.0525c8e3f0097710544e.js.map → 3146.5a2c9c57f0ee140a9853.js.map} +1 -1
  14. notebook/static/{3488.405b2a619b7b87fc6f6b.js → 3488.4950efa0e3d80a841f23.js} +2 -2
  15. notebook/static/3488.4950efa0e3d80a841f23.js.map +1 -0
  16. notebook/static/{3768.409eda0ebb4676a30596.js → 3768.879ec647cb9a279eb309.js} +19 -19
  17. notebook/static/{7302.8dfb32b083b16efa038a.js.map → 3768.879ec647cb9a279eb309.js.map} +1 -1
  18. notebook/static/{4382.c3425ddaa226b75d1b57.js → 4382.11fbce1b6420d8976505.js} +3 -3
  19. notebook/static/{4382.c3425ddaa226b75d1b57.js.map → 4382.11fbce1b6420d8976505.js.map} +1 -1
  20. notebook/static/{4499.69ddcc73939e5bacc11c.js → 4499.e80329d16895102bbc12.js} +3 -3
  21. notebook/static/{4499.69ddcc73939e5bacc11c.js.map → 4499.e80329d16895102bbc12.js.map} +1 -1
  22. notebook/static/{4630.64ab2753f3286b5a778b.js → 4630.dd26ad6c2189ab26297a.js} +3 -3
  23. notebook/static/4630.dd26ad6c2189ab26297a.js.map +1 -0
  24. notebook/static/{4645.41cffc0184b6538b7e00.js → 4645.777b918de2a09b7b9a9b.js} +5 -5
  25. notebook/static/{4645.41cffc0184b6538b7e00.js.map → 4645.777b918de2a09b7b9a9b.js.map} +1 -1
  26. notebook/static/{4837.0e774b52bbcd51546b55.js → 4837.84a75547bf8a4a8e3759.js} +3 -3
  27. notebook/static/{4837.0e774b52bbcd51546b55.js.map → 4837.84a75547bf8a4a8e3759.js.map} +1 -1
  28. notebook/static/{4926.70b91208fd35ee838d65.js → 4926.c68927936b855fd893c5.js} +3 -3
  29. notebook/static/{4926.70b91208fd35ee838d65.js.map → 4926.c68927936b855fd893c5.js.map} +1 -1
  30. notebook/static/{5135.398f538011f4562d1fae.js → 5135.c7a9f8d53984219aba23.js} +11 -11
  31. notebook/static/{5135.398f538011f4562d1fae.js.map → 5135.c7a9f8d53984219aba23.js.map} +1 -1
  32. notebook/static/5448.a9016133a2b9389ac102.js +951 -0
  33. notebook/static/5448.a9016133a2b9389ac102.js.map +1 -0
  34. notebook/static/{5573.fadd0e2001b2575ccb0f.js → 5573.91bd2c782927c770f734.js} +18 -18
  35. notebook/static/5573.91bd2c782927c770f734.js.map +1 -0
  36. notebook/static/{5601.3e30eb7d151dda3b25ed.js → 5601.8f8d6c0ace5f7e929f35.js} +5 -5
  37. notebook/static/{5601.3e30eb7d151dda3b25ed.js.map → 5601.8f8d6c0ace5f7e929f35.js.map} +1 -1
  38. notebook/static/{6345.351e07d7802b67cb9d25.js → 6345.fa1f3ac32febb56fd8b9.js} +5 -5
  39. notebook/static/{6345.351e07d7802b67cb9d25.js.map → 6345.fa1f3ac32febb56fd8b9.js.map} +1 -1
  40. notebook/static/{7154.1ab03d07151bbd0aad06.js → 7154.cbe00782c73879782ae7.js} +5 -5
  41. notebook/static/{7154.1ab03d07151bbd0aad06.js.map → 7154.cbe00782c73879782ae7.js.map} +1 -1
  42. notebook/static/{7302.8dfb32b083b16efa038a.js → 7302.cbe9c1f18fe1a9d3a129.js} +19 -19
  43. notebook/static/{3768.409eda0ebb4676a30596.js.map → 7302.cbe9c1f18fe1a9d3a129.js.map} +1 -1
  44. notebook/static/{7369.286a75761c308381b0a4.js → 7369.8768f287c1cf1cc37db0.js} +25 -25
  45. notebook/static/{7369.286a75761c308381b0a4.js.map → 7369.8768f287c1cf1cc37db0.js.map} +1 -1
  46. notebook/static/{5157.325614b1326d23735fbe.js → 7534.e6ec4e7bd41255482e3e.js} +2 -2
  47. notebook/static/{5157.325614b1326d23735fbe.js.map → 7534.e6ec4e7bd41255482e3e.js.map} +1 -1
  48. notebook/static/{755.3d6eb3b7f81d035f52f4.js → 755.86950c1067a75cbbe902.js} +4 -4
  49. notebook/static/{755.3d6eb3b7f81d035f52f4.js.map → 755.86950c1067a75cbbe902.js.map} +1 -1
  50. notebook/static/{757.c9635937c6883f4b69fe.js → 757.86f80ac05f38c4f4be68.js} +97 -814
  51. notebook/static/757.86f80ac05f38c4f4be68.js.map +1 -0
  52. notebook/static/{7811.fa11577c84ea92d4102c.js → 7811.15b37088e4868dee449b.js} +5 -5
  53. notebook/static/{7811.fa11577c84ea92d4102c.js.map → 7811.15b37088e4868dee449b.js.map} +1 -1
  54. notebook/static/{7906.67e8d86ba7ed95cbac87.js → 7906.6b836133253dc69ada3b.js} +3 -3
  55. notebook/static/{7906.67e8d86ba7ed95cbac87.js.map → 7906.6b836133253dc69ada3b.js.map} +1 -1
  56. notebook/static/{7995.45be6443b704da1daafc.js → 7995.e6c73e8581b7790a84e7.js} +2 -2
  57. notebook/static/{7995.45be6443b704da1daafc.js.map → 7995.e6c73e8581b7790a84e7.js.map} +1 -1
  58. notebook/static/{6033.e5f43eeda4cc803965de.js → 8384.4a19822f320fec925f9b.js} +2 -2
  59. notebook/static/{6033.e5f43eeda4cc803965de.js.map → 8384.4a19822f320fec925f9b.js.map} +1 -1
  60. notebook/static/{8579.d7fc77346371c454ec00.js → 8579.b99b947f4531351037b0.js} +13 -13
  61. notebook/static/{8579.d7fc77346371c454ec00.js.map → 8579.b99b947f4531351037b0.js.map} +1 -1
  62. notebook/static/{8781.f58f42a24da8ac99623f.js → 8781.b7c620b7ec3a9833df1c.js} +58 -58
  63. notebook/static/{8781.f58f42a24da8ac99623f.js.map → 8781.b7c620b7ec3a9833df1c.js.map} +1 -1
  64. notebook/static/{8845.ac1c5acb78cea4acee08.js → 8845.4f41e164a0399572ddec.js} +14 -14
  65. notebook/static/{8845.ac1c5acb78cea4acee08.js.map → 8845.4f41e164a0399572ddec.js.map} +1 -1
  66. notebook/static/{8875.576e3c6503ecdf5c2124.js → 8875.934ae30259f7ed06908f.js} +4 -4
  67. notebook/static/{8875.576e3c6503ecdf5c2124.js.map → 8875.934ae30259f7ed06908f.js.map} +1 -1
  68. notebook/static/{9068.cb72a595212d6ed7de5e.js → 9068.a1663e3fbe550c0a2151.js} +3 -3
  69. notebook/static/{9068.cb72a595212d6ed7de5e.js.map → 9068.a1663e3fbe550c0a2151.js.map} +1 -1
  70. notebook/static/{9380.709f3e6308fc49ccb353.js → 9380.438b50b596a131ebbe9a.js} +5 -5
  71. notebook/static/{9380.709f3e6308fc49ccb353.js.map → 9380.438b50b596a131ebbe9a.js.map} +1 -1
  72. notebook/static/{9619.6f4ade981540ff20b8bd.js → 9619.82b5a1c798e28d4c26c5.js} +5 -5
  73. notebook/static/{9619.6f4ade981540ff20b8bd.js.map → 9619.82b5a1c798e28d4c26c5.js.map} +1 -1
  74. notebook/static/main.fa530803fa8c046b1a88.js +1174 -0
  75. notebook/static/main.fa530803fa8c046b1a88.js.map +1 -0
  76. notebook/static/{notebook_core.4799ce7e762b693682b6.js → notebook_core.c9e3f27c4be739a57674.js} +1073 -891
  77. notebook/static/{notebook_core.4799ce7e762b693682b6.js.map → notebook_core.c9e3f27c4be739a57674.js.map} +1 -1
  78. notebook/static/third-party-licenses.json +110 -122
  79. notebook/templates/consoles.html +1 -1
  80. notebook/templates/edit.html +1 -1
  81. notebook/templates/error.html +1 -1
  82. notebook/templates/notebooks.html +1 -1
  83. notebook/templates/terminals.html +1 -1
  84. notebook/templates/tree.html +1 -1
  85. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  86. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  87. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  88. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  89. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  90. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  91. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  92. notebook-7.3.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/926.1e1698d53d81bf49c4ad.js → notebook-7.3.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/157.2df91472e02c447c6341.js +1 -1
  93. notebook-7.3.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.89eee0979a49b375da20.js +1 -0
  94. notebook-7.3.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.a483ccd28c27e3c44bf4.js +1 -0
  95. notebook-7.3.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.c48a681bb3e8043bbbd7.js → notebook-7.3.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +1 -1
  96. notebook-7.3.3.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.1721422919ae05a29840.js +1 -0
  97. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  98. {notebook-7.3.2.dist-info → notebook-7.3.3.dist-info}/METADATA +2 -2
  99. {notebook-7.3.2.dist-info → notebook-7.3.3.dist-info}/RECORD +122 -122
  100. notebook/static/131.ae628045345ebd7a085c.js.map +0 -1
  101. notebook/static/3488.405b2a619b7b87fc6f6b.js.map +0 -1
  102. notebook/static/4630.64ab2753f3286b5a778b.js.map +0 -1
  103. notebook/static/5573.fadd0e2001b2575ccb0f.js.map +0 -1
  104. notebook/static/757.c9635937c6883f4b69fe.js.map +0 -1
  105. notebook/static/7796.ea7106c833e81e2e6a6d.js +0 -1608
  106. notebook/static/7796.ea7106c833e81e2e6a6d.js.map +0 -1
  107. notebook/static/main.407246dd27aed8010549.js +0 -1174
  108. notebook/static/main.407246dd27aed8010549.js.map +0 -1
  109. notebook-7.3.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.f1a870f262b5e8588c75.js +0 -1
  110. notebook-7.3.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.7261ac56728710cbd7f2.js +0 -1
  111. notebook-7.3.2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.cad89c571bc2aee4aff2.js +0 -1
  112. {notebook-7.3.2.data → notebook-7.3.3.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  113. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  114. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  115. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  116. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  117. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  118. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  119. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  120. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  121. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  122. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  123. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  124. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/full-width-notebook.json +0 -0
  125. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  126. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  127. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  128. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  129. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  130. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  131. {notebook-7.3.2.data → notebook-7.3.3.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  132. {notebook-7.3.2.dist-info → notebook-7.3.3.dist-info}/WHEEL +0 -0
  133. {notebook-7.3.2.dist-info → notebook-7.3.3.dist-info}/entry_points.txt +0 -0
  134. {notebook-7.3.2.dist-info → notebook-7.3.3.dist-info}/licenses/LICENSE +0 -0
@@ -1,1608 +0,0 @@
1
- (self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([[7796],{
2
-
3
- /***/ 66471:
4
- /***/ ((module) => {
5
-
6
- "use strict";
7
-
8
-
9
- // do not edit .js files directly - edit src/index.jst
10
-
11
-
12
-
13
- module.exports = function equal(a, b) {
14
- if (a === b) return true;
15
-
16
- if (a && b && typeof a == 'object' && typeof b == 'object') {
17
- if (a.constructor !== b.constructor) return false;
18
-
19
- var length, i, keys;
20
- if (Array.isArray(a)) {
21
- length = a.length;
22
- if (length != b.length) return false;
23
- for (i = length; i-- !== 0;)
24
- if (!equal(a[i], b[i])) return false;
25
- return true;
26
- }
27
-
28
-
29
-
30
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
31
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
32
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
33
-
34
- keys = Object.keys(a);
35
- length = keys.length;
36
- if (length !== Object.keys(b).length) return false;
37
-
38
- for (i = length; i-- !== 0;)
39
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
40
-
41
- for (i = length; i-- !== 0;) {
42
- var key = keys[i];
43
-
44
- if (!equal(a[key], b[key])) return false;
45
- }
46
-
47
- return true;
48
- }
49
-
50
- // true if both NaN, false otherwise
51
- return a!==a && b!==b;
52
- };
53
-
54
-
55
- /***/ }),
56
-
57
- /***/ 25127:
58
- /***/ ((module) => {
59
-
60
- "use strict";
61
-
62
-
63
- var traverse = module.exports = function (schema, opts, cb) {
64
- // Legacy support for v0.3.1 and earlier.
65
- if (typeof opts == 'function') {
66
- cb = opts;
67
- opts = {};
68
- }
69
-
70
- cb = opts.cb || cb;
71
- var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
72
- var post = cb.post || function() {};
73
-
74
- _traverse(opts, pre, post, schema, '', schema);
75
- };
76
-
77
-
78
- traverse.keywords = {
79
- additionalItems: true,
80
- items: true,
81
- contains: true,
82
- additionalProperties: true,
83
- propertyNames: true,
84
- not: true,
85
- if: true,
86
- then: true,
87
- else: true
88
- };
89
-
90
- traverse.arrayKeywords = {
91
- items: true,
92
- allOf: true,
93
- anyOf: true,
94
- oneOf: true
95
- };
96
-
97
- traverse.propsKeywords = {
98
- $defs: true,
99
- definitions: true,
100
- properties: true,
101
- patternProperties: true,
102
- dependencies: true
103
- };
104
-
105
- traverse.skipKeywords = {
106
- default: true,
107
- enum: true,
108
- const: true,
109
- required: true,
110
- maximum: true,
111
- minimum: true,
112
- exclusiveMaximum: true,
113
- exclusiveMinimum: true,
114
- multipleOf: true,
115
- maxLength: true,
116
- minLength: true,
117
- pattern: true,
118
- format: true,
119
- maxItems: true,
120
- minItems: true,
121
- uniqueItems: true,
122
- maxProperties: true,
123
- minProperties: true
124
- };
125
-
126
-
127
- function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
128
- if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
129
- pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
130
- for (var key in schema) {
131
- var sch = schema[key];
132
- if (Array.isArray(sch)) {
133
- if (key in traverse.arrayKeywords) {
134
- for (var i=0; i<sch.length; i++)
135
- _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
136
- }
137
- } else if (key in traverse.propsKeywords) {
138
- if (sch && typeof sch == 'object') {
139
- for (var prop in sch)
140
- _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
141
- }
142
- } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
143
- _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
144
- }
145
- }
146
- post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
147
- }
148
- }
149
-
150
-
151
- function escapeJsonPtr(str) {
152
- return str.replace(/~/g, '~0').replace(/\//g, '~1');
153
- }
154
-
155
-
156
- /***/ }),
157
-
158
- /***/ 22371:
159
- /***/ (function(__unused_webpack_module, exports) {
160
-
161
- /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
162
- (function (global, factory) {
163
- true ? factory(exports) :
164
- 0;
165
- }(this, (function (exports) { 'use strict';
166
-
167
- function merge() {
168
- for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
169
- sets[_key] = arguments[_key];
170
- }
171
-
172
- if (sets.length > 1) {
173
- sets[0] = sets[0].slice(0, -1);
174
- var xl = sets.length - 1;
175
- for (var x = 1; x < xl; ++x) {
176
- sets[x] = sets[x].slice(1, -1);
177
- }
178
- sets[xl] = sets[xl].slice(1);
179
- return sets.join('');
180
- } else {
181
- return sets[0];
182
- }
183
- }
184
- function subexp(str) {
185
- return "(?:" + str + ")";
186
- }
187
- function typeOf(o) {
188
- return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
189
- }
190
- function toUpperCase(str) {
191
- return str.toUpperCase();
192
- }
193
- function toArray(obj) {
194
- return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
195
- }
196
- function assign(target, source) {
197
- var obj = target;
198
- if (source) {
199
- for (var key in source) {
200
- obj[key] = source[key];
201
- }
202
- }
203
- return obj;
204
- }
205
-
206
- function buildExps(isIRI) {
207
- var ALPHA$$ = "[A-Za-z]",
208
- CR$ = "[\\x0D]",
209
- DIGIT$$ = "[0-9]",
210
- DQUOTE$$ = "[\\x22]",
211
- HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
212
- //case-insensitive
213
- LF$$ = "[\\x0A]",
214
- SP$$ = "[\\x20]",
215
- PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
216
- //expanded
217
- GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
218
- SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
219
- RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
220
- UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
221
- //subset, excludes bidi control characters
222
- IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
223
- //subset
224
- UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
225
- SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
226
- USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
227
- DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$),
228
- DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
229
- //relaxed parsing rules
230
- IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
231
- H16$ = subexp(HEXDIG$$ + "{1,4}"),
232
- LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
233
- IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
234
- // 6( h16 ":" ) ls32
235
- IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
236
- // "::" 5( h16 ":" ) ls32
237
- IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
238
- //[ h16 ] "::" 4( h16 ":" ) ls32
239
- IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
240
- //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
241
- IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
242
- //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
243
- IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
244
- //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
245
- IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
246
- //[ *4( h16 ":" ) h16 ] "::" ls32
247
- IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
248
- //[ *5( h16 ":" ) h16 ] "::" h16
249
- IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
250
- //[ *6( h16 ":" ) h16 ] "::"
251
- IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
252
- ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
253
- //RFC 6874
254
- IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$),
255
- //RFC 6874
256
- IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$),
257
- //RFC 6874, with relaxed parsing rules
258
- IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
259
- IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"),
260
- //RFC 6874
261
- REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
262
- HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$),
263
- PORT$ = subexp(DIGIT$$ + "*"),
264
- AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"),
265
- PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
266
- SEGMENT$ = subexp(PCHAR$ + "*"),
267
- SEGMENT_NZ$ = subexp(PCHAR$ + "+"),
268
- SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
269
- PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"),
270
- PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"),
271
- //simplified
272
- PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),
273
- //simplified
274
- PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),
275
- //simplified
276
- PATH_EMPTY$ = "(?!" + PCHAR$ + ")",
277
- PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
278
- QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"),
279
- FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"),
280
- HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
281
- URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
282
- RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$),
283
- RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
284
- URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$),
285
- ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"),
286
- GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
287
- RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
288
- ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$",
289
- SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
290
- AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
291
- return {
292
- NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
293
- NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
294
- NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
295
- NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
296
- NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
297
- NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
298
- NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
299
- ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
300
- UNRESERVED: new RegExp(UNRESERVED$$, "g"),
301
- OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
302
- PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
303
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
304
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
305
- };
306
- }
307
- var URI_PROTOCOL = buildExps(false);
308
-
309
- var IRI_PROTOCOL = buildExps(true);
310
-
311
- var slicedToArray = function () {
312
- function sliceIterator(arr, i) {
313
- var _arr = [];
314
- var _n = true;
315
- var _d = false;
316
- var _e = undefined;
317
-
318
- try {
319
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
320
- _arr.push(_s.value);
321
-
322
- if (i && _arr.length === i) break;
323
- }
324
- } catch (err) {
325
- _d = true;
326
- _e = err;
327
- } finally {
328
- try {
329
- if (!_n && _i["return"]) _i["return"]();
330
- } finally {
331
- if (_d) throw _e;
332
- }
333
- }
334
-
335
- return _arr;
336
- }
337
-
338
- return function (arr, i) {
339
- if (Array.isArray(arr)) {
340
- return arr;
341
- } else if (Symbol.iterator in Object(arr)) {
342
- return sliceIterator(arr, i);
343
- } else {
344
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
345
- }
346
- };
347
- }();
348
-
349
-
350
-
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
- var toConsumableArray = function (arr) {
362
- if (Array.isArray(arr)) {
363
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
364
-
365
- return arr2;
366
- } else {
367
- return Array.from(arr);
368
- }
369
- };
370
-
371
- /** Highest positive signed 32-bit float value */
372
-
373
- var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
374
-
375
- /** Bootstring parameters */
376
- var base = 36;
377
- var tMin = 1;
378
- var tMax = 26;
379
- var skew = 38;
380
- var damp = 700;
381
- var initialBias = 72;
382
- var initialN = 128; // 0x80
383
- var delimiter = '-'; // '\x2D'
384
-
385
- /** Regular expressions */
386
- var regexPunycode = /^xn--/;
387
- var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
388
- var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
389
-
390
- /** Error messages */
391
- var errors = {
392
- 'overflow': 'Overflow: input needs wider integers to process',
393
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
394
- 'invalid-input': 'Invalid input'
395
- };
396
-
397
- /** Convenience shortcuts */
398
- var baseMinusTMin = base - tMin;
399
- var floor = Math.floor;
400
- var stringFromCharCode = String.fromCharCode;
401
-
402
- /*--------------------------------------------------------------------------*/
403
-
404
- /**
405
- * A generic error utility function.
406
- * @private
407
- * @param {String} type The error type.
408
- * @returns {Error} Throws a `RangeError` with the applicable error message.
409
- */
410
- function error$1(type) {
411
- throw new RangeError(errors[type]);
412
- }
413
-
414
- /**
415
- * A generic `Array#map` utility function.
416
- * @private
417
- * @param {Array} array The array to iterate over.
418
- * @param {Function} callback The function that gets called for every array
419
- * item.
420
- * @returns {Array} A new array of values returned by the callback function.
421
- */
422
- function map(array, fn) {
423
- var result = [];
424
- var length = array.length;
425
- while (length--) {
426
- result[length] = fn(array[length]);
427
- }
428
- return result;
429
- }
430
-
431
- /**
432
- * A simple `Array#map`-like wrapper to work with domain name strings or email
433
- * addresses.
434
- * @private
435
- * @param {String} domain The domain name or email address.
436
- * @param {Function} callback The function that gets called for every
437
- * character.
438
- * @returns {Array} A new string of characters returned by the callback
439
- * function.
440
- */
441
- function mapDomain(string, fn) {
442
- var parts = string.split('@');
443
- var result = '';
444
- if (parts.length > 1) {
445
- // In email addresses, only the domain name should be punycoded. Leave
446
- // the local part (i.e. everything up to `@`) intact.
447
- result = parts[0] + '@';
448
- string = parts[1];
449
- }
450
- // Avoid `split(regex)` for IE8 compatibility. See #17.
451
- string = string.replace(regexSeparators, '\x2E');
452
- var labels = string.split('.');
453
- var encoded = map(labels, fn).join('.');
454
- return result + encoded;
455
- }
456
-
457
- /**
458
- * Creates an array containing the numeric code points of each Unicode
459
- * character in the string. While JavaScript uses UCS-2 internally,
460
- * this function will convert a pair of surrogate halves (each of which
461
- * UCS-2 exposes as separate characters) into a single code point,
462
- * matching UTF-16.
463
- * @see `punycode.ucs2.encode`
464
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
465
- * @memberOf punycode.ucs2
466
- * @name decode
467
- * @param {String} string The Unicode input string (UCS-2).
468
- * @returns {Array} The new array of code points.
469
- */
470
- function ucs2decode(string) {
471
- var output = [];
472
- var counter = 0;
473
- var length = string.length;
474
- while (counter < length) {
475
- var value = string.charCodeAt(counter++);
476
- if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
477
- // It's a high surrogate, and there is a next character.
478
- var extra = string.charCodeAt(counter++);
479
- if ((extra & 0xFC00) == 0xDC00) {
480
- // Low surrogate.
481
- output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
482
- } else {
483
- // It's an unmatched surrogate; only append this code unit, in case the
484
- // next code unit is the high surrogate of a surrogate pair.
485
- output.push(value);
486
- counter--;
487
- }
488
- } else {
489
- output.push(value);
490
- }
491
- }
492
- return output;
493
- }
494
-
495
- /**
496
- * Creates a string based on an array of numeric code points.
497
- * @see `punycode.ucs2.decode`
498
- * @memberOf punycode.ucs2
499
- * @name encode
500
- * @param {Array} codePoints The array of numeric code points.
501
- * @returns {String} The new Unicode string (UCS-2).
502
- */
503
- var ucs2encode = function ucs2encode(array) {
504
- return String.fromCodePoint.apply(String, toConsumableArray(array));
505
- };
506
-
507
- /**
508
- * Converts a basic code point into a digit/integer.
509
- * @see `digitToBasic()`
510
- * @private
511
- * @param {Number} codePoint The basic numeric code point value.
512
- * @returns {Number} The numeric value of a basic code point (for use in
513
- * representing integers) in the range `0` to `base - 1`, or `base` if
514
- * the code point does not represent a value.
515
- */
516
- var basicToDigit = function basicToDigit(codePoint) {
517
- if (codePoint - 0x30 < 0x0A) {
518
- return codePoint - 0x16;
519
- }
520
- if (codePoint - 0x41 < 0x1A) {
521
- return codePoint - 0x41;
522
- }
523
- if (codePoint - 0x61 < 0x1A) {
524
- return codePoint - 0x61;
525
- }
526
- return base;
527
- };
528
-
529
- /**
530
- * Converts a digit/integer into a basic code point.
531
- * @see `basicToDigit()`
532
- * @private
533
- * @param {Number} digit The numeric value of a basic code point.
534
- * @returns {Number} The basic code point whose value (when used for
535
- * representing integers) is `digit`, which needs to be in the range
536
- * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
537
- * used; else, the lowercase form is used. The behavior is undefined
538
- * if `flag` is non-zero and `digit` has no uppercase form.
539
- */
540
- var digitToBasic = function digitToBasic(digit, flag) {
541
- // 0..25 map to ASCII a..z or A..Z
542
- // 26..35 map to ASCII 0..9
543
- return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
544
- };
545
-
546
- /**
547
- * Bias adaptation function as per section 3.4 of RFC 3492.
548
- * https://tools.ietf.org/html/rfc3492#section-3.4
549
- * @private
550
- */
551
- var adapt = function adapt(delta, numPoints, firstTime) {
552
- var k = 0;
553
- delta = firstTime ? floor(delta / damp) : delta >> 1;
554
- delta += floor(delta / numPoints);
555
- for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
556
- delta = floor(delta / baseMinusTMin);
557
- }
558
- return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
559
- };
560
-
561
- /**
562
- * Converts a Punycode string of ASCII-only symbols to a string of Unicode
563
- * symbols.
564
- * @memberOf punycode
565
- * @param {String} input The Punycode string of ASCII-only symbols.
566
- * @returns {String} The resulting string of Unicode symbols.
567
- */
568
- var decode = function decode(input) {
569
- // Don't use UCS-2.
570
- var output = [];
571
- var inputLength = input.length;
572
- var i = 0;
573
- var n = initialN;
574
- var bias = initialBias;
575
-
576
- // Handle the basic code points: let `basic` be the number of input code
577
- // points before the last delimiter, or `0` if there is none, then copy
578
- // the first basic code points to the output.
579
-
580
- var basic = input.lastIndexOf(delimiter);
581
- if (basic < 0) {
582
- basic = 0;
583
- }
584
-
585
- for (var j = 0; j < basic; ++j) {
586
- // if it's not a basic code point
587
- if (input.charCodeAt(j) >= 0x80) {
588
- error$1('not-basic');
589
- }
590
- output.push(input.charCodeAt(j));
591
- }
592
-
593
- // Main decoding loop: start just after the last delimiter if any basic code
594
- // points were copied; start at the beginning otherwise.
595
-
596
- for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{
597
-
598
- // `index` is the index of the next character to be consumed.
599
- // Decode a generalized variable-length integer into `delta`,
600
- // which gets added to `i`. The overflow checking is easier
601
- // if we increase `i` as we go, then subtract off its starting
602
- // value at the end to obtain `delta`.
603
- var oldi = i;
604
- for (var w = 1, k = base;; /* no condition */k += base) {
605
-
606
- if (index >= inputLength) {
607
- error$1('invalid-input');
608
- }
609
-
610
- var digit = basicToDigit(input.charCodeAt(index++));
611
-
612
- if (digit >= base || digit > floor((maxInt - i) / w)) {
613
- error$1('overflow');
614
- }
615
-
616
- i += digit * w;
617
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
618
-
619
- if (digit < t) {
620
- break;
621
- }
622
-
623
- var baseMinusT = base - t;
624
- if (w > floor(maxInt / baseMinusT)) {
625
- error$1('overflow');
626
- }
627
-
628
- w *= baseMinusT;
629
- }
630
-
631
- var out = output.length + 1;
632
- bias = adapt(i - oldi, out, oldi == 0);
633
-
634
- // `i` was supposed to wrap around from `out` to `0`,
635
- // incrementing `n` each time, so we'll fix that now:
636
- if (floor(i / out) > maxInt - n) {
637
- error$1('overflow');
638
- }
639
-
640
- n += floor(i / out);
641
- i %= out;
642
-
643
- // Insert `n` at position `i` of the output.
644
- output.splice(i++, 0, n);
645
- }
646
-
647
- return String.fromCodePoint.apply(String, output);
648
- };
649
-
650
- /**
651
- * Converts a string of Unicode symbols (e.g. a domain name label) to a
652
- * Punycode string of ASCII-only symbols.
653
- * @memberOf punycode
654
- * @param {String} input The string of Unicode symbols.
655
- * @returns {String} The resulting Punycode string of ASCII-only symbols.
656
- */
657
- var encode = function encode(input) {
658
- var output = [];
659
-
660
- // Convert the input in UCS-2 to an array of Unicode code points.
661
- input = ucs2decode(input);
662
-
663
- // Cache the length.
664
- var inputLength = input.length;
665
-
666
- // Initialize the state.
667
- var n = initialN;
668
- var delta = 0;
669
- var bias = initialBias;
670
-
671
- // Handle the basic code points.
672
- var _iteratorNormalCompletion = true;
673
- var _didIteratorError = false;
674
- var _iteratorError = undefined;
675
-
676
- try {
677
- for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
678
- var _currentValue2 = _step.value;
679
-
680
- if (_currentValue2 < 0x80) {
681
- output.push(stringFromCharCode(_currentValue2));
682
- }
683
- }
684
- } catch (err) {
685
- _didIteratorError = true;
686
- _iteratorError = err;
687
- } finally {
688
- try {
689
- if (!_iteratorNormalCompletion && _iterator.return) {
690
- _iterator.return();
691
- }
692
- } finally {
693
- if (_didIteratorError) {
694
- throw _iteratorError;
695
- }
696
- }
697
- }
698
-
699
- var basicLength = output.length;
700
- var handledCPCount = basicLength;
701
-
702
- // `handledCPCount` is the number of code points that have been handled;
703
- // `basicLength` is the number of basic code points.
704
-
705
- // Finish the basic string with a delimiter unless it's empty.
706
- if (basicLength) {
707
- output.push(delimiter);
708
- }
709
-
710
- // Main encoding loop:
711
- while (handledCPCount < inputLength) {
712
-
713
- // All non-basic code points < n have been handled already. Find the next
714
- // larger one:
715
- var m = maxInt;
716
- var _iteratorNormalCompletion2 = true;
717
- var _didIteratorError2 = false;
718
- var _iteratorError2 = undefined;
719
-
720
- try {
721
- for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
722
- var currentValue = _step2.value;
723
-
724
- if (currentValue >= n && currentValue < m) {
725
- m = currentValue;
726
- }
727
- }
728
-
729
- // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
730
- // but guard against overflow.
731
- } catch (err) {
732
- _didIteratorError2 = true;
733
- _iteratorError2 = err;
734
- } finally {
735
- try {
736
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
737
- _iterator2.return();
738
- }
739
- } finally {
740
- if (_didIteratorError2) {
741
- throw _iteratorError2;
742
- }
743
- }
744
- }
745
-
746
- var handledCPCountPlusOne = handledCPCount + 1;
747
- if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
748
- error$1('overflow');
749
- }
750
-
751
- delta += (m - n) * handledCPCountPlusOne;
752
- n = m;
753
-
754
- var _iteratorNormalCompletion3 = true;
755
- var _didIteratorError3 = false;
756
- var _iteratorError3 = undefined;
757
-
758
- try {
759
- for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
760
- var _currentValue = _step3.value;
761
-
762
- if (_currentValue < n && ++delta > maxInt) {
763
- error$1('overflow');
764
- }
765
- if (_currentValue == n) {
766
- // Represent delta as a generalized variable-length integer.
767
- var q = delta;
768
- for (var k = base;; /* no condition */k += base) {
769
- var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
770
- if (q < t) {
771
- break;
772
- }
773
- var qMinusT = q - t;
774
- var baseMinusT = base - t;
775
- output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
776
- q = floor(qMinusT / baseMinusT);
777
- }
778
-
779
- output.push(stringFromCharCode(digitToBasic(q, 0)));
780
- bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
781
- delta = 0;
782
- ++handledCPCount;
783
- }
784
- }
785
- } catch (err) {
786
- _didIteratorError3 = true;
787
- _iteratorError3 = err;
788
- } finally {
789
- try {
790
- if (!_iteratorNormalCompletion3 && _iterator3.return) {
791
- _iterator3.return();
792
- }
793
- } finally {
794
- if (_didIteratorError3) {
795
- throw _iteratorError3;
796
- }
797
- }
798
- }
799
-
800
- ++delta;
801
- ++n;
802
- }
803
- return output.join('');
804
- };
805
-
806
- /**
807
- * Converts a Punycode string representing a domain name or an email address
808
- * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
809
- * it doesn't matter if you call it on a string that has already been
810
- * converted to Unicode.
811
- * @memberOf punycode
812
- * @param {String} input The Punycoded domain name or email address to
813
- * convert to Unicode.
814
- * @returns {String} The Unicode representation of the given Punycode
815
- * string.
816
- */
817
- var toUnicode = function toUnicode(input) {
818
- return mapDomain(input, function (string) {
819
- return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
820
- });
821
- };
822
-
823
- /**
824
- * Converts a Unicode string representing a domain name or an email address to
825
- * Punycode. Only the non-ASCII parts of the domain name will be converted,
826
- * i.e. it doesn't matter if you call it with a domain that's already in
827
- * ASCII.
828
- * @memberOf punycode
829
- * @param {String} input The domain name or email address to convert, as a
830
- * Unicode string.
831
- * @returns {String} The Punycode representation of the given domain name or
832
- * email address.
833
- */
834
- var toASCII = function toASCII(input) {
835
- return mapDomain(input, function (string) {
836
- return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
837
- });
838
- };
839
-
840
- /*--------------------------------------------------------------------------*/
841
-
842
- /** Define the public API */
843
- var punycode = {
844
- /**
845
- * A string representing the current Punycode.js version number.
846
- * @memberOf punycode
847
- * @type String
848
- */
849
- 'version': '2.1.0',
850
- /**
851
- * An object of methods to convert from JavaScript's internal character
852
- * representation (UCS-2) to Unicode code points, and back.
853
- * @see <https://mathiasbynens.be/notes/javascript-encoding>
854
- * @memberOf punycode
855
- * @type Object
856
- */
857
- 'ucs2': {
858
- 'decode': ucs2decode,
859
- 'encode': ucs2encode
860
- },
861
- 'decode': decode,
862
- 'encode': encode,
863
- 'toASCII': toASCII,
864
- 'toUnicode': toUnicode
865
- };
866
-
867
- /**
868
- * URI.js
869
- *
870
- * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
871
- * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
872
- * @see http://github.com/garycourt/uri-js
873
- */
874
- /**
875
- * Copyright 2011 Gary Court. All rights reserved.
876
- *
877
- * Redistribution and use in source and binary forms, with or without modification, are
878
- * permitted provided that the following conditions are met:
879
- *
880
- * 1. Redistributions of source code must retain the above copyright notice, this list of
881
- * conditions and the following disclaimer.
882
- *
883
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
884
- * of conditions and the following disclaimer in the documentation and/or other materials
885
- * provided with the distribution.
886
- *
887
- * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
888
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
889
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
890
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
891
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
892
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
893
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
894
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
895
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
896
- *
897
- * The views and conclusions contained in the software and documentation are those of the
898
- * authors and should not be interpreted as representing official policies, either expressed
899
- * or implied, of Gary Court.
900
- */
901
- var SCHEMES = {};
902
- function pctEncChar(chr) {
903
- var c = chr.charCodeAt(0);
904
- var e = void 0;
905
- if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
906
- return e;
907
- }
908
- function pctDecChars(str) {
909
- var newStr = "";
910
- var i = 0;
911
- var il = str.length;
912
- while (i < il) {
913
- var c = parseInt(str.substr(i + 1, 2), 16);
914
- if (c < 128) {
915
- newStr += String.fromCharCode(c);
916
- i += 3;
917
- } else if (c >= 194 && c < 224) {
918
- if (il - i >= 6) {
919
- var c2 = parseInt(str.substr(i + 4, 2), 16);
920
- newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
921
- } else {
922
- newStr += str.substr(i, 6);
923
- }
924
- i += 6;
925
- } else if (c >= 224) {
926
- if (il - i >= 9) {
927
- var _c = parseInt(str.substr(i + 4, 2), 16);
928
- var c3 = parseInt(str.substr(i + 7, 2), 16);
929
- newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
930
- } else {
931
- newStr += str.substr(i, 9);
932
- }
933
- i += 9;
934
- } else {
935
- newStr += str.substr(i, 3);
936
- i += 3;
937
- }
938
- }
939
- return newStr;
940
- }
941
- function _normalizeComponentEncoding(components, protocol) {
942
- function decodeUnreserved(str) {
943
- var decStr = pctDecChars(str);
944
- return !decStr.match(protocol.UNRESERVED) ? str : decStr;
945
- }
946
- if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
947
- if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
948
- if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
949
- if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
950
- if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
951
- if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
952
- return components;
953
- }
954
-
955
- function _stripLeadingZeros(str) {
956
- return str.replace(/^0*(.*)/, "$1") || "0";
957
- }
958
- function _normalizeIPv4(host, protocol) {
959
- var matches = host.match(protocol.IPV4ADDRESS) || [];
960
-
961
- var _matches = slicedToArray(matches, 2),
962
- address = _matches[1];
963
-
964
- if (address) {
965
- return address.split(".").map(_stripLeadingZeros).join(".");
966
- } else {
967
- return host;
968
- }
969
- }
970
- function _normalizeIPv6(host, protocol) {
971
- var matches = host.match(protocol.IPV6ADDRESS) || [];
972
-
973
- var _matches2 = slicedToArray(matches, 3),
974
- address = _matches2[1],
975
- zone = _matches2[2];
976
-
977
- if (address) {
978
- var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
979
- _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
980
- last = _address$toLowerCase$2[0],
981
- first = _address$toLowerCase$2[1];
982
-
983
- var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
984
- var lastFields = last.split(":").map(_stripLeadingZeros);
985
- var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
986
- var fieldCount = isLastFieldIPv4Address ? 7 : 8;
987
- var lastFieldsStart = lastFields.length - fieldCount;
988
- var fields = Array(fieldCount);
989
- for (var x = 0; x < fieldCount; ++x) {
990
- fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
991
- }
992
- if (isLastFieldIPv4Address) {
993
- fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
994
- }
995
- var allZeroFields = fields.reduce(function (acc, field, index) {
996
- if (!field || field === "0") {
997
- var lastLongest = acc[acc.length - 1];
998
- if (lastLongest && lastLongest.index + lastLongest.length === index) {
999
- lastLongest.length++;
1000
- } else {
1001
- acc.push({ index: index, length: 1 });
1002
- }
1003
- }
1004
- return acc;
1005
- }, []);
1006
- var longestZeroFields = allZeroFields.sort(function (a, b) {
1007
- return b.length - a.length;
1008
- })[0];
1009
- var newHost = void 0;
1010
- if (longestZeroFields && longestZeroFields.length > 1) {
1011
- var newFirst = fields.slice(0, longestZeroFields.index);
1012
- var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
1013
- newHost = newFirst.join(":") + "::" + newLast.join(":");
1014
- } else {
1015
- newHost = fields.join(":");
1016
- }
1017
- if (zone) {
1018
- newHost += "%" + zone;
1019
- }
1020
- return newHost;
1021
- } else {
1022
- return host;
1023
- }
1024
- }
1025
- var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
1026
- var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
1027
- function parse(uriString) {
1028
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1029
-
1030
- var components = {};
1031
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
1032
- if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
1033
- var matches = uriString.match(URI_PARSE);
1034
- if (matches) {
1035
- if (NO_MATCH_IS_UNDEFINED) {
1036
- //store each component
1037
- components.scheme = matches[1];
1038
- components.userinfo = matches[3];
1039
- components.host = matches[4];
1040
- components.port = parseInt(matches[5], 10);
1041
- components.path = matches[6] || "";
1042
- components.query = matches[7];
1043
- components.fragment = matches[8];
1044
- //fix port number
1045
- if (isNaN(components.port)) {
1046
- components.port = matches[5];
1047
- }
1048
- } else {
1049
- //IE FIX for improper RegExp matching
1050
- //store each component
1051
- components.scheme = matches[1] || undefined;
1052
- components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
1053
- components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
1054
- components.port = parseInt(matches[5], 10);
1055
- components.path = matches[6] || "";
1056
- components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
1057
- components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
1058
- //fix port number
1059
- if (isNaN(components.port)) {
1060
- components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
1061
- }
1062
- }
1063
- if (components.host) {
1064
- //normalize IP hosts
1065
- components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
1066
- }
1067
- //determine reference type
1068
- if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
1069
- components.reference = "same-document";
1070
- } else if (components.scheme === undefined) {
1071
- components.reference = "relative";
1072
- } else if (components.fragment === undefined) {
1073
- components.reference = "absolute";
1074
- } else {
1075
- components.reference = "uri";
1076
- }
1077
- //check for reference errors
1078
- if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
1079
- components.error = components.error || "URI is not a " + options.reference + " reference.";
1080
- }
1081
- //find scheme handler
1082
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
1083
- //check if scheme can't handle IRIs
1084
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
1085
- //if host component is a domain name
1086
- if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
1087
- //convert Unicode IDN -> ASCII IDN
1088
- try {
1089
- components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
1090
- } catch (e) {
1091
- components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
1092
- }
1093
- }
1094
- //convert IRI -> URI
1095
- _normalizeComponentEncoding(components, URI_PROTOCOL);
1096
- } else {
1097
- //normalize encodings
1098
- _normalizeComponentEncoding(components, protocol);
1099
- }
1100
- //perform scheme specific parsing
1101
- if (schemeHandler && schemeHandler.parse) {
1102
- schemeHandler.parse(components, options);
1103
- }
1104
- } else {
1105
- components.error = components.error || "URI can not be parsed.";
1106
- }
1107
- return components;
1108
- }
1109
-
1110
- function _recomposeAuthority(components, options) {
1111
- var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
1112
- var uriTokens = [];
1113
- if (components.userinfo !== undefined) {
1114
- uriTokens.push(components.userinfo);
1115
- uriTokens.push("@");
1116
- }
1117
- if (components.host !== undefined) {
1118
- //normalize IP hosts, add brackets and escape zone separator for IPv6
1119
- uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
1120
- return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
1121
- }));
1122
- }
1123
- if (typeof components.port === "number" || typeof components.port === "string") {
1124
- uriTokens.push(":");
1125
- uriTokens.push(String(components.port));
1126
- }
1127
- return uriTokens.length ? uriTokens.join("") : undefined;
1128
- }
1129
-
1130
- var RDS1 = /^\.\.?\//;
1131
- var RDS2 = /^\/\.(\/|$)/;
1132
- var RDS3 = /^\/\.\.(\/|$)/;
1133
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
1134
- function removeDotSegments(input) {
1135
- var output = [];
1136
- while (input.length) {
1137
- if (input.match(RDS1)) {
1138
- input = input.replace(RDS1, "");
1139
- } else if (input.match(RDS2)) {
1140
- input = input.replace(RDS2, "/");
1141
- } else if (input.match(RDS3)) {
1142
- input = input.replace(RDS3, "/");
1143
- output.pop();
1144
- } else if (input === "." || input === "..") {
1145
- input = "";
1146
- } else {
1147
- var im = input.match(RDS5);
1148
- if (im) {
1149
- var s = im[0];
1150
- input = input.slice(s.length);
1151
- output.push(s);
1152
- } else {
1153
- throw new Error("Unexpected dot segment condition");
1154
- }
1155
- }
1156
- }
1157
- return output.join("");
1158
- }
1159
-
1160
- function serialize(components) {
1161
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1162
-
1163
- var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
1164
- var uriTokens = [];
1165
- //find scheme handler
1166
- var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
1167
- //perform scheme specific serialization
1168
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
1169
- if (components.host) {
1170
- //if host component is an IPv6 address
1171
- if (protocol.IPV6ADDRESS.test(components.host)) {}
1172
- //TODO: normalize IPv6 address as per RFC 5952
1173
-
1174
- //if host component is a domain name
1175
- else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
1176
- //convert IDN via punycode
1177
- try {
1178
- components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
1179
- } catch (e) {
1180
- components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
1181
- }
1182
- }
1183
- }
1184
- //normalize encoding
1185
- _normalizeComponentEncoding(components, protocol);
1186
- if (options.reference !== "suffix" && components.scheme) {
1187
- uriTokens.push(components.scheme);
1188
- uriTokens.push(":");
1189
- }
1190
- var authority = _recomposeAuthority(components, options);
1191
- if (authority !== undefined) {
1192
- if (options.reference !== "suffix") {
1193
- uriTokens.push("//");
1194
- }
1195
- uriTokens.push(authority);
1196
- if (components.path && components.path.charAt(0) !== "/") {
1197
- uriTokens.push("/");
1198
- }
1199
- }
1200
- if (components.path !== undefined) {
1201
- var s = components.path;
1202
- if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
1203
- s = removeDotSegments(s);
1204
- }
1205
- if (authority === undefined) {
1206
- s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
1207
- }
1208
- uriTokens.push(s);
1209
- }
1210
- if (components.query !== undefined) {
1211
- uriTokens.push("?");
1212
- uriTokens.push(components.query);
1213
- }
1214
- if (components.fragment !== undefined) {
1215
- uriTokens.push("#");
1216
- uriTokens.push(components.fragment);
1217
- }
1218
- return uriTokens.join(""); //merge tokens into a string
1219
- }
1220
-
1221
- function resolveComponents(base, relative) {
1222
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1223
- var skipNormalization = arguments[3];
1224
-
1225
- var target = {};
1226
- if (!skipNormalization) {
1227
- base = parse(serialize(base, options), options); //normalize base components
1228
- relative = parse(serialize(relative, options), options); //normalize relative components
1229
- }
1230
- options = options || {};
1231
- if (!options.tolerant && relative.scheme) {
1232
- target.scheme = relative.scheme;
1233
- //target.authority = relative.authority;
1234
- target.userinfo = relative.userinfo;
1235
- target.host = relative.host;
1236
- target.port = relative.port;
1237
- target.path = removeDotSegments(relative.path || "");
1238
- target.query = relative.query;
1239
- } else {
1240
- if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
1241
- //target.authority = relative.authority;
1242
- target.userinfo = relative.userinfo;
1243
- target.host = relative.host;
1244
- target.port = relative.port;
1245
- target.path = removeDotSegments(relative.path || "");
1246
- target.query = relative.query;
1247
- } else {
1248
- if (!relative.path) {
1249
- target.path = base.path;
1250
- if (relative.query !== undefined) {
1251
- target.query = relative.query;
1252
- } else {
1253
- target.query = base.query;
1254
- }
1255
- } else {
1256
- if (relative.path.charAt(0) === "/") {
1257
- target.path = removeDotSegments(relative.path);
1258
- } else {
1259
- if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
1260
- target.path = "/" + relative.path;
1261
- } else if (!base.path) {
1262
- target.path = relative.path;
1263
- } else {
1264
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
1265
- }
1266
- target.path = removeDotSegments(target.path);
1267
- }
1268
- target.query = relative.query;
1269
- }
1270
- //target.authority = base.authority;
1271
- target.userinfo = base.userinfo;
1272
- target.host = base.host;
1273
- target.port = base.port;
1274
- }
1275
- target.scheme = base.scheme;
1276
- }
1277
- target.fragment = relative.fragment;
1278
- return target;
1279
- }
1280
-
1281
- function resolve(baseURI, relativeURI, options) {
1282
- var schemelessOptions = assign({ scheme: 'null' }, options);
1283
- return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
1284
- }
1285
-
1286
- function normalize(uri, options) {
1287
- if (typeof uri === "string") {
1288
- uri = serialize(parse(uri, options), options);
1289
- } else if (typeOf(uri) === "object") {
1290
- uri = parse(serialize(uri, options), options);
1291
- }
1292
- return uri;
1293
- }
1294
-
1295
- function equal(uriA, uriB, options) {
1296
- if (typeof uriA === "string") {
1297
- uriA = serialize(parse(uriA, options), options);
1298
- } else if (typeOf(uriA) === "object") {
1299
- uriA = serialize(uriA, options);
1300
- }
1301
- if (typeof uriB === "string") {
1302
- uriB = serialize(parse(uriB, options), options);
1303
- } else if (typeOf(uriB) === "object") {
1304
- uriB = serialize(uriB, options);
1305
- }
1306
- return uriA === uriB;
1307
- }
1308
-
1309
- function escapeComponent(str, options) {
1310
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
1311
- }
1312
-
1313
- function unescapeComponent(str, options) {
1314
- return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
1315
- }
1316
-
1317
- var handler = {
1318
- scheme: "http",
1319
- domainHost: true,
1320
- parse: function parse(components, options) {
1321
- //report missing host
1322
- if (!components.host) {
1323
- components.error = components.error || "HTTP URIs must have a host.";
1324
- }
1325
- return components;
1326
- },
1327
- serialize: function serialize(components, options) {
1328
- var secure = String(components.scheme).toLowerCase() === "https";
1329
- //normalize the default port
1330
- if (components.port === (secure ? 443 : 80) || components.port === "") {
1331
- components.port = undefined;
1332
- }
1333
- //normalize the empty path
1334
- if (!components.path) {
1335
- components.path = "/";
1336
- }
1337
- //NOTE: We do not parse query strings for HTTP URIs
1338
- //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
1339
- //and not the HTTP spec.
1340
- return components;
1341
- }
1342
- };
1343
-
1344
- var handler$1 = {
1345
- scheme: "https",
1346
- domainHost: handler.domainHost,
1347
- parse: handler.parse,
1348
- serialize: handler.serialize
1349
- };
1350
-
1351
- function isSecure(wsComponents) {
1352
- return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
1353
- }
1354
- //RFC 6455
1355
- var handler$2 = {
1356
- scheme: "ws",
1357
- domainHost: true,
1358
- parse: function parse(components, options) {
1359
- var wsComponents = components;
1360
- //indicate if the secure flag is set
1361
- wsComponents.secure = isSecure(wsComponents);
1362
- //construct resouce name
1363
- wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
1364
- wsComponents.path = undefined;
1365
- wsComponents.query = undefined;
1366
- return wsComponents;
1367
- },
1368
- serialize: function serialize(wsComponents, options) {
1369
- //normalize the default port
1370
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
1371
- wsComponents.port = undefined;
1372
- }
1373
- //ensure scheme matches secure flag
1374
- if (typeof wsComponents.secure === 'boolean') {
1375
- wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
1376
- wsComponents.secure = undefined;
1377
- }
1378
- //reconstruct path from resource name
1379
- if (wsComponents.resourceName) {
1380
- var _wsComponents$resourc = wsComponents.resourceName.split('?'),
1381
- _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
1382
- path = _wsComponents$resourc2[0],
1383
- query = _wsComponents$resourc2[1];
1384
-
1385
- wsComponents.path = path && path !== '/' ? path : undefined;
1386
- wsComponents.query = query;
1387
- wsComponents.resourceName = undefined;
1388
- }
1389
- //forbid fragment component
1390
- wsComponents.fragment = undefined;
1391
- return wsComponents;
1392
- }
1393
- };
1394
-
1395
- var handler$3 = {
1396
- scheme: "wss",
1397
- domainHost: handler$2.domainHost,
1398
- parse: handler$2.parse,
1399
- serialize: handler$2.serialize
1400
- };
1401
-
1402
- var O = {};
1403
- var isIRI = true;
1404
- //RFC 3986
1405
- var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
1406
- var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
1407
- var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
1408
- //RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
1409
- //const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
1410
- //const WSP$$ = "[\\x20\\x09]";
1411
- //const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127)
1412
- //const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext
1413
- //const VCHAR$$ = "[\\x21-\\x7E]";
1414
- //const WSP$$ = "[\\x20\\x09]";
1415
- //const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext
1416
- //const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
1417
- //const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
1418
- //const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
1419
- var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
1420
- var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
1421
- var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
1422
- var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
1423
- var UNRESERVED = new RegExp(UNRESERVED$$, "g");
1424
- var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
1425
- var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
1426
- var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
1427
- var NOT_HFVALUE = NOT_HFNAME;
1428
- function decodeUnreserved(str) {
1429
- var decStr = pctDecChars(str);
1430
- return !decStr.match(UNRESERVED) ? str : decStr;
1431
- }
1432
- var handler$4 = {
1433
- scheme: "mailto",
1434
- parse: function parse$$1(components, options) {
1435
- var mailtoComponents = components;
1436
- var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
1437
- mailtoComponents.path = undefined;
1438
- if (mailtoComponents.query) {
1439
- var unknownHeaders = false;
1440
- var headers = {};
1441
- var hfields = mailtoComponents.query.split("&");
1442
- for (var x = 0, xl = hfields.length; x < xl; ++x) {
1443
- var hfield = hfields[x].split("=");
1444
- switch (hfield[0]) {
1445
- case "to":
1446
- var toAddrs = hfield[1].split(",");
1447
- for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
1448
- to.push(toAddrs[_x]);
1449
- }
1450
- break;
1451
- case "subject":
1452
- mailtoComponents.subject = unescapeComponent(hfield[1], options);
1453
- break;
1454
- case "body":
1455
- mailtoComponents.body = unescapeComponent(hfield[1], options);
1456
- break;
1457
- default:
1458
- unknownHeaders = true;
1459
- headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
1460
- break;
1461
- }
1462
- }
1463
- if (unknownHeaders) mailtoComponents.headers = headers;
1464
- }
1465
- mailtoComponents.query = undefined;
1466
- for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
1467
- var addr = to[_x2].split("@");
1468
- addr[0] = unescapeComponent(addr[0]);
1469
- if (!options.unicodeSupport) {
1470
- //convert Unicode IDN -> ASCII IDN
1471
- try {
1472
- addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
1473
- } catch (e) {
1474
- mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
1475
- }
1476
- } else {
1477
- addr[1] = unescapeComponent(addr[1], options).toLowerCase();
1478
- }
1479
- to[_x2] = addr.join("@");
1480
- }
1481
- return mailtoComponents;
1482
- },
1483
- serialize: function serialize$$1(mailtoComponents, options) {
1484
- var components = mailtoComponents;
1485
- var to = toArray(mailtoComponents.to);
1486
- if (to) {
1487
- for (var x = 0, xl = to.length; x < xl; ++x) {
1488
- var toAddr = String(to[x]);
1489
- var atIdx = toAddr.lastIndexOf("@");
1490
- var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
1491
- var domain = toAddr.slice(atIdx + 1);
1492
- //convert IDN via punycode
1493
- try {
1494
- domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
1495
- } catch (e) {
1496
- components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
1497
- }
1498
- to[x] = localPart + "@" + domain;
1499
- }
1500
- components.path = to.join(",");
1501
- }
1502
- var headers = mailtoComponents.headers = mailtoComponents.headers || {};
1503
- if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
1504
- if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
1505
- var fields = [];
1506
- for (var name in headers) {
1507
- if (headers[name] !== O[name]) {
1508
- fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
1509
- }
1510
- }
1511
- if (fields.length) {
1512
- components.query = fields.join("&");
1513
- }
1514
- return components;
1515
- }
1516
- };
1517
-
1518
- var URN_PARSE = /^([^\:]+)\:(.*)/;
1519
- //RFC 2141
1520
- var handler$5 = {
1521
- scheme: "urn",
1522
- parse: function parse$$1(components, options) {
1523
- var matches = components.path && components.path.match(URN_PARSE);
1524
- var urnComponents = components;
1525
- if (matches) {
1526
- var scheme = options.scheme || urnComponents.scheme || "urn";
1527
- var nid = matches[1].toLowerCase();
1528
- var nss = matches[2];
1529
- var urnScheme = scheme + ":" + (options.nid || nid);
1530
- var schemeHandler = SCHEMES[urnScheme];
1531
- urnComponents.nid = nid;
1532
- urnComponents.nss = nss;
1533
- urnComponents.path = undefined;
1534
- if (schemeHandler) {
1535
- urnComponents = schemeHandler.parse(urnComponents, options);
1536
- }
1537
- } else {
1538
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
1539
- }
1540
- return urnComponents;
1541
- },
1542
- serialize: function serialize$$1(urnComponents, options) {
1543
- var scheme = options.scheme || urnComponents.scheme || "urn";
1544
- var nid = urnComponents.nid;
1545
- var urnScheme = scheme + ":" + (options.nid || nid);
1546
- var schemeHandler = SCHEMES[urnScheme];
1547
- if (schemeHandler) {
1548
- urnComponents = schemeHandler.serialize(urnComponents, options);
1549
- }
1550
- var uriComponents = urnComponents;
1551
- var nss = urnComponents.nss;
1552
- uriComponents.path = (nid || options.nid) + ":" + nss;
1553
- return uriComponents;
1554
- }
1555
- };
1556
-
1557
- var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
1558
- //RFC 4122
1559
- var handler$6 = {
1560
- scheme: "urn:uuid",
1561
- parse: function parse(urnComponents, options) {
1562
- var uuidComponents = urnComponents;
1563
- uuidComponents.uuid = uuidComponents.nss;
1564
- uuidComponents.nss = undefined;
1565
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
1566
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
1567
- }
1568
- return uuidComponents;
1569
- },
1570
- serialize: function serialize(uuidComponents, options) {
1571
- var urnComponents = uuidComponents;
1572
- //normalize UUID
1573
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
1574
- return urnComponents;
1575
- }
1576
- };
1577
-
1578
- SCHEMES[handler.scheme] = handler;
1579
- SCHEMES[handler$1.scheme] = handler$1;
1580
- SCHEMES[handler$2.scheme] = handler$2;
1581
- SCHEMES[handler$3.scheme] = handler$3;
1582
- SCHEMES[handler$4.scheme] = handler$4;
1583
- SCHEMES[handler$5.scheme] = handler$5;
1584
- SCHEMES[handler$6.scheme] = handler$6;
1585
-
1586
- exports.SCHEMES = SCHEMES;
1587
- exports.pctEncChar = pctEncChar;
1588
- exports.pctDecChars = pctDecChars;
1589
- exports.parse = parse;
1590
- exports.removeDotSegments = removeDotSegments;
1591
- exports.serialize = serialize;
1592
- exports.resolveComponents = resolveComponents;
1593
- exports.resolve = resolve;
1594
- exports.normalize = normalize;
1595
- exports.equal = equal;
1596
- exports.escapeComponent = escapeComponent;
1597
- exports.unescapeComponent = unescapeComponent;
1598
-
1599
- Object.defineProperty(exports, '__esModule', { value: true });
1600
-
1601
- })));
1602
- //# sourceMappingURL=uri.all.js.map
1603
-
1604
-
1605
- /***/ })
1606
-
1607
- }]);
1608
- //# sourceMappingURL=7796.ea7106c833e81e2e6a6d.js.map?v=ea7106c833e81e2e6a6d