@qikdev/sdk 0.1.169 → 0.1.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +24 -0
- package/.husky/pre-commit +5 -0
- package/eslint.config.js +6 -0
- package/jsdoc.conf +10 -0
- package/package.json +2 -12
- package/public/docs/access.html +3826 -0
- package/public/docs/api.html +1356 -0
- package/public/docs/auth.html +2180 -0
- package/public/docs/cache.html +351 -0
- package/public/docs/content.html +2560 -0
- package/public/docs/files.html +779 -0
- package/public/docs/filter.html +1355 -0
- package/public/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/public/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/public/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/public/docs/index.html +96 -0
- package/public/docs/qik.access.js.html +790 -0
- package/public/docs/qik.api.js.html +511 -0
- package/public/docs/qik.auth.js.html +1006 -0
- package/public/docs/qik.cache.js.html +131 -0
- package/public/docs/qik.content.js.html +918 -0
- package/public/docs/qik.core.js.html +301 -0
- package/public/docs/qik.files.js.html +219 -0
- package/public/docs/qik.filter.js.html +611 -0
- package/public/docs/qik.socket.js.html +416 -0
- package/public/docs/qik.system.js.html +117 -0
- package/public/docs/qik.utils.js.html +1467 -0
- package/public/docs/scripts/collapse.js +20 -0
- package/public/docs/scripts/linenumber.js +25 -0
- package/public/docs/scripts/nav.js +12 -0
- package/public/docs/scripts/polyfill.js +4 -0
- package/public/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/public/docs/scripts/prettify/lang-css.js +2 -0
- package/public/docs/scripts/prettify/prettify.js +28 -0
- package/public/docs/scripts/search.js +83 -0
- package/public/docs/socket.html +810 -0
- package/public/docs/styles/jsdoc.css +765 -0
- package/public/docs/styles/prettify.css +79 -0
- package/public/docs/system.html +197 -0
- package/src/api/qik.access.js +825 -0
- package/src/api/qik.api.js +431 -0
- package/src/api/qik.auth.js +881 -0
- package/src/api/qik.cache.js +63 -0
- package/src/api/qik.content.js +839 -0
- package/src/api/qik.core.js +245 -0
- package/src/api/qik.files.js +186 -0
- package/src/api/qik.filter.js +543 -0
- package/src/api/qik.geo.js +895 -0
- package/src/api/qik.socket.js +360 -0
- package/src/api/qik.system.js +49 -0
- package/src/api/qik.utils.js +1412 -0
- package/src/index.js +20 -0
- package/src/version.js +1 -0
- package/test/index.spec.js +41 -0
- package/test/mocha.opts +0 -0
- package/yarn-error.log +3598 -0
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
///////////////////////////////////////////////////
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new QikGeo instance.
|
|
5
|
+
* This module provides a number of geolocation features and functions
|
|
6
|
+
* @alias geo
|
|
7
|
+
* @constructor
|
|
8
|
+
* @hideconstructor
|
|
9
|
+
* @param {QikCore} qik A reference to the parent instance of the QikCore module. This module is usually created by a QikCore instance that passes itself in as the first argument.
|
|
10
|
+
*/
|
|
11
|
+
export default function(qik) {
|
|
12
|
+
|
|
13
|
+
///////////////////////////////////////////////////
|
|
14
|
+
|
|
15
|
+
var service = {}
|
|
16
|
+
|
|
17
|
+
function isEnabled() {
|
|
18
|
+
if (typeof window === 'undefined') {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!window.navigator) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (!window.navigator.geolocation) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* Get the distance between two geo location points
|
|
36
|
+
* @alias geo.distance
|
|
37
|
+
* @param {Object} positionOne The first position
|
|
38
|
+
* @param {Number} positionOne.lat The first positions latitude
|
|
39
|
+
* @param {Number} positionOne.lon The first positions longitude
|
|
40
|
+
* @param {Object} positionTwo The second position
|
|
41
|
+
* @param {Number} positionTwo.lat The second positions latitude
|
|
42
|
+
* @param {Number} positionTwo.lon The second positions longitude
|
|
43
|
+
* @example
|
|
44
|
+
* const meters = await sdk.geo.distance({lat, lon}, {lat, lon})
|
|
45
|
+
* // Returns 634
|
|
46
|
+
*/
|
|
47
|
+
service.distance = function({ lat: lat1, lon: lon1 }, { lat: lat2, lon: lon2 }) {
|
|
48
|
+
function deg2rad(deg) {
|
|
49
|
+
return deg * (Math.PI / 180)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var R = 6371000; // Radius of the earth in meters
|
|
53
|
+
var dLat = deg2rad(lat2 - lat1);
|
|
54
|
+
var dLon = deg2rad(lon2 - lon1);
|
|
55
|
+
var a =
|
|
56
|
+
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
|
57
|
+
Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *
|
|
58
|
+
Math.sin(dLon / 2) * Math.sin(dLon / 2);
|
|
59
|
+
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
60
|
+
var d = R * c; // Distance in meters
|
|
61
|
+
return d;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* Start watching the user's geolocation
|
|
67
|
+
* @alias geo.getPosition
|
|
68
|
+
* @param {Function} callback A function that will be called with updated position data
|
|
69
|
+
* @example
|
|
70
|
+
* const position = await sdk.geo.getPosition()
|
|
71
|
+
* // Returns {coords:{latitude, longitude, altitude, accuracy, ...}}
|
|
72
|
+
*/
|
|
73
|
+
service.getPosition = async function() {
|
|
74
|
+
|
|
75
|
+
if (!isEnabled()) {
|
|
76
|
+
return Promise.reject({ message: 'Geolocation is not enabled' });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
console.log('qik:geo: getting location');
|
|
80
|
+
return new Promise(function(resolve, reject) {
|
|
81
|
+
navigator.geolocation.getCurrentPosition(resolve, reject);
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* Start watching the user's geolocation
|
|
88
|
+
* @alias geo.stopWatchPosition
|
|
89
|
+
* @param {Function} callback A function that will be called with updated position data
|
|
90
|
+
* @example
|
|
91
|
+
* const result = await sdk.geo.watchPosition(callback)
|
|
92
|
+
* // Returns {id:<watcherID>}
|
|
93
|
+
*/
|
|
94
|
+
service.watchPosition = async function(positionDataReceived) {
|
|
95
|
+
|
|
96
|
+
if (!isEnabled()) {
|
|
97
|
+
return Promise.reject({ message: 'Geolocation is not enabled' });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log('qik:geo: watching location');
|
|
101
|
+
return new Promise(function(resolve, reject) {
|
|
102
|
+
const watchID = navigator.geolocation.watchPosition(positionDataReceived, reject);
|
|
103
|
+
resolve({
|
|
104
|
+
id: watchID,
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* Start watching the user's geolocation
|
|
112
|
+
* @alias geo.stopWatchPosition
|
|
113
|
+
* @param {String} watchID the id of the watcher to stop
|
|
114
|
+
* @example
|
|
115
|
+
* const result = await sdk.geo.stopWatchPosition(watchID)
|
|
116
|
+
* // Returns true after the watcher has been stopped
|
|
117
|
+
*/
|
|
118
|
+
service.stopWatchPosition = async function(watchID) {
|
|
119
|
+
if (!isEnabled()) {
|
|
120
|
+
return Promise.reject({ message: 'Geolocation is not enabled' });
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
console.log('qik:geo: watch stopped');
|
|
124
|
+
navigator.geolocation.clearWatch(this.watchID);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
///////////////////////////////////////////////////
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* Retrieves the default timezone for the current user/application
|
|
134
|
+
* will attempt to retrieve an accurate timezone either from the user's organisation or available services within the browser
|
|
135
|
+
* @alias geo.getDefaultTimezone
|
|
136
|
+
* @example
|
|
137
|
+
* const result = sdk.geo.getDefaultTimezone()
|
|
138
|
+
* // Would return something similar to:
|
|
139
|
+
* // Australia/Melbourne
|
|
140
|
+
*/
|
|
141
|
+
service.getDefaultTimezone = function() {
|
|
142
|
+
|
|
143
|
+
const {session:currentUser} = qik.auth.getCurrentUser();
|
|
144
|
+
|
|
145
|
+
if(currentUser) {
|
|
146
|
+
const defaultUserTimezone = currentUser?.organisation?.timezone;
|
|
147
|
+
if(defaultUserTimezone) {
|
|
148
|
+
return defaultUserTimezone;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (typeof window === 'undefined') {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (!window.Intl) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
return window.Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
///////////////////////////////////////////////////
|
|
163
|
+
|
|
164
|
+
service.countryLookup = {
|
|
165
|
+
"AC": "Ascension Island",
|
|
166
|
+
"AD": "Andorra",
|
|
167
|
+
"AE": "United Arab Emirates",
|
|
168
|
+
"AF": "Afghanistan",
|
|
169
|
+
"AG": "Antigua And Barbuda",
|
|
170
|
+
"AI": "Anguilla",
|
|
171
|
+
"AL": "Albania",
|
|
172
|
+
"AM": "Armenia",
|
|
173
|
+
"AO": "Angola",
|
|
174
|
+
"AQ": "Antarctica",
|
|
175
|
+
"AR": "Argentina",
|
|
176
|
+
"AS": "American Samoa",
|
|
177
|
+
"AT": "Austria",
|
|
178
|
+
"AU": "Australia",
|
|
179
|
+
"AW": "Aruba",
|
|
180
|
+
"AX": "Åland Islands",
|
|
181
|
+
"AZ": "Azerbaijan",
|
|
182
|
+
"BA": "Bosnia & Herzegovina",
|
|
183
|
+
"BB": "Barbados",
|
|
184
|
+
"BD": "Bangladesh",
|
|
185
|
+
"BE": "Belgium",
|
|
186
|
+
"BF": "Burkina Faso",
|
|
187
|
+
"BG": "Bulgaria",
|
|
188
|
+
"BH": "Bahrain",
|
|
189
|
+
"BI": "Burundi",
|
|
190
|
+
"BJ": "Benin",
|
|
191
|
+
"BL": "Saint Barthélemy",
|
|
192
|
+
"BM": "Bermuda",
|
|
193
|
+
"BN": "Brunei Darussalam",
|
|
194
|
+
"BO": "Bolivia, Plurinational State Of",
|
|
195
|
+
"BQ": "Bonaire, Saint Eustatius And Saba",
|
|
196
|
+
"BR": "Brazil",
|
|
197
|
+
"BS": "Bahamas",
|
|
198
|
+
"BT": "Bhutan",
|
|
199
|
+
"BV": "Bouvet Island",
|
|
200
|
+
"BW": "Botswana",
|
|
201
|
+
"BY": "Belarus",
|
|
202
|
+
"BZ": "Belize",
|
|
203
|
+
"CA": "Canada",
|
|
204
|
+
"CC": "Cocos (Keeling) Islands",
|
|
205
|
+
"CD": "Democratic Republic Of Congo",
|
|
206
|
+
"CF": "Central African Republic",
|
|
207
|
+
"CG": "Republic Of Congo",
|
|
208
|
+
"CH": "Switzerland",
|
|
209
|
+
"CI": "Côte d'Ivoire",
|
|
210
|
+
"CK": "Cook Islands",
|
|
211
|
+
"CL": "Chile",
|
|
212
|
+
"CM": "Cameroon",
|
|
213
|
+
"CN": "China",
|
|
214
|
+
"CO": "Colombia",
|
|
215
|
+
"CP": "Clipperton Island",
|
|
216
|
+
"CR": "Costa Rica",
|
|
217
|
+
"CU": "Cuba",
|
|
218
|
+
"CV": "Cabo Verde",
|
|
219
|
+
"CW": "Curacao",
|
|
220
|
+
"CX": "Christmas Island",
|
|
221
|
+
"CY": "Cyprus",
|
|
222
|
+
"CZ": "Czech Republic",
|
|
223
|
+
"DE": "Germany",
|
|
224
|
+
"DG": "Diego Garcia",
|
|
225
|
+
"DJ": "Djibouti",
|
|
226
|
+
"DK": "Denmark",
|
|
227
|
+
"DM": "Dominica",
|
|
228
|
+
"DO": "Dominican Republic",
|
|
229
|
+
"DZ": "Algeria",
|
|
230
|
+
"EA": "Ceuta, Mulilla",
|
|
231
|
+
"EC": "Ecuador",
|
|
232
|
+
"EE": "Estonia",
|
|
233
|
+
"EG": "Egypt",
|
|
234
|
+
"EH": "Western Sahara",
|
|
235
|
+
"ER": "Eritrea",
|
|
236
|
+
"ES": "Spain",
|
|
237
|
+
"ET": "Ethiopia",
|
|
238
|
+
"EU": "European Union",
|
|
239
|
+
"FI": "Finland",
|
|
240
|
+
"FJ": "Fiji",
|
|
241
|
+
"FK": "Falkland Islands",
|
|
242
|
+
"FM": "Micronesia, Federated States Of",
|
|
243
|
+
"FO": "Faroe Islands",
|
|
244
|
+
"TF": "French Southern Territories",
|
|
245
|
+
"FR": "France",
|
|
246
|
+
"FX": "France, Metropolitan",
|
|
247
|
+
"GA": "Gabon",
|
|
248
|
+
"GB": "United Kingdom",
|
|
249
|
+
"GD": "Grenada",
|
|
250
|
+
"GE": "Georgia",
|
|
251
|
+
"GF": "French Guiana",
|
|
252
|
+
"GG": "Guernsey",
|
|
253
|
+
"GH": "Ghana",
|
|
254
|
+
"GI": "Gibraltar",
|
|
255
|
+
"GL": "Greenland",
|
|
256
|
+
"GM": "Gambia",
|
|
257
|
+
"GN": "Guinea",
|
|
258
|
+
"GP": "Guadeloupe",
|
|
259
|
+
"GQ": "Equatorial Guinea",
|
|
260
|
+
"GR": "Greece",
|
|
261
|
+
"GS": "South Georgia And The South Sandwich Islands",
|
|
262
|
+
"GT": "Guatemala",
|
|
263
|
+
"GU": "Guam",
|
|
264
|
+
"GW": "Guinea-bissau",
|
|
265
|
+
"GY": "Guyana",
|
|
266
|
+
"HK": "Hong Kong",
|
|
267
|
+
"HM": "Heard Island And McDonald Islands",
|
|
268
|
+
"HN": "Honduras",
|
|
269
|
+
"HR": "Croatia",
|
|
270
|
+
"HT": "Haiti",
|
|
271
|
+
"HU": "Hungary",
|
|
272
|
+
"IC": "Canary Islands",
|
|
273
|
+
"ID": "Indonesia",
|
|
274
|
+
"IE": "Ireland",
|
|
275
|
+
"IL": "Israel",
|
|
276
|
+
"IM": "Isle Of Man",
|
|
277
|
+
"IN": "India",
|
|
278
|
+
"IO": "British Indian Ocean Territory",
|
|
279
|
+
"IQ": "Iraq",
|
|
280
|
+
"IR": "Iran, Islamic Republic Of",
|
|
281
|
+
"IS": "Iceland",
|
|
282
|
+
"IT": "Italy",
|
|
283
|
+
"JE": "Jersey",
|
|
284
|
+
"JM": "Jamaica",
|
|
285
|
+
"JO": "Jordan",
|
|
286
|
+
"JP": "Japan",
|
|
287
|
+
"KE": "Kenya",
|
|
288
|
+
"KG": "Kyrgyzstan",
|
|
289
|
+
"KH": "Cambodia",
|
|
290
|
+
"KI": "Kiribati",
|
|
291
|
+
"KM": "Comoros",
|
|
292
|
+
"KN": "Saint Kitts And Nevis",
|
|
293
|
+
"KP": "Korea, Democratic People's Republic Of",
|
|
294
|
+
"KR": "Korea, Republic Of",
|
|
295
|
+
"KW": "Kuwait",
|
|
296
|
+
"KY": "Cayman Islands",
|
|
297
|
+
"KZ": "Kazakhstan",
|
|
298
|
+
"LA": "Lao People's Democratic Republic",
|
|
299
|
+
"LB": "Lebanon",
|
|
300
|
+
"LC": "Saint Lucia",
|
|
301
|
+
"LI": "Liechtenstein",
|
|
302
|
+
"LK": "Sri Lanka",
|
|
303
|
+
"LR": "Liberia",
|
|
304
|
+
"LS": "Lesotho",
|
|
305
|
+
"LT": "Lithuania",
|
|
306
|
+
"LU": "Luxembourg",
|
|
307
|
+
"LV": "Latvia",
|
|
308
|
+
"LY": "Libya",
|
|
309
|
+
"MA": "Morocco",
|
|
310
|
+
"MC": "Monaco",
|
|
311
|
+
"MD": "Moldova",
|
|
312
|
+
"ME": "Montenegro",
|
|
313
|
+
"MF": "Saint Martin",
|
|
314
|
+
"MG": "Madagascar",
|
|
315
|
+
"MH": "Marshall Islands",
|
|
316
|
+
"MK": "Macedonia, The Former Yugoslav Republic Of",
|
|
317
|
+
"ML": "Mali",
|
|
318
|
+
"MM": "Myanmar",
|
|
319
|
+
"MN": "Mongolia",
|
|
320
|
+
"MO": "Macao",
|
|
321
|
+
"MP": "Northern Mariana Islands",
|
|
322
|
+
"MQ": "Martinique",
|
|
323
|
+
"MR": "Mauritania",
|
|
324
|
+
"MS": "Montserrat",
|
|
325
|
+
"MT": "Malta",
|
|
326
|
+
"MU": "Mauritius",
|
|
327
|
+
"MV": "Maldives",
|
|
328
|
+
"MW": "Malawi",
|
|
329
|
+
"MX": "Mexico",
|
|
330
|
+
"MY": "Malaysia",
|
|
331
|
+
"MZ": "Mozambique",
|
|
332
|
+
"NA": "Namibia",
|
|
333
|
+
"NC": "New Caledonia",
|
|
334
|
+
"NE": "Niger",
|
|
335
|
+
"NF": "Norfolk Island",
|
|
336
|
+
"NG": "Nigeria",
|
|
337
|
+
"NI": "Nicaragua",
|
|
338
|
+
"NL": "Netherlands",
|
|
339
|
+
"NO": "Norway",
|
|
340
|
+
"NP": "Nepal",
|
|
341
|
+
"NR": "Nauru",
|
|
342
|
+
"NU": "Niue",
|
|
343
|
+
"NZ": "New Zealand",
|
|
344
|
+
"OM": "Oman",
|
|
345
|
+
"PA": "Panama",
|
|
346
|
+
"PE": "Peru",
|
|
347
|
+
"PF": "French Polynesia",
|
|
348
|
+
"PG": "Papua New Guinea",
|
|
349
|
+
"PH": "Philippines",
|
|
350
|
+
"PK": "Pakistan",
|
|
351
|
+
"PL": "Poland",
|
|
352
|
+
"PM": "Saint Pierre And Miquelon",
|
|
353
|
+
"PN": "Pitcairn",
|
|
354
|
+
"PR": "Puerto Rico",
|
|
355
|
+
"PS": "Palestinian Territory, Occupied",
|
|
356
|
+
"PT": "Portugal",
|
|
357
|
+
"PW": "Palau",
|
|
358
|
+
"PY": "Paraguay",
|
|
359
|
+
"QA": "Qatar",
|
|
360
|
+
"RE": "Reunion",
|
|
361
|
+
"RO": "Romania",
|
|
362
|
+
"RS": "Serbia",
|
|
363
|
+
"RU": "Russian Federation",
|
|
364
|
+
"RW": "Rwanda",
|
|
365
|
+
"SA": "Saudi Arabia",
|
|
366
|
+
"SB": "Solomon Islands",
|
|
367
|
+
"SC": "Seychelles",
|
|
368
|
+
"SD": "Sudan",
|
|
369
|
+
"SE": "Sweden",
|
|
370
|
+
"SG": "Singapore",
|
|
371
|
+
"SH": "Saint Helena, Ascension And Tristan Da Cunha",
|
|
372
|
+
"SI": "Slovenia",
|
|
373
|
+
"SJ": "Svalbard And Jan Mayen",
|
|
374
|
+
"SK": "Slovakia",
|
|
375
|
+
"SL": "Sierra Leone",
|
|
376
|
+
"SM": "San Marino",
|
|
377
|
+
"SN": "Senegal",
|
|
378
|
+
"SO": "Somalia",
|
|
379
|
+
"SR": "Suriname",
|
|
380
|
+
"SS": "South Sudan",
|
|
381
|
+
"ST": "Sao Tome and Principe",
|
|
382
|
+
"SU": "USSR",
|
|
383
|
+
"SV": "El Salvador",
|
|
384
|
+
"SX": "Sint Maarten",
|
|
385
|
+
"SY": "Syrian Arab Republic",
|
|
386
|
+
"SZ": "Swaziland",
|
|
387
|
+
"TA": "Tristan de Cunha",
|
|
388
|
+
"TC": "Turks And Caicos Islands",
|
|
389
|
+
"TD": "Chad",
|
|
390
|
+
"TG": "Togo",
|
|
391
|
+
"TH": "Thailand",
|
|
392
|
+
"TJ": "Tajikistan",
|
|
393
|
+
"TK": "Tokelau",
|
|
394
|
+
"TL": "Timor-Leste, Democratic Republic of",
|
|
395
|
+
"TM": "Turkmenistan",
|
|
396
|
+
"TN": "Tunisia",
|
|
397
|
+
"TO": "Tonga",
|
|
398
|
+
"TR": "Turkey",
|
|
399
|
+
"TT": "Trinidad And Tobago",
|
|
400
|
+
"TV": "Tuvalu",
|
|
401
|
+
"TW": "Taiwan",
|
|
402
|
+
"TZ": "Tanzania, United Republic Of",
|
|
403
|
+
"UA": "Ukraine",
|
|
404
|
+
"UG": "Uganda",
|
|
405
|
+
"UK": "United Kingdom",
|
|
406
|
+
"UM": "United States Minor Outlying Islands",
|
|
407
|
+
"US": "United States",
|
|
408
|
+
"UY": "Uruguay",
|
|
409
|
+
"UZ": "Uzbekistan",
|
|
410
|
+
"VA": "Vatican City State",
|
|
411
|
+
"VC": "Saint Vincent And The Grenadines",
|
|
412
|
+
"VE": "Venezuela, Bolivarian Republic Of",
|
|
413
|
+
"VG": "Virgin Islands (British)",
|
|
414
|
+
"VI": "Virgin Islands (US)",
|
|
415
|
+
"VN": "Viet Nam",
|
|
416
|
+
"VU": "Vanuatu",
|
|
417
|
+
"WF": "Wallis And Futuna",
|
|
418
|
+
"WS": "Samoa",
|
|
419
|
+
"XK": "Kosovo",
|
|
420
|
+
"YE": "Yemen",
|
|
421
|
+
"YT": "Mayotte",
|
|
422
|
+
"ZA": "South Africa",
|
|
423
|
+
"ZM": "Zambia",
|
|
424
|
+
"ZW": "Zimbabwe"
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
service.countryNames = Object.values(service.countryLookup);
|
|
428
|
+
|
|
429
|
+
service.timezones = [
|
|
430
|
+
"Africa/Abidjan",
|
|
431
|
+
"Africa/Accra",
|
|
432
|
+
"Africa/Addis_Ababa",
|
|
433
|
+
"Africa/Algiers",
|
|
434
|
+
"Africa/Asmera",
|
|
435
|
+
"Africa/Bamako",
|
|
436
|
+
"Africa/Bangui",
|
|
437
|
+
"Africa/Banjul",
|
|
438
|
+
"Africa/Bissau",
|
|
439
|
+
"Africa/Blantyre",
|
|
440
|
+
"Africa/Brazzaville",
|
|
441
|
+
"Africa/Bujumbura",
|
|
442
|
+
"Africa/Cairo",
|
|
443
|
+
"Africa/Casablanca",
|
|
444
|
+
"Africa/Ceuta",
|
|
445
|
+
"Africa/Conakry",
|
|
446
|
+
"Africa/Dakar",
|
|
447
|
+
"Africa/Dar_es_Salaam",
|
|
448
|
+
"Africa/Djibouti",
|
|
449
|
+
"Africa/Douala",
|
|
450
|
+
"Africa/El_Aaiun",
|
|
451
|
+
"Africa/Freetown",
|
|
452
|
+
"Africa/Gaborone",
|
|
453
|
+
"Africa/Harare",
|
|
454
|
+
"Africa/Johannesburg",
|
|
455
|
+
"Africa/Juba",
|
|
456
|
+
"Africa/Kampala",
|
|
457
|
+
"Africa/Khartoum",
|
|
458
|
+
"Africa/Kigali",
|
|
459
|
+
"Africa/Kinshasa",
|
|
460
|
+
"Africa/Lagos",
|
|
461
|
+
"Africa/Libreville",
|
|
462
|
+
"Africa/Lome",
|
|
463
|
+
"Africa/Luanda",
|
|
464
|
+
"Africa/Lubumbashi",
|
|
465
|
+
"Africa/Lusaka",
|
|
466
|
+
"Africa/Malabo",
|
|
467
|
+
"Africa/Maputo",
|
|
468
|
+
"Africa/Maseru",
|
|
469
|
+
"Africa/Mbabane",
|
|
470
|
+
"Africa/Mogadishu",
|
|
471
|
+
"Africa/Monrovia",
|
|
472
|
+
"Africa/Nairobi",
|
|
473
|
+
"Africa/Ndjamena",
|
|
474
|
+
"Africa/Niamey",
|
|
475
|
+
"Africa/Nouakchott",
|
|
476
|
+
"Africa/Ouagadougou",
|
|
477
|
+
"Africa/Porto-Novo",
|
|
478
|
+
"Africa/Sao_Tome",
|
|
479
|
+
"Africa/Tripoli",
|
|
480
|
+
"Africa/Tunis",
|
|
481
|
+
"Africa/Windhoek",
|
|
482
|
+
"America/Anchorage",
|
|
483
|
+
"America/Anguilla",
|
|
484
|
+
"America/Antigua",
|
|
485
|
+
"America/Araguaina",
|
|
486
|
+
"America/Argentina/La_Rioja",
|
|
487
|
+
"America/Argentina/Rio_Gallegos",
|
|
488
|
+
"America/Argentina/Salta",
|
|
489
|
+
"America/Argentina/San_Juan",
|
|
490
|
+
"America/Argentina/San_Luis",
|
|
491
|
+
"America/Argentina/Tucuman",
|
|
492
|
+
"America/Argentina/Ushuaia",
|
|
493
|
+
"America/Aruba",
|
|
494
|
+
"America/Asuncion",
|
|
495
|
+
"America/Bahia",
|
|
496
|
+
"America/Bahia_Banderas",
|
|
497
|
+
"America/Barbados",
|
|
498
|
+
"America/Belem",
|
|
499
|
+
"America/Belize",
|
|
500
|
+
"America/Blanc-Sablon",
|
|
501
|
+
"America/Boa_Vista",
|
|
502
|
+
"America/Bogota",
|
|
503
|
+
"America/Boise",
|
|
504
|
+
"America/Buenos_Aires",
|
|
505
|
+
"America/Cambridge_Bay",
|
|
506
|
+
"America/Campo_Grande",
|
|
507
|
+
"America/Cancun",
|
|
508
|
+
"America/Caracas",
|
|
509
|
+
"America/Catamarca",
|
|
510
|
+
"America/Cayenne",
|
|
511
|
+
"America/Cayman",
|
|
512
|
+
"America/Chicago",
|
|
513
|
+
"America/Chihuahua",
|
|
514
|
+
"America/Coral_Harbour",
|
|
515
|
+
"America/Cordoba",
|
|
516
|
+
"America/Costa_Rica",
|
|
517
|
+
"America/Creston",
|
|
518
|
+
"America/Cuiaba",
|
|
519
|
+
"America/Curacao",
|
|
520
|
+
"America/Danmarkshavn",
|
|
521
|
+
"America/Dawson",
|
|
522
|
+
"America/Dawson_Creek",
|
|
523
|
+
"America/Denver",
|
|
524
|
+
"America/Detroit",
|
|
525
|
+
"America/Dominica",
|
|
526
|
+
"America/Edmonton",
|
|
527
|
+
"America/Eirunepe",
|
|
528
|
+
"America/El_Salvador",
|
|
529
|
+
"America/Fortaleza",
|
|
530
|
+
"America/Glace_Bay",
|
|
531
|
+
"America/Godthab",
|
|
532
|
+
"America/Goose_Bay",
|
|
533
|
+
"America/Grand_Turk",
|
|
534
|
+
"America/Grenada",
|
|
535
|
+
"America/Guadeloupe",
|
|
536
|
+
"America/Guatemala",
|
|
537
|
+
"America/Guayaquil",
|
|
538
|
+
"America/Guyana",
|
|
539
|
+
"America/Halifax",
|
|
540
|
+
"America/Havana",
|
|
541
|
+
"America/Hermosillo",
|
|
542
|
+
"America/Indiana/Knox",
|
|
543
|
+
"America/Indiana/Marengo",
|
|
544
|
+
"America/Indiana/Petersburg",
|
|
545
|
+
"America/Indiana/Tell_City",
|
|
546
|
+
"America/Indiana/Vevay",
|
|
547
|
+
"America/Indiana/Vincennes",
|
|
548
|
+
"America/Indiana/Winamac",
|
|
549
|
+
"America/Indianapolis",
|
|
550
|
+
"America/Inuvik",
|
|
551
|
+
"America/Iqaluit",
|
|
552
|
+
"America/Jamaica",
|
|
553
|
+
"America/Jujuy",
|
|
554
|
+
"America/Juneau",
|
|
555
|
+
"America/Kentucky/Monticello",
|
|
556
|
+
"America/Kralendijk",
|
|
557
|
+
"America/La_Paz",
|
|
558
|
+
"America/Lima",
|
|
559
|
+
"America/Los_Angeles",
|
|
560
|
+
"America/Louisville",
|
|
561
|
+
"America/Lower_Princes",
|
|
562
|
+
"America/Maceio",
|
|
563
|
+
"America/Managua",
|
|
564
|
+
"America/Manaus",
|
|
565
|
+
"America/Marigot",
|
|
566
|
+
"America/Martinique",
|
|
567
|
+
"America/Matamoros",
|
|
568
|
+
"America/Mazatlan",
|
|
569
|
+
"America/Mendoza",
|
|
570
|
+
"America/Menominee",
|
|
571
|
+
"America/Merida",
|
|
572
|
+
"America/Mexico_City",
|
|
573
|
+
"America/Moncton",
|
|
574
|
+
"America/Monterrey",
|
|
575
|
+
"America/Montevideo",
|
|
576
|
+
"America/Montreal",
|
|
577
|
+
"America/Montserrat",
|
|
578
|
+
"America/Nassau",
|
|
579
|
+
"America/New_York",
|
|
580
|
+
"America/Nipigon",
|
|
581
|
+
"America/Nome",
|
|
582
|
+
"America/Noronha",
|
|
583
|
+
"America/North_Dakota/Beulah",
|
|
584
|
+
"America/North_Dakota/Center",
|
|
585
|
+
"America/North_Dakota/New_Salem",
|
|
586
|
+
"America/Ojinaga",
|
|
587
|
+
"America/Panama",
|
|
588
|
+
"America/Pangnirtung",
|
|
589
|
+
"America/Paramaribo",
|
|
590
|
+
"America/Phoenix",
|
|
591
|
+
"America/Port-au-Prince",
|
|
592
|
+
"America/Port_of_Spain",
|
|
593
|
+
"America/Porto_Velho",
|
|
594
|
+
"America/Puerto_Rico",
|
|
595
|
+
"America/Rainy_River",
|
|
596
|
+
"America/Rankin_Inlet",
|
|
597
|
+
"America/Recife",
|
|
598
|
+
"America/Regina",
|
|
599
|
+
"America/Resolute",
|
|
600
|
+
"America/Rio_Branco",
|
|
601
|
+
"America/Santa_Isabel",
|
|
602
|
+
"America/Santarem",
|
|
603
|
+
"America/Santiago",
|
|
604
|
+
"America/Santo_Domingo",
|
|
605
|
+
"America/Sao_Paulo",
|
|
606
|
+
"America/Scoresbysund",
|
|
607
|
+
"America/Sitka",
|
|
608
|
+
"America/St_Barthelemy",
|
|
609
|
+
"America/St_Johns",
|
|
610
|
+
"America/St_Kitts",
|
|
611
|
+
"America/St_Lucia",
|
|
612
|
+
"America/St_Thomas",
|
|
613
|
+
"America/St_Vincent",
|
|
614
|
+
"America/Swift_Current",
|
|
615
|
+
"America/Tegucigalpa",
|
|
616
|
+
"America/Thule",
|
|
617
|
+
"America/Thunder_Bay",
|
|
618
|
+
"America/Tijuana",
|
|
619
|
+
"America/Toronto",
|
|
620
|
+
"America/Tortola",
|
|
621
|
+
"America/Vancouver",
|
|
622
|
+
"America/Whitehorse",
|
|
623
|
+
"America/Winnipeg",
|
|
624
|
+
"America/Yakutat",
|
|
625
|
+
"America/Yellowknife",
|
|
626
|
+
"Antarctica/Casey",
|
|
627
|
+
"Antarctica/Davis",
|
|
628
|
+
"Antarctica/DumontDUrville",
|
|
629
|
+
"Antarctica/Macquarie",
|
|
630
|
+
"Antarctica/Mawson",
|
|
631
|
+
"Antarctica/McMurdo",
|
|
632
|
+
"Antarctica/Palmer",
|
|
633
|
+
"Antarctica/Rothera",
|
|
634
|
+
"Antarctica/Syowa",
|
|
635
|
+
"Antarctica/Vostok",
|
|
636
|
+
"Arctic/Longyearbyen",
|
|
637
|
+
"Asia/Aden",
|
|
638
|
+
"Asia/Almaty",
|
|
639
|
+
"Asia/Amman",
|
|
640
|
+
"Asia/Anadyr",
|
|
641
|
+
"Asia/Aqtau",
|
|
642
|
+
"Asia/Aqtobe",
|
|
643
|
+
"Asia/Ashgabat",
|
|
644
|
+
"Asia/Baghdad",
|
|
645
|
+
"Asia/Bahrain",
|
|
646
|
+
"Asia/Baku",
|
|
647
|
+
"Asia/Bangkok",
|
|
648
|
+
"Asia/Beirut",
|
|
649
|
+
"Asia/Bishkek",
|
|
650
|
+
"Asia/Brunei",
|
|
651
|
+
"Asia/Calcutta",
|
|
652
|
+
"Asia/Chita",
|
|
653
|
+
"Asia/Choibalsan",
|
|
654
|
+
"Asia/Colombo",
|
|
655
|
+
"Asia/Damascus",
|
|
656
|
+
"Asia/Dhaka",
|
|
657
|
+
"Asia/Dili",
|
|
658
|
+
"Asia/Dubai",
|
|
659
|
+
"Asia/Dushanbe",
|
|
660
|
+
"Asia/Hong_Kong",
|
|
661
|
+
"Asia/Hovd",
|
|
662
|
+
"Asia/Irkutsk",
|
|
663
|
+
"Asia/Jakarta",
|
|
664
|
+
"Asia/Jayapura",
|
|
665
|
+
"Asia/Jerusalem",
|
|
666
|
+
"Asia/Kabul",
|
|
667
|
+
"Asia/Kamchatka",
|
|
668
|
+
"Asia/Karachi",
|
|
669
|
+
"Asia/Kathmandu",
|
|
670
|
+
"Asia/Khandyga",
|
|
671
|
+
"Asia/Kolkata",
|
|
672
|
+
"Asia/Krasnoyarsk",
|
|
673
|
+
"Asia/Kuala_Lumpur",
|
|
674
|
+
"Asia/Kuching",
|
|
675
|
+
"Asia/Kuwait",
|
|
676
|
+
"Asia/Macau",
|
|
677
|
+
"Asia/Magadan",
|
|
678
|
+
"Asia/Makassar",
|
|
679
|
+
"Asia/Manila",
|
|
680
|
+
"Asia/Muscat",
|
|
681
|
+
"Asia/Nicosia",
|
|
682
|
+
"Asia/Novokuznetsk",
|
|
683
|
+
"Asia/Novosibirsk",
|
|
684
|
+
"Asia/Omsk",
|
|
685
|
+
"Asia/Oral",
|
|
686
|
+
"Asia/Phnom_Penh",
|
|
687
|
+
"Asia/Pontianak",
|
|
688
|
+
"Asia/Pyongyang",
|
|
689
|
+
"Asia/Qatar",
|
|
690
|
+
"Asia/Qyzylorda",
|
|
691
|
+
"Asia/Rangoon",
|
|
692
|
+
"Asia/Riyadh",
|
|
693
|
+
"Asia/Saigon",
|
|
694
|
+
"Asia/Sakhalin",
|
|
695
|
+
"Asia/Samarkand",
|
|
696
|
+
"Asia/Seoul",
|
|
697
|
+
"Asia/Shanghai",
|
|
698
|
+
"Asia/Singapore",
|
|
699
|
+
"Asia/Srednekolymsk",
|
|
700
|
+
"Asia/Taipei",
|
|
701
|
+
"Asia/Tashkent",
|
|
702
|
+
"Asia/Tbilisi",
|
|
703
|
+
"Asia/Tehran",
|
|
704
|
+
"Asia/Thimphu",
|
|
705
|
+
"Asia/Tokyo",
|
|
706
|
+
"Asia/Ulaanbaatar",
|
|
707
|
+
"Asia/Urumqi",
|
|
708
|
+
"Asia/Ust-Nera",
|
|
709
|
+
"Asia/Vientiane",
|
|
710
|
+
"Asia/Vladivostok",
|
|
711
|
+
"Asia/Yakutsk",
|
|
712
|
+
"Asia/Yekaterinburg",
|
|
713
|
+
"Asia/Yerevan",
|
|
714
|
+
"Atlantic/Azores",
|
|
715
|
+
"Atlantic/Bermuda",
|
|
716
|
+
"Atlantic/Canary",
|
|
717
|
+
"Atlantic/Cape_Verde",
|
|
718
|
+
"Atlantic/Faeroe",
|
|
719
|
+
"Atlantic/Madeira",
|
|
720
|
+
"Atlantic/Reykjavik",
|
|
721
|
+
"Atlantic/South_Georgia",
|
|
722
|
+
"Atlantic/St_Helena",
|
|
723
|
+
"Atlantic/Stanley",
|
|
724
|
+
"Australia/Adelaide",
|
|
725
|
+
"Australia/Brisbane",
|
|
726
|
+
"Australia/Broken_Hill",
|
|
727
|
+
"Australia/Currie",
|
|
728
|
+
"Australia/Darwin",
|
|
729
|
+
"Australia/Hobart",
|
|
730
|
+
"Australia/Lindeman",
|
|
731
|
+
"Australia/Melbourne",
|
|
732
|
+
"Australia/Perth",
|
|
733
|
+
"Australia/Sydney",
|
|
734
|
+
"CST6CDT",
|
|
735
|
+
"EST5EDT",
|
|
736
|
+
"Etc/GMT",
|
|
737
|
+
"Etc/GMT+1",
|
|
738
|
+
"Etc/GMT+10",
|
|
739
|
+
"Etc/GMT+11",
|
|
740
|
+
"Etc/GMT+12",
|
|
741
|
+
"Etc/GMT+2",
|
|
742
|
+
"Etc/GMT+3",
|
|
743
|
+
"Etc/GMT+4",
|
|
744
|
+
"Etc/GMT+5",
|
|
745
|
+
"Etc/GMT+6",
|
|
746
|
+
"Etc/GMT+7",
|
|
747
|
+
"Etc/GMT-1",
|
|
748
|
+
"Etc/GMT-10",
|
|
749
|
+
"Etc/GMT-11",
|
|
750
|
+
"Etc/GMT-12",
|
|
751
|
+
"Etc/GMT-13",
|
|
752
|
+
"Etc/GMT-2",
|
|
753
|
+
"Etc/GMT-3",
|
|
754
|
+
"Etc/GMT-4",
|
|
755
|
+
"Etc/GMT-5",
|
|
756
|
+
"Etc/GMT-6",
|
|
757
|
+
"Etc/GMT-7",
|
|
758
|
+
"Etc/GMT-8",
|
|
759
|
+
"Etc/GMT-9",
|
|
760
|
+
"Europe/Amsterdam",
|
|
761
|
+
"Europe/Andorra",
|
|
762
|
+
"Europe/Astrakhan",
|
|
763
|
+
"Europe/Athens",
|
|
764
|
+
"Europe/Belgrade",
|
|
765
|
+
"Europe/Berlin",
|
|
766
|
+
"Europe/Bratislava",
|
|
767
|
+
"Europe/Brussels",
|
|
768
|
+
"Europe/Bucharest",
|
|
769
|
+
"Europe/Budapest",
|
|
770
|
+
"Europe/Busingen",
|
|
771
|
+
"Europe/Chisinau",
|
|
772
|
+
"Europe/Copenhagen",
|
|
773
|
+
"Europe/Dublin",
|
|
774
|
+
"Europe/Gibraltar",
|
|
775
|
+
"Europe/Guernsey",
|
|
776
|
+
"Europe/Helsinki",
|
|
777
|
+
"Europe/Isle_of_Man",
|
|
778
|
+
"Europe/Istanbul",
|
|
779
|
+
"Europe/Jersey",
|
|
780
|
+
"Europe/Kaliningrad",
|
|
781
|
+
"Europe/Kiev",
|
|
782
|
+
"Europe/Kirov",
|
|
783
|
+
"Europe/Lisbon",
|
|
784
|
+
"Europe/Ljubljana",
|
|
785
|
+
"Europe/London",
|
|
786
|
+
"Europe/Luxembourg",
|
|
787
|
+
"Europe/Madrid",
|
|
788
|
+
"Europe/Malta",
|
|
789
|
+
"Europe/Mariehamn",
|
|
790
|
+
"Europe/Minsk",
|
|
791
|
+
"Europe/Monaco",
|
|
792
|
+
"Europe/Moscow",
|
|
793
|
+
"Europe/Nicosia",
|
|
794
|
+
"Europe/Oslo",
|
|
795
|
+
"Europe/Paris",
|
|
796
|
+
"Europe/Podgorica",
|
|
797
|
+
"Europe/Prague",
|
|
798
|
+
"Europe/Riga",
|
|
799
|
+
"Europe/Rome",
|
|
800
|
+
"Europe/Samara",
|
|
801
|
+
"Europe/San_Marino",
|
|
802
|
+
"Europe/Sarajevo",
|
|
803
|
+
"Europe/Simferopol",
|
|
804
|
+
"Europe/Skopje",
|
|
805
|
+
"Europe/Sofia",
|
|
806
|
+
"Europe/Stockholm",
|
|
807
|
+
"Europe/Tallinn",
|
|
808
|
+
"Europe/Tirane",
|
|
809
|
+
"Europe/Ulyanovsk",
|
|
810
|
+
"Europe/Uzhgorod",
|
|
811
|
+
"Europe/Vaduz",
|
|
812
|
+
"Europe/Vatican",
|
|
813
|
+
"Europe/Vienna",
|
|
814
|
+
"Europe/Vilnius",
|
|
815
|
+
"Europe/Volgograd",
|
|
816
|
+
"Europe/Warsaw",
|
|
817
|
+
"Europe/Zagreb",
|
|
818
|
+
"Europe/Zaporozhye",
|
|
819
|
+
"Europe/Zurich",
|
|
820
|
+
"Indian/Antananarivo",
|
|
821
|
+
"Indian/Chagos",
|
|
822
|
+
"Indian/Christmas",
|
|
823
|
+
"Indian/Cocos",
|
|
824
|
+
"Indian/Comoro",
|
|
825
|
+
"Indian/Kerguelen",
|
|
826
|
+
"Indian/Mahe",
|
|
827
|
+
"Indian/Maldives",
|
|
828
|
+
"Indian/Mauritius",
|
|
829
|
+
"Indian/Mayotte",
|
|
830
|
+
"Indian/Reunion",
|
|
831
|
+
"MST7MDT",
|
|
832
|
+
"PST8PDT",
|
|
833
|
+
"Pacific/Apia",
|
|
834
|
+
"Pacific/Auckland",
|
|
835
|
+
"Pacific/Efate",
|
|
836
|
+
"Pacific/Enderbury",
|
|
837
|
+
"Pacific/Fakaofo",
|
|
838
|
+
"Pacific/Fiji",
|
|
839
|
+
"Pacific/Funafuti",
|
|
840
|
+
"Pacific/Galapagos",
|
|
841
|
+
"Pacific/Guadalcanal",
|
|
842
|
+
"Pacific/Guam",
|
|
843
|
+
"Pacific/Honolulu",
|
|
844
|
+
"Pacific/Johnston",
|
|
845
|
+
"Pacific/Kosrae",
|
|
846
|
+
"Pacific/Kwajalein",
|
|
847
|
+
"Pacific/Majuro",
|
|
848
|
+
"Pacific/Midway",
|
|
849
|
+
"Pacific/Nauru",
|
|
850
|
+
"Pacific/Niue",
|
|
851
|
+
"Pacific/Noumea",
|
|
852
|
+
"Pacific/Pago_Pago",
|
|
853
|
+
"Pacific/Palau",
|
|
854
|
+
"Pacific/Ponape",
|
|
855
|
+
"Pacific/Port_Moresby",
|
|
856
|
+
"Pacific/Rarotonga",
|
|
857
|
+
"Pacific/Saipan",
|
|
858
|
+
"Pacific/Tahiti",
|
|
859
|
+
"Pacific/Tarawa",
|
|
860
|
+
"Pacific/Tongatapu",
|
|
861
|
+
"Pacific/Truk",
|
|
862
|
+
"Pacific/Wake",
|
|
863
|
+
"Pacific/Wallis",
|
|
864
|
+
]
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
*
|
|
868
|
+
* Retrieves the default country for the current user/application
|
|
869
|
+
* will attempt to retrieve the country from the user or application's organisation or from services available within the browser
|
|
870
|
+
* @alias geo.getDefaultCountry
|
|
871
|
+
* @example
|
|
872
|
+
* const result = sdk.geo.getDefaultCountry()
|
|
873
|
+
* // Would return something similar to:
|
|
874
|
+
* // { code:'AU', name:'Australia' }
|
|
875
|
+
*/
|
|
876
|
+
service.getDefaultCountry = function() {
|
|
877
|
+
const {session:currentUser} = qik.auth.getCurrentUser();
|
|
878
|
+
|
|
879
|
+
if(currentUser) {
|
|
880
|
+
const code = currentUser?.organisation?.countryCode;
|
|
881
|
+
if(code) {
|
|
882
|
+
const name = service.countryLookup[code];
|
|
883
|
+
return {
|
|
884
|
+
code,
|
|
885
|
+
name
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
///////////////////////////////////////////////////
|
|
892
|
+
|
|
893
|
+
return service;
|
|
894
|
+
|
|
895
|
+
}
|