1WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}} 2; 3try { 4/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/lib-version.js' */ 5// NOTE: this is in "lib" because it's required by aui-amd.js. This module _cannot_ have any dependencies on non-lib 6// modules (like "common") 7define('applinks/lib/version', [ 8 'applinks/lib/lodash' 9], function( 10 _ 11) { 12 13 function checkIntValue(value, desc) { 14 if (_.isUndefined(value)) { 15 return 0; 16 } else if (typeof value !== 'number' || isNaN(value)) { 17 throw new Error(desc + ': expected a number, was: <' + value + '>'); 18 } else { 19 return Math.floor(value); 20 } 21 } 22 23 function checkVersionObject(object, desc) { 24 if (!object || !(object instanceof Version)) { 25 throw new Error(desc + ': expected a Version object, was: <' + object + '>'); 26 } 27 return object; 28 } 29 30 function compareInt(intOne, intTwo) { 31 return intOne > intTwo ? 1 : intOne == intTwo ? 0 : -1; 32 } 33 34 /** 35 * Constructs a version object that contains version information and can be compared with other version objects. 36 * 37 * @param major major version component 38 * @param minor minor version component 39 * @param bugfix bugfix version component 40 * @constructor 41 */ 42 function Version(major, minor, bugfix) { 43 this.major = checkIntValue(major, 'major'); 44 this.minor = checkIntValue(minor, 'minor'); 45 this.bugfix = checkIntValue(bugfix, 'bugfix'); 46 } 47 48 /** 49 * Constructs a Version by parsing a version string. 50 * 51 * @param versionString version string to parse, expected to be in the form of <major>.<minor>.<bugfix> 52 * @param versionDesc what version does the `versionString` represent 53 */ 54 Version.parse = function(versionString, versionDesc) { 55 versionDesc = versionDesc || 'versionString'; 56 if (!versionString) { 57 throw new Error(versionDesc + ': expected a non-empty string'); 58 } 59 var versionSplit = versionString.split('.'); 60 if (versionSplit.length !== 3) { 61 throw new Error(versionDesc + ': expected <major>.<minor>.<bugfix> string, was: <' + versionString + '>'); 62 } 63 return new Version(parseInt(versionSplit[0]), parseInt(versionSplit[1]), parseInt(versionSplit[2])); 64 }; 65 66 /** 67 * Comparator function to sort Version objects. 68 * 69 * @param versionOne first version object 70 * @param versionTwo second version object 71 * @returns {Number} comparison result 72 * @see Version.compareTo(that) 73 */ 74 Version.comparator = function(versionOne, versionTwo) { 75 return checkVersionObject(versionOne, 'versionOne').compareTo(checkVersionObject(versionTwo, 'versionTwo')); 76 }; 77 78 /** 79 * Return -1, 0 or 1 as this Version object represents a version less than, equal to, or greater than `that`. 80 * 81 * @param that the other version to compare to 82 * @returns {Number} comparison result 83 */ 84 Version.prototype.compareTo = function(that) { 85 checkVersionObject(that, 'that'); 86 var majorResult = compareInt(this.major, that.major); 87 if (majorResult != 0) { 88 return majorResult; 89 } 90 var minorResult = compareInt(this.minor, that.minor); 91 if (minorResult != 0) { 92 return minorResult; 93 } 94 return compareInt(this.bugfix, that.bugfix); 95 }; 96 97 Version.prototype.greaterThan = function(that) { 98 return this.compareTo(that) > 0; 99 }; 100 101 Version.prototype.greaterThanOrEqual = function(that) { 102 return this.compareTo(that) >= 0; 103 }; 104 105 Version.prototype.lessThan = function(that) { 106 return this.compareTo(that) < 0; 107 }; 108 109 Version.prototype.lessThanOrEqual = function(that) { 110 return this.compareTo(that) <= 0; 111 }; 112 113 Version.prototype.equals = function(that) { 114 return this.compareTo(that) == 0; 115 }; 116 117 Version.prototype.toMinor = function() { 118 return new Version(this.major, this.minor); 119 }; 120 121 Version.prototype.toMajor = function() { 122 return new Version(this.major); 123 }; 124 125 Version.prototype.toString = function() { 126 return this.major + '.' + this.minor + '.' + this.bugfix; 127 }; 128 129 return Version; 130}); 131}catch(e){WRMCB(e)}; 132; 133try { 134/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/aui-version-detail
134s.js' */ 135define('applinks/lib/aui-version-details', [ 136 'applinks/lib/version' 137], function( 138 Version 139) { 140 // minimum 5.9.x AUI versions - lower versions ship with bugs that break some of the Applinks functionality. 141 var MINIMUM_59_VERSION = new Version(5, 9, 13); 142 var VERSION_58 = new Version(5, 8); 143 var VERSION_59 = new Version(5, 9); 144 145 function checkVersion(version) { 146 // if 5.9, must be >= the minimum required 5.9.x version 147 if (version.lessThan(MINIMUM_59_VERSION) || version.lessThan(VERSION_59)) { 148 throw new Error('AUI version ' + version + ' is too low, you need to upgrade AUI to ' + MINIMUM_59_VERSION 149 + ' for Applinks to work'); 150 } 151 } 152 153 function addVersionDetails(AJS) { 154 var ajsVersion = Version.parse(AJS.version, 'AUI version'); 155 checkVersion(ajsVersion); 156 157 AJS.versionDetails = ajsVersion; 158 AJS.versionDetails.is58 = ajsVersion.toMinor().equals(VERSION_58); 159 AJS.versionDetails.is59 = ajsVersion.toMinor().equals(VERSION_59); 160 161 return AJS; 162 } 163 164 return { 165 /** 166 * Check AUI version for compatibility with Applinks and add `versionDetails` field. 167 */ 168 addVersionDetails: addVersionDetails 169 }; 170}); 171 172}catch(e){WRMCB(e)}; 173; 174try { 175/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/console-amd.js' */ 176define('applinks/lib/console', function() { 177 return window.console; 178}); 179}catch(e){WRMCB(e)}; 180; 181try { 182/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/jquery-amd.js' */ 183define('applinks/lib/jquery', function() { 184 return window.jQuery; 185}); 186}catch(e){WRMCB(e)}; 187; 188try { 189/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/aui-amd.js' */ 190define('applinks/lib/aui', [ 191 'applinks/lib/window', 192 'applinks/lib/aui-version-details' 193], function( 194 window, 195 VersionDetails 196) { 197 var AJS = window.AJS; 198 if (!AJS) { 199 throw new Error('window.AJS not defined, cannot load AUI'); 200 } 201 202 return VersionDetails.addVersionDetails(AJS); 203}); 204}catch(e){WRMCB(e)}; 205; 206try { 207/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/wrm-amd.js' */ 208/** 209 * Define Web resource manager as an AMD dependency. This should also be present in apps using Atlassian Plugins Web 210 * Resources framework. 211 */ 212define('applinks/lib/wrm', function() { 213 return window.WRM; 214}); 215}catch(e){WRMCB(e)}; 216; 217try { 218/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/skate-amd.js' */ 219define('applinks/lib/skate', function() { 220 // window.skate is not exposed as a global from AUI 5.9, this will return undefined with that version or later 221 return window.skate; 222}); 223 224}catch(e){WRMCB(e)}; 225; 226try { 227/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/window-amd.js' */ 228/** 229 * Define window as AMD module to facilitate unit testing of some modules 230 */ 231define('applinks/lib/window', function() { 232 return window; 233}); 234}catch(e){WRMCB(e)}; 235; 236try { 237/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/spi-amd.js' */ 238/** 239 * Define the Applinks SPI functions as AMD module to facilitate unit testing of some modules 240 */ 241define('applinks/lib/spi', function() { 242 return {get: 243 function (){ 244 //required since code that depends on this global is run before the global is defined, 245 // can be eliminated once this module is made properly AMD 246 return AppLinks.SPI; 247 }} 248}); 249}catch(e){WRMCB(e)}; 250; 251try { 252/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/applinks-creation-amd.js' */ 253/** 254 * Define the Applinks creation resources as AMD module to facilitate unit testing of some modules 255 */ 256define('applinks/lib/creation', function() { 257 return { 258 get: function () { 259 //required since code that depends on this global is run before the global is defined, 260 // can be eliminated once this module is made properly AMD 261 return AppLinks.Creation; 262 } 263 } 264}); 265}catch(e){WRMCB(e)};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.