Jamez-s преди 6 години
родител
ревизия
2a3a47e02c
променени са 100 файла, в които са добавени 6333 реда и са изтрити 95 реда
  1. 1
    0
      .classpath
  2. 6
    0
      .idea/vcs.xml
  3. 130
    95
      .idea/workspace.xml
  4. 1
    0
      node_modules/.bin/acorn
  5. 1
    0
      node_modules/.bin/brfs
  6. 1
    0
      node_modules/.bin/cdl
  7. 1
    0
      node_modules/.bin/escodegen
  8. 1
    0
      node_modules/.bin/esgenerate
  9. 1
    0
      node_modules/.bin/esparse
  10. 1
    0
      node_modules/.bin/esvalidate
  11. 1
    0
      node_modules/.bin/geojson-rewind
  12. 1
    0
      node_modules/.bin/js-yaml
  13. 1
    0
      node_modules/.bin/pbf
  14. 1
    0
      node_modules/.bin/quote-stream
  15. 1
    0
      node_modules/.bin/sharkdown
  16. 1
    0
      node_modules/@mapbox/geojson-area/.travis.yml
  17. 10
    0
      node_modules/@mapbox/geojson-area/CHANGELOG.md
  18. 27
    0
      node_modules/@mapbox/geojson-area/LICENSE
  19. 26
    0
      node_modules/@mapbox/geojson-area/README.md
  20. 89
    0
      node_modules/@mapbox/geojson-area/index.js
  21. 67
    0
      node_modules/@mapbox/geojson-area/package.json
  22. 11
    0
      node_modules/@mapbox/geojson-area/test/all.json
  23. 29
    0
      node_modules/@mapbox/geojson-area/test/basic.js
  24. 1311
    0
      node_modules/@mapbox/geojson-area/test/illinois.json
  25. 17
    0
      node_modules/@mapbox/jsonlint-lines-primitives/Makefile
  26. 7
    0
      node_modules/@mapbox/jsonlint-lines-primitives/README.md
  27. 92
    0
      node_modules/@mapbox/jsonlint-lines-primitives/lib/formatter.js
  28. 692
    0
      node_modules/@mapbox/jsonlint-lines-primitives/lib/jsonlint.js
  29. 65
    0
      node_modules/@mapbox/jsonlint-lines-primitives/package.json
  30. 8
    0
      node_modules/@mapbox/jsonlint-lines-primitives/scripts/bundle.js
  31. 24
    0
      node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.l
  32. 110
    0
      node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.y
  33. 210
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/all-tests.js
  34. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/10.json
  35. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/11.json
  36. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/12.json
  37. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/13.json
  38. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/14.json
  39. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/15.json
  40. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/16.json
  41. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/17.json
  42. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/19.json
  43. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/2.json
  44. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/20.json
  45. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/21.json
  46. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/22.json
  47. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/23.json
  48. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/24.json
  49. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/25.json
  50. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/26.json
  51. 2
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/27.json
  52. 2
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/28.json
  53. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/29.json
  54. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/3.json
  55. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/30.json
  56. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/31.json
  57. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/32.json
  58. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/33.json
  59. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/34.json
  60. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/4.json
  61. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/5.json
  62. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/6.json
  63. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/7.json
  64. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/8.json
  65. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/fails/9.json
  66. 58
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/passes/1.json
  67. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/passes/2.json
  68. 6
    0
      node_modules/@mapbox/jsonlint-lines-primitives/test/passes/3.json
  69. 334
    0
      node_modules/@mapbox/jsonlint-lines-primitives/web/json2.js
  70. 59
    0
      node_modules/@mapbox/jsonlint-lines-primitives/web/jsonlint.html
  71. 1
    0
      node_modules/@mapbox/jsonlint-lines-primitives/web/jsonlint.js
  72. 17
    0
      node_modules/@mapbox/mapbox-gl-supported/.eslintrc
  73. 6
    0
      node_modules/@mapbox/mapbox-gl-supported/CONTRIBUTING.md
  74. 30
    0
      node_modules/@mapbox/mapbox-gl-supported/LICENSE.txt
  75. 30
    0
      node_modules/@mapbox/mapbox-gl-supported/README.md
  76. 165
    0
      node_modules/@mapbox/mapbox-gl-supported/diagnostics.html
  77. 48
    0
      node_modules/@mapbox/mapbox-gl-supported/index.html
  78. 156
    0
      node_modules/@mapbox/mapbox-gl-supported/index.js
  79. 51
    0
      node_modules/@mapbox/mapbox-gl-supported/package.json
  80. 8
    0
      node_modules/@mapbox/point-geometry/.travis.yml
  81. 5
    0
      node_modules/@mapbox/point-geometry/HISTORY.md
  82. 13
    0
      node_modules/@mapbox/point-geometry/LICENSE
  83. 364
    0
      node_modules/@mapbox/point-geometry/README.md
  84. 312
    0
      node_modules/@mapbox/point-geometry/index.js
  85. 63
    0
      node_modules/@mapbox/point-geometry/package.json
  86. 139
    0
      node_modules/@mapbox/point-geometry/test.js
  87. 63
    0
      node_modules/@mapbox/shelf-pack/.eslintrc
  88. 10
    0
      node_modules/@mapbox/shelf-pack/.npmignore
  89. 5
    0
      node_modules/@mapbox/shelf-pack/.travis.yml
  90. 41
    0
      node_modules/@mapbox/shelf-pack/CHANGELOG.md
  91. 44
    0
      node_modules/@mapbox/shelf-pack/CODE_OF_CONDUCT.md
  92. 15
    0
      node_modules/@mapbox/shelf-pack/LICENSE.md
  93. 221
    0
      node_modules/@mapbox/shelf-pack/README.md
  94. 447
    0
      node_modules/@mapbox/shelf-pack/index.js
  95. 453
    0
      node_modules/@mapbox/shelf-pack/index.umd.js
  96. 69
    0
      node_modules/@mapbox/shelf-pack/package.json
  97. 2
    0
      node_modules/@mapbox/tiny-sdf/.npmignore
  98. 28
    0
      node_modules/@mapbox/tiny-sdf/README.md
  99. 90
    0
      node_modules/@mapbox/tiny-sdf/debug.html
  100. 0
    0
      node_modules/@mapbox/tiny-sdf/index.html

+ 1
- 0
.classpath Целия файл

@@ -28,5 +28,6 @@
28 28
 			<attribute name="maven.pomderived" value="true"/>
29 29
 		</attributes>
30 30
 	</classpathentry>
31
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
31 32
 	<classpathentry kind="output" path="target/classes"/>
32 33
 </classpath>

+ 6
- 0
.idea/vcs.xml Целия файл

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 130
- 95
.idea/workspace.xml Целия файл

@@ -1,7 +1,22 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4
-    <list default="true" id="46a192f1-c52a-4c0e-9829-ea19bec01413" name="Default" comment="" />
4
+    <list default="true" id="46a192f1-c52a-4c0e-9829-ea19bec01413" name="Default" comment="">
5
+      <change beforePath="$PROJECT_DIR$/.classpath" beforeDir="false" afterPath="$PROJECT_DIR$/.classpath" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/boot/controller/ShipWreckController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/boot/controller/ShipWreckController.java" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/boot/model/Shipwreck.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/boot/model/Shipwreck.java" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.properties" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/target/classes/META-INF/maven/com.boot/das-boot/pom.properties" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/META-INF/maven/com.boot/das-boot/pom.properties" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/target/classes/META-INF/maven/com.boot/das-boot/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/META-INF/maven/com.boot/das-boot/pom.xml" afterDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/target/classes/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application.properties" afterDir="false" />
14
+      <change beforePath="$PROJECT_DIR$/target/classes/com/boot/App.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/boot/App.class" afterDir="false" />
15
+      <change beforePath="$PROJECT_DIR$/target/classes/com/boot/controller/HomeController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/boot/controller/HomeController.class" afterDir="false" />
16
+      <change beforePath="$PROJECT_DIR$/target/classes/com/boot/controller/ShipWreckController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/boot/controller/ShipWreckController.class" afterDir="false" />
17
+      <change beforePath="$PROJECT_DIR$/target/classes/com/boot/controller/ShipwreckStub.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/boot/controller/ShipwreckStub.class" afterDir="false" />
18
+      <change beforePath="$PROJECT_DIR$/target/classes/com/boot/model/Shipwreck.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/boot/model/Shipwreck.class" afterDir="false" />
19
+    </list>
5 20
     <ignored path="$PROJECT_DIR$/out/" />
6 21
     <ignored path="$PROJECT_DIR$/target/" />
7 22
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
@@ -38,72 +53,42 @@
38 53
       <file leaf-file-name="pom.xml" pinned="false" current-in-tab="false">
39 54
         <entry file="file://$PROJECT_DIR$/pom.xml">
40 55
           <provider selected="true" editor-type-id="text-editor">
41
-            <state relative-caret-position="348">
42
-              <caret line="38" column="8" selection-start-line="38" selection-start-column="8" selection-end-line="38" selection-end-column="8" />
56
+            <state relative-caret-position="273">
57
+              <caret line="33" column="21" selection-end-line="58" />
43 58
             </state>
44 59
           </provider>
45 60
         </entry>
46 61
       </file>
47
-      <file leaf-file-name="V2__create_shipwreck.sql" pinned="false" current-in-tab="false">
48
-        <entry file="file://$PROJECT_DIR$/src/main/resources/db/migration/V2__create_shipwreck.sql">
49
-          <provider selected="true" editor-type-id="text-editor">
50
-            <state relative-caret-position="135">
51
-              <caret line="9" column="2" selection-start-line="9" selection-start-column="2" selection-end-line="9" selection-end-column="2" />
52
-            </state>
53
-          </provider>
54
-        </entry>
55
-      </file>
56
-      <file leaf-file-name="App.java" pinned="false" current-in-tab="false">
57
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/App.java">
58
-          <provider selected="true" editor-type-id="text-editor">
59
-            <state relative-caret-position="210">
60
-              <caret line="14" selection-start-line="14" selection-end-line="14" />
61
-              <folding>
62
-                <element signature="imports" expanded="true" />
63
-                <element signature="e#226#227#0" expanded="true" />
64
-                <element signature="e#271#272#0" expanded="true" />
65
-              </folding>
66
-            </state>
67
-          </provider>
68
-        </entry>
69
-      </file>
70
-      <file leaf-file-name="HomeController.java" pinned="false" current-in-tab="false">
71
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/HomeController.java">
62
+      <file leaf-file-name="PersistenceConfiguration.java" pinned="false" current-in-tab="true">
63
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/config/PersistenceConfiguration.java">
72 64
           <provider selected="true" editor-type-id="text-editor">
73
-            <state relative-caret-position="165">
74
-              <caret line="13" selection-start-line="13" selection-end-line="13" />
65
+            <state relative-caret-position="360">
66
+              <caret line="24" selection-start-line="24" selection-end-line="24" />
75 67
               <folding>
76 68
                 <element signature="imports" expanded="true" />
69
+                <element signature="e#288#289#0" expanded="true" />
70
+                <element signature="e#327#328#0" expanded="true" />
71
+                <element signature="e#658#659#0" expanded="true" />
72
+                <element signature="e#688#689#0" expanded="true" />
77 73
               </folding>
78 74
             </state>
79 75
           </provider>
80 76
         </entry>
81 77
       </file>
82
-      <file leaf-file-name="ShipWreckController.java" pinned="false" current-in-tab="false">
83
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/ShipWreckController.java">
78
+      <file leaf-file-name="V2__create_shipwreck.sql" pinned="false" current-in-tab="false">
79
+        <entry file="file://$PROJECT_DIR$/src/main/resources/db/migration/V2__create_shipwreck.sql">
84 80
           <provider selected="true" editor-type-id="text-editor">
85
-            <state relative-caret-position="415">
86
-              <caret line="30" column="45" selection-start-line="30" selection-start-column="45" selection-end-line="30" selection-end-column="45" />
87
-              <folding>
88
-                <element signature="imports" expanded="true" />
89
-                <element signature="e#452#453#0" expanded="true" />
90
-                <element signature="e#486#487#0" expanded="true" />
91
-                <element signature="e#677#678#0" expanded="true" />
92
-                <element signature="e#703#704#0" expanded="true" />
93
-                <element signature="e#643#644#0" expanded="true" />
94
-                <element signature="e#678#679#0" expanded="true" />
95
-                <element signature="e#1010#1011#0" expanded="true" />
96
-                <element signature="e#1048#1049#0" expanded="true" />
97
-              </folding>
81
+            <state relative-caret-position="135">
82
+              <caret line="9" column="2" selection-start-line="9" selection-start-column="2" selection-end-line="9" selection-end-column="2" />
98 83
             </state>
99 84
           </provider>
100 85
         </entry>
101 86
       </file>
102
-      <file leaf-file-name="application.properties" pinned="false" current-in-tab="true">
87
+      <file leaf-file-name="application.properties" pinned="false" current-in-tab="false">
103 88
         <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
104 89
           <provider selected="true" editor-type-id="text-editor">
105
-            <state relative-caret-position="300">
106
-              <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
90
+            <state relative-caret-position="135">
91
+              <caret line="9" column="27" selection-start-line="8" selection-start-column="29" selection-end-line="9" selection-end-column="27" />
107 92
             </state>
108 93
           </provider>
109 94
         </entry>
@@ -129,8 +114,23 @@
129 114
       <file leaf-file-name="Shipwreck.java" pinned="false" current-in-tab="false">
130 115
         <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/model/Shipwreck.java">
131 116
           <provider selected="true" editor-type-id="text-editor">
132
-            <state relative-caret-position="480">
133
-              <caret line="40" selection-start-line="40" selection-end-line="40" />
117
+            <state relative-caret-position="90">
118
+              <caret line="11" column="49" selection-start-line="11" selection-start-column="49" selection-end-line="11" selection-end-column="49" />
119
+              <folding>
120
+                <element signature="imports" expanded="true" />
121
+              </folding>
122
+            </state>
123
+          </provider>
124
+        </entry>
125
+      </file>
126
+      <file leaf-file-name="ShipWreckController.java" pinned="false" current-in-tab="false">
127
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/ShipWreckController.java">
128
+          <provider selected="true" editor-type-id="text-editor">
129
+            <state relative-caret-position="449">
130
+              <caret line="45" selection-start-line="45" selection-end-line="45" />
131
+              <folding>
132
+                <element signature="imports" expanded="true" />
133
+              </folding>
134 134
             </state>
135 135
           </provider>
136 136
         </entry>
@@ -153,6 +153,9 @@
153 153
       </list>
154 154
     </option>
155 155
   </component>
156
+  <component name="Git.Settings">
157
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
158
+  </component>
156 159
   <component name="IdeDocumentHistory">
157 160
     <option name="CHANGED_PATHS">
158 161
       <list>
@@ -164,7 +167,9 @@
164 167
         <option value="$PROJECT_DIR$/src/main/resources/application-test.properties" />
165 168
         <option value="$PROJECT_DIR$/src/main/resources/application-prod.properties" />
166 169
         <option value="$PROJECT_DIR$/src/main/resources/db/migration/V2__create_shipwreck.sql" />
170
+        <option value="$PROJECT_DIR$/src/main/java/com/boot/config/PersistenceConfiguration.java" />
167 171
         <option value="$PROJECT_DIR$/src/main/resources/application.properties" />
172
+        <option value="$PROJECT_DIR$/src/main/java/com/boot/model/Shipwreck.java" />
168 173
       </list>
169 174
     </option>
170 175
   </component>
@@ -191,11 +196,12 @@
191 196
     <packageJsonPaths />
192 197
   </component>
193 198
   <component name="ProjectFrameBounds">
194
-    <option name="x" value="-90" />
195
-    <option name="y" value="23" />
196
-    <option name="width" value="996" />
197
-    <option name="height" value="859" />
199
+    <option name="x" value="2237" />
200
+    <option name="y" value="-198" />
201
+    <option name="width" value="1058" />
202
+    <option name="height" value="990" />
198 203
   </component>
204
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
199 205
   <component name="ProjectView">
200 206
     <navigator proportions="" version="1">
201 207
       <foldersAlwaysOnTop value="true" />
@@ -241,6 +247,15 @@
241 247
               <item name="main" type="462c0819:PsiDirectoryNode" />
242 248
               <item name="java" type="462c0819:PsiDirectoryNode" />
243 249
               <item name="boot" type="462c0819:PsiDirectoryNode" />
250
+              <item name="config" type="462c0819:PsiDirectoryNode" />
251
+            </path>
252
+            <path>
253
+              <item name="dasboot" type="b2602c69:ProjectViewProjectNode" />
254
+              <item name="dasboot" type="462c0819:PsiDirectoryNode" />
255
+              <item name="src" type="462c0819:PsiDirectoryNode" />
256
+              <item name="main" type="462c0819:PsiDirectoryNode" />
257
+              <item name="java" type="462c0819:PsiDirectoryNode" />
258
+              <item name="boot" type="462c0819:PsiDirectoryNode" />
244 259
               <item name="controller" type="462c0819:PsiDirectoryNode" />
245 260
             </path>
246 261
             <path>
@@ -267,6 +282,17 @@
267 282
               <item name="resources" type="462c0819:PsiDirectoryNode" />
268 283
               <item name="migration" type="462c0819:PsiDirectoryNode" />
269 284
             </path>
285
+            <path>
286
+              <item name="dasboot" type="b2602c69:ProjectViewProjectNode" />
287
+              <item name="dasboot" type="462c0819:PsiDirectoryNode" />
288
+              <item name="src" type="462c0819:PsiDirectoryNode" />
289
+              <item name="test" type="462c0819:PsiDirectoryNode" />
290
+            </path>
291
+            <path>
292
+              <item name="dasboot" type="b2602c69:ProjectViewProjectNode" />
293
+              <item name="dasboot" type="462c0819:PsiDirectoryNode" />
294
+              <item name="target" type="462c0819:PsiDirectoryNode" />
295
+            </path>
270 296
           </expand>
271 297
           <select />
272 298
         </subPane>
@@ -402,15 +428,15 @@
402 428
       <option name="presentableId" value="Default" />
403 429
       <updated>1531174323086</updated>
404 430
       <workItem from="1531174324751" duration="1340000" />
405
-      <workItem from="1531176498227" duration="5072000" />
431
+      <workItem from="1531176498227" duration="10334000" />
406 432
     </task>
407 433
     <servers />
408 434
   </component>
409 435
   <component name="TimeTrackingManager">
410
-    <option name="totallyTimeSpent" value="6412000" />
436
+    <option name="totallyTimeSpent" value="11674000" />
411 437
   </component>
412 438
   <component name="ToolWindowManager">
413
-    <frame x="1350" y="-124" width="996" height="859" extended-state="0" />
439
+    <frame x="2237" y="-198" width="1058" height="990" extended-state="0" />
414 440
     <editor active="true" />
415 441
     <layout>
416 442
       <window_info anchor="right" id="Palette" order="3" />
@@ -419,7 +445,7 @@
419 445
       <window_info anchor="bottom" id="Database Changes" order="9" show_stripe_button="false" />
420 446
       <window_info id="Capture Tool" order="4" />
421 447
       <window_info id="Designer" order="2" />
422
-      <window_info anchor="right" id="Database" order="6" sideWeight="0.4993234" visible="true" weight="0.0" />
448
+      <window_info anchor="right" id="Database" order="6" sideWeight="0.49825174" visible="true" weight="0.0" />
423 449
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
424 450
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
425 451
       <window_info id="UI Designer" order="5" />
@@ -430,12 +456,12 @@
430 456
       <window_info id="Image Layers" order="3" />
431 457
       <window_info anchor="bottom" id="Java Enterprise" order="11" />
432 458
       <window_info anchor="right" id="Capture Analysis" order="4" />
433
-      <window_info anchor="bottom" id="Run" order="2" weight="0.40324762" />
434
-      <window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" weight="0.32959327" />
435
-      <window_info anchor="right" id="Coverage" sideWeight="0.5006766" side_tool="true" visible="true" weight="0.0" />
459
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.34252873" />
460
+      <window_info anchor="bottom" id="Version Control" order="7" weight="0.32959327" />
461
+      <window_info anchor="right" id="Coverage" sideWeight="0.50174826" side_tool="true" visible="true" weight="0.0" />
436 462
       <window_info anchor="bottom" id="Spring" order="11" />
437 463
       <window_info anchor="bottom" id="Terminal" order="10" weight="0.3401015" />
438
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.32389936" />
464
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.41535434" />
439 465
       <window_info anchor="right" id="Bean Validation" order="9" />
440 466
       <window_info id="Web" order="7" side_tool="true" />
441 467
       <window_info anchor="bottom" id="Find" order="1" weight="0.3289855" />
@@ -510,73 +536,82 @@
510 536
         </state>
511 537
       </provider>
512 538
     </entry>
513
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/HomeController.java">
539
+    <entry file="file://$PROJECT_DIR$/src/main/resources/application-prod.properties">
514 540
       <provider selected="true" editor-type-id="text-editor">
515
-        <state relative-caret-position="165">
516
-          <caret line="13" selection-start-line="13" selection-end-line="13" />
517
-          <folding>
518
-            <element signature="imports" expanded="true" />
519
-          </folding>
541
+        <state>
542
+          <caret column="14" selection-start-column="14" selection-end-column="14" />
520 543
         </state>
521 544
       </provider>
522 545
     </entry>
523
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/ShipWreckController.java">
546
+    <entry file="file://$PROJECT_DIR$/pom.xml">
524 547
       <provider selected="true" editor-type-id="text-editor">
525
-        <state relative-caret-position="415">
526
-          <caret line="30" column="45" selection-start-line="30" selection-start-column="45" selection-end-line="30" selection-end-column="45" />
548
+        <state relative-caret-position="273">
549
+          <caret line="33" column="21" selection-end-line="58" />
550
+        </state>
551
+      </provider>
552
+    </entry>
553
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/HomeController.java">
554
+      <provider selected="true" editor-type-id="text-editor">
555
+        <state relative-caret-position="165">
556
+          <caret line="13" selection-start-line="13" selection-end-line="13" />
527 557
           <folding>
528 558
             <element signature="imports" expanded="true" />
529
-            <element signature="e#452#453#0" expanded="true" />
530
-            <element signature="e#486#487#0" expanded="true" />
531
-            <element signature="e#677#678#0" expanded="true" />
532
-            <element signature="e#703#704#0" expanded="true" />
533
-            <element signature="e#643#644#0" expanded="true" />
534
-            <element signature="e#678#679#0" expanded="true" />
535
-            <element signature="e#1010#1011#0" expanded="true" />
536
-            <element signature="e#1048#1049#0" expanded="true" />
537 559
           </folding>
538 560
         </state>
539 561
       </provider>
540 562
     </entry>
541
-    <entry file="file://$PROJECT_DIR$/src/main/resources/application-test.properties">
563
+    <entry file="file://$PROJECT_DIR$/src/main/resources/db/migration/V2__create_shipwreck.sql">
542 564
       <provider selected="true" editor-type-id="text-editor">
543
-        <state>
544
-          <caret column="16" selection-start-column="16" selection-end-column="16" />
565
+        <state relative-caret-position="135">
566
+          <caret line="9" column="2" selection-start-line="9" selection-start-column="2" selection-end-line="9" selection-end-column="2" />
545 567
         </state>
546 568
       </provider>
547 569
     </entry>
548
-    <entry file="file://$PROJECT_DIR$/pom.xml">
570
+    <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
549 571
       <provider selected="true" editor-type-id="text-editor">
550
-        <state relative-caret-position="348">
551
-          <caret line="38" column="8" selection-start-line="38" selection-start-column="8" selection-end-line="38" selection-end-column="8" />
572
+        <state relative-caret-position="135">
573
+          <caret line="9" column="27" selection-start-line="8" selection-start-column="29" selection-end-line="9" selection-end-column="27" />
552 574
         </state>
553 575
       </provider>
554 576
     </entry>
555
-    <entry file="file://$PROJECT_DIR$/src/main/resources/application-prod.properties">
577
+    <entry file="file://$PROJECT_DIR$/src/main/resources/application-test.properties">
556 578
       <provider selected="true" editor-type-id="text-editor">
557 579
         <state>
558
-          <caret column="14" selection-start-column="14" selection-end-column="14" />
580
+          <caret column="16" selection-start-column="16" selection-end-column="16" />
559 581
         </state>
560 582
       </provider>
561 583
     </entry>
562 584
     <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/model/Shipwreck.java">
563 585
       <provider selected="true" editor-type-id="text-editor">
564
-        <state relative-caret-position="480">
565
-          <caret line="40" selection-start-line="40" selection-end-line="40" />
586
+        <state relative-caret-position="90">
587
+          <caret line="11" column="49" selection-start-line="11" selection-start-column="49" selection-end-line="11" selection-end-column="49" />
588
+          <folding>
589
+            <element signature="imports" expanded="true" />
590
+          </folding>
566 591
         </state>
567 592
       </provider>
568 593
     </entry>
569
-    <entry file="file://$PROJECT_DIR$/src/main/resources/db/migration/V2__create_shipwreck.sql">
594
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/controller/ShipWreckController.java">
570 595
       <provider selected="true" editor-type-id="text-editor">
571
-        <state relative-caret-position="135">
572
-          <caret line="9" column="2" selection-start-line="9" selection-start-column="2" selection-end-line="9" selection-end-column="2" />
596
+        <state relative-caret-position="449">
597
+          <caret line="45" selection-start-line="45" selection-end-line="45" />
598
+          <folding>
599
+            <element signature="imports" expanded="true" />
600
+          </folding>
573 601
         </state>
574 602
       </provider>
575 603
     </entry>
576
-    <entry file="file://$PROJECT_DIR$/src/main/resources/application.properties">
604
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/boot/config/PersistenceConfiguration.java">
577 605
       <provider selected="true" editor-type-id="text-editor">
578
-        <state relative-caret-position="300">
579
-          <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
606
+        <state relative-caret-position="360">
607
+          <caret line="24" selection-start-line="24" selection-end-line="24" />
608
+          <folding>
609
+            <element signature="imports" expanded="true" />
610
+            <element signature="e#288#289#0" expanded="true" />
611
+            <element signature="e#327#328#0" expanded="true" />
612
+            <element signature="e#658#659#0" expanded="true" />
613
+            <element signature="e#688#689#0" expanded="true" />
614
+          </folding>
580 615
         </state>
581 616
       </provider>
582 617
     </entry>

+ 1
- 0
node_modules/.bin/acorn Целия файл

@@ -0,0 +1 @@
1
+../acorn/bin/acorn

+ 1
- 0
node_modules/.bin/brfs Целия файл

@@ -0,0 +1 @@
1
+../brfs/bin/cmd.js

+ 1
- 0
node_modules/.bin/cdl Целия файл

@@ -0,0 +1 @@
1
+../cardinal/bin/cdl.js

+ 1
- 0
node_modules/.bin/escodegen Целия файл

@@ -0,0 +1 @@
1
+../escodegen/bin/escodegen.js

+ 1
- 0
node_modules/.bin/esgenerate Целия файл

@@ -0,0 +1 @@
1
+../escodegen/bin/esgenerate.js

+ 1
- 0
node_modules/.bin/esparse Целия файл

@@ -0,0 +1 @@
1
+../esprima/bin/esparse.js

+ 1
- 0
node_modules/.bin/esvalidate Целия файл

@@ -0,0 +1 @@
1
+../esprima/bin/esvalidate.js

+ 1
- 0
node_modules/.bin/geojson-rewind Целия файл

@@ -0,0 +1 @@
1
+../geojson-rewind/geojson-rewind

+ 1
- 0
node_modules/.bin/js-yaml Целия файл

@@ -0,0 +1 @@
1
+../js-yaml/bin/js-yaml.js

+ 1
- 0
node_modules/.bin/pbf Целия файл

@@ -0,0 +1 @@
1
+../pbf/bin/pbf

+ 1
- 0
node_modules/.bin/quote-stream Целия файл

@@ -0,0 +1 @@
1
+../quote-stream/bin/cmd.js

+ 1
- 0
node_modules/.bin/sharkdown Целия файл

@@ -0,0 +1 @@
1
+../sharkdown/sharkdown

+ 1
- 0
node_modules/@mapbox/geojson-area/.travis.yml Целия файл

@@ -0,0 +1 @@
1
+language: node_js

+ 10
- 0
node_modules/@mapbox/geojson-area/CHANGELOG.md Целия файл

@@ -0,0 +1,10 @@
1
+<a name="0.2.2"></a>
2
+## [0.2.2](https://github.com/mapbox/geojson-area/compare/v0.2.1...v0.2.2) (2016-12-19)
3
+
4
+
5
+### Bug Fixes
6
+
7
+* **algorithm:** Avoid accidental global i, fixes use strict ([1646944](https://github.com/mapbox/geojson-area/commit/1646944))
8
+
9
+
10
+

+ 27
- 0
node_modules/@mapbox/geojson-area/LICENSE Целия файл

@@ -0,0 +1,27 @@
1
+Copyright 2005-2013 OpenLayers Contributors. All rights reserved. See
2
+authors.txt for full list.
3
+
4
+Redistribution and use in source and binary forms, with or without modification,
5
+are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this
8
+list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright notice,
11
+this list of conditions and the following disclaimer in the documentation and/or
12
+other materials provided with the distribution.
13
+
14
+THIS SOFTWARE IS PROVIDED BY OPENLAYERS CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
15
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
17
+SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+
25
+The views and conclusions contained in the software and documentation are those
26
+of the authors and should not be interpreted as representing official policies,
27
+either expressed or implied, of OpenLayers Contributors.

+ 26
- 0
node_modules/@mapbox/geojson-area/README.md Целия файл

@@ -0,0 +1,26 @@
1
+[![Build Status](https://travis-ci.org/mapbox/geojson-area.png)](https://travis-ci.org/mapbox/geojson-area)
2
+
3
+# geojson-area
4
+
5
+Calculate the area inside of any [GeoJSON](http://geojson.org/) geometry.
6
+
7
+## usage
8
+
9
+    npm install @mapbox/geojson-area
10
+
11
+## example
12
+
13
+```js
14
+var geojsonArea = require('@mapbox/geojson-area');
15
+
16
+var area = geojsonArea.geometry(obj);
17
+```
18
+
19
+## api
20
+
21
+### `geojsonArea.geometry(obj)`
22
+
23
+Given a Geometry object, return contained
24
+area as square meters. Invalid input will return `null`.
25
+
26
+Adapted from [OpenLayers](http://openlayers.org/)

+ 89
- 0
node_modules/@mapbox/geojson-area/index.js Целия файл

@@ -0,0 +1,89 @@
1
+var wgs84 = require('wgs84');
2
+
3
+module.exports.geometry = geometry;
4
+module.exports.ring = ringArea;
5
+
6
+function geometry(_) {
7
+    var area = 0, i;
8
+    switch (_.type) {
9
+        case 'Polygon':
10
+            return polygonArea(_.coordinates);
11
+        case 'MultiPolygon':
12
+            for (i = 0; i < _.coordinates.length; i++) {
13
+                area += polygonArea(_.coordinates[i]);
14
+            }
15
+            return area;
16
+        case 'Point':
17
+        case 'MultiPoint':
18
+        case 'LineString':
19
+        case 'MultiLineString':
20
+            return 0;
21
+        case 'GeometryCollection':
22
+            for (i = 0; i < _.geometries.length; i++) {
23
+                area += geometry(_.geometries[i]);
24
+            }
25
+            return area;
26
+    }
27
+}
28
+
29
+function polygonArea(coords) {
30
+    var area = 0;
31
+    if (coords && coords.length > 0) {
32
+        area += Math.abs(ringArea(coords[0]));
33
+        for (var i = 1; i < coords.length; i++) {
34
+            area -= Math.abs(ringArea(coords[i]));
35
+        }
36
+    }
37
+    return area;
38
+}
39
+
40
+/**
41
+ * Calculate the approximate area of the polygon were it projected onto
42
+ *     the earth.  Note that this area will be positive if ring is oriented
43
+ *     clockwise, otherwise it will be negative.
44
+ *
45
+ * Reference:
46
+ * Robert. G. Chamberlain and William H. Duquette, "Some Algorithms for
47
+ *     Polygons on a Sphere", JPL Publication 07-03, Jet Propulsion
48
+ *     Laboratory, Pasadena, CA, June 2007 http://trs-new.jpl.nasa.gov/dspace/handle/2014/40409
49
+ *
50
+ * Returns:
51
+ * {float} The approximate signed geodesic area of the polygon in square
52
+ *     meters.
53
+ */
54
+
55
+function ringArea(coords) {
56
+    var p1, p2, p3, lowerIndex, middleIndex, upperIndex, i,
57
+    area = 0,
58
+    coordsLength = coords.length;
59
+
60
+    if (coordsLength > 2) {
61
+        for (i = 0; i < coordsLength; i++) {
62
+            if (i === coordsLength - 2) {// i = N-2
63
+                lowerIndex = coordsLength - 2;
64
+                middleIndex = coordsLength -1;
65
+                upperIndex = 0;
66
+            } else if (i === coordsLength - 1) {// i = N-1
67
+                lowerIndex = coordsLength - 1;
68
+                middleIndex = 0;
69
+                upperIndex = 1;
70
+            } else { // i = 0 to N-3
71
+                lowerIndex = i;
72
+                middleIndex = i+1;
73
+                upperIndex = i+2;
74
+            }
75
+            p1 = coords[lowerIndex];
76
+            p2 = coords[middleIndex];
77
+            p3 = coords[upperIndex];
78
+            area += ( rad(p3[0]) - rad(p1[0]) ) * Math.sin( rad(p2[1]));
79
+        }
80
+
81
+        area = area * wgs84.RADIUS * wgs84.RADIUS / 2;
82
+    }
83
+
84
+    return area;
85
+}
86
+
87
+function rad(_) {
88
+    return _ * Math.PI / 180;
89
+}

+ 67
- 0
node_modules/@mapbox/geojson-area/package.json Целия файл

@@ -0,0 +1,67 @@
1
+{
2
+  "_from": "@mapbox/geojson-area@0.2.2",
3
+  "_id": "@mapbox/geojson-area@0.2.2",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-GNeBSqNr8j+7zDefjiaiKSfevxA=",
6
+  "_location": "/@mapbox/geojson-area",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "version",
10
+    "registry": true,
11
+    "raw": "@mapbox/geojson-area@0.2.2",
12
+    "name": "@mapbox/geojson-area",
13
+    "escapedName": "@mapbox%2fgeojson-area",
14
+    "scope": "@mapbox",
15
+    "rawSpec": "0.2.2",
16
+    "saveSpec": null,
17
+    "fetchSpec": "0.2.2"
18
+  },
19
+  "_requiredBy": [
20
+    "/geojson-rewind"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz",
23
+  "_shasum": "18d7814aa36bf23fbbcc379f8e26a22927debf10",
24
+  "_spec": "@mapbox/geojson-area@0.2.2",
25
+  "_where": "/Users/jamess/Labs/dasboot/node_modules/geojson-rewind",
26
+  "author": {
27
+    "name": "Tom MacWright"
28
+  },
29
+  "bugs": {
30
+    "url": "https://github.com/mapbox/geojson-area/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "config": {
34
+    "commitizen": {
35
+      "path": "./node_modules/cz-conventional-changelog"
36
+    }
37
+  },
38
+  "dependencies": {
39
+    "wgs84": "0.0.0"
40
+  },
41
+  "deprecated": false,
42
+  "description": "calculate the physical area of a geojson geometry",
43
+  "devDependencies": {
44
+    "cz-conventional-changelog": "^1.2.0",
45
+    "tape": "^3.0.3"
46
+  },
47
+  "directories": {
48
+    "test": "test"
49
+  },
50
+  "homepage": "https://github.com/mapbox/geojson-area#readme",
51
+  "keywords": [
52
+    "geojson",
53
+    "area",
54
+    "geodesy"
55
+  ],
56
+  "license": "BSD-2-Clause",
57
+  "main": "index.js",
58
+  "name": "@mapbox/geojson-area",
59
+  "repository": {
60
+    "type": "git",
61
+    "url": "git+ssh://git@github.com/mapbox/geojson-area.git"
62
+  },
63
+  "scripts": {
64
+    "test": "tape test/basic.js"
65
+  },
66
+  "version": "0.2.2"
67
+}

+ 11
- 0
node_modules/@mapbox/geojson-area/test/all.json Целия файл

@@ -0,0 +1,11 @@
1
+{
2
+  "type": "Polygon",
3
+  "coordinates": [[
4
+      [-180, -90],
5
+      [-180, 90],
6
+      [180, 90],
7
+      [180, -90],
8
+      [-180, -90]
9
+    ]
10
+  ]
11
+}

+ 29
- 0
node_modules/@mapbox/geojson-area/test/basic.js Целия файл

@@ -0,0 +1,29 @@
1
+var gjArea = require('../'),
2
+    test = require('tape'),
3
+    ill = require('./illinois.json'),
4
+    all = require('./all.json');
5
+
6
+test('geojson area', function(t) {
7
+    t.test('computes the area of illinois', function(t) {
8
+        t.equal(gjArea.geometry(ill), 145978332359.36746);
9
+        t.end();
10
+    });
11
+    // http://www.wolframalpha.com/input/?i=surface+area+of+earth
12
+    t.test('computes the area of the world', function(t) {
13
+        t.equal(gjArea.geometry(all), 511207893395811.06);
14
+        t.end();
15
+    });
16
+    t.test('point has zero area', function(t) {
17
+        t.equal(gjArea.geometry({ type: 'Point', coordinates: [0,0] }), 0);
18
+        t.end();
19
+    });
20
+    t.test('linestring has zero area', function(t) {
21
+        t.equal(gjArea.geometry({ type: 'LineString', coordinates: [[0,0],[1,1]] }), 0);
22
+        t.end();
23
+    });
24
+    t.test('geometrycollection is the sum', function(t) {
25
+        t.equal(gjArea.geometry({ type: 'GeometryCollection', geometries: [all, ill] }), 511353871728170.44);
26
+        t.end();
27
+    });
28
+    t.end();
29
+});

+ 1311
- 0
node_modules/@mapbox/geojson-area/test/illinois.json
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 17
- 0
node_modules/@mapbox/jsonlint-lines-primitives/Makefile Целия файл

@@ -0,0 +1,17 @@
1
+
2
+all: build test site
3
+
4
+build:
5
+	./node_modules/jison/lib/cli.js src/jsonlint.y src/jsonlint.l
6
+	mv jsonlint.js lib/jsonlint.js
7
+	node scripts/bundle.js | ./node_modules/uglify-js/bin/uglifyjs > web/jsonlint.js
8
+
9
+site:
10
+	cp web/jsonlint.js ../jsonlint-pages/jsonlint.js
11
+
12
+deploy: site
13
+	cd ../jsonlint-pages && git commit -a -m 'deploy site updates' && git push origin gh-pages
14
+
15
+test: lib/jsonlint.js test/all-tests.js
16
+	node test/all-tests.js
17
+

+ 7
- 0
node_modules/@mapbox/jsonlint-lines-primitives/README.md Целия файл

@@ -0,0 +1,7 @@
1
+JSON Lint
2
+=========
3
+
4
+A fork of the `lines-primitive` branch of [tmcw/jsonlint](https://github.com/tmcw/jsonlint), which is a fork of [zaach/jsonlint](https://github.com/zaach/jsonlint) that adds line number annotations to the parsed JSON.
5
+
6
+This fork is used by Mapbox GL JS, specifically for providing helpful error messages when validating Mapbox GL style JSON documents.
7
+

+ 92
- 0
node_modules/@mapbox/jsonlint-lines-primitives/lib/formatter.js Целия файл

@@ -0,0 +1,92 @@
1
+#!/usr/bin/env node
2
+
3
+/**
4
+ * Manual formatter taken straight from https://github.com/umbrae/jsonlintdotcom
5
+**/
6
+
7
+/*jslint white: true, devel: true, onevar: true, browser: true, undef: true, nomen: true, regexp: true, plusplus: false, bitwise: true, newcap: true, maxerr: 50, indent: 4 */
8
+
9
+/**
10
+ * jsl.format - Provide json reformatting in a character-by-character approach, so that even invalid JSON may be reformatted (to the best of its ability).
11
+ *
12
+**/
13
+var formatter = (function () {
14
+
15
+    function repeat(s, count) {
16
+        return new Array(count + 1).join(s);
17
+    }
18
+
19
+    function formatJson(json, indentChars) {
20
+        var i           = 0,
21
+            il          = 0,
22
+            tab         = (typeof indentChars !== "undefined") ? indentChars : "    ",
23
+            newJson     = "",
24
+            indentLevel = 0,
25
+            inString    = false,
26
+            currentChar = null;
27
+
28
+        for (i = 0, il = json.length; i < il; i += 1) { 
29
+            currentChar = json.charAt(i);
30
+
31
+            switch (currentChar) {
32
+            case '{': 
33
+            case '[': 
34
+                if (!inString) { 
35
+                    newJson += currentChar + "\n" + repeat(tab, indentLevel + 1);
36
+                    indentLevel += 1; 
37
+                } else { 
38
+                    newJson += currentChar; 
39
+                }
40
+                break; 
41
+            case '}': 
42
+            case ']': 
43
+                if (!inString) { 
44
+                    indentLevel -= 1; 
45
+                    newJson += "\n" + repeat(tab, indentLevel) + currentChar; 
46
+                } else { 
47
+                    newJson += currentChar; 
48
+                } 
49
+                break; 
50
+            case ',': 
51
+                if (!inString) { 
52
+                    newJson += ",\n" + repeat(tab, indentLevel); 
53
+                } else { 
54
+                    newJson += currentChar; 
55
+                } 
56
+                break; 
57
+            case ':': 
58
+                if (!inString) { 
59
+                    newJson += ": "; 
60
+                } else { 
61
+                    newJson += currentChar; 
62
+                } 
63
+                break; 
64
+            case ' ':
65
+            case "\n":
66
+            case "\t":
67
+                if (inString) {
68
+                    newJson += currentChar;
69
+                }
70
+                break;
71
+            case '"': 
72
+                if (i > 0 && json.charAt(i - 1) !== '\\') {
73
+                    inString = !inString; 
74
+                }
75
+                newJson += currentChar; 
76
+                break;
77
+            default: 
78
+                newJson += currentChar; 
79
+                break;                    
80
+            } 
81
+        } 
82
+
83
+        return newJson; 
84
+    }
85
+
86
+    return { "formatJson": formatJson };
87
+
88
+}());
89
+
90
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
91
+  exports.formatter = formatter;
92
+}

+ 692
- 0
node_modules/@mapbox/jsonlint-lines-primitives/lib/jsonlint.js Целия файл

@@ -0,0 +1,692 @@
1
+/* parser generated by jison 0.4.15 */
2
+/*
3
+  Returns a Parser object of the following structure:
4
+
5
+  Parser: {
6
+    yy: {}
7
+  }
8
+
9
+  Parser.prototype: {
10
+    yy: {},
11
+    trace: function(),
12
+    symbols_: {associative list: name ==> number},
13
+    terminals_: {associative list: number ==> name},
14
+    productions_: [...],
15
+    performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
16
+    table: [...],
17
+    defaultActions: {...},
18
+    parseError: function(str, hash),
19
+    parse: function(input),
20
+
21
+    lexer: {
22
+        EOF: 1,
23
+        parseError: function(str, hash),
24
+        setInput: function(input),
25
+        input: function(),
26
+        unput: function(str),
27
+        more: function(),
28
+        less: function(n),
29
+        pastInput: function(),
30
+        upcomingInput: function(),
31
+        showPosition: function(),
32
+        test_match: function(regex_match_array, rule_index),
33
+        next: function(),
34
+        lex: function(),
35
+        begin: function(condition),
36
+        popState: function(),
37
+        _currentRules: function(),
38
+        topState: function(),
39
+        pushState: function(condition),
40
+
41
+        options: {
42
+            ranges: boolean           (optional: true ==> token location info will include a .range[] member)
43
+            flex: boolean             (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
44
+            backtrack_lexer: boolean  (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
45
+        },
46
+
47
+        performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
48
+        rules: [...],
49
+        conditions: {associative list: name ==> set},
50
+    }
51
+  }
52
+
53
+
54
+  token location info (@$, _$, etc.): {
55
+    first_line: n,
56
+    last_line: n,
57
+    first_column: n,
58
+    last_column: n,
59
+    range: [start_number, end_number]       (where the numbers are indexes into the input string, regular zero-based)
60
+  }
61
+
62
+
63
+  the parseError function receives a 'hash' object with these members for lexer and parser errors: {
64
+    text:        (matched text)
65
+    token:       (the produced terminal token, if any)
66
+    line:        (yylineno)
67
+  }
68
+  while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
69
+    loc:         (yylloc)
70
+    expected:    (string describing the set of expected tokens)
71
+    recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
72
+  }
73
+*/
74
+var parser = (function(){
75
+var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,12],$V1=[1,13],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,14],$V6=[1,15],$V7=[14,18,22,24],$V8=[18,22],$V9=[22,24];
76
+var parser = {trace: function trace() { },
77
+yy: {},
78
+symbols_: {"error":2,"JSONString":3,"STRING":4,"JSONNumber":5,"NUMBER":6,"JSONNullLiteral":7,"NULL":8,"JSONBooleanLiteral":9,"TRUE":10,"FALSE":11,"JSONText":12,"JSONValue":13,"EOF":14,"JSONObject":15,"JSONArray":16,"{":17,"}":18,"JSONMemberList":19,"JSONMember":20,":":21,",":22,"[":23,"]":24,"JSONElementList":25,"$accept":0,"$end":1},
79
+terminals_: {2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},
80
+productions_: [0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],
81
+performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
82
+/* this == yyval */
83
+
84
+var $0 = $$.length - 1;
85
+switch (yystate) {
86
+case 1:
87
+ // replace escaped characters with actual character
88
+          this.$ = new String(yytext.replace(/\\(\\|")/g, "$"+"1")
89
+                     .replace(/\\n/g,'\n')
90
+                     .replace(/\\r/g,'\r')
91
+                     .replace(/\\t/g,'\t')
92
+                     .replace(/\\v/g,'\v')
93
+                     .replace(/\\f/g,'\f')
94
+                     .replace(/\\b/g,'\b'));
95
+          this.$.__line__ =  this._$.first_line;
96
+        
97
+break;
98
+case 2:
99
+
100
+            this.$ = new Number(yytext);
101
+            this.$.__line__ =  this._$.first_line;
102
+        
103
+break;
104
+case 3:
105
+
106
+            this.$ = null;
107
+        
108
+break;
109
+case 4:
110
+
111
+            this.$ = new Boolean(true);
112
+            this.$.__line__ = this._$.first_line;
113
+        
114
+break;
115
+case 5:
116
+
117
+            this.$ = new Boolean(false);
118
+            this.$.__line__ = this._$.first_line;
119
+        
120
+break;
121
+case 6:
122
+return this.$ = $$[$0-1];
123
+break;
124
+case 13:
125
+this.$ = {}; Object.defineProperty(this.$, '__line__', {
126
+            value: this._$.first_line,
127
+            enumerable: false
128
+        })
129
+break;
130
+case 14: case 19:
131
+this.$ = $$[$0-1]; Object.defineProperty(this.$, '__line__', {
132
+            value: this._$.first_line,
133
+            enumerable: false
134
+        })
135
+break;
136
+case 15:
137
+this.$ = [$$[$0-2], $$[$0]];
138
+break;
139
+case 16:
140
+this.$ = {}; this.$[$$[$0][0]] = $$[$0][1];
141
+break;
142
+case 17:
143
+this.$ = $$[$0-2]; $$[$0-2][$$[$0][0]] = $$[$0][1];
144
+break;
145
+case 18:
146
+this.$ = []; Object.defineProperty(this.$, '__line__', {
147
+            value: this._$.first_line,
148
+            enumerable: false
149
+        })
150
+break;
151
+case 20:
152
+this.$ = [$$[$0]];
153
+break;
154
+case 21:
155
+this.$ = $$[$0-2]; $$[$0-2].push($$[$0]);
156
+break;
157
+}
158
+},
159
+table: [{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,12:1,13:2,15:7,16:8,17:$V5,23:$V6},{1:[3]},{14:[1,16]},o($V7,[2,7]),o($V7,[2,8]),o($V7,[2,9]),o($V7,[2,10]),o($V7,[2,11]),o($V7,[2,12]),o($V7,[2,3]),o($V7,[2,4]),o($V7,[2,5]),o([14,18,21,22,24],[2,1]),o($V7,[2,2]),{3:20,4:$V0,18:[1,17],19:18,20:19},{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,13:23,15:7,16:8,17:$V5,23:$V6,24:[1,21],25:22},{1:[2,6]},o($V7,[2,13]),{18:[1,24],22:[1,25]},o($V8,[2,16]),{21:[1,26]},o($V7,[2,18]),{22:[1,28],24:[1,27]},o($V9,[2,20]),o($V7,[2,14]),{3:20,4:$V0,20:29},{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,13:30,15:7,16:8,17:$V5,23:$V6},o($V7,[2,19]),{3:5,4:$V0,5:6,6:$V1,7:3,8:$V2,9:4,10:$V3,11:$V4,13:31,15:7,16:8,17:$V5,23:$V6},o($V8,[2,17]),o($V8,[2,15]),o($V9,[2,21])],
160
+defaultActions: {16:[2,6]},
161
+parseError: function parseError(str, hash) {
162
+    if (hash.recoverable) {
163
+        this.trace(str);
164
+    } else {
165
+        throw new Error(str);
166
+    }
167
+},
168
+parse: function parse(input) {
169
+    var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
170
+    var args = lstack.slice.call(arguments, 1);
171
+    var lexer = Object.create(this.lexer);
172
+    var sharedState = { yy: {} };
173
+    for (var k in this.yy) {
174
+        if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
175
+            sharedState.yy[k] = this.yy[k];
176
+        }
177
+    }
178
+    lexer.setInput(input, sharedState.yy);
179
+    sharedState.yy.lexer = lexer;
180
+    sharedState.yy.parser = this;
181
+    if (typeof lexer.yylloc == 'undefined') {
182
+        lexer.yylloc = {};
183
+    }
184
+    var yyloc = lexer.yylloc;
185
+    lstack.push(yyloc);
186
+    var ranges = lexer.options && lexer.options.ranges;
187
+    if (typeof sharedState.yy.parseError === 'function') {
188
+        this.parseError = sharedState.yy.parseError;
189
+    } else {
190
+        this.parseError = Object.getPrototypeOf(this).parseError;
191
+    }
192
+    function popStack(n) {
193
+        stack.length = stack.length - 2 * n;
194
+        vstack.length = vstack.length - n;
195
+        lstack.length = lstack.length - n;
196
+    }
197
+    _token_stack:
198
+        function lex() {
199
+            var token;
200
+            token = lexer.lex() || EOF;
201
+            if (typeof token !== 'number') {
202
+                token = self.symbols_[token] || token;
203
+            }
204
+            return token;
205
+        }
206
+    var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
207
+    while (true) {
208
+        state = stack[stack.length - 1];
209
+        if (this.defaultActions[state]) {
210
+            action = this.defaultActions[state];
211
+        } else {
212
+            if (symbol === null || typeof symbol == 'undefined') {
213
+                symbol = lex();
214
+            }
215
+            action = table[state] && table[state][symbol];
216
+        }
217
+                    if (typeof action === 'undefined' || !action.length || !action[0]) {
218
+                var errStr = '';
219
+                expected = [];
220
+                for (p in table[state]) {
221
+                    if (this.terminals_[p] && p > TERROR) {
222
+                        expected.push('\'' + this.terminals_[p] + '\'');
223
+                    }
224
+                }
225
+                if (lexer.showPosition) {
226
+                    errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
227
+                } else {
228
+                    errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
229
+                }
230
+                this.parseError(errStr, {
231
+                    text: lexer.match,
232
+                    token: this.terminals_[symbol] || symbol,
233
+                    line: lexer.yylineno,
234
+                    loc: yyloc,
235
+                    expected: expected
236
+                });
237
+            }
238
+        if (action[0] instanceof Array && action.length > 1) {
239
+            throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
240
+        }
241
+        switch (action[0]) {
242
+        case 1:
243
+            stack.push(symbol);
244
+            vstack.push(lexer.yytext);
245
+            lstack.push(lexer.yylloc);
246
+            stack.push(action[1]);
247
+            symbol = null;
248
+            if (!preErrorSymbol) {
249
+                yyleng = lexer.yyleng;
250
+                yytext = lexer.yytext;
251
+                yylineno = lexer.yylineno;
252
+                yyloc = lexer.yylloc;
253
+                if (recovering > 0) {
254
+                    recovering--;
255
+                }
256
+            } else {
257
+                symbol = preErrorSymbol;
258
+                preErrorSymbol = null;
259
+            }
260
+            break;
261
+        case 2:
262
+            len = this.productions_[action[1]][1];
263
+            yyval.$ = vstack[vstack.length - len];
264
+            yyval._$ = {
265
+                first_line: lstack[lstack.length - (len || 1)].first_line,
266
+                last_line: lstack[lstack.length - 1].last_line,
267
+                first_column: lstack[lstack.length - (len || 1)].first_column,
268
+                last_column: lstack[lstack.length - 1].last_column
269
+            };
270
+            if (ranges) {
271
+                yyval._$.range = [
272
+                    lstack[lstack.length - (len || 1)].range[0],
273
+                    lstack[lstack.length - 1].range[1]
274
+                ];
275
+            }
276
+            r = this.performAction.apply(yyval, [
277
+                yytext,
278
+                yyleng,
279
+                yylineno,
280
+                sharedState.yy,
281
+                action[1],
282
+                vstack,
283
+                lstack
284
+            ].concat(args));
285
+            if (typeof r !== 'undefined') {
286
+                return r;
287
+            }
288
+            if (len) {
289
+                stack = stack.slice(0, -1 * len * 2);
290
+                vstack = vstack.slice(0, -1 * len);
291
+                lstack = lstack.slice(0, -1 * len);
292
+            }
293
+            stack.push(this.productions_[action[1]][0]);
294
+            vstack.push(yyval.$);
295
+            lstack.push(yyval._$);
296
+            newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
297
+            stack.push(newState);
298
+            break;
299
+        case 3:
300
+            return true;
301
+        }
302
+    }
303
+    return true;
304
+}};
305
+/* generated by jison-lex 0.3.4 */
306
+var lexer = (function(){
307
+var lexer = ({
308
+
309
+EOF:1,
310
+
311
+parseError:function parseError(str, hash) {
312
+        if (this.yy.parser) {
313
+            this.yy.parser.parseError(str, hash);
314
+        } else {
315
+            throw new Error(str);
316
+        }
317
+    },
318
+
319
+// resets the lexer, sets new input
320
+setInput:function (input, yy) {
321
+        this.yy = yy || this.yy || {};
322
+        this._input = input;
323
+        this._more = this._backtrack = this.done = false;
324
+        this.yylineno = this.yyleng = 0;
325
+        this.yytext = this.matched = this.match = '';
326
+        this.conditionStack = ['INITIAL'];
327
+        this.yylloc = {
328
+            first_line: 1,
329
+            first_column: 0,
330
+            last_line: 1,
331
+            last_column: 0
332
+        };
333
+        if (this.options.ranges) {
334
+            this.yylloc.range = [0,0];
335
+        }
336
+        this.offset = 0;
337
+        return this;
338
+    },
339
+
340
+// consumes and returns one char from the input
341
+input:function () {
342
+        var ch = this._input[0];
343
+        this.yytext += ch;
344
+        this.yyleng++;
345
+        this.offset++;
346
+        this.match += ch;
347
+        this.matched += ch;
348
+        var lines = ch.match(/(?:\r\n?|\n).*/g);
349
+        if (lines) {
350
+            this.yylineno++;
351
+            this.yylloc.last_line++;
352
+        } else {
353
+            this.yylloc.last_column++;
354
+        }
355
+        if (this.options.ranges) {
356
+            this.yylloc.range[1]++;
357
+        }
358
+
359
+        this._input = this._input.slice(1);
360
+        return ch;
361
+    },
362
+
363
+// unshifts one char (or a string) into the input
364
+unput:function (ch) {
365
+        var len = ch.length;
366
+        var lines = ch.split(/(?:\r\n?|\n)/g);
367
+
368
+        this._input = ch + this._input;
369
+        this.yytext = this.yytext.substr(0, this.yytext.length - len);
370
+        //this.yyleng -= len;
371
+        this.offset -= len;
372
+        var oldLines = this.match.split(/(?:\r\n?|\n)/g);
373
+        this.match = this.match.substr(0, this.match.length - 1);
374
+        this.matched = this.matched.substr(0, this.matched.length - 1);
375
+
376
+        if (lines.length - 1) {
377
+            this.yylineno -= lines.length - 1;
378
+        }
379
+        var r = this.yylloc.range;
380
+
381
+        this.yylloc = {
382
+            first_line: this.yylloc.first_line,
383
+            last_line: this.yylineno + 1,
384
+            first_column: this.yylloc.first_column,
385
+            last_column: lines ?
386
+                (lines.length === oldLines.length ? this.yylloc.first_column : 0)
387
+                 + oldLines[oldLines.length - lines.length].length - lines[0].length :
388
+              this.yylloc.first_column - len
389
+        };
390
+
391
+        if (this.options.ranges) {
392
+            this.yylloc.range = [r[0], r[0] + this.yyleng - len];
393
+        }
394
+        this.yyleng = this.yytext.length;
395
+        return this;
396
+    },
397
+
398
+// When called from action, caches matched text and appends it on next action
399
+more:function () {
400
+        this._more = true;
401
+        return this;
402
+    },
403
+
404
+// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
405
+reject:function () {
406
+        if (this.options.backtrack_lexer) {
407
+            this._backtrack = true;
408
+        } else {
409
+            return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
410
+                text: "",
411
+                token: null,
412
+                line: this.yylineno
413
+            });
414
+
415
+        }
416
+        return this;
417
+    },
418
+
419
+// retain first n characters of the match
420
+less:function (n) {
421
+        this.unput(this.match.slice(n));
422
+    },
423
+
424
+// displays already matched input, i.e. for error messages
425
+pastInput:function () {
426
+        var past = this.matched.substr(0, this.matched.length - this.match.length);
427
+        return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
428
+    },
429
+
430
+// displays upcoming input, i.e. for error messages
431
+upcomingInput:function () {
432
+        var next = this.match;
433
+        if (next.length < 20) {
434
+            next += this._input.substr(0, 20-next.length);
435
+        }
436
+        return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
437
+    },
438
+
439
+// displays the character position where the lexing error occurred, i.e. for error messages
440
+showPosition:function () {
441
+        var pre = this.pastInput();
442
+        var c = new Array(pre.length + 1).join("-");
443
+        return pre + this.upcomingInput() + "\n" + c + "^";
444
+    },
445
+
446
+// test the lexed token: return FALSE when not a match, otherwise return token
447
+test_match:function (match, indexed_rule) {
448
+        var token,
449
+            lines,
450
+            backup;
451
+
452
+        if (this.options.backtrack_lexer) {
453
+            // save context
454
+            backup = {
455
+                yylineno: this.yylineno,
456
+                yylloc: {
457
+                    first_line: this.yylloc.first_line,
458
+                    last_line: this.last_line,
459
+                    first_column: this.yylloc.first_column,
460
+                    last_column: this.yylloc.last_column
461
+                },
462
+                yytext: this.yytext,
463
+                match: this.match,
464
+                matches: this.matches,
465
+                matched: this.matched,
466
+                yyleng: this.yyleng,
467
+                offset: this.offset,
468
+                _more: this._more,
469
+                _input: this._input,
470
+                yy: this.yy,
471
+                conditionStack: this.conditionStack.slice(0),
472
+                done: this.done
473
+            };
474
+            if (this.options.ranges) {
475
+                backup.yylloc.range = this.yylloc.range.slice(0);
476
+            }
477
+        }
478
+
479
+        lines = match[0].match(/(?:\r\n?|\n).*/g);
480
+        if (lines) {
481
+            this.yylineno += lines.length;
482
+        }
483
+        this.yylloc = {
484
+            first_line: this.yylloc.last_line,
485
+            last_line: this.yylineno + 1,
486
+            first_column: this.yylloc.last_column,
487
+            last_column: lines ?
488
+                         lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
489
+                         this.yylloc.last_column + match[0].length
490
+        };
491
+        this.yytext += match[0];
492
+        this.match += match[0];
493
+        this.matches = match;
494
+        this.yyleng = this.yytext.length;
495
+        if (this.options.ranges) {
496
+            this.yylloc.range = [this.offset, this.offset += this.yyleng];
497
+        }
498
+        this._more = false;
499
+        this._backtrack = false;
500
+        this._input = this._input.slice(match[0].length);
501
+        this.matched += match[0];
502
+        token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
503
+        if (this.done && this._input) {
504
+            this.done = false;
505
+        }
506
+        if (token) {
507
+            return token;
508
+        } else if (this._backtrack) {
509
+            // recover context
510
+            for (var k in backup) {
511
+                this[k] = backup[k];
512
+            }
513
+            return false; // rule action called reject() implying the next rule should be tested instead.
514
+        }
515
+        return false;
516
+    },
517
+
518
+// return next match in input
519
+next:function () {
520
+        if (this.done) {
521
+            return this.EOF;
522
+        }
523
+        if (!this._input) {
524
+            this.done = true;
525
+        }
526
+
527
+        var token,
528
+            match,
529
+            tempMatch,
530
+            index;
531
+        if (!this._more) {
532
+            this.yytext = '';
533
+            this.match = '';
534
+        }
535
+        var rules = this._currentRules();
536
+        for (var i = 0; i < rules.length; i++) {
537
+            tempMatch = this._input.match(this.rules[rules[i]]);
538
+            if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
539
+                match = tempMatch;
540
+                index = i;
541
+                if (this.options.backtrack_lexer) {
542
+                    token = this.test_match(tempMatch, rules[i]);
543
+                    if (token !== false) {
544
+                        return token;
545
+                    } else if (this._backtrack) {
546
+                        match = false;
547
+                        continue; // rule action called reject() implying a rule MISmatch.
548
+                    } else {
549
+                        // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
550
+                        return false;
551
+                    }
552
+                } else if (!this.options.flex) {
553
+                    break;
554
+                }
555
+            }
556
+        }
557
+        if (match) {
558
+            token = this.test_match(match, rules[index]);
559
+            if (token !== false) {
560
+                return token;
561
+            }
562
+            // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
563
+            return false;
564
+        }
565
+        if (this._input === "") {
566
+            return this.EOF;
567
+        } else {
568
+            return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
569
+                text: "",
570
+                token: null,
571
+                line: this.yylineno
572
+            });
573
+        }
574
+    },
575
+
576
+// return next match that has a token
577
+lex:function lex() {
578
+        var r = this.next();
579
+        if (r) {
580
+            return r;
581
+        } else {
582
+            return this.lex();
583
+        }
584
+    },
585
+
586
+// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
587
+begin:function begin(condition) {
588
+        this.conditionStack.push(condition);
589
+    },
590
+
591
+// pop the previously active lexer condition state off the condition stack
592
+popState:function popState() {
593
+        var n = this.conditionStack.length - 1;
594
+        if (n > 0) {
595
+            return this.conditionStack.pop();
596
+        } else {
597
+            return this.conditionStack[0];
598
+        }
599
+    },
600
+
601
+// produce the lexer rule set which is active for the currently active lexer condition state
602
+_currentRules:function _currentRules() {
603
+        if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
604
+            return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
605
+        } else {
606
+            return this.conditions["INITIAL"].rules;
607
+        }
608
+    },
609
+
610
+// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
611
+topState:function topState(n) {
612
+        n = this.conditionStack.length - 1 - Math.abs(n || 0);
613
+        if (n >= 0) {
614
+            return this.conditionStack[n];
615
+        } else {
616
+            return "INITIAL";
617
+        }
618
+    },
619
+
620
+// alias for begin(condition)
621
+pushState:function pushState(condition) {
622
+        this.begin(condition);
623
+    },
624
+
625
+// return the number of states currently on the stack
626
+stateStackSize:function stateStackSize() {
627
+        return this.conditionStack.length;
628
+    },
629
+options: {},
630
+performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
631
+var YYSTATE=YY_START;
632
+switch($avoiding_name_collisions) {
633
+case 0:/* skip whitespace */
634
+break;
635
+case 1:return 6
636
+break;
637
+case 2:yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2); return 4
638
+break;
639
+case 3:return 17
640
+break;
641
+case 4:return 18
642
+break;
643
+case 5:return 23
644
+break;
645
+case 6:return 24
646
+break;
647
+case 7:return 22
648
+break;
649
+case 8:return 21
650
+break;
651
+case 9:return 10
652
+break;
653
+case 10:return 11
654
+break;
655
+case 11:return 8
656
+break;
657
+case 12:return 14
658
+break;
659
+case 13:return 'INVALID'
660
+break;
661
+}
662
+},
663
+rules: [/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],
664
+conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"inclusive":true}}
665
+});
666
+return lexer;
667
+})();
668
+parser.lexer = lexer;
669
+function Parser () {
670
+  this.yy = {};
671
+}
672
+Parser.prototype = parser;parser.Parser = Parser;
673
+return new Parser;
674
+})();
675
+
676
+
677
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
678
+exports.parser = parser;
679
+exports.Parser = parser.Parser;
680
+exports.parse = function () { return parser.parse.apply(parser, arguments); };
681
+exports.main = function commonjsMain(args) {
682
+    if (!args[1]) {
683
+        console.log('Usage: '+args[0]+' FILE');
684
+        process.exit(1);
685
+    }
686
+    var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
687
+    return exports.parser.parse(source);
688
+};
689
+if (typeof module !== 'undefined' && require.main === module) {
690
+  exports.main(process.argv.slice(1));
691
+}
692
+}

+ 65
- 0
node_modules/@mapbox/jsonlint-lines-primitives/package.json Целия файл

@@ -0,0 +1,65 @@
1
+{
2
+  "_from": "@mapbox/jsonlint-lines-primitives@^2.0.1",
3
+  "_id": "@mapbox/jsonlint-lines-primitives@2.0.1",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-LGegvJq+ks4UFnEAvtAhygFRZxaNg2vw7PsvLOAXY8ziJLv5aFDSdHDEMJA/Q8PG5dNhMioUvo0kNqb7U5dPoQ==",
6
+  "_location": "/@mapbox/jsonlint-lines-primitives",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@mapbox/jsonlint-lines-primitives@^2.0.1",
12
+    "name": "@mapbox/jsonlint-lines-primitives",
13
+    "escapedName": "@mapbox%2fjsonlint-lines-primitives",
14
+    "scope": "@mapbox",
15
+    "rawSpec": "^2.0.1",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^2.0.1"
18
+  },
19
+  "_requiredBy": [
20
+    "/mapbox-gl"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.1.tgz",
23
+  "_shasum": "bc4c1593e2ec2371e2771c518068d6eab8eeae58",
24
+  "_spec": "@mapbox/jsonlint-lines-primitives@^2.0.1",
25
+  "_where": "/Users/jamess/Labs/dasboot/node_modules/mapbox-gl",
26
+  "author": {
27
+    "name": "Zach Carter",
28
+    "email": "zach@carter.name",
29
+    "url": "http://zaa.ch"
30
+  },
31
+  "bugs": {
32
+    "url": "http://github.com/mapbox/jsonlint/issues"
33
+  },
34
+  "bundleDependencies": false,
35
+  "dependencies": {},
36
+  "deprecated": false,
37
+  "description": "Validate JSON",
38
+  "devDependencies": {
39
+    "jison": "*",
40
+    "test": "*",
41
+    "uglify-js": "*"
42
+  },
43
+  "engines": {
44
+    "node": ">= 0.6"
45
+  },
46
+  "homepage": "https://github.com/mapbox/jsonlint#readme",
47
+  "keywords": [
48
+    "json",
49
+    "validation",
50
+    "lint",
51
+    "jsonlint"
52
+  ],
53
+  "main": "lib/jsonlint.js",
54
+  "name": "@mapbox/jsonlint-lines-primitives",
55
+  "optionalDependencies": {},
56
+  "preferGlobal": true,
57
+  "repository": {
58
+    "type": "git",
59
+    "url": "git://github.com/mapbox/jsonlint.git"
60
+  },
61
+  "scripts": {
62
+    "test": "node test/all-tests.js"
63
+  },
64
+  "version": "2.0.1"
65
+}

+ 8
- 0
node_modules/@mapbox/jsonlint-lines-primitives/scripts/bundle.js Целия файл

@@ -0,0 +1,8 @@
1
+var fs = require('fs');
2
+
3
+var source = "var jsonlint = (function(){var require=true,module=false;var exports={};" +
4
+  fs.readFileSync(__dirname+'/../lib/jsonlint.js', 'utf8') +
5
+  "return exports;})()";
6
+
7
+console.log(source);
8
+

+ 24
- 0
node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.l Целия файл

@@ -0,0 +1,24 @@
1
+int  "-"?([0-9]|[1-9][0-9]+)
2
+exp  [eE][-+]?[0-9]+
3
+frac  "."[0-9]+
4
+
5
+%%
6
+\s+      /* skip whitespace */
7
+
8
+{int}{frac}?{exp}?\b    return 'NUMBER'
9
+\"(?:'\\'[\\"bfnrt/]|'\\u'[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*\"    yytext = yytext.substr(1,yyleng-2); return 'STRING'
10
+
11
+"{"      return '{'
12
+"}"      return '}'
13
+"["      return '['
14
+"]"      return ']'
15
+","      return ','
16
+":"      return ':'
17
+"true"   return 'TRUE'
18
+"false"  return 'FALSE'
19
+"null"   return 'NULL'
20
+<<EOF>>  return 'EOF'
21
+.        return 'INVALID'
22
+
23
+%%
24
+

+ 110
- 0
node_modules/@mapbox/jsonlint-lines-primitives/src/jsonlint.y Целия файл

@@ -0,0 +1,110 @@
1
+%start JSONText
2
+
3
+/*
4
+  ECMA-262 5th Edition, 15.12.1 The JSON Grammar.
5
+*/
6
+
7
+
8
+%%
9
+
10
+JSONString
11
+    : STRING
12
+        { // replace escaped characters with actual character
13
+          $$ = new String(yytext.replace(/\\(\\|")/g, "$"+"1")
14
+                     .replace(/\\n/g,'\n')
15
+                     .replace(/\\r/g,'\r')
16
+                     .replace(/\\t/g,'\t')
17
+                     .replace(/\\v/g,'\v')
18
+                     .replace(/\\f/g,'\f')
19
+                     .replace(/\\b/g,'\b'));
20
+          $$.__line__ =  @$.first_line;
21
+        }
22
+    ;
23
+
24
+JSONNumber
25
+    : NUMBER
26
+        {
27
+            $$ = new Number(yytext);
28
+            $$.__line__ =  @$.first_line;
29
+        }
30
+    ;
31
+
32
+JSONNullLiteral
33
+    : NULL
34
+        {
35
+            $$ = null;
36
+        }
37
+    ;
38
+
39
+JSONBooleanLiteral
40
+    : TRUE
41
+        {
42
+            $$ = new Boolean(true);
43
+            $$.__line__ = @$.first_line;
44
+        }
45
+    | FALSE
46
+        {
47
+            $$ = new Boolean(false);
48
+            $$.__line__ = @$.first_line;
49
+        }
50
+    ;
51
+
52
+JSONText
53
+    : JSONValue EOF
54
+        {return $$ = $1;}
55
+    ;
56
+
57
+JSONValue
58
+    : JSONNullLiteral
59
+    | JSONBooleanLiteral
60
+    | JSONString
61
+    | JSONNumber
62
+    | JSONObject
63
+    | JSONArray
64
+    ;
65
+
66
+JSONObject
67
+    : '{' '}'
68
+        {$$ = {}; Object.defineProperty($$, '__line__', {
69
+            value: @$.first_line,
70
+            enumerable: false
71
+        })}
72
+    | '{' JSONMemberList '}'
73
+        {$$ = $2; Object.defineProperty($$, '__line__', {
74
+            value: @$.first_line,
75
+            enumerable: false
76
+        })}
77
+    ;
78
+
79
+JSONMember
80
+    : JSONString ':' JSONValue
81
+        {$$ = [$1, $3];}
82
+    ;
83
+
84
+JSONMemberList
85
+    : JSONMember
86
+        {{$$ = {}; $$[$1[0]] = $1[1];}}
87
+    | JSONMemberList ',' JSONMember
88
+        {$$ = $1; $1[$3[0]] = $3[1];}
89
+    ;
90
+
91
+JSONArray
92
+    : '[' ']'
93
+        {$$ = []; Object.defineProperty($$, '__line__', {
94
+            value: @$.first_line,
95
+            enumerable: false
96
+        })}
97
+    | '[' JSONElementList ']'
98
+        {$$ = $2; Object.defineProperty($$, '__line__', {
99
+            value: @$.first_line,
100
+            enumerable: false
101
+        })}
102
+    ;
103
+
104
+JSONElementList
105
+    : JSONValue
106
+        {$$ = [$1];}
107
+    | JSONElementList ',' JSONValue
108
+        {$$ = $1; $1.push($3);}
109
+    ;
110
+

+ 210
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/all-tests.js Целия файл

@@ -0,0 +1,210 @@
1
+var fs = require("fs"),
2
+    assert = require("assert"),
3
+    parser = require("../lib/jsonlint").parser;
4
+
5
+exports["test string with line break"] = function () {
6
+    var json = '{"foo": "bar\nbar"}';
7
+    assert["throws"](function () {parser.parse(json)}, "should throw error");
8
+};
9
+
10
+exports["test string literal"] = function () {
11
+    var json = '"foo"';
12
+    assert.equal(parser.parse(json), "foo");
13
+    assert.equal(parser.parse(json).__line__, 1);
14
+};
15
+
16
+exports["test number literal"] = function () {
17
+    var json = '1234';
18
+    assert.equal(parser.parse(json), 1234);
19
+    assert.equal(parser.parse(json).__line__, 1);
20
+};
21
+
22
+exports["test null literal"] = function () {
23
+    var json = 'null';
24
+    assert.equal(parser.parse(json), null);
25
+};
26
+
27
+exports["test boolean literal"] = function () {
28
+    var json = 'true';
29
+    assert.equal(parser.parse(json), true);
30
+    assert.equal(parser.parse(json).__line__, 1);
31
+};
32
+
33
+exports["test unclosed array"] = function () {
34
+  var json = fs.readFileSync(__dirname + "/fails/2.json").toString();
35
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
36
+};
37
+
38
+exports["test unquotedkey keys must be quoted"] = function () {
39
+  var json = fs.readFileSync(__dirname + "/fails/3.json").toString();
40
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
41
+};
42
+
43
+exports["test extra comma"] = function () {
44
+  var json = fs.readFileSync(__dirname + "/fails/4.json").toString();
45
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
46
+};
47
+
48
+exports["test double extra comma"] = function () {
49
+  var json = fs.readFileSync(__dirname + "/fails/5.json").toString();
50
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
51
+};
52
+
53
+exports["test missing value"] = function () {
54
+  var json = fs.readFileSync(__dirname + "/fails/6.json").toString();
55
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
56
+};
57
+
58
+exports["test comma after the close"] = function () {
59
+  var json = fs.readFileSync(__dirname + "/fails/7.json").toString();
60
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
61
+};
62
+
63
+exports["test extra close"] = function () {
64
+  var json = fs.readFileSync(__dirname + "/fails/8.json").toString();
65
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
66
+};
67
+
68
+exports["test extra comma after value"] = function () {
69
+  var json = fs.readFileSync(__dirname + "/fails/9.json").toString();
70
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
71
+};
72
+
73
+exports["test extra value after close with misplaced quotes"] = function () {
74
+  var json = fs.readFileSync(__dirname + "/fails/10.json").toString();
75
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
76
+};
77
+
78
+exports["test illegal expression addition"] = function () {
79
+  var json = fs.readFileSync(__dirname + "/fails/11.json").toString();
80
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
81
+};
82
+
83
+exports["test illegal invocation of alert"] = function () {
84
+  var json = fs.readFileSync(__dirname + "/fails/12.json").toString();
85
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
86
+};
87
+
88
+exports["test numbers cannot have leading zeroes"] = function () {
89
+  var json = fs.readFileSync(__dirname + "/fails/13.json").toString();
90
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
91
+};
92
+
93
+exports["test numbers cannot be hex"] = function () {
94
+  var json = fs.readFileSync(__dirname + "/fails/14.json").toString();
95
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
96
+};
97
+
98
+exports["test illegal backslash escape \\0"] = function () {
99
+  var json = fs.readFileSync(__dirname + "/fails/15.json").toString();
100
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
101
+};
102
+
103
+exports["test unquoted text"] = function () {
104
+  var json = fs.readFileSync(__dirname + "/fails/16.json").toString();
105
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
106
+};
107
+
108
+exports["test illegal backslash escape \\x"] = function () {
109
+  var json = fs.readFileSync(__dirname + "/fails/17.json").toString();
110
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
111
+};
112
+
113
+exports["test missing colon"] = function () {
114
+  var json = fs.readFileSync(__dirname + "/fails/19.json")
115
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
116
+};
117
+
118
+exports["test double colon"] = function () {
119
+  var json = fs.readFileSync(__dirname + "/fails/20.json").toString();
120
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
121
+};
122
+
123
+exports["test comma instead of colon"] = function () {
124
+  var json = fs.readFileSync(__dirname + "/fails/21.json").toString();
125
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
126
+};
127
+
128
+exports["test colon instead of comma"] = function () {
129
+  var json = fs.readFileSync(__dirname + "/fails/22.json").toString();
130
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
131
+};
132
+
133
+exports["test bad raw value"] = function () {
134
+  var json = fs.readFileSync(__dirname + "/fails/23.json").toString();
135
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
136
+};
137
+
138
+exports["test single quotes"] = function () {
139
+  var json = fs.readFileSync(__dirname + "/fails/24.json").toString();
140
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
141
+};
142
+
143
+exports["test tab character in string"] = function () {
144
+  var json = fs.readFileSync(__dirname + "/fails/25.json").toString();
145
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
146
+};
147
+
148
+exports["test tab character in string 2"] = function () {
149
+  var json = fs.readFileSync(__dirname + "/fails/26.json").toString();
150
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
151
+};
152
+
153
+exports["test line break in string"] = function () {
154
+  var json = fs.readFileSync(__dirname + "/fails/27.json").toString();
155
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
156
+};
157
+
158
+exports["test line break in string in array"] = function () {
159
+  var json = fs.readFileSync(__dirname + "/fails/28.json").toString();
160
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
161
+};
162
+
163
+exports["test 0e"] = function () {
164
+  var json = fs.readFileSync(__dirname + "/fails/29.json").toString();
165
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
166
+};
167
+
168
+exports["test 0e+"] = function () {
169
+  var json = fs.readFileSync(__dirname + "/fails/30.json").toString();
170
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
171
+};
172
+
173
+exports["test 0e+ 1"] = function () {
174
+  var json = fs.readFileSync(__dirname + "/fails/31.json").toString();
175
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
176
+};
177
+
178
+exports["test comma instead of closing brace"] = function () {
179
+  var json = fs.readFileSync(__dirname + "/fails/32.json").toString();
180
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
181
+};
182
+
183
+exports["test bracket mismatch"] = function () {
184
+  var json = fs.readFileSync(__dirname + "/fails/33.json").toString();
185
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
186
+}
187
+
188
+exports["test extra brace"] = function () {
189
+  var json = fs.readFileSync(__dirname + "/fails/34.json").toString();
190
+  assert["throws"](function () {parser.parse(json)}, "should throw error");
191
+}
192
+
193
+exports["test pass-1"] = function () {
194
+  var json = fs.readFileSync(__dirname + "/passes/1.json").toString();
195
+  assert.doesNotThrow(function () {parser.parse(json)}, "should pass");
196
+}
197
+
198
+exports["test pass-2"] = function () {
199
+  var json = fs.readFileSync(__dirname + "/passes/2.json").toString();
200
+  assert.doesNotThrow(function () {parser.parse(json)}, "should pass");
201
+}
202
+
203
+exports["test pass-3"] = function () {
204
+  var json = fs.readFileSync(__dirname + "/passes/3.json").toString();
205
+  assert.doesNotThrow(function () {parser.parse(json)}, "should pass");
206
+}
207
+
208
+if (require.main === module) {
209
+    require("test").run(exports);
210
+}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/10.json Целия файл

@@ -0,0 +1 @@
1
+{"Extra value after close": true} "misplaced quoted value"

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/11.json Целия файл

@@ -0,0 +1 @@
1
+{"Illegal expression": 1 + 2}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/12.json Целия файл

@@ -0,0 +1 @@
1
+{"Illegal invocation": alert()}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/13.json Целия файл

@@ -0,0 +1 @@
1
+{"Numbers cannot have leading zeroes": 013}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/14.json Целия файл

@@ -0,0 +1 @@
1
+{"Numbers cannot be hex": 0x14}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/15.json Целия файл

@@ -0,0 +1 @@
1
+["Illegal backslash escape: \x15"]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/16.json Целия файл

@@ -0,0 +1 @@
1
+[\naked]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/17.json Целия файл

@@ -0,0 +1 @@
1
+["Illegal backslash escape: \017"]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/19.json Целия файл

@@ -0,0 +1 @@
1
+{"Missing colon" null}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/2.json Целия файл

@@ -0,0 +1 @@
1
+["Unclosed array"

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/20.json Целия файл

@@ -0,0 +1 @@
1
+{"Double colon":: null}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/21.json Целия файл

@@ -0,0 +1 @@
1
+{"Comma instead of colon", null}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/22.json Целия файл

@@ -0,0 +1 @@
1
+["Colon instead of comma": false]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/23.json Целия файл

@@ -0,0 +1 @@
1
+["Bad value", truth]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/24.json Целия файл

@@ -0,0 +1 @@
1
+['single quote']

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/25.json Целия файл

@@ -0,0 +1 @@
1
+["	tab	character	in	string	"]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/26.json Целия файл

@@ -0,0 +1 @@
1
+["tab\   character\   in\  string\  "]

+ 2
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/27.json Целия файл

@@ -0,0 +1,2 @@
1
+["line
2
+break"]

+ 2
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/28.json Целия файл

@@ -0,0 +1,2 @@
1
+["line\
2
+break"]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/29.json Целия файл

@@ -0,0 +1 @@
1
+[0e]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/3.json Целия файл

@@ -0,0 +1 @@
1
+{unquoted_key: "keys must be quoted"}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/30.json Целия файл

@@ -0,0 +1 @@
1
+[0e+]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/31.json Целия файл

@@ -0,0 +1 @@
1
+[0e+-1]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/32.json Целия файл

@@ -0,0 +1 @@
1
+{"Comma instead if closing brace": true,

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/33.json Целия файл

@@ -0,0 +1 @@
1
+["mismatch"}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/34.json Целия файл

@@ -0,0 +1 @@
1
+{"extra brace": 1}}

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/4.json Целия файл

@@ -0,0 +1 @@
1
+["extra comma",]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/5.json Целия файл

@@ -0,0 +1 @@
1
+["double extra comma",,]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/6.json Целия файл

@@ -0,0 +1 @@
1
+[   , "<-- missing value"]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/7.json Целия файл

@@ -0,0 +1 @@
1
+["Comma after the close"],

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/8.json Целия файл

@@ -0,0 +1 @@
1
+["Extra close"]]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/fails/9.json Целия файл

@@ -0,0 +1 @@
1
+{"Extra comma": true,}

+ 58
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/passes/1.json Целия файл

@@ -0,0 +1,58 @@
1
+[
2
+    "JSON Test Pattern pass1",
3
+    {"object with 1 member":["array with 1 element"]},
4
+    {},
5
+    [],
6
+    -42,
7
+    true,
8
+    false,
9
+    null,
10
+    {
11
+        "integer": 1234567890,
12
+        "real": -9876.543210,
13
+        "e": 0.123456789e-12,
14
+        "E": 1.234567890E+34,
15
+        "":  23456789012E66,
16
+        "zero": 0,
17
+        "one": 1,
18
+        "space": " ",
19
+        "quote": "\"",
20
+        "backslash": "\\",
21
+        "controls": "\b\f\n\r\t",
22
+        "slash": "/ & \/",
23
+        "alpha": "abcdefghijklmnopqrstuvwyz",
24
+        "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
25
+        "digit": "0123456789",
26
+        "0123456789": "digit",
27
+        "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
28
+        "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
29
+        "true": true,
30
+        "false": false,
31
+        "null": null,
32
+        "array":[  ],
33
+        "object":{  },
34
+        "address": "50 St. James Street",
35
+        "url": "http://www.JSON.org/",
36
+        "comment": "// /* <!-- --",
37
+        "# -- --> */": " ",
38
+        " s p a c e d " :[1,2 , 3
39
+
40
+,
41
+
42
+4 , 5        ,          6           ,7        ],"compact":[1,2,3,4,5,6,7],
43
+        "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
44
+        "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
45
+        "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
46
+: "A key can be any string"
47
+    },
48
+    0.5 ,98.6
49
+,
50
+99.44
51
+,
52
+
53
+1066,
54
+1e1,
55
+0.1e1,
56
+1e-1,
57
+1e00,2e+00,2e-00
58
+,"rosebud"]

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/passes/2.json Целия файл

@@ -0,0 +1 @@
1
+[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]

+ 6
- 0
node_modules/@mapbox/jsonlint-lines-primitives/test/passes/3.json Целия файл

@@ -0,0 +1,6 @@
1
+{
2
+    "JSON Test Pattern pass3": {
3
+        "The outermost value": "must be an object or array.",
4
+        "In this test": "It is an object."
5
+    }
6
+}

+ 334
- 0
node_modules/@mapbox/jsonlint-lines-primitives/web/json2.js Целия файл

@@ -0,0 +1,334 @@
1
+
2
+/*jslint evil: true, strict: false */
3
+
4
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
5
+    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
6
+    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
7
+    lastIndex, length, parse, prototype, push, replace, slice, stringify,
8
+    test, toJSON, toString, valueOf
9
+*/
10
+
11
+
12
+// Create a JSON object only if one does not already exist. We create the
13
+// methods in a closure to avoid creating global variables.
14
+
15
+if (!this.JSON) {
16
+    this.JSON = {};
17
+}
18
+
19
+(function () {
20
+
21
+    function f(n) {
22
+        // Format integers to have at least two digits.
23
+        return n < 10 ? '0' + n : n;
24
+    }
25
+
26
+    if (typeof Date.prototype.toJSON !== 'function') {
27
+
28
+        Date.prototype.toJSON = function (key) {
29
+
30
+            return isFinite(this.valueOf()) ?
31
+                   this.getUTCFullYear()   + '-' +
32
+                 f(this.getUTCMonth() + 1) + '-' +
33
+                 f(this.getUTCDate())      + 'T' +
34
+                 f(this.getUTCHours())     + ':' +
35
+                 f(this.getUTCMinutes())   + ':' +
36
+                 f(this.getUTCSeconds())   + 'Z' : null;
37
+        };
38
+
39
+        String.prototype.toJSON =
40
+        Number.prototype.toJSON =
41
+        Boolean.prototype.toJSON = function (key) {
42
+            return this.valueOf();
43
+        };
44
+    }
45
+
46
+    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
47
+        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
48
+        gap,
49
+        indent,
50
+        meta = {    // table of character substitutions
51
+            '\b': '\\b',
52
+            '\t': '\\t',
53
+            '\n': '\\n',
54
+            '\f': '\\f',
55
+            '\r': '\\r',
56
+            '"' : '\\"',
57
+            '\\': '\\\\'
58
+        },
59
+        rep;
60
+
61
+
62
+    function quote(string) {
63
+
64
+// If the string contains no control characters, no quote characters, and no
65
+// backslash characters, then we can safely slap some quotes around it.
66
+// Otherwise we must also replace the offending characters with safe escape
67
+// sequences.
68
+
69
+        escapable.lastIndex = 0;
70
+        return escapable.test(string) ?
71
+            '"' + string.replace(escapable, function (a) {
72
+                var c = meta[a];
73
+                return typeof c === 'string' ? c :
74
+                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
75
+            }) + '"' :
76
+            '"' + string + '"';
77
+    }
78
+
79
+
80
+    function str(key, holder) {
81
+
82
+// Produce a string from holder[key].
83
+
84
+        var i,          // The loop counter.
85
+            k,          // The member key.
86
+            v,          // The member value.
87
+            length,
88
+            mind = gap,
89
+            partial,
90
+            value = holder[key];
91
+
92
+// If the value has a toJSON method, call it to obtain a replacement value.
93
+
94
+        if (value && typeof value === 'object' &&
95
+                typeof value.toJSON === 'function') {
96
+            value = value.toJSON(key);
97
+        }
98
+
99
+// If we were called with a replacer function, then call the replacer to
100
+// obtain a replacement value.
101
+
102
+        if (typeof rep === 'function') {
103
+            value = rep.call(holder, key, value);
104
+        }
105
+
106
+// What happens next depends on the value's type.
107
+
108
+        switch (typeof value) {
109
+        case 'string':
110
+            return quote(value);
111
+
112
+        case 'number':
113
+
114
+// JSON numbers must be finite. Encode non-finite numbers as null.
115
+
116
+            return isFinite(value) ? String(value) : 'null';
117
+
118
+        case 'boolean':
119
+        case 'null':
120
+
121
+// If the value is a boolean or null, convert it to a string. Note:
122
+// typeof null does not produce 'null'. The case is included here in
123
+// the remote chance that this gets fixed someday.
124
+
125
+            return String(value);
126
+
127
+// If the type is 'object', we might be dealing with an object or an array or
128
+// null.
129
+
130
+        case 'object':
131
+
132
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
133
+// so watch out for that case.
134
+
135
+            if (!value) {
136
+                return 'null';
137
+            }
138
+
139
+// Make an array to hold the partial results of stringifying this object value.
140
+
141
+            gap += indent;
142
+            partial = [];
143
+
144
+// Is the value an array?
145
+
146
+            if (Object.prototype.toString.apply(value) === '[object Array]') {
147
+
148
+// The value is an array. Stringify every element. Use null as a placeholder
149
+// for non-JSON values.
150
+
151
+                length = value.length;
152
+                for (i = 0; i < length; i += 1) {
153
+                    partial[i] = str(i, value) || 'null';
154
+                }
155
+
156
+// Join all of the elements together, separated with commas, and wrap them in
157
+// brackets.
158
+
159
+                v = partial.length === 0 ? '[]' :
160
+                    gap ? '[\n' + gap +
161
+                            partial.join(',\n' + gap) + '\n' +
162
+                                mind + ']' :
163
+                          '[' + partial.join(',') + ']';
164
+                gap = mind;
165
+                return v;
166
+            }
167
+
168
+// If the replacer is an array, use it to select the members to be stringified.
169
+
170
+            if (rep && typeof rep === 'object') {
171
+                length = rep.length;
172
+                for (i = 0; i < length; i += 1) {
173
+                    k = rep[i];
174
+                    if (typeof k === 'string') {
175
+                        v = str(k, value);
176
+                        if (v) {
177
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
178
+                        }
179
+                    }
180
+                }
181
+            } else {
182
+
183
+// Otherwise, iterate through all of the keys in the object.
184
+
185
+                for (k in value) {
186
+                    if (Object.hasOwnProperty.call(value, k)) {
187
+                        v = str(k, value);
188
+                        if (v) {
189
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
190
+                        }
191
+                    }
192
+                }
193
+            }
194
+
195
+// Join all of the member texts together, separated with commas,
196
+// and wrap them in braces.
197
+
198
+            v = partial.length === 0 ? '{}' :
199
+                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
200
+                        mind + '}' : '{' + partial.join(',') + '}';
201
+            gap = mind;
202
+            return v;
203
+        }
204
+    }
205
+
206
+// If the JSON object does not yet have a stringify method, give it one.
207
+
208
+    if (typeof JSON.stringify !== 'function') {
209
+        JSON.stringify = function (value, replacer, space) {
210
+
211
+// The stringify method takes a value and an optional replacer, and an optional
212
+// space parameter, and returns a JSON text. The replacer can be a function
213
+// that can replace values, or an array of strings that will select the keys.
214
+// A default replacer method can be provided. Use of the space parameter can
215
+// produce text that is more easily readable.
216
+
217
+            var i;
218
+            gap = '';
219
+            indent = '';
220
+
221
+// If the space parameter is a number, make an indent string containing that
222
+// many spaces.
223
+
224
+            if (typeof space === 'number') {
225
+                for (i = 0; i < space; i += 1) {
226
+                    indent += ' ';
227
+                }
228
+
229
+// If the space parameter is a string, it will be used as the indent string.
230
+
231
+            } else if (typeof space === 'string') {
232
+                indent = space;
233
+            }
234
+
235
+// If there is a replacer, it must be a function or an array.
236
+// Otherwise, throw an error.
237
+
238
+            rep = replacer;
239
+            if (replacer && typeof replacer !== 'function' &&
240
+                    (typeof replacer !== 'object' ||
241
+                     typeof replacer.length !== 'number')) {
242
+                throw new Error('JSON.stringify');
243
+            }
244
+
245
+// Make a fake root object containing our value under the key of ''.
246
+// Return the result of stringifying the value.
247
+
248
+            return str('', {'': value});
249
+        };
250
+    }
251
+
252
+
253
+// If the JSON object does not yet have a parse method, give it one.
254
+
255
+    if (typeof JSON.parse !== 'function') {
256
+        JSON.parse = function (text, reviver) {
257
+
258
+// The parse method takes a text and an optional reviver function, and returns
259
+// a JavaScript value if the text is a valid JSON text.
260
+
261
+            var j;
262
+
263
+            function walk(holder, key) {
264
+
265
+// The walk method is used to recursively walk the resulting structure so
266
+// that modifications can be made.
267
+
268
+                var k, v, value = holder[key];
269
+                if (value && typeof value === 'object') {
270
+                    for (k in value) {
271
+                        if (Object.hasOwnProperty.call(value, k)) {
272
+                            v = walk(value, k);
273
+                            if (v !== undefined) {
274
+                                value[k] = v;
275
+                            } else {
276
+                                delete value[k];
277
+                            }
278
+                        }
279
+                    }
280
+                }
281
+                return reviver.call(holder, key, value);
282
+            }
283
+
284
+
285
+// Parsing happens in four stages. In the first stage, we replace certain
286
+// Unicode characters with escape sequences. JavaScript handles many characters
287
+// incorrectly, either silently deleting them, or treating them as line endings.
288
+
289
+            cx.lastIndex = 0;
290
+            if (cx.test(text)) {
291
+                text = text.replace(cx, function (a) {
292
+                    return '\\u' +
293
+                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
294
+                });
295
+            }
296
+
297
+// In the second stage, we run the text against regular expressions that look
298
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
299
+// because they can cause invocation, and '=' because it can cause mutation.
300
+// But just to be safe, we want to reject all unexpected forms.
301
+
302
+// We split the second stage into 4 regexp operations in order to work around
303
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
304
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
305
+// replace all simple value tokens with ']' characters. Third, we delete all
306
+// open brackets that follow a colon or comma or that begin the text. Finally,
307
+// we look to see that the remaining characters are only whitespace or ']' or
308
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
309
+
310
+            if (/^[\],:{}\s]*$/.
311
+test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
312
+replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
313
+replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
314
+
315
+// In the third stage we use the eval function to compile the text into a
316
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
317
+// in JavaScript: it can begin a block or an object literal. We wrap the text
318
+// in parens to eliminate the ambiguity.
319
+
320
+                j = eval('(' + text + ')');
321
+
322
+// In the optional fourth stage, we recursively walk the new structure, passing
323
+// each name/value pair to a reviver function for possible transformation.
324
+
325
+                return typeof reviver === 'function' ?
326
+                    walk({'': j}, '') : j;
327
+            }
328
+
329
+// If the text is not JSON parseable, then a SyntaxError is thrown.
330
+
331
+            throw new SyntaxError('JSON.parse');
332
+        };
333
+    }
334
+}());

+ 59
- 0
node_modules/@mapbox/jsonlint-lines-primitives/web/jsonlint.html Целия файл

@@ -0,0 +1,59 @@
1
+<!doctype html> 
2
+<html lang="en"> 
3
+<head> 
4
+    <meta charset="utf-8" /> 
5
+    <title>JSON Lint</title> 
6
+    <script src="json2.js"></script>
7
+    <script src="jsonlint.js"></script>
8
+    <script>
9
+      window.onload = function () {
10
+        document.getElementById("button").onclick = function () {
11
+          try {
12
+            var result = jsonlint.parse(document.getElementById("source").value);
13
+            if (result) {
14
+              document.getElementById("result").innerHTML = "JSON is valid!";
15
+              document.getElementById("result").className = "pass";
16
+              if (document.getElementById("reformat").checked) {
17
+                document.getElementById("source").value = JSON.stringify(result, null, "  ");
18
+              }
19
+            }
20
+          } catch(e) {
21
+            document.getElementById("result").innerHTML = e;
22
+            document.getElementById("result").className = "fail";
23
+          }
24
+        };
25
+      }
26
+    </script>
27
+    <style>
28
+      body {font-family: sans-serif;}
29
+      #result {
30
+        padding: 1em;
31
+      }
32
+      .pass {
33
+        background-color: #efe;
34
+        color: #393;
35
+        border: 2px solid #393;
36
+      }
37
+      .fail {
38
+        background-color: #fee;
39
+        color: #933;
40
+        border: 2px solid #933;
41
+      }
42
+      textarea { width: 100%; }
43
+    </style>
44
+</head> 
45
+<body> 
46
+  <h1>JSON Lint</h1> 
47
+  <p>A pure JavaScript version of the service provided at <a href="http://jsonlint.com/">jsonlint.com</a>.</p>
48
+  <textarea id="source" rows="20" cols="50">
49
+
50
+  </textarea>
51
+  <p>
52
+    <button id="button">Validate</button>
53
+    <input type="checkbox" value="yes" id="reformat" /><label for="reformat">reformat JSON</label>
54
+  </p>
55
+  <h2>Results</h2>
56
+  <pre id="result"></pre>
57
+  <p><a href="http://github.com/zaach/jsonlint">project on github</a></p> 
58
+</body> 
59
+</html> 

+ 1
- 0
node_modules/@mapbox/jsonlint-lines-primitives/web/jsonlint.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 17
- 0
node_modules/@mapbox/mapbox-gl-supported/.eslintrc Целия файл

@@ -0,0 +1,17 @@
1
+{
2
+  "extends": "mourner",
3
+  "rules": {
4
+    "object-curly-spacing": 0,
5
+    "key-spacing": 0,
6
+    "array-bracket-spacing": 0,
7
+    "space-before-function-paren": 0,
8
+    "quotes": 0,
9
+    "no-eq-null": 0,
10
+    "consistent-return": 0,
11
+    "global-require": 0,
12
+    "block-scoped-var": 2
13
+  },
14
+  "env": {
15
+    "browser": true
16
+  }
17
+}

+ 6
- 0
node_modules/@mapbox/mapbox-gl-supported/CONTRIBUTING.md Целия файл

@@ -0,0 +1,6 @@
1
+# Deploying a new release
2
+
3
+ - `npm test`
4
+ - `npm version {patch|minor|major}`
5
+ - `git push --follow-tags`
6
+ - `aws s3 cp --acl public-read index.js s3://mapbox-gl-js/plugins/mapbox-gl-supported/v$(node --print --eval "require('./package.json').version")/mapbox-gl-supported.js`

+ 30
- 0
node_modules/@mapbox/mapbox-gl-supported/LICENSE.txt Целия файл

@@ -0,0 +1,30 @@
1
+
2
+BSD 3-Clause License
3
+
4
+Copyright (c) 2017, Mapbox
5
+All rights reserved.
6
+
7
+Redistribution and use in source and binary forms, with or without
8
+modification, are permitted provided that the following conditions are met:
9
+
10
+* Redistributions of source code must retain the above copyright notice, this
11
+  list of conditions and the following disclaimer.
12
+
13
+* Redistributions in binary form must reproduce the above copyright notice,
14
+  this list of conditions and the following disclaimer in the documentation
15
+  and/or other materials provided with the distribution.
16
+
17
+* Neither the name of the copyright holder nor the names of its
18
+  contributors may be used to endorse or promote products derived from
19
+  this software without specific prior written permission.
20
+
21
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 30
- 0
node_modules/@mapbox/mapbox-gl-supported/README.md Целия файл

@@ -0,0 +1,30 @@
1
+# Mapbox GL JS Supported
2
+
3
+This library determines if a browser supports [Mapbox GL JS](http://github.com/mapbox/mapbox-gl-js).
4
+
5
+## Testing Your Browser
6
+
7
+You may test your browser [here](http://mapbox.github.io/mapbox-gl-supported).
8
+
9
+## Using Mapbox GL JS Supported with a `<script>` tag
10
+
11
+```html
12
+<script src='mapbox-gl-supported.js'></script>
13
+<script>
14
+if (mapboxgl.supported()) {
15
+    ...
16
+} else {
17
+    ...
18
+}
19
+</script>
20
+```
21
+
22
+## Using Mapbox GL JS Supported with [Browserify](http://browserify.org/)
23
+
24
+```bash
25
+npm install --save @mapbox/mapbox-gl-supported
26
+```
27
+
28
+```js
29
+var isSupported = require('@mapbox/mapbox-gl-supported')();
30
+```

+ 165
- 0
node_modules/@mapbox/mapbox-gl-supported/diagnostics.html Целия файл

@@ -0,0 +1,165 @@
1
+<!doctype html>
2
+
3
+<html style='height: 100%;'>
4
+
5
+<head>
6
+    <link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
7
+
8
+    <style>
9
+
10
+        body {
11
+            display:flex;
12
+            flex-direction: column;
13
+            align-items: center;
14
+            justify-content: center;
15
+        }
16
+
17
+        h2 {
18
+            margin-top: 50px;
19
+            margin-bottom: 10px;
20
+        }
21
+
22
+        #table, #map, #map-log, #diagnostics-log {
23
+            width: 960px;
24
+            margin: 10px 0;
25
+        }
26
+
27
+        #map {
28
+            height: 100px;
29
+        }
30
+
31
+        #canvas {
32
+            height: 0;
33
+        }
34
+
35
+        th code {
36
+            font-weight: bold;
37
+        }
38
+    </style>
39
+</head>
40
+
41
+<body class='fill-gray'>
42
+
43
+    <h2>Map instantiation diagnostics</h2>
44
+    <div id="map"></div>
45
+    <code id="map-log"></code>
46
+    <script src='https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.js'></script>
47
+    <script>
48
+    mapboxgl.accessToken = 'pk.eyJ1IjoibHVjYXN3b2oiLCJhIjoiY2l5Nmg4cWU1MDA0ejMzcDJtNHJmZzJkcyJ9.WhcEdTYQH6sSw2pm0RSP9Q';
49
+        try {
50
+            var map = new mapboxgl.Map({
51
+                container: 'map',
52
+                style: 'mapbox://styles/mapbox/streets-v9',
53
+                zoom: 1
54
+            });
55
+            map.on('error', function(event) {
56
+                writeLogMessage(event.error.toString());
57
+            });
58
+            writeLogMessage('WebGL context:', map.painter.gl);
59
+            writeLogMessage('WebGL errors:', map.painter.gl.getError());
60
+        } catch (e) {
61
+            writeLogMessage('Caught exception:', e.stack || e.toString());
62
+        }
63
+        writeLogMessage('Done!');
64
+
65
+        function writeLogMessage() {
66
+            document.getElementById('map-log').innerHTML += Array.prototype.join.call(arguments, ' ') + '\n';
67
+        }
68
+    </script>
69
+
70
+
71
+
72
+    <h2>Support detection diagnostics</h2>
73
+    <canvas id="canvas"></canvas>
74
+    <table id='table'>
75
+        <tr>
76
+            <th>Detection method</th>
77
+            <th>Context type</th>
78
+            <th><code>failIfMajorPerformanceCaveat</code></th>
79
+            <th>Result</th>
80
+            <th>Errors</th>
81
+        </tr>
82
+    </table>
83
+    <script src='index.js'></script>
84
+    <script>
85
+        function performTest(detectionMethod, contextType, failIfMajorPerformanceCaveat) {
86
+            var attributes = Object.create(mapboxgl.supported.webGLContextAttributes);
87
+            attributes.failIfMajorPerformanceCaveat = failIfMajorPerformanceCaveat;
88
+
89
+            var canvas = document.getElementById('canvas');
90
+            if (canvas[detectionMethod]) {
91
+                var results = '<code>' + canvas[detectionMethod](contextType, attributes) + '</code>';
92
+                writeTestResults(results, results && results.getError && results.getError());
93
+            } else {
94
+                writeTestResults('detection method unavailable');
95
+            }
96
+
97
+            function writeTestResults(result, error) {
98
+                var tr = document.createElement('tr');
99
+
100
+                var detectionMethodTd = document.createElement('td');
101
+                detectionMethodTd.innerHTML = detectionMethod;
102
+                tr.appendChild(detectionMethodTd);
103
+
104
+                var contextTypeTd = document.createElement('td');
105
+                contextTypeTd.innerHTML = contextType;
106
+                tr.appendChild(contextTypeTd);
107
+
108
+                var failIfMajorPerformanceCaveatTd = document.createElement('td');
109
+                failIfMajorPerformanceCaveatTd.innerHTML = failIfMajorPerformanceCaveat;
110
+                tr.appendChild(failIfMajorPerformanceCaveatTd);
111
+
112
+                var resultTd = document.createElement('td');
113
+                resultTd.innerHTML = result;
114
+                tr.appendChild(resultTd);
115
+
116
+                var errorTd = document.createElement('td');
117
+                errorTd.innerHTML = error || 'none';
118
+                tr.appendChild(errorTd);
119
+
120
+                document.getElementById('table').appendChild(tr);
121
+            }
122
+        }
123
+
124
+        performTest('probablySupportsContext', 'webgl', true);
125
+        performTest('probablySupportsContext', 'webgl', false);
126
+        performTest('probablySupportsContext', 'experimental-webgl', true);
127
+        performTest('probablySupportsContext', 'experimental-webgl', false);
128
+
129
+        performTest('supportsContext', 'webgl', true);
130
+        performTest('supportsContext', 'webgl', false);
131
+        performTest('supportsContext', 'experimental-webgl', true);
132
+        performTest('supportsContext', 'experimental-webgl', false);
133
+
134
+        performTest('getContext', 'webgl', true);
135
+        performTest('getContext', 'webgl', false);
136
+        performTest('getContext', 'experimental-webgl', true);
137
+        performTest('getContext', 'experimental-webgl', false);
138
+    </script>
139
+
140
+
141
+
142
+    <h2>WebGL diagnostics</h2>
143
+    <script src="https://cdn.rawgit.com/ashima/webgl-diagnostic/3cc7b376/js/webgldiagdata.js"></script>
144
+    <script src="https://cdn.rawgit.com/ashima/webgl-diagnostic/3cc7b376/js/webgldiagnostic.js"></script>
145
+    <code id="diagnostics-log"></code>
146
+    <script>
147
+        var diagnosticsLogElement = document.getElementById('diagnostics-log');
148
+        diagnosticsLogElement.innerHTML = WebGLDiagnostic.report('canvas');
149
+
150
+        var canvasElement = document.getElementById('canvas');
151
+        var gl = canvasElement.getContext('webgl') || canvasElement.getContext('experimental-webgl');
152
+        var glDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');
153
+        diagnosticsLogElement.innerHTML += '\n';
154
+        if (glDebugRendererInfo) {
155
+            diagnosticsLogElement.innerHTML += 'Unmasked vendor: ' + gl.getParameter(glDebugRendererInfo.UNMASKED_VENDOR_WEBGL) + '\n';
156
+            diagnosticsLogElement.innerHTML += 'Unmasked renderer: ' + gl.getParameter(glDebugRendererInfo.UNMASKED_RENDERER_WEBGL) + '\n';
157
+        } else {
158
+            diagnosticsLogElement.innerHTML += '"WEBGL_debug_renderer_info" extension unavailable'
159
+        }
160
+    </script>
161
+
162
+
163
+</body>
164
+
165
+</html>

+ 48
- 0
node_modules/@mapbox/mapbox-gl-supported/index.html Целия файл

@@ -0,0 +1,48 @@
1
+<!doctype html>
2
+
3
+<html style='height: 100%;'>
4
+
5
+<head>
6
+    <link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
7
+
8
+    <style>
9
+        html, body {
10
+            height: 100%;
11
+        }
12
+
13
+        body {
14
+            display:flex;
15
+            flex-direction: column;
16
+            align-items: center;
17
+            justify-content: center;
18
+        }
19
+
20
+        h1, h2 {
21
+            display: block;
22
+        }
23
+    </style>
24
+</head>
25
+
26
+<body class='fill-gray'>
27
+    <h2 class='fancy center'>Mapbox GL JS is</h2>
28
+    <h1 class='fancy center'>...</h1>
29
+
30
+    <script src='index.js'></script>
31
+    <script>
32
+        var bodyElement = document.body;
33
+        var h1Element = document.getElementsByTagName('h1')[0];
34
+
35
+        if (mapboxgl.supported({failIfMajorPerformanceCaveat: true})) {
36
+            h1Element.innerHTML = 'supported';
37
+            bodyElement.className = 'fill-green';
38
+        } else if (mapboxgl.supported({failIfMajorPerformanceCaveat: false})) {
39
+            h1Element.innerHTML = 'supported with a major performance caveat';
40
+            bodyElement.className = 'fill-orange';
41
+        } else {
42
+            h1Element.innerHTML = 'not supported';
43
+            bodyElement.className = 'fill-red';
44
+        }
45
+    </script>
46
+</body>
47
+
48
+</html>

+ 156
- 0
node_modules/@mapbox/mapbox-gl-supported/index.js Целия файл

@@ -0,0 +1,156 @@
1
+'use strict';
2
+
3
+if (typeof module !== 'undefined' && module.exports) {
4
+    module.exports = isSupported;
5
+} else if (window) {
6
+    window.mapboxgl = window.mapboxgl || {};
7
+    window.mapboxgl.supported = isSupported;
8
+}
9
+
10
+/**
11
+ * Test whether the current browser supports Mapbox GL JS
12
+ * @param {Object} options
13
+ * @param {boolean} [options.failIfMajorPerformanceCaveat=false] Return `false`
14
+ *   if the performance of Mapbox GL JS would be dramatically worse than
15
+ *   expected (i.e. a software renderer is would be used)
16
+ * @return {boolean}
17
+ */
18
+function isSupported(options) {
19
+    return !!(
20
+        isBrowser() &&
21
+        isArraySupported() &&
22
+        isFunctionSupported() &&
23
+        isObjectSupported() &&
24
+        isJSONSupported() &&
25
+        isWorkerSupported() &&
26
+        isUint8ClampedArraySupported() &&
27
+        isArrayBufferSupported() &&
28
+        isWebGLSupportedCached(options && options.failIfMajorPerformanceCaveat)
29
+    );
30
+}
31
+
32
+function isBrowser() {
33
+    return typeof window !== 'undefined' && typeof document !== 'undefined';
34
+}
35
+
36
+function isArraySupported() {
37
+    return (
38
+        Array.prototype &&
39
+        Array.prototype.every &&
40
+        Array.prototype.filter &&
41
+        Array.prototype.forEach &&
42
+        Array.prototype.indexOf &&
43
+        Array.prototype.lastIndexOf &&
44
+        Array.prototype.map &&
45
+        Array.prototype.some &&
46
+        Array.prototype.reduce &&
47
+        Array.prototype.reduceRight &&
48
+        Array.isArray
49
+    );
50
+}
51
+
52
+function isFunctionSupported() {
53
+    return Function.prototype && Function.prototype.bind;
54
+}
55
+
56
+function isObjectSupported() {
57
+    return (
58
+        Object.keys &&
59
+        Object.create &&
60
+        Object.getPrototypeOf &&
61
+        Object.getOwnPropertyNames &&
62
+        Object.isSealed &&
63
+        Object.isFrozen &&
64
+        Object.isExtensible &&
65
+        Object.getOwnPropertyDescriptor &&
66
+        Object.defineProperty &&
67
+        Object.defineProperties &&
68
+        Object.seal &&
69
+        Object.freeze &&
70
+        Object.preventExtensions
71
+    );
72
+}
73
+
74
+function isJSONSupported() {
75
+    return 'JSON' in window && 'parse' in JSON && 'stringify' in JSON;
76
+}
77
+
78
+function isWorkerSupported() {
79
+    if (!('Worker' in window && 'Blob' in window && 'URL' in window)) {
80
+        return false;
81
+    }
82
+
83
+    var blob = new Blob([''], { type: 'text/javascript' });
84
+    var workerURL = URL.createObjectURL(blob);
85
+    var supported;
86
+    var worker;
87
+
88
+    try {
89
+        worker = new Worker(workerURL);
90
+        supported = true;
91
+    } catch (e) {
92
+        supported = false;
93
+    }
94
+
95
+    if (worker) {
96
+        worker.terminate();
97
+    }
98
+    URL.revokeObjectURL(workerURL);
99
+
100
+    return supported;
101
+}
102
+
103
+// IE11 only supports `Uint8ClampedArray` as of version
104
+// [KB2929437](https://support.microsoft.com/en-us/kb/2929437)
105
+function isUint8ClampedArraySupported() {
106
+    return 'Uint8ClampedArray' in window;
107
+}
108
+
109
+// https://github.com/mapbox/mapbox-gl-supported/issues/19
110
+function isArrayBufferSupported() {
111
+    return ArrayBuffer.isView;
112
+}
113
+
114
+var isWebGLSupportedCache = {};
115
+function isWebGLSupportedCached(failIfMajorPerformanceCaveat) {
116
+
117
+    if (isWebGLSupportedCache[failIfMajorPerformanceCaveat] === undefined) {
118
+        isWebGLSupportedCache[failIfMajorPerformanceCaveat] = isWebGLSupported(failIfMajorPerformanceCaveat);
119
+    }
120
+
121
+    return isWebGLSupportedCache[failIfMajorPerformanceCaveat];
122
+}
123
+
124
+isSupported.webGLContextAttributes = {
125
+    antialias: false,
126
+    alpha: true,
127
+    stencil: true,
128
+    depth: true
129
+};
130
+
131
+function isWebGLSupported(failIfMajorPerformanceCaveat) {
132
+
133
+    var canvas = document.createElement('canvas');
134
+
135
+    var attributes = Object.create(isSupported.webGLContextAttributes);
136
+    attributes.failIfMajorPerformanceCaveat = failIfMajorPerformanceCaveat;
137
+
138
+    if (canvas.probablySupportsContext) {
139
+        return (
140
+            canvas.probablySupportsContext('webgl', attributes) ||
141
+            canvas.probablySupportsContext('experimental-webgl', attributes)
142
+        );
143
+
144
+    } else if (canvas.supportsContext) {
145
+        return (
146
+            canvas.supportsContext('webgl', attributes) ||
147
+            canvas.supportsContext('experimental-webgl', attributes)
148
+        );
149
+
150
+    } else {
151
+        return (
152
+            canvas.getContext('webgl', attributes) ||
153
+            canvas.getContext('experimental-webgl', attributes)
154
+        );
155
+    }
156
+}

+ 51
- 0
node_modules/@mapbox/mapbox-gl-supported/package.json Целия файл

@@ -0,0 +1,51 @@
1
+{
2
+  "_from": "@mapbox/mapbox-gl-supported@^1.4.0",
3
+  "_id": "@mapbox/mapbox-gl-supported@1.4.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-ZD0Io4XK+/vU/4zpANjOtdWfVszAgnaMPsGR6LKsWh4kLIEv9qoobTVmJPPuwuM+ZI2b3BlZ6DYw1XHVmv6YTA==",
6
+  "_location": "/@mapbox/mapbox-gl-supported",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@mapbox/mapbox-gl-supported@^1.4.0",
12
+    "name": "@mapbox/mapbox-gl-supported",
13
+    "escapedName": "@mapbox%2fmapbox-gl-supported",
14
+    "scope": "@mapbox",
15
+    "rawSpec": "^1.4.0",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^1.4.0"
18
+  },
19
+  "_requiredBy": [
20
+    "/mapbox-gl"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@mapbox/mapbox-gl-supported/-/mapbox-gl-supported-1.4.0.tgz",
23
+  "_shasum": "36946b22944fe2cfa43cfafd5ef36fdb54a069e4",
24
+  "_spec": "@mapbox/mapbox-gl-supported@^1.4.0",
25
+  "_where": "/Users/jamess/Labs/dasboot/node_modules/mapbox-gl",
26
+  "bugs": {
27
+    "url": "https://github.com/mapbox/mapbox-gl-supported/issues"
28
+  },
29
+  "bundleDependencies": false,
30
+  "deprecated": false,
31
+  "description": "A library to determine if a browser supports Mapbox GL JS",
32
+  "devDependencies": {
33
+    "browserify": "^11.2.0",
34
+    "eslint": "^2.8.0",
35
+    "eslint-config-mourner": "^2.0.1",
36
+    "uglify-js": "^2.4.24"
37
+  },
38
+  "homepage": "https://github.com/mapbox/mapbox-gl-supported#readme",
39
+  "license": "BSD-3-Clause",
40
+  "main": "index.js",
41
+  "name": "@mapbox/mapbox-gl-supported",
42
+  "repository": {
43
+    "type": "git",
44
+    "url": "git+https://github.com/mapbox/mapbox-gl-supported.git"
45
+  },
46
+  "scripts": {
47
+    "build": "mkdir -p dist && uglifyjs index.js -c -m -o dist/mapbox-gl-supported.js",
48
+    "test": "eslint index.js"
49
+  },
50
+  "version": "1.4.0"
51
+}

+ 8
- 0
node_modules/@mapbox/point-geometry/.travis.yml Целия файл

@@ -0,0 +1,8 @@
1
+language: node_js
2
+node_js:
3
+  - "0.10"
4
+before_install:
5
+  - npm install -g npm@~1.4.6
6
+script:
7
+  - npm test
8
+  - npm run cov

+ 5
- 0
node_modules/@mapbox/point-geometry/HISTORY.md Целия файл

@@ -0,0 +1,5 @@
1
+## 0.1.0
2
+
3
+* Adds [rotateAround](https://github.com/mapbox/point-geometry/pull/5) and
4
+  [multByPoint](https://github.com/mapbox/point-geometry/pull/7) and divByPoint
5
+  methods.

+ 13
- 0
node_modules/@mapbox/point-geometry/LICENSE Целия файл

@@ -0,0 +1,13 @@
1
+Copyright (c) 2015, Mapbox <>
2
+
3
+Permission to use, copy, modify, and/or distribute this software for any
4
+purpose with or without fee is hereby granted, provided that the above
5
+copyright notice and this permission notice appear in all copies.
6
+
7
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+ 364
- 0
node_modules/@mapbox/point-geometry/README.md Целия файл

@@ -0,0 +1,364 @@
1
+# point-geometry
2
+
3
+[![build status](https://secure.travis-ci.org/mapbox/point-geometry.png)](http://travis-ci.org/mapbox/point-geometry) [![Coverage Status](https://coveralls.io/repos/mapbox/point-geometry/badge.svg?branch=master)](https://coveralls.io/r/mapbox/point-geometry?branch=master)
4
+
5
+a point geometry with transforms
6
+
7
+
8
+### `Point(x, y)`
9
+
10
+A standalone point geometry with useful accessor, comparison, and
11
+modification methods.
12
+
13
+
14
+### Parameters
15
+
16
+| parameter | type   | description                                                                            |
17
+| --------- | ------ | -------------------------------------------------------------------------------------- |
18
+| `x`       | Number | the x-coordinate. this could be longitude or screen pixels, or any other sort of unit. |
19
+| `y`       | Number | the y-coordinate. this could be latitude or screen pixels, or any other sort of unit.  |
20
+
21
+
22
+### Example
23
+
24
+```js
25
+var point = new Point(-77, 38);
26
+```
27
+
28
+
29
+### `clone`
30
+
31
+Clone this point, returning a new point that can be modified
32
+without affecting the old one.
33
+
34
+
35
+**Returns** `Point`, the clone
36
+
37
+
38
+### `add(p)`
39
+
40
+Add this point's x & y coordinates to another point,
41
+yielding a new point.
42
+
43
+### Parameters
44
+
45
+| parameter | type  | description     |
46
+| --------- | ----- | --------------- |
47
+| `p`       | Point | the other point |
48
+
49
+
50
+
51
+**Returns** `Point`, output point
52
+
53
+
54
+### `sub(p)`
55
+
56
+Subtract this point's x & y coordinates to from point,
57
+yielding a new point.
58
+
59
+### Parameters
60
+
61
+| parameter | type  | description     |
62
+| --------- | ----- | --------------- |
63
+| `p`       | Point | the other point |
64
+
65
+
66
+
67
+**Returns** `Point`, output point
68
+
69
+
70
+### `multByPoint(p)`
71
+
72
+Multiply this point's x & y coordinates by point,
73
+yielding a new point.
74
+
75
+### Parameters
76
+
77
+| parameter | type  | description     |
78
+| --------- | ----- | --------------- |
79
+| `p`       | Point | the other point |
80
+
81
+
82
+
83
+**Returns** `Point`, output point
84
+
85
+
86
+### `divByPoint(p)`
87
+
88
+Divide this point's x & y coordinates by point,
89
+yielding a new point.
90
+
91
+### Parameters
92
+
93
+| parameter | type  | description     |
94
+| --------- | ----- | --------------- |
95
+| `p`       | Point | the other point |
96
+
97
+
98
+
99
+**Returns** `Point`, output point
100
+
101
+
102
+### `mult(k)`
103
+
104
+Multiply this point's x & y coordinates by a factor,
105
+yielding a new point.
106
+
107
+### Parameters
108
+
109
+| parameter | type  | description |
110
+| --------- | ----- | ----------- |
111
+| `k`       | Point | factor      |
112
+
113
+
114
+
115
+**Returns** `Point`, output point
116
+
117
+
118
+### `div(k)`
119
+
120
+Divide this point's x & y coordinates by a factor,
121
+yielding a new point.
122
+
123
+### Parameters
124
+
125
+| parameter | type  | description |
126
+| --------- | ----- | ----------- |
127
+| `k`       | Point | factor      |
128
+
129
+
130
+
131
+**Returns** `Point`, output point
132
+
133
+
134
+### `rotate(a)`
135
+
136
+Rotate this point around the 0, 0 origin by an angle a,
137
+given in radians
138
+
139
+### Parameters
140
+
141
+| parameter | type   | description                        |
142
+| --------- | ------ | ---------------------------------- |
143
+| `a`       | Number | angle to rotate around, in radians |
144
+
145
+
146
+
147
+**Returns** `Point`, output point
148
+
149
+
150
+### `rotateAround(a, p)`
151
+
152
+Rotate this point around p point by an angle a,
153
+given in radians
154
+
155
+### Parameters
156
+
157
+| parameter | type   | description                        |
158
+| --------- | ------ | ---------------------------------- |
159
+| `a`       | Number | angle to rotate around, in radians |
160
+| `p`       | Point  | Point to rotate around             |
161
+
162
+
163
+
164
+**Returns** `Point`, output point
165
+
166
+
167
+### `matMult(m)`
168
+
169
+Multiply this point by a 4x1 transformation matrix
170
+
171
+### Parameters
172
+
173
+| parameter | type              | description           |
174
+| --------- | ----------------- | --------------------- |
175
+| `m`       | Array\.\<Number\> | transformation matrix |
176
+
177
+
178
+
179
+**Returns** `Point`, output point
180
+
181
+
182
+### `unit`
183
+
184
+Calculate this point but as a unit vector from 0, 0, meaning
185
+that the distance from the resulting point to the 0, 0
186
+coordinate will be equal to 1 and the angle from the resulting
187
+point to the 0, 0 coordinate will be the same as before.
188
+
189
+
190
+**Returns** `Point`, unit vector point
191
+
192
+
193
+### `perp`
194
+
195
+Compute a perpendicular point, where the new y coordinate
196
+is the old x coordinate and the new x coordinate is the old y
197
+coordinate multiplied by -1
198
+
199
+
200
+**Returns** `Point`, perpendicular point
201
+
202
+
203
+### `round`
204
+
205
+Return a version of this point with the x & y coordinates
206
+rounded to integers.
207
+
208
+
209
+**Returns** `Point`, rounded point
210
+
211
+
212
+### `mag`
213
+
214
+Return the magitude of this point: this is the Euclidean
215
+distance from the 0, 0 coordinate to this point's x and y
216
+coordinates.
217
+
218
+
219
+**Returns** `Number`, magnitude
220
+
221
+
222
+### `equals(other)`
223
+
224
+Judge whether this point is equal to another point, returning
225
+true or false.
226
+
227
+### Parameters
228
+
229
+| parameter | type  | description     |
230
+| --------- | ----- | --------------- |
231
+| `other`   | Point | the other point |
232
+
233
+
234
+
235
+**Returns** `boolean`, whether the points are equal
236
+
237
+
238
+### `dist(p)`
239
+
240
+Calculate the distance from this point to another point
241
+
242
+### Parameters
243
+
244
+| parameter | type  | description     |
245
+| --------- | ----- | --------------- |
246
+| `p`       | Point | the other point |
247
+
248
+
249
+
250
+**Returns** `Number`, distance
251
+
252
+
253
+### `distSqr(p)`
254
+
255
+Calculate the distance from this point to another point,
256
+without the square root step. Useful if you're comparing
257
+relative distances.
258
+
259
+### Parameters
260
+
261
+| parameter | type  | description     |
262
+| --------- | ----- | --------------- |
263
+| `p`       | Point | the other point |
264
+
265
+
266
+
267
+**Returns** `Number`, distance
268
+
269
+
270
+### `angle`
271
+
272
+Get the angle from the 0, 0 coordinate to this point, in radians
273
+coordinates.
274
+
275
+
276
+**Returns** `Number`, angle
277
+
278
+
279
+### `angleTo(b)`
280
+
281
+Get the angle from this point to another point, in radians
282
+
283
+### Parameters
284
+
285
+| parameter | type  | description     |
286
+| --------- | ----- | --------------- |
287
+| `b`       | Point | the other point |
288
+
289
+
290
+
291
+**Returns** `Number`, angle
292
+
293
+
294
+### `angleWith(b)`
295
+
296
+Get the angle between this point and another point, in radians
297
+
298
+### Parameters
299
+
300
+| parameter | type  | description     |
301
+| --------- | ----- | --------------- |
302
+| `b`       | Point | the other point |
303
+
304
+
305
+
306
+**Returns** `Number`, angle
307
+
308
+
309
+### `angleWithSep(x, y)`
310
+
311
+Find the angle of the two vectors, solving the formula for
312
+the cross product a x b = |a||b|sin(θ) for θ.
313
+
314
+### Parameters
315
+
316
+| parameter | type   | description      |
317
+| --------- | ------ | ---------------- |
318
+| `x`       | Number | the x-coordinate |
319
+| `y`       | Number | the y-coordinate |
320
+
321
+
322
+
323
+**Returns** `Number`, the angle in radians
324
+
325
+
326
+### `convert(a)`
327
+
328
+Construct a point from an array if necessary, otherwise if the input
329
+is already a Point, or an unknown type, return it unchanged
330
+
331
+### Parameters
332
+
333
+| parameter | type                     | description             |
334
+| --------- | ------------------------ | ----------------------- |
335
+| `a`       | Array\.\<Number\>\,Point | any kind of input value |
336
+
337
+
338
+### Example
339
+
340
+```js
341
+// this
342
+var point = Point.convert([0, 1]);
343
+// is equivalent to
344
+var point = new Point(0, 1);
345
+```
346
+
347
+
348
+**Returns** `Point`, constructed point, or passed-through value.
349
+
350
+## Installation
351
+
352
+Requires [nodejs](http://nodejs.org/).
353
+
354
+```sh
355
+$ npm install point-geometry
356
+```
357
+
358
+## Tests
359
+
360
+```sh
361
+$ npm test
362
+```
363
+
364
+

+ 312
- 0
node_modules/@mapbox/point-geometry/index.js Целия файл

@@ -0,0 +1,312 @@
1
+'use strict';
2
+
3
+module.exports = Point;
4
+
5
+/**
6
+ * A standalone point geometry with useful accessor, comparison, and
7
+ * modification methods.
8
+ *
9
+ * @class Point
10
+ * @param {Number} x the x-coordinate. this could be longitude or screen
11
+ * pixels, or any other sort of unit.
12
+ * @param {Number} y the y-coordinate. this could be latitude or screen
13
+ * pixels, or any other sort of unit.
14
+ * @example
15
+ * var point = new Point(-77, 38);
16
+ */
17
+function Point(x, y) {
18
+    this.x = x;
19
+    this.y = y;
20
+}
21
+
22
+Point.prototype = {
23
+
24
+    /**
25
+     * Clone this point, returning a new point that can be modified
26
+     * without affecting the old one.
27
+     * @return {Point} the clone
28
+     */
29
+    clone: function() { return new Point(this.x, this.y); },
30
+
31
+    /**
32
+     * Add this point's x & y coordinates to another point,
33
+     * yielding a new point.
34
+     * @param {Point} p the other point
35
+     * @return {Point} output point
36
+     */
37
+    add:     function(p) { return this.clone()._add(p); },
38
+
39
+    /**
40
+     * Subtract this point's x & y coordinates to from point,
41
+     * yielding a new point.
42
+     * @param {Point} p the other point
43
+     * @return {Point} output point
44
+     */
45
+    sub:     function(p) { return this.clone()._sub(p); },
46
+
47
+    /**
48
+     * Multiply this point's x & y coordinates by point,
49
+     * yielding a new point.
50
+     * @param {Point} p the other point
51
+     * @return {Point} output point
52
+     */
53
+    multByPoint:    function(p) { return this.clone()._multByPoint(p); },
54
+
55
+    /**
56
+     * Divide this point's x & y coordinates by point,
57
+     * yielding a new point.
58
+     * @param {Point} p the other point
59
+     * @return {Point} output point
60
+     */
61
+    divByPoint:     function(p) { return this.clone()._divByPoint(p); },
62
+
63
+    /**
64
+     * Multiply this point's x & y coordinates by a factor,
65
+     * yielding a new point.
66
+     * @param {Point} k factor
67
+     * @return {Point} output point
68
+     */
69
+    mult:    function(k) { return this.clone()._mult(k); },
70
+
71
+    /**
72
+     * Divide this point's x & y coordinates by a factor,
73
+     * yielding a new point.
74
+     * @param {Point} k factor
75
+     * @return {Point} output point
76
+     */
77
+    div:     function(k) { return this.clone()._div(k); },
78
+
79
+    /**
80
+     * Rotate this point around the 0, 0 origin by an angle a,
81
+     * given in radians
82
+     * @param {Number} a angle to rotate around, in radians
83
+     * @return {Point} output point
84
+     */
85
+    rotate:  function(a) { return this.clone()._rotate(a); },
86
+
87
+    /**
88
+     * Rotate this point around p point by an angle a,
89
+     * given in radians
90
+     * @param {Number} a angle to rotate around, in radians
91
+     * @param {Point} p Point to rotate around
92
+     * @return {Point} output point
93
+     */
94
+    rotateAround:  function(a,p) { return this.clone()._rotateAround(a,p); },
95
+
96
+    /**
97
+     * Multiply this point by a 4x1 transformation matrix
98
+     * @param {Array<Number>} m transformation matrix
99
+     * @return {Point} output point
100
+     */
101
+    matMult: function(m) { return this.clone()._matMult(m); },
102
+
103
+    /**
104
+     * Calculate this point but as a unit vector from 0, 0, meaning
105
+     * that the distance from the resulting point to the 0, 0
106
+     * coordinate will be equal to 1 and the angle from the resulting
107
+     * point to the 0, 0 coordinate will be the same as before.
108
+     * @return {Point} unit vector point
109
+     */
110
+    unit:    function() { return this.clone()._unit(); },
111
+
112
+    /**
113
+     * Compute a perpendicular point, where the new y coordinate
114
+     * is the old x coordinate and the new x coordinate is the old y
115
+     * coordinate multiplied by -1
116
+     * @return {Point} perpendicular point
117
+     */
118
+    perp:    function() { return this.clone()._perp(); },
119
+
120
+    /**
121
+     * Return a version of this point with the x & y coordinates
122
+     * rounded to integers.
123
+     * @return {Point} rounded point
124
+     */
125
+    round:   function() { return this.clone()._round(); },
126
+
127
+    /**
128
+     * Return the magitude of this point: this is the Euclidean
129
+     * distance from the 0, 0 coordinate to this point's x and y
130
+     * coordinates.
131
+     * @return {Number} magnitude
132
+     */
133
+    mag: function() {
134
+        return Math.sqrt(this.x * this.x + this.y * this.y);
135
+    },
136
+
137
+    /**
138
+     * Judge whether this point is equal to another point, returning
139
+     * true or false.
140
+     * @param {Point} other the other point
141
+     * @return {boolean} whether the points are equal
142
+     */
143
+    equals: function(other) {
144
+        return this.x === other.x &&
145
+               this.y === other.y;
146
+    },
147
+
148
+    /**
149
+     * Calculate the distance from this point to another point
150
+     * @param {Point} p the other point
151
+     * @return {Number} distance
152
+     */
153
+    dist: function(p) {
154
+        return Math.sqrt(this.distSqr(p));
155
+    },
156
+
157
+    /**
158
+     * Calculate the distance from this point to another point,
159
+     * without the square root step. Useful if you're comparing
160
+     * relative distances.
161
+     * @param {Point} p the other point
162
+     * @return {Number} distance
163
+     */
164
+    distSqr: function(p) {
165
+        var dx = p.x - this.x,
166
+            dy = p.y - this.y;
167
+        return dx * dx + dy * dy;
168
+    },
169
+
170
+    /**
171
+     * Get the angle from the 0, 0 coordinate to this point, in radians
172
+     * coordinates.
173
+     * @return {Number} angle
174
+     */
175
+    angle: function() {
176
+        return Math.atan2(this.y, this.x);
177
+    },
178
+
179
+    /**
180
+     * Get the angle from this point to another point, in radians
181
+     * @param {Point} b the other point
182
+     * @return {Number} angle
183
+     */
184
+    angleTo: function(b) {
185
+        return Math.atan2(this.y - b.y, this.x - b.x);
186
+    },
187
+
188
+    /**
189
+     * Get the angle between this point and another point, in radians
190
+     * @param {Point} b the other point
191
+     * @return {Number} angle
192
+     */
193
+    angleWith: function(b) {
194
+        return this.angleWithSep(b.x, b.y);
195
+    },
196
+
197
+    /*
198
+     * Find the angle of the two vectors, solving the formula for
199
+     * the cross product a x b = |a||b|sin(θ) for θ.
200
+     * @param {Number} x the x-coordinate
201
+     * @param {Number} y the y-coordinate
202
+     * @return {Number} the angle in radians
203
+     */
204
+    angleWithSep: function(x, y) {
205
+        return Math.atan2(
206
+            this.x * y - this.y * x,
207
+            this.x * x + this.y * y);
208
+    },
209
+
210
+    _matMult: function(m) {
211
+        var x = m[0] * this.x + m[1] * this.y,
212
+            y = m[2] * this.x + m[3] * this.y;
213
+        this.x = x;
214
+        this.y = y;
215
+        return this;
216
+    },
217
+
218
+    _add: function(p) {
219
+        this.x += p.x;
220
+        this.y += p.y;
221
+        return this;
222
+    },
223
+
224
+    _sub: function(p) {
225
+        this.x -= p.x;
226
+        this.y -= p.y;
227
+        return this;
228
+    },
229
+
230
+    _mult: function(k) {
231
+        this.x *= k;
232
+        this.y *= k;
233
+        return this;
234
+    },
235
+
236
+    _div: function(k) {
237
+        this.x /= k;
238
+        this.y /= k;
239
+        return this;
240
+    },
241
+
242
+    _multByPoint: function(p) {
243
+        this.x *= p.x;
244
+        this.y *= p.y;
245
+        return this;
246
+    },
247
+
248
+    _divByPoint: function(p) {
249
+        this.x /= p.x;
250
+        this.y /= p.y;
251
+        return this;
252
+    },
253
+
254
+    _unit: function() {
255
+        this._div(this.mag());
256
+        return this;
257
+    },
258
+
259
+    _perp: function() {
260
+        var y = this.y;
261
+        this.y = this.x;
262
+        this.x = -y;
263
+        return this;
264
+    },
265
+
266
+    _rotate: function(angle) {
267
+        var cos = Math.cos(angle),
268
+            sin = Math.sin(angle),
269
+            x = cos * this.x - sin * this.y,
270
+            y = sin * this.x + cos * this.y;
271
+        this.x = x;
272
+        this.y = y;
273
+        return this;
274
+    },
275
+
276
+    _rotateAround: function(angle, p) {
277
+        var cos = Math.cos(angle),
278
+            sin = Math.sin(angle),
279
+            x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),
280
+            y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);
281
+        this.x = x;
282
+        this.y = y;
283
+        return this;
284
+    },
285
+
286
+    _round: function() {
287
+        this.x = Math.round(this.x);
288
+        this.y = Math.round(this.y);
289
+        return this;
290
+    }
291
+};
292
+
293
+/**
294
+ * Construct a point from an array if necessary, otherwise if the input
295
+ * is already a Point, or an unknown type, return it unchanged
296
+ * @param {Array<Number>|Point|*} a any kind of input value
297
+ * @return {Point} constructed point, or passed-through value.
298
+ * @example
299
+ * // this
300
+ * var point = Point.convert([0, 1]);
301
+ * // is equivalent to
302
+ * var point = new Point(0, 1);
303
+ */
304
+Point.convert = function (a) {
305
+    if (a instanceof Point) {
306
+        return a;
307
+    }
308
+    if (Array.isArray(a)) {
309
+        return new Point(a[0], a[1]);
310
+    }
311
+    return a;
312
+};

+ 63
- 0
node_modules/@mapbox/point-geometry/package.json Целия файл

@@ -0,0 +1,63 @@
1
+{
2
+  "_from": "@mapbox/point-geometry@^0.1.0",
3
+  "_id": "@mapbox/point-geometry@0.1.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-ioP5M1x4YO/6Lu7KJUMyqgru2PI=",
6
+  "_location": "/@mapbox/point-geometry",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@mapbox/point-geometry@^0.1.0",
12
+    "name": "@mapbox/point-geometry",
13
+    "escapedName": "@mapbox%2fpoint-geometry",
14
+    "scope": "@mapbox",
15
+    "rawSpec": "^0.1.0",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^0.1.0"
18
+  },
19
+  "_requiredBy": [
20
+    "/@mapbox/vector-tile",
21
+    "/mapbox-gl",
22
+    "/vt-pbf"
23
+  ],
24
+  "_resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz",
25
+  "_shasum": "8a83f9335c7860effa2eeeca254332aa0aeed8f2",
26
+  "_spec": "@mapbox/point-geometry@^0.1.0",
27
+  "_where": "/Users/jamess/Labs/dasboot/node_modules/mapbox-gl",
28
+  "author": {
29
+    "name": "Tom MacWright"
30
+  },
31
+  "bugs": {
32
+    "url": "https://github.com/mapbox/point-geometry/issues"
33
+  },
34
+  "bundleDependencies": false,
35
+  "deprecated": false,
36
+  "description": "a point geometry with transforms",
37
+  "devDependencies": {
38
+    "coveralls": "~2.10.1",
39
+    "dox": "^0.6.1",
40
+    "doxme": "^1.8.2",
41
+    "istanbul": "~0.2.11",
42
+    "tape": "~2.13.3"
43
+  },
44
+  "homepage": "https://github.com/mapbox/point-geometry",
45
+  "keywords": [
46
+    "point",
47
+    "geometry",
48
+    "primitive"
49
+  ],
50
+  "license": "ISC",
51
+  "main": "index.js",
52
+  "name": "@mapbox/point-geometry",
53
+  "repository": {
54
+    "type": "git",
55
+    "url": "git+ssh://git@github.com/mapbox/point-geometry.git"
56
+  },
57
+  "scripts": {
58
+    "cov": "istanbul cover test.js && coveralls < ./coverage/lcov.info",
59
+    "doc": "dox -r < index.js | doxme --readme > README.md",
60
+    "test": "tape test.js"
61
+  },
62
+  "version": "0.1.0"
63
+}

+ 139
- 0
node_modules/@mapbox/point-geometry/test.js Целия файл

@@ -0,0 +1,139 @@
1
+'use strict';
2
+var test = require('tape').test;
3
+
4
+var Point = require('./');
5
+
6
+test('Point', function(t) {
7
+    t.test('.convert', function(t) {
8
+        t.equal(Point.convert(new Point(20, 30)).equals(new Point(20, 30)), true);
9
+        t.equal(Point.convert([20, 30]).equals(new Point(20, 30)), true);
10
+        t.equal(Point.convert('somestring'), 'somestring');
11
+        t.end();
12
+    });
13
+    t.test('vector operations', function(t) {
14
+        t.test('#mag', function(t) {
15
+            t.test('gets the magnitude of a vector', function() {
16
+                t.equal(new Point(0, 2).mag(), 2);
17
+                t.equal(new Point(0, 0).mag(), 0);
18
+                t.equal(new Point(10, 0).mag(), 10);
19
+                t.end();
20
+            });
21
+        });
22
+        t.test('#unit', function(t) {
23
+            t.test('calculates the unit vector', function() {
24
+                t.deepEqual(new Point(0, 1000).unit(), new Point(0, 1));
25
+                t.end();
26
+            });
27
+        });
28
+        t.test('#equals', function(t) {
29
+            t.equals((new Point(0, 0).equals(new Point(0, 0))), true, 'equal');
30
+            t.equals((new Point(0, 0).equals(new Point(0, 10))), false, 'not equal');
31
+            t.end();
32
+        });
33
+        t.test('#dist', function(t) {
34
+            t.equals((new Point(0, 10).dist(new Point(0, 0))), 10);
35
+            t.equals((new Point(Math.sqrt(2), Math.sqrt(2)).dist(new Point(0, 0))), 2);
36
+            t.equals((new Point(0, 0).dist(new Point(0, 0))), 0);
37
+            t.end();
38
+        });
39
+        t.test('#mult', function(t) {
40
+            t.equals((new Point(0, 0).mult(5)).equals(new Point(0, 0)), true);
41
+            t.equals((new Point(0, 1).mult(5)).equals(new Point(0, 5)), true);
42
+            t.equals((new Point(1, 1).mult(5)).equals(new Point(5, 5)), true);
43
+            t.end();
44
+        });
45
+        t.test('#div', function(t) {
46
+            t.equals((new Point(0, 0).div(5)).equals(new Point(0, 0)), true);
47
+            t.equals((new Point(0, 1).div(5)).equals(new Point(0, 1/5)), true);
48
+            t.equals((new Point(1, 1).div(5)).equals(new Point(1/5, 1/5)), true);
49
+            t.end();
50
+        });
51
+        t.test('#multByPoint', function(t) {
52
+            t.equals((new Point(0, 0).multByPoint(new Point(5,5))).equals(new Point(0, 0)), true);
53
+            t.equals((new Point(0, 1).multByPoint(new Point(5,5))).equals(new Point(0, 5)), true);
54
+            t.equals((new Point(1, 1).multByPoint(new Point(4,5))).equals(new Point(4, 5)), true);
55
+            t.end();
56
+        });
57
+        t.test('#divByPoint', function(t) {
58
+            t.equals((new Point(0, 0).divByPoint(new Point(5,5))).equals(new Point(0, 0)), true);
59
+            t.equals((new Point(0, 1).divByPoint(new Point(5,5))).equals(new Point(0, 1/5)), true);
60
+            t.equals((new Point(1, 1).divByPoint(new Point(4,5))).equals(new Point(1/4, 1/5)), true);
61
+            t.end();
62
+        });
63
+        t.test('#rotate', function(t) {
64
+            t.equals((new Point(0, 0).rotate(0)).equals(new Point(0, 0)), true);
65
+            t.deepEquals((new Point(0, 1).rotate(Math.PI/2)).round(), new Point(-1, 0));
66
+            t.deepEquals((new Point(0, 1).rotate(Math.PI)).round(), new Point(0, -1));
67
+            t.end();
68
+        });
69
+        t.test('#rotateAround', function(t) {
70
+            t.deepEquals((new Point(2, 3).rotateAround(Math.PI/2, new Point(2,2))).round(), new Point(1, 2));
71
+            t.deepEquals((new Point(2, 3).rotateAround(Math.PI, new Point(2,2))).round(), new Point(2, 1));
72
+            t.end();
73
+        });
74
+        t.test('#round', function(t) {
75
+            t.equals((new Point(0, 0).round()).equals(new Point(0, 0)), true);
76
+            t.equals((new Point(0, 0.5).round()).equals(new Point(0, 1)), true);
77
+            t.equals((new Point(0.2, 0.2).round()).equals(new Point(0, 0)), true);
78
+            t.end();
79
+        });
80
+        t.test('#angle', function(t) {
81
+            t.equals((new Point(0, 0).angle()), 0);
82
+            t.equals((new Point(10, 10).angle()), Math.PI / 4);
83
+            t.equals((new Point(0, 10).angle()), Math.PI / 2);
84
+            t.equals((new Point(10, 0).angle()), 0);
85
+            t.end();
86
+        });
87
+        t.test('#angleTo', function(t) {
88
+            var b = new Point(0, 0);
89
+            t.equals((new Point(0, 0).angleTo(b)), 0);
90
+            t.equals((new Point(10, 10).angleTo(b)), Math.PI / 4);
91
+            t.equals((new Point(0, 10).angleTo(b)), Math.PI / 2);
92
+            t.equals((new Point(10, 0).angleTo(b)), 0);
93
+            t.end();
94
+        });
95
+        t.test('#angleWith', function(t) {
96
+            var b = new Point(0, 0);
97
+            t.equals((new Point(0, 0).angleWith(b)), 0);
98
+            t.equals((new Point(10, 10).angleWith(b)), 0);
99
+            t.equals((new Point(0, 10).angleWith(b)), 0);
100
+            t.equals((new Point(10, 0).angleWith(b)), 0);
101
+            t.end();
102
+        });
103
+        t.test('#angleWithSep', function(t) {
104
+            t.equals((new Point(0, 0).angleWithSep(0, 0)), 0);
105
+            t.equals((new Point(10, 10).angleWithSep(0, 0)), 0);
106
+            t.equals((new Point(0, 10).angleWithSep(0, 0)), 0);
107
+            t.equals((new Point(10, 0).angleWithSep(0, 0)), 0);
108
+            t.end();
109
+        });
110
+        t.test('#matMult', function(t) {
111
+            t.equals((new Point(0, 0).matMult([0, 0, 0, 0])).equals(new Point(0, 0)), true);
112
+            t.deepEquals((new Point(1, 1).matMult([0, 0, 0, 0])), new Point(0, 0));
113
+            t.deepEquals((new Point(1, 1).matMult([1, 0, 1, 0])), new Point(1, 1));
114
+            t.deepEquals((new Point(1, 1).matMult([1, 0, 0, 0])), new Point(1, 0));
115
+            t.deepEquals((new Point(1, 1).matMult([0, 0, 1, 0])), new Point(0, 1));
116
+            t.deepEquals((new Point(1, 1).matMult([0, 0, 1, 2])), new Point(0, 3));
117
+            t.deepEquals((new Point(1, 1).matMult([1, 1, 1, 1])), new Point(2, 2));
118
+            t.end();
119
+        });
120
+        t.test('#perp', function(t) {
121
+            t.test('calculates a vector perpendicular to the given vector', function() {
122
+                t.deepEqual(new Point(0, 1000).perp(), new Point(-1000, 0));
123
+                t.end();
124
+            });
125
+        });
126
+        t.test('#add', function(t) {
127
+            t.test('adds two vectors', function() {
128
+                t.deepEqual(new Point(0, 0).add(new Point(10, 10)), new Point(10, 10));
129
+                t.end();
130
+            });
131
+        });
132
+        t.test('#sub', function(t) {
133
+            t.test('adds subtracts a vector from another', function() {
134
+                t.deepEqual(new Point(0, 0).sub(new Point(10, 10)), new Point(-10, -10));
135
+                t.end();
136
+            });
137
+        });
138
+    });
139
+});

+ 63
- 0
node_modules/@mapbox/shelf-pack/.eslintrc Целия файл

@@ -0,0 +1,63 @@
1
+{
2
+    "env": {
3
+        "browser": true,
4
+        "node": true,
5
+        "es6": true
6
+    },
7
+    "parserOptions": {
8
+        "ecmaVersion": 6,
9
+        "sourceType": "module"
10
+    },
11
+    "extends": [
12
+        "eslint:recommended"
13
+    ],
14
+    "rules": {
15
+        "dot-notation": "error",
16
+        "eqeqeq": ["error", "smart"],
17
+        "indent": ["off", 4],
18
+        "keyword-spacing": "error",
19
+        "linebreak-style": ["error", "unix"],
20
+        "no-caller": "error",
21
+        "no-catch-shadow": "error",
22
+        "no-div-regex": "error",
23
+        "no-extend-native": "error",
24
+        "no-extra-bind": "error",
25
+        "no-floating-decimal": "error",
26
+        "no-implied-eval": "error",
27
+        "no-invalid-this": "error",
28
+        "no-iterator": "error",
29
+        "no-labels": "error",
30
+        "no-label-var": "error",
31
+        "no-lone-blocks": "error",
32
+        "no-loop-func": "error",
33
+        "no-multi-str": "error",
34
+        "no-native-reassign": "error",
35
+        "no-new": "error",
36
+        "no-new-func": "error",
37
+        "no-new-wrappers": "error",
38
+        "no-octal": "error",
39
+        "no-octal-escape": "error",
40
+        "no-process-env": "error",
41
+        "no-proto": "error",
42
+        "no-return-assign": "off",
43
+        "no-script-url": "error",
44
+        "no-self-compare": "error",
45
+        "no-sequences": "error",
46
+        "no-shadow": "off",
47
+        "no-shadow-restricted-names": "error",
48
+        "no-throw-literal": "error",
49
+        "no-unneeded-ternary": "error",
50
+        "no-unused-expressions": "error",
51
+        "no-unexpected-multiline": "error",
52
+        "no-unused-vars": "warn",
53
+        "no-void": "error",
54
+        "no-warning-comments": "warn",
55
+        "no-with": "error",
56
+        "no-use-before-define": ["off", "nofunc"],
57
+        "semi": ["error", "always"],
58
+        "semi-spacing": "error",
59
+        "space-unary-ops": "error",
60
+        "wrap-regex": "off",
61
+        "quotes": ["error", "single"]
62
+    }
63
+}

+ 10
- 0
node_modules/@mapbox/shelf-pack/.npmignore Целия файл

@@ -0,0 +1,10 @@
1
+.DS_Store
2
+.nyc_output/
3
+bench/
4
+circle.yml
5
+coverage/
6
+docs/
7
+node_modules/
8
+npm-debug.log
9
+RELEASE.md
10
+test/

+ 5
- 0
node_modules/@mapbox/shelf-pack/.travis.yml Целия файл

@@ -0,0 +1,5 @@
1
+language: node_js
2
+node_js:
3
+  - "4"
4
+  - "6"
5
+  - "8"

+ 41
- 0
node_modules/@mapbox/shelf-pack/CHANGELOG.md Целия файл

@@ -0,0 +1,41 @@
1
+:warning: = Breaking change
2
+
3
+## 3.1.0
4
+##### 2017-Aug-25
5
+* Provide shrink as a public method (#90)
6
+
7
+## 3.0.0
8
+##### 2017-Feb-12
9
+* :warning: shelf-pack is now a scoped package under the @mapbox namespace
10
+
11
+## 2.0.1
12
+##### 2016-Aug-11
13
+* Remember original size of free bins and use that for packing free space (#29)
14
+
15
+## 2.0.0
16
+##### 2016-Aug-08
17
+* Avoid id collisions by updating `maxId` if a numeric `id` is supplied (#28)
18
+* Skip free bins if they are more wasteful than free shelves (#25)
19
+* Prefer numeric Bin ids over strings (3x perf boost)
20
+* :warning: Remove convenience `width`, `height` properties from Bin object, use only `w`, `h`
21
+* Reference counting (see #20 or README)
22
+  * Each bin now gets a unique id.  An id can be passed as optional param to the
23
+    `packOne()` function, otherwise a numeric id will be generated.
24
+  * Bins are automatically reference counted (i.e. a newly packed Bin will have a `refcount` of 1).
25
+  * Functions `ref(bin)` and `unref(bin)` track which bins are being used.
26
+  * When a Bin's `refcount` decrements to 0, the Bin will be marked as free,
27
+    and its space may be reused by the packing code.
28
+
29
+## 1.1.0
30
+##### 2016-Jul-15
31
+* Release as ES6 module alongside UMD build, add `jsnext:main` to `package.json`
32
+
33
+## 1.0.0
34
+##### 2016-Mar-29
35
+* :warning: Rename `allocate()` -> `packOne()` for API consistency
36
+* Add `autoResize` option (#7)
37
+* Add `clear()` method
38
+* Generate API docs (#9)
39
+* Add `pack()` batch allocator
40
+* Add benchmarks (#2)
41
+* :warning: Return `null` instead of `{-1,-1}` on failed allocation (#1)

+ 44
- 0
node_modules/@mapbox/shelf-pack/CODE_OF_CONDUCT.md Целия файл

@@ -0,0 +1,44 @@
1
+# Contributor Code of Conduct
2
+
3
+#### Guidelines
4
+
5
+* Please be respectful to one another.
6
+* Many contributors are volunteering their time.  We might not get to your
7
+issue right away.  Be patient.
8
+* Other contributors have different backgrounds and perspectives than you do.
9
+Diversity is a community strength.
10
+* We will disagree sometimes.  That's ok.  When this happens, assume that the
11
+person with whom you disagree is a smart person with good reasons for believing
12
+something different.
13
+* Everyone has bad days.  If you find yourself about to be mean to someone,
14
+take a break and cool off.  This project will still be here later.
15
+* When you make a mistake, apologize.
16
+
17
+
18
+#### We will not tolerate
19
+
20
+* Sexualized language or imagery
21
+* Hate speech
22
+* Personal attacks
23
+* Trolling or insulting/derogatory comments
24
+* Public or private harassment
25
+* Publishing other's private information
26
+* Plagiarism
27
+* Other unethical or unprofessional conduct
28
+
29
+#### Enforcement
30
+
31
+Project maintainers commit themselves to fairly enforcing this Code of Conduct.
32
+This means we may:
33
+
34
+* Edit or delete harmful comments, code, issues, or other contributions
35
+* Ban harmful users from the project, temporarily or permanently
36
+
37
+This Code of Conduct applies both within project spaces and in public spaces when an
38
+individual is representing the project or its community.
39
+
40
+Instances of unacceptable behavior may be reported privately to the project maintainers.
41
+
42
+#### See Also
43
+
44
+This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org).

+ 15
- 0
node_modules/@mapbox/shelf-pack/LICENSE.md Целия файл

@@ -0,0 +1,15 @@
1
+ISC License
2
+
3
+Copyright (c) 2017, Mapbox
4
+
5
+Permission to use, copy, modify, and/or distribute this software for any purpose
6
+with or without fee is hereby granted, provided that the above copyright notice
7
+and this permission notice appear in all copies.
8
+
9
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
11
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
13
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
14
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
15
+THIS SOFTWARE.

+ 221
- 0
node_modules/@mapbox/shelf-pack/README.md Целия файл

@@ -0,0 +1,221 @@
1
+[![npm version](https://badge.fury.io/js/%40mapbox%2Fshelf-pack.svg)](https://badge.fury.io/js/%40mapbox%2Fshelf-pack)
2
+[![Build Status](https://secure.travis-ci.org/mapbox/shelf-pack.svg)](http://travis-ci.org/mapbox/shelf-pack)
3
+[![Coverage Status](https://coveralls.io/repos/github/mapbox/shelf-pack/badge.svg?branch=master)](https://coveralls.io/github/mapbox/shelf-pack?branch=master)
4
+
5
+## shelf-pack
6
+
7
+A 2D rectangular [bin packing](https://en.wikipedia.org/wiki/Bin_packing_problem)
8
+data structure that uses the Shelf Best Height Fit heuristic.
9
+
10
+
11
+### What is it?
12
+
13
+`shelf-pack` is a library for packing little rectangles into a big rectangle.  This sounds simple enough,
14
+but finding an optimal packing is a problem with [NP-Complete](https://en.wikipedia.org/wiki/NP-completeness)
15
+complexity.  One useful application of bin packing is to assemble icons or glyphs into a sprite texture.
16
+
17
+There are many ways to approach the bin packing problem, but `shelf-pack` uses the Shelf Best
18
+Height Fit heuristic.  It works by dividing the total space into "shelves", each with a certain height.
19
+The allocator packs rectangles onto whichever shelf minimizes the amount of wasted vertical space.
20
+
21
+`shelf-pack` is simple, fast, and works best when the rectangles have similar heights (icons and glyphs
22
+are like this).  It is not a generalized bin packer, and can potentially waste a lot of space if the
23
+rectangles vary significantly in height.
24
+
25
+
26
+### How fast is it?
27
+
28
+Really fast!  `shelf-pack` is several orders of magnitude faster than the more general
29
+[`bin-pack`](https://www.npmjs.com/package/bin-pack) library.
30
+
31
+```bash
32
+> npm run bench
33
+
34
+ShelfPack single allocate fixed size bins x 1,610 ops/sec ±1.21% (90 runs sampled)
35
+ShelfPack single allocate random width bins x 1,475 ops/sec ±1.00% (89 runs sampled)
36
+ShelfPack single allocate random height bins x 1,458 ops/sec ±1.00% (90 runs sampled)
37
+ShelfPack single allocate random height and width bins x 1,346 ops/sec ±0.96% (89 runs sampled)
38
+ShelfPack batch allocate fixed size bins x 1,522 ops/sec ±1.06% (86 runs sampled)
39
+ShelfPack batch allocate random width bins x 1,427 ops/sec ±1.06% (89 runs sampled)
40
+ShelfPack batch allocate random height bins x 1,350 ops/sec ±1.63% (90 runs sampled)
41
+ShelfPack batch allocate random height and width bins x 1,257 ops/sec ±1.02% (89 runs sampled)
42
+BinPack batch allocate fixed size bins x 2.21 ops/sec ±6.60% (10 runs sampled)
43
+BinPack batch allocate random width bins x 0.50 ops/sec ±2.25% (6 runs sampled)
44
+BinPack batch allocate random height bins x 0.51 ops/sec ±1.97% (6 runs sampled)
45
+BinPack batch allocate random height and width bins x 0.51 ops/sec ±1.37% (6 runs sampled)
46
+```
47
+
48
+
49
+### Usage
50
+
51
+#### Basic Usage
52
+
53
+```js
54
+var ShelfPack = require('@mapbox/shelf-pack');
55
+
56
+// Initialize the sprite with a width and height..
57
+var sprite = new ShelfPack(64, 64);
58
+
59
+// Pack bins one at a time..
60
+for (var i = 0; i < 5; i++) {
61
+    // packOne() accepts parameters: `width`, `height`, `id`
62
+    // and returns a single allocated Bin object..
63
+    // `id` is optional - if you skip it, shelf-pack will make up a number for you..
64
+    // (Protip: numeric ids are much faster than string ids)
65
+
66
+    var bin = sprite.packOne(32, 32);
67
+    console.log(bin || 'out of space');
68
+}
69
+
70
+/* output:
71
+Bin { id: 1, x: 0, y: 0, w: 32, h: 32, maxw: 32, maxh: 32, refcount: 1 }
72
+Bin { id: 2, x: 32, y: 0, w: 32, h: 32, maxw: 32, maxh: 32, refcount: 1 }
73
+Bin { id: 3, x: 0, y: 32, w: 32, h: 32, maxw: 32, maxh: 32, refcount: 1 }
74
+Bin { id: 4, x: 32, y: 32, w: 32, h: 32, maxw: 32, maxh: 32, refcount: 1 }
75
+out of space
76
+*/
77
+
78
+// Clear sprite and start over..
79
+sprite.clear();
80
+
81
+// Or, resize sprite by passing larger dimensions..
82
+sprite.resize(128, 128);   // width, height
83
+
84
+```
85
+
86
+
87
+#### Batch packing
88
+
89
+```js
90
+var ShelfPack = require('@mapbox/shelf-pack');
91
+
92
+// If you don't want to think about the size of the sprite,
93
+// the `autoResize` option will allow it to grow as needed..
94
+var sprite = new ShelfPack(10, 10, { autoResize: true });
95
+
96
+// Bins can be allocated in batches..
97
+// Each requested bin should have `w`, `h` (or `width`, `height`) properties..
98
+var requests = [
99
+    { id: 'a', width: 10, height: 10 },
100
+    { id: 'b', width: 10, height: 12 },
101
+    { id: 'c', w: 10, h: 12 },
102
+    { id: 'd', w: 10, h: 10 }
103
+];
104
+
105
+// pack() returns an Array of packed Bin objects..
106
+var results = sprite.pack(requests);
107
+
108
+results.forEach(function(bin) {
109
+    console.log(bin);
110
+});
111
+
112
+/* output:
113
+Bin { id: 'a', x: 0, y: 0, w: 10, h: 10, maxw: 10, maxh: 10, refcount: 1 }
114
+Bin { id: 'b', x: 0, y: 10, w: 10, h: 12, maxw: 10, maxh: 12, refcount: 1 }
115
+Bin { id: 'c', x: 10, y: 10, w: 10, h: 12, maxw: 10, maxh: 12, refcount: 1 }
116
+Bin { id: 'd', x: 10, y: 0, w: 10, h: 10, maxw: 10, maxh: 10, refcount: 1 }
117
+*/
118
+
119
+// If you don't mind letting ShelfPack modify your objects,
120
+// the `inPlace` option will decorate your bin objects with `x` and `y` properties.
121
+// Fancy!
122
+var myBins = [
123
+    { id: 'e', width: 12, height: 24 },
124
+    { id: 'f', width: 12, height: 12 },
125
+    { id: 'g', w: 10, h: 10 }
126
+];
127
+
128
+sprite.pack(myBins, { inPlace: true });
129
+myBins.forEach(function(bin) {
130
+    console.log(bin);
131
+});
132
+
133
+/* output:
134
+{ id: 'e', width: 12, height: 24, x: 0, y: 22 }
135
+{ id: 'f', width: 12, height: 12, x: 20, y: 10 }
136
+{ id: 'g', w: 10, h: 10, x: 20, y: 0 }
137
+*/
138
+
139
+```
140
+
141
+#### Reference Counting
142
+
143
+```js
144
+var ShelfPack = require('@mapbox/shelf-pack');
145
+
146
+// Initialize the sprite with a width and height..
147
+var sprite = new ShelfPack(64, 64);
148
+
149
+// Allocated bins are automatically reference counted.
150
+// They start out having a refcount of 1.
151
+[100, 101, 102].forEach(function(id) {
152
+    var bin = sprite.packOne(16, 16, id);
153
+    console.log(bin);
154
+});
155
+
156
+/* output:
157
+Bin { id: 100, x: 0, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 1 }
158
+Bin { id: 101, x: 16, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 1 }
159
+Bin { id: 102, x: 32, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 1 }
160
+*/
161
+
162
+// If you try to pack the same id again, shelf-pack will not re-pack it.
163
+// Instead, it will increment the reference count automatically..
164
+var bin102 = sprite.packOne(16, 16, 102);
165
+console.log(bin102);
166
+
167
+/* output:
168
+Bin { id: 102, x: 32, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 2 }
169
+*/
170
+
171
+// You can also manually increment the reference count..
172
+var bin101 = sprite.getBin(101);
173
+sprite.ref(bin101);
174
+console.log(bin101);
175
+
176
+/* output:
177
+Bin { id: 101, x: 16, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 2 }
178
+*/
179
+
180
+// ...and decrement it!
181
+var bin100 = sprite.getBin(100);
182
+sprite.unref(bin100);
183
+console.log(bin100);
184
+
185
+/* output:
186
+Bin { id: 100, x: 0, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 0 }
187
+*/
188
+
189
+// Bins with a refcount of 0 are considered free space.
190
+// Next time a bin is packed, shelf-back tries to reuse free space first.
191
+// See how Bin 103 gets allocated at [0,0] - Bin 100's old spot!
192
+var bin103 = sprite.packOne(16, 15, 103);
193
+console.log(bin103);
194
+
195
+/* output:
196
+Bin { id: 103, x: 0, y: 0, w: 16, h: 15, maxw: 16, maxh: 16, refcount: 1 }
197
+*/
198
+
199
+// Bin 103 may be smaller (16x15) but it knows 16x16 was its original size.
200
+// If that space becomes free again, a 16x16 bin will still fit there.
201
+sprite.unref(bin103)
202
+var bin104 = sprite.packOne(16, 16, 104);
203
+console.log(bin104);
204
+
205
+/* output:
206
+Bin { id: 104, x: 0, y: 0, w: 16, h: 16, maxw: 16, maxh: 16, refcount: 1 }
207
+*/
208
+
209
+```
210
+
211
+
212
+### Documentation
213
+
214
+Complete API documentation is here:  http://mapbox.github.io/shelf-pack/
215
+
216
+
217
+### See also
218
+
219
+J. Jylänky, "A Thousand Ways to Pack the Bin - A Practical
220
+Approach to Two-Dimensional Rectangle Bin Packing,"
221
+http://clb.demon.fi/files/RectangleBinPack.pdf, 2010

+ 447
- 0
node_modules/@mapbox/shelf-pack/index.js Целия файл

@@ -0,0 +1,447 @@
1
+export default ShelfPack;
2
+
3
+
4
+/**
5
+ * Create a new ShelfPack bin allocator.
6
+ *
7
+ * Uses the Shelf Best Height Fit algorithm from
8
+ * http://clb.demon.fi/files/RectangleBinPack.pdf
9
+ *
10
+ * @class  ShelfPack
11
+ * @param  {number}  [w=64]  Initial width of the sprite
12
+ * @param  {number}  [h=64]  Initial width of the sprite
13
+ * @param  {Object}  [options]
14
+ * @param  {boolean} [options.autoResize=false]  If `true`, the sprite will automatically grow
15
+ * @example
16
+ * var sprite = new ShelfPack(64, 64, { autoResize: false });
17
+ */
18
+function ShelfPack(w, h, options) {
19
+    options = options || {};
20
+    this.w = w || 64;
21
+    this.h = h || 64;
22
+    this.autoResize = !!options.autoResize;
23
+    this.shelves = [];
24
+    this.freebins = [];
25
+    this.stats = {};
26
+    this.bins = {};
27
+    this.maxId = 0;
28
+}
29
+
30
+
31
+/**
32
+ * Batch pack multiple bins into the sprite.
33
+ *
34
+ * @param   {Object[]} bins       Array of requested bins - each object should have `width`, `height` (or `w`, `h`) properties
35
+ * @param   {number}   bins[].w   Requested bin width
36
+ * @param   {number}   bins[].h   Requested bin height
37
+ * @param   {Object}   [options]
38
+ * @param   {boolean}  [options.inPlace=false] If `true`, the supplied bin objects will be updated inplace with `x` and `y` properties
39
+ * @returns {Bin[]}    Array of allocated Bins - each Bin is an object with `id`, `x`, `y`, `w`, `h` properties
40
+ * @example
41
+ * var bins = [
42
+ *     { id: 1, w: 12, h: 12 },
43
+ *     { id: 2, w: 12, h: 16 },
44
+ *     { id: 3, w: 12, h: 24 }
45
+ * ];
46
+ * var results = sprite.pack(bins, { inPlace: false });
47
+ */
48
+ShelfPack.prototype.pack = function(bins, options) {
49
+    bins = [].concat(bins);
50
+    options = options || {};
51
+
52
+    var results = [],
53
+        w, h, id, allocation;
54
+
55
+    for (var i = 0; i < bins.length; i++) {
56
+        w  = bins[i].w || bins[i].width;
57
+        h  = bins[i].h || bins[i].height;
58
+        id = bins[i].id;
59
+
60
+        if (w && h) {
61
+            allocation = this.packOne(w, h, id);
62
+            if (!allocation) {
63
+                continue;
64
+            }
65
+            if (options.inPlace) {
66
+                bins[i].x  = allocation.x;
67
+                bins[i].y  = allocation.y;
68
+                bins[i].id = allocation.id;
69
+            }
70
+            results.push(allocation);
71
+        }
72
+    }
73
+
74
+    this.shrink();
75
+
76
+    return results;
77
+};
78
+
79
+
80
+/**
81
+ * Pack a single bin into the sprite.
82
+ *
83
+ * Each bin will have a unique identitifer.
84
+ * If no identifier is supplied in the `id` parameter, one will be created.
85
+ * Note: The supplied `id` is used as an object index, so numeric values are fastest!
86
+ *
87
+ * Bins are automatically refcounted (i.e. a newly packed Bin will have a refcount of 1).
88
+ * When a bin is no longer needed, use the `ShelfPack.unref` function to mark it
89
+ *   as unused.  When a Bin's refcount decrements to 0, the Bin will be marked
90
+ *   as free and its space may be reused by the packing code.
91
+ *
92
+ * @param    {number}         w      Width of the bin to allocate
93
+ * @param    {number}         h      Height of the bin to allocate
94
+ * @param    {number|string}  [id]   Unique identifier for this bin, (if unsupplied, assume it's a new bin and create an id)
95
+ * @returns  {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties, or `null` if allocation failed
96
+ * @example
97
+ * var results = sprite.packOne(12, 16, 'a');
98
+ */
99
+ShelfPack.prototype.packOne = function(w, h, id) {
100
+    var best = { freebin: -1, shelf: -1, waste: Infinity },
101
+        y = 0,
102
+        bin, shelf, waste, i;
103
+
104
+    // if id was supplied, attempt a lookup..
105
+    if (typeof id === 'string' || typeof id === 'number') {
106
+        bin = this.getBin(id);
107
+        if (bin) {              // we packed this bin already
108
+            this.ref(bin);
109
+            return bin;
110
+        }
111
+        if (typeof id === 'number') {
112
+            this.maxId = Math.max(id, this.maxId);
113
+        }
114
+    } else {
115
+        id = ++this.maxId;
116
+    }
117
+
118
+    // First try to reuse a free bin..
119
+    for (i = 0; i < this.freebins.length; i++) {
120
+        bin = this.freebins[i];
121
+
122
+        // exactly the right height and width, use it..
123
+        if (h === bin.maxh && w === bin.maxw) {
124
+            return this.allocFreebin(i, w, h, id);
125
+        }
126
+        // not enough height or width, skip it..
127
+        if (h > bin.maxh || w > bin.maxw) {
128
+            continue;
129
+        }
130
+        // extra height or width, minimize wasted area..
131
+        if (h <= bin.maxh && w <= bin.maxw) {
132
+            waste = (bin.maxw * bin.maxh) - (w * h);
133
+            if (waste < best.waste) {
134
+                best.waste = waste;
135
+                best.freebin = i;
136
+            }
137
+        }
138
+    }
139
+
140
+    // Next find the best shelf..
141
+    for (i = 0; i < this.shelves.length; i++) {
142
+        shelf = this.shelves[i];
143
+        y += shelf.h;
144
+
145
+        // not enough width on this shelf, skip it..
146
+        if (w > shelf.free) {
147
+            continue;
148
+        }
149
+        // exactly the right height, pack it..
150
+        if (h === shelf.h) {
151
+            return this.allocShelf(i, w, h, id);
152
+        }
153
+        // not enough height, skip it..
154
+        if (h > shelf.h) {
155
+            continue;
156
+        }
157
+        // extra height, minimize wasted area..
158
+        if (h < shelf.h) {
159
+            waste = (shelf.h - h) * w;
160
+            if (waste < best.waste) {
161
+                best.freebin = -1;
162
+                best.waste = waste;
163
+                best.shelf = i;
164
+            }
165
+        }
166
+    }
167
+
168
+    if (best.freebin !== -1) {
169
+        return this.allocFreebin(best.freebin, w, h, id);
170
+    }
171
+
172
+    if (best.shelf !== -1) {
173
+        return this.allocShelf(best.shelf, w, h, id);
174
+    }
175
+
176
+    // No free bins or shelves.. add shelf..
177
+    if (h <= (this.h - y) && w <= this.w) {
178
+        shelf = new Shelf(y, this.w, h);
179
+        return this.allocShelf(this.shelves.push(shelf) - 1, w, h, id);
180
+    }
181
+
182
+    // No room for more shelves..
183
+    // If `autoResize` option is set, grow the sprite as follows:
184
+    //  * double whichever sprite dimension is smaller (`w1` or `h1`)
185
+    //  * if sprite dimensions are equal, grow width before height
186
+    //  * accomodate very large bin requests (big `w` or `h`)
187
+    if (this.autoResize) {
188
+        var h1, h2, w1, w2;
189
+
190
+        h1 = h2 = this.h;
191
+        w1 = w2 = this.w;
192
+
193
+        if (w1 <= h1 || w > w1) {   // grow width..
194
+            w2 = Math.max(w, w1) * 2;
195
+        }
196
+        if (h1 < w1 || h > h1) {    // grow height..
197
+            h2 = Math.max(h, h1) * 2;
198
+        }
199
+
200
+        this.resize(w2, h2);
201
+        return this.packOne(w, h, id);  // retry
202
+    }
203
+
204
+    return null;
205
+};
206
+
207
+
208
+/**
209
+ * Called by packOne() to allocate a bin by reusing an existing freebin
210
+ *
211
+ * @private
212
+ * @param    {number}         index  Index into the `this.freebins` array
213
+ * @param    {number}         w      Width of the bin to allocate
214
+ * @param    {number}         h      Height of the bin to allocate
215
+ * @param    {number|string}  id     Unique identifier for this bin
216
+ * @returns  {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties
217
+ * @example
218
+ * var bin = sprite.allocFreebin(0, 12, 16, 'a');
219
+ */
220
+ShelfPack.prototype.allocFreebin = function (index, w, h, id) {
221
+    var bin = this.freebins.splice(index, 1)[0];
222
+    bin.id = id;
223
+    bin.w = w;
224
+    bin.h = h;
225
+    bin.refcount = 0;
226
+    this.bins[id] = bin;
227
+    this.ref(bin);
228
+    return bin;
229
+};
230
+
231
+
232
+/**
233
+ * Called by `packOne() to allocate bin on an existing shelf
234
+ *
235
+ * @private
236
+ * @param    {number}         index  Index into the `this.shelves` array
237
+ * @param    {number}         w      Width of the bin to allocate
238
+ * @param    {number}         h      Height of the bin to allocate
239
+ * @param    {number|string}  id     Unique identifier for this bin
240
+ * @returns  {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties
241
+ * @example
242
+ * var results = sprite.allocShelf(0, 12, 16, 'a');
243
+ */
244
+ShelfPack.prototype.allocShelf = function(index, w, h, id) {
245
+    var shelf = this.shelves[index];
246
+    var bin = shelf.alloc(w, h, id);
247
+    this.bins[id] = bin;
248
+    this.ref(bin);
249
+    return bin;
250
+};
251
+
252
+
253
+/**
254
+ * Shrink the width/height of the sprite to the bare minimum.
255
+ * Since shelf-pack doubles first width, then height when running out of shelf space
256
+ * this can result in fairly large unused space both in width and height if that happens
257
+ * towards the end of bin packing.
258
+ */
259
+ShelfPack.prototype.shrink = function() {
260
+    if (this.shelves.length > 0) {
261
+        var w2 = 0;
262
+        var h2 = 0;
263
+
264
+        for (var j = 0; j < this.shelves.length; j++) {
265
+            var shelf = this.shelves[j];
266
+            h2 += shelf.h;
267
+            w2 = Math.max(shelf.w - shelf.free, w2);
268
+        }
269
+
270
+        this.resize(w2, h2);
271
+    }
272
+};
273
+
274
+
275
+/**
276
+ * Return a packed bin given its id, or undefined if the id is not found
277
+ *
278
+ * @param    {number|string}  id  Unique identifier for this bin,
279
+ * @returns  {Bin}            The requested bin, or undefined if not yet packed
280
+ * @example
281
+ * var b = sprite.getBin('a');
282
+ */
283
+ShelfPack.prototype.getBin = function(id) {
284
+    return this.bins[id];
285
+};
286
+
287
+
288
+/**
289
+ * Increment the ref count of a bin and update statistics.
290
+ *
291
+ * @param    {Bin}     bin  Bin instance
292
+ * @returns  {number}  New refcount of the bin
293
+ * @example
294
+ * var bin = sprite.getBin('a');
295
+ * sprite.ref(bin);
296
+ */
297
+ShelfPack.prototype.ref = function(bin) {
298
+    if (++bin.refcount === 1) {   // a new Bin.. record height in stats historgram..
299
+        var h = bin.h;
300
+        this.stats[h] = (this.stats[h] | 0) + 1;
301
+    }
302
+
303
+    return bin.refcount;
304
+};
305
+
306
+
307
+/**
308
+ * Decrement the ref count of a bin and update statistics.
309
+ * The bin will be automatically marked as free space once the refcount reaches 0.
310
+ *
311
+ * @param    {Bin}     bin  Bin instance
312
+ * @returns  {number}  New refcount of the bin
313
+ * @example
314
+ * var bin = sprite.getBin('a');
315
+ * sprite.unref(bin);
316
+ */
317
+ShelfPack.prototype.unref = function(bin) {
318
+    if (bin.refcount === 0) {
319
+        return 0;
320
+    }
321
+
322
+    if (--bin.refcount === 0) {
323
+        this.stats[bin.h]--;
324
+        delete this.bins[bin.id];
325
+        this.freebins.push(bin);
326
+    }
327
+
328
+    return bin.refcount;
329
+};
330
+
331
+
332
+/**
333
+ * Clear the sprite.  Resets everything and resets statistics.
334
+ *
335
+ * @example
336
+ * sprite.clear();
337
+ */
338
+ShelfPack.prototype.clear = function() {
339
+    this.shelves = [];
340
+    this.freebins = [];
341
+    this.stats = {};
342
+    this.bins = {};
343
+    this.maxId = 0;
344
+};
345
+
346
+
347
+/**
348
+ * Resize the sprite.
349
+ *
350
+ * @param   {number}  w  Requested new sprite width
351
+ * @param   {number}  h  Requested new sprite height
352
+ * @returns {boolean} `true` if resize succeeded, `false` if failed
353
+ * @example
354
+ * sprite.resize(256, 256);
355
+ */
356
+ShelfPack.prototype.resize = function(w, h) {
357
+    this.w = w;
358
+    this.h = h;
359
+    for (var i = 0; i < this.shelves.length; i++) {
360
+        this.shelves[i].resize(w);
361
+    }
362
+    return true;
363
+};
364
+
365
+
366
+/**
367
+ * Create a new Shelf.
368
+ *
369
+ * @private
370
+ * @class  Shelf
371
+ * @param  {number}  y   Top coordinate of the new shelf
372
+ * @param  {number}  w   Width of the new shelf
373
+ * @param  {number}  h   Height of the new shelf
374
+ * @example
375
+ * var shelf = new Shelf(64, 512, 24);
376
+ */
377
+function Shelf(y, w, h) {
378
+    this.x = 0;
379
+    this.y = y;
380
+    this.w = this.free = w;
381
+    this.h = h;
382
+}
383
+
384
+
385
+/**
386
+ * Allocate a single bin into the shelf.
387
+ *
388
+ * @private
389
+ * @param   {number}         w   Width of the bin to allocate
390
+ * @param   {number}         h   Height of the bin to allocate
391
+ * @param   {number|string}  id  Unique id of the bin to allocate
392
+ * @returns {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties, or `null` if allocation failed
393
+ * @example
394
+ * shelf.alloc(12, 16, 'a');
395
+ */
396
+Shelf.prototype.alloc = function(w, h, id) {
397
+    if (w > this.free || h > this.h) {
398
+        return null;
399
+    }
400
+    var x = this.x;
401
+    this.x += w;
402
+    this.free -= w;
403
+    return new Bin(id, x, this.y, w, h, w, this.h);
404
+};
405
+
406
+
407
+/**
408
+ * Resize the shelf.
409
+ *
410
+ * @private
411
+ * @param   {number}  w  Requested new width of the shelf
412
+ * @returns {boolean}    true
413
+ * @example
414
+ * shelf.resize(512);
415
+ */
416
+Shelf.prototype.resize = function(w) {
417
+    this.free += (w - this.w);
418
+    this.w = w;
419
+    return true;
420
+};
421
+
422
+
423
+/**
424
+ * Create a new Bin object.
425
+ *
426
+ * @class  Bin
427
+ * @param  {number|string}  id      Unique id of the bin
428
+ * @param  {number}         x       Left coordinate of the bin
429
+ * @param  {number}         y       Top coordinate of the bin
430
+ * @param  {number}         w       Width of the bin
431
+ * @param  {number}         h       Height of the bin
432
+ * @param  {number}         [maxw]  Max width of the bin (defaults to `w` if not provided)
433
+ * @param  {number}         [maxh]  Max height of the bin (defaults to `h` if not provided)
434
+ * @example
435
+ * var bin = new Bin('a', 0, 0, 12, 16);
436
+ */
437
+function Bin(id, x, y, w, h, maxw, maxh) {
438
+    this.id = id;
439
+    this.x  = x;
440
+    this.y  = y;
441
+    this.w  = w;
442
+    this.h  = h;
443
+    this.maxw = maxw || w;
444
+    this.maxh = maxh || h;
445
+    this.refcount = 0;
446
+}
447
+

+ 453
- 0
node_modules/@mapbox/shelf-pack/index.umd.js Целия файл

@@ -0,0 +1,453 @@
1
+(function (global, factory) {
2
+	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+	typeof define === 'function' && define.amd ? define(factory) :
4
+	(global.ShelfPack = factory());
5
+}(this, (function () {
6
+
7
+/**
8
+ * Create a new ShelfPack bin allocator.
9
+ *
10
+ * Uses the Shelf Best Height Fit algorithm from
11
+ * http://clb.demon.fi/files/RectangleBinPack.pdf
12
+ *
13
+ * @class  ShelfPack
14
+ * @param  {number}  [w=64]  Initial width of the sprite
15
+ * @param  {number}  [h=64]  Initial width of the sprite
16
+ * @param  {Object}  [options]
17
+ * @param  {boolean} [options.autoResize=false]  If `true`, the sprite will automatically grow
18
+ * @example
19
+ * var sprite = new ShelfPack(64, 64, { autoResize: false });
20
+ */
21
+function ShelfPack$1(w, h, options) {
22
+    options = options || {};
23
+    this.w = w || 64;
24
+    this.h = h || 64;
25
+    this.autoResize = !!options.autoResize;
26
+    this.shelves = [];
27
+    this.freebins = [];
28
+    this.stats = {};
29
+    this.bins = {};
30
+    this.maxId = 0;
31
+}
32
+
33
+
34
+/**
35
+ * Batch pack multiple bins into the sprite.
36
+ *
37
+ * @param   {Object[]} bins       Array of requested bins - each object should have `width`, `height` (or `w`, `h`) properties
38
+ * @param   {number}   bins[].w   Requested bin width
39
+ * @param   {number}   bins[].h   Requested bin height
40
+ * @param   {Object}   [options]
41
+ * @param   {boolean}  [options.inPlace=false] If `true`, the supplied bin objects will be updated inplace with `x` and `y` properties
42
+ * @returns {Bin[]}    Array of allocated Bins - each Bin is an object with `id`, `x`, `y`, `w`, `h` properties
43
+ * @example
44
+ * var bins = [
45
+ *     { id: 1, w: 12, h: 12 },
46
+ *     { id: 2, w: 12, h: 16 },
47
+ *     { id: 3, w: 12, h: 24 }
48
+ * ];
49
+ * var results = sprite.pack(bins, { inPlace: false });
50
+ */
51
+ShelfPack$1.prototype.pack = function(bins, options) {
52
+    bins = [].concat(bins);
53
+    options = options || {};
54
+
55
+    var results = [],
56
+        w, h, id, allocation;
57
+
58
+    for (var i = 0; i < bins.length; i++) {
59
+        w  = bins[i].w || bins[i].width;
60
+        h  = bins[i].h || bins[i].height;
61
+        id = bins[i].id;
62
+
63
+        if (w && h) {
64
+            allocation = this.packOne(w, h, id);
65
+            if (!allocation) {
66
+                continue;
67
+            }
68
+            if (options.inPlace) {
69
+                bins[i].x  = allocation.x;
70
+                bins[i].y  = allocation.y;
71
+                bins[i].id = allocation.id;
72
+            }
73
+            results.push(allocation);
74
+        }
75
+    }
76
+
77
+    this.shrink();
78
+
79
+    return results;
80
+};
81
+
82
+
83
+/**
84
+ * Pack a single bin into the sprite.
85
+ *
86
+ * Each bin will have a unique identitifer.
87
+ * If no identifier is supplied in the `id` parameter, one will be created.
88
+ * Note: The supplied `id` is used as an object index, so numeric values are fastest!
89
+ *
90
+ * Bins are automatically refcounted (i.e. a newly packed Bin will have a refcount of 1).
91
+ * When a bin is no longer needed, use the `ShelfPack.unref` function to mark it
92
+ *   as unused.  When a Bin's refcount decrements to 0, the Bin will be marked
93
+ *   as free and its space may be reused by the packing code.
94
+ *
95
+ * @param    {number}         w      Width of the bin to allocate
96
+ * @param    {number}         h      Height of the bin to allocate
97
+ * @param    {number|string}  [id]   Unique identifier for this bin, (if unsupplied, assume it's a new bin and create an id)
98
+ * @returns  {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties, or `null` if allocation failed
99
+ * @example
100
+ * var results = sprite.packOne(12, 16, 'a');
101
+ */
102
+ShelfPack$1.prototype.packOne = function(w, h, id) {
103
+    var best = { freebin: -1, shelf: -1, waste: Infinity },
104
+        y = 0,
105
+        bin, shelf, waste, i;
106
+
107
+    // if id was supplied, attempt a lookup..
108
+    if (typeof id === 'string' || typeof id === 'number') {
109
+        bin = this.getBin(id);
110
+        if (bin) {              // we packed this bin already
111
+            this.ref(bin);
112
+            return bin;
113
+        }
114
+        if (typeof id === 'number') {
115
+            this.maxId = Math.max(id, this.maxId);
116
+        }
117
+    } else {
118
+        id = ++this.maxId;
119
+    }
120
+
121
+    // First try to reuse a free bin..
122
+    for (i = 0; i < this.freebins.length; i++) {
123
+        bin = this.freebins[i];
124
+
125
+        // exactly the right height and width, use it..
126
+        if (h === bin.maxh && w === bin.maxw) {
127
+            return this.allocFreebin(i, w, h, id);
128
+        }
129
+        // not enough height or width, skip it..
130
+        if (h > bin.maxh || w > bin.maxw) {
131
+            continue;
132
+        }
133
+        // extra height or width, minimize wasted area..
134
+        if (h <= bin.maxh && w <= bin.maxw) {
135
+            waste = (bin.maxw * bin.maxh) - (w * h);
136
+            if (waste < best.waste) {
137
+                best.waste = waste;
138
+                best.freebin = i;
139
+            }
140
+        }
141
+    }
142
+
143
+    // Next find the best shelf..
144
+    for (i = 0; i < this.shelves.length; i++) {
145
+        shelf = this.shelves[i];
146
+        y += shelf.h;
147
+
148
+        // not enough width on this shelf, skip it..
149
+        if (w > shelf.free) {
150
+            continue;
151
+        }
152
+        // exactly the right height, pack it..
153
+        if (h === shelf.h) {
154
+            return this.allocShelf(i, w, h, id);
155
+        }
156
+        // not enough height, skip it..
157
+        if (h > shelf.h) {
158
+            continue;
159
+        }
160
+        // extra height, minimize wasted area..
161
+        if (h < shelf.h) {
162
+            waste = (shelf.h - h) * w;
163
+            if (waste < best.waste) {
164
+                best.freebin = -1;
165
+                best.waste = waste;
166
+                best.shelf = i;
167
+            }
168
+        }
169
+    }
170
+
171
+    if (best.freebin !== -1) {
172
+        return this.allocFreebin(best.freebin, w, h, id);
173
+    }
174
+
175
+    if (best.shelf !== -1) {
176
+        return this.allocShelf(best.shelf, w, h, id);
177
+    }
178
+
179
+    // No free bins or shelves.. add shelf..
180
+    if (h <= (this.h - y) && w <= this.w) {
181
+        shelf = new Shelf(y, this.w, h);
182
+        return this.allocShelf(this.shelves.push(shelf) - 1, w, h, id);
183
+    }
184
+
185
+    // No room for more shelves..
186
+    // If `autoResize` option is set, grow the sprite as follows:
187
+    //  * double whichever sprite dimension is smaller (`w1` or `h1`)
188
+    //  * if sprite dimensions are equal, grow width before height
189
+    //  * accomodate very large bin requests (big `w` or `h`)
190
+    if (this.autoResize) {
191
+        var h1, h2, w1, w2;
192
+
193
+        h1 = h2 = this.h;
194
+        w1 = w2 = this.w;
195
+
196
+        if (w1 <= h1 || w > w1) {   // grow width..
197
+            w2 = Math.max(w, w1) * 2;
198
+        }
199
+        if (h1 < w1 || h > h1) {    // grow height..
200
+            h2 = Math.max(h, h1) * 2;
201
+        }
202
+
203
+        this.resize(w2, h2);
204
+        return this.packOne(w, h, id);  // retry
205
+    }
206
+
207
+    return null;
208
+};
209
+
210
+
211
+/**
212
+ * Called by packOne() to allocate a bin by reusing an existing freebin
213
+ *
214
+ * @private
215
+ * @param    {number}         index  Index into the `this.freebins` array
216
+ * @param    {number}         w      Width of the bin to allocate
217
+ * @param    {number}         h      Height of the bin to allocate
218
+ * @param    {number|string}  id     Unique identifier for this bin
219
+ * @returns  {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties
220
+ * @example
221
+ * var bin = sprite.allocFreebin(0, 12, 16, 'a');
222
+ */
223
+ShelfPack$1.prototype.allocFreebin = function (index, w, h, id) {
224
+    var bin = this.freebins.splice(index, 1)[0];
225
+    bin.id = id;
226
+    bin.w = w;
227
+    bin.h = h;
228
+    bin.refcount = 0;
229
+    this.bins[id] = bin;
230
+    this.ref(bin);
231
+    return bin;
232
+};
233
+
234
+
235
+/**
236
+ * Called by `packOne() to allocate bin on an existing shelf
237
+ *
238
+ * @private
239
+ * @param    {number}         index  Index into the `this.shelves` array
240
+ * @param    {number}         w      Width of the bin to allocate
241
+ * @param    {number}         h      Height of the bin to allocate
242
+ * @param    {number|string}  id     Unique identifier for this bin
243
+ * @returns  {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties
244
+ * @example
245
+ * var results = sprite.allocShelf(0, 12, 16, 'a');
246
+ */
247
+ShelfPack$1.prototype.allocShelf = function(index, w, h, id) {
248
+    var shelf = this.shelves[index];
249
+    var bin = shelf.alloc(w, h, id);
250
+    this.bins[id] = bin;
251
+    this.ref(bin);
252
+    return bin;
253
+};
254
+
255
+
256
+/**
257
+ * Shrink the width/height of the sprite to the bare minimum.
258
+ * Since shelf-pack doubles first width, then height when running out of shelf space
259
+ * this can result in fairly large unused space both in width and height if that happens
260
+ * towards the end of bin packing.
261
+ */
262
+ShelfPack$1.prototype.shrink = function() {
263
+    if (this.shelves.length > 0) {
264
+        var w2 = 0;
265
+        var h2 = 0;
266
+
267
+        for (var j = 0; j < this.shelves.length; j++) {
268
+            var shelf = this.shelves[j];
269
+            h2 += shelf.h;
270
+            w2 = Math.max(shelf.w - shelf.free, w2);
271
+        }
272
+
273
+        this.resize(w2, h2);
274
+    }
275
+};
276
+
277
+
278
+/**
279
+ * Return a packed bin given its id, or undefined if the id is not found
280
+ *
281
+ * @param    {number|string}  id  Unique identifier for this bin,
282
+ * @returns  {Bin}            The requested bin, or undefined if not yet packed
283
+ * @example
284
+ * var b = sprite.getBin('a');
285
+ */
286
+ShelfPack$1.prototype.getBin = function(id) {
287
+    return this.bins[id];
288
+};
289
+
290
+
291
+/**
292
+ * Increment the ref count of a bin and update statistics.
293
+ *
294
+ * @param    {Bin}     bin  Bin instance
295
+ * @returns  {number}  New refcount of the bin
296
+ * @example
297
+ * var bin = sprite.getBin('a');
298
+ * sprite.ref(bin);
299
+ */
300
+ShelfPack$1.prototype.ref = function(bin) {
301
+    if (++bin.refcount === 1) {   // a new Bin.. record height in stats historgram..
302
+        var h = bin.h;
303
+        this.stats[h] = (this.stats[h] | 0) + 1;
304
+    }
305
+
306
+    return bin.refcount;
307
+};
308
+
309
+
310
+/**
311
+ * Decrement the ref count of a bin and update statistics.
312
+ * The bin will be automatically marked as free space once the refcount reaches 0.
313
+ *
314
+ * @param    {Bin}     bin  Bin instance
315
+ * @returns  {number}  New refcount of the bin
316
+ * @example
317
+ * var bin = sprite.getBin('a');
318
+ * sprite.unref(bin);
319
+ */
320
+ShelfPack$1.prototype.unref = function(bin) {
321
+    if (bin.refcount === 0) {
322
+        return 0;
323
+    }
324
+
325
+    if (--bin.refcount === 0) {
326
+        this.stats[bin.h]--;
327
+        delete this.bins[bin.id];
328
+        this.freebins.push(bin);
329
+    }
330
+
331
+    return bin.refcount;
332
+};
333
+
334
+
335
+/**
336
+ * Clear the sprite.  Resets everything and resets statistics.
337
+ *
338
+ * @example
339
+ * sprite.clear();
340
+ */
341
+ShelfPack$1.prototype.clear = function() {
342
+    this.shelves = [];
343
+    this.freebins = [];
344
+    this.stats = {};
345
+    this.bins = {};
346
+    this.maxId = 0;
347
+};
348
+
349
+
350
+/**
351
+ * Resize the sprite.
352
+ *
353
+ * @param   {number}  w  Requested new sprite width
354
+ * @param   {number}  h  Requested new sprite height
355
+ * @returns {boolean} `true` if resize succeeded, `false` if failed
356
+ * @example
357
+ * sprite.resize(256, 256);
358
+ */
359
+ShelfPack$1.prototype.resize = function(w, h) {
360
+    this.w = w;
361
+    this.h = h;
362
+    for (var i = 0; i < this.shelves.length; i++) {
363
+        this.shelves[i].resize(w);
364
+    }
365
+    return true;
366
+};
367
+
368
+
369
+/**
370
+ * Create a new Shelf.
371
+ *
372
+ * @private
373
+ * @class  Shelf
374
+ * @param  {number}  y   Top coordinate of the new shelf
375
+ * @param  {number}  w   Width of the new shelf
376
+ * @param  {number}  h   Height of the new shelf
377
+ * @example
378
+ * var shelf = new Shelf(64, 512, 24);
379
+ */
380
+function Shelf(y, w, h) {
381
+    this.x = 0;
382
+    this.y = y;
383
+    this.w = this.free = w;
384
+    this.h = h;
385
+}
386
+
387
+
388
+/**
389
+ * Allocate a single bin into the shelf.
390
+ *
391
+ * @private
392
+ * @param   {number}         w   Width of the bin to allocate
393
+ * @param   {number}         h   Height of the bin to allocate
394
+ * @param   {number|string}  id  Unique id of the bin to allocate
395
+ * @returns {Bin}            Bin object with `id`, `x`, `y`, `w`, `h` properties, or `null` if allocation failed
396
+ * @example
397
+ * shelf.alloc(12, 16, 'a');
398
+ */
399
+Shelf.prototype.alloc = function(w, h, id) {
400
+    if (w > this.free || h > this.h) {
401
+        return null;
402
+    }
403
+    var x = this.x;
404
+    this.x += w;
405
+    this.free -= w;
406
+    return new Bin(id, x, this.y, w, h, w, this.h);
407
+};
408
+
409
+
410
+/**
411
+ * Resize the shelf.
412
+ *
413
+ * @private
414
+ * @param   {number}  w  Requested new width of the shelf
415
+ * @returns {boolean}    true
416
+ * @example
417
+ * shelf.resize(512);
418
+ */
419
+Shelf.prototype.resize = function(w) {
420
+    this.free += (w - this.w);
421
+    this.w = w;
422
+    return true;
423
+};
424
+
425
+
426
+/**
427
+ * Create a new Bin object.
428
+ *
429
+ * @class  Bin
430
+ * @param  {number|string}  id      Unique id of the bin
431
+ * @param  {number}         x       Left coordinate of the bin
432
+ * @param  {number}         y       Top coordinate of the bin
433
+ * @param  {number}         w       Width of the bin
434
+ * @param  {number}         h       Height of the bin
435
+ * @param  {number}         [maxw]  Max width of the bin (defaults to `w` if not provided)
436
+ * @param  {number}         [maxh]  Max height of the bin (defaults to `h` if not provided)
437
+ * @example
438
+ * var bin = new Bin('a', 0, 0, 12, 16);
439
+ */
440
+function Bin(id, x, y, w, h, maxw, maxh) {
441
+    this.id = id;
442
+    this.x  = x;
443
+    this.y  = y;
444
+    this.w  = w;
445
+    this.h  = h;
446
+    this.maxw = maxw || w;
447
+    this.maxh = maxh || h;
448
+    this.refcount = 0;
449
+}
450
+
451
+return ShelfPack$1;
452
+
453
+})));

+ 69
- 0
node_modules/@mapbox/shelf-pack/package.json Целия файл

@@ -0,0 +1,69 @@
1
+{
2
+  "_from": "@mapbox/shelf-pack@^3.1.0",
3
+  "_id": "@mapbox/shelf-pack@3.1.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-Ht6pwL9nFbIXFxumBkbCAa9SD2o=",
6
+  "_location": "/@mapbox/shelf-pack",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "@mapbox/shelf-pack@^3.1.0",
12
+    "name": "@mapbox/shelf-pack",
13
+    "escapedName": "@mapbox%2fshelf-pack",
14
+    "scope": "@mapbox",
15
+    "rawSpec": "^3.1.0",
16
+    "saveSpec": null,
17
+    "fetchSpec": "^3.1.0"
18
+  },
19
+  "_requiredBy": [
20
+    "/mapbox-gl"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/@mapbox/shelf-pack/-/shelf-pack-3.1.0.tgz",
23
+  "_shasum": "1edea9c0bf6715b217171ba60646c201af520f6a",
24
+  "_spec": "@mapbox/shelf-pack@^3.1.0",
25
+  "_where": "/Users/jamess/Labs/dasboot/node_modules/mapbox-gl",
26
+  "author": {
27
+    "name": "Bryan Housel",
28
+    "email": "bryan@mapbox.com"
29
+  },
30
+  "bugs": {
31
+    "url": "https://github.com/mapbox/shelf-pack/issues"
32
+  },
33
+  "bundleDependencies": false,
34
+  "deprecated": false,
35
+  "description": "A 2D rectangular bin packing data structure that uses the Shelf Best Height Fit heuristic",
36
+  "devDependencies": {
37
+    "benchmark": "^2.1.0",
38
+    "bin-pack": "1.0.2",
39
+    "coveralls": "^2.11.12",
40
+    "documentation": "4.0.0-beta5",
41
+    "eslint": "^3.8.0",
42
+    "rollup": "0.41.4",
43
+    "tap": "^10.1.0"
44
+  },
45
+  "engines": {
46
+    "node": ">=4.0.0"
47
+  },
48
+  "homepage": "https://github.com/mapbox/shelf-pack#readme",
49
+  "jsnext:main": "index.js",
50
+  "keywords": [
51
+    "bin packing",
52
+    "sprite"
53
+  ],
54
+  "license": "ISC",
55
+  "main": "index.umd.js",
56
+  "name": "@mapbox/shelf-pack",
57
+  "repository": {
58
+    "type": "git",
59
+    "url": "git+https://github.com/mapbox/shelf-pack.git"
60
+  },
61
+  "scripts": {
62
+    "bench": "npm run build && node bench/bench.js",
63
+    "build": "rollup -f umd -n ShelfPack index.js --no-indent --no-strict -o index.umd.js",
64
+    "docs": "documentation build index.js --lint --github --format html --output docs/",
65
+    "lint": "eslint index.js test/ bench/",
66
+    "test": "npm run build && npm run lint && tap --cov test/*.js"
67
+  },
68
+  "version": "3.1.0"
69
+}

+ 2
- 0
node_modules/@mapbox/tiny-sdf/.npmignore Целия файл

@@ -0,0 +1,2 @@
1
+node_modules
2
+yarn.lock

+ 28
- 0
node_modules/@mapbox/tiny-sdf/README.md Целия файл

@@ -0,0 +1,28 @@
1
+# TinySDF
2
+
3
+TinySDF is a tiny and fast JavaScript library for generating SDF (signed distance field)
4
+from system fonts on the browser using Canvas 2D and
5
+[Felzenszwalb/Huttenlocher distance transform](https://cs.brown.edu/~pff/dt/).
6
+This is very useful for [rendering text with WebGL](https://www.mapbox.com/blog/text-signed-distance-fields/).
7
+
8
+Demo: http://mapbox.github.io/tiny-sdf/
9
+
10
+## Usage
11
+Create a TinySDF for drawing SDFs based on font parameters:
12
+
13
+    var fontsize = 24; // Pixel font size
14
+    var buffer = 3;    // Pixel whitespace buffer around glyph
15
+    var radius = 8;    // Lower = "sharper", higher = "fuzzier"
16
+    var cutoff = 0.25  // Across the board alpha channel reduction
17
+                       // Reduces low-alpha pixels to zero, "thins" SDF overall
18
+
19
+    var fontFamily = 'sans-serif'; // css font-family
20
+    var fontWeight = 'normal';     // css font-weight
21
+    var tinySDFGenerator = new TinySDF(fontsize,
22
+                                       buffer,
23
+                                       radius,
24
+                                       cutoff,
25
+                                       fontFamily,
26
+                                       fontWeight);
27
+
28
+    var oneSDF = tinySDFGenerator.draw('泽');

+ 90
- 0
node_modules/@mapbox/tiny-sdf/debug.html Целия файл

@@ -0,0 +1,90 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+<title>SDF test</title>
5
+<style>
6
+
7
+</style>
8
+</head>
9
+<body>
10
+<canvas id="canvas" width="512" height="512"></canvas>
11
+<script>module = {};</script>
12
+<script src="index.js"></script>
13
+<script>
14
+
15
+var canvas = document.getElementById('canvas');
16
+var ctx = canvas.getContext('2d');
17
+var width = 512;
18
+var height = 512;
19
+
20
+ctx.fillStyle = 'white';
21
+ctx.fillRect(0, 0, 512, 512);
22
+
23
+ctx.fillStyle = 'black';
24
+ctx.font = '512px sans-serif';
25
+ctx.textBaseline = 'middle';
26
+ctx.fillText('了', 0, 256);
27
+
28
+// ctx.moveTo(width / 2, 200);
29
+// ctx.lineTo(200, height - 200);
30
+// ctx.lineTo(width - 200, height - 200);
31
+// ctx.closePath();
32
+// ctx.strokeStyle = 'black';
33
+// ctx.stroke();
34
+// ctx.arc(width / 2, height / 2, 50, 0, Math.PI * 2, false);
35
+// ctx.fillStyle = 'black';
36
+// ctx.fill();
37
+// ctx.font = '64px serif';
38
+// ctx.fillStyle = 'black';
39
+// ctx.fillText('Hello world', 100, 100);
40
+
41
+var imgData = ctx.getImageData(0, 0, width, height);
42
+
43
+console.time('sdf total');
44
+
45
+console.time('init grids');
46
+var grid1 = new Float32Array(width * height);
47
+var grid2 = new Float32Array(width * height);
48
+for (var i = 0; i < width * height; i++) {
49
+    var val = imgData.data[i * 4];
50
+    grid1[i] = val === 255 ? 1e20 : val === 0 ? 0 : Math.abs(val / 255 - 0.5);
51
+    grid2[i] = val === 0 ? 1e20 : val === 255 ? 0 : Math.abs(val / 255 - 0.5);
52
+}
53
+console.timeEnd('init grids');
54
+
55
+console.time('sdf outer pass');
56
+edt(grid1, width, height);
57
+console.timeEnd('sdf outer pass');
58
+
59
+console.time('sdf inner pass');
60
+edt(grid2, width, height);
61
+console.timeEnd('sdf inner pass');
62
+
63
+console.timeEnd('sdf total');
64
+
65
+var result = new Float64Array(width * height);
66
+var max = 0;
67
+for (var i = 0; i < width * height; i++) {
68
+    max = Math.max(max, grid2[i]);
69
+}
70
+for (var i = 0; i < width * height; i++) {
71
+    result[i] = max + grid1[i] - grid2[i];
72
+}
73
+
74
+displayGrid(result);
75
+
76
+function displayGrid(grid) {
77
+    for (var y = 0; y < height; y++) {
78
+        for (var x = 0; x < width; x++) {
79
+            var k = y * width + x;
80
+            var d = grid[k];
81
+            var c = Math.max(Math.min(255, Math.round(d)), 0); //d % 10 < 5 ? 0 : 255
82
+            imgData.data[4 * k + 0] = imgData.data[4 * k + 1] = imgData.data[4 * k + 2] = c;
83
+        }
84
+    }
85
+    ctx.putImageData(imgData, 0, 0);
86
+}
87
+
88
+</script>
89
+</body>
90
+</html>

+ 0
- 0
node_modules/@mapbox/tiny-sdf/index.html Целия файл


Някои файлове не бяха показани, защото твърде много файлове са промени