1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | var jsCommon;
|
55 | (function (jsCommon) {
|
56 | |
57 |
|
58 |
|
59 | var DOMConstants;
|
60 | (function (DOMConstants) {
|
61 | |
62 |
|
63 |
|
64 | DOMConstants.escKeyCode = 27;
|
65 | DOMConstants.enterKeyCode = 13;
|
66 | DOMConstants.tabKeyCode = 9;
|
67 | DOMConstants.upArrowKeyCode = 38;
|
68 | DOMConstants.downArrowKeyCode = 40;
|
69 | DOMConstants.leftArrowKeyCode = 37;
|
70 | DOMConstants.rightArrowKeyCode = 39;
|
71 | DOMConstants.homeKeyCode = 36;
|
72 | DOMConstants.endKeyCode = 35;
|
73 | DOMConstants.backSpaceKeyCode = 8;
|
74 | DOMConstants.deleteKeyCode = 46;
|
75 | DOMConstants.spaceKeyCode = 32;
|
76 | DOMConstants.shiftKeyCode = 16;
|
77 | DOMConstants.ctrlKeyCode = 17;
|
78 | DOMConstants.altKeyCode = 18;
|
79 | DOMConstants.aKeyCode = 65;
|
80 | DOMConstants.cKeyCode = 67;
|
81 | DOMConstants.sKeyCode = 83;
|
82 | DOMConstants.vKeyCode = 86;
|
83 | DOMConstants.wKeyCode = 87;
|
84 | DOMConstants.xKeyCode = 88;
|
85 | DOMConstants.yKeyCode = 89;
|
86 | DOMConstants.zKeyCode = 90;
|
87 | |
88 |
|
89 |
|
90 | DOMConstants.DocumentBody = 'body';
|
91 | DOMConstants.Anchor = 'a';
|
92 | DOMConstants.EditableTextElements = ':text, textarea';
|
93 | DOMConstants.EditableNumericElements = '[type="number"]';
|
94 | |
95 |
|
96 |
|
97 | DOMConstants.disabledAttributeOrValue = 'disabled';
|
98 | DOMConstants.readonlyAttributeOrValue = 'readonly';
|
99 | DOMConstants.idAttribute = 'id';
|
100 | DOMConstants.styleAttribute = 'style';
|
101 | DOMConstants.hrefAttribute = 'href';
|
102 | DOMConstants.targetAttribute = 'target';
|
103 | DOMConstants.blankValue = '_blank';
|
104 | DOMConstants.selfValue = '_self';
|
105 | DOMConstants.classAttribute = 'class';
|
106 | DOMConstants.titleAttribute = 'title';
|
107 | DOMConstants.srcAttribute = 'src';
|
108 | |
109 |
|
110 |
|
111 | DOMConstants.contextmenuEventName = 'contextmenu';
|
112 | DOMConstants.blurEventName = 'blur';
|
113 | DOMConstants.keyUpEventName = 'keyup';
|
114 | DOMConstants.inputEventName = 'input';
|
115 | DOMConstants.changeEventName = 'change';
|
116 | DOMConstants.cutEventName = 'cut';
|
117 | DOMConstants.keyDownEventName = 'keydown';
|
118 | DOMConstants.mouseMoveEventName = 'mousemove';
|
119 | DOMConstants.mouseDownEventName = 'mousedown';
|
120 | DOMConstants.mouseEnterEventName = 'mouseenter';
|
121 | DOMConstants.mouseLeaveEventName = 'mouseleave';
|
122 | DOMConstants.mouseOverEventName = 'mouseover';
|
123 | DOMConstants.mouseOutEventName = 'mouseout';
|
124 | DOMConstants.mouseClickEventName = 'click';
|
125 | DOMConstants.pasteEventName = 'paste';
|
126 | DOMConstants.scrollEventName = 'scroll';
|
127 | DOMConstants.dropEventName = 'drop';
|
128 | DOMConstants.focusEventName = 'focus';
|
129 | DOMConstants.focusInEventName = 'focusin';
|
130 | DOMConstants.focusOutEventName = 'focusout';
|
131 | DOMConstants.selectEventName = 'select';
|
132 | DOMConstants.messageEventName = 'message';
|
133 | DOMConstants.loadEventName = 'load';
|
134 | DOMConstants.beforeUnload = 'beforeunload';
|
135 | |
136 |
|
137 |
|
138 | DOMConstants.inputAndSelectEventNames = 'input, select';
|
139 | })(DOMConstants = jsCommon.DOMConstants || (jsCommon.DOMConstants = {}));
|
140 | })(jsCommon || (jsCommon = {}));
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 | var powerbi;
|
167 | (function (powerbi) {
|
168 | (function (PowerBIErrorResourceType) {
|
169 | PowerBIErrorResourceType[PowerBIErrorResourceType["ResourceCodeReference"] = 0] = "ResourceCodeReference";
|
170 | PowerBIErrorResourceType[PowerBIErrorResourceType["EmbeddedString"] = 1] = "EmbeddedString";
|
171 | })(powerbi.PowerBIErrorResourceType || (powerbi.PowerBIErrorResourceType = {}));
|
172 | var PowerBIErrorResourceType = powerbi.PowerBIErrorResourceType;
|
173 | var ServiceErrorToClientError = (function () {
|
174 | function ServiceErrorToClientError(serviceError) {
|
175 | this.m_serviceError = serviceError;
|
176 | }
|
177 | Object.defineProperty(ServiceErrorToClientError.prototype, "code", {
|
178 | get: function () {
|
179 | return ServiceErrorToClientError.codeName;
|
180 | },
|
181 | enumerable: true,
|
182 | configurable: true
|
183 | });
|
184 | Object.defineProperty(ServiceErrorToClientError.prototype, "ignorable", {
|
185 | get: function () {
|
186 | return false;
|
187 | },
|
188 | enumerable: true,
|
189 | configurable: true
|
190 | });
|
191 | Object.defineProperty(ServiceErrorToClientError.prototype, "requestId", {
|
192 | get: function () {
|
193 | return this.httpRequestId;
|
194 | },
|
195 | set: function (value) {
|
196 | this.httpRequestId = value;
|
197 | },
|
198 | enumerable: true,
|
199 | configurable: true
|
200 | });
|
201 | ServiceErrorToClientError.prototype.getDetails = function (resourceProvider) {
|
202 | var errorDetails;
|
203 | if (this.m_serviceError.statusCode === 6 ) {
|
204 | errorDetails = PowerBIErrorDetailHelper.GetDetailsFromTransformError(resourceProvider, this.m_serviceError);
|
205 | }
|
206 | else {
|
207 | errorDetails = PowerBIErrorDetailHelper.GetDetailsFromServerErrorStatusCode(resourceProvider, this.m_serviceError.statusCode);
|
208 | }
|
209 | PowerBIErrorDetailHelper.addAdditionalInfo(errorDetails, this.m_serviceError.errorDetails, resourceProvider);
|
210 | PowerBIErrorDetailHelper.addMessageAndStackTrace(errorDetails, this.m_serviceError.message || null, this.m_serviceError.stackTrace || null, resourceProvider);
|
211 | return errorDetails;
|
212 | };
|
213 | ServiceErrorToClientError.codeName = 'ServiceErrorToClientError';
|
214 | return ServiceErrorToClientError;
|
215 | }());
|
216 | powerbi.ServiceErrorToClientError = ServiceErrorToClientError;
|
217 | var PowerBIErrorDetailHelper = (function () {
|
218 | function PowerBIErrorDetailHelper() {
|
219 | }
|
220 | PowerBIErrorDetailHelper.addAdditionalInfo = function (errorDetails, pbiErrorDetails, localize) {
|
221 | if (pbiErrorDetails) {
|
222 | for (var i = 0; i < pbiErrorDetails.length; i++) {
|
223 | var element = pbiErrorDetails[i];
|
224 | var localizedCode = localize.getOptional(PowerBIErrorDetailHelper.serverErrorPrefix + element.code);
|
225 | var additionErrorInfoKeyValuePair = {
|
226 | errorInfoKey: localizedCode ? localizedCode : element.code,
|
227 | errorInfoValue: element.detail.type === PowerBIErrorResourceType.ResourceCodeReference ? localize.get(PowerBIErrorDetailHelper.serverErrorPrefix + element.detail.value) : element.detail.value
|
228 | };
|
229 | errorDetails.additionalErrorInfo.push(additionErrorInfoKeyValuePair);
|
230 | }
|
231 | }
|
232 | return errorDetails;
|
233 | };
|
234 | PowerBIErrorDetailHelper.addMessageAndStackTrace = function (errorDetails, message, stackTrace, localize) {
|
235 | if (message) {
|
236 | var additionErrorInfoKeyValuePair = {
|
237 | errorInfoKey: localize.get("AdditionalErrorInfo_ErrorDetailsText"),
|
238 | errorInfoValue: message
|
239 | };
|
240 | errorDetails.additionalErrorInfo.push(additionErrorInfoKeyValuePair);
|
241 | }
|
242 | if (stackTrace) {
|
243 | var additionErrorInfoKeyValuePair = {
|
244 | errorInfoKey: localize.get("AdditionalErrorInfo_StackTraceText"),
|
245 | errorInfoValue: stackTrace
|
246 | };
|
247 | errorDetails.additionalErrorInfo.push(additionErrorInfoKeyValuePair);
|
248 | }
|
249 | return errorDetails;
|
250 | };
|
251 | PowerBIErrorDetailHelper.GetDetailsFromTransformError = function (localize, serviceError) {
|
252 | var message = localize.get('ServiceError_CannotLoadVisual');
|
253 | var key = localize.get('ServiceError_CannotLoadVisual');
|
254 | var val = serviceError.message;
|
255 | var additionalInfo = [];
|
256 | additionalInfo.push({ errorInfoKey: key, errorInfoValue: val, });
|
257 | var errorDetails = {
|
258 | message: message,
|
259 | additionalErrorInfo: additionalInfo,
|
260 | };
|
261 | return errorDetails;
|
262 | };
|
263 | PowerBIErrorDetailHelper.GetDetailsFromServerErrorStatusCode = function (localize, statusCode) {
|
264 |
|
265 | var message = "";
|
266 | var key = "";
|
267 | var val = "";
|
268 | switch (statusCode) {
|
269 | case 2 :
|
270 | message = localize.get('ServiceError_ModelCannotLoad');
|
271 | key = localize.get('ServiceError_ModelConvertFailureKey');
|
272 | val = localize.get('ServiceError_ModelConvertFailureValue');
|
273 | break;
|
274 | case 3 :
|
275 | message = localize.get('ServiceError_ModelCannotLoad');
|
276 | key = localize.get('ServiceError_ModelCreationFailureKey');
|
277 | val = localize.get('ServiceError_ModelCreationFailureValue');
|
278 | break;
|
279 | case 1 :
|
280 | message = localize.get('ServiceError_ModelCannotLoad');
|
281 | key = localize.get('ServiceError_ModelFetchingFailureKey');
|
282 | val = localize.get('ServiceError_ModelFetchingFailureValue');
|
283 | break;
|
284 | case 4 :
|
285 | message = localize.get('ServiceError_CannotLoadVisual');
|
286 | key = localize.get('ServiceError_ExecuteSemanticQueryErrorKey');
|
287 | val = localize.get('ServiceError_ExecuteSemanticQueryErrorValue');
|
288 | break;
|
289 | case 5 :
|
290 | message = localize.get('ServiceError_CannotLoadVisual');
|
291 | key = localize.get('ServiceError_ExecuteSemanticQueryInvalidStreamFormatKey');
|
292 | val = localize.get('ServiceError_ExecuteSemanticQueryInvalidStreamFormatValue');
|
293 | break;
|
294 | case 0 :
|
295 | default:
|
296 | message = localize.get('ServiceError_GeneralError');
|
297 | key = localize.get('ServiceError_GeneralErrorKey');
|
298 | val = localize.get('ServiceError_GeneralErrorValue');
|
299 | break;
|
300 | }
|
301 | var additionalInfo = [];
|
302 | additionalInfo.push({ errorInfoKey: key, errorInfoValue: val, });
|
303 | var errorDetails = {
|
304 | message: message,
|
305 | additionalErrorInfo: additionalInfo,
|
306 | };
|
307 | return errorDetails;
|
308 | };
|
309 | PowerBIErrorDetailHelper.serverErrorPrefix = "ServerError_";
|
310 | return PowerBIErrorDetailHelper;
|
311 | }());
|
312 | powerbi.PowerBIErrorDetailHelper = PowerBIErrorDetailHelper;
|
313 | })(powerbi || (powerbi = {}));
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 | var powerbi;
|
340 | (function (powerbi) {
|
341 | })(powerbi || (powerbi = {}));
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 | var powerbi;
|
368 | (function (powerbi) {
|
369 | powerbi.CategoryTypes = {
|
370 | Address: "Address",
|
371 | City: "City",
|
372 | Continent: "Continent",
|
373 | CountryRegion: "Country",
|
374 | County: "County",
|
375 | Longitude: "Longitude",
|
376 | Latitude: "Latitude",
|
377 | Place: "Place",
|
378 | PostalCode: "PostalCode",
|
379 | StateOrProvince: "StateOrProvince"
|
380 | };
|
381 | function createGeoTaggingAnalyzerService(getLocalized) {
|
382 | return new GeoTaggingAnalyzerService(getLocalized);
|
383 | }
|
384 | powerbi.createGeoTaggingAnalyzerService = createGeoTaggingAnalyzerService;
|
385 | var EnglishBackup = {
|
386 | GeotaggingString_Continent: "continent",
|
387 | GeotaggingString_Continents: "continents",
|
388 | GeotaggingString_Country: "country",
|
389 | GeotaggingString_Countries: "countries",
|
390 | GeotaggingString_State: "state",
|
391 | GeotaggingString_States: "states",
|
392 | GeotaggingString_City: "city",
|
393 | GeotaggingString_Cities: "cities",
|
394 | GeotaggingString_Town: "town",
|
395 | GeotaggingString_Towns: "towns",
|
396 | GeotaggingString_Province: "province",
|
397 | GeotaggingString_Provinces: "provinces",
|
398 | GeotaggingString_County: "county",
|
399 | GeotaggingString_Counties: "counties",
|
400 | GeotaggingString_Village: "village",
|
401 | GeotaggingString_Villages: "villages",
|
402 | GeotaggingString_Post: "post",
|
403 | GeotaggingString_Zip: "zip",
|
404 | GeotaggingString_Code: "code",
|
405 | GeotaggingString_Place: "place",
|
406 | GeotaggingString_Places: "places",
|
407 | GeotaggingString_Address: "address",
|
408 | GeotaggingString_Addresses: "addresses",
|
409 | GeotaggingString_Street: "street",
|
410 | GeotaggingString_Streets: "streets",
|
411 | GeotaggingString_Longitude: "longitude",
|
412 | GeotaggingString_Longitude_Short: "lon",
|
413 | GeotaggingString_Latitude: "latitude",
|
414 | GeotaggingString_Latitude_Short: "lat",
|
415 | GeotaggingString_PostalCode: "postal code",
|
416 | GeotaggingString_PostalCodes: "postal codes",
|
417 | GeotaggingString_ZipCode: "zip code",
|
418 | GeotaggingString_ZipCodes: "zip codes",
|
419 | GeotaggingString_Territory: "territory",
|
420 | GeotaggingString_Territories: "territories",
|
421 | GeotaggingString_VRMBackCompat_CountryRegion: "CountryRegion",
|
422 | GeotaggingString_VRMBackCompat_StateOrProvince: "StateOrProvince",
|
423 | };
|
424 | var GeoTaggingAnalyzerService = (function () {
|
425 | function GeoTaggingAnalyzerService(getLocalized) {
|
426 | this.GeotaggingString_VRMBackCompat_CountryRegion = "CountryRegion";
|
427 | this.GeotaggingString_VRMBackCompat_StateOrProvince = "StateOrProvince";
|
428 | this.GeotaggingString_Continent = getLocalized("GeotaggingString_Continent").toLowerCase();
|
429 | this.GeotaggingString_Continents = getLocalized("GeotaggingString_Continents").toLowerCase();
|
430 | this.GeotaggingString_Country = getLocalized("GeotaggingString_Country").toLowerCase();
|
431 | this.GeotaggingString_Countries = getLocalized("GeotaggingString_Countries").toLowerCase();
|
432 | this.GeotaggingString_State = getLocalized("GeotaggingString_State").toLowerCase();
|
433 | this.GeotaggingString_States = getLocalized("GeotaggingString_States").toLowerCase();
|
434 | this.GeotaggingString_City = getLocalized("GeotaggingString_City").toLowerCase();
|
435 | this.GeotaggingString_Cities = getLocalized("GeotaggingString_Cities").toLowerCase();
|
436 | this.GeotaggingString_Town = getLocalized("GeotaggingString_Town").toLowerCase();
|
437 | this.GeotaggingString_Towns = getLocalized("GeotaggingString_Towns").toLowerCase();
|
438 | this.GeotaggingString_Province = getLocalized("GeotaggingString_Province").toLowerCase();
|
439 | this.GeotaggingString_Provinces = getLocalized("GeotaggingString_Provinces").toLowerCase();
|
440 | this.GeotaggingString_County = getLocalized("GeotaggingString_County").toLowerCase();
|
441 | this.GeotaggingString_Counties = getLocalized("GeotaggingString_Counties").toLowerCase();
|
442 | this.GeotaggingString_Village = getLocalized("GeotaggingString_Village").toLowerCase();
|
443 | this.GeotaggingString_Villages = getLocalized("GeotaggingString_Villages").toLowerCase();
|
444 | this.GeotaggingString_Post = getLocalized("GeotaggingString_Post").toLowerCase();
|
445 | this.GeotaggingString_Zip = getLocalized("GeotaggingString_Zip").toLowerCase();
|
446 | this.GeotaggingString_Code = getLocalized("GeotaggingString_Code").toLowerCase();
|
447 | this.GeotaggingString_Place = getLocalized("GeotaggingString_Place").toLowerCase();
|
448 | this.GeotaggingString_Places = getLocalized("GeotaggingString_Places").toLowerCase();
|
449 | this.GeotaggingString_Address = getLocalized("GeotaggingString_Address").toLowerCase();
|
450 | this.GeotaggingString_Addresses = getLocalized("GeotaggingString_Addresses").toLowerCase();
|
451 | this.GeotaggingString_Street = getLocalized("GeotaggingString_Street").toLowerCase();
|
452 | this.GeotaggingString_Streets = getLocalized("GeotaggingString_Streets").toLowerCase();
|
453 | this.GeotaggingString_Longitude = getLocalized("GeotaggingString_Longitude").toLowerCase();
|
454 | this.GeotaggingString_Longitude_Short = getLocalized("GeotaggingString_Longitude_Short").toLowerCase();
|
455 | this.GeotaggingString_Latitude = getLocalized("GeotaggingString_Latitude").toLowerCase();
|
456 | this.GeotaggingString_Latitude_Short = getLocalized("GeotaggingString_Latitude_Short").toLowerCase();
|
457 | this.GeotaggingString_PostalCode = getLocalized("GeotaggingString_PostalCode").toLowerCase();
|
458 | this.GeotaggingString_PostalCodes = getLocalized("GeotaggingString_PostalCodes").toLowerCase();
|
459 | this.GeotaggingString_ZipCode = getLocalized("GeotaggingString_ZipCode").toLowerCase();
|
460 | this.GeotaggingString_ZipCodes = getLocalized("GeotaggingString_ZipCodes").toLowerCase();
|
461 | this.GeotaggingString_Territory = getLocalized("GeotaggingString_Territory").toLowerCase();
|
462 | this.GeotaggingString_Territories = getLocalized("GeotaggingString_Territories").toLowerCase();
|
463 | }
|
464 | GeoTaggingAnalyzerService.prototype.isLongitudeOrLatitude = function (fieldRefName) {
|
465 | return this.isLongitude(fieldRefName) ||
|
466 | this.isLatitude(fieldRefName);
|
467 | };
|
468 | GeoTaggingAnalyzerService.prototype.isGeographic = function (fieldRefName) {
|
469 | return this.isLongitudeOrLatitude(fieldRefName) ||
|
470 | this.isGeocodable(fieldRefName);
|
471 | };
|
472 | GeoTaggingAnalyzerService.prototype.isGeocodable = function (fieldRefName) {
|
473 | return this.isAddress(fieldRefName) ||
|
474 | this.isCity(fieldRefName) ||
|
475 | this.isContinent(fieldRefName) ||
|
476 | this.isCountry(fieldRefName) ||
|
477 | this.isCounty(fieldRefName) ||
|
478 | this.isStateOrProvince(fieldRefName) ||
|
479 | this.isPlace(fieldRefName) ||
|
480 | this.isPostalCode(fieldRefName) ||
|
481 | this.isTerritory(fieldRefName);
|
482 | };
|
483 | GeoTaggingAnalyzerService.prototype.isGeoshapable = function (fieldRefName) {
|
484 | return this.isCity(fieldRefName) ||
|
485 | this.isCountry(fieldRefName) ||
|
486 | this.isCounty(fieldRefName) ||
|
487 | this.isStateOrProvince(fieldRefName) ||
|
488 | this.isPostalCode(fieldRefName) ||
|
489 | this.isTerritory(fieldRefName) ||
|
490 | this.isGeoshapableEnglish(fieldRefName);
|
491 | };
|
492 | GeoTaggingAnalyzerService.prototype.isGeoshapableEnglish = function (fieldRefName) {
|
493 | return this.isEnglishCity(fieldRefName) ||
|
494 | this.isEnglishCountry(fieldRefName) ||
|
495 | this.isEnglishCounty(fieldRefName) ||
|
496 | this.isEnglishStateOrProvince(fieldRefName) ||
|
497 | this.isEnglishPostalCode(fieldRefName) ||
|
498 | this.isEnglishTerritory(fieldRefName);
|
499 | };
|
500 | GeoTaggingAnalyzerService.prototype.isAddress = function (fieldRefName) {
|
501 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
502 | this.GeotaggingString_Address,
|
503 | this.GeotaggingString_Addresses,
|
504 | this.GeotaggingString_Street,
|
505 | this.GeotaggingString_Streets
|
506 | ]);
|
507 | };
|
508 | GeoTaggingAnalyzerService.prototype.isPlace = function (fieldRefName) {
|
509 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
510 | this.GeotaggingString_Place,
|
511 | this.GeotaggingString_Places
|
512 | ]);
|
513 | };
|
514 | GeoTaggingAnalyzerService.prototype.isCity = function (fieldRefName) {
|
515 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
516 | this.GeotaggingString_City,
|
517 | this.GeotaggingString_Cities,
|
518 | this.GeotaggingString_Town,
|
519 | this.GeotaggingString_Towns,
|
520 | this.GeotaggingString_Village,
|
521 | this.GeotaggingString_Villages
|
522 | ]);
|
523 | };
|
524 | GeoTaggingAnalyzerService.prototype.isStateOrProvince = function (fieldRefName) {
|
525 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
526 | this.GeotaggingString_State,
|
527 | this.GeotaggingString_States,
|
528 | this.GeotaggingString_Province,
|
529 | this.GeotaggingString_Provinces,
|
530 | this.GeotaggingString_VRMBackCompat_StateOrProvince,
|
531 | ]);
|
532 | };
|
533 | GeoTaggingAnalyzerService.prototype.isCountry = function (fieldRefName) {
|
534 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
535 | this.GeotaggingString_Country,
|
536 | this.GeotaggingString_Countries,
|
537 | this.GeotaggingString_VRMBackCompat_CountryRegion
|
538 | ]);
|
539 | };
|
540 | GeoTaggingAnalyzerService.prototype.isCounty = function (fieldRefName) {
|
541 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
542 | this.GeotaggingString_County,
|
543 | this.GeotaggingString_Counties
|
544 | ]);
|
545 | };
|
546 | GeoTaggingAnalyzerService.prototype.isContinent = function (fieldRefName) {
|
547 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
548 | this.GeotaggingString_Continent,
|
549 | this.GeotaggingString_Continents
|
550 | ]);
|
551 | };
|
552 | GeoTaggingAnalyzerService.prototype.isPostalCode = function (fieldRefName) {
|
553 | var result = (GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
554 | this.GeotaggingString_Post,
|
555 | this.GeotaggingString_Zip])
|
556 | && GeoTaggingAnalyzerService.hasMatches(fieldRefName, [this.GeotaggingString_Code])) ||
|
557 | GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
558 | this.GeotaggingString_PostalCode,
|
559 | this.GeotaggingString_PostalCodes,
|
560 | this.GeotaggingString_ZipCode,
|
561 | this.GeotaggingString_ZipCodes
|
562 | ]);
|
563 |
|
564 | if (!result) {
|
565 | var whiteSpaceRegex = /\s+/;
|
566 | var fieldNameWithoutWhitespace = fieldRefName.replace(whiteSpaceRegex, "");
|
567 | result = GeoTaggingAnalyzerService.hasMatches(fieldNameWithoutWhitespace, [
|
568 | this.GeotaggingString_PostalCode.replace(whiteSpaceRegex, ''),
|
569 | this.GeotaggingString_PostalCodes.replace(whiteSpaceRegex, ''),
|
570 | this.GeotaggingString_ZipCode.replace(whiteSpaceRegex, ''),
|
571 | this.GeotaggingString_ZipCodes.replace(whiteSpaceRegex, '')
|
572 | ]);
|
573 | }
|
574 | return result;
|
575 | };
|
576 | GeoTaggingAnalyzerService.prototype.isLongitude = function (fieldRefName) {
|
577 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [this.GeotaggingString_Longitude])
|
578 | || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [this.GeotaggingString_Longitude_Short], true );
|
579 | };
|
580 | GeoTaggingAnalyzerService.prototype.isLatitude = function (fieldRefName) {
|
581 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [this.GeotaggingString_Latitude])
|
582 | || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [this.GeotaggingString_Latitude_Short], true );
|
583 | };
|
584 | GeoTaggingAnalyzerService.prototype.isTerritory = function (fieldRefName) {
|
585 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
586 | this.GeotaggingString_Territory,
|
587 | this.GeotaggingString_Territories
|
588 | ]);
|
589 | };
|
590 | GeoTaggingAnalyzerService.hasMatches = function (fieldName, possibleMatches, useStrict) {
|
591 | var nonWordRegex = /\W/;
|
592 | var value = fieldName.toLowerCase();
|
593 | for (var i = 0, len = possibleMatches.length; i < len; i++) {
|
594 | var possibleMatch = possibleMatches[i].toLowerCase();
|
595 | if (!useStrict) {
|
596 | if (value.indexOf(possibleMatch) > -1)
|
597 | return true;
|
598 | }
|
599 | else {
|
600 | var indexofpossibleMatch = value.indexOf(possibleMatch);
|
601 | if (indexofpossibleMatch > -1) {
|
602 | var wordEndFlag = void 0, wordBeginFlag = void 0;
|
603 | wordEndFlag = wordBeginFlag = true;
|
604 | if (indexofpossibleMatch - 1 > 0)
|
605 | wordBeginFlag = nonWordRegex.test(value[indexofpossibleMatch - 1]);
|
606 | if (indexofpossibleMatch + possibleMatch.length < value.length)
|
607 | wordEndFlag = nonWordRegex.test(value[indexofpossibleMatch + possibleMatch.length]);
|
608 | if (wordBeginFlag && wordEndFlag)
|
609 | return true;
|
610 | }
|
611 | }
|
612 | }
|
613 | return false;
|
614 | };
|
615 | GeoTaggingAnalyzerService.prototype.getFieldType = function (fieldName) {
|
616 | if (fieldName == null)
|
617 | return undefined;
|
618 | if (this.isLatitude(fieldName))
|
619 | return powerbi.CategoryTypes.Latitude;
|
620 | if (this.isLongitude(fieldName))
|
621 | return powerbi.CategoryTypes.Longitude;
|
622 | if (this.isPostalCode(fieldName))
|
623 | return powerbi.CategoryTypes.PostalCode;
|
624 | if (this.isAddress(fieldName))
|
625 | return powerbi.CategoryTypes.Address;
|
626 | if (this.isPlace(fieldName))
|
627 | return powerbi.CategoryTypes.Place;
|
628 | if (this.isCity(fieldName))
|
629 | return powerbi.CategoryTypes.City;
|
630 | if (this.isCountry(fieldName))
|
631 | return powerbi.CategoryTypes.CountryRegion;
|
632 | if (this.isCounty(fieldName))
|
633 | return powerbi.CategoryTypes.County;
|
634 | if (this.isStateOrProvince(fieldName))
|
635 | return powerbi.CategoryTypes.StateOrProvince;
|
636 | if (this.isContinent(fieldName))
|
637 | return powerbi.CategoryTypes.Continent;
|
638 | return this.getEnglishFieldType(fieldName);
|
639 | };
|
640 | GeoTaggingAnalyzerService.prototype.isEnglishAddress = function (fieldRefName) {
|
641 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
642 | EnglishBackup.GeotaggingString_Address,
|
643 | EnglishBackup.GeotaggingString_Addresses,
|
644 | EnglishBackup.GeotaggingString_Street,
|
645 | EnglishBackup.GeotaggingString_Streets
|
646 | ]);
|
647 | };
|
648 | GeoTaggingAnalyzerService.prototype.isEnglishPlace = function (fieldRefName) {
|
649 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
650 | EnglishBackup.GeotaggingString_Place,
|
651 | EnglishBackup.GeotaggingString_Places
|
652 | ]);
|
653 | };
|
654 | GeoTaggingAnalyzerService.prototype.isEnglishCity = function (fieldRefName) {
|
655 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
656 | EnglishBackup.GeotaggingString_City,
|
657 | EnglishBackup.GeotaggingString_Cities,
|
658 | EnglishBackup.GeotaggingString_Town,
|
659 | EnglishBackup.GeotaggingString_Towns,
|
660 | EnglishBackup.GeotaggingString_Village,
|
661 | EnglishBackup.GeotaggingString_Villages
|
662 | ]);
|
663 | };
|
664 | GeoTaggingAnalyzerService.prototype.isEnglishStateOrProvince = function (fieldRefName) {
|
665 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
666 | EnglishBackup.GeotaggingString_State,
|
667 | EnglishBackup.GeotaggingString_States,
|
668 | EnglishBackup.GeotaggingString_Province,
|
669 | EnglishBackup.GeotaggingString_Provinces,
|
670 | EnglishBackup.GeotaggingString_VRMBackCompat_StateOrProvince,
|
671 | ]);
|
672 | };
|
673 | GeoTaggingAnalyzerService.prototype.isEnglishCountry = function (fieldRefName) {
|
674 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
675 | EnglishBackup.GeotaggingString_Country,
|
676 | EnglishBackup.GeotaggingString_Countries,
|
677 | EnglishBackup.GeotaggingString_VRMBackCompat_CountryRegion
|
678 | ]);
|
679 | };
|
680 | GeoTaggingAnalyzerService.prototype.isEnglishCounty = function (fieldRefName) {
|
681 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
682 | EnglishBackup.GeotaggingString_County,
|
683 | EnglishBackup.GeotaggingString_Counties
|
684 | ]);
|
685 | };
|
686 | GeoTaggingAnalyzerService.prototype.isEnglishContinent = function (fieldRefName) {
|
687 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
688 | EnglishBackup.GeotaggingString_Continent,
|
689 | EnglishBackup.GeotaggingString_Continents
|
690 | ]);
|
691 | };
|
692 | GeoTaggingAnalyzerService.prototype.isEnglishPostalCode = function (fieldRefName) {
|
693 | var result = (GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
694 | EnglishBackup.GeotaggingString_Post,
|
695 | EnglishBackup.GeotaggingString_Zip])
|
696 | && GeoTaggingAnalyzerService.hasMatches(fieldRefName, [this.GeotaggingString_Code])) ||
|
697 | GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
698 | EnglishBackup.GeotaggingString_PostalCode,
|
699 | EnglishBackup.GeotaggingString_PostalCodes,
|
700 | EnglishBackup.GeotaggingString_ZipCode,
|
701 | EnglishBackup.GeotaggingString_ZipCodes
|
702 | ]);
|
703 |
|
704 | if (!result) {
|
705 | var whiteSpaceRegexPattern = new RegExp('\s');
|
706 | result = GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
707 | EnglishBackup.GeotaggingString_PostalCode.replace(whiteSpaceRegexPattern, ''),
|
708 | EnglishBackup.GeotaggingString_PostalCodes.replace(whiteSpaceRegexPattern, ''),
|
709 | EnglishBackup.GeotaggingString_ZipCode.replace(whiteSpaceRegexPattern, ''),
|
710 | EnglishBackup.GeotaggingString_ZipCodes.replace(whiteSpaceRegexPattern, '')
|
711 | ]);
|
712 | }
|
713 | return result;
|
714 | };
|
715 | GeoTaggingAnalyzerService.prototype.isEnglishLongitude = function (fieldRefName) {
|
716 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [EnglishBackup.GeotaggingString_Longitude])
|
717 | || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [EnglishBackup.GeotaggingString_Longitude_Short], true );
|
718 | };
|
719 | GeoTaggingAnalyzerService.prototype.isEnglishLatitude = function (fieldRefName) {
|
720 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [EnglishBackup.GeotaggingString_Latitude])
|
721 | || GeoTaggingAnalyzerService.hasMatches(fieldRefName, [EnglishBackup.GeotaggingString_Latitude_Short], true );
|
722 | };
|
723 | GeoTaggingAnalyzerService.prototype.isEnglishTerritory = function (fieldRefName) {
|
724 | return GeoTaggingAnalyzerService.hasMatches(fieldRefName, [
|
725 | EnglishBackup.GeotaggingString_Territory,
|
726 | EnglishBackup.GeotaggingString_Territories
|
727 | ]);
|
728 | };
|
729 | GeoTaggingAnalyzerService.prototype.getEnglishFieldType = function (fieldName) {
|
730 | if (fieldName == null)
|
731 | return undefined;
|
732 | if (this.isEnglishLatitude(fieldName))
|
733 | return powerbi.CategoryTypes.Latitude;
|
734 | if (this.isEnglishLongitude(fieldName))
|
735 | return powerbi.CategoryTypes.Longitude;
|
736 | if (this.isEnglishPostalCode(fieldName))
|
737 | return powerbi.CategoryTypes.PostalCode;
|
738 | if (this.isEnglishAddress(fieldName))
|
739 | return powerbi.CategoryTypes.Address;
|
740 | if (this.isEnglishPlace(fieldName))
|
741 | return powerbi.CategoryTypes.Place;
|
742 | if (this.isEnglishCity(fieldName))
|
743 | return powerbi.CategoryTypes.City;
|
744 | if (this.isEnglishCountry(fieldName))
|
745 | return powerbi.CategoryTypes.CountryRegion;
|
746 | if (this.isEnglishCounty(fieldName))
|
747 | return powerbi.CategoryTypes.County;
|
748 | if (this.isEnglishStateOrProvince(fieldName))
|
749 | return powerbi.CategoryTypes.StateOrProvince;
|
750 | if (this.isEnglishContinent(fieldName))
|
751 | return powerbi.CategoryTypes.Continent;
|
752 | return undefined;
|
753 | };
|
754 | return GeoTaggingAnalyzerService;
|
755 | }());
|
756 | powerbi.GeoTaggingAnalyzerService = GeoTaggingAnalyzerService;
|
757 | })(powerbi || (powerbi = {}));
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | if (typeof DEBUG === 'undefined')
|
784 | var DEBUG = true;
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 | var powerbi;
|
811 | (function (powerbi) {
|
812 | |
813 |
|
814 |
|
815 | var UnknownClientError = (function () {
|
816 | function UnknownClientError(code) {
|
817 | debug.assertValue(code, 'code');
|
818 | this.errorCode = code;
|
819 | }
|
820 | Object.defineProperty(UnknownClientError.prototype, "code", {
|
821 | get: function () {
|
822 | return this.errorCode;
|
823 | },
|
824 | enumerable: true,
|
825 | configurable: true
|
826 | });
|
827 | Object.defineProperty(UnknownClientError.prototype, "ignorable", {
|
828 | get: function () {
|
829 | return false;
|
830 | },
|
831 | enumerable: true,
|
832 | configurable: true
|
833 | });
|
834 | UnknownClientError.prototype.getDetails = function (resourceProvider) {
|
835 | var details = {
|
836 | message: resourceProvider.get('ClientError_UnknownClientErrorValue'),
|
837 | additionalErrorInfo: [{ errorInfoKey: resourceProvider.get('ClientError_UnknownClientErrorKey'), errorInfoValue: resourceProvider.get('ClientError_UnknownClientErrorValue'), }],
|
838 | };
|
839 | return details;
|
840 | };
|
841 | return UnknownClientError;
|
842 | }());
|
843 | powerbi.UnknownClientError = UnknownClientError;
|
844 | var HttpClientError = (function () {
|
845 | function HttpClientError(httpStatusCode, requestId) {
|
846 | debug.assertValue(httpStatusCode, 'httpStatusCode');
|
847 | debug.assertValue(requestId, 'requestId');
|
848 | this.httpStatusCode = httpStatusCode;
|
849 | this.httpRequestId = requestId;
|
850 | }
|
851 | Object.defineProperty(HttpClientError.prototype, "code", {
|
852 | get: function () {
|
853 | return 'HttpClientError';
|
854 | },
|
855 | enumerable: true,
|
856 | configurable: true
|
857 | });
|
858 | Object.defineProperty(HttpClientError.prototype, "ignorable", {
|
859 | get: function () {
|
860 | return false;
|
861 | },
|
862 | enumerable: true,
|
863 | configurable: true
|
864 | });
|
865 | Object.defineProperty(HttpClientError.prototype, "requestId", {
|
866 | get: function () {
|
867 | return this.httpRequestId;
|
868 | },
|
869 | enumerable: true,
|
870 | configurable: true
|
871 | });
|
872 | HttpClientError.prototype.getDetails = function (resourceProvider) {
|
873 |
|
874 | var details = {
|
875 | message: null,
|
876 | additionalErrorInfo: [
|
877 | { errorInfoKey: resourceProvider.get('DsrError_Key'), errorInfoValue: resourceProvider.get('DsrError_UnknownErrorValue') },
|
878 | { errorInfoKey: resourceProvider.get('ClientError_HttpResponseStatusCodeKey'), errorInfoValue: this.httpStatusCode.toString() }],
|
879 | };
|
880 | return details;
|
881 | };
|
882 | return HttpClientError;
|
883 | }());
|
884 | powerbi.HttpClientError = HttpClientError;
|
885 | var IgnorableClientError = (function () {
|
886 | function IgnorableClientError() {
|
887 | }
|
888 | Object.defineProperty(IgnorableClientError.prototype, "code", {
|
889 | get: function () {
|
890 | return 'IgnorableClientError';
|
891 | },
|
892 | enumerable: true,
|
893 | configurable: true
|
894 | });
|
895 | Object.defineProperty(IgnorableClientError.prototype, "ignorable", {
|
896 | get: function () {
|
897 | return true;
|
898 | },
|
899 | enumerable: true,
|
900 | configurable: true
|
901 | });
|
902 | IgnorableClientError.prototype.getDetails = function (resourceProvider) {
|
903 | var details = {
|
904 | message: '',
|
905 | additionalErrorInfo: [],
|
906 | };
|
907 | return details;
|
908 | };
|
909 | return IgnorableClientError;
|
910 | }());
|
911 | powerbi.IgnorableClientError = IgnorableClientError;
|
912 | })(powerbi || (powerbi = {}));
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 | var jsCommon;
|
939 | (function (jsCommon) {
|
940 | var ArrayExtensions;
|
941 | (function (ArrayExtensions) {
|
942 | |
943 |
|
944 |
|
945 | function intersect(target, other) {
|
946 | var result = [];
|
947 | for (var i = target.length - 1; i >= 0; --i) {
|
948 | if (other.indexOf(target[i]) !== -1) {
|
949 | result.push(target[i]);
|
950 | }
|
951 | }
|
952 | return result;
|
953 | }
|
954 | ArrayExtensions.intersect = intersect;
|
955 | |
956 |
|
957 |
|
958 | function diff(target, other) {
|
959 | var result = [];
|
960 | for (var i = target.length - 1; i >= 0; --i) {
|
961 | var value = target[i];
|
962 | if (other.indexOf(value) === -1) {
|
963 | result.push(value);
|
964 | }
|
965 | }
|
966 | return result;
|
967 | }
|
968 | ArrayExtensions.diff = diff;
|
969 | |
970 |
|
971 |
|
972 | function distinct(source) {
|
973 | var result = [];
|
974 | for (var i = 0, len = source.length; i < len; i++) {
|
975 | var value = source[i];
|
976 | if (result.indexOf(value) === -1) {
|
977 | result.push(value);
|
978 | }
|
979 | }
|
980 | return result;
|
981 | }
|
982 | ArrayExtensions.distinct = distinct;
|
983 | |
984 |
|
985 |
|
986 |
|
987 | function union(target, source) {
|
988 | for (var i = 0, len = source.length; i < len; ++i) {
|
989 | unionSingle(target, source[i]);
|
990 | }
|
991 | }
|
992 | ArrayExtensions.union = union;
|
993 | |
994 |
|
995 |
|
996 | function unionSingle(target, value) {
|
997 | if (target.indexOf(value) < 0) {
|
998 | target.push(value);
|
999 | }
|
1000 | }
|
1001 | ArrayExtensions.unionSingle = unionSingle;
|
1002 | |
1003 |
|
1004 |
|
1005 |
|
1006 | function range(source, startIndex, endIndex) {
|
1007 | debug.assert(startIndex >= 0 && startIndex < source.length, 'startIndex is out of range.');
|
1008 | debug.assert(endIndex >= 0 && endIndex < source.length, 'endIndex is out of range.');
|
1009 | var result = [];
|
1010 | for (var i = startIndex; i <= endIndex; ++i) {
|
1011 | result.push(source[i]);
|
1012 | }
|
1013 | return result;
|
1014 | }
|
1015 | ArrayExtensions.range = range;
|
1016 | |
1017 |
|
1018 |
|
1019 | function take(source, count) {
|
1020 | debug.assert(count >= 0, 'Count is negative.');
|
1021 | debug.assert(count <= source.length, 'Count is too large.');
|
1022 | var result = [];
|
1023 | for (var i = 0; i < count; ++i) {
|
1024 | result.push(source[i]);
|
1025 | }
|
1026 | return result;
|
1027 | }
|
1028 | ArrayExtensions.take = take;
|
1029 | function copy(source) {
|
1030 | debug.assertValue(source, 'source');
|
1031 | return take(source, source.length);
|
1032 | }
|
1033 | ArrayExtensions.copy = copy;
|
1034 | |
1035 |
|
1036 |
|
1037 | function sequenceEqual(left, right, comparison) {
|
1038 | debug.assertValue(comparison, 'comparison');
|
1039 | if (left === right) {
|
1040 | return true;
|
1041 | }
|
1042 | if (!!left !== !!right) {
|
1043 | return false;
|
1044 | }
|
1045 | var len = left.length;
|
1046 | if (len !== right.length) {
|
1047 | return false;
|
1048 | }
|
1049 | var i = 0;
|
1050 | while (i < len && comparison(left[i], right[i])) {
|
1051 | ++i;
|
1052 | }
|
1053 | return i === len;
|
1054 | }
|
1055 | ArrayExtensions.sequenceEqual = sequenceEqual;
|
1056 | |
1057 |
|
1058 |
|
1059 |
|
1060 | function emptyToNull(array) {
|
1061 | if (array && array.length === 0) {
|
1062 | return null;
|
1063 | }
|
1064 | return array;
|
1065 | }
|
1066 | ArrayExtensions.emptyToNull = emptyToNull;
|
1067 | function indexOf(array, predicate) {
|
1068 | debug.assertValue(array, 'array');
|
1069 | debug.assertValue(predicate, 'predicate');
|
1070 | for (var i = 0, len = array.length; i < len; ++i) {
|
1071 | if (predicate(array[i])) {
|
1072 | return i;
|
1073 | }
|
1074 | }
|
1075 | return -1;
|
1076 | }
|
1077 | ArrayExtensions.indexOf = indexOf;
|
1078 | |
1079 |
|
1080 |
|
1081 | function rotate(array, offset) {
|
1082 | if (offset === 0)
|
1083 | return array.slice();
|
1084 | var rotated = array.slice(offset);
|
1085 | Array.prototype.push.apply(rotated, array.slice(0, offset));
|
1086 | return rotated;
|
1087 | }
|
1088 | ArrayExtensions.rotate = rotate;
|
1089 | function createWithId() {
|
1090 | return extendWithId([]);
|
1091 | }
|
1092 | ArrayExtensions.createWithId = createWithId;
|
1093 | function extendWithId(array) {
|
1094 | debug.assertValue(array, 'array');
|
1095 | var extended = array;
|
1096 | extended.withId = withId;
|
1097 | return extended;
|
1098 | }
|
1099 | ArrayExtensions.extendWithId = extendWithId;
|
1100 | |
1101 |
|
1102 |
|
1103 | function findWithId(array, id) {
|
1104 | for (var i = 0, len = array.length; i < len; i++) {
|
1105 | var item = array[i];
|
1106 | if (item.id === id)
|
1107 | return item;
|
1108 | }
|
1109 | }
|
1110 | ArrayExtensions.findWithId = findWithId;
|
1111 | function withId(id) {
|
1112 | return ArrayExtensions.findWithId(this, id);
|
1113 | }
|
1114 | function createWithName() {
|
1115 | return extendWithName([]);
|
1116 | }
|
1117 | ArrayExtensions.createWithName = createWithName;
|
1118 | function extendWithName(array) {
|
1119 | debug.assertValue(array, 'array');
|
1120 | var extended = array;
|
1121 | extended.withName = withName;
|
1122 | return extended;
|
1123 | }
|
1124 | ArrayExtensions.extendWithName = extendWithName;
|
1125 | function findItemWithName(array, name) {
|
1126 | var index = indexWithName(array, name);
|
1127 | if (index >= 0)
|
1128 | return array[index];
|
1129 | }
|
1130 | ArrayExtensions.findItemWithName = findItemWithName;
|
1131 | function indexWithName(array, name) {
|
1132 | for (var i = 0, len = array.length; i < len; i++) {
|
1133 | var item = array[i];
|
1134 | if (item.name === name)
|
1135 | return i;
|
1136 | }
|
1137 | return -1;
|
1138 | }
|
1139 | ArrayExtensions.indexWithName = indexWithName;
|
1140 | |
1141 |
|
1142 |
|
1143 |
|
1144 | function insertSorted(list, value) {
|
1145 | debug.assertValue(list, 'list');
|
1146 | debug.assertValue(value, 'value');
|
1147 | var len = list.length;
|
1148 |
|
1149 | for (var i = len - 1; i >= 0; i--) {
|
1150 | var diff_1 = list[i] - value;
|
1151 | if (diff_1 === 0)
|
1152 | return false;
|
1153 | if (diff_1 > 0)
|
1154 | continue;
|
1155 |
|
1156 | list.splice(i + 1, 0, value);
|
1157 | return true;
|
1158 | }
|
1159 | list.unshift(value);
|
1160 | return true;
|
1161 | }
|
1162 | ArrayExtensions.insertSorted = insertSorted;
|
1163 | |
1164 |
|
1165 |
|
1166 |
|
1167 | function removeFirst(list, value) {
|
1168 | var index = list.indexOf(value);
|
1169 | if (index < 0)
|
1170 | return false;
|
1171 | list.splice(index, 1);
|
1172 | return true;
|
1173 | }
|
1174 | ArrayExtensions.removeFirst = removeFirst;
|
1175 | |
1176 |
|
1177 |
|
1178 | function withName(name) {
|
1179 | var array = this;
|
1180 | return findItemWithName(array, name);
|
1181 | }
|
1182 | |
1183 |
|
1184 |
|
1185 | function clear(array) {
|
1186 | if (!array)
|
1187 | return;
|
1188 | while (array.length > 0)
|
1189 | array.pop();
|
1190 | }
|
1191 | ArrayExtensions.clear = clear;
|
1192 | function isUndefinedOrEmpty(array) {
|
1193 | if (!array || array.length === 0) {
|
1194 | return true;
|
1195 | }
|
1196 | return false;
|
1197 | }
|
1198 | ArrayExtensions.isUndefinedOrEmpty = isUndefinedOrEmpty;
|
1199 | function swap(array, firstIndex, secondIndex) {
|
1200 | var temp = array[firstIndex];
|
1201 | array[firstIndex] = array[secondIndex];
|
1202 | array[secondIndex] = temp;
|
1203 | }
|
1204 | ArrayExtensions.swap = swap;
|
1205 | function isInArray(array, lookupItem, compareCallback) {
|
1206 | return _.any(array, function (item) { return compareCallback(item, lookupItem); });
|
1207 | }
|
1208 | ArrayExtensions.isInArray = isInArray;
|
1209 |
|
1210 | function isArrayOrInheritedArray(obj) {
|
1211 | debug.assertValue(obj, 'obj');
|
1212 | var nextPrototype = obj;
|
1213 | while (nextPrototype != null) {
|
1214 | if (_.isArray(nextPrototype))
|
1215 | return true;
|
1216 | nextPrototype = Object.getPrototypeOf(nextPrototype);
|
1217 | }
|
1218 | return false;
|
1219 | }
|
1220 | ArrayExtensions.isArrayOrInheritedArray = isArrayOrInheritedArray;
|
1221 | })(ArrayExtensions = jsCommon.ArrayExtensions || (jsCommon.ArrayExtensions = {}));
|
1222 | })(jsCommon || (jsCommon = {}));
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 | var InJs;
|
1249 | (function (InJs) {
|
1250 | var DomFactory;
|
1251 | (function (DomFactory) {
|
1252 | function div() {
|
1253 | return $('<div/>');
|
1254 | }
|
1255 | DomFactory.div = div;
|
1256 | function span() {
|
1257 | return $('<span/>');
|
1258 | }
|
1259 | DomFactory.span = span;
|
1260 | function checkbox() {
|
1261 | return $('<input type="checkbox"/>');
|
1262 | }
|
1263 | DomFactory.checkbox = checkbox;
|
1264 | function ul() {
|
1265 | return $('<ul/>');
|
1266 | }
|
1267 | DomFactory.ul = ul;
|
1268 | function li() {
|
1269 | return $('<li/>');
|
1270 | }
|
1271 | DomFactory.li = li;
|
1272 | function button() {
|
1273 | return $('<input type="button"/>');
|
1274 | }
|
1275 | DomFactory.button = button;
|
1276 | function select() {
|
1277 | return $('<select/>');
|
1278 | }
|
1279 | DomFactory.select = select;
|
1280 | function textBox() {
|
1281 | return $('<input type="text"/>');
|
1282 | }
|
1283 | DomFactory.textBox = textBox;
|
1284 | function img() {
|
1285 | return $('<img/>');
|
1286 | }
|
1287 | DomFactory.img = img;
|
1288 | function iframe() {
|
1289 | return $('<iframe/>');
|
1290 | }
|
1291 | DomFactory.iframe = iframe;
|
1292 | })(DomFactory = InJs.DomFactory || (InJs.DomFactory = {}));
|
1293 | })(InJs || (InJs = {}));
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 | var powerbi;
|
1320 | (function (powerbi) {
|
1321 | |
1322 |
|
1323 |
|
1324 |
|
1325 | var Double;
|
1326 | (function (Double) {
|
1327 |
|
1328 | Double.MIN_VALUE = -Number.MAX_VALUE;
|
1329 | Double.MAX_VALUE = Number.MAX_VALUE;
|
1330 | Double.MIN_EXP = -308;
|
1331 | Double.MAX_EXP = 308;
|
1332 | Double.EPSILON = 1E-323;
|
1333 | Double.DEFAULT_PRECISION = 0.0001;
|
1334 | Double.DEFAULT_PRECISION_IN_DECIMAL_DIGITS = 12;
|
1335 | Double.LOG_E_10 = Math.log(10);
|
1336 | Double.POSITIVE_POWERS = [
|
1337 | 1E0, 1E1, 1E2, 1E3, 1E4, 1E5, 1E6, 1E7, 1E8, 1E9, 1E10, 1E11, 1E12, 1E13, 1E14, 1E15, 1E16, 1E17, 1E18, 1E19, 1E20, 1E21, 1E22, 1E23, 1E24, 1E25, 1E26, 1E27, 1E28, 1E29, 1E30, 1E31, 1E32, 1E33, 1E34, 1E35, 1E36, 1E37, 1E38, 1E39, 1E40, 1E41, 1E42, 1E43, 1E44, 1E45, 1E46, 1E47, 1E48, 1E49, 1E50, 1E51, 1E52, 1E53, 1E54, 1E55, 1E56, 1E57, 1E58, 1E59, 1E60, 1E61, 1E62, 1E63, 1E64, 1E65, 1E66, 1E67, 1E68, 1E69, 1E70, 1E71, 1E72, 1E73, 1E74, 1E75, 1E76, 1E77, 1E78, 1E79, 1E80, 1E81, 1E82, 1E83, 1E84, 1E85, 1E86, 1E87, 1E88, 1E89, 1E90, 1E91, 1E92, 1E93, 1E94, 1E95, 1E96, 1E97, 1E98, 1E99,
|
1338 | 1E100, 1E101, 1E102, 1E103, 1E104, 1E105, 1E106, 1E107, 1E108, 1E109, 1E110, 1E111, 1E112, 1E113, 1E114, 1E115, 1E116, 1E117, 1E118, 1E119, 1E120, 1E121, 1E122, 1E123, 1E124, 1E125, 1E126, 1E127, 1E128, 1E129, 1E130, 1E131, 1E132, 1E133, 1E134, 1E135, 1E136, 1E137, 1E138, 1E139, 1E140, 1E141, 1E142, 1E143, 1E144, 1E145, 1E146, 1E147, 1E148, 1E149, 1E150, 1E151, 1E152, 1E153, 1E154, 1E155, 1E156, 1E157, 1E158, 1E159, 1E160, 1E161, 1E162, 1E163, 1E164, 1E165, 1E166, 1E167, 1E168, 1E169, 1E170, 1E171, 1E172, 1E173, 1E174, 1E175, 1E176, 1E177, 1E178, 1E179, 1E180, 1E181, 1E182, 1E183, 1E184, 1E185, 1E186, 1E187, 1E188, 1E189, 1E190, 1E191, 1E192, 1E193, 1E194, 1E195, 1E196, 1E197, 1E198, 1E199,
|
1339 | 1E200, 1E201, 1E202, 1E203, 1E204, 1E205, 1E206, 1E207, 1E208, 1E209, 1E210, 1E211, 1E212, 1E213, 1E214, 1E215, 1E216, 1E217, 1E218, 1E219, 1E220, 1E221, 1E222, 1E223, 1E224, 1E225, 1E226, 1E227, 1E228, 1E229, 1E230, 1E231, 1E232, 1E233, 1E234, 1E235, 1E236, 1E237, 1E238, 1E239, 1E240, 1E241, 1E242, 1E243, 1E244, 1E245, 1E246, 1E247, 1E248, 1E249, 1E250, 1E251, 1E252, 1E253, 1E254, 1E255, 1E256, 1E257, 1E258, 1E259, 1E260, 1E261, 1E262, 1E263, 1E264, 1E265, 1E266, 1E267, 1E268, 1E269, 1E270, 1E271, 1E272, 1E273, 1E274, 1E275, 1E276, 1E277, 1E278, 1E279, 1E280, 1E281, 1E282, 1E283, 1E284, 1E285, 1E286, 1E287, 1E288, 1E289, 1E290, 1E291, 1E292, 1E293, 1E294, 1E295, 1E296, 1E297, 1E298, 1E299,
|
1340 | 1E300, 1E301, 1E302, 1E303, 1E304, 1E305, 1E306, 1E307, 1E308];
|
1341 | Double.NEGATIVE_POWERS = [
|
1342 | 1E0, 1E-1, 1E-2, 1E-3, 1E-4, 1E-5, 1E-6, 1E-7, 1E-8, 1E-9, 1E-10, 1E-11, 1E-12, 1E-13, 1E-14, 1E-15, 1E-16, 1E-17, 1E-18, 1E-19, 1E-20, 1E-21, 1E-22, 1E-23, 1E-24, 1E-25, 1E-26, 1E-27, 1E-28, 1E-29, 1E-30, 1E-31, 1E-32, 1E-33, 1E-34, 1E-35, 1E-36, 1E-37, 1E-38, 1E-39, 1E-40, 1E-41, 1E-42, 1E-43, 1E-44, 1E-45, 1E-46, 1E-47, 1E-48, 1E-49, 1E-50, 1E-51, 1E-52, 1E-53, 1E-54, 1E-55, 1E-56, 1E-57, 1E-58, 1E-59, 1E-60, 1E-61, 1E-62, 1E-63, 1E-64, 1E-65, 1E-66, 1E-67, 1E-68, 1E-69, 1E-70, 1E-71, 1E-72, 1E-73, 1E-74, 1E-75, 1E-76, 1E-77, 1E-78, 1E-79, 1E-80, 1E-81, 1E-82, 1E-83, 1E-84, 1E-85, 1E-86, 1E-87, 1E-88, 1E-89, 1E-90, 1E-91, 1E-92, 1E-93, 1E-94, 1E-95, 1E-96, 1E-97, 1E-98, 1E-99,
|
1343 | 1E-100, 1E-101, 1E-102, 1E-103, 1E-104, 1E-105, 1E-106, 1E-107, 1E-108, 1E-109, 1E-110, 1E-111, 1E-112, 1E-113, 1E-114, 1E-115, 1E-116, 1E-117, 1E-118, 1E-119, 1E-120, 1E-121, 1E-122, 1E-123, 1E-124, 1E-125, 1E-126, 1E-127, 1E-128, 1E-129, 1E-130, 1E-131, 1E-132, 1E-133, 1E-134, 1E-135, 1E-136, 1E-137, 1E-138, 1E-139, 1E-140, 1E-141, 1E-142, 1E-143, 1E-144, 1E-145, 1E-146, 1E-147, 1E-148, 1E-149, 1E-150, 1E-151, 1E-152, 1E-153, 1E-154, 1E-155, 1E-156, 1E-157, 1E-158, 1E-159, 1E-160, 1E-161, 1E-162, 1E-163, 1E-164, 1E-165, 1E-166, 1E-167, 1E-168, 1E-169, 1E-170, 1E-171, 1E-172, 1E-173, 1E-174, 1E-175, 1E-176, 1E-177, 1E-178, 1E-179, 1E-180, 1E-181, 1E-182, 1E-183, 1E-184, 1E-185, 1E-186, 1E-187, 1E-188, 1E-189, 1E-190, 1E-191, 1E-192, 1E-193, 1E-194, 1E-195, 1E-196, 1E-197, 1E-198, 1E-199,
|
1344 | 1E-200, 1E-201, 1E-202, 1E-203, 1E-204, 1E-205, 1E-206, 1E-207, 1E-208, 1E-209, 1E-210, 1E-211, 1E-212, 1E-213, 1E-214, 1E-215, 1E-216, 1E-217, 1E-218, 1E-219, 1E-220, 1E-221, 1E-222, 1E-223, 1E-224, 1E-225, 1E-226, 1E-227, 1E-228, 1E-229, 1E-230, 1E-231, 1E-232, 1E-233, 1E-234, 1E-235, 1E-236, 1E-237, 1E-238, 1E-239, 1E-240, 1E-241, 1E-242, 1E-243, 1E-244, 1E-245, 1E-246, 1E-247, 1E-248, 1E-249, 1E-250, 1E-251, 1E-252, 1E-253, 1E-254, 1E-255, 1E-256, 1E-257, 1E-258, 1E-259, 1E-260, 1E-261, 1E-262, 1E-263, 1E-264, 1E-265, 1E-266, 1E-267, 1E-268, 1E-269, 1E-270, 1E-271, 1E-272, 1E-273, 1E-274, 1E-275, 1E-276, 1E-277, 1E-278, 1E-279, 1E-280, 1E-281, 1E-282, 1E-283, 1E-284, 1E-285, 1E-286, 1E-287, 1E-288, 1E-289, 1E-290, 1E-291, 1E-292, 1E-293, 1E-294, 1E-295, 1E-296, 1E-297, 1E-298, 1E-299,
|
1345 | 1E-300, 1E-301, 1E-302, 1E-303, 1E-304, 1E-305, 1E-306, 1E-307, 1E-308, 1E-309, 1E-310, 1E-311, 1E-312, 1E-313, 1E-314, 1E-315, 1E-316, 1E-317, 1E-318, 1E-319, 1E-320, 1E-321, 1E-322, 1E-323, 1E-324];
|
1346 | |
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 | function pow10(exp) {
|
1352 | debug.assertValue(exp, "exp");
|
1353 |
|
1354 | if (exp >= 0) {
|
1355 | if (exp < Double.POSITIVE_POWERS.length) {
|
1356 | return Double.POSITIVE_POWERS[exp];
|
1357 | }
|
1358 | else {
|
1359 | return Infinity;
|
1360 | }
|
1361 | }
|
1362 |
|
1363 | exp = -exp;
|
1364 | if (exp > 0 && exp < Double.NEGATIVE_POWERS.length) {
|
1365 | return Double.NEGATIVE_POWERS[exp];
|
1366 | }
|
1367 | else {
|
1368 | return 0;
|
1369 | }
|
1370 | }
|
1371 | Double.pow10 = pow10;
|
1372 | |
1373 |
|
1374 |
|
1375 |
|
1376 |
|
1377 | function log10(val) {
|
1378 | debug.assert(val >= 0, "val");
|
1379 |
|
1380 | if (val > 1 && val < 1E16) {
|
1381 | if (val < 1E8) {
|
1382 | if (val < 1E4) {
|
1383 | if (val < 1E2) {
|
1384 | if (val < 1E1) {
|
1385 | return 0;
|
1386 | }
|
1387 | else {
|
1388 | return 1;
|
1389 | }
|
1390 | }
|
1391 | else {
|
1392 | if (val < 1E3) {
|
1393 | return 2;
|
1394 | }
|
1395 | else {
|
1396 | return 3;
|
1397 | }
|
1398 | }
|
1399 | }
|
1400 | else {
|
1401 | if (val < 1E6) {
|
1402 | if (val < 1E5) {
|
1403 | return 4;
|
1404 | }
|
1405 | else {
|
1406 | return 5;
|
1407 | }
|
1408 | }
|
1409 | else {
|
1410 | if (val < 1E7) {
|
1411 | return 6;
|
1412 | }
|
1413 | else {
|
1414 | return 7;
|
1415 | }
|
1416 | }
|
1417 | }
|
1418 | }
|
1419 | else {
|
1420 | if (val < 1E12) {
|
1421 | if (val < 1E10) {
|
1422 | if (val < 1E9) {
|
1423 | return 8;
|
1424 | }
|
1425 | else {
|
1426 | return 9;
|
1427 | }
|
1428 | }
|
1429 | else {
|
1430 | if (val < 1E11) {
|
1431 | return 10;
|
1432 | }
|
1433 | else {
|
1434 | return 11;
|
1435 | }
|
1436 | }
|
1437 | }
|
1438 | else {
|
1439 | if (val < 1E14) {
|
1440 | if (val < 1E13) {
|
1441 | return 12;
|
1442 | }
|
1443 | else {
|
1444 | return 13;
|
1445 | }
|
1446 | }
|
1447 | else {
|
1448 | if (val < 1E15) {
|
1449 | return 14;
|
1450 | }
|
1451 | else {
|
1452 | return 15;
|
1453 | }
|
1454 | }
|
1455 | }
|
1456 | }
|
1457 | }
|
1458 | if (val > 1E-16 && val < 1) {
|
1459 | if (val < 1E-8) {
|
1460 | if (val < 1E-12) {
|
1461 | if (val < 1E-14) {
|
1462 | if (val < 1E-15) {
|
1463 | return -16;
|
1464 | }
|
1465 | else {
|
1466 | return -15;
|
1467 | }
|
1468 | }
|
1469 | else {
|
1470 | if (val < 1E-13) {
|
1471 | return -14;
|
1472 | }
|
1473 | else {
|
1474 | return -13;
|
1475 | }
|
1476 | }
|
1477 | }
|
1478 | else {
|
1479 | if (val < 1E-10) {
|
1480 | if (val < 1E-11) {
|
1481 | return -12;
|
1482 | }
|
1483 | else {
|
1484 | return -11;
|
1485 | }
|
1486 | }
|
1487 | else {
|
1488 | if (val < 1E-9) {
|
1489 | return -10;
|
1490 | }
|
1491 | else {
|
1492 | return -9;
|
1493 | }
|
1494 | }
|
1495 | }
|
1496 | }
|
1497 | else {
|
1498 | if (val < 1E-4) {
|
1499 | if (val < 1E-6) {
|
1500 | if (val < 1E-7) {
|
1501 | return -8;
|
1502 | }
|
1503 | else {
|
1504 | return -7;
|
1505 | }
|
1506 | }
|
1507 | else {
|
1508 | if (val < 1E-5) {
|
1509 | return -6;
|
1510 | }
|
1511 | else {
|
1512 | return -5;
|
1513 | }
|
1514 | }
|
1515 | }
|
1516 | else {
|
1517 | if (val < 1E-2) {
|
1518 | if (val < 1E-3) {
|
1519 | return -4;
|
1520 | }
|
1521 | else {
|
1522 | return -3;
|
1523 | }
|
1524 | }
|
1525 | else {
|
1526 | if (val < 1E-1) {
|
1527 | return -2;
|
1528 | }
|
1529 | else {
|
1530 | return -1;
|
1531 | }
|
1532 | }
|
1533 | }
|
1534 | }
|
1535 | }
|
1536 |
|
1537 |
|
1538 | var log10 = Math.log(val) / Double.LOG_E_10;
|
1539 | return Double.floorWithPrecision(log10);
|
1540 | }
|
1541 | Double.log10 = log10;
|
1542 | |
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 | function getPrecision(x, decimalDigits) {
|
1549 | if (decimalDigits === undefined) {
|
1550 | decimalDigits = Double.DEFAULT_PRECISION_IN_DECIMAL_DIGITS;
|
1551 | }
|
1552 | else {
|
1553 | debug.assert(decimalDigits >= 0, "decimalDigits");
|
1554 | }
|
1555 | if (!x) {
|
1556 | return undefined;
|
1557 | }
|
1558 | var exp = Double.log10(Math.abs(x));
|
1559 | if (exp < Double.MIN_EXP) {
|
1560 | return 0;
|
1561 | }
|
1562 | var precisionExp = Math.max(exp - decimalDigits, -Double.NEGATIVE_POWERS.length + 1);
|
1563 | return Double.pow10(precisionExp);
|
1564 | }
|
1565 | Double.getPrecision = getPrecision;
|
1566 | |
1567 |
|
1568 |
|
1569 |
|
1570 |
|
1571 |
|
1572 | function equalWithPrecision(x, y, precision) {
|
1573 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1574 | debug.assert(precision >= 0, "precision");
|
1575 | return x === y || Math.abs(x - y) < precision;
|
1576 | }
|
1577 | Double.equalWithPrecision = equalWithPrecision;
|
1578 | |
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 | function lessWithPrecision(x, y, precision) {
|
1586 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1587 | debug.assert(precision >= 0, "precision");
|
1588 | return x < y && Math.abs(x - y) > precision;
|
1589 | }
|
1590 | Double.lessWithPrecision = lessWithPrecision;
|
1591 | |
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 | function lessOrEqualWithPrecision(x, y, precision) {
|
1599 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1600 | debug.assert(precision >= 0, "precision");
|
1601 | return x < y || Math.abs(x - y) < precision;
|
1602 | }
|
1603 | Double.lessOrEqualWithPrecision = lessOrEqualWithPrecision;
|
1604 | |
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 | function greaterWithPrecision(x, y, precision) {
|
1612 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1613 | debug.assert(precision >= 0, "precision");
|
1614 | return x > y && Math.abs(x - y) > precision;
|
1615 | }
|
1616 | Double.greaterWithPrecision = greaterWithPrecision;
|
1617 | |
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 | function greaterOrEqualWithPrecision(x, y, precision) {
|
1625 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1626 | debug.assert(precision >= 0, "precision");
|
1627 | return x > y || Math.abs(x - y) < precision;
|
1628 | }
|
1629 | Double.greaterOrEqualWithPrecision = greaterOrEqualWithPrecision;
|
1630 | |
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 | function floorWithPrecision(x, precision) {
|
1636 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1637 | debug.assert(precision >= 0, "precision");
|
1638 | var roundX = Math.round(x);
|
1639 | if (Math.abs(x - roundX) < precision) {
|
1640 | return roundX;
|
1641 | }
|
1642 | else {
|
1643 | return Math.floor(x);
|
1644 | }
|
1645 | }
|
1646 | Double.floorWithPrecision = floorWithPrecision;
|
1647 | |
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 | function ceilWithPrecision(x, precision) {
|
1653 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1654 | debug.assert(precision >= 0, "precision");
|
1655 | var roundX = Math.round(x);
|
1656 | if (Math.abs(x - roundX) < precision) {
|
1657 | return roundX;
|
1658 | }
|
1659 | else {
|
1660 | return Math.ceil(x);
|
1661 | }
|
1662 | }
|
1663 | Double.ceilWithPrecision = ceilWithPrecision;
|
1664 | |
1665 |
|
1666 |
|
1667 |
|
1668 |
|
1669 |
|
1670 | function floorToPrecision(x, precision) {
|
1671 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1672 | debug.assert(precision >= 0, "precision");
|
1673 | if (precision === 0 || x === 0) {
|
1674 | return x;
|
1675 | }
|
1676 |
|
1677 | return Math.floor(x / precision) * precision;
|
1678 | }
|
1679 | Double.floorToPrecision = floorToPrecision;
|
1680 | |
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 | function ceilToPrecision(x, precision) {
|
1687 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1688 | debug.assert(precision >= 0, "precision");
|
1689 | if (precision === 0 || x === 0) {
|
1690 | return x;
|
1691 | }
|
1692 |
|
1693 | return Math.ceil(x / precision) * precision;
|
1694 | }
|
1695 | Double.ceilToPrecision = ceilToPrecision;
|
1696 | |
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 | function roundToPrecision(x, precision) {
|
1703 | precision = applyDefault(precision, Double.DEFAULT_PRECISION);
|
1704 | debug.assert(precision >= 0, "precision");
|
1705 | if (precision === 0 || x === 0) {
|
1706 | return x;
|
1707 | }
|
1708 |
|
1709 | var result = Math.round(x / precision) * precision;
|
1710 | var decimalDigits = Math.round(Double.log10(Math.abs(x)) - Double.log10(precision)) + 1;
|
1711 | if (decimalDigits > 0 && decimalDigits < 16) {
|
1712 | result = parseFloat(result.toPrecision(decimalDigits));
|
1713 | }
|
1714 | return result;
|
1715 | }
|
1716 | Double.roundToPrecision = roundToPrecision;
|
1717 | |
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 | function ensureInRange(x, min, max) {
|
1724 | debug.assert(min <= max, "min must be less or equal to max");
|
1725 | if (x === undefined || x === null) {
|
1726 | return x;
|
1727 | }
|
1728 | if (x < min) {
|
1729 | return min;
|
1730 | }
|
1731 | if (x > max) {
|
1732 | return max;
|
1733 | }
|
1734 | return x;
|
1735 | }
|
1736 | Double.ensureInRange = ensureInRange;
|
1737 | |
1738 |
|
1739 |
|
1740 |
|
1741 | function round(x) {
|
1742 | debug.assert(x >= 0, "x must be greater or equal to 0");
|
1743 | return (0.5 + x) << 0;
|
1744 | }
|
1745 | Double.round = round;
|
1746 | |
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 |
|
1753 | function project(value, fromMin, fromSize, toMin, toSize) {
|
1754 | if (fromSize === 0 || toSize === 0) {
|
1755 | if (fromMin <= value && value <= fromMin + fromSize) {
|
1756 | return toMin;
|
1757 | }
|
1758 | else {
|
1759 | return NaN;
|
1760 | }
|
1761 | }
|
1762 | var relativeX = (value - fromMin) / fromSize;
|
1763 | var projectedX = toMin + relativeX * toSize;
|
1764 | return projectedX;
|
1765 | }
|
1766 | Double.project = project;
|
1767 | |
1768 |
|
1769 |
|
1770 |
|
1771 | function removeDecimalNoise(value) {
|
1772 | return roundToPrecision(value, getPrecision(value));
|
1773 | }
|
1774 | Double.removeDecimalNoise = removeDecimalNoise;
|
1775 | |
1776 |
|
1777 |
|
1778 |
|
1779 | function isInteger(value) {
|
1780 | return value !== null && value % 1 === 0;
|
1781 | }
|
1782 | Double.isInteger = isInteger;
|
1783 | |
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 | function toIncrement(value, increment) {
|
1792 | return Math.round(value / increment) * increment;
|
1793 | }
|
1794 | Double.toIncrement = toIncrement;
|
1795 | })(Double = powerbi.Double || (powerbi.Double = {}));
|
1796 | function applyDefault(value, defaultValue) {
|
1797 | return value !== undefined ? value : defaultValue;
|
1798 | }
|
1799 | })(powerbi || (powerbi = {}));
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 | var jsCommon;
|
1826 | (function (jsCommon) {
|
1827 | var Double = powerbi.Double;
|
1828 | var Color;
|
1829 | (function (Color) {
|
1830 | function rotate(rgbString, rotateFactor) {
|
1831 | if (rotateFactor === 0)
|
1832 | return rgbString;
|
1833 | var originalRgb = parseColorString(rgbString);
|
1834 | var originalHsv = rgbToHsv(originalRgb);
|
1835 | var rotatedHsv = rotateHsv(originalHsv, rotateFactor);
|
1836 | var rotatedRgb = hsvToRgb(rotatedHsv);
|
1837 | return hexString(rotatedRgb);
|
1838 | }
|
1839 | Color.rotate = rotate;
|
1840 | function normalizeToHexString(color) {
|
1841 | var rgb = parseColorString(color);
|
1842 | return hexString(rgb);
|
1843 | }
|
1844 | Color.normalizeToHexString = normalizeToHexString;
|
1845 | function parseColorString(color) {
|
1846 | debug.assertValue(color, 'color');
|
1847 | if (color.indexOf('#') >= 0) {
|
1848 | if (color.length === 7) {
|
1849 |
|
1850 | var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
|
1851 | if (result == null || result.length < 4)
|
1852 | return;
|
1853 | return {
|
1854 | R: parseInt(result[1], 16),
|
1855 | G: parseInt(result[2], 16),
|
1856 | B: parseInt(result[3], 16),
|
1857 | };
|
1858 | }
|
1859 | else if (color.length === 4) {
|
1860 |
|
1861 | var result = /^#?([a-f\d])([a-f\d])([a-f\d])$/i.exec(color);
|
1862 | if (result == null || result.length < 4)
|
1863 | return;
|
1864 | return {
|
1865 | R: parseInt(result[1] + result[1], 16),
|
1866 | G: parseInt(result[2] + result[2], 16),
|
1867 | B: parseInt(result[3] + result[3], 16),
|
1868 | };
|
1869 | }
|
1870 | }
|
1871 | else if (color.indexOf('rgb(') >= 0) {
|
1872 |
|
1873 | var result = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/.exec(color);
|
1874 | if (result == null || result.length < 4)
|
1875 | return;
|
1876 | return {
|
1877 | R: parseInt(result[1], 10),
|
1878 | G: parseInt(result[2], 10),
|
1879 | B: parseInt(result[3], 10),
|
1880 | };
|
1881 | }
|
1882 | else if (color.indexOf('rgba(') >= 0) {
|
1883 |
|
1884 | var result = /^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*(?:\.\d+)?)\)$/.exec(color);
|
1885 | if (result == null || result.length < 5)
|
1886 | return;
|
1887 | return {
|
1888 | R: parseInt(result[1], 10),
|
1889 | G: parseInt(result[2], 10),
|
1890 | B: parseInt(result[3], 10),
|
1891 | A: parseFloat(result[4]),
|
1892 | };
|
1893 | }
|
1894 | }
|
1895 | Color.parseColorString = parseColorString;
|
1896 | function rgbToHsv(rgbColor) {
|
1897 | var s, h;
|
1898 | var r = rgbColor.R / 255, g = rgbColor.G / 255, b = rgbColor.B / 255;
|
1899 | var min = Math.min(r, Math.min(g, b));
|
1900 | var max = Math.max(r, Math.max(g, b));
|
1901 | var v = max;
|
1902 | var delta = max - min;
|
1903 | if (max === 0 || delta === 0) {
|
1904 |
|
1905 |
|
1906 |
|
1907 | s = 0;
|
1908 | h = 0;
|
1909 | }
|
1910 | else {
|
1911 | s = delta / max;
|
1912 | if (r === max) {
|
1913 |
|
1914 | h = (g - b) / delta;
|
1915 | }
|
1916 | else if (g === max) {
|
1917 |
|
1918 | h = 2 + (b - r) / delta;
|
1919 | }
|
1920 | else {
|
1921 |
|
1922 | h = 4 + (r - g) / delta;
|
1923 | }
|
1924 | }
|
1925 |
|
1926 |
|
1927 |
|
1928 | h /= 6;
|
1929 | if (h < 0) {
|
1930 | h += 1;
|
1931 | }
|
1932 | return {
|
1933 | H: h,
|
1934 | S: s,
|
1935 | V: v,
|
1936 | };
|
1937 | }
|
1938 | function hsvToRgb(hsvColor) {
|
1939 | var r, g, b;
|
1940 | var h = hsvColor.H, s = hsvColor.S, v = hsvColor.V;
|
1941 | if (s === 0) {
|
1942 |
|
1943 |
|
1944 | r = v;
|
1945 | g = v;
|
1946 | b = v;
|
1947 | }
|
1948 | else {
|
1949 | var p = void 0, q = void 0, t = void 0, fractionalSector = void 0, sectorNumber = void 0, sectorPos = void 0;
|
1950 |
|
1951 |
|
1952 | sectorPos = h * 6;
|
1953 | sectorNumber = Math.floor(sectorPos);
|
1954 |
|
1955 |
|
1956 |
|
1957 | fractionalSector = sectorPos - sectorNumber;
|
1958 |
|
1959 |
|
1960 | p = v * (1.0 - s);
|
1961 | q = v * (1.0 - (s * fractionalSector));
|
1962 | t = v * (1.0 - (s * (1 - fractionalSector)));
|
1963 |
|
1964 |
|
1965 | switch (sectorNumber) {
|
1966 | case 0:
|
1967 | r = v;
|
1968 | g = t;
|
1969 | b = p;
|
1970 | break;
|
1971 | case 1:
|
1972 | r = q;
|
1973 | g = v;
|
1974 | b = p;
|
1975 | break;
|
1976 | case 2:
|
1977 | r = p;
|
1978 | g = v;
|
1979 | b = t;
|
1980 | break;
|
1981 | case 3:
|
1982 | r = p;
|
1983 | g = q;
|
1984 | b = v;
|
1985 | break;
|
1986 | case 4:
|
1987 | r = t;
|
1988 | g = p;
|
1989 | b = v;
|
1990 | break;
|
1991 | case 5:
|
1992 | r = v;
|
1993 | g = p;
|
1994 | b = q;
|
1995 | break;
|
1996 | }
|
1997 | }
|
1998 | return {
|
1999 | R: Math.floor(r * 255),
|
2000 | G: Math.floor(g * 255),
|
2001 | B: Math.floor(b * 255),
|
2002 | };
|
2003 | }
|
2004 | function rotateHsv(hsvColor, rotateFactor) {
|
2005 | var newH = hsvColor.H + rotateFactor;
|
2006 | return {
|
2007 | H: newH > 1 ? newH - 1 : newH,
|
2008 | S: hsvColor.S,
|
2009 | V: hsvColor.V,
|
2010 | };
|
2011 | }
|
2012 | function darken(color, diff) {
|
2013 | var flooredNumber = Math.floor(diff);
|
2014 | return {
|
2015 | R: Math.max(0, color.R - flooredNumber),
|
2016 | G: Math.max(0, color.G - flooredNumber),
|
2017 | B: Math.max(0, color.B - flooredNumber),
|
2018 | };
|
2019 | }
|
2020 | Color.darken = darken;
|
2021 | function rgbString(color) {
|
2022 | if (color.A == null)
|
2023 | return "rgb(" + color.R + "," + color.G + "," + color.B + ")";
|
2024 | return "rgba(" + color.R + "," + color.G + "," + color.B + "," + color.A + ")";
|
2025 | }
|
2026 | Color.rgbString = rgbString;
|
2027 | function hexString(color) {
|
2028 | return "#" + componentToHex(color.R) + componentToHex(color.G) + componentToHex(color.B);
|
2029 | }
|
2030 | Color.hexString = hexString;
|
2031 | function componentToHex(hexComponent) {
|
2032 | var clamped = Double.ensureInRange(hexComponent, 0, 255);
|
2033 | var hex = clamped.toString(16).toUpperCase();
|
2034 | return hex.length === 1 ? "0" + hex : hex;
|
2035 | }
|
2036 | })(Color = jsCommon.Color || (jsCommon.Color = {}));
|
2037 | })(jsCommon || (jsCommon = {}));
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 | var jsCommon;
|
2064 | (function (jsCommon) {
|
2065 | |
2066 |
|
2067 |
|
2068 | var CssConstants;
|
2069 | (function (CssConstants) {
|
2070 | function createClassAndSelector(className) {
|
2071 | return {
|
2072 | class: className,
|
2073 | selector: '.' + className,
|
2074 | };
|
2075 | }
|
2076 | CssConstants.createClassAndSelector = createClassAndSelector;
|
2077 | CssConstants.styleAttribute = 'style';
|
2078 | CssConstants.pixelUnits = 'px';
|
2079 | CssConstants.heightProperty = 'height';
|
2080 | CssConstants.widthProperty = 'width';
|
2081 | CssConstants.topProperty = 'top';
|
2082 | CssConstants.bottomProperty = 'bottom';
|
2083 | CssConstants.leftProperty = 'left';
|
2084 | CssConstants.rightProperty = 'right';
|
2085 | CssConstants.marginTopProperty = 'margin-top';
|
2086 | CssConstants.marginLeftProperty = 'margin-left';
|
2087 | CssConstants.displayProperty = 'display';
|
2088 | CssConstants.backgroundProperty = 'background';
|
2089 | CssConstants.backgroundColorProperty = 'background-color';
|
2090 | CssConstants.backgroundRepeatProperty = 'background-repeat';
|
2091 | CssConstants.backgroundSizeProperty = 'background-size';
|
2092 | CssConstants.backgroundImageProperty = 'background-image';
|
2093 | CssConstants.textShadowProperty = 'text-shadow';
|
2094 | CssConstants.textAlignProperty = 'text-align';
|
2095 | CssConstants.borderTopWidthProperty = 'border-top-width';
|
2096 | CssConstants.borderBottomWidthProperty = 'border-bottom-width';
|
2097 | CssConstants.borderLeftWidthProperty = 'border-left-width';
|
2098 | CssConstants.borderRightWidthProperty = 'border-right-width';
|
2099 | CssConstants.fontSizeProperty = 'font-size';
|
2100 | CssConstants.fontWeightProperty = 'font-weight';
|
2101 | CssConstants.colorProperty = 'color';
|
2102 | CssConstants.opacityProperty = 'opacity';
|
2103 | CssConstants.paddingLeftProperty = 'padding-left';
|
2104 | CssConstants.paddingRightProperty = 'padding-right';
|
2105 | CssConstants.positionProperty = 'position';
|
2106 | CssConstants.maxWidthProperty = 'max-width';
|
2107 | CssConstants.minWidthProperty = 'min-width';
|
2108 | CssConstants.overflowProperty = 'overflow';
|
2109 | CssConstants.overflowXProperty = 'overflow-x';
|
2110 | CssConstants.overflowYProperty = 'overflow-y';
|
2111 | CssConstants.transformProperty = 'transform';
|
2112 | CssConstants.webkitTransformProperty = '-webkit-transform';
|
2113 | CssConstants.cursorProperty = 'cursor';
|
2114 | CssConstants.visibilityProperty = 'visibility';
|
2115 | CssConstants.absoluteValue = 'absolute';
|
2116 | CssConstants.zeroPixelValue = '0px';
|
2117 | CssConstants.autoValue = 'auto';
|
2118 | CssConstants.hiddenValue = 'hidden';
|
2119 | CssConstants.noneValue = 'none';
|
2120 | CssConstants.blockValue = 'block';
|
2121 | CssConstants.inlineBlockValue = 'inline-block';
|
2122 | CssConstants.transparentValue = 'transparent';
|
2123 | CssConstants.boldValue = 'bold';
|
2124 | CssConstants.visibleValue = 'visible';
|
2125 | CssConstants.tableRowValue = 'table-row';
|
2126 | CssConstants.coverValue = 'cover';
|
2127 | CssConstants.pointerValue = 'pointer';
|
2128 | CssConstants.scrollValue = 'scroll';
|
2129 | })(CssConstants = jsCommon.CssConstants || (jsCommon.CssConstants = {}));
|
2130 | })(jsCommon || (jsCommon = {}));
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 | var debug;
|
2163 | (function (debug) {
|
2164 | |
2165 |
|
2166 |
|
2167 | function assert(condition, message) {
|
2168 | if (condition !== true) {
|
2169 | assertFail(message || ('condition: ' + condition));
|
2170 | }
|
2171 | }
|
2172 | debug.assert = assert;
|
2173 | |
2174 |
|
2175 |
|
2176 | function assertValue(value, message) {
|
2177 | if (value === null || value === undefined) {
|
2178 | assertFail(message || ('condition: ' + value));
|
2179 | }
|
2180 | }
|
2181 | debug.assertValue = assertValue;
|
2182 | |
2183 |
|
2184 |
|
2185 | function assertNonEmpty(value, message) {
|
2186 | if (!(value != null && value.length > 0)) {
|
2187 | assertFail(message || ('condition: ' + value));
|
2188 | }
|
2189 | }
|
2190 | debug.assertNonEmpty = assertNonEmpty;
|
2191 | |
2192 |
|
2193 |
|
2194 |
|
2195 | function assertAnyValue(value, message) {
|
2196 | }
|
2197 | debug.assertAnyValue = assertAnyValue;
|
2198 | function assertFail(message) {
|
2199 | (debug.assertFailFunction || alert)('Debug Assert failed: ' + message);
|
2200 | }
|
2201 | debug.assertFail = assertFail;
|
2202 | })(debug || (debug = {}));
|
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 |
|
2208 |
|
2209 |
|
2210 |
|
2211 |
|
2212 |
|
2213 |
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 |
|
2219 |
|
2220 |
|
2221 |
|
2222 |
|
2223 |
|
2224 |
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 | var jsCommon;
|
2230 | (function (jsCommon) {
|
2231 | var Errors;
|
2232 | (function (Errors) {
|
2233 | function infoNavAppAlreadyPresent() {
|
2234 | return {
|
2235 | name: 'infoNavAppAlreadyPresent',
|
2236 | message: 'Cannot initialize embedded scenario when the InfoNav App is already present in this context',
|
2237 | stack: getExceptionStackTrace()
|
2238 | };
|
2239 | }
|
2240 | Errors.infoNavAppAlreadyPresent = infoNavAppAlreadyPresent;
|
2241 | function invalidOperation(message) {
|
2242 | return {
|
2243 | name: 'invalidOperation',
|
2244 | message: message,
|
2245 | stack: getExceptionStackTrace()
|
2246 | };
|
2247 | }
|
2248 | Errors.invalidOperation = invalidOperation;
|
2249 | function argument(argumentName, message) {
|
2250 | return {
|
2251 | name: 'invalidArgumentError',
|
2252 | argument: argumentName,
|
2253 | message: message,
|
2254 | stack: getExceptionStackTrace()
|
2255 | };
|
2256 | }
|
2257 | Errors.argument = argument;
|
2258 | function argumentNull(argumentName) {
|
2259 | return {
|
2260 | name: 'argumentNull',
|
2261 | argument: argumentName,
|
2262 | message: 'Argument was null',
|
2263 | stack: getExceptionStackTrace()
|
2264 | };
|
2265 | }
|
2266 | Errors.argumentNull = argumentNull;
|
2267 | function argumentUndefined(argumentName) {
|
2268 | return {
|
2269 | name: 'argumentUndefined',
|
2270 | argument: argumentName,
|
2271 | message: 'Argument was undefined',
|
2272 | stack: getExceptionStackTrace()
|
2273 | };
|
2274 | }
|
2275 | Errors.argumentUndefined = argumentUndefined;
|
2276 | function argumentOutOfRange(argumentName) {
|
2277 | return {
|
2278 | name: 'argumentOutOfRange',
|
2279 | argument: argumentName,
|
2280 | message: 'Argument was out of range',
|
2281 | stack: getExceptionStackTrace()
|
2282 | };
|
2283 | }
|
2284 | Errors.argumentOutOfRange = argumentOutOfRange;
|
2285 | function pureVirtualMethodException(className, methodName) {
|
2286 | return {
|
2287 | name: 'pureVirtualMethodException',
|
2288 | message: 'This method must be overriden by the derived class:' + className + '.' + methodName,
|
2289 | stack: getExceptionStackTrace()
|
2290 | };
|
2291 | }
|
2292 | Errors.pureVirtualMethodException = pureVirtualMethodException;
|
2293 | function notImplementedException(message) {
|
2294 | return {
|
2295 | name: 'notImplementedException',
|
2296 | message: message,
|
2297 | stack: getExceptionStackTrace()
|
2298 | };
|
2299 | }
|
2300 | Errors.notImplementedException = notImplementedException;
|
2301 | function getExceptionStackTrace() {
|
2302 | return getStackTrace( 2);
|
2303 | }
|
2304 | })(Errors = jsCommon.Errors || (jsCommon.Errors = {}));
|
2305 | |
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 | function getStackTrace(leadingFramesToRemove) {
|
2314 | if (leadingFramesToRemove === void 0) { leadingFramesToRemove = 1; }
|
2315 | var stackTrace, stackSegments;
|
2316 | try {
|
2317 |
|
2318 | throw new Error();
|
2319 | }
|
2320 | catch (error) {
|
2321 | stackTrace = error.stack;
|
2322 | if (stackTrace != null) {
|
2323 | stackSegments = stackTrace.split('\n');
|
2324 | stackSegments.splice(1, leadingFramesToRemove);
|
2325 |
|
2326 | stackTrace = stackSegments.join('\n');
|
2327 | }
|
2328 | }
|
2329 | return stackTrace;
|
2330 | }
|
2331 | jsCommon.getStackTrace = getStackTrace;
|
2332 | })(jsCommon || (jsCommon = {}));
|
2333 |
|
2334 |
|
2335 |
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 |
|
2347 |
|
2348 |
|
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 |
|
2358 | $.fn.multiline = function (text) {
|
2359 | this.text(text);
|
2360 | this.html(this.html().replace(/\n/g, '<br/>'));
|
2361 | return this;
|
2362 | };
|
2363 | $.fn.togglePanelControl = function () {
|
2364 | return this.each(function () {
|
2365 | $(this).addClass("ui-accordion ui-accordion-icons ui-widget ui-helper-reset")
|
2366 | .find(".accordionHeader")
|
2367 | .addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-top ui-corner-bottom")
|
2368 | .hover(function () {
|
2369 | $(this).toggleClass("ui-state-hover");
|
2370 | })
|
2371 | .prepend('<span class="ui-icon ui-icon-triangle-1-e"></span>')
|
2372 | .click(function () {
|
2373 | $(this)
|
2374 | .toggleClass("ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom")
|
2375 | .find("> .ui-icon").toggleClass("ui-icon-triangle-1-e ui-icon-triangle-1-s").end()
|
2376 | .next().slideToggle();
|
2377 | return false;
|
2378 | })
|
2379 | .next()
|
2380 | .addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom")
|
2381 | .hide();
|
2382 | });
|
2383 | };
|
2384 | var jsCommon;
|
2385 | (function (jsCommon) {
|
2386 | var JQueryConstants;
|
2387 | (function (JQueryConstants) {
|
2388 | JQueryConstants.VisibleSelector = ':visible';
|
2389 | })(JQueryConstants = jsCommon.JQueryConstants || (jsCommon.JQueryConstants = {}));
|
2390 | })(jsCommon || (jsCommon = {}));
|
2391 |
|
2392 |
|
2393 |
|
2394 |
|
2395 |
|
2396 |
|
2397 |
|
2398 |
|
2399 |
|
2400 |
|
2401 |
|
2402 |
|
2403 |
|
2404 |
|
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 |
|
2415 |
|
2416 | var jsCommon;
|
2417 | (function (jsCommon) {
|
2418 | |
2419 |
|
2420 |
|
2421 | var Lazy = (function () {
|
2422 | function Lazy(factoryMethod) {
|
2423 | jsCommon.Utility.throwIfNullOrUndefined(factoryMethod, this, 'constructor', 'factoryMethod');
|
2424 | this.factoryMethod = factoryMethod;
|
2425 | }
|
2426 | Lazy.prototype.getValue = function () {
|
2427 | if (this.factoryMethod !== null) {
|
2428 | this.value = this.factoryMethod();
|
2429 |
|
2430 | this.factoryMethod = null;
|
2431 | }
|
2432 | return this.value;
|
2433 | };
|
2434 | return Lazy;
|
2435 | }());
|
2436 | jsCommon.Lazy = Lazy;
|
2437 | })(jsCommon || (jsCommon = {}));
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 |
|
2444 |
|
2445 |
|
2446 |
|
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 |
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 | var powerbi;
|
2464 | (function (powerbi) {
|
2465 | var Prototype;
|
2466 | (function (Prototype) {
|
2467 | |
2468 |
|
2469 |
|
2470 | function inherit(obj, extension) {
|
2471 | debug.assertValue(obj, 'obj');
|
2472 | function wrapCtor() { }
|
2473 | ;
|
2474 | wrapCtor.prototype = obj;
|
2475 | var inherited = new wrapCtor();
|
2476 | if (extension)
|
2477 | extension(inherited);
|
2478 | return inherited;
|
2479 | }
|
2480 | Prototype.inherit = inherit;
|
2481 | |
2482 |
|
2483 |
|
2484 |
|
2485 | function inheritSingle(obj) {
|
2486 | debug.assertValue(obj, 'obj');
|
2487 | var proto = Object.getPrototypeOf(obj);
|
2488 | if (proto === Object.prototype || proto === Array.prototype)
|
2489 | obj = inherit(obj);
|
2490 | return obj;
|
2491 | }
|
2492 | Prototype.inheritSingle = inheritSingle;
|
2493 | |
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 | function overrideArray(prototype, override) {
|
2499 | if (!prototype)
|
2500 | return;
|
2501 | var overwritten;
|
2502 | for (var i = 0, len = prototype.length; i < len; i++) {
|
2503 | var value = override(prototype[i]);
|
2504 | if (value) {
|
2505 | if (!overwritten)
|
2506 | overwritten = inherit(prototype);
|
2507 | overwritten[i] = value;
|
2508 | }
|
2509 | }
|
2510 | return overwritten;
|
2511 | }
|
2512 | Prototype.overrideArray = overrideArray;
|
2513 | })(Prototype = powerbi.Prototype || (powerbi.Prototype = {}));
|
2514 | })(powerbi || (powerbi = {}));
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 |
|
2528 |
|
2529 |
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 |
|
2545 |
|
2546 |
|
2547 |
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 |
|
2556 |
|
2557 |
|
2558 |
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 |
|
2564 |
|
2565 |
|
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 |
|
2571 |
|
2572 |
|
2573 |
|
2574 |
|
2575 |
|
2576 |
|
2577 |
|
2578 |
|
2579 |
|
2580 |
|
2581 |
|
2582 |
|
2583 |
|
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 | var jsCommon;
|
2591 | (function (jsCommon) {
|
2592 | var Formatting;
|
2593 | (function (Formatting) {
|
2594 | var regexCache;
|
2595 | |
2596 |
|
2597 |
|
2598 | function findDateFormat(value, format, cultureName) {
|
2599 | switch (format) {
|
2600 | case "m":
|
2601 |
|
2602 | format = "M";
|
2603 | break;
|
2604 | case "O":
|
2605 | case "o":
|
2606 |
|
2607 | format = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'0000'";
|
2608 | break;
|
2609 | case "R":
|
2610 | case "r":
|
2611 |
|
2612 | value = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
|
2613 | format = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
|
2614 | break;
|
2615 | case "s":
|
2616 |
|
2617 | format = "S";
|
2618 | break;
|
2619 | case "u":
|
2620 |
|
2621 | value = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
|
2622 | format = "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
|
2623 | break;
|
2624 | case "U":
|
2625 |
|
2626 | value = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
|
2627 | format = "F";
|
2628 | break;
|
2629 | case "y":
|
2630 | case "Y":
|
2631 |
|
2632 | switch (cultureName) {
|
2633 | case "default":
|
2634 | case "en":
|
2635 | case "en-US":
|
2636 | format = "MMMM, yyyy";
|
2637 | break;
|
2638 | default:
|
2639 | format = "Y";
|
2640 | }
|
2641 | break;
|
2642 | }
|
2643 | return { value: value, format: format };
|
2644 | }
|
2645 | Formatting.findDateFormat = findDateFormat;
|
2646 | |
2647 |
|
2648 |
|
2649 | function fixDateTimeFormat(format) {
|
2650 |
|
2651 |
|
2652 | format = format.replace(/%K/g, "zzz");
|
2653 | format = format.replace(/K/g, "zzz");
|
2654 | format = format.replace(/fffffff/g, "fff0000");
|
2655 | format = format.replace(/ffffff/g, "fff000");
|
2656 | format = format.replace(/fffff/g, "fff00");
|
2657 | format = format.replace(/ffff/g, "fff0");
|
2658 |
|
2659 |
|
2660 | format = format.replace(/yyyyy/g, "0yyyy");
|
2661 |
|
2662 |
|
2663 | format = format.replace(/(^y|^)yyy(^y|$)/g, "yyyy");
|
2664 | if (!regexCache) {
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 | regexCache = ["d", "f", "F", "g", "h", "H", "K", "m", "M", "s", "t", "y", "z", ":", "/"].map(function (s) {
|
2672 | return { r: new RegExp("\%" + s + "(?!" + s + ")", "g"), s: s };
|
2673 | });
|
2674 | }
|
2675 | if (format.indexOf("%") !== -1 && format.length > 2) {
|
2676 | for (var i = 0; i < regexCache.length; i++) {
|
2677 | format = format.replace(regexCache[i].r, regexCache[i].s);
|
2678 | }
|
2679 | }
|
2680 | return format;
|
2681 | }
|
2682 | Formatting.fixDateTimeFormat = fixDateTimeFormat;
|
2683 | })(Formatting = jsCommon.Formatting || (jsCommon.Formatting = {}));
|
2684 | })(jsCommon || (jsCommon = {}));
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 |
|
2695 |
|
2696 |
|
2697 |
|
2698 |
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 |
|
2710 | var jsCommon;
|
2711 | (function (jsCommon) {
|
2712 | var doc = document, headElement = doc.head, firstScriptInHeadElement = headElement.getElementsByTagName('script')[0], linkElement = doc.createElement('link'), scriptElement = doc.createElement('script'), styleSheetLoaded = [], javaScriptFilesLoaded = [], javaScriptFilesLoading = [];
|
2713 | linkElement.setAttribute('rel', 'stylesheet');
|
2714 | function requires(dependency, to) {
|
2715 | if (to === void 0) { to = $.noop; }
|
2716 | loadStyleSheets(dependency.cssFiles || []);
|
2717 | var scriptsToRun = dependency.javaScriptFilesWithCallback || [];
|
2718 | if (dependency.javaScriptFiles) {
|
2719 | for (var i = 0, len = dependency.javaScriptFiles.length; i < len; ++i) {
|
2720 | scriptsToRun.push({ javascriptFile: dependency.javaScriptFiles[i] });
|
2721 | }
|
2722 | }
|
2723 | loadJavaScriptFiles(scriptsToRun, to);
|
2724 | }
|
2725 | jsCommon.requires = requires;
|
2726 | |
2727 |
|
2728 |
|
2729 | function loadStyleSheets(hrefList) {
|
2730 | hrefList.forEach(function (href) {
|
2731 | if (styleSheetLoaded.indexOf(href) === -1) {
|
2732 | styleSheetLoaded.push(href);
|
2733 | loadStyleSheet(href);
|
2734 | }
|
2735 | });
|
2736 | }
|
2737 | function loadJavaScriptFiles(scripts, callback) {
|
2738 | var loadingCount = scripts.length, parsingCount = loadingCount, sourceCodeList = [];
|
2739 | function parseIfLoadingComplete() {
|
2740 | if (!--loadingCount) {
|
2741 | parseJavaScriptSourceCodes(scripts, sourceCodeList);
|
2742 | }
|
2743 | }
|
2744 | function makeCallbackIfParsingComplete() {
|
2745 | if (!--parsingCount) {
|
2746 | callback();
|
2747 | }
|
2748 | }
|
2749 | scripts.forEach(function (script, index) {
|
2750 | var file = script.javascriptFile;
|
2751 | if (javaScriptFilesLoaded.indexOf(file) === -1) {
|
2752 | if (file in javaScriptFilesLoading) {
|
2753 | javaScriptFilesLoading[file].push(function () {
|
2754 | parseIfLoadingComplete();
|
2755 | makeCallbackIfParsingComplete();
|
2756 | });
|
2757 | }
|
2758 | else {
|
2759 | javaScriptFilesLoading[file] = [function () {
|
2760 | makeCallbackIfParsingComplete();
|
2761 | }];
|
2762 | if (isExternalUrl(file)) {
|
2763 | sourceCodeList[index] = script;
|
2764 | parseIfLoadingComplete();
|
2765 | }
|
2766 | else {
|
2767 | loadJavaScriptSourceCode(file, function (sourceCode) {
|
2768 | sourceCodeList[index] = { javascriptFile: sourceCode };
|
2769 | parseIfLoadingComplete();
|
2770 | });
|
2771 | }
|
2772 | }
|
2773 | }
|
2774 | else {
|
2775 | parseIfLoadingComplete();
|
2776 | makeCallbackIfParsingComplete();
|
2777 | }
|
2778 | });
|
2779 | }
|
2780 | function loadStyleSheet(href) {
|
2781 | var link = linkElement.cloneNode();
|
2782 | link.href = href;
|
2783 | if (firstScriptInHeadElement) {
|
2784 | headElement.insertBefore(link, firstScriptInHeadElement);
|
2785 | }
|
2786 | else {
|
2787 | headElement.appendChild(link);
|
2788 | }
|
2789 | }
|
2790 | function loadJavaScriptSourceCode(src, onload) {
|
2791 | webGet(src, function () {
|
2792 | onload(this.responseText);
|
2793 | });
|
2794 | }
|
2795 | function parseJavaScript(script, onComplete) {
|
2796 | if (onComplete === void 0) { onComplete = $.noop; }
|
2797 | if (!script) {
|
2798 | onComplete();
|
2799 | return;
|
2800 | }
|
2801 | var sourceCodeOrFileName = script.javascriptFile;
|
2802 | var targetCallback = onComplete;
|
2803 | if (script.onLoadCallback) {
|
2804 | var promiseAsCallback = function () {
|
2805 | script.onLoadCallback().then(onComplete);
|
2806 | };
|
2807 | targetCallback = promiseAsCallback;
|
2808 | }
|
2809 | isExternalUrl(sourceCodeOrFileName)
|
2810 | ? loadExternalJavaScriptFile(sourceCodeOrFileName, targetCallback)
|
2811 | : parseInternalJavaScriptCode(sourceCodeOrFileName, targetCallback);
|
2812 | }
|
2813 | function parseInternalJavaScriptCode(sourceCode, onComplete) {
|
2814 | if (onComplete === void 0) { onComplete = $.noop; }
|
2815 | var script;
|
2816 | if (sourceCode) {
|
2817 | script = scriptElement.cloneNode();
|
2818 | script.setAttribute('type', 'text/javascript');
|
2819 | script.innerHTML = sourceCode;
|
2820 | headElement.appendChild(script);
|
2821 | }
|
2822 | setTimeout(onComplete, 0);
|
2823 | }
|
2824 | function loadExternalJavaScriptFile(src, onload) {
|
2825 | var script;
|
2826 | if (src) {
|
2827 | script = scriptElement.cloneNode();
|
2828 | script.setAttribute('src', src);
|
2829 | script.setAttribute('charset', 'utf-8');
|
2830 | script.onload = onload;
|
2831 | headElement.appendChild(script);
|
2832 | }
|
2833 | }
|
2834 | function parseJavaScriptSourceCodes(scripts, sourceCodeList) {
|
2835 | asyncLoop(sourceCodeList, parseJavaScript, function () {
|
2836 | scripts.forEach(function (script) {
|
2837 | var file = script.javascriptFile;
|
2838 | var listeners = javaScriptFilesLoading[file];
|
2839 | if (listeners) {
|
2840 | listeners.forEach(function (listener) {
|
2841 | listener();
|
2842 | });
|
2843 | }
|
2844 | delete javaScriptFilesLoading[file];
|
2845 | if (javaScriptFilesLoaded.indexOf(file) === -1) {
|
2846 | javaScriptFilesLoaded.push(file);
|
2847 | }
|
2848 | });
|
2849 | });
|
2850 | }
|
2851 | function webGet(src, onload, onerror) {
|
2852 | var xhr = new XMLHttpRequest();
|
2853 | try {
|
2854 | xhr.open('GET', src, true);
|
2855 | xhr.onload = onload;
|
2856 | xhr.onerror = onerror;
|
2857 | xhr.send(null);
|
2858 | }
|
2859 | catch (e) {
|
2860 | }
|
2861 | }
|
2862 | function isExternalUrl(url) {
|
2863 | var origin = location.protocol + '//' + location.host + '/';
|
2864 | return /^http[s]?:\/\/.+/i.test(url) && url.indexOf(origin) !== 0;
|
2865 | }
|
2866 | function _() {
|
2867 | var args = [];
|
2868 | for (var _i = 0; _i < arguments.length; _i++) {
|
2869 | args[_i - 0] = arguments[_i];
|
2870 | }
|
2871 | }
|
2872 | function asyncSteps() {
|
2873 | var args = [];
|
2874 | for (var _i = 0; _i < arguments.length; _i++) {
|
2875 | args[_i - 0] = arguments[_i];
|
2876 | }
|
2877 | if (args.length === 0) {
|
2878 | return;
|
2879 | }
|
2880 | var steps = [], i = args.length;
|
2881 | while (i--) {
|
2882 | (function (j) {
|
2883 | steps[j] = function () {
|
2884 | args[j](steps[j + 1] || _);
|
2885 | };
|
2886 | })(i);
|
2887 | }
|
2888 | steps[0]();
|
2889 | }
|
2890 | function asyncLoop(enumerable, func, callback) {
|
2891 | var steps = [], i = 0, len = enumerable.length;
|
2892 | for (; i < len - 1; i++) {
|
2893 | (function (i) {
|
2894 | steps[i] = function (next) {
|
2895 | func(enumerable[i], next);
|
2896 | };
|
2897 | }(i));
|
2898 | }
|
2899 | steps[len - 1] = function (next) {
|
2900 | func(enumerable[len - 1], callback);
|
2901 | };
|
2902 | asyncSteps.apply(null, steps);
|
2903 | }
|
2904 | })(jsCommon || (jsCommon = {}));
|
2905 |
|
2906 |
|
2907 |
|
2908 |
|
2909 |
|
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 |
|
2930 | var powerbi;
|
2931 | (function (powerbi) {
|
2932 | function createJQueryPromiseFactory() {
|
2933 | return new JQueryPromiseFactory();
|
2934 | }
|
2935 | powerbi.createJQueryPromiseFactory = createJQueryPromiseFactory;
|
2936 | |
2937 |
|
2938 |
|
2939 |
|
2940 | var JQueryPromiseFactory = (function () {
|
2941 | function JQueryPromiseFactory() {
|
2942 | }
|
2943 | JQueryPromiseFactory.prototype.defer = function () {
|
2944 | return new JQueryDeferredWrapper($.Deferred());
|
2945 | };
|
2946 | JQueryPromiseFactory.prototype.reject = function (reason) {
|
2947 | var deferred = this.defer();
|
2948 | deferred.reject(reason);
|
2949 | return deferred.promise;
|
2950 | };
|
2951 | JQueryPromiseFactory.prototype.resolve = function (value) {
|
2952 | var deferred = this.defer();
|
2953 | deferred.resolve(value);
|
2954 | return deferred.promise;
|
2955 | };
|
2956 | JQueryPromiseFactory.prototype.all = function (promises) {
|
2957 | var unwrappedPromises = jQuery.map(promises, function (value) {
|
2958 | return value && value.promise ? value.promise : value;
|
2959 | });
|
2960 | return new JQueryPromiseWrapper($.when.apply($, unwrappedPromises));
|
2961 | };
|
2962 | JQueryPromiseFactory.prototype.when = function (value) {
|
2963 | var unwrappedPromise = value && value.promise ? value.promise : value;
|
2964 | return new JQueryPromiseWrapper($.when(unwrappedPromise));
|
2965 | };
|
2966 | return JQueryPromiseFactory;
|
2967 | }());
|
2968 | |
2969 |
|
2970 |
|
2971 | var JQueryDeferredWrapper = (function () {
|
2972 | function JQueryDeferredWrapper(deferred) {
|
2973 | debug.assertValue(deferred, 'deferred');
|
2974 | this.deferred = deferred;
|
2975 | this.promise = new JQueryPromiseWrapper(deferred.promise());
|
2976 | }
|
2977 | JQueryDeferredWrapper.prototype.resolve = function (value) {
|
2978 | this.deferred.resolve(value);
|
2979 | };
|
2980 | JQueryDeferredWrapper.prototype.reject = function (reason) {
|
2981 | this.deferred.reject(reason);
|
2982 | };
|
2983 | return JQueryDeferredWrapper;
|
2984 | }());
|
2985 | |
2986 |
|
2987 |
|
2988 | var JQueryPromiseWrapper = (function () {
|
2989 | function JQueryPromiseWrapper(promise) {
|
2990 | debug.assertValue(promise, 'promise');
|
2991 | this.promise = promise;
|
2992 | }
|
2993 | JQueryPromiseWrapper.prototype.then = function (a, b) {
|
2994 | return new JQueryPromiseWrapper(this.promise.then(JQueryPromiseWrapper.wrapCallback(a), JQueryPromiseWrapper.wrapCallback(b)));
|
2995 | };
|
2996 | JQueryPromiseWrapper.prototype.catch = function (callback) {
|
2997 | return this.then(null, callback);
|
2998 | };
|
2999 | JQueryPromiseWrapper.prototype.finally = function (callback) {
|
3000 | this.promise.always(JQueryPromiseWrapper.wrapCallback(callback));
|
3001 | return this;
|
3002 | };
|
3003 | |
3004 |
|
3005 |
|
3006 | JQueryPromiseWrapper.wrapCallback = function (callback) {
|
3007 | if (callback)
|
3008 | return function (arg) {
|
3009 | var value = callback(arg);
|
3010 |
|
3011 | if (value instanceof JQueryPromiseWrapper)
|
3012 | return value.promise;
|
3013 | return value;
|
3014 | };
|
3015 | return callback;
|
3016 | };
|
3017 | return JQueryPromiseWrapper;
|
3018 | }());
|
3019 | })(powerbi || (powerbi = {}));
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 |
|
3027 |
|
3028 |
|
3029 |
|
3030 |
|
3031 |
|
3032 |
|
3033 |
|
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 |
|
3042 |
|
3043 |
|
3044 |
|
3045 | var powerbi;
|
3046 | (function (powerbi) {
|
3047 | var LocalStorageService = (function () {
|
3048 | function LocalStorageService() {
|
3049 | }
|
3050 | LocalStorageService.prototype.getData = function (key) {
|
3051 | try {
|
3052 | if (localStorage) {
|
3053 | var value = localStorage[key];
|
3054 | if (value) {
|
3055 | return JSON.parse(value);
|
3056 | }
|
3057 | }
|
3058 | }
|
3059 | catch (exception) { }
|
3060 | return null;
|
3061 | };
|
3062 | LocalStorageService.prototype.setData = function (key, data) {
|
3063 | try {
|
3064 | if (localStorage) {
|
3065 | localStorage[key] = JSON.stringify(data);
|
3066 | }
|
3067 | }
|
3068 | catch (e) { }
|
3069 | };
|
3070 | return LocalStorageService;
|
3071 | }());
|
3072 | var EphemeralStorageService = (function () {
|
3073 | function EphemeralStorageService(clearCacheInterval) {
|
3074 | this.cache = {};
|
3075 | this.clearCacheInterval = (clearCacheInterval != null)
|
3076 | ? clearCacheInterval
|
3077 | : EphemeralStorageService.defaultClearCacheInterval;
|
3078 | this.clearCache();
|
3079 | }
|
3080 | EphemeralStorageService.prototype.getData = function (key) {
|
3081 | return this.cache[key];
|
3082 | };
|
3083 | EphemeralStorageService.prototype.setData = function (key, data) {
|
3084 | var _this = this;
|
3085 | this.cache[key] = data;
|
3086 | if (this.clearCacheTimerId == null) {
|
3087 | this.clearCacheTimerId = setTimeout(function () { return _this.clearCache(); }, this.clearCacheInterval);
|
3088 | }
|
3089 | };
|
3090 | EphemeralStorageService.prototype.clearCache = function () {
|
3091 | this.cache = {};
|
3092 | this.clearCacheTimerId = undefined;
|
3093 | };
|
3094 | EphemeralStorageService.defaultClearCacheInterval = (1000 * 60 * 60 * 24);
|
3095 | return EphemeralStorageService;
|
3096 | }());
|
3097 | powerbi.EphemeralStorageService = EphemeralStorageService;
|
3098 | powerbi.localStorageService = new LocalStorageService();
|
3099 | powerbi.ephemeralStorageService = new EphemeralStorageService();
|
3100 | })(powerbi || (powerbi = {}));
|
3101 |
|
3102 |
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 |
|
3120 |
|
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 |
|
3126 | var jsCommon;
|
3127 | (function (jsCommon) {
|
3128 | var WordBreaker;
|
3129 | (function (WordBreaker) {
|
3130 | var SPACE = ' ';
|
3131 | var BREAKERS_REGEX = /[\s\n]+/g;
|
3132 | function search(index, content, backward) {
|
3133 | if (backward) {
|
3134 | for (var i = index - 1; i > -1; i--) {
|
3135 | if (hasBreakers(content[i]))
|
3136 | return i + 1;
|
3137 | }
|
3138 | }
|
3139 | else {
|
3140 | for (var i = index, ilen = content.length; i < ilen; i++) {
|
3141 | if (hasBreakers(content[i]))
|
3142 | return i;
|
3143 | }
|
3144 | }
|
3145 | return backward ? 0 : content.length;
|
3146 | }
|
3147 | |
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 | function find(index, content) {
|
3153 | debug.assert(index >= 0 && index <= content.length, 'index within content string bounds');
|
3154 | var result = { start: 0, end: 0 };
|
3155 | if (content.length === 0)
|
3156 | return result;
|
3157 | result.start = search(index, content, true);
|
3158 | result.end = search(index, content, false);
|
3159 | return result;
|
3160 | }
|
3161 | WordBreaker.find = find;
|
3162 | |
3163 |
|
3164 |
|
3165 |
|
3166 | function hasBreakers(content) {
|
3167 | BREAKERS_REGEX.lastIndex = 0;
|
3168 | return BREAKERS_REGEX.test(content);
|
3169 | }
|
3170 | WordBreaker.hasBreakers = hasBreakers;
|
3171 | |
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 | function wordCount(content) {
|
3177 | var count = 1;
|
3178 | BREAKERS_REGEX.lastIndex = 0;
|
3179 | BREAKERS_REGEX.exec(content);
|
3180 | while (BREAKERS_REGEX.lastIndex !== 0) {
|
3181 | count++;
|
3182 | BREAKERS_REGEX.exec(content);
|
3183 | }
|
3184 | return count;
|
3185 | }
|
3186 | WordBreaker.wordCount = wordCount;
|
3187 | function getMaxWordWidth(content, textWidthMeasurer, properties) {
|
3188 | var words = split(content);
|
3189 | var maxWidth = 0;
|
3190 | for (var _i = 0, words_1 = words; _i < words_1.length; _i++) {
|
3191 | var w = words_1[_i];
|
3192 | properties.text = w;
|
3193 | maxWidth = Math.max(maxWidth, textWidthMeasurer(properties));
|
3194 | }
|
3195 | return maxWidth;
|
3196 | }
|
3197 | WordBreaker.getMaxWordWidth = getMaxWordWidth;
|
3198 | function split(content) {
|
3199 | return content.split(BREAKERS_REGEX);
|
3200 | }
|
3201 | function getWidth(content, properties, textWidthMeasurer) {
|
3202 | properties.text = content;
|
3203 | return textWidthMeasurer(properties);
|
3204 | }
|
3205 | function truncate(content, properties, truncator, maxWidth) {
|
3206 | properties.text = content;
|
3207 | return truncator(properties, maxWidth);
|
3208 | }
|
3209 | |
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 | function splitByWidth(content, properties, textWidthMeasurer, maxWidth, maxNumLines, truncator) {
|
3222 |
|
3223 | truncator = truncator ? truncator : function (properties, maxWidth) { return properties.text; };
|
3224 | var result = [];
|
3225 | var words = split(content);
|
3226 | var usedWidth = 0;
|
3227 | var wordsInLine = [];
|
3228 | for (var _i = 0, words_2 = words; _i < words_2.length; _i++) {
|
3229 | var word = words_2[_i];
|
3230 |
|
3231 | if ((maxNumLines > 0) && (result.length >= maxNumLines - 1)) {
|
3232 | wordsInLine.push(word);
|
3233 | continue;
|
3234 | }
|
3235 |
|
3236 |
|
3237 | var wordWidth = wordsInLine.length === 0
|
3238 | ? getWidth(word, properties, textWidthMeasurer)
|
3239 | : getWidth(SPACE + word, properties, textWidthMeasurer);
|
3240 |
|
3241 |
|
3242 | if (usedWidth + wordWidth > maxWidth) {
|
3243 |
|
3244 | if (wordsInLine.length === 0) {
|
3245 | result.push(truncate(word, properties, truncator, maxWidth));
|
3246 | usedWidth = 0;
|
3247 | wordsInLine = [];
|
3248 | continue;
|
3249 | }
|
3250 | result.push(truncate(wordsInLine.join(SPACE), properties, truncator, maxWidth));
|
3251 | usedWidth = 0;
|
3252 | wordsInLine = [];
|
3253 | }
|
3254 |
|
3255 | wordsInLine.push(word);
|
3256 | usedWidth += wordWidth;
|
3257 | }
|
3258 |
|
3259 | result.push(truncate(wordsInLine.join(SPACE), properties, truncator, maxWidth));
|
3260 | return result;
|
3261 | }
|
3262 | WordBreaker.splitByWidth = splitByWidth;
|
3263 | })(WordBreaker = jsCommon.WordBreaker || (jsCommon.WordBreaker = {}));
|
3264 | })(jsCommon || (jsCommon = {}));
|
3265 |
|
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 |
|
3272 |
|
3273 |
|
3274 |
|
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 |
|
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 | var powerbi;
|
3291 | (function (powerbi) {
|
3292 | var TextMeasurementService;
|
3293 | (function (TextMeasurementService) {
|
3294 | var ellipsis = '…';
|
3295 | var OverflowingText = jsCommon.CssConstants.createClassAndSelector('overflowingText');
|
3296 | var spanElement;
|
3297 | var svgTextElement;
|
3298 | var canvasCtx;
|
3299 | var fallbackFontFamily;
|
3300 | |
3301 |
|
3302 |
|
3303 | function ensureDOM() {
|
3304 | if (spanElement)
|
3305 | return;
|
3306 | spanElement = $('<span/>');
|
3307 | $('body').append(spanElement);
|
3308 |
|
3309 | svgTextElement = d3.select($('body').get(0))
|
3310 | .append('svg')
|
3311 | .style({
|
3312 | 'height': '0px',
|
3313 | 'width': '0px',
|
3314 | 'position': 'absolute'
|
3315 | })
|
3316 | .append('text');
|
3317 | canvasCtx = $('<canvas/>').get(0).getContext("2d");
|
3318 | fallbackFontFamily = window.getComputedStyle(svgTextElement.node()).fontFamily;
|
3319 | }
|
3320 | |
3321 |
|
3322 |
|
3323 | function removeSpanElement() {
|
3324 | if (spanElement && spanElement.remove) {
|
3325 | spanElement.remove();
|
3326 | }
|
3327 | spanElement = null;
|
3328 | }
|
3329 | TextMeasurementService.removeSpanElement = removeSpanElement;
|
3330 | |
3331 |
|
3332 |
|
3333 |
|
3334 | function measureSvgTextWidth(textProperties) {
|
3335 | debug.assertValue(textProperties, 'textProperties');
|
3336 | debug.assert(_.isEmpty(textProperties.fontSize) || textProperties.fontSize.indexOf("px") !== -1, "TextProperties' text size should be in px.");
|
3337 | ensureDOM();
|
3338 | canvasCtx.font =
|
3339 | (textProperties.fontStyle || "") + " " +
|
3340 | (textProperties.fontVariant || "") + " " +
|
3341 | (textProperties.fontWeight || "") + " " +
|
3342 | textProperties.fontSize + " " +
|
3343 | (textProperties.fontFamily || fallbackFontFamily);
|
3344 | return canvasCtx.measureText(textProperties.text).width;
|
3345 | }
|
3346 | TextMeasurementService.measureSvgTextWidth = measureSvgTextWidth;
|
3347 | |
3348 |
|
3349 |
|
3350 |
|
3351 | function measureSvgTextRect(textProperties) {
|
3352 | debug.assertValue(textProperties, 'textProperties');
|
3353 | debug.assert(_.isEmpty(textProperties.fontSize) || textProperties.fontSize.indexOf("px") !== -1, "TextProperties' text size should be in px.");
|
3354 | ensureDOM();
|
3355 | svgTextElement.style(null);
|
3356 | svgTextElement
|
3357 | .text(textProperties.text)
|
3358 | .attr({
|
3359 | 'visibility': 'hidden',
|
3360 | 'font-family': textProperties.fontFamily || fallbackFontFamily,
|
3361 | 'font-variant': textProperties.fontVariant,
|
3362 | 'font-size': textProperties.fontSize,
|
3363 | 'font-weight': textProperties.fontWeight,
|
3364 | 'font-style': textProperties.fontStyle,
|
3365 | 'white-space': textProperties.whiteSpace || 'nowrap'
|
3366 | });
|
3367 |
|
3368 |
|
3369 | return svgTextElement.node().getBBox();
|
3370 | }
|
3371 | TextMeasurementService.measureSvgTextRect = measureSvgTextRect;
|
3372 | |
3373 |
|
3374 |
|
3375 |
|
3376 | function measureSvgTextHeight(textProperties) {
|
3377 | return measureSvgTextRect(textProperties).height;
|
3378 | }
|
3379 | TextMeasurementService.measureSvgTextHeight = measureSvgTextHeight;
|
3380 | |
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 | function estimateSvgTextRect(textProperties) {
|
3386 | debug.assertValue(textProperties, 'textProperties');
|
3387 | debug.assert(_.isEmpty(textProperties.fontSize) || textProperties.fontSize.indexOf("px") !== -1, "TextProperties' text size should be in px.");
|
3388 | var propertiesKey = textProperties.fontFamily + textProperties.fontSize;
|
3389 | var rect = powerbi.ephemeralStorageService.getData(propertiesKey);
|
3390 | if (rect == null) {
|
3391 |
|
3392 |
|
3393 | var estimatedTextProperties = {
|
3394 | fontFamily: textProperties.fontFamily,
|
3395 | fontSize: textProperties.fontSize,
|
3396 | text: "M",
|
3397 | };
|
3398 | rect = TextMeasurementService.measureSvgTextRect(estimatedTextProperties);
|
3399 |
|
3400 |
|
3401 | if (rect.height > 0)
|
3402 | powerbi.ephemeralStorageService.setData(propertiesKey, rect);
|
3403 | }
|
3404 | return rect;
|
3405 | }
|
3406 | |
3407 |
|
3408 |
|
3409 |
|
3410 | function estimateSvgTextBaselineDelta(textProperties) {
|
3411 | var rect = estimateSvgTextRect(textProperties);
|
3412 | return rect.y + rect.height;
|
3413 | }
|
3414 | TextMeasurementService.estimateSvgTextBaselineDelta = estimateSvgTextBaselineDelta;
|
3415 | |
3416 |
|
3417 |
|
3418 |
|
3419 | function estimateSvgTextHeight(textProperties, tightFightForNumeric) {
|
3420 | if (tightFightForNumeric === void 0) { tightFightForNumeric = false; }
|
3421 | var height = estimateSvgTextRect(textProperties).height;
|
3422 |
|
3423 | if (tightFightForNumeric)
|
3424 | height *= 0.7;
|
3425 | return height;
|
3426 | }
|
3427 | TextMeasurementService.estimateSvgTextHeight = estimateSvgTextHeight;
|
3428 | |
3429 |
|
3430 |
|
3431 |
|
3432 | function measureSvgTextElementWidth(svgElement) {
|
3433 | debug.assertValue(svgElement, 'svgElement');
|
3434 | return measureSvgTextWidth(getSvgMeasurementProperties(svgElement));
|
3435 | }
|
3436 | TextMeasurementService.measureSvgTextElementWidth = measureSvgTextElementWidth;
|
3437 | |
3438 |
|
3439 |
|
3440 |
|
3441 | function getMeasurementProperties(element) {
|
3442 | debug.assertValue(element, 'element');
|
3443 | return {
|
3444 | text: element.val() || element.text(),
|
3445 | fontFamily: element.css('font-family'),
|
3446 | fontSize: element.css('font-size'),
|
3447 | fontWeight: element.css('font-weight'),
|
3448 | fontStyle: element.css('font-style'),
|
3449 | fontVariant: element.css('font-variant'),
|
3450 | whiteSpace: element.css('white-space')
|
3451 | };
|
3452 | }
|
3453 | TextMeasurementService.getMeasurementProperties = getMeasurementProperties;
|
3454 | |
3455 |
|
3456 |
|
3457 |
|
3458 | function getSvgMeasurementProperties(svgElement) {
|
3459 | debug.assertValue(svgElement, 'svgElement');
|
3460 | var style = window.getComputedStyle(svgElement, null);
|
3461 | return {
|
3462 | text: svgElement.textContent,
|
3463 | fontFamily: style.fontFamily,
|
3464 | fontSize: style.fontSize,
|
3465 | fontWeight: style.fontWeight,
|
3466 | fontStyle: style.fontStyle,
|
3467 | fontVariant: style.fontVariant,
|
3468 | whiteSpace: style.whiteSpace
|
3469 | };
|
3470 | }
|
3471 | TextMeasurementService.getSvgMeasurementProperties = getSvgMeasurementProperties;
|
3472 | |
3473 |
|
3474 |
|
3475 |
|
3476 | function getDivElementWidth(element) {
|
3477 | debug.assert(element.is('div'), 'Given element is not a div type. Cannot get width');
|
3478 | return getComputedStyle(element[0]).width;
|
3479 | }
|
3480 | TextMeasurementService.getDivElementWidth = getDivElementWidth;
|
3481 | |
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 | function getTailoredTextOrDefault(textProperties, maxWidth) {
|
3487 | debug.assertValue(textProperties, 'properties');
|
3488 | debug.assertValue(textProperties.text, 'properties.text');
|
3489 | debug.assert(_.isEmpty(textProperties.fontSize) || textProperties.fontSize.indexOf("px") !== -1, "TextProperties' text size should be in px.");
|
3490 | ensureDOM();
|
3491 | var strLength = textProperties.text.length;
|
3492 | if (strLength === 0)
|
3493 | return textProperties.text;
|
3494 | var width = measureSvgTextWidth(textProperties);
|
3495 | if (width < maxWidth)
|
3496 | return textProperties.text;
|
3497 |
|
3498 | var copiedTextProperties = powerbi.Prototype.inherit(textProperties);
|
3499 |
|
3500 |
|
3501 |
|
3502 | var text = copiedTextProperties.text = ellipsis + copiedTextProperties.text;
|
3503 | var min = 1;
|
3504 | var max = text.length;
|
3505 | var i = ellipsis.length;
|
3506 | while (min <= max) {
|
3507 |
|
3508 | i = (min + max) / 2 | 0;
|
3509 | copiedTextProperties.text = text.substr(0, i);
|
3510 | width = measureSvgTextWidth(copiedTextProperties);
|
3511 | if (maxWidth > width)
|
3512 | min = i + 1;
|
3513 | else if (maxWidth < width)
|
3514 | max = i - 1;
|
3515 | else
|
3516 | break;
|
3517 | }
|
3518 |
|
3519 |
|
3520 |
|
3521 |
|
3522 | copiedTextProperties.text = text.substr(0, i);
|
3523 | width = measureSvgTextWidth(copiedTextProperties);
|
3524 | if (width > maxWidth)
|
3525 | i--;
|
3526 | return text.substr(ellipsis.length, i - ellipsis.length) + ellipsis;
|
3527 | }
|
3528 | TextMeasurementService.getTailoredTextOrDefault = getTailoredTextOrDefault;
|
3529 | |
3530 |
|
3531 |
|
3532 |
|
3533 |
|
3534 | function svgEllipsis(textElement, maxWidth) {
|
3535 | debug.assertValue(textElement, 'textElement');
|
3536 | var properties = getSvgMeasurementProperties(textElement);
|
3537 | var originalText = properties.text;
|
3538 | var tailoredText = getTailoredTextOrDefault(properties, maxWidth);
|
3539 | if (originalText !== tailoredText) {
|
3540 | textElement.textContent = tailoredText;
|
3541 | }
|
3542 | }
|
3543 | TextMeasurementService.svgEllipsis = svgEllipsis;
|
3544 | |
3545 |
|
3546 |
|
3547 |
|
3548 |
|
3549 |
|
3550 |
|
3551 |
|
3552 | function wordBreak(textElement, maxWidth, maxHeight, linePadding) {
|
3553 | if (linePadding === void 0) { linePadding = 0; }
|
3554 | debug.assertValue(textElement, 'textElement');
|
3555 | var properties = getSvgMeasurementProperties(textElement);
|
3556 | var height = estimateSvgTextHeight(properties) + linePadding;
|
3557 | var maxNumLines = Math.max(1, Math.floor(maxHeight / height));
|
3558 | var node = d3.select(textElement);
|
3559 |
|
3560 | var firstDY = node.attr('y');
|
3561 |
|
3562 | var labelText = textElement.textContent;
|
3563 | textElement.textContent = null;
|
3564 |
|
3565 | var words = jsCommon.WordBreaker.splitByWidth(labelText, properties, measureSvgTextWidth, maxWidth, maxNumLines);
|
3566 | for (var i = 0, ilen = words.length; i < ilen; i++) {
|
3567 | properties.text = words[i];
|
3568 | node
|
3569 | .append('tspan')
|
3570 | .attr({
|
3571 | 'x': 0,
|
3572 | 'dy': i === 0 ? firstDY : height,
|
3573 | })
|
3574 | .text(getTailoredTextOrDefault(properties, maxWidth));
|
3575 | }
|
3576 | }
|
3577 | TextMeasurementService.wordBreak = wordBreak;
|
3578 | |
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 | function wordBreakOverflowingText(textElement, maxWidth, maxHeight, linePadding) {
|
3587 | if (linePadding === void 0) { linePadding = 0; }
|
3588 | debug.assertValue(textElement, 'textElement');
|
3589 | var properties = getSvgMeasurementProperties(textElement);
|
3590 | var height = estimateSvgTextHeight(properties) + linePadding;
|
3591 | var maxNumLines = Math.max(1, Math.floor(maxHeight / height));
|
3592 |
|
3593 | var labelText = textElement.textContent;
|
3594 | textElement.textContent = null;
|
3595 |
|
3596 | var words = jsCommon.WordBreaker.splitByWidth(labelText, properties, measureSvgTextWidth, maxWidth, maxNumLines);
|
3597 |
|
3598 |
|
3599 | words = _.compact(words);
|
3600 | var spanItem = d3.select(textElement)
|
3601 | .selectAll(OverflowingText.selector)
|
3602 | .data(words, function (d) { return $.inArray(d, words); });
|
3603 | spanItem
|
3604 | .enter()
|
3605 | .append("span")
|
3606 | .classed(OverflowingText.class, true)
|
3607 | .text(function (d) { return d; })
|
3608 | .style("width", jsCommon.PixelConverter.toString(maxWidth));
|
3609 | }
|
3610 | TextMeasurementService.wordBreakOverflowingText = wordBreakOverflowingText;
|
3611 | })(TextMeasurementService = powerbi.TextMeasurementService || (powerbi.TextMeasurementService = {}));
|
3612 | })(powerbi || (powerbi = {}));
|
3613 |
|
3614 |
|
3615 |
|
3616 |
|
3617 |
|
3618 |
|
3619 |
|
3620 |
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 |
|
3629 |
|
3630 |
|
3631 |
|
3632 |
|
3633 |
|
3634 |
|
3635 |
|
3636 |
|
3637 |
|
3638 | var jsCommon;
|
3639 | (function (jsCommon) {
|
3640 | var DOMConstants = jsCommon.DOMConstants;
|
3641 | var KeyUtils;
|
3642 | (function (KeyUtils) {
|
3643 | function isArrowKey(keyCode) {
|
3644 | return keyCode === DOMConstants.downArrowKeyCode
|
3645 | || keyCode === DOMConstants.upArrowKeyCode
|
3646 | || keyCode === DOMConstants.leftArrowKeyCode
|
3647 | || keyCode === DOMConstants.rightArrowKeyCode;
|
3648 | }
|
3649 | KeyUtils.isArrowKey = isArrowKey;
|
3650 | })(KeyUtils = jsCommon.KeyUtils || (jsCommon.KeyUtils = {}));
|
3651 | })(jsCommon || (jsCommon = {}));
|
3652 |
|
3653 |
|
3654 |
|
3655 |
|
3656 |
|
3657 |
|
3658 |
|
3659 |
|
3660 |
|
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 |
|
3673 |
|
3674 |
|
3675 |
|
3676 |
|
3677 | var jsCommon;
|
3678 | (function (jsCommon) {
|
3679 | |
3680 |
|
3681 |
|
3682 | var ThrottleUtility = (function () {
|
3683 | function ThrottleUtility(delay) {
|
3684 | this.timerFactory = jsCommon.TimerPromiseFactory.instance;
|
3685 | this.delay = 0;
|
3686 | if (delay) {
|
3687 | this.delay = delay;
|
3688 | }
|
3689 | }
|
3690 | ThrottleUtility.prototype.run = function (fn) {
|
3691 | var _this = this;
|
3692 | if (!this.fn) {
|
3693 | this.fn = fn;
|
3694 | this.timerFactory.create(this.delay).done(function () { return _this.timerComplete(_this.fn); });
|
3695 | }
|
3696 | else {
|
3697 | this.fn = fn;
|
3698 | }
|
3699 | };
|
3700 | |
3701 |
|
3702 |
|
3703 | ThrottleUtility.prototype.timerComplete = function (fn) {
|
3704 |
|
3705 | fn();
|
3706 |
|
3707 | this.fn = null;
|
3708 | };
|
3709 | return ThrottleUtility;
|
3710 | }());
|
3711 | jsCommon.ThrottleUtility = ThrottleUtility;
|
3712 | })(jsCommon || (jsCommon = {}));
|
3713 |
|
3714 |
|
3715 |
|
3716 |
|
3717 |
|
3718 |
|
3719 |
|
3720 |
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 |
|
3728 |
|
3729 |
|
3730 |
|
3731 |
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 | var jsCommon;
|
3739 | (function (jsCommon) {
|
3740 | |
3741 |
|
3742 |
|
3743 | var TimerPromiseFactory = (function () {
|
3744 | function TimerPromiseFactory() {
|
3745 | }
|
3746 | |
3747 |
|
3748 |
|
3749 | TimerPromiseFactory.prototype.create = function (delayInMs) {
|
3750 | debug.assertValue(delayInMs, 'delayInMs');
|
3751 | debug.assert(delayInMs >= 0, 'delayInMs must be a positive value.');
|
3752 | var deferred = $.Deferred();
|
3753 | window.setTimeout(function () { return deferred.resolve(); }, delayInMs);
|
3754 | return deferred;
|
3755 | };
|
3756 | TimerPromiseFactory.instance = new TimerPromiseFactory();
|
3757 | return TimerPromiseFactory;
|
3758 | }());
|
3759 | jsCommon.TimerPromiseFactory = TimerPromiseFactory;
|
3760 | })(jsCommon || (jsCommon = {}));
|
3761 |
|
3762 |
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 |
|
3768 |
|
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 |
|
3786 | var jsCommon;
|
3787 | (function (jsCommon) {
|
3788 | |
3789 |
|
3790 |
|
3791 | (function (HttpStatusCode) {
|
3792 | HttpStatusCode[HttpStatusCode["OK"] = 200] = "OK";
|
3793 | HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest";
|
3794 | HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized";
|
3795 | HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden";
|
3796 | HttpStatusCode[HttpStatusCode["RequestEntityTooLarge"] = 413] = "RequestEntityTooLarge";
|
3797 | })(jsCommon.HttpStatusCode || (jsCommon.HttpStatusCode = {}));
|
3798 | var HttpStatusCode = jsCommon.HttpStatusCode;
|
3799 | |
3800 |
|
3801 |
|
3802 | var HttpConstants;
|
3803 | (function (HttpConstants) {
|
3804 | HttpConstants.ApplicationOctetStream = 'application/octet-stream';
|
3805 | HttpConstants.MultiPartFormData = 'multipart/form-data';
|
3806 | })(HttpConstants = jsCommon.HttpConstants || (jsCommon.HttpConstants = {}));
|
3807 | |
3808 |
|
3809 |
|
3810 | var StringExtensions;
|
3811 | (function (StringExtensions) {
|
3812 | var HtmlTagRegex = new RegExp('[<>]', 'g');
|
3813 | function format() {
|
3814 | var args = [];
|
3815 | for (var _i = 0; _i < arguments.length; _i++) {
|
3816 | args[_i - 0] = arguments[_i];
|
3817 | }
|
3818 | var s = args[0];
|
3819 | if (isNullOrUndefinedOrWhiteSpaceString(s))
|
3820 | return s;
|
3821 | for (var i = 0; i < args.length - 1; i++) {
|
3822 | var reg = new RegExp("\\{" + i + "\\}", "gm");
|
3823 | s = s.replace(reg, args[i + 1]);
|
3824 | }
|
3825 | return s;
|
3826 | }
|
3827 | StringExtensions.format = format;
|
3828 | |
3829 |
|
3830 |
|
3831 | function equalIgnoreCase(a, b) {
|
3832 | return StringExtensions.normalizeCase(a) === StringExtensions.normalizeCase(b);
|
3833 | }
|
3834 | StringExtensions.equalIgnoreCase = equalIgnoreCase;
|
3835 | function startsWithIgnoreCase(a, b) {
|
3836 | var normalizedSearchString = StringExtensions.normalizeCase(b);
|
3837 | return StringExtensions.normalizeCase(a).indexOf(normalizedSearchString) === 0;
|
3838 | }
|
3839 | StringExtensions.startsWithIgnoreCase = startsWithIgnoreCase;
|
3840 | function startsWith(a, b) {
|
3841 | return a.indexOf(b) === 0;
|
3842 | }
|
3843 | StringExtensions.startsWith = startsWith;
|
3844 |
|
3845 | function containsIgnoreCase(source, substring) {
|
3846 | if (source == null)
|
3847 | return false;
|
3848 | return source.toLowerCase().indexOf(substring.toLowerCase().toString()) !== -1;
|
3849 | }
|
3850 | StringExtensions.containsIgnoreCase = containsIgnoreCase;
|
3851 | |
3852 |
|
3853 |
|
3854 |
|
3855 | function normalizeCase(value) {
|
3856 | Utility.throwIfNullOrUndefined(value, StringExtensions, 'normalizeCase', 'value');
|
3857 | return value.toUpperCase();
|
3858 | }
|
3859 | StringExtensions.normalizeCase = normalizeCase;
|
3860 | |
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 | function isNullOrEmpty(value) {
|
3866 | return (value == null) || (value.length === 0);
|
3867 | }
|
3868 | StringExtensions.isNullOrEmpty = isNullOrEmpty;
|
3869 | |
3870 |
|
3871 |
|
3872 |
|
3873 |
|
3874 | function isNullOrUndefinedOrWhiteSpaceString(str) {
|
3875 | return StringExtensions.isNullOrEmpty(str) || StringExtensions.isNullOrEmpty(str.trim());
|
3876 | }
|
3877 | StringExtensions.isNullOrUndefinedOrWhiteSpaceString = isNullOrUndefinedOrWhiteSpaceString;
|
3878 | |
3879 |
|
3880 |
|
3881 | function containsWhitespace(str) {
|
3882 | Utility.throwIfNullOrUndefined(str, this, 'containsWhitespace', 'str');
|
3883 | var expr = /\s/;
|
3884 | return expr.test(str);
|
3885 | }
|
3886 | StringExtensions.containsWhitespace = containsWhitespace;
|
3887 | |
3888 |
|
3889 |
|
3890 | function isWhitespace(str) {
|
3891 | Utility.throwIfNullOrUndefined(str, this, 'isWhitespace', 'str');
|
3892 | return str.trim() === '';
|
3893 | }
|
3894 | StringExtensions.isWhitespace = isWhitespace;
|
3895 | |
3896 |
|
3897 |
|
3898 | function trimTrailingWhitespace(str) {
|
3899 | Utility.throwIfNullOrUndefined(str, this, 'trimTrailingWhitespace', 'str');
|
3900 | return str.replace(/\s+$/, '');
|
3901 | }
|
3902 | StringExtensions.trimTrailingWhitespace = trimTrailingWhitespace;
|
3903 | |
3904 |
|
3905 |
|
3906 | function trimWhitespace(str) {
|
3907 | Utility.throwIfNullOrUndefined(str, this, 'trimWhitespace', 'str');
|
3908 | return str.replace(/^\s+/, '').replace(/\s+$/, '');
|
3909 | }
|
3910 | StringExtensions.trimWhitespace = trimWhitespace;
|
3911 | |
3912 |
|
3913 |
|
3914 | function getLengthDifference(left, right) {
|
3915 | Utility.throwIfNullOrUndefined(left, this, 'getLengthDifference', 'left');
|
3916 | Utility.throwIfNullOrUndefined(right, this, 'getLengthDifference', 'right');
|
3917 | return Math.abs(left.length - right.length);
|
3918 | }
|
3919 | StringExtensions.getLengthDifference = getLengthDifference;
|
3920 | |
3921 |
|
3922 |
|
3923 |
|
3924 |
|
3925 | function repeat(char, count) {
|
3926 | var result = "";
|
3927 | for (var i = 0; i < count; i++) {
|
3928 | result += char;
|
3929 | }
|
3930 | return result;
|
3931 | }
|
3932 | StringExtensions.repeat = repeat;
|
3933 | |
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 | function replaceAll(text, textToFind, textToReplace) {
|
3940 | if (!textToFind)
|
3941 | return text;
|
3942 | var pattern = escapeStringForRegex(textToFind);
|
3943 | return text.replace(new RegExp(pattern, 'gi'), textToReplace);
|
3944 | }
|
3945 | StringExtensions.replaceAll = replaceAll;
|
3946 | function ensureUniqueNames(names) {
|
3947 | debug.assertValue(names, 'names');
|
3948 | var usedNames = {};
|
3949 |
|
3950 |
|
3951 | for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {
|
3952 | var name_1 = names_1[_i];
|
3953 | usedNames[name_1] = false;
|
3954 | }
|
3955 | var uniqueNames = [];
|
3956 |
|
3957 | for (var _a = 0, names_2 = names; _a < names_2.length; _a++) {
|
3958 | var name_2 = names_2[_a];
|
3959 | var uniqueName = name_2;
|
3960 |
|
3961 | if (usedNames[uniqueName]) {
|
3962 | var counter = 0;
|
3963 |
|
3964 | while (usedNames[uniqueName] !== undefined) {
|
3965 | uniqueName = name_2 + "." + (++counter);
|
3966 | }
|
3967 | }
|
3968 | uniqueNames.push(uniqueName);
|
3969 | usedNames[uniqueName] = true;
|
3970 | }
|
3971 | return uniqueNames;
|
3972 | }
|
3973 | StringExtensions.ensureUniqueNames = ensureUniqueNames;
|
3974 | |
3975 |
|
3976 |
|
3977 | function findUniqueName(usedNames, baseName) {
|
3978 | debug.assertValue(usedNames, 'usedNames');
|
3979 | debug.assertValue(baseName, 'baseName');
|
3980 |
|
3981 | var i = 0, uniqueName = baseName;
|
3982 | while (usedNames[uniqueName]) {
|
3983 | uniqueName = baseName + (++i);
|
3984 | }
|
3985 | return uniqueName;
|
3986 | }
|
3987 | StringExtensions.findUniqueName = findUniqueName;
|
3988 | function constructCommaSeparatedList(list, resourceProvider, maxValue) {
|
3989 | if (!list || list.length === 0)
|
3990 | return '';
|
3991 | if (maxValue === null || maxValue === undefined)
|
3992 | maxValue = Number.MAX_VALUE;
|
3993 | var length = Math.min(maxValue, list.length);
|
3994 | var replacedList = [];
|
3995 |
|
3996 | for (var j = 0; j < 2; j++) {
|
3997 | var targetValue = '{' + j + '}';
|
3998 | var replaceValue = '_|_<' + j + '>_|_';
|
3999 | for (var i = 0; i < length; i++) {
|
4000 | if (list[i].indexOf(targetValue) > -1) {
|
4001 | list[i] = list[i].replace(targetValue, replaceValue);
|
4002 | replacedList.push({ targetValue: targetValue, replaceValue: replaceValue });
|
4003 | }
|
4004 | }
|
4005 | }
|
4006 | var commaSeparatedList = '';
|
4007 | for (var i = 0; i < length; i++) {
|
4008 | if (i === 0)
|
4009 | commaSeparatedList = list[i];
|
4010 | else
|
4011 | commaSeparatedList = StringExtensions.format(resourceProvider.get('FilterRestatement_Comma'), commaSeparatedList, list[i]);
|
4012 | }
|
4013 | for (var i = 0; i < replacedList.length; i++) {
|
4014 | commaSeparatedList = commaSeparatedList.replace(replacedList[i].replaceValue, replacedList[i].targetValue);
|
4015 | }
|
4016 | return commaSeparatedList;
|
4017 | }
|
4018 | StringExtensions.constructCommaSeparatedList = constructCommaSeparatedList;
|
4019 | function escapeStringForRegex(s) {
|
4020 | return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1');
|
4021 | }
|
4022 | StringExtensions.escapeStringForRegex = escapeStringForRegex;
|
4023 | |
4024 |
|
4025 |
|
4026 | function normalizeFileName(fileName) {
|
4027 | debug.assertValue(fileName, 'fileName');
|
4028 | return fileName.replace(/[\<\>\:"\/\\\|\?*]/g, '');
|
4029 | }
|
4030 | StringExtensions.normalizeFileName = normalizeFileName;
|
4031 | |
4032 |
|
4033 |
|
4034 |
|
4035 | function stringifyAsPrettyJSON(object) {
|
4036 |
|
4037 | return JSON.stringify(object );
|
4038 | }
|
4039 | StringExtensions.stringifyAsPrettyJSON = stringifyAsPrettyJSON;
|
4040 | |
4041 |
|
4042 |
|
4043 |
|
4044 | function deriveClsCompliantName(input, fallback) {
|
4045 | debug.assertValue(input, 'input');
|
4046 | var result = input.replace(/^[^A-Za-z]*/g, '').replace(/[ :\.\/\\\-\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]/g, '_').replace(/[\W]/g, '');
|
4047 | return result.length > 0 ? result : fallback;
|
4048 | }
|
4049 | StringExtensions.deriveClsCompliantName = deriveClsCompliantName;
|
4050 |
|
4051 | function stripTagDelimiters(s) {
|
4052 | return s.replace(HtmlTagRegex, '');
|
4053 | }
|
4054 | StringExtensions.stripTagDelimiters = stripTagDelimiters;
|
4055 | })(StringExtensions = jsCommon.StringExtensions || (jsCommon.StringExtensions = {}));
|
4056 | |
4057 |
|
4058 |
|
4059 | var Utility = (function () {
|
4060 | function Utility() {
|
4061 | }
|
4062 | |
4063 |
|
4064 |
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 | Utility.throwIfNullOrUndefined = function (value, context, methodName, parameterName) {
|
4070 | if (value === null) {
|
4071 | Utility.throwException(jsCommon.Errors.argumentNull(Utility.getComponentName(context) + methodName + '.' + parameterName));
|
4072 | }
|
4073 | else if (typeof (value) === Utility.Undefined) {
|
4074 | Utility.throwException(jsCommon.Errors.argumentUndefined(Utility.getComponentName(context) + methodName + '.' + parameterName));
|
4075 | }
|
4076 | };
|
4077 | |
4078 |
|
4079 |
|
4080 |
|
4081 |
|
4082 |
|
4083 |
|
4084 | Utility.throwIfNullOrEmpty = function (value, context, methodName, parameterName) {
|
4085 | Utility.throwIfNullOrUndefined(value, context, methodName, parameterName);
|
4086 | if (!value.length) {
|
4087 | Utility.throwException(jsCommon.Errors.argumentOutOfRange(Utility.getComponentName(context) + methodName + '.' + parameterName));
|
4088 | }
|
4089 | };
|
4090 | |
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 | Utility.throwIfNullOrEmptyString = function (value, context, methodName, parameterName) {
|
4098 | Utility.throwIfNullOrUndefined(value, context, methodName, parameterName);
|
4099 | if (value.length < 1) {
|
4100 | Utility.throwException(jsCommon.Errors.argumentOutOfRange(Utility.getComponentName(context) + methodName + '.' + parameterName));
|
4101 | }
|
4102 | };
|
4103 | |
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 | Utility.throwIfNullEmptyOrWhitespaceString = function (value, context, methodName, parameterName) {
|
4111 | Utility.throwIfNullOrUndefined(value, context, methodName, parameterName);
|
4112 | if (StringExtensions.isNullOrUndefinedOrWhiteSpaceString(value)) {
|
4113 | Utility.throwException(jsCommon.Errors.argumentOutOfRange(Utility.getComponentName(context) + methodName + '.' + parameterName));
|
4114 | }
|
4115 | };
|
4116 | |
4117 |
|
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 |
|
4123 | Utility.throwIfNotTrue = function (condition, context, methodName, parameterName) {
|
4124 | if (!condition) {
|
4125 | Utility.throwException(jsCommon.Errors.argument(parameterName, Utility.getComponentName(context) + methodName + '.' + parameterName));
|
4126 | }
|
4127 | };
|
4128 | |
4129 |
|
4130 |
|
4131 |
|
4132 | Utility.isString = function (value) {
|
4133 | return ((typeof value) === 'string');
|
4134 | };
|
4135 | |
4136 |
|
4137 |
|
4138 |
|
4139 | Utility.isBoolean = function (value) {
|
4140 | return ((typeof value) === 'boolean');
|
4141 | };
|
4142 | |
4143 |
|
4144 |
|
4145 |
|
4146 | Utility.isNumber = function (value) {
|
4147 | return ((typeof value) === 'number');
|
4148 | };
|
4149 | |
4150 |
|
4151 |
|
4152 |
|
4153 | Utility.isDate = function (value) {
|
4154 | return Utility.isObject(value) && (value instanceof Date);
|
4155 | };
|
4156 | |
4157 |
|
4158 |
|
4159 |
|
4160 | Utility.isObject = function (value) {
|
4161 | return (value != null) && ((typeof value) === 'object');
|
4162 | };
|
4163 | |
4164 |
|
4165 |
|
4166 |
|
4167 | Utility.isNullOrUndefined = function (value) {
|
4168 | return (value === null) || (typeof (value) === Utility.Undefined);
|
4169 | };
|
4170 | |
4171 |
|
4172 |
|
4173 |
|
4174 |
|
4175 |
|
4176 | Utility.urlCombine = function (baseUrl, path) {
|
4177 | Utility.throwIfNullOrUndefined(baseUrl, null, "urlCombine", "baseUrl");
|
4178 | Utility.throwIfNullOrUndefined(path, null, "urlCombine", "path");
|
4179 |
|
4180 | if (StringExtensions.isNullOrUndefinedOrWhiteSpaceString(path)) {
|
4181 | return baseUrl;
|
4182 | }
|
4183 | if (StringExtensions.isNullOrUndefinedOrWhiteSpaceString(baseUrl)) {
|
4184 | return path;
|
4185 | }
|
4186 | var finalUrl = baseUrl;
|
4187 | if (finalUrl.charAt(finalUrl.length - 1) === '/') {
|
4188 | if (path.charAt(0) === '/')
|
4189 | path = path.slice(1);
|
4190 | }
|
4191 | else {
|
4192 | if (path.charAt(0) !== '/')
|
4193 | path = '/' + path;
|
4194 | }
|
4195 | return finalUrl + path;
|
4196 | };
|
4197 | Utility.getAbsoluteUri = function (path) {
|
4198 | Utility.throwIfNullOrUndefined(path, null, "getAbsoluteUri", "path");
|
4199 | var url = path;
|
4200 |
|
4201 | if (url && url.indexOf('http') === -1) {
|
4202 | url = Utility.urlCombine(clusterUri, url);
|
4203 | }
|
4204 | return url;
|
4205 | };
|
4206 | Utility.getStaticResourceUri = function (path) {
|
4207 | Utility.throwIfNullOrUndefined(path, null, "getStaticResourceUri", "path");
|
4208 | var url = path;
|
4209 |
|
4210 | if (url && url.indexOf('http') === -1) {
|
4211 | url = jsCommon.Utility.urlCombine(Utility.staticContentLocation, url);
|
4212 | }
|
4213 | return url;
|
4214 | };
|
4215 | Utility.getComponentName = function (context) {
|
4216 | return !context ? '' : (typeof context).toString() + '.';
|
4217 | };
|
4218 | Utility.throwException = function (e) {
|
4219 | jsCommon.Trace.error(StringExtensions.format("Throwing exception: {0}", JSON.stringify(e)),
|
4220 | e.stack != null ? false : true);
|
4221 | throw e;
|
4222 | };
|
4223 | Utility.createClassSelector = function (className) {
|
4224 | Utility.throwIfNullOrEmptyString(className, null, 'CreateClassSelector', 'className');
|
4225 | return '.' + className;
|
4226 | };
|
4227 | Utility.createIdSelector = function (id) {
|
4228 | Utility.throwIfNullOrEmptyString(id, null, 'CreateIdSelector', 'id');
|
4229 | return '#' + id;
|
4230 | };
|
4231 | |
4232 |
|
4233 |
|
4234 |
|
4235 | Utility.generateGuid = function () {
|
4236 | var guid = "", idx = 0;
|
4237 | for (idx = 0; idx < 32; idx += 1) {
|
4238 | var guidDigitsItem = Math.random() * 16 | 0;
|
4239 | switch (idx) {
|
4240 | case 8:
|
4241 | case 12:
|
4242 | case 16:
|
4243 | case 20:
|
4244 | guid += "-";
|
4245 | break;
|
4246 | }
|
4247 | guid += guidDigitsItem.toString(16);
|
4248 | }
|
4249 | return guid;
|
4250 | };
|
4251 | |
4252 |
|
4253 |
|
4254 | Utility.getCookieValue = function (key) {
|
4255 |
|
4256 |
|
4257 | var keyValuePairs = document.cookie.split(';');
|
4258 | for (var i = 0; i < keyValuePairs.length; i++) {
|
4259 | var keyValue = keyValuePairs[i];
|
4260 | var split = keyValue.split('=');
|
4261 | if (split.length > 0 && split[0].trim() === key) {
|
4262 | return keyValue.substr(keyValue.indexOf('=') + 1);
|
4263 | }
|
4264 | }
|
4265 | return null;
|
4266 | };
|
4267 | |
4268 |
|
4269 |
|
4270 |
|
4271 |
|
4272 | Utility.getDomainForUrl = function (url) {
|
4273 | var hrefObject = Utility.getHrefObjectFromUrl(url);
|
4274 | return hrefObject.prop('protocol') + '//' + hrefObject.prop('hostname');
|
4275 | };
|
4276 | |
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 | Utility.getHostNameForUrl = function (url) {
|
4282 | var hrefObject = Utility.getHrefObjectFromUrl(url);
|
4283 | return Utility.urlCombine(hrefObject.prop('hostname'), hrefObject.prop('pathname'));
|
4284 | };
|
4285 | |
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 | Utility.getUrlWithoutQueryString = function (url) {
|
4291 | var hrefObject = Utility.getHrefObjectFromUrl(url);
|
4292 | return hrefObject.prop('protocol') + '//' + Utility.urlCombine(hrefObject.prop('host'), hrefObject.prop('pathname'));
|
4293 | };
|
4294 | |
4295 |
|
4296 |
|
4297 |
|
4298 |
|
4299 | Utility.getProtocolFromUrl = function (url) {
|
4300 | return Utility.getHrefObjectFromUrl(url).prop('protocol').replace(':', '');
|
4301 | };
|
4302 | |
4303 |
|
4304 |
|
4305 |
|
4306 |
|
4307 | Utility.getHrefObjectFromUrl = function (url) {
|
4308 | var aObject = $('<a>');
|
4309 | aObject = aObject.prop('href', url);
|
4310 | return aObject;
|
4311 | };
|
4312 | |
4313 |
|
4314 |
|
4315 |
|
4316 |
|
4317 | Utility.convertWcfToJsDictionary = function (wcfDictionary) {
|
4318 |
|
4319 |
|
4320 |
|
4321 |
|
4322 | var result = {};
|
4323 | for (var i = 0; i < wcfDictionary.length; i++) {
|
4324 | var keyValuePair = wcfDictionary[i];
|
4325 | result[keyValuePair['Key']] = keyValuePair['Value'];
|
4326 | }
|
4327 | return result;
|
4328 | };
|
4329 | Utility.getDateFromWcfJsonString = function (jsonDate, fromUtcMilliseconds) {
|
4330 | if (StringExtensions.isNullOrEmpty(jsonDate)) {
|
4331 | return null;
|
4332 | }
|
4333 | var begIndex = jsonDate.indexOf('(');
|
4334 | var endIndex = jsonDate.indexOf(')');
|
4335 | if (begIndex !== -1 && endIndex !== -1) {
|
4336 | var milliseconds = parseInt(jsonDate.substring(begIndex + 1, endIndex), 10);
|
4337 | if (fromUtcMilliseconds) {
|
4338 | return new Date(milliseconds);
|
4339 | }
|
4340 | else {
|
4341 | var retValue = new Date(0);
|
4342 | retValue.setUTCMilliseconds(milliseconds);
|
4343 | return retValue;
|
4344 | }
|
4345 | }
|
4346 | return null;
|
4347 | };
|
4348 | |
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 | Utility.getOuterHtml = function (content) {
|
4354 | return $('<div>').append(content).html();
|
4355 | };
|
4356 | |
4357 |
|
4358 |
|
4359 |
|
4360 |
|
4361 |
|
4362 | Utility.compareInt = function (a, b) {
|
4363 | return a - b;
|
4364 | };
|
4365 | |
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 | Utility.getIndexOfMinValue = function (a) {
|
4371 | var retValue = 0;
|
4372 | var currentMinValue = a[0];
|
4373 | for (var i = 0; i < a.length; i++) {
|
4374 | if (a[i] < currentMinValue) {
|
4375 | currentMinValue = a[i];
|
4376 | retValue = i;
|
4377 | }
|
4378 | }
|
4379 | return retValue;
|
4380 | };
|
4381 | |
4382 |
|
4383 |
|
4384 |
|
4385 |
|
4386 | Utility.extractUrlFromCssBackgroundImage = function (input) {
|
4387 | return input.replace(/"/g, "").replace(/url\(|\)$/ig, "");
|
4388 | };
|
4389 | |
4390 |
|
4391 |
|
4392 | Utility.isValidImageDataUrl = function (url) {
|
4393 | var regex = new RegExp('data:(image\/(png|jpg|jpeg|gif|svg))');
|
4394 | return regex.test(url);
|
4395 | };
|
4396 | Utility.isLocalUrl = function (url) {
|
4397 | return _.startsWith(url, "data:") || _.startsWith(url, "blob:");
|
4398 | };
|
4399 | |
4400 |
|
4401 |
|
4402 |
|
4403 |
|
4404 | Utility.saveAsFile = function (content, fileName) {
|
4405 | var contentBlob = new Blob([content], { type: HttpConstants.ApplicationOctetStream });
|
4406 | var url = window['webkitURL'] || URL;
|
4407 | var urlLink = url.createObjectURL(contentBlob);
|
4408 | var fileNameLink = fileName || urlLink;
|
4409 |
|
4410 | if (window.navigator.msSaveOrOpenBlob) {
|
4411 | window.navigator.msSaveOrOpenBlob(contentBlob, fileNameLink);
|
4412 | return;
|
4413 | }
|
4414 |
|
4415 |
|
4416 |
|
4417 | var hyperlink = document.createElement('a');
|
4418 | hyperlink.href = urlLink;
|
4419 | hyperlink.target = '_blank';
|
4420 | hyperlink['download'] = fileNameLink;
|
4421 | document.body.appendChild(hyperlink);
|
4422 | hyperlink.click();
|
4423 | document.body.removeChild(hyperlink);
|
4424 | };
|
4425 | |
4426 |
|
4427 |
|
4428 |
|
4429 |
|
4430 | Utility.getType = function (obj) {
|
4431 | Utility.throwIfNullEmptyOrWhitespaceString(obj.__type, this, 'getType', 'obj');
|
4432 | var parts = obj.__type.split(":");
|
4433 | if (parts.length !== 2) {
|
4434 | jsCommon.Errors.argument("obj.__type", "Type String not in expected format [Type]#[Namespace]: " + obj.__type);
|
4435 | }
|
4436 | if (parts[1] !== Utility.TypeNamespace) {
|
4437 | jsCommon.Errors.argument("obj.__type", "Type Namespace not expected: " + parts[1]);
|
4438 | }
|
4439 | return parts[0];
|
4440 | };
|
4441 | |
4442 |
|
4443 |
|
4444 |
|
4445 |
|
4446 |
|
4447 | Utility.isEventSupported = function (eventName, element) {
|
4448 | eventName = 'on' + eventName;
|
4449 | var isSupported = (eventName in element);
|
4450 | if (!isSupported) {
|
4451 |
|
4452 | if (!element.setAttribute) {
|
4453 | element = document.createElement('div');
|
4454 | }
|
4455 | if (element.setAttribute && element.removeAttribute) {
|
4456 | element.setAttribute(eventName, '');
|
4457 | isSupported = typeof element[eventName] === 'function';
|
4458 |
|
4459 | if (typeof element[eventName] !== 'undefined') {
|
4460 | element[eventName] = null;
|
4461 | }
|
4462 | element.removeAttribute(eventName);
|
4463 | }
|
4464 | }
|
4465 | element = null;
|
4466 | return isSupported;
|
4467 | };
|
4468 | Utility.toPixel = function (pixelAmount) {
|
4469 | Utility.throwIfNullOrUndefined(pixelAmount, this, "toPixel", "pixelAmount");
|
4470 | return pixelAmount.toString() + jsCommon.CssConstants.pixelUnits;
|
4471 | };
|
4472 | Utility.getPropertyCount = function (object) {
|
4473 | Utility.throwIfNullOrUndefined(object, this, "getPropertyCount", "object");
|
4474 | return Object.getOwnPropertyNames(object).length;
|
4475 | };
|
4476 | |
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 | Utility.getFileExtension = function (filePath) {
|
4482 | if (filePath) {
|
4483 | var index = filePath.lastIndexOf('.');
|
4484 | if (index >= 0)
|
4485 | return filePath.substr(index + 1);
|
4486 | }
|
4487 | return '';
|
4488 | };
|
4489 | |
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 | Utility.extractFileNameFromPath = function (filePath) {
|
4495 | return filePath.replace(/^.*[\\\/]/, '');
|
4496 | };
|
4497 | |
4498 |
|
4499 |
|
4500 |
|
4501 |
|
4502 |
|
4503 |
|
4504 | Utility.canUseClipboard = function () {
|
4505 | return (typeof MSApp === "undefined");
|
4506 | };
|
4507 | Utility.is64BitOperatingSystem = function () {
|
4508 | return navigator.userAgent.indexOf("WOW64") !== -1 ||
|
4509 | navigator.userAgent.indexOf("Win64") !== -1;
|
4510 | };
|
4511 | Utility.parseNumber = function (value, defaultValue) {
|
4512 | if (value === null)
|
4513 | return null;
|
4514 | if (value === undefined)
|
4515 | return defaultValue;
|
4516 | var result = Number(value);
|
4517 | if (isFinite(result))
|
4518 | return result;
|
4519 | if (isNaN(result) && !(typeof value === "number" || value === "NaN"))
|
4520 | return defaultValue;
|
4521 | return result;
|
4522 | };
|
4523 | Utility.getURLParamValue = function (name) {
|
4524 | var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
|
4525 | if (results == null) {
|
4526 | return null;
|
4527 | }
|
4528 | else {
|
4529 | return results[1] || 0;
|
4530 | }
|
4531 | };
|
4532 | |
4533 |
|
4534 |
|
4535 |
|
4536 |
|
4537 |
|
4538 |
|
4539 | Utility.getLocalTimeZoneString = function () {
|
4540 | var timeSummer = new Date(Date.UTC(2005, 6, 30, 0, 0, 0, 0));
|
4541 | var summerOffset = -1 * timeSummer.getTimezoneOffset();
|
4542 | var timeWinter = new Date(Date.UTC(2005, 12, 30, 0, 0, 0, 0));
|
4543 | var winterOffset = -1 * timeWinter.getTimezoneOffset();
|
4544 | var localTimeZoneString;
|
4545 | if (-720 === summerOffset && -720 === winterOffset) {
|
4546 | localTimeZoneString = 'Dateline Standard Time';
|
4547 | }
|
4548 | else if (-660 === summerOffset && -660 === winterOffset) {
|
4549 | localTimeZoneString = 'UTC-11';
|
4550 | }
|
4551 | else if (-660 === summerOffset && -660 === winterOffset) {
|
4552 | localTimeZoneString = 'Samoa Standard Time';
|
4553 | }
|
4554 | else if (-600 === summerOffset && -600 === winterOffset) {
|
4555 | localTimeZoneString = 'Hawaiian Standard Time';
|
4556 | }
|
4557 | else if (-480 === summerOffset && -540 === winterOffset) {
|
4558 | localTimeZoneString = 'Alaskan Standard Time';
|
4559 | }
|
4560 | else if (-420 === summerOffset && -480 === winterOffset) {
|
4561 | localTimeZoneString = 'Pacific Standard Time';
|
4562 | }
|
4563 | else if (-420 === summerOffset && -420 === winterOffset) {
|
4564 | localTimeZoneString = 'US Mountain Standard Time';
|
4565 | }
|
4566 | else if (-360 === summerOffset && -420 === winterOffset) {
|
4567 | localTimeZoneString = 'Mountain Standard Time';
|
4568 | }
|
4569 | else if (-360 === summerOffset && -360 === winterOffset) {
|
4570 | localTimeZoneString = 'Central America Standard Time';
|
4571 | }
|
4572 | else if (-300 === summerOffset && -360 === winterOffset) {
|
4573 | localTimeZoneString = 'Central Standard Time';
|
4574 | }
|
4575 | else if (-300 === summerOffset && -300 === winterOffset) {
|
4576 | localTimeZoneString = 'SA Pacific Standard Time';
|
4577 | }
|
4578 | else if (-240 === summerOffset && -300 === winterOffset) {
|
4579 | localTimeZoneString = 'Eastern Standard Time';
|
4580 | }
|
4581 | else if (-270 === summerOffset && -270 === winterOffset) {
|
4582 | localTimeZoneString = 'Venezuela Standard Time';
|
4583 | }
|
4584 | else if (-240 === summerOffset && -240 === winterOffset) {
|
4585 | localTimeZoneString = 'SA Western Standard Time';
|
4586 | }
|
4587 | else if (-240 === summerOffset && -180 === winterOffset) {
|
4588 | localTimeZoneString = 'Central Brazilian Standard Time';
|
4589 | }
|
4590 | else if (-180 === summerOffset && -240 === winterOffset) {
|
4591 | localTimeZoneString = 'Atlantic Standard Time';
|
4592 | }
|
4593 | else if (-180 === summerOffset && -180 === winterOffset) {
|
4594 | localTimeZoneString = 'Montevideo Standard Time';
|
4595 | }
|
4596 | else if (-180 === summerOffset && -120 === winterOffset) {
|
4597 | localTimeZoneString = 'E. South America Standard Time';
|
4598 | }
|
4599 | else if (-150 === summerOffset && -210 === winterOffset) {
|
4600 | localTimeZoneString = 'Mid-Atlantic Standard Time';
|
4601 | }
|
4602 | else if (-120 === summerOffset && -120 === winterOffset) {
|
4603 | localTimeZoneString = 'SA Eastern Standard Time';
|
4604 | }
|
4605 | else if (0 === summerOffset && 0 === winterOffset) {
|
4606 | localTimeZoneString = 'UTC';
|
4607 | }
|
4608 | else if (60 === summerOffset && 0 === winterOffset) {
|
4609 | localTimeZoneString = 'GMT Standard Time';
|
4610 | }
|
4611 | else if (60 === summerOffset && 120 === winterOffset) {
|
4612 | localTimeZoneString = 'Namibia Standard Time';
|
4613 | }
|
4614 | else if (120 === summerOffset && 60 === winterOffset) {
|
4615 | localTimeZoneString = 'Romance Standard Time';
|
4616 | }
|
4617 | else if (120 === summerOffset && 120 === winterOffset) {
|
4618 | localTimeZoneString = 'South Africa Standard Time';
|
4619 | }
|
4620 | else if (180 === summerOffset && 120 === winterOffset) {
|
4621 | localTimeZoneString = 'GTB Standard Time';
|
4622 | }
|
4623 | else if (180 === summerOffset && 180 === winterOffset) {
|
4624 | localTimeZoneString = 'E. Africa Standard Time';
|
4625 | }
|
4626 | else if (240 === summerOffset && 180 === winterOffset) {
|
4627 | localTimeZoneString = 'Russian Standard Time';
|
4628 | }
|
4629 | else if (240 === summerOffset && 240 === winterOffset) {
|
4630 | localTimeZoneString = 'Arabian Standard Time';
|
4631 | }
|
4632 | else if (270 === summerOffset && 210 === winterOffset) {
|
4633 | localTimeZoneString = 'Iran Standard Time';
|
4634 | }
|
4635 | else if (270 === summerOffset && 270 === winterOffset) {
|
4636 | localTimeZoneString = 'Afghanistan Standard Time';
|
4637 | }
|
4638 | else if (300 === summerOffset && 240 === winterOffset) {
|
4639 | localTimeZoneString = 'Pakistan Standard Time';
|
4640 | }
|
4641 | else if (300 === summerOffset && 300 === winterOffset) {
|
4642 | localTimeZoneString = 'West Asia Standard Time';
|
4643 | }
|
4644 | else if (330 === summerOffset && 330 === winterOffset) {
|
4645 | localTimeZoneString = 'India Standard Time';
|
4646 | }
|
4647 | else if (345 === summerOffset && 345 === winterOffset) {
|
4648 | localTimeZoneString = 'Nepal Standard Time';
|
4649 | }
|
4650 | else if (360 === summerOffset && 300 === winterOffset) {
|
4651 | localTimeZoneString = 'N. Central Asia Standard Time';
|
4652 | }
|
4653 | else if (360 === summerOffset && 360 === winterOffset) {
|
4654 | localTimeZoneString = 'Central Asia Standard Time';
|
4655 | }
|
4656 | else if (390 === summerOffset && 390 === winterOffset) {
|
4657 | localTimeZoneString = 'Myanmar Standard Time';
|
4658 | }
|
4659 | else if (420 === summerOffset && 360 === winterOffset) {
|
4660 | localTimeZoneString = 'North Asia Standard Time';
|
4661 | }
|
4662 | else if (420 === summerOffset && 420 === winterOffset) {
|
4663 | localTimeZoneString = 'SE Asia Standard Time';
|
4664 | }
|
4665 | else if (480 === summerOffset && 420 === winterOffset) {
|
4666 | localTimeZoneString = 'North Asia East Standard Time';
|
4667 | }
|
4668 | else if (480 === summerOffset && 480 === winterOffset) {
|
4669 | localTimeZoneString = 'China Standard Time';
|
4670 | }
|
4671 | else if (540 === summerOffset && 480 === winterOffset) {
|
4672 | localTimeZoneString = 'Yakutsk Standard Time';
|
4673 | }
|
4674 | else if (540 === summerOffset && 540 === winterOffset) {
|
4675 | localTimeZoneString = 'Tokyo Standard Time';
|
4676 | }
|
4677 | else if (570 === summerOffset && 570 === winterOffset) {
|
4678 | localTimeZoneString = 'Cen. Australia Standard Time';
|
4679 | }
|
4680 | else if (600 === summerOffset && 600 === winterOffset) {
|
4681 | localTimeZoneString = 'E. Australia Standard Time';
|
4682 | }
|
4683 | else if (600 === summerOffset && 660 === winterOffset) {
|
4684 | localTimeZoneString = 'AUS Eastern Standard Time';
|
4685 | }
|
4686 | else if (660 === summerOffset && 600 === winterOffset) {
|
4687 | localTimeZoneString = 'Tasmania Standard Time';
|
4688 | }
|
4689 | else if (660 === summerOffset && 660 === winterOffset) {
|
4690 | localTimeZoneString = 'West Pacific Standard Time';
|
4691 | }
|
4692 | else if (690 === summerOffset && 690 === winterOffset) {
|
4693 | localTimeZoneString = 'Central Pacific Standard Time';
|
4694 | }
|
4695 | else if (720 === summerOffset && 660 === winterOffset) {
|
4696 | localTimeZoneString = 'Magadan Standard Time';
|
4697 | }
|
4698 | else if (720 === summerOffset && 720 === winterOffset) {
|
4699 | localTimeZoneString = 'Fiji Standard Time';
|
4700 | }
|
4701 | else if (720 === summerOffset && 780 === winterOffset) {
|
4702 | localTimeZoneString = 'New Zealand Standard Time';
|
4703 | }
|
4704 | else if (780 === summerOffset && 780 === winterOffset) {
|
4705 | localTimeZoneString = 'Tonga Standard Time';
|
4706 | }
|
4707 | else {
|
4708 | localTimeZoneString = 'UTC';
|
4709 | }
|
4710 | return localTimeZoneString;
|
4711 | };
|
4712 | Utility.TypeNamespace = 'http://schemas.microsoft.com/sqlbi/2013/01/NLRuntimeService';
|
4713 | Utility.JsonContentType = 'application/json';
|
4714 | Utility.JpegContentType = 'image/jpeg';
|
4715 | Utility.XJavascriptContentType = 'application/x-javascript';
|
4716 | Utility.JsonDataType = 'json';
|
4717 | Utility.BlobDataType = 'blob';
|
4718 | Utility.HttpGetMethod = 'GET';
|
4719 | Utility.HttpPostMethod = 'POST';
|
4720 | Utility.HttpPutMethod = 'PUT';
|
4721 | Utility.HttpDeleteMethod = 'DELETE';
|
4722 | Utility.HttpContentTypeHeader = 'Content-Type';
|
4723 | Utility.HttpAcceptHeader = 'Accept';
|
4724 | Utility.Undefined = 'undefined';
|
4725 | Utility.staticContentLocation = window.location.protocol + '//' + window.location.host;
|
4726 | return Utility;
|
4727 | }());
|
4728 | jsCommon.Utility = Utility;
|
4729 | var VersionUtility = (function () {
|
4730 | function VersionUtility() {
|
4731 | }
|
4732 | |
4733 |
|
4734 |
|
4735 |
|
4736 |
|
4737 |
|
4738 | VersionUtility.compareVersions = function (versionA, versionB) {
|
4739 | var a = versionA.split('.').map(parseFloat);
|
4740 | var b = versionB.split('.').map(parseFloat);
|
4741 | var versionParts = Math.max(a.length, b.length);
|
4742 | for (var i = 0; i < versionParts; i++) {
|
4743 | var partA = a[i] || 0;
|
4744 | var partB = b[i] || 0;
|
4745 | if (partA > partB)
|
4746 | return 1;
|
4747 | if (partA < partB)
|
4748 | return -1;
|
4749 | }
|
4750 | return 0;
|
4751 | };
|
4752 | return VersionUtility;
|
4753 | }());
|
4754 | jsCommon.VersionUtility = VersionUtility;
|
4755 | var PerformanceUtil;
|
4756 | (function (PerformanceUtil) {
|
4757 | var PerfMarker = (function () {
|
4758 | function PerfMarker(name) {
|
4759 | this._name = name;
|
4760 | this._start = PerfMarker.begin(name);
|
4761 | }
|
4762 | PerfMarker.begin = function (name) {
|
4763 | if (window.performance === undefined || performance.mark === undefined)
|
4764 | return;
|
4765 | if (console.time) {
|
4766 | console.time(name);
|
4767 | }
|
4768 | name = 'Begin ' + name;
|
4769 | performance.mark(name);
|
4770 | return name;
|
4771 | };
|
4772 | PerfMarker.prototype.end = function () {
|
4773 | if (window.performance === undefined || performance.mark === undefined || performance.measure === undefined)
|
4774 | return;
|
4775 | var name = this._name;
|
4776 | var end = 'End ' + name;
|
4777 | performance.mark(end);
|
4778 | performance.measure(name, this._start, end);
|
4779 | if (console.timeEnd) {
|
4780 | console.timeEnd(name);
|
4781 | }
|
4782 | };
|
4783 | return PerfMarker;
|
4784 | }());
|
4785 | PerformanceUtil.PerfMarker = PerfMarker;
|
4786 | function create(name) {
|
4787 | return new PerfMarker(name);
|
4788 | }
|
4789 | PerformanceUtil.create = create;
|
4790 | })(PerformanceUtil = jsCommon.PerformanceUtil || (jsCommon.PerformanceUtil = {}));
|
4791 | var DeferUtility;
|
4792 | (function (DeferUtility) {
|
4793 | |
4794 |
|
4795 |
|
4796 |
|
4797 |
|
4798 |
|
4799 | function deferUntilNextFrame(callback) {
|
4800 | var isWaiting, args, context;
|
4801 | if (!window.requestAnimationFrame) {
|
4802 | window.requestAnimationFrame = function (func) { return setTimeout(func, 1000 / 50); };
|
4803 | }
|
4804 | return function () {
|
4805 | if (!isWaiting) {
|
4806 | isWaiting = true;
|
4807 | args = arguments;
|
4808 | context = this;
|
4809 | window.requestAnimationFrame(function () {
|
4810 | isWaiting = false;
|
4811 | callback.apply(context, args);
|
4812 | });
|
4813 | }
|
4814 | };
|
4815 | }
|
4816 | DeferUtility.deferUntilNextFrame = deferUntilNextFrame;
|
4817 | })(DeferUtility = jsCommon.DeferUtility || (jsCommon.DeferUtility = {}));
|
4818 | })(jsCommon || (jsCommon = {}));
|
4819 |
|
4820 |
|
4821 |
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 |
|
4834 |
|
4835 |
|
4836 |
|
4837 |
|
4838 |
|
4839 |
|
4840 |
|
4841 |
|
4842 |
|
4843 |
|
4844 | var jsCommon;
|
4845 | (function (jsCommon) {
|
4846 | var TraceItem = (function () {
|
4847 | function TraceItem(text, type, sessionId, requestId) {
|
4848 | this.text = text;
|
4849 | this.type = type;
|
4850 | this.sessionId = sessionId;
|
4851 | this.requestId = requestId;
|
4852 | this.timeStamp = new Date();
|
4853 | }
|
4854 | TraceItem.prototype.toString = function () {
|
4855 | var resultString = '';
|
4856 | resultString += (jsCommon.StringExtensions.format('{0} ({1}): {2}', TraceItem.traceTypeStrings[this.type], this.timeStamp.toUTCString(), this.text));
|
4857 | if (this.requestId)
|
4858 | resultString += ('\n(Request id: ' + this.requestId + ')');
|
4859 | return resultString;
|
4860 | };
|
4861 | TraceItem.traceTypeStrings = [
|
4862 | 'INFORMATION',
|
4863 | 'VERBOSE',
|
4864 | 'WARNING',
|
4865 | 'ERROR',
|
4866 | 'EXPECTEDERROR',
|
4867 | 'UNEXPECTEDERROR',
|
4868 | 'FATAL',
|
4869 | ];
|
4870 | return TraceItem;
|
4871 | }());
|
4872 | jsCommon.TraceItem = TraceItem;
|
4873 | })(jsCommon || (jsCommon = {}));
|
4874 |
|
4875 |
|
4876 |
|
4877 |
|
4878 |
|
4879 |
|
4880 |
|
4881 |
|
4882 |
|
4883 |
|
4884 |
|
4885 |
|
4886 |
|
4887 |
|
4888 |
|
4889 |
|
4890 |
|
4891 |
|
4892 |
|
4893 |
|
4894 |
|
4895 |
|
4896 |
|
4897 |
|
4898 |
|
4899 | var jsCommon;
|
4900 | (function (jsCommon) {
|
4901 | var UrlUtils;
|
4902 | (function (UrlUtils) {
|
4903 | var urlRegex = /http[s]?:\/\/(\S)+/gi;
|
4904 | function isValidUrl(value) {
|
4905 | if (jsCommon.StringExtensions.isNullOrEmpty(value))
|
4906 | return false;
|
4907 | var match = jsCommon.RegExpExtensions.run(urlRegex, value);
|
4908 | if (!!match && match.index === 0)
|
4909 | return true;
|
4910 | return false;
|
4911 | }
|
4912 | UrlUtils.isValidUrl = isValidUrl;
|
4913 | |
4914 |
|
4915 |
|
4916 |
|
4917 | function isValidImageUrl(url) {
|
4918 |
|
4919 |
|
4920 | return isValidUrl(url);
|
4921 | }
|
4922 | UrlUtils.isValidImageUrl = isValidImageUrl;
|
4923 | function findAllValidUrls(text) {
|
4924 | if (jsCommon.StringExtensions.isNullOrEmpty(text))
|
4925 | return [];
|
4926 |
|
4927 |
|
4928 | var urlRanges = [];
|
4929 | var matches;
|
4930 | var start = 0;
|
4931 | while ((matches = jsCommon.RegExpExtensions.run(urlRegex, text, start)) !== null) {
|
4932 | var url = matches[0];
|
4933 | var end = matches.index + url.length;
|
4934 | urlRanges.push({
|
4935 | start: matches.index,
|
4936 | end: end,
|
4937 | text: url,
|
4938 | });
|
4939 | start = end;
|
4940 | }
|
4941 | return urlRanges;
|
4942 | }
|
4943 | UrlUtils.findAllValidUrls = findAllValidUrls;
|
4944 | function getBase64ContentFromDataUri(uri) {
|
4945 | if (uri.indexOf('data:') !== 0)
|
4946 | throw new Error("Expected data uri");
|
4947 |
|
4948 | var base64Token = ";base64,";
|
4949 | var indexBase64TokenStart = uri.indexOf(base64Token);
|
4950 | if (indexBase64TokenStart < 0)
|
4951 | throw new Error("Expected base 64 content in data url");
|
4952 | var indexBase64Start = indexBase64TokenStart + base64Token.length;
|
4953 | return uri.substr(indexBase64Start, uri.length - indexBase64Start);
|
4954 | }
|
4955 | UrlUtils.getBase64ContentFromDataUri = getBase64ContentFromDataUri;
|
4956 | })(UrlUtils = jsCommon.UrlUtils || (jsCommon.UrlUtils = {}));
|
4957 | })(jsCommon || (jsCommon = {}));
|
4958 |
|
4959 |
|
4960 |
|
4961 |
|
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 |
|
4967 |
|
4968 |
|
4969 |
|
4970 |
|
4971 |
|
4972 |
|
4973 |
|
4974 |
|
4975 |
|
4976 |
|
4977 |
|
4978 |
|
4979 |
|
4980 |
|
4981 |
|
4982 |
|
4983 | var jsCommon;
|
4984 | (function (jsCommon) {
|
4985 | var BrowserUtils;
|
4986 | (function (BrowserUtils) {
|
4987 | function isChrome() {
|
4988 | var vendorName = window.navigator.vendor || "";
|
4989 | var userAgent = window.navigator.userAgent.toLowerCase();
|
4990 | return vendorName.toLowerCase().indexOf('google') > -1 &&
|
4991 | userAgent.indexOf('chrome') > -1 &&
|
4992 | userAgent.indexOf('edge') === -1 &&
|
4993 | userAgent.indexOf('opr') === -1;
|
4994 | }
|
4995 | BrowserUtils.isChrome = isChrome;
|
4996 | function isInternetExplorerOrEdge() {
|
4997 | var userAgent = window.navigator.userAgent.toLowerCase();
|
4998 | return userAgent.indexOf('msie') > -1
|
4999 | || userAgent.indexOf('trident') > -1
|
5000 | || userAgent.indexOf('edge') > -1;
|
5001 | }
|
5002 | BrowserUtils.isInternetExplorerOrEdge = isInternetExplorerOrEdge;
|
5003 | |
5004 |
|
5005 |
|
5006 |
|
5007 | function getInternetExplorerVersion() {
|
5008 | var retValue = 0;
|
5009 | if (navigator.appName === 'Microsoft Internet Explorer' || window.navigator.userAgent.indexOf('MSIE') >= 0) {
|
5010 | var re = new RegExp('MSIE ([0-9]{1,}[\\.0-9]{0,})');
|
5011 | var result = re.exec(window.navigator.userAgent);
|
5012 | if (result) {
|
5013 | retValue = parseFloat(result[1]);
|
5014 | }
|
5015 | }
|
5016 | return retValue;
|
5017 | }
|
5018 | BrowserUtils.getInternetExplorerVersion = getInternetExplorerVersion;
|
5019 | })(BrowserUtils = jsCommon.BrowserUtils || (jsCommon.BrowserUtils = {}));
|
5020 | })(jsCommon || (jsCommon = {}));
|
5021 |
|
5022 |
|
5023 |
|
5024 |
|
5025 |
|
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 |
|
5031 |
|
5032 |
|
5033 |
|
5034 |
|
5035 |
|
5036 |
|
5037 |
|
5038 |
|
5039 |
|
5040 |
|
5041 |
|
5042 |
|
5043 |
|
5044 |
|
5045 |
|
5046 | var jsCommon;
|
5047 | (function (jsCommon) {
|
5048 | |
5049 |
|
5050 |
|
5051 | var EnumExtensions;
|
5052 | (function (EnumExtensions) {
|
5053 | |
5054 |
|
5055 |
|
5056 | function hasFlag(value, flag) {
|
5057 | debug.assert(!!flag, 'flag must be specified and nonzero.');
|
5058 | return (value & flag) === flag;
|
5059 | }
|
5060 | EnumExtensions.hasFlag = hasFlag;
|
5061 | |
5062 |
|
5063 |
|
5064 | function setFlag(value, flag) {
|
5065 | debug.assert(!!flag, "flag must be specified and nonzero.");
|
5066 | return value |= flag;
|
5067 | }
|
5068 | EnumExtensions.setFlag = setFlag;
|
5069 | |
5070 |
|
5071 |
|
5072 | function resetFlag(value, flag) {
|
5073 | debug.assert(!!flag, "flag must be specified and nonzero.");
|
5074 | return value &= ~flag;
|
5075 | }
|
5076 | EnumExtensions.resetFlag = resetFlag;
|
5077 | |
5078 |
|
5079 |
|
5080 | function toString(enumType, value) {
|
5081 | return enumType[value];
|
5082 | }
|
5083 | EnumExtensions.toString = toString;
|
5084 | })(EnumExtensions = jsCommon.EnumExtensions || (jsCommon.EnumExtensions = {}));
|
5085 | |
5086 |
|
5087 |
|
5088 | var StringExtensions;
|
5089 | (function (StringExtensions) {
|
5090 | |
5091 |
|
5092 |
|
5093 | function endsWith(str, suffix) {
|
5094 | debug.assertValue(str, 'str');
|
5095 | debug.assertValue(suffix, 'suffix');
|
5096 | return str.indexOf(suffix, str.length - suffix.length) !== -1;
|
5097 | }
|
5098 | StringExtensions.endsWith = endsWith;
|
5099 | })(StringExtensions = jsCommon.StringExtensions || (jsCommon.StringExtensions = {}));
|
5100 | var LogicExtensions;
|
5101 | (function (LogicExtensions) {
|
5102 | function XOR(a, b) {
|
5103 | return (a || b) && !(a && b);
|
5104 | }
|
5105 | LogicExtensions.XOR = XOR;
|
5106 | })(LogicExtensions = jsCommon.LogicExtensions || (jsCommon.LogicExtensions = {}));
|
5107 | var JsonComparer;
|
5108 | (function (JsonComparer) {
|
5109 | |
5110 |
|
5111 |
|
5112 | function equals(x, y) {
|
5113 | if (x === y)
|
5114 | return true;
|
5115 | return JSON.stringify(x) === JSON.stringify(y);
|
5116 | }
|
5117 | JsonComparer.equals = equals;
|
5118 | })(JsonComparer = jsCommon.JsonComparer || (jsCommon.JsonComparer = {}));
|
5119 | |
5120 |
|
5121 |
|
5122 |
|
5123 | var TextSizeDefaults;
|
5124 | (function (TextSizeDefaults) {
|
5125 | |
5126 |
|
5127 |
|
5128 |
|
5129 | TextSizeDefaults.TextSizeMin = 8;
|
5130 | |
5131 |
|
5132 |
|
5133 |
|
5134 | TextSizeDefaults.TextSizeMax = 40;
|
5135 | var TextSizeRange = TextSizeDefaults.TextSizeMax - TextSizeDefaults.TextSizeMin;
|
5136 | |
5137 |
|
5138 |
|
5139 |
|
5140 | function getScale(textSize) {
|
5141 | return (textSize - TextSizeDefaults.TextSizeMin) / TextSizeRange;
|
5142 | }
|
5143 | TextSizeDefaults.getScale = getScale;
|
5144 | })(TextSizeDefaults = jsCommon.TextSizeDefaults || (jsCommon.TextSizeDefaults = {}));
|
5145 | var PixelConverter;
|
5146 | (function (PixelConverter) {
|
5147 | var PxPtRatio = 4 / 3;
|
5148 | var PixelString = 'px';
|
5149 | |
5150 |
|
5151 |
|
5152 | function toString(px) {
|
5153 | return px + PixelString;
|
5154 | }
|
5155 | PixelConverter.toString = toString;
|
5156 | |
5157 |
|
5158 |
|
5159 |
|
5160 |
|
5161 | function fromPoint(pt) {
|
5162 | return toString(fromPointToPixel(pt));
|
5163 | }
|
5164 | PixelConverter.fromPoint = fromPoint;
|
5165 | |
5166 |
|
5167 |
|
5168 |
|
5169 |
|
5170 | function fromPointToPixel(pt) {
|
5171 | return (PxPtRatio * pt);
|
5172 | }
|
5173 | PixelConverter.fromPointToPixel = fromPointToPixel;
|
5174 | |
5175 |
|
5176 |
|
5177 |
|
5178 | function toPoint(px) {
|
5179 | return px / PxPtRatio;
|
5180 | }
|
5181 | PixelConverter.toPoint = toPoint;
|
5182 | })(PixelConverter = jsCommon.PixelConverter || (jsCommon.PixelConverter = {}));
|
5183 | var RegExpExtensions;
|
5184 | (function (RegExpExtensions) {
|
5185 | |
5186 |
|
5187 |
|
5188 |
|
5189 |
|
5190 |
|
5191 |
|
5192 |
|
5193 |
|
5194 | function run(regex, value, start) {
|
5195 | debug.assertValue(regex, 'regex');
|
5196 | regex.lastIndex = start || 0;
|
5197 | return regex.exec(value);
|
5198 | }
|
5199 | RegExpExtensions.run = run;
|
5200 | })(RegExpExtensions = jsCommon.RegExpExtensions || (jsCommon.RegExpExtensions = {}));
|
5201 | })(jsCommon || (jsCommon = {}));
|
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 |
|
5215 |
|
5216 |
|
5217 |
|
5218 |
|
5219 |
|
5220 |
|
5221 |
|
5222 |
|
5223 |
|
5224 |
|
5225 |
|
5226 |
|
5227 | var powerbi;
|
5228 | (function (powerbi) {
|
5229 | var visuals;
|
5230 | (function (visuals) {
|
5231 | var utility;
|
5232 | (function (utility) {
|
5233 | var StyleUtils;
|
5234 | (function (StyleUtils) {
|
5235 | function getRotateAngleFromElement(element) {
|
5236 | var rawElemStyle = element.get(0).style;
|
5237 | var transformString = rawElemStyle.transform || rawElemStyle.webkitTransform;
|
5238 | if (transformString) {
|
5239 | var transform = transformString.match(/rotate\((-?\d+(?:\.\d*)?)deg\)/);
|
5240 | if (transform) {
|
5241 | return parseFloat(transform[1]);
|
5242 | }
|
5243 | }
|
5244 | return 0;
|
5245 | }
|
5246 | StyleUtils.getRotateAngleFromElement = getRotateAngleFromElement;
|
5247 | function getTranslateTransformFromElement(element) {
|
5248 | var rawElemStyle = element.get(0).style;
|
5249 |
|
5250 |
|
5251 |
|
5252 | var transformString = rawElemStyle.transform || rawElemStyle.webkitTransform;
|
5253 | var retValue = { x: 0, y: 0 };
|
5254 | if (transformString && transformString.length > 0) {
|
5255 | var transform = transformString.match(/translate\((-?\d+(?:\.\d*)?)px, (-?\d+(?:\.\d*)?)px\)/);
|
5256 | if (transform) {
|
5257 | retValue.x = parseFloat(transform[1]);
|
5258 | retValue.y = parseFloat(transform[2]);
|
5259 | }
|
5260 | }
|
5261 | return retValue;
|
5262 | }
|
5263 | StyleUtils.getTranslateTransformFromElement = getTranslateTransformFromElement;
|
5264 | function getPadding(element) {
|
5265 | if (!element)
|
5266 | return;
|
5267 | return {
|
5268 | left: parseFloat(element.css('padding-left')) || 0,
|
5269 | right: parseFloat(element.css('padding-right')) || 0,
|
5270 | top: parseFloat(element.css('padding-top')) || 0,
|
5271 | bottom: parseFloat(element.css('padding-bottom')) || 0,
|
5272 | };
|
5273 | }
|
5274 | StyleUtils.getPadding = getPadding;
|
5275 | })(StyleUtils = utility.StyleUtils || (utility.StyleUtils = {}));
|
5276 | })(utility = visuals.utility || (visuals.utility = {}));
|
5277 | })(visuals = powerbi.visuals || (powerbi.visuals = {}));
|
5278 | })(powerbi || (powerbi = {}));
|
5279 |
|
5280 |
|
5281 |
|
5282 |
|
5283 |
|
5284 |
|
5285 |
|
5286 |
|
5287 |
|
5288 |
|
5289 |
|
5290 |
|
5291 |
|
5292 |
|
5293 |
|
5294 |
|
5295 |
|
5296 |
|
5297 |
|
5298 |
|
5299 |
|
5300 |
|
5301 |
|
5302 |
|
5303 |
|
5304 | var jsCommon;
|
5305 | (function (jsCommon) {
|
5306 | var ConsoleTracer = (function () {
|
5307 | function ConsoleTracer() {
|
5308 | }
|
5309 | ConsoleTracer.prototype.logTrace = function (trace) {
|
5310 | if (DEBUG) {
|
5311 | switch (trace.type) {
|
5312 | case jsCommon.TraceType.Information:
|
5313 | console.info(trace.toString());
|
5314 | break;
|
5315 | case jsCommon.TraceType.UnexpectedError:
|
5316 | case jsCommon.TraceType.Error:
|
5317 | case jsCommon.TraceType.Fatal:
|
5318 | console.error(trace.toString());
|
5319 | break;
|
5320 | case jsCommon.TraceType.ExpectedError:
|
5321 | case jsCommon.TraceType.Warning:
|
5322 | console.warn(trace.toString());
|
5323 | break;
|
5324 | case jsCommon.TraceType.Verbose:
|
5325 | console.log(trace.toString());
|
5326 | break;
|
5327 | default:
|
5328 | console.log(trace.toString());
|
5329 | break;
|
5330 | }
|
5331 | }
|
5332 | };
|
5333 | return ConsoleTracer;
|
5334 | }());
|
5335 | jsCommon.ConsoleTracer = ConsoleTracer;
|
5336 | var Trace;
|
5337 | (function (Trace) {
|
5338 | var traceMaxCount = 1000;
|
5339 | var traces = new Array(traceMaxCount);
|
5340 | var lastTraceIndex = -1;
|
5341 | var defaultListener = new ConsoleTracer();
|
5342 | var listeners = new Array(defaultListener);
|
5343 | |
5344 |
|
5345 |
|
5346 | function warning(text, requestId) {
|
5347 | debug.assertValue(text, 'text');
|
5348 | logTraceInternal(new jsCommon.TraceItem(text, jsCommon.TraceType.Warning, requestId));
|
5349 | }
|
5350 | Trace.warning = warning;
|
5351 | |
5352 |
|
5353 |
|
5354 | function error(text, includeStackTrace, requestId) {
|
5355 | debug.assertValue(text, 'text');
|
5356 | if (includeStackTrace)
|
5357 | text = jsCommon.StringExtensions.format("{0}.\nStack:\n{1}", text, jsCommon.getStackTrace());
|
5358 | logTraceInternal(new jsCommon.TraceItem(text, jsCommon.TraceType.Error, requestId));
|
5359 | }
|
5360 | Trace.error = error;
|
5361 | |
5362 |
|
5363 |
|
5364 | function verbose(text, requestId) {
|
5365 | debug.assertValue(text, 'text');
|
5366 | logTraceInternal(new jsCommon.TraceItem(text, jsCommon.TraceType.Verbose, requestId));
|
5367 | }
|
5368 | Trace.verbose = verbose;
|
5369 | function addListener(listener) {
|
5370 | debug.assertValue(listener, 'listener');
|
5371 | listeners.push(listener);
|
5372 | }
|
5373 | Trace.addListener = addListener;
|
5374 | function removeListener(listener) {
|
5375 | debug.assertValue(listener, 'listener');
|
5376 | var index = listeners.indexOf(listener);
|
5377 | if (index >= 0)
|
5378 | listeners.splice(index, 1);
|
5379 | }
|
5380 | Trace.removeListener = removeListener;
|
5381 | function resetListeners() {
|
5382 | listeners = new Array(defaultListener);
|
5383 | }
|
5384 | Trace.resetListeners = resetListeners;
|
5385 | function reset() {
|
5386 | lastTraceIndex = -1;
|
5387 | }
|
5388 | Trace.reset = reset;
|
5389 | function getTraces() {
|
5390 | if (lastTraceIndex < 0)
|
5391 | return;
|
5392 | var result = new Array(lastTraceIndex + 1);
|
5393 | for (var i = 0; i <= lastTraceIndex; i++)
|
5394 | result[i] = traces[i];
|
5395 | return result;
|
5396 | }
|
5397 | Trace.getTraces = getTraces;
|
5398 | |
5399 |
|
5400 |
|
5401 | function disableDefaultListener() {
|
5402 | removeListener(defaultListener);
|
5403 | }
|
5404 | Trace.disableDefaultListener = disableDefaultListener;
|
5405 | function enableDefaultListener() {
|
5406 | addListener(defaultListener);
|
5407 | }
|
5408 | Trace.enableDefaultListener = enableDefaultListener;
|
5409 | function logTraceInternal(trace) {
|
5410 | if ((lastTraceIndex + 1) >= traceMaxCount)
|
5411 | reset();
|
5412 | traces[++lastTraceIndex] = trace;
|
5413 | for (var i = 0, len = listeners.length; i < len; i++)
|
5414 | listeners[i].logTrace(trace);
|
5415 | }
|
5416 | })(Trace = jsCommon.Trace || (jsCommon.Trace = {}));
|
5417 | })(jsCommon || (jsCommon = {}));
|
5418 |
|
5419 |
|
5420 |
|
5421 |
|
5422 |
|
5423 |
|
5424 |
|
5425 |
|
5426 |
|
5427 |
|
5428 |
|
5429 |
|
5430 |
|
5431 |
|
5432 |
|
5433 |
|
5434 |
|
5435 |
|
5436 |
|
5437 |
|
5438 |
|
5439 |
|
5440 |
|
5441 |
|
5442 |
|
5443 | var jsCommon;
|
5444 | (function (jsCommon) {
|
5445 | |
5446 |
|
5447 |
|
5448 | (function (TraceType) {
|
5449 | TraceType[TraceType["Information"] = 0] = "Information";
|
5450 | TraceType[TraceType["Verbose"] = 1] = "Verbose";
|
5451 | TraceType[TraceType["Warning"] = 2] = "Warning";
|
5452 | TraceType[TraceType["Error"] = 3] = "Error";
|
5453 | TraceType[TraceType["ExpectedError"] = 4] = "ExpectedError";
|
5454 | TraceType[TraceType["UnexpectedError"] = 5] = "UnexpectedError";
|
5455 | TraceType[TraceType["Fatal"] = 6] = "Fatal";
|
5456 | })(jsCommon.TraceType || (jsCommon.TraceType = {}));
|
5457 | var TraceType = jsCommon.TraceType;
|
5458 | })(jsCommon || (jsCommon = {}));
|
5459 |
|
5460 |
|
5461 |
|
5462 |
|
5463 |
|
5464 |
|
5465 |
|
5466 |
|
5467 |
|
5468 |
|
5469 |
|
5470 |
|
5471 |
|
5472 |
|
5473 |
|
5474 |
|
5475 |
|
5476 |
|
5477 |
|
5478 |
|
5479 |
|
5480 |
|
5481 |
|
5482 |
|
5483 |
|
5484 | var jsCommon;
|
5485 | (function (jsCommon) {
|
5486 | |
5487 |
|
5488 |
|
5489 | var MSMapcontrol = 'https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1&onscriptload=globalMapControlLoaded';
|
5490 | |
5491 |
|
5492 |
|
5493 | var MSMapcontrolLoaded = false;
|
5494 | var WaitForMSMapLoad = null;
|
5495 | var PowerViewPackage = {
|
5496 | javaScriptFiles: [
|
5497 | powerbi.build + '/externals/pv/webclient.js'
|
5498 | ],
|
5499 | cssFiles: [
|
5500 | powerbi.build + '/externals/pv/Styles/_all.css'
|
5501 | ],
|
5502 | javaScriptFilesWithCallback: [
|
5503 | { javascriptFile: MSMapcontrol, onLoadCallback: waitForMapControlLoaded }
|
5504 | ]
|
5505 | };
|
5506 | function ensurePowerView(action) {
|
5507 | if (action === void 0) { action = _.noop; }
|
5508 | jsCommon.requires(PowerViewPackage, action);
|
5509 | }
|
5510 | jsCommon.ensurePowerView = ensurePowerView;
|
5511 | var MapPackage = {
|
5512 | javaScriptFilesWithCallback: [
|
5513 | { javascriptFile: MSMapcontrol, onLoadCallback: waitForMapControlLoaded }
|
5514 | ]
|
5515 | };
|
5516 | function ensureMap(locale, action) {
|
5517 | var mapPackageWithLocale = powerbi.Prototype.inherit(MapPackage);
|
5518 | if (!_.isEmpty(locale)) {
|
5519 | mapPackageWithLocale.javaScriptFilesWithCallback[0].javascriptFile = MSMapcontrol.concat('&mkt=' + locale);
|
5520 | }
|
5521 | jsCommon.requires(mapPackageWithLocale, action);
|
5522 | }
|
5523 | jsCommon.ensureMap = ensureMap;
|
5524 | function mapControlLoaded() {
|
5525 | MSMapcontrolLoaded = true;
|
5526 | if (WaitForMSMapLoad) {
|
5527 | WaitForMSMapLoad.resolve();
|
5528 | WaitForMSMapLoad = undefined;
|
5529 | }
|
5530 | }
|
5531 | jsCommon.mapControlLoaded = mapControlLoaded;
|
5532 | function waitForMapControlLoaded() {
|
5533 | var task;
|
5534 | if (!MSMapcontrolLoaded) {
|
5535 | task = WaitForMSMapLoad = $.Deferred();
|
5536 | }
|
5537 | else {
|
5538 | task = $.Deferred();
|
5539 | task.resolve();
|
5540 | }
|
5541 | return task.promise();
|
5542 | }
|
5543 | jsCommon.waitForMapControlLoaded = waitForMapControlLoaded;
|
5544 | })(jsCommon || (jsCommon = {}));
|
5545 |
|
5546 | var globalMapControlLoaded = function () {
|
5547 |
|
5548 | jsCommon.mapControlLoaded();
|
5549 | };
|
5550 |
|
5551 |
|
5552 |
|
5553 |
|
5554 |
|
5555 |
|
5556 |
|
5557 |
|
5558 |
|
5559 |
|
5560 |
|
5561 |
|
5562 |
|
5563 |
|
5564 |
|
5565 |
|
5566 |
|
5567 |
|
5568 |
|
5569 |
|
5570 |
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 |
|
5576 | var InJs;
|
5577 | (function (InJs) {
|
5578 | |
5579 |
|
5580 |
|
5581 | (function (TraceType) {
|
5582 | TraceType[TraceType["information"] = 0] = "information";
|
5583 | TraceType[TraceType["verbose"] = 1] = "verbose";
|
5584 | TraceType[TraceType["warning"] = 2] = "warning";
|
5585 | TraceType[TraceType["error"] = 3] = "error";
|
5586 | TraceType[TraceType["expectedError"] = 4] = "expectedError";
|
5587 | TraceType[TraceType["unexpectedError"] = 5] = "unexpectedError";
|
5588 | TraceType[TraceType["fatal"] = 6] = "fatal";
|
5589 | })(InJs.TraceType || (InJs.TraceType = {}));
|
5590 | var TraceType = InJs.TraceType;
|
5591 | })(InJs || (InJs = {}));
|
5592 |
|
5593 |
|