diff --git a/404.html b/404.html new file mode 100644 index 0000000..9a48320 --- /dev/null +++ b/404.html @@ -0,0 +1,26 @@ + + + + The page you were looking for doesn't exist (404) + + + + + +
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+ + diff --git a/422.html b/422.html new file mode 100644 index 0000000..83660ab --- /dev/null +++ b/422.html @@ -0,0 +1,26 @@ + + + + The change you wanted was rejected (422) + + + + + +
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+ + diff --git a/500.html b/500.html new file mode 100644 index 0000000..b80307f --- /dev/null +++ b/500.html @@ -0,0 +1,26 @@ + + + + We're sorry, but something went wrong (500) + + + + + +
+

We're sorry, but something went wrong.

+

We've been notified about this issue and we'll take a look at it shortly.

+
+ + diff --git a/app b/app new file mode 120000 index 0000000..cd5f0af --- /dev/null +++ b/app @@ -0,0 +1 @@ +sencha/app \ No newline at end of file diff --git a/app.js b/app.js new file mode 120000 index 0000000..e3e603a --- /dev/null +++ b/app.js @@ -0,0 +1 @@ +sencha/app.js \ No newline at end of file diff --git a/app.json b/app.json new file mode 120000 index 0000000..cbe0467 --- /dev/null +++ b/app.json @@ -0,0 +1 @@ +sencha/app.json \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/resources b/resources new file mode 120000 index 0000000..469af24 --- /dev/null +++ b/resources @@ -0,0 +1 @@ +sencha/resources/ \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..085187f --- /dev/null +++ b/robots.txt @@ -0,0 +1,5 @@ +# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# +# To ban all spiders from the entire site uncomment the next two lines: +# User-Agent: * +# Disallow: / diff --git a/sdk b/sdk new file mode 120000 index 0000000..e280e8b --- /dev/null +++ b/sdk @@ -0,0 +1 @@ +sencha/sdk/ \ No newline at end of file diff --git a/sencha/app.js b/sencha/app.js new file mode 100644 index 0000000..e7827eb --- /dev/null +++ b/sencha/app.js @@ -0,0 +1,101 @@ +var rootPanel; + +// +Ext.Loader.setPath({ + 'Ext': 'sdk/src' +}); +// + + +Ext.application({ + name: 'TwitterExample', + + controllers: [], + views: [], + stores: [], + models: [], + + requires: [ + 'Ext.MessageBox' + ], + + icon: { + 57: 'resources/icons/Icon.png', + 72: 'resources/icons/Icon~ipad.png', + 114: 'resources/icons/Icon@2x.png', + 144: 'resources/icons/Icon~ipad@2x.png' + }, + + phoneStartupScreen: 'resources/loading/Homescreen.jpg', + tabletStartupScreen: 'resources/loading/Homescreen~ipad.jpg', + + launch: function() { + + // Destroy the #appLoadingIndicator element + Ext.fly('appLoadingIndicator').destroy(); + + var button = Ext.create('Ext.Button', { + text: 'Button', + handler: function() { + console.log("click!"); + }, + }); + + // Initialize the main view + rootPanel = Ext.Viewport.add({ + xtype: "container", + padding: 10, + items: [{ + xtype: "panel", + html: "login with twitter example
", + }] + }); + }, + + onUpdated: function() { + Ext.Msg.confirm( + "Application Update", + "This application has just successfully been updated to the latest version. Reload now?", + function() { + window.location.reload(); + } + ); + }, +}); + +function addLogoutButton() { + console.log("addLogoutButton"); + rootPanel.add( + { + xtype: "button", + id: "logoutButton", + text: "logout of twitter", + handler: function() { + twttr.anywhere.signOut(); + }, + } + ); +} + +function processLogin(user) { + addLogoutButton(); +}; + +function processLogout() { + var items = rootPanel.getItems(); + console.log(items); + for(i=0; i + + + + Twitter Example + + + + + + +
+
+
+
+
+ + diff --git a/sencha/packager.json b/sencha/packager.json new file mode 100644 index 0000000..2528dc9 --- /dev/null +++ b/sencha/packager.json @@ -0,0 +1,126 @@ +{ + /** + * @cfg {String} applicationName + * @required + * This is the name of your application, which is displayed on the device when the app is installed. On IOS, this should match + * the name of your application in the Apple Provisioning Portal. + */ + "applicationName":"My Application", + + /** + * @cfg {String} applicationId + * This is the name namespace for your application. On IOS, this should match the name of your application in the Apple Provisioning Portal. + */ + "applicationId":"com.mycompany.myAppID", + + /** + * @cfg {String} versionString + * @required + * This is the version of your application. + */ + "versionString":"1.0", + + /** + * @cfg {String} iconName + * This is file name of your icon. This should be in the same directory of this configuration file. + * + * For iOS, please refer to their documentation about icon sizes: + * https://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html + * + * For Android, please refer to the Google Launcher icons guide: + * http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html + */ + "iconName":"resources/icons/Icon~ipad.png", + + /** + * @cfg {String} inputPath + * @required + * This is location of your Sencha Touch 2 application, relative to this configuration file. + */ + "inputPath":"build/native", + + /** + * @cfg {String} outputPath + * @required + * This is where the built application file with be saved. + */ + "outputPath":"build/", + + /** + * @cfg {String} configuration + * @required + * This is configuration for your application. `Debug` should always be used unless you are submitting your app to an online + * store - in which case `Release` should be specified. + */ + "configuration":"Debug", + + /** + * @cfg {String} platform + * @required + * This is the platform where you will be running your application. Available options are: + * - iOSSimulator + * - iOS + * - Android + * - AndroidEmulator + */ + "platform":"iOSSimulator", + + /** + * @cfg {String} deviceType + * @required + * This is device type that your application will be running on. + * + * If you are developing for Android, this is not necessary. + * + * Available options are: + * - iPhone + * - iPad + * - Universal + */ + "deviceType":"Universal", + + /** + * @cfg {String} certificatePath + * This is the location of your certificate. + * This is required when you are developing for Android or you are developing on Windows. + */ + "certificatePath":"/path/to/certificate.file", + + /** + * @cfg {String} certificateAlias + * This is the name of your certificate. + * + * IF you do not specify this on OSX, we will try and automatically find the certificate for you using the applicationId. + * + * This can be just a simple matcher. For example, if your certificate name is "iPhone Developer: Robert Dougan (ABCDEFGHIJ)", you + * can just put "iPhone Developer". + * + * When using a certificatePath on Windows, you do not need to specify this. + */ + "certificateAlias":"", + + /** + * @cfg {String} sdkPath + * This is the path to the Android SDK, if you are developing an Android application. + */ + "sdkPath":"/path/to/android-sdk", + + /** + * @cfg androidAPILevel + * This is android API level, the version of Android SDK to use, you can read more about it here: http://developer.android.com/guide/appendix/api-levels.html. + * Be sure to install corresponding platform API in android SDK manager (android_sdk/tools/android) + */ + "androidAPILevel":"15", + + /** + * @cfg orientations + * @required + * This is orientations that this application can run. + */ + "orientations": [ + "portrait", + "landscapeLeft", + "landscapeRight", + "portraitUpsideDown" + ] +} diff --git a/sencha/resources/css/app.css b/sencha/resources/css/app.css new file mode 100644 index 0000000..2578846 --- /dev/null +++ b/sencha/resources/css/app.css @@ -0,0 +1,6755 @@ +/* line 3, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, +h4, h5, h6, pre, code, form, fieldset, legend, +input, textarea, p, blockquote, th, td { + margin: 0; + padding: 0; +} + +/* line 8, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* line 13, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +fieldset, img { + border: 0; +} + +/* line 18, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +address, caption, cite, code, +dfn, em, strong, th, var { + font-style: normal; + font-weight: normal; +} + +/* line 23, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +li { + list-style: none; +} + +/* line 27, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +caption, th { + text-align: left; +} + +/* line 31, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +h1, h2, h3, h4, h5, h6 { + font-size: 100%; + font-weight: normal; +} + +/* line 37, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +q:before, +q:after { + content: ""; +} + +/* line 41, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +abbr, acronym { + border: 0; + font-variant: normal; +} + +/* line 46, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +sup { + vertical-align: text-top; +} + +/* line 50, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +sub { + vertical-align: text-bottom; +} + +/* line 54, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +input, textarea, select { + font-family: inherit; + font-size: inherit; + font-weight: inherit; +} + +/* line 60, ../themes/stylesheets/sencha-touch/default/core/_reset.scss */ +*:focus { + outline: none; +} + +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/* line 10, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +html, body { + font-family: "Helvetica Neue", HelveticaNeue, "Helvetica-Neue", Helvetica, "BBAlpha Sans", sans-serif; + font-weight: normal; + position: relative; + -webkit-text-size-adjust: none; +} + +/* line 17, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body.x-desktop { + overflow: hidden; +} + +/* line 21, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +*, *:after, *:before { + -webkit-box-sizing: border-box; + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-user-select: none; + -webkit-touch-callout: none; + -webkit-user-drag: none; +} + +/* line 29, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-ios.x-tablet .x-landscape * { + -webkit-text-stroke: 1px transparent; +} + +/* line 33, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body { + font-size: 104%; +} + +/* line 37, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body.x-ios { + -webkit-backface-visibility: hidden; +} + +/* line 41, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body.x-android.x-phone { + font-size: 116%; +} + +/* line 45, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body.x-android.x-phone.x-silk { + font-size: 130%; +} + +/* line 49, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body.x-ios.x-phone { + font-size: 114%; +} + +/* line 53, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +body.x-desktop { + font-size: 114%; +} + +/* line 57, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +input, textarea { + -webkit-user-select: text; +} + +/* line 61, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-hidden-visibility { + visibility: hidden !important; +} + +/* line 65, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-hidden-display, .x-field-hidden { + display: none !important; +} + +/* line 69, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-hidden-offsets { + position: absolute !important; + left: -10000em; + top: -10000em; + visibility: hidden; +} + +/* line 76, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-fullscreen { + position: absolute !important; +} + +/* line 83, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-desktop .x-body-stretcher { + margin-bottom: 0px; +} + +/* line 87, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + height: 100%; + z-index: 10; + display: -webkit-box; + display: box; + -webkit-box-align: center; + box-align: center; + -webkit-box-pack: center; + box-pack: center; + background: rgba(0, 0, 0, 0.3) center center no-repeat; +} +/* line 104, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask.x-mask-gray { + background-color: rgba(0, 0, 0, 0.5); +} +/* line 108, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask.x-mask-transparent { + background-color: transparent; +} +/* line 112, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask .x-mask-inner { + background: rgba(0, 0, 0, 0.25); + color: #fff; + text-align: center; + padding: .4em; + font-size: .95em; + font-weight: bold; + -webkit-border-radius: 0.5em; + border-radius: 0.5em; +} +/* line 122, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask .x-loading-spinner-outer { + display: -webkit-box; + display: box; + -webkit-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: center; + box-align: center; + -webkit-box-pack: center; + box-pack: center; + width: 100%; + min-width: 8.5em; + height: 8.5em; +} +/* line 133, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask.x-indicator-hidden .x-loading-spinner-outer { + display: none; +} +/* line 138, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-mask .x-mask-message { + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; + -webkit-box-flex: 0 !important; + max-width: 13em; + min-width: 8.5em; +} + +/* line 146, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-draggable { + z-index: 1; +} + +/* line 150, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-dragging { + opacity: 0.7; +} + +/* line 154, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-panel-list { + background-color: #eaf6fe; +} + +/* line 159, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-html { + -webkit-user-select: auto; + -webkit-touch-callout: inherit; + line-height: 1.5; + color: #333; + font-size: .8em; + padding: 1.2em; +} +/* line 33, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html body { + line-height: 1.5; + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + color: #333333; + font-size: 75%; +} +/* line 51, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h1, .x-html h2, .x-html h3, .x-html h4, .x-html h5, .x-html h6 { + font-weight: normal; + color: #222222; +} +/* line 52, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h1 img, .x-html h2 img, .x-html h3 img, .x-html h4 img, .x-html h5 img, .x-html h6 img { + margin: 0; +} +/* line 53, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h1 { + font-size: 3em; + line-height: 1; + margin-bottom: 0.50em; +} +/* line 54, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h2 { + font-size: 2em; + margin-bottom: 0.75em; +} +/* line 55, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h3 { + font-size: 1.5em; + line-height: 1; + margin-bottom: 1.00em; +} +/* line 56, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h4 { + font-size: 1.2em; + line-height: 1.25; + margin-bottom: 1.25em; +} +/* line 57, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h5 { + font-size: 1em; + font-weight: bold; + margin-bottom: 1.50em; +} +/* line 58, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html h6 { + font-size: 1em; + font-weight: bold; +} +/* line 59, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html p { + margin: 0 0 1.5em; +} +/* line 60, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html p .left { + display: inline; + float: left; + margin: 1.5em 1.5em 1.5em 0; + padding: 0; +} +/* line 61, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html p .right { + display: inline; + float: right; + margin: 1.5em 0 1.5em 1.5em; + padding: 0; +} +/* line 62, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html a { + text-decoration: underline; + color: #0066cc; +} +/* line 18, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/typography/links/_link-colors.scss */ +.x-html a:visited { + color: #004c99; +} +/* line 21, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/typography/links/_link-colors.scss */ +.x-html a:focus { + color: #0099ff; +} +/* line 24, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/typography/links/_link-colors.scss */ +.x-html a:hover { + color: #0099ff; +} +/* line 27, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/compass/stylesheets/compass/typography/links/_link-colors.scss */ +.x-html a:active { + color: #bf00ff; +} +/* line 63, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html blockquote { + margin: 1.5em; + color: #666666; + font-style: italic; +} +/* line 64, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html strong, .x-html dfn { + font-weight: bold; +} +/* line 65, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html em, .x-html dfn { + font-style: italic; +} +/* line 66, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html sup, .x-html sub { + line-height: 0; +} +/* line 67, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html abbr, .x-html acronym { + border-bottom: 1px dotted #666666; +} +/* line 68, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html address { + margin: 0 0 1.5em; + font-style: italic; +} +/* line 69, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html del { + color: #666666; +} +/* line 70, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html pre { + margin: 1.5em 0; + white-space: pre; +} +/* line 71, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html pre, .x-html code, .x-html tt { + font: 1em "andale mono", "lucida console", monospace; + line-height: 1.5; +} +/* line 72, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html li ul, .x-html li ol { + margin: 0; +} +/* line 73, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html ul, .x-html ol { + margin: 0 1.5em 1.5em 0; + padding-left: 1.5em; +} +/* line 74, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html ul { + list-style-type: disc; +} +/* line 75, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html ol { + list-style-type: decimal; +} +/* line 76, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html dl { + margin: 0 0 1.5em 0; +} +/* line 77, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html dl dt { + font-weight: bold; +} +/* line 78, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html dd { + margin-left: 1.5em; +} +/* line 79, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html table { + margin-bottom: 1.4em; + width: 100%; +} +/* line 80, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html th { + font-weight: bold; +} +/* line 81, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html thead th { + background: #c3d9ff; +} +/* line 82, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html th, .x-html td, .x-html caption { + padding: 4px 10px 4px 5px; +} +/* line 85, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html table.striped tr:nth-child(even) td, .x-html table tr.even td { + background: #e5ecf9; +} +/* line 86, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html tfoot { + font-style: italic; +} +/* line 87, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html caption { + background: #eeeeee; +} +/* line 88, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html .quiet { + color: #666666; +} +/* line 89, /Library/Ruby/Gems/1.8/gems/compass-0.11.5/frameworks/blueprint/stylesheets/blueprint/_typography.scss */ +.x-html .loud { + color: #111111; +} +/* line 169, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-html ul li { + list-style-type: circle; +} +/* line 172, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-html ol li { + list-style-type: decimal; +} + +/* line 178, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-video { + background-color: #000; +} + +/* line 182, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-sortable .x-dragging { + opacity: 1; + z-index: 5; +} + +/* line 187, ../themes/stylesheets/sencha-touch/default/core/_core.scss */ +.x-layout-card-item { + background: #eeeeee; +} + +/* line 1, ../themes/stylesheets/sencha-touch/default/widgets/_map.scss */ +.x-map { + background-color: #edeae2; +} +/* line 3, ../themes/stylesheets/sencha-touch/default/widgets/_map.scss */ +.x-map * { + -webkit-box-sizing: content-box; + box-sizing: content-box; +} + +/* line 9, ../themes/stylesheets/sencha-touch/default/widgets/_map.scss */ +.x-mask-map { + background: transparent !important; +} + +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.Toolbar + */ +/** + * @var {color} $toolbar-base-color + * The primary color variable from which toolbars derive their light and dark UIs. + */ +/** + * @var {measurement} $toolbar-spacing + * Space between items in a toolbar (like buttons and fields) + */ +/** + * @var {string} $toolbar-gradient + * Background gradient style for toolbars. + */ +/** + * @var {boolean} $include-toolbar-uis + * Optionally disable separate toolbar UIs (light and dark). + */ +/** + * Includes default toolbar styles. + */ +/** + * Creates a theme UI for toolbars. + * + * // SCSS + * @include sencha-toolbar-ui('sub', #58710D, 'glossy'); + * + * // JS + * var myTb = new Ext.Toolbar({title: 'My Green Glossy Toolbar', ui: 'sub'}) + * + * @param {string} $ui-label The name of the UI being created. + * Can not included spaces or special punctuation (used in class names) + * @param {color} $color Base color for the UI. + * @param {string} $gradient: $toolbar-gradien Background gradient style for the UI. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.Button + */ +/** + * @var {measurement} $button-height Default height for buttons. + */ +/** + * @var {measurement} $button-radius Default border-radius for buttons. + */ +/** + * @var {measurement} $button-stroke-weight Default border width for buttons. + */ +/** + * @var {string} $button-gradient Default gradient for buttons. + * + * See {@link Global_CSS#background-gradient background-gradient}. + */ +/** + * @var {string} $toolbar-icon-size Default size (width and height) for toolbar icons. + */ +/** + * @var {boolean} $include-button-uis Optionally disable separate button UIs, including action, confirm, and decline. + */ +/** + * @var {boolean} $include-button-highlights Optionally disable special CSS3 effects on buttons including gradients, text-shadows, and box-shadows. + */ +/** + * Includes default button styles. + * + * See {@link Global_CSS#background-gradient background-gradient}. + */ +/** + * Creates a theme UI for buttons. + * Also automatically generates UIs for {ui-label}-round and {ui-label}-small. + * + * // SCSS + * @include sencha-button-ui('secondary', #99A4AE, 'glossy'); + * + * // JS + * var cancelBtn = new Ext.Button({text: 'Cancel', ui: 'secondary'}); + * + * @param {string} $ui-label The name of the UI being created. + * Can not included spaces or special punctuation (used in class names) + * @param {color} $color Base color for the UI. + * @param {string} $gradient Default gradient for the UI. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.tab.Bar + */ +/** + * @var {boolean} $include-tabbar-uis Optionally disable separate tabbar UIs (light and dark). + */ +/** + * @var {boolean} $include-top-tabs + * Optionally exclude top tab styles by setting to false. + */ +/** + * @var {boolean} $include-bottom-tabs + * Optionally exclude bottom tab styles by setting to false. + */ +/** + * @var {color} $tabs-light + * Base color for "light" UI tabs. + */ +/** + * @var {color} $tabs-light-active + * Active color for "light" UI tabs. + */ +/** + * @var {color} $tabs-dark + * Base color for "dark" UI tabs. + */ +/** + * @var {color} $tabs-dark-active + * Active color for "dark" UI tabs. + */ +/** + * @var {string} $tabs-bar-gradient + * Background gradient style for tab bars. + */ +/** + * @class Ext.tab.Tab + */ +/** + * @var {string} $tabs-bottom-radius + * Border-radius for bottom tabs. + */ +/** + * @var {string} $tabs-bottom-icon-size + * Icon size for bottom tabs + */ +/** + * @var {string} $tabs-bottom-active-gradient + * Background gradient style for active bottom tabs. + */ +/** + * @var {boolean} $include-tab-highlights + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * Includes default tab styles. + * + * @member Ext.tab.Bar + */ +/** + * Creates a theme UI for tabbar/tab components. + * + * // SCSS + * @include sencha-button-ui('pink', #333, 'matte', #AE537A); + * + * // JS + * var tabs = new Ext.tab.Panel({ + * tabBar: { + * ui: 'pink', + * dock: 'bottom', + * layout: { pack: 'center' } + * }, + * ... + * }); + * + * @param {string} $ui-label The name of the UI being created. + * Can not included spaces or special punctuation (used in class names) + * @param {color} $bar-color Base color for the tab bar. + * @param {string} $bar-gradient Background gradient style for the tab bar. + * @param {color} $tab-active-color Background-color for active tab icons. + * + * @member Ext.tab.Bar + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.carousel.Indicator + */ +/** + * @var {measurement} $carousel-indicator-size Size (width/height) of carousel indicator dots. + */ +/** + * @var {measurement} $carousel-indicator-spacing + * Amount of space between carousel indicator dots. + */ +/** + * @var {measurement} $carousel-track-size Size of the track the carousel indicator dots are in. + */ +/** + * Creates a theme UI for carousel indicator components. + * + * @param {string} $ui-label The name of the UI being created. + * Can not included spaces or special punctuation (used in class names) + * @param {color} $color Base color for the UI. + * @param {string} $gradient Default gradient for the UI. + * @param {color} $active-color Active color for the UI. + * @param {string} $active-gradient Active gradient for the UI. + */ +/** + * @class Ext.carousel.Carousel + */ +/** + * Includes basic carousel formatting. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.dataview.IndexBar + */ +/** + * @var {measurement} $index-bar-width + * Width of the index bar. + */ +/** + * @var {color} $index-bar-bg-color + * Background-color of the index bar. + */ +/** + * @var {color} $index-bar-color + * Text color of the index bar. + */ +/** + * Includes default index bar styles. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.dataview.List + */ +/** + * @var {color} $list-color + * Text color for list rows. + */ +/** + * @var {color} $list-bg-color + * Background-color for list rows. + */ +/** + * @var {color} $include-list-highlights + * Optionally disable all list gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $list-zebrastripe + * Optionally zebra-stripe the list (alternating background colors). + */ +/** + * @var {color} $list-pressed-color + * Background-color for pressed list rows. + */ +/** + * @var {color} $list-active-color + * Background-color for selected list rows. + */ +/** + * @var {string} $list-active-gradient + * Gradient style for selected list rows. + */ +/** + * @var {color} $list-header-bg-color + * Background-color for list header rows (in grouped lists). + */ +/** + * @var {string} $list-header-gradient + * Gradient style for list header rows (in grouped lists). + * + * See {@link Global_CSS#background-gradient background-gradient}. + */ +/** + * @var {measurement} $list-disclosure-size + * Default size (width/height) for disclosure icons. + */ +/** + * @var {measurement} $list-disclosure-round-size + * Default size (width/height) for disclosure icons in a list with a 'round' ui. + */ +/** + * Includes default list styles. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * Includes default form slider styles. + * + * @member Ext.field.Slider + */ +/** + * @var {color} $form-bg-color + * Default background-color for forms. + * + * @member Ext.form.Panel + */ +/** + * @class Ext.field.Field + */ +/** + * @var {color} $form-field-bg-color + * Default background-color for form fields. + */ +/** + * @var {color} $form-light + * Light color for form fields, mostly used on field borders. + */ +/** + * @var {color} $form-dark + * Dark color for form fields, mostly used on labels/text. + */ +/** + * @var {measurement} $form-label-width + * Default width for form labels. + */ +/** + * @var {color} $form-label-background-color + * The default background color for labels + */ +/** + * @var {measurement} $form-field-height + * Default height for form fields. + */ +/** + * @var {measurement} $form-spacing + * Default spacing for form fields, used for padding, etc. + */ +/** + * @var {measurement} $form-textarea-height + * Default height for form textareas. + * + * @member Ext.field.TextArea + */ +/** + * @var {measurement} $form-thumb-size + * Default size of "thumbs" for form sliders/toggles. + * + * @member Ext.field.Slider + */ +/** + * @var {measurement} $form-toggle-size + * Thumb size minus padding for inset thumbs like in a Toggle element. + * + * @member Ext.field.Toggle + */ +/** + * @var {measurement} $form-fieldset-radius + * Default border-radius for form fieldsets. + * + * @member Ext.form.FieldSet + */ +/** + * @var {measurement} $form-slider-size + * Height of the slider "track." + * + * @member Ext.field.Slider + */ +/** + * Includes default form styles. + * + * See {@link Global_CSS#background-gradient background-gradient}. + * + * @member Ext.form.Panel + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.Sheet + */ +/** + * @var {color} $sheet-bg-color + * Background-color for action sheets and message boxes. + */ +/** + * @var {color} $sheet-bg-gradient + * Background gradient style for action sheets and message boxes. + */ +/** + * @var {measurement} $sheet-button-spacing + * Vertical spacing between sheet buttons. + */ +/** + * @var {measurement} $sheet-padding + * Overall padding in a sheet. + */ +/** + * Includes default sheet styles (also required for message box). + */ +/** + * Includes default message box styles. + * + * @member Ext.MessageBox + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/** + * @class Ext.field.Field + */ +/** + * @var {color} $toolbar-input-bg + * Background-color for toolbar form fields. + */ +/** + * @var {color} $toolbar-input-color + * Text color for toolbar form fields. + */ +/** + * @var {measurement} $toolbar-input-height + * Text color for toolbar form fields. + */ +/** + * @var {color} $toolbar-input-border-color + * Border color for toolbar form fields. + */ +/** + * Includes default toolbar form field styles. + * + * @member Ext.tab.Bar + */ +/** + * @class Ext.LoadMask + */ +/** + * @var {color} $loading-spinner-color + * Background-color for the bars in the loading spinner. + */ +/** + * Includes default loading spinner styles (for dataviews). + */ +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/* line 3, ../themes/stylesheets/sencha-touch/default/widgets/_img.scss */ +.x-img { + background-repeat: no-repeat; +} + +/** + * @class Global_CSS + * + * Global CSS variables and mixins of Sencha Touch. + */ +/** + * @var {boolean} $include-html-style + * Optionally remove included HTML styles/typography (for components with styleHtmlContent: true). + * Styles are scoped to .x-html. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-default-icons + * Optionally remove the default icon set which includes the following toolbar and tab bar icons: action, + * add, arrow_down, arrow_left, arrow_right, arrow_up, bookmarks, compose, delete, download, favorites, + * home, info, locate, maps, more, organize, refresh, reply, search, settings, star, team, time, trash, + * and user. Set to false to reduce CSS weight. + */ +/** + * @var {boolean} $include-form-sliders + * Decides if default HTML styles are included (for components with styleHtmlContent: true). Class is applied to .x-html. + */ +/** + * @var {boolean} $include-floating-panels + * Decides whether or not to include floating panels (useful to disable for iPhone applications which do not typically have floating menus). + */ +/** + * @var {boolean} $include-default-uis + * Decides whether or not to include the default UIs for all components. + */ +/** + * @var {boolean} $include-highlights=true + * Optionally disable all gradients, text-shadows, and box-shadows. Useful for CSS debugging, + * non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $include-border-radius + * Optionally disable all border-radius. Useful for CSS debugging, non-performant browsers, or minimalist designs. + */ +/** + * @var {boolean} $basic-slider + * Optionally remove CSS3 effects from the slider component for improved performance. + */ +/** + * @var {color} $base-color + * The primary color variable from which most elements derive their color scheme. + */ +/** + * @var {string} $base-gradient + * The primary gradient variable from which most elements derive their color scheme. + * @see background-gradient + */ +/** + * @var {font-family} $font-family + * The font-family to be used throughout the theme. + * @see background-gradient + */ +/** + * @var {color} $alert-color + * Color used for elements like badges, errors, and "decline" UIs (eg. on buttons). + */ +/** + * @var {color} $confirm-color + * Color used for elements like success messages, and "confirm" UIs (eg. on buttons). + */ +/** + * @var {color} $active-color + * Color used for elements like selected rows, "action" UIs (eg. on buttons) and certain overlays like the picker mask. + */ +/** + * @var {color} $neutral-color + * Color used for the neautral `ui` for Toolbars and Tabbars. + */ +/** + * @var {color} $page-bg-color + * Background color for fullscreen components. + */ +/** + * @var {measurement} $global-row-height + * The minimum row height for items like toolbars and list items. + */ +/** + * @class Global_CSS + */ +/** + * Add a background gradient to a selector. + * + * .my-element { + * @include background-gradient(green, 'recessed') + * } + * + * @param {color} $bg-color The base color of the gradient. + * @param {string} $type The style of the gradient, one of five pre-defined options: matte, bevel, glossy, recessed, or flat. + */ +/** + * Includes a base64-encoded icon for use within tab bars and buttons (With the component parameter iconMask: true). + * + * @include pictos-iconmask('attachment'); + * + * @param {string} $name The name of the icon to be included. This is to match the name of the icon file (located at resources/themes/images/default/pictos) without its extention (.png). + */ +/** + * Includes the default styles for toolbar buttons, mostly used as a helper function. + * + * @param {color} $bg-color Base color to be used for the button. + * @param {color} $type Gradient style for the button, will automatically use "recessed" when pressed. + */ +/** + * Adds a small text shadow (or highlight) to give the impression of beveled text. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds a small box shadow (or highlight) to give the impression of being beveled. + * + * @param {string} $type Either shadow or highlight, decides whether to apply a light shadow or dark. + */ +/** + * Adds basic styles to :before or :after pseudo-elements. + * + * .my-element:after { + * @include insertion(50px, 50px); + * } + * + * @param {measurement} $width Height of pseudo-element. + * @param {measurement} $height Height of pseudo-element. + * @param {measurement} $top Top positioning of pseudo-element. + * @param {measurement} $left Left positioning of pseudo-element. + * + */ +/** + * Makes an element stretch to its parent's bounds. + */ +/** + * Colors the text of an element based on lightness of its background. + * + * .my-element { + * @include color-by-background(#fff); // Colors text black. + * } + * + * .my-element { + * @include color-by-background(#fff, 40%); // Colors text gray. + * } + * + * @param {color} $bg-color Background color of element. + * @param {percent} $contrast Contrast of text color to its background. + * + */ +/** + * Bevels the text based on its background. + * + * @param {color} $bg-color Background color of element. + * @see bevel-text + * + */ +/** + * Creates a background gradient for masked elements, based on the lightness of their background. + * + * @param {color} $bg-color Background color of element. + * @param {percent} $percent Contrast of the new gradient to its background. + * @param {percent} $style Gradient style of the gradient. + * @see background-gradient + * + */ +/** + * Makes the element text overflow to use ellipsis. + */ +/* line 3, ../themes/stylesheets/sencha-touch/default/widgets/_media.scss */ +.x-video { + height: 100%; + width: 100%; +} + +/* line 8, ../themes/stylesheets/sencha-touch/default/widgets/_media.scss */ +.x-video > * { + height: 100%; + width: 100%; + position: absolute; +} + +/* line 14, ../themes/stylesheets/sencha-touch/default/widgets/_media.scss */ +.x-video-ghost { + -webkit-background-size: 100% auto; + background: black url() center center no-repeat; +} + +/* line 19, ../themes/stylesheets/sencha-touch/default/widgets/_media.scss */ +audio { + width: 100%; +} + +/* line 8, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-panel, +.x-msgbox, +.x-panel-body { + position: relative; +} + +/* line 15, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-panel.x-floating, +.x-msgbox.x-floating, +.x-form.x-floating { + padding: 6px; + -webkit-border-radius: 0.3em; + border-radius: 0.3em; + -webkit-box-shadow: rgba(0, 0, 0, 0.8) 0 0.2em 0.6em; + background-color: #03111a; + background-image: none; +} +/* line 21, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-panel.x-floating.x-floating-light, +.x-msgbox.x-floating.x-floating-light, +.x-form.x-floating.x-floating-light { + background-color: #1985d0; + background-image: none; +} +/* line 27, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-panel.x-floating > .x-panel-inner, .x-panel.x-floating .x-scroll-view, .x-panel.x-floating .x-body, +.x-msgbox.x-floating > .x-panel-inner, +.x-msgbox.x-floating .x-scroll-view, +.x-msgbox.x-floating .x-body, +.x-form.x-floating > .x-panel-inner, +.x-form.x-floating .x-scroll-view, +.x-form.x-floating .x-body { + background-color: #fff; + -webkit-border-radius: 0.3em; + border-radius: 0.3em; +} + +/* line 37, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-anchor { + width: 1.631em; + height: 0.7em; + position: absolute; + left: 0; + top: 0; + z-index: 1; + -webkit-mask: 0 0 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAPCAYAAABut3YUAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNpi/PX7LwOFwAyIG6HseiA+Ra5BjBQ6xg+IVwAxJ5T/HYgjgHgTOYYxUeCQUiBeh+QQBih7HVSOLiHDDMSTgTiTgLrpQJwLxH9p5RhOaLT4EakeFF3RQPyF2o6RhkaBGYkheRmIPYH4KbXSjC4QnyTDIch6danhGCcgPgwNGXKBNNQMb0ocEwXE24GYn4FyADJjI76Ej88x7UC8FIjZGKgHQDlxGtRsZmISMMjy+dBQoSXYBC0gv+NyDD80xzgx0AeAqg4fIH6NHk0qQHyMjg6B1WvHYDkNFjIgwS1ALMowMOAjEAeBHINe2Q0U+AUQYACQ10C2QNhRogAAAABJRU5ErkJggg==') no-repeat; + -webkit-mask-size: 1.631em 0.7em; + overflow: hidden; + background-color: #03111a; + -webkit-transform-origin: 0% 0%; +} +/* line 50, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-anchor.x-anchor-top { + margin-left: -0.816em; + margin-top: -0.7em; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-anchor.x-anchor-bottom { + -webkit-transform: rotate(180deg); + margin-left: 0.816em; + margin-top: 0.6em; +} +/* line 61, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-anchor.x-anchor-left { + -webkit-transform: rotate(270deg); + margin-left: -0.7em; + margin-top: -0.1em; +} +/* line 67, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-anchor.x-anchor-right { + -webkit-transform: rotate(90deg); + margin-left: 0.7em; + margin-top: 0; +} + +/* line 74, ../themes/stylesheets/sencha-touch/default/widgets/_panel.scss */ +.x-floating.x-panel-light:after { + background-color: #1985d0; +} + +/* line 56, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button { + -webkit-background-clip: padding; + background-clip: padding-box; + -webkit-border-radius: 0.4em; + border-radius: 0.4em; + display: -webkit-box; + display: box; + -webkit-box-align: center; + box-align: center; + min-height: 1.8em; + padding: .3em .6em; + position: relative; + overflow: hidden; + -webkit-user-select: none; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button, .x-toolbar .x-button { + border: 1px solid #999999; + border-top-color: #a6a6a6; + color: black; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-back:before, .x-button.x-button-forward:before, .x-toolbar .x-button.x-button-back:before, .x-toolbar .x-button.x-button-forward:before { + background: #999999; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button, .x-button.x-button-back:after, .x-button.x-button-forward:after, .x-toolbar .x-button, .x-toolbar .x-button.x-button-back:after, .x-toolbar .x-button.x-button-forward:after { + background-color: #cccccc; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #dedede), color-stop(100%, #bababa)); + background-image: -webkit-linear-gradient(#ffffff, #dedede 2%, #bababa); + background-image: linear-gradient(#ffffff, #dedede 2%, #bababa); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button .x-button-icon.x-icon-mask, .x-toolbar .x-button .x-button-icon.x-icon-mask { + background-color: black; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4d4d4d), color-stop(2%, #121212), color-stop(100%, #000000)); + background-image: -webkit-linear-gradient(#4d4d4d, #121212 2%, #000000); + background-image: linear-gradient(#4d4d4d, #121212 2%, #000000); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-pressing, .x-button.x-button-pressing:after, .x-button.x-button-pressed, .x-button.x-button-pressed:after, .x-button.x-button-active, .x-button.x-button-active:after, .x-toolbar .x-button.x-button-pressing, .x-toolbar .x-button.x-button-pressing:after, .x-toolbar .x-button.x-button-pressed, .x-toolbar .x-button.x-button-pressed:after, .x-toolbar .x-button.x-button-active, .x-toolbar .x-button.x-button-active:after { + background-color: #c4c4c4; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ababab), color-stop(10%, #b8b8b8), color-stop(65%, #c4c4c4), color-stop(100%, #c6c6c6)); + background-image: -webkit-linear-gradient(#ababab, #b8b8b8 10%, #c4c4c4 65%, #c6c6c6); + background-image: linear-gradient(#ababab, #b8b8b8 10%, #c4c4c4 65%, #c6c6c6); +} +/* line 69, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button .x-button-icon { + width: 2.1em; + height: 2.1em; + background-repeat: no-repeat; + background-position: center; + display: block; +} +/* line 76, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button .x-button-icon.x-icon-mask { + width: 1.3em; + height: 1.3em; + -webkit-mask-size: 1.3em; +} +/* line 83, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button.x-item-disabled .x-button-label, .x-button.x-item-disabled .x-hasbadge .x-badge, .x-hasbadge .x-button.x-item-disabled .x-badge, .x-button.x-item-disabled .x-button-icon { + opacity: .5; +} + +/* line 88, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-round, .x-button.x-button-action-round, .x-button.x-button-confirm-round, .x-button.x-button-decline-round { + -webkit-border-radius: 0.9em; + border-radius: 0.9em; + padding: 0.1em 0.9em; +} + +/* line 94, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-left, .x-icon-align-right { + -webkit-box-orient: horizontal; + box-orient: horizontal; +} + +/* line 97, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-top, .x-iconalign-bottom { + -webkit-box-orient: vertical; + box-orient: vertical; +} + +/* line 100, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-bottom, .x-iconalign-right { + -webkit-box-direction: reverse; + box-direction: reverse; +} + +/* line 103, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-center { + -webkit-box-pack: center; + box-pack: center; +} + +/* line 106, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-left .x-button-label, .x-iconalign-left .x-hasbadge .x-badge, .x-hasbadge .x-iconalign-left .x-badge { + margin-left: 0.3em; +} + +/* line 109, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-right .x-button-label, .x-iconalign-right .x-hasbadge .x-badge, .x-hasbadge .x-iconalign-right .x-badge { + margin-right: 0.3em; +} + +/* line 112, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-top .x-button-label, .x-iconalign-top .x-hasbadge .x-badge, .x-hasbadge .x-iconalign-top .x-badge { + margin-top: 0.3em; +} + +/* line 115, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-iconalign-bottom .x-button-label, .x-iconalign-bottom .x-hasbadge .x-badge, .x-hasbadge .x-iconalign-bottom .x-badge { + margin-bottom: 0.3em; +} + +/* line 120, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-label, .x-hasbadge .x-badge { + -webkit-box-flex: 1; + box-flex: 1; + -webkit-box-align: center; + box-align: center; + white-space: nowrap; + text-overflow: ellipsis; + text-align: center; + font-weight: bold; + line-height: 1.2em; + display: block; + overflow: hidden; +} + +/* line 133, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-toolbar .x-button { + margin: 0 .2em; + padding: .3em .6em; +} +/* line 137, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-toolbar .x-button .x-button-label, .x-toolbar .x-button .x-hasbadge .x-badge, .x-hasbadge .x-toolbar .x-button .x-badge { + font-size: .7em; +} + +/* line 142, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-small, .x-button.x-button-action-small, .x-button.x-button-confirm-small, .x-button.x-button-decline-small, .x-toolbar .x-button-small, .x-toolbar .x-button.x-button-action-small, .x-toolbar .x-button.x-button-confirm-small, .x-toolbar .x-button.x-button-decline-small { + -webkit-border-radius: 0.3em; + border-radius: 0.3em; + padding: .2em .4em; + min-height: 0; +} +/* line 147, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-small .x-button-label, .x-button.x-button-action-small .x-button-label, .x-button.x-button-confirm-small .x-button-label, .x-button.x-button-decline-small .x-button-label, .x-button-small .x-hasbadge .x-badge, .x-hasbadge .x-button-small .x-badge, .x-button.x-button-action-small .x-hasbadge .x-badge, .x-hasbadge .x-button.x-button-action-small .x-badge, .x-button.x-button-confirm-small .x-hasbadge .x-badge, .x-hasbadge .x-button.x-button-confirm-small .x-badge, .x-button.x-button-decline-small .x-hasbadge .x-badge, .x-hasbadge .x-button.x-button-decline-small .x-badge, .x-toolbar .x-button-small .x-button-label, .x-toolbar .x-button.x-button-action-small .x-button-label, .x-toolbar .x-button.x-button-confirm-small .x-button-label, .x-toolbar .x-button.x-button-decline-small .x-button-label, .x-toolbar .x-button-small .x-hasbadge .x-badge, .x-hasbadge .x-toolbar .x-button-small .x-badge, .x-toolbar .x-button.x-button-action-small .x-hasbadge .x-badge, .x-hasbadge .x-toolbar .x-button.x-button-action-small .x-badge, .x-toolbar .x-button.x-button-confirm-small .x-hasbadge .x-badge, .x-hasbadge .x-toolbar .x-button.x-button-confirm-small .x-badge, .x-toolbar .x-button.x-button-decline-small .x-hasbadge .x-badge, .x-hasbadge .x-toolbar .x-button.x-button-decline-small .x-badge { + font-size: .6em; +} +/* line 151, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-small .x-button-icon, .x-button.x-button-action-small .x-button-icon, .x-button.x-button-confirm-small .x-button-icon, .x-button.x-button-decline-small .x-button-icon, .x-toolbar .x-button-small .x-button-icon, .x-toolbar .x-button.x-button-action-small .x-button-icon, .x-toolbar .x-button.x-button-confirm-small .x-button-icon, .x-toolbar .x-button.x-button-decline-small .x-button-icon { + width: .75em; + height: .75em; +} + +/* line 169, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-forward, .x-button-back { + position: relative; + overflow: visible; + height: 1.8em; + z-index: 1; +} +/* line 174, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-forward:before, .x-button-forward:after, .x-button-back:before, .x-button-back:after { + content: ""; + position: absolute; + width: 0.773em; + height: 1.8em; + top: -0.1em; + left: auto; + z-index: 2; + -webkit-mask: 0.145em 0 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAABGCAYAAADb7SQ4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAiNJREFUeNrEWb9LQlEUvj5BcHoQvMnVKXD1D3CLwqBJbHJsazQaWoSCxgbHJiMIAiNok6AhCDdXVycnJ8EQOgeOYaG+d39998KH+HyP753zzjnfd325xfdSgVeV8B6BScuEV0IRSbxHeCMk/AVFXCA8ScQKSXxPqK0fQBBfE5r/D+Y8VzUT9jb94DPimqRYIYkrhGcpKhhxIqTxrpNcExdlQJTTTnRJnCc8ykhUSOIOoZ71ZFfEZ4S2zgUu+rguxZRHEnPbfKRVsOtUl0RtYpOLTYljIS2Z3nVk2DY9SbNCEt8RDm0rUpe4La1jvXSqmtum72raZI24KuNQIYl/nSGSOJb0Jq61M0pxhjwK9304hUjHGSKILzc5Q5drUzttdYY+I97pDH1FzG0zNFUb04gTG4kzJS5kdYauiZtZnaFr4ooKsCIVaDHxKAQxt1NBnGIVHfGCcEQYh3jGU8KBfMKLiyM+lgzAq/qT0ArVTg+Ei1B9fEPoovV4fcfQd2HedScX39GprwGTNjJn0maTELN6IuSzECLB6T5x2eM66jQgnIeSxa60GnS3uL56tr7b1Ai0JPVwYi6yho2U2lgfKym19VxjMRHzEGbvS9K+RBPzetGVUpf29lZHSl2/DMnLvwh1ZMQrKW3Ic4fvJOZS6ZMQW5hpmpT63DvtlFLfm7bBNruM2C2yXb7y3U6ZpRS5P/4jpUjihRTbCJ3q1eL3GMMfAQYAJmB6SBO619IAAAAASUVORK5CYII=') no-repeat; + -webkit-mask-size: 0.773em 1.8em; + overflow: hidden; +} + +/* line 184, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-back, +.x-toolbar .x-button-back { + margin-left: 0.828em; + padding-left: .4em; +} +/* line 187, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-back:before, +.x-toolbar .x-button-back:before { + left: -0.693em; +} +/* line 190, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-back:after, +.x-toolbar .x-button-back:after { + left: -0.628em; +} + +/* line 196, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-forward, +.x-toolbar .x-button-forward { + margin-right: 0.828em; + padding-right: .4em; +} +/* line 199, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-forward:before, .x-button-forward:after, +.x-toolbar .x-button-forward:before, +.x-toolbar .x-button-forward:after { + -webkit-mask: -0.145em 0 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAABGCAYAAADb7SQ4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXlJREFUaN7lmTFqAlEQhh8EhFSCYJXW1law9QAewMrWAwQWAmmtbPcGHiCQ1gPYCla2QsDKSsgmQecvFqImu2/fzry/2OLb9mt23vwz47Kvn5MwEFxM8DkLB6HHEIOd0GGIwUpoMcRgyRKDOUsMJizxpzBiiMFR6DPEeZl1GWKwFh4ZYvAmPDDEqmVWVQxmLPG3MGaIVcosVAz2whNDDDZCmyEG7yFlpiEGKUsMEpb4XKXMtMXeiVVb7J1YLcRgW1ZmVuLSxGopLkys1mLwwhL/mVhjie8Sayxx3kp7DPFVYo0tzhNriyEGU5Z40TjxtDE/F6WcDowHBE/msDFNImG0xZQRBAonDCvxhhH2vKZIZ9Ds+7EDfaWFnKZ4xhja5owxdcnYCAQv1p1Gi4sprn08cZbDt6ZYZasXIn5mLFHTjLCvVt1V+4rVt/M+4r3FPaJMbHaBKRKb3pyKxKZXtv/Er4yjZpRL6q042u34tzh4xV9H/FHnqBHKBQeEd6aqqwD6AAAAAElFTkSuQmCC') no-repeat; +} +/* line 202, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-forward:before, +.x-toolbar .x-button-forward:before { + right: -0.693em; +} +/* line 205, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button-forward:after, +.x-toolbar .x-button-forward:after { + right: -0.628em; +} + +/* line 213, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button.x-button-plain, +.x-toolbar .x-button.x-button-plain { + background: none; + border: 0 none; + -webkit-border-radius: none; + border-radius: none; + min-height: 0; + text-shadow: none; + line-height: auto; + height: auto; + padding: 0.5em; +} +/* line 223, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button.x-button-plain > *, +.x-toolbar .x-button.x-button-plain > * { + overflow: visible; +} +/* line 227, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button.x-button-plain .x-button-icon, +.x-toolbar .x-button.x-button-plain .x-button-icon { + -webkit-mask-size: 1.4em; + width: 1.4em; + height: 1.4em; +} +/* line 233, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button.x-button-plain.x-button-pressing, .x-button.x-button-plain.x-button-pressed, +.x-toolbar .x-button.x-button-plain.x-button-pressing, +.x-toolbar .x-button.x-button-plain.x-button-pressed { + background: none; + background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 24, color-stop(0%, rgba(182, 225, 255, 0.7)), color-stop(100%, rgba(182, 225, 255, 0))); + background-image: -webkit-radial-gradient(rgba(182, 225, 255, 0.7), rgba(182, 225, 255, 0) 24px); + background-image: radial-gradient(rgba(182, 225, 255, 0.7), rgba(182, 225, 255, 0) 24px); +} +/* line 238, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-button.x-button-plain.x-button-pressing .x-button-icon.x-button-mask, .x-button.x-button-plain.x-button-pressed .x-button-icon.x-button-mask, +.x-toolbar .x-button.x-button-plain.x-button-pressing .x-button-icon.x-button-mask, +.x-toolbar .x-button.x-button-plain.x-button-pressed .x-button-icon.x-button-mask { + background-color: white; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e6e6e6), color-stop(10%, #f2f2f2), color-stop(65%, #ffffff), color-stop(100%, #ffffff)); + background-image: -webkit-linear-gradient(#e6e6e6, #f2f2f2 10%, #ffffff 65%, #ffffff); + background-image: linear-gradient(#e6e6e6, #f2f2f2 10%, #ffffff 65%, #ffffff); +} + +/* line 245, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-segmentedbutton .x-button { + margin: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +/* line 251, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-segmentedbutton .x-button.x-first { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; +} +/* line 254, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-segmentedbutton .x-button.x-last { + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; +} +/* line 259, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-segmentedbutton .x-button:not(:first-child) { + border-left: 0; +} + +/* line 270, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-hasbadge { + overflow: visible; +} +/* line 272, ../themes/stylesheets/sencha-touch/default/widgets/_buttons.scss */ +.x-hasbadge .x-badge { + -webkit-background-clip: padding; + background-clip: padding-box; + -webkit-border-radius: 0.2em; + border-radius: 0.2em; + padding: .1em .3em; + z-index: 2; + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; + -webkit-box-shadow: rgba(0, 0, 0, 0.5) 0 0.1em 0.1em; + box-shadow: rgba(0, 0, 0, 0.5) 0 0.1em 0.1em; + overflow: hidden; + color: #ffcccc; + border: 1px solid #990000; + position: absolute; + width: auto; + min-width: 2em; + line-height: 1.2em; + font-size: .6em; + right: 0px; + top: -0.2em; + max-width: 95%; + background-color: #cc0000; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ff6666), color-stop(2%, #f00000), color-stop(100%, #a80000)); + background-image: -webkit-linear-gradient(#ff6666, #f00000 2%, #a80000); + background-image: linear-gradient(#ff6666, #f00000 2%, #a80000); + display: inline-block; +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.action, +.x-button .x-button-icon.x-icon-mask.action { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAFI0lEQVRoBe2YW4hVVRjHZ0yzq6lFEaMlE0PShYRAJIl6iEqKHnqI6WJB0IvdICkfEk0aIyo0KFCph8giCitI7CkoohQL7SoZDaQmXSgKo4uWNf1+zt7DOXvOOXuvvc85bc+cD36ssy/r+77/Xmt9e+3TOzIy0jORbNJEEqvWruBOH/HuCHdHuMOeQOmmdO+ozaA5oxXPunSC2Re4MbgCNiB6vvqbKbx0giNxp9BeBU/BIJqnRecLN2UVrLDj4GIYgscRfSltYSuzYMUdA/0wCI8ieglM5XduK7vgWJhTegGshucRfQHkyj1XpziLNrfmOh2ug1dhMaJn0gbZZDpNpsexQb2y3azfKXCAwns4W5dMd7m2B2ANLCT/x/A/nKknN5mUhWFp1g4Z7vM14jrbBZvgEwi1tAdkDEf3ZrgI0S/RrkP4IdqGpuA+cJo0yw7iyNfJmzAcMrokfjp93HC4XrPYCdzkgPXDPPqvJN7eRh0VrBWqfKMuev6k3Qzr4SP4HWqOFIkZ73iYA/NhLpwPZ4LLS+FZzUp+GtwAA/heS/sGwv+irWnXc9bdTRF20/8eOBWmEKwnCectOrPhSlgF2+Bb+Bl+AxP8B/6FvLn8Td8fYQXMSubgsVZU8Cv4mAeNhC7k+jLYCopzrRURlvZA9P8WLIJJlcI5zi1Ypw+Dr4oqp3EAzlsbLCjfg1PeEUxLtlnXXU4/wQboq8gpl2BHx2l5UuyosuW8I6rQb8Bp1iwRefy4VN6FReaopU3pX7jnhwSO7MmVIiNnJ3L+DtgHCm3ltA0RH4/26rhKk1tdu4kr7yeuHkKgU3rMqI5ncfAQDIKbg14oi1nJv4OvTShthC9LjmTyGB8XwhZw+oQ8+Xbc68C8AOboK6+YYPpfDV+B06YdAkJiuMtzhvrOP1JYafMLpu/Z8CmEJNGOe60fz0J/cjZmWcP0G2+sWZ/aUnCqhFosOq7gyf6uOT888th+Ot0HmxF7MOkgt2AcXQNLkg5rHPv+dffjVvPX6PdeWtf7MJhUssD578ZtEGL6sY4MIfTjeh1zCWZ0Z+DwQXAkapkjtzviPdoPYB+JuJVMNfy7QQkR7MbGPfRaYhi7ruUSjLcbwe1k0tw2vgivwy6C70/ekPE4JK+N+HySWDuz+A5xXOnvlsqD6Lf/QjwBnxNc4a02YwzBeuIdyBosWDDT7RKcn1MRYA+/V8ImAv9Rcb5VP53ufoQ8AB8S0+PMFiwYz5fDzCjCF7SLCbojOm514zZ3HViYLIZVxmD4h8B0rtWtFXkEn4tTv22thPe2SawVeDs8TTz/NqoyhLqDGoC7wervt3lNCxKMY/fIc+BLuJXgn9G20pyuVuA1sJF4vt7GjHx8nZnT7XAXzIXnoK4FCcbLVHAqLW+DWF8v78Aq2EY8v7zGDK2+EmfBI3AtTAPNTU1dCxXs/a6ht+t6bM4FNykvw/0IdYSrDLHu8iyeQ7Cg6mLKQahgd0pbSOJwit/cl6Np6p+BrxGn6hNUp1z3m/tOWAH+DrIgwSTQcBcTFLnOzcRwSjZ6j/vdvQyCxRrSanu0mWvZqp3LjkbBuYTGnSac4CxreCQqJPFD+r/bhq+dtOSyCO7DyWzIcm9avKLXXb+FcskiYjlBfB0lP9KLJp+nv6N7ZL+cp7N9sgg+L6/zMvabcEWrK7iM07CZOXVHuJlPs4y+rNJ74JkyJpczp62N+vWOfpw0uqWzrnXXcGeN53g13REe/0w660x3hDtrPMer+Q9LNCcV91c+jgAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.add, +.x-button .x-button-icon.x-icon-mask.add { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAABqUlEQVRoBe2awWnDUBBE843B4NxcQSAFOC4lJeTkoxtJDykgvRhcgCFNJCFgIs+ChEHSJX93YT6ZD4ssmR3NztNFH5Wu6+6iVynlEZpbp+4J3s5OjWm7DRxZuMMCdUB9oyzNmrJe01hEejMtM5exIh6bCI3JbFkDT27EckEDs5DI8iHCWcmy6IowC4ksHyKclSyLrgizkMjyIcJZybLoijALiSwfIpyVLItuOGFso/xiuEvAgJdeK0DqJrHEhtsTTh9ul9y/ChR2KE+Y1ruDt2ccI7d6PszcK+oFFblWELt3Cn6i/8epMW5/W+LKGrUZ/0NwboF5QxuPsfY8dmOxJs41cBOYHCZF2BFeE60i3AQmh0kRdoTXRKsIN4HJYVKEHeE10frvCNvr4RH1HojH3rGHr3hqA7VdkxPKvuKJ3AA4hn7BM3xxA5N71Fdv1gz/tax3P+hFHmsJwM/8wraMadqOh5GuXda76rVqNWb7wgeevQvRRQ1MBCPFiginxEokKsJEMFKsiHBKrESiIkwEI8WKCKfESiQqwkQwUqyIcEqsRKIiTAQjxcoVrP83/9czD9EAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.arrow_down, +.x-button .x-button-icon.x-icon-mask.arrow_down { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGRTdGMTE3NDA3MjA2ODExOTJDQUMyNUQwRUE4NjdEQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxQTFBMDFDQ0I5NEYxMURGQUU1RjlGMEFERUNDQTVEMCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMkRCMDIxMkI5NEUxMURGQUU1RjlGMEFERUNDQTVEMCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjMwRTE0QzVBNDIyMjY4MTFCQ0ZCOTAzOTcwNzcyRkVCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFN0YxMTc0MDcyMDY4MTE5MkNBQzI1RDBFQTg2N0RCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HfrH/AAAAeVJREFUeNrs2cFHBGEUAPA3zYqIiIhOnTpFRHSKrp26RqeuEV077R/QqWtE166dOkVERHRa9hQRnZalFcv0Hk/W1Mx+38z3vvlm5j3eZW+/9+abne+9KEkSaFPMQMtCwQpWsIIVrGAFK1jBClawgo2ik/4hiqJGwLKuvfpIc5xSkWqYr5hzU1s/mRNxXTPsJ+ZqluvXlwOmSj3XBDvG3M1rpAmYYoUrFzr4ZNqTawqm2MH8Dhh7ZXJUbcAUx4FinzBnJcAUl4FhP/jIgRSYKvkYCJaO2LbNv08RMMUy5nsA4COTLy0XYIqtil9iF6aflq7AwBWuAvuQ9ZKSBgNX2ieWjtKSzeXBNZgqfe8J+4W5aXtbcg0GrvibB/BhkeuhBJhigzsghT0veh+WAlMcCGHvMOMQwcCdcIntYy6WmXhIg2PuiAvsEHO97IhHGgzckb4D8L6LmZYPMHBnhiWwXVdDPF9g4A4Vwd66nFr6BAN3ygbbw1yoMzjmjplgB5hrrufSvsHAHesZDOD2JAbxVYCBOzfIAZ9JbR6qAgN3cPwP9kZy1VIlGLiTdluCmoOBO/pnS9Bk8DzmS3pL4BMcpZEe1qX0GI/atC4dQYXRMa1MU0IX4gpWsIIVrGAFK1jBCnYUPwIMAPUPAyFL+nRdAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.arrow_left, +.x-button .x-button-icon.x-icon-mask.arrow_left { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGRTdGMTE3NDA3MjA2ODExOTJDQUMyNUQwRUE4NjdEQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGMDZEQTFBREFDOTMxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGMDZEQTFBQ0FDOTMxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFGQzJEMjQxRjIyMDY4MTE4QTZEQzUxMDg5Q0Y0RTRFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFN0YxMTc0MDcyMDY4MTE5MkNBQzI1RDBFQTg2N0RCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+FXGmxAAAAghJREFUeNrsm09ERFEUxt+rxBAxqyFm1SqiRYpMSpFapUVaRGpTRIpIbWLaFJEoRZtilChRWiRKsyklilYRERERERGZvsN57Wfmvnnnznkfv+WM+bn3e/ePN24mk3E0pcRRllC42FOWy4dc1w30R+fz3LFthEs1TelZ0KlBuAIcgmRgHS5gqlm2RsNTmqbvrUlZycLT4BhUiliWfEwEbII+UeuwT4nzqNZq2Gm1gTu/ZaUIj4NTEBW7tTTY1zUwKH4vbaive6BBw2kpAa6DkA1CeBicgZhVx8McUg5WWNi+83CWiXFfE9ZeAGQR6ukBqJKyu/Gzw7TcXEiS9UuYbiWWeU8ckXYqMT2lozyFW6SeOU0K1/FhPS75RsHUlKbj3KV0WRPC1Nd5sCuxr6anNPV12zFwk2jLCCdtk81XeAIsahL+BVOgH3xrEPayA5rAixZhyj2oB2ktwpR30A5WtQh7vR4DQ+BHg7CXLdAMXrUIU26411dahClvoBVsaBF2uMsjYFRCrwt5a7kOOnjUVQg7vE43cr9VCDu8I6Nep7QIO7z3HgCTvHYXvbCXJe71hxZhyjmv1w9ahCnP/DDb1yLs9boXzGgR9rIAusCnFmHKCff6UYsw5Ymlj7QIU75AN5gz9YVuLu8eB/S+dA+v1+l83pe2Sfg/BRe2OeGfPELhUDgUtip/AgwAw4tbozZtKFwAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.arrow_right, +.x-button .x-button-icon.x-icon-mask.arrow_right { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGRTdGMTE3NDA3MjA2ODExOTJDQUMyNUQwRUE4NjdEQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpGMDZEQTFCMUFDOTMxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpGMDZEQTFCMEFDOTMxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFGQzJEMjQxRjIyMDY4MTE4QTZEQzUxMDg5Q0Y0RTRFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFN0YxMTc0MDcyMDY4MTE5MkNBQzI1RDBFQTg2N0RCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+xvZexwAAAhhJREFUeNrsm8FHRFEUxu9rxhARsxqiVauYXWoTpTYtUkRqlWkz0WaiTW2iNi3atGhTm4k2E5GYSJRaZcZQtIqIISIiYhgyfZdv/oF59913X+cdfst5733u+c495743XqvVUpKiSwmLWPB/j2QnP/I8L9SH9lN3/KxwQlpKT4FtaR7eAhegR1LRmgEVMCCpSg+CGtNczLbUC8pgQ9I+rCv3LiiBbkmNxwJ93S+p08qCRzAhqbVMg2tQkNRLa1/vg6ILvrY5POTAXdi+tj0tDbOYjUoaDzPgBuQlzcMpcEhSkg4A8lztjBTBin6u0d8iBOvoYwXPSRGsuEcXuWcnJAhuR4G+TksRrGOMfXhWimDFjqzCyUuE4LavS5yxExIEt0OfopRN+DpKbx6MHAtHSfAeWPN7kWQEhDbAMjg1cTHXBdfBLHiSUKXvwZBJsS4LPgCT4NP0hV1L6SZYAcdB3cAlwe9gDlQlTEsP9Gs16Bu5IPgIjIOP/34AoP26Ss82bd00LA/r1Vzk1mM1whCsfTrPpsJ62E7pE/q1HpaPbAn+Betgib1xaGEjpb+Ywrcu7H9BC35m8//mSncTZEqfgRGXxAYpeJNp3FCOhemU/ub+euXqzGlS8AuYBq8unyiYSulLNv9OizUleIcr+6MiEF4n3x7ze2n9OkSfE5/bfmg/30v7ERxaWBcc5Yj/5BELjgXHgiMVfwIMAGPkXbHq6ClAAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.arrow_up, +.x-button .x-button-icon.x-icon-mask.arrow_up { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGRTdGMTE3NDA3MjA2ODExOTJDQUMyNUQwRUE4NjdEQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDQUZBQUM3NEFDOTMxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDQUZBQUM3M0FDOTMxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFGQzJEMjQxRjIyMDY4MTE4QTZEQzUxMDg5Q0Y0RTRFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFN0YxMTc0MDcyMDY4MTE5MkNBQzI1RDBFQTg2N0RCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+ar3jxgAAAbFJREFUeNrs2j9ExGEcx/H71YmmpoiIaIq4KSKi6dabbo1oiqamm1qboimiNZpuuikiIqLppiPipqYjIuLp+/D95vy6X/frfr/n730e3sst53XP9x7u+V2ilKpM05qpTNkCGGCAAQYYYIABBhhggAEGeNSqpl9IkiQKWNbvfBc7PDdNIz1PPVK7Trd+OMPrRr8l9Uat2nT9+CyCW4yVnnnHowTXqa8UWHcdI3iNGozASscxgReo7h9YxTtfjwXcHoOVBjwJQYNPcmKlLk9EkODGP7FSO0TwOvU+IVjxZAQD1iPZK4CVGiGAZ6lOCVjFE7LhO/i0JKzUK3KImQY3S8ZKHZ4cr8A16sMQWPHkeANepF4MYqWmD2A9arcWsIonqOYafGYJK73yRDkB71nGSnd5r4jKBG9Sn47AunOb4CWq7xAr7dsA61G69wCreMK2TIMvPMFKfZ44I+ADz7DSQ9YhVgS87fiQGtdlmeBlvkNWnndYBljfGT8FgJVDbKco+CoQrBp6mrEyKfgoMOyvpxlZ4CT9vcXj0shWNe8nE8vCfzwABhhggAEGGGCATa1vAQYAZekAmr8OukgAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.compose, +.x-button .x-button-icon.x-icon-mask.compose { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAF/0lEQVRoBe2aW4hVVRjH54xa6nSzm92sHiZNorJowMpxrDEoyECiUUpztIkeeumpoCB6rAwi6FHwIXqKXkqiEE0no0QNLWwyspmGsruWlVqp0+9/2t9hz3Lty+mcfTnpB/9Za397Xf7//a219lr7TGVsbKztZLL2k0mstJ4S/H+P+ESfwEqlMhn/VNAJpoOjoGibAIFfwDbWnT/DZOCrex34D4b9vvw4wVScRKEu0AcWgQtBmYb9DvgsA6OganCWhgFwL/lHEf35v3ci/mqVFrAO8AT4FugJHge6URZsg0s3aDfOAe+H8f0INAo3gavD9928iT2bgqvBYVAWgWEeG+E1G0wwAeQ18hTZ/cDKSvROECnaBD9Iod9DFa2BMqSDEgAqjtiH8H3v4XwM32ZwlZUPp/jbLgHDoAziXA7r4aXIhsVqgZLYA8Atb9eK9BbQGRarvOwxEDdfdU9D/UiOUH9bwTixAWGJ/QmYuKhUojU6xomu4HgL3AV89ipO3ZdYlc3LJOJTsAeR1bAEr56V+J4H00Aa0/D+BNxPM0NW4Wcyvqe0G7+Gu5b9IhAexnrYq8A+4OMa55PoDaA6p0kjG1jHvVqnetBFQBxAP9CrJ27qxYm2OX25IhdlxxGoRgqzYFOxHAIvgHMbIKKF7iIwVe+yMtsA5F4CjYiVPu2+lhG/z3QRNRTeKGIIB4NKgXgEHIrhF8Xb9WuxmmVayhphLVDPgimgEdtL5VWI3RNuxH0idp17hCGlAOg924zISmyXRdbSskVYYjVnmxFZvXt14DjBLKJummuEYXU3iNsuuvyirnXam2cRddNSRJjXj1bjteAc0Ih9QeU+RG6JayTqSeUSYYhpu/griOKR1j9MGze7EXWvKRPZUaaC6VebAYltxrFUYue64nzXRQ7pfki+CDpAI6bVWJuKD9M0Ere1TFO/7jLMV+2NbTXWh8JGTDuoxYjVySqVFRFhfV15DjQqdoQ2BuoRS/mqRS0KTZ3D9KTISuxvIKrPtP5R2rjFnaP4Ek93lInsvGmC6eM00A+asRp/RTu3esRej3+G63evKZOL4HvoJ/x1MW0k3XI/0E6PR0Q3/o/AHPeee53XHO6DzDRgw5ls3fYlNZYgYHO4JmvgfVy/DjqBPhDEWuaCIXQpDOYELNaQPg4SiQXlLfmazErEvmsOpbQ9j+RlcAH4G6Qyd9jYdVPmMAx6wDEgkXOBHrK+lIqg9RWXSmy3OzTxzQcjwOrq29x1bjn3mjK1ClbR0oYF07Z2U08FfewiPV8EMK3YOu8midYCNd9DWpHVSm1clZZC8HkQ2R4Qe4Z0kpEnr5Vb36oU+TBxy2uB6rXyluK7AehAb+UsTSU46zl8BcRuBBrSg5CuzTPyf+HTfPbNaUVvKWU2kLq2BMdM15n2OmvBd0BEw3cHGPaQ0r1XwNuhe/r2vAKxG0O+cNbWg7AvdT6zvTQrqH5rXhowWYeAqmD8Z+DTqroA9IKFYDqQSewDlN2kiywsM8GQnR3gCOkQQmeRanhL4J1Av2qY6SP7XvBklmLVWZaCV9D+6eAQ0DxVVK8EZiNkPgDvAS1sQ4jV2ThTy0Qw0ZwM69sD5joVdQV5iV8P9DOOxO5DpL5j5WaZCIb9AqAV+ij4A+hw/maA/XlEkr68lpXga+ltKxgE2sDs9vZegDMrwWsQuboAPYldtieW+A8F8p6X9VDMRHA9BPIuGyd4LG8yKfuL46WdW6xJcFQDU3i96LRTGoOPBGmnligsirQWre/AxZ4C1+DrpY/3PfeKcl1Gxz3AJ1inrsR3uiquBf3AZ9/g1FFMjZXBZkBCW1Sf7WSx1NEx0bSv1QZBQ7tVoYA8jeDEf7yhXNuZ4B2gSq0qeBjuM1MJViGsB6hSK4rW598BMO6/bKPE14YAFXQ2HQWtMrwVnINAYmufjqKEmr8mOIj0bVTWSUYb/qQPbBoaRUABOQz03znLwUQTkyat/hZDpZrxGjqLi4VgMbgJ6L1XFlNUPwYKymvgACL10FPbCYJT12zRgnFbyxaVFE/7lOD459P6d/8Bhs9x6sTqrJgAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.delete, +.x-button .x-button-icon.x-icon-mask.delete { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAGcElEQVRoBdWbzYscRRjGexY1EPK9u9mVoJH4cVBPCYR8mB0IbkISyB/gOYIeFSUQQaIX8eBBDKuCsBFFxJuieFCMEb9RiZrcxKOgB7+i0RjN+vwm9Q41Nd0z1d3Vk9mGh6rufut93l93dc9katNaWlrKymytVmuD4mek7zX2YpmxqWJVwwrl2iL9qBp+LpN3okywjNYo/qh0Sjqi/ZVlxqeIdZ5HXA1HXU3xqbnDMVJGYJ+UzktMi1+le6VrY8aniMHLeeJNDdRCTWti88fCTirpSemChJHpT/Uflq6LNawah4fzwtP8aanppDQZk3sosBJNS4tSCGumf+jcMWlFjGGVGHI7D7zM12+pjRqnh+UfCKwE66SXpL8k3yDsc/4+KfmdJqfLHVMDta4bBF0IrIFrpaeloqsaQvM83S8lgyaXy2nvjdAz3KdWal5bBJ0LrAGz0rPS31KYdNA+8Y9Jtac3OVyuKjVQ+2wedB+wAqekE9Iv0iC4onNMvUelytCMdTmGTeOiGqgdhqkQugdYAdzZBakqrBXAXXlCWhkaDttnjBtb9s6at7UwwNJzp7vAOsE3KKaCfcbZwKrtP8r1oBR9p4l1Yxhb1dcfBwtMG+xCd4A5IHFHfpL8AXX7fFw8YGbDWmIlxtT19cfDBFsHWm22UVqUfpP8wFR97tbxCNjjikt1Z8PaYYMR1uwRidd5GJRyn39k8PaeCME55s4Rk9IzzAUjrNmcdEb6VwqDUu5fUv6npGsMmr47xrmUXmEu2GCcs2d4v3Y+kZqaUlbAf/J4SOKuIvocs/NNtDDBtp8L7b+lt+vgaWkU0M/IB40CFqbt3VllnQ59lu3Tyc+kpqfYZXmgJu6o5YQBln09jD07WdZSwF6JKdA0tBXWREvtMMDS6mH0d6yvoLb0sdT0lGsClpqpvW08ftt9hv2D9LVxdb6Vmn57p4SmVmreG/LYfiGwg96hwd8sE2hgqXWHweW1A4Ed9AElOTfm0MBS44E8SP/YUGAHzfQ+O6bQwFJb4TQuDexBj9v0tmkcBdvh8OmH9XUVt0nvSE1/7415kVEDtWwbVrd/PmpK9wzIsq0y+VLi6sYU1kQM3tSw1a8tpl8amKTa2s7wakAbbDsGMIypBOygdwr6C6npr4j+DMELz50hSOx+ZWAHvVvmX0mj+EaGB167Y+Hy4iaUoM7GW/sHiSvf9IYHXnhW3/KuQswxOa6SFqSqP6X6UzW2jxeeq2JqzIupNKVlyEri81K4sBVbeJ04PPGOXjH0wUsDy2i19IJ0QapTeJ2xeFPDah8mpl8KWAbc2cel36U6BacYSw3UUupORwMr8aS0KF3NOxteKGqhpqi1YWZAFLASrpdelMYJ1uCpidrWJ5nSSjQtvSyNI6wPTY1JFsRJNMqPHoMo21IjtVZeEJ9xCZYDrF0cg54pmt65z7BAp6QT0nKC9aGpvW9tOPel5WAX1KZaNrVCRtlSOwx90D13WAEsiD8nLWdYu7AwwDJwQZypUHf13wwHtWfkgwbFpDhnf/rQtyC+SeZ8Px3FnX1LPpud6KcAG5QDJtg2dZ5hdTZKi1JTC+J+MZ/K5yZ7g9KXOObHNNHvWRA/JsPzIzB9Xx53GKy1HJM41wSonxNGWLN56Wupyd+nTiv/rQYZtpyTiPELTNmHDcb5zltanTnplHRRSmlErjek60PIcJ8YF5vaHybY5vDsfizpwB4p9TLp68p5SwhXtE+sxJhU0JeUC6Y95tkF7tBn2SGd/FxK8VcAHyjPzVLP+qwZ57XEujGMrQsNAyyHfK8eYAfNM82bsw40KwJ3Sn1/teOb5/UZ48aSoyo0tcMwH3r0ATvogwrmzwWq/Pz6nsbdLpWGteIY63KQqyw0NVP7Qcvnt7nADpq1YZYzeA5iTV9T7I1S9DT2i/H75HC5yBnrT63UXLhGXAjsoNsafFaKudOvKG6zVBvWwMnlcpJ7GDQ1Umvbxue1A4EZoO2wSzToc/ptxdwgJYO1YsnpcuNRBE1twB62cUXtUGAHzTN9TsqDflPHb5OSw1rR5HYeeIXQ1ERtuc+s5bA2CthB80yHn9P8pDIrNQbbLfQKNF54GjTPLDUVPrM23tpoYAe9S8k/kjB6VdoiNQ7bLfYKNJ54UwO17LLzMW2nWA2K3vQ/we5S8N0SL5LvZHI5enCCQPnzkcU3snukd+X/YZm0/wPdHqnTTpY+CgAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.organize, +.x-button .x-button-icon.x-icon-mask.organize { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAEdUlEQVRoBe2aS2xMURjHjbbqUaLoI7RChQUiGo9YaEqkoolIkCASSki68dixsLIVYmHbkJA03UgkFRI2QgRBKl4RgtJFK0jUI+o5fv/p68ztmUlHzpzO9PZLfjP3fOfcO9//fOeee+69E4lGo6PCZKPDJFZaQyc4N1mGI5FIMfUVkAfZMPaVwE54yqn6i+8BllQwravgAEyEv5DppsQ8gYPw3hqsJi0bNJ4El0GZzSa6iHcbjLbpsp7DDGX5V8ByyDbLJ+CdUGQLPNGQnkzj3TDFspN68BNkwhDPIY5poG/T1lBYR+LOkuW4uSeR4KXssN48grF9h20NdeukYLRL96Y6vAD2wCwwbQyFvXARPpoVA85fKnXiN4HtvP2Gf0tPG3XWUKNYT4E6PxjvD3x1EDHPZZvgxTTSDBc8gMrKbql5gKHeJh7NM6/AFu91/EVmjHGTFmN+HA3qYSoE7SuO8+zcEawY4vJdfr8Z/ljiqMS3AV2RvjpTPc7V0A623rqJv8RsnynbxDUXXieJuy/LfRmmEzSd7wKtroL2Hcc5BL4LVmRCmbheEIfmHduVQ1muQV/3BN2bJZyqaANbdm/jL+xtm4nfxKcsP08Q/zX8MxV3TDXqx+PYBGUQNHVAI9AsYrsuB9sPVflDT5xH+O7OZn8kK9msJf6G3ooFOOr66+O2NOVL6A7oP/njmmREQcN5LGhy1cLJtBwK++FSLqrVSGvPcrCZGu8DZTqTBSs+zUkarTZTUrerYh50gHYY7rSpRxZCCYTByvouS2FQK42hE9w7S/tKsOaIt/AGfoMWO3OgFLyYb8FaGByHl6C1r27jlsAh8HaN14LD1+x8jN/KNVdqlAvhgq8YfJ/DLYjVUDatk8J905HObd+Cf1rEaHTp5sSL+RacaKWWyO+8E3wLdi4g1QOOCE61x7Kt/UiGsy1jqcY7kuFUeyzF9ok6WA8ZvJjLtbQWEI/hXpLIW4N1rLyiPHV5hP9MsM4or2V7hlH+702XghWE3gAcTRKN3mjY7AZOdZbNCnAug4wTrNXSItCrmmYSZ3tGTNVAo+1nvCLOyLyeT9WC7WlqXNtUCq7vlpTlGkQMeG+Vio9j6NbxMOjtn8u7udjzaJcH1H3uLViVikCzLftqEtsKbeAyNh3LuWAdVM+yr8JsU8hgt9mvGh6ATousEKwgdcvXCMWDFap2mOYBTWK6b3YtNvYDrs9hM0i9BTgB+YMRTbvp0AS6bzaP43I7LUPaDFBvHPVmIy+ZaOp1+TkJX8Dc3/V22gUrYF1jN4L1r0T4NSPXg+sZ2dZZXgRr5m6BymCW8en6rc54BrYAXfu8CFbQmoQ0c1eYoilXw0NQp7gWZzueN8H68S44DbG/IPA9H66AL7FR12tpYk9qetOwGfSaVjcMNVAFie6iqHJv6bws2YaUfLpctYP+S5WoTVr8vjOMvphN4FN4N69Dybs6yw+OCLZ0yrByhS7DmrRaoQE0Kw5707JOf/UvH/ZKewTG/kscFrHSGbpzOHSC/wHSRhVOrpN3ggAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.refresh, +.x-button .x-button-icon.x-icon-mask.refresh { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAG1ElEQVRoBc2aa6hVRRiGO17yrmloWpqhllH2wyKSEIsIo8QorLSbqVRgJd3DyFAQIyIiKQz61cUgpB+B0EWii4VkGFRUJpWKphZaaVZeutjz6FmwOnuvNbPWXvvs88HD2nvNzDfzrpn55tvrnLYjR44c1wpra2vrRr8jYC9j+KOzxmCnrTL7ng2LEN+rswbRSsH/ItL+Fwqij+8M0a0UrD5Fa0vg2c4Q3WrBik3sVj480WzRXUlwG4Lnw9OI7p08haqvXUmw2tzH8+AhRPf1RtXW1QSrz4i9CJYjepA3qrSuKFh9PeEWcE9XOtMtE0yyYYROojQfa0zRc8GZ7l9TWvJGj5LtCjdj0AYll6uD90HLQMizZKZ70vzOKjKypgpmkONQMxpGwWlwAvg9STLG8jlkip4FO/H3GKJ/DzXIK2/DQV554TIGdQaNpsNkmAAjoYpj5i/8rIIFjPlXruVMwY1Czy7X8+Al+B4OgU+yag7i0wjereyYqxDrDD4Ku6FqgfX87aGfR6BPGdENCabTqfAh/A31Btesez/T32LoXVR0KcF0NByeBPdSs0SF/Nr33VBIdOEoTVDyKFkCN0OlSQH+Ys2HsReMF66ueCuyJPDqzD4HvqEIzUCzyk1WtsAcKBy8opc0zgfBU+A52CwxIb+K3Qw3FJmodN0owXTgseNxsA9Cg2pm+S76vyktoOjn2D3sfjVAhFJBqmSax8km+BZ2gBnUlXAmhMyH+B3cj8DVocq55aEnROOJsB7MdIrOnnt9DVwD48G3lAPAB21evRRCPl3G22FaaKwx5blLmk4c2DNQdN+aaa2DKdAvayCULYQ8wYnYhpZxuv+QYGf3a/gnMLD0oH+h7mIYnO6o42fK/bX0MKTbpj8nYmd1bNvI98w9zHnbh8FcDSPBwcWYe/ReWMOgfEhlTbH6ugs/75Z1Urdd1tOi8qnwGcTO7j7qXgU9snym71Mva4bt70uYmq5f1ee6M8zsOphJoOiY2XVGlsEbDKxY5kOjlLmkt4Iz+z7Xyi1LjD/QJ4PLOsbWUmklGMkbsc00fqBZYh1Y3RnmvjnyWeDREbL9VHgVdjNQZ6is/URDxb5e1kFMuyzBij0ZzLBC5n5bzUAbmV2Titvx8V6os0bLs5b0aBz3j3CuyA/A36dlzK2zFTpFrAPMmuFRlPWzQsDMpN6BMoGqO+2+h9tiZ7Y9mBpXQivPIHoYvzXjyhKsUwcUsoNU2IRjj5JCRhtXx8rYRohV5Bh4EExP8+KFK24VfAT/syzBLmeT+5Ap9LdQpYrKFTwMrgcF55k/Tj6FGsFZe/gUKhupu5q5VGOCo7Nv3RrLEryLmgdqarf2hjPsyssac9ToshobjGKepO1jzuqowQQqGVNOj+zvMPVMdWssS/Cf1IwJRAa3CcSTmABX03nBG451DMTEFleniUyNZQneQk0zqJC5xHw3HTOIkK9QuYHqQsgKtOn2Ct6ZvpF8zhK8jQou65DZ+UXQ1ADHCrKfyTAWQubK/AH8XV5jWYI3UtOzLMZMQ2cyqGbOshnZDPBYCpn79xuouyWzBLskPodDEDJf394IXiu39vgwEccXQyjDsn/H/gkovMayBCt0Hdg4xi6g0rVNmuUT8b0AzA1C5vnryjT7q3sOZ77TopH7ZQOYj+oohH89NAuKeuPBgDL7Tsrw5SmwHEJ9J+W+bLR+/8RHx2tmpzRy3yyCfZA4DF23UfcK6Nmxo6Lf8WFUfhzM10P9JuUeRZfl9ZUp2EaYeycJAInT0NU/ct0HQ/M6ziqjnft0PLwCsavLMbkNV8OQLN9HNeUWHjtfn8eJiUhIaLrcCPkaTIHo2aau+3UmbIS0v5jPnrtz8vQEBR+tcOxVz3qcmWrGdJyu42y/BXfAJKjZW9w7CaaBy/djKDKrSV/mDCsg+HCj/qmF6DsPZ8tgOJQxV8geMBnwszPobCp2IAyFYVDGXE1fwAwmaEvQQWgJtM+ySYWC90PyVLvC1aPHQHl5jI6jWqIrHpuFl3F+oAuJ/pGxzIXoP4znRumODwPHI+BFcFm2eoZ907IEBnQcZ973QoJ1hLnnXoBWiXYZ74D50CtPXL2ywoLbRRtwloKBqDNnWrEGvOugVEZXSnC76O506o8GX8QbKZst3KPnTTi33szF3istOOmAAZgVrYBm/SeeD/MruAf6Jv2WvUadw3QUNM5q30ZcCrNhDMT8lKNapil0LayCtxG4JbNmgYLKBNsnortxccbPh+lgBuUvnlhzW3iumpaaofkzbzvXyqxSwelRIb4f3w1u58AlMA6GwNkwGEwhN4PZl0vWWLABDEr7EVr3BzxlDdl/zhnCj3tOo0oAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.reply, +.x-button .x-button-icon.x-icon-mask.reply { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAES0lEQVRoBe2ZSWgUQRSGM24YTdSo4AYRTcxBEZJDJCoigrtGg6CIgihqogfRgEERguhB40UP6kHw4kEET4J4E9wPAdeg4ALigjuKcSMuMX7/mAmdSU/SXdM9PTPpBx/T3al67/31urq6K5G2trac3mR9epNYaQ0FZ3vFwwqHFc6yEQhv6SwraBc5YYW7DEmWXUhZhSORSC7UwKIgxzAlghE5CZFHoAEKgxTcz8/gCI3gfzHsh6l+xnLq2zfBaC0miXpYDvmgu+kXBGqeC0aohK2D7TAF+kPamKeCETseZdugGgZDSp4RxHFsnghGqKo4H/aB5uoASEtLWjBiZ6KsFlaAHlJpbUkJRmwl6rTcFKW1SktyRoIROhofdbARhlr8OTkMdBPNlWCE6iG0AA5AqRN1Nm1cxbTpn9Qlx8ERO4pIG0Br6yDDqH3pV4kvPdRewCd4C+/ZPdWx7xZxsk1LgqvIZDeUeZzRT/xJ8Dt4BQ/gGjSSVzO/3psEJ4JoY+A4fATNvVTwhjh34RSshMGJ8jO5biuWIJqrc6AJ/kIqhNrF+EFs3fqHYRoMMxFp7dNFME5Hwi5QMLskgrqmgb8M+hgZYRXh5riTYBxpFM9CUKKcxlWOSyHPjVi1jQqmYy7shQ/gNGjQ7f6Q6yWY7UY07XNK4CK0QtAiTOK/J29tLOQ7EU67nIGgtfU1mARMhz6a3zegtCfRHXOYxhXtndJBgGkOT9FQ1Z3oDsFqhBXAFngJpkGD7veN3NclEt1JcKwRHaaD3niCTt40vh6+q2N6rL+2gtUA03p8FL6AaeAg++ntsNwqNqor/kL8OZ2WgF71vEpeq8FvC36uDveJM8qqyenHwzg67oE1MAxMTeLOQyNod0SDqO2hCaDVIma6u3R9OAxq/9WxW9PT+wRsQ7RiE7Gbj4f4v9F8Fujxb1ptfR2tj/cbf04bfbbqZWgsFEM5LITNcBLc3HF6iM2IxXAlWJ0wJXEQfoFb4RJcEwtu8kv/PCiEGdAAevFQJbvL5Rh/j351uRbcLloVmA83ewgUn0TSgq2DRGzloVt9E9yDFoiPqfOvUBHN3erA7TFOtG6fBqdfVp4KtuZLDqr8DrgDdqIPcb2/UYXjAmmu1cLDBIGswX0THMuJHIrgDGglsMZu4nxI0oItgcbjUHP7MyRaanwXrHywvlAFj8E6v+dqZ8MTI9BzHO2DtaC9KY1wIEYurXCO4JrbjyA6CvzO80wwznS3tMAFDpfBKdArnkY4ECOXqwTWUqZvA1mJp4L/+4wKf8ZxDeyE26AlLBBD9HUC14GWr8mezWEc2/oiiNZM/TumGbRLkdQ6nChOT9eJWw3ffakwjjuMRF5wUg9b4QnE5hOHKTVNsSuO3qW9SosN/Yn4KmAQbnnl040f4pelVLCb5Pxq6/st7Vfipn5DwaYjlyn9wgpnSqVM8wwrbDpymdIvrHCmVMo0z15X4X9rh8wHLEjawQAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.search, +.x-button .x-button-icon.x-icon-mask.search { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAGdElEQVRoBdWaa4ycUxjHd9rpbm2bqKhiUavbVZdo0LCyLl3iHhGEkkZsKBYJX4RISHwQIYIPNJoQlUjTuCakUZ9oVGRF0GywslvqbgkpDarqsn7/6XsmM5n38pzzvtudeZL/nplznvM8z//cz5ktTU5OtuWRUqk0i/qdoAN0gcXgP+CkzIcx8APYBXbi82/SaZFSKGGILiTibnA+GADHgbkgSXZT8CF4GwyDEXxvI92r4k0Yoj1EeAG4CvSDEggRkX8VbID4lhADQXXUwxZgfAF4CGwFmgdFYQJb68HJljjy6mSSJZAZ4CLwESiKZJydb7A/CGblJZVWP5UwzueBB8AfIC7IovO0mK0B89KCzlOWSBinWoBeAkWTstiT3948xJLqxhLG2Xzw4jSRdQ0yiv/upMBD8xsI40Rzdu00k3WknyeO+aHk4urFEb4TJ/80CWEdYB4BhS1kdfswe+zpGNf80RYUIr9QSdgOdNCYCfaLcABpqFxBbymu3FIlDFkdD18B5wRYHaHOJvAeGCU4fa8IdnXUPAaoMZeDk4CvfEKFM7CrhswnbpxjZQX4C7j5Y0m1d64EXc5OWoqeFsPLwTvAYt/p/Iv+6jTb1rLKHMbYgWCjZxCb0T/e6qhWj3o6hz8HRMSRykp17l5WayfksyN8oafzTegfHOLQ1aG+blc6ZGQRdeVawB4GlWno7Pim1G9rB08AZzgrfRfdw3wdxelHvl/38K01Itc2Rf22Q8BPIIuoynXQL/SQj71DwcfA4n8nev1xjWfN0yGjD2gxsYh6432LolWHQL9F91Gj/j7oacUPFhE+11hbLxbrCFBzqWh5A4PDRqN90RZqVK9XE+ET67MSv41D9s3E0nwFX1Ndu4RFjkZpjkUxTkeEdTDIEvXqW1lKoeU0pOavXj10OsuSI1CYnaWUVC7COvpliR7f9CQzlaK5/LPBQRc6mstBIsIW0WXiO4tiDh35mIr1oS4kK2ENOctwqzPu+SX0MdDLjZWw9Pb1suyv7EPYR7cuEithLRLL6moW/0VriaVRtT1qTQkSER411Cyjc4pBL4/KEirPNRj4FZ3gXy5EWM+vWaIhtJQNf2GWYkg5dtWzui9bhuqn6OkVNUhE+ANjTZG91Kjrq6bDxHnGStqvcxHWsU5bQpZ0orCK3rDs21m2quXY6+DLTWBBNTP9wxbOKZZ4E63omLYZWG4r0nkQtOtwVASwdYeH723o9uTxS/3Ks+ytHk5/R3cI5LqIK2hEDw86XVkb+wV0Z+YiHDnWCjnu4Vj3Ug3DzhDn1NPacTX4HljJ6gFPr5e5RpZ74tFz6l0ezhWk5tFTYJFPEOjrLKxhrEazktWR8zVQ9vEVp1ttLYyplyeANQinN0ydIXBUnAOXR7nsrwAbgatrTbX3nu1s5Ul1oKgIRsZYMR/jy72gY0+u6a8OJMJX1P+C9MsaqDcPAseCHtANQkRTwHIoybZd21qR0Q2k1pZP0tNJSIubLhxJOr75egO/sjbekM/VIe0qY1RDb6p//PYl6/QniO0sF2tI2kBYRpBTgVrUOWqm9DPiGgghW+GWVBGj/UCvEM1E1sWinr4sKfa0/NgedhUwqsVITzvOUTOl6gxv0qmERRw5HOi/bHz2zb3VMHp28hremYQj0rq23QhGwFSQ0ZVPu8NvAfa3Use8kJkI1wzxxRhfDcYDAotrKF0GngYnRA17D599f7KVXcVzmoszLfUi7AxhfBG4GKwFPudhBacnmpfBStDwnzrkrQIhpDW8L3ExJqXV/wBA2Vs4WelquT9Qzy8FvdHnDlKR01RQ8OrJMaAp8TnYQUA7SBsEm6pzPXgcyI6PaCG7Hdu6VcVLUkuE5ONBR8ByDGb42sPGteBPEDcV0vK0ZZ2Z5C9oSCcZKzqfwO8OJK2FbCAunqYmrICRQaA3rLRejSvTWtGwTzc94Yj0DQS/O4C05nQd6VYhrIVMpEN6Wqv3crBngY4b582aR9DXgJCFTPt05T+AtKq2jNARzxLs/UBbnY/0onwLO97sXPuwj8cidQn8OuytAe0edjUyuluqh2vIPcNnPS1rIbOKfkRf0pKEGdqSJyFwM/AZ3j+2JGHXpZDWWf4+sMvlpaTal7e3xLYEsdQ4ITIIsras29AppxrKctRM5ZDRLUvv13GnLl1p5yjellylCb5BolvWkRQMgT6g6apXmnVgPWQrc/1/boJCaHVWyukAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.settings, +.x-button .x-button-icon.x-icon-mask.settings { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAIkklEQVRoBdWZd6yeUxjAe2lLUbVKrFaLUhUVo1pbQtqqESOECGLGH2IkCP8YQewYtUoTKmkJ/2hVEDFixN5FadXWBjFaq0b9fl/vuc5973nf9xtvez9P8rtnPeec5zn7/W7HsmXL+vzfpKOjYxVs3hR2hlXhT/gcX94iLBYd/r+BR2vB+eBsyVJ4FPqX+eJItbUwm8rmMEZDTRAMhG1Nd4p+bABbmUZlAGwLI0D9Lmlrh7HV5boHOHuPkL6LcCisDztCEJ1aBxwYwyvgMbgfToD/pGwJ9FY5FjoZ42AuhKX7N/HX4Er4Psq33PQ0eBz+APP+gbfhAOjQl7bdvxjYH86F4Gwc/pWT74DEesYXwWWwtg6385L25J0FH0JWXOopyfrjDC+AmTj7sxWyCua1hWCgs6Ox58GPTRr1FfVmwBuhfts6rIH47NJ9Eu6BWBwM9+xU8HqaDA5OLL+ReAmm044zXZPlGzmk2iDklHUSvF4mwU4wHEbCuqDo7OdwKXgK/w4DwEfIdVC7vgjVcxnPg/fhHZjVdocWRmn8faDBKRaTf4srPoa81eFocABS9cy7ra2XNAam5BcyvZqy4vL/Er7OFsTpdnW4yK5+OBCWd+yLjw9neY04Mxsvajiru7LS3qXut2/Aq8mZ6zp0iPuOnsBeH0wYi1thL8jmW99l7ux/1G0fxHui2TiNOojdaLQt6vcF38tbwyHg0zLel57AD8Io2Ay2h+sh3r++tl6AI2AbWBv62XAlwogPoyFPVhvuJpRpyCwc/7hbQU4CPWdlMfWWEFrX2YvFpXskTIRFsD4Mgqy4Qr6gPZ+ny6XR0c/Tp7Up4GdaPBNx/KG8unn5tOV+vLOgzbj9VNwD7gHYMPRRyR5mJpyBIVDU3lD0/ISrS9B19U2A4+uqkFZywMbCYbTnqig00PJ6xYNCPCnzZD0KRuQVJvJty089PyJicdY+hfggs7y2fAl/MBGJk+DJ7grgb+YCz6ZRceY8OHaEftly08ho+AQ0IrW0zPsWjkrV72zDg+VwGB50iHse3AbhpJ5P/AzYBz6E0Jf9egqfDieBZ4Vl38E1MKirzRBJhSh6ED0D7k0bvAA2gVVifdITwQd+MCAVOgMXx/WMIx42J8M88Ep6E7YJesSd5SthBuwOzvxweBhCPw6IV5nL1y+pPWEqXAJd+7fWX2g4G6K4HTwHGhoaNnwZDoLVQh3iZ4NXRayXinuV1N7vtc779NmN9NOZejr9FowL7WdDyjyVb4TQhzY+A7Vv3qBPuquvrrwQiUMUR8JMyDobOlhI2dXgIbQaXAvhV4agkwqfQs+DxH11PrhqUnou0TkwNrYrxMn3ADoMXgUnwIm5Ano4GOqEsMceppJ76REomzGX0bNwCrgMnZmU8XGeA3UizIK8wQz6Ou0+HROMjUPyXboOngyArhUX62XjKYcvp7IHTOi4N0MH5eGs0a2kXVpZ8fBYnM3spbSrxqVdnWRHi5Y9Ne+Gn6E3Z1dnn4fBWRtbSfdY0jaGjAYf3u6j3nLabbVfK86l6qaWNP3UllGYZdMrWzzxJ8OLVXdcO8ZTjfL29CP7VvD4r71DU3qJvPnkfQ1hZWxGfMuEXl7WXxQ8AacwQ9/kKTWdn5r2kEejO8DbUM+V8yR6x8II8CM9XBdbEffJ6FVXtkUsXwC7BhuqDpN7OHRCx951flgvgTBj2XApZX7CDYHci5+ywXAOFD1QbGsq9A02VB32pXH/26Zj/cEL3JkZCs6MT7+DwfyU6PwUuBDDCq8yyr+ln5vQ3RB8ZaXOD+2xv2XovkK4AD4CB9yB+o12XG1Niw/xLeBA2Alcji5jr6Z6xJfWQRihQXULzsxG2T7rER8fbqu54J08m/7eIWxarqJm0TLLLuGQ1pCjYFUMKNwa2XLq7Au/Q2ir3tDZfQoa7jPY4LLym9Pl3Kg42q/TUDNLzDv+tUY7RF973RJNS2of1duYDv9Sr3JGz9P4jUxePUlXgnWbllYcdmY1oFnxvl3p0orDrdTV0VbrNzVYrXS6NT3mXVdlxng7bF+mlCi3Xkuiw57QzRw8Xl9DuGKaGbSNqbsrNCpuIX+YaFq86KfDuuA97AnorPl2Lju51TkTXoe6Dy8GyFm6CLwdysSJ0EH5CfwFZEqTNwNVO5+CtcjymRpKfDsY1UlI+6NZaiZ19CyYhhHey6WCv0egdDf4a2RKfiDzPVgI78OczvAD+mjphKYdjtmSRwMqPh1/VTWHz8g/AZK/Wcfto7MfzIO8thy0B+M6VccLHaZzD6aXQEPyjDTfc8CtcQD0eAWRtwdMBWevqB1n0FkdVbWjob2i7+GBdHwpnAZrQj3yPUoLQKMXwXowEhy4wVCPOLjT4AKMtL1qJXieDellEvgzS9GMrKgyz4ZTszZVkU4uaTobBrPB19CKcqqoXZf2fBhdhZNxGz0cphOvm5uhbL8VGVxFmYP9BAyMDW41nrpqDqGT8ZB3bVC0UsQfJfYGr73KJOXwLrS+QQM9NHo3NqLvw2hcA7aUqqYcdu/6ovG0LJM5KNwBX4LLuEz8Geh28OebMrE9T/p7yhQbKk/tCRrw55eXwaddaj/6a8VMGAP+93AyeBendOO85zr1hxNOA5+McXmIuwr8ifaklH2t5PU4tEJjdDYWfCdnHx1zyTsG1lAX6YAzIc/44ITh/epHffhQ8feqWEdnXWGTgl6VYa7Dnc7sQ8fvgiems3ov+M7u9poifSh4d8aGp+JXZ42nzibgP7eXgM5+CuOzelWlCx3udNqZvgGOg+QVQb467mMNTjlqnl87J6cMJ9+zZH+4BfZN6VSVV+pwPR1hpA+VNyFvz+vwJ7B3Pe2tSJ3UKY1dDctX1PBzTsfyxGeq26NXpRKHmZGleOEV4pLOk4Xo+XrrVfFir0r8bh4EG0E8057i3r8eTL0u/wJCZSL2DoplLgAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.star, +.x-button .x-button-icon.x-icon-mask.star { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAFfUlEQVRoBd2aXahVRRTHz/Ujv+2mZRGZB7W6mtpFikC7+UWUZiqBD0JPFdRL1EMFPfjoU4baS0FUD/UWZBEVShA+BCpmWApRSkgllNpDmZWZt9//eOay72afvWfWOTPn3rvgz8yeWbPW+s/XmT379AwODtZSSQ+CryVgA/gVfIx/pelEhFMBVlvBOaBeFo6Cean8y09KsnMg932TqCOs9M2UhMfhMJVsxtHcAmcbmekLCsqjFKUkvAYG1xSwmEHZqoLyKEVJCDOCNxH9HUCbVl6mULAuXxjrOQlhgl8Bbi0h0Uen3FBS37GqVIQHiHh2SdR16jTlo0t0woycpuxiUDSdHcFeMv3uIWYanTDB3wIWVZBQHP10zuQKvbarUxDWT1HRz1E++Ds99fLtgp6jEmbExhPNcs+IbkZPiCpRCRP5TPCQJ4MJ6A3QSUqjSWzC2ozuC4j+fnSnB+gHq8YmvJKIJgVEpRPX9QH6waqxCa8PjEhHT981H2j6qno0wqzF63BhOUxsom3Zb7aJqGsUjTAONFJlpysXQz7VuXpavrBTzzEJaz1adlzNjHs6RTBvJyZhjZTF/kTaWZZCnlvhsyWgQkPZQpagzsX1bFlAXjGtDdAPUu1p3PPQhCCXkdwG/mta0PWLds060AuAnqtEOjpdbQR3VymX1P9F3UfgGJA9X9F92c/ADaQ2P8V0DJ4/kDbeYKaSvgI2AN0+OGJK1VAbSIhTOXEOybYll2kte77yD4rqrHyb85S9Cl4HtReAyI11/A7HpRq5PSD6oR0f3Rad+H7S1DvV7UgS+tc1cU3n3V/AWJ/SX8BxVuMinow2rNNjlPQVeH0GFg378kDBfLAPXARjZbTPwmUXmOG+bgz71EKFfqKeAUWfREZbJxyCxyOOqEuHER4qrNUWovwy0CFktBHV4eNZMNvxyaaFhKWAaBt/HJwEo4W0luSKLMF8viVhp4iBeeBd8CcYqcQ1qi+CKS7uVmklYdcQY0+C42Ckkf6EmO51cVal3oRlCFkCdKgfCWtbo7obDO3AVWQbHHyUsjo40E6uq9cvQbdG+wN892fj8s0HjXDWKA51/t4JUo72H/jTDtybjSUkbyYsJ0gdfAtSjfTn+JoWQjCv2+57a4M1QaQSvZvrMsIs7RJejGcdUlLJUhzpZsYsZsJcCen6ZwCE3IaYA2021OfUdU3fJltmwni7Fvh+KDMF16KR3ux0lWuSdgjPxeNdJq/tNdKNqJaSSUyEmVK6JNPomtqbIh3eSKNsEmvAarfJ5LEzjbbR59MtpqyEb8eZjpndkhtxvNri3Er4YZxpx+yW6Jdhi8V5MOHm+n0QZ9afo0u0fQO8A5S3iPaQ1cTSG9w4f/SqesZBH/gRWI6T+gyyxfkgvw2cMdrS+/lTzpZvGnyWxsnTwHLRd4R2a/OBqQyoztKBe/P2qp6DCBOUptKHhuA+pU1fq2Co0/F0L9CVaghxXTbWW9ktKg8lrFfCrwODeh/9wgu1bEDo6OT2Fvgb+JLWq+nQEsnaa5UPJbwKBxc8A9KXPG1O3u+u6E4F24GvD3XMDjCxFcF8uTdhjGpHfwn49L42lCeAdyDZwGi3HpwAPr6+Q29htn1ZPoSwfuz3ewShXVcBNz62lzkvq6O9DjZHgQ9p72kdQljvob9VBPAN9Q+UEQmpw5b+Sf8e0FotI/4a9ZN8bIcQXlnh9AD1y3ychuhgU0tpJyhb14epn+ljN+Sk9S9G1ct50d8SdgF9x9EO3lHB5hXwPEYfA8dbGD9LuWZBtfj0inSQWUDTKzu1dAB5Dkz2tdOOHn70LvwVyMag/FYwzse295Rukq5j+G1wEOib66PAy5FPMD46+NPmqTV7CpwGGvkJPm2l8z8GWDNDloqpGQAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.trash, +.x-button .x-button-icon.x-icon-mask.trash { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAFBElEQVRoBe2aS4gdRRRA8+L/m0QIJkYNLlQUNOAvigpRcCEIcSsiCLoLLoILcaM7QVBX4koRshDxt9CFKCoiuvGDCP5QkxCiJhInRo2Ovzie80gPNWX1dL3uesM09IUz3V1169a9daur+031aG5ubkUpGY1GK7G1Dq4Cz9vKiIY74Sv8+72tkWQ7Ay4Bxo+Hu2E3/AuOZBf+ov2TsL6Ef5WNUsGazXvgEHQJMm77N/aeg3Mrh7seOweMM2bWYH+B2OES1/9g9w0oEnSngHHCYO+FGSgRXJ0NM/0idA565BRpKyxSt9J2B5xWY+Mw5Udq6uqKT6XimESlmX4d7sTnA4n6rKJjs7QSSgTrSno7nJyodtFyGr4AP4G6TeLIHweb4A44C0LR1xtgCzwP7aTtIkBvLlSfQjwNZyl7FNa0sU077V4DX0Js25X7cRjPzDb2Nd5FnK7xPbGXskdwxsxOLLRzdnwIj8GvkQFnypqobKLLrgGnOjMzP6cqJijzfn0NXPljmXRNWNC+dcBHM7HA2NELp10nwbaz5iC4OsdidTyrYp3a68ZFi7XJFfNsOBGcUmFnPpbiBWkVZefT7g+OXcTF0EUsFPtaje0Lw0LOzfoM49B4Gy36WMKwK+WDcC2cAmGwXK7YAAYdym9c+NiIdUOdnHODc6DjpPioix9LBvwtPE3QOzjWi7MjBS0M8CGY1huUA1ISg/4cNqXiqcqSwVqJ3AQ/QEmnpm3LR+IzsLYKMD4mA6bBOfAKuFpO28nS9v0Bcxckn9V1Ad9Pg2m/H5cONLT3Mf5fFGfX63hBQG8s7/LXxcdV0nvjMtgKp0MojuaroM60xYB8Z78ZTog6c515B1ylXey+ARe3/0tqFNCy0RjrkdvgOwhH0TeiB2A1uMBNGx9Ta+FZiP34mrIrQR39cECSUzqZYYIcR0mjJtmFwmHUvdenLjwmnUl7Eh05+LP40fjvoGTACYN1Rc6CecGhM7lw2lt+AA7Fg4fOespXgYO0j3pvnXmh3rY+/52+vrXtRSd841rQJ/WV1JVX9eNj14DnjeHnJVw8DBeAnX8A2ynfXwXN+cWUPQUOjNl6i7Jt1I9nCOe+1V0NT4AB/wkvw31QRIoFjDfnwRXgfVbJGZzsry44boTNUGVjlvOToPpV5FvbjXApKE7VLZ6UkpWlDGHH+96pV93/4TSsujGA8MeF51Xw6njuO3soKTth/UTnJQOeqONFlKsBW0SlfdVyDLh9NBkth4AzBqnXKkOGe52+DOeHDGcMUq9Vhgz3On0Zzg8ZzhikXqsMGe51+jKcHzKcMUi9Vhky3Ov0ZTg/ZDhjkHqtMmS41+nLcH7IcMYg9VplOWY4/Md88cEtHbDOVg5Xx9jpsM9Yx52JeAcw1ontTXRdcm9pFz3vBveHdNJN6YPVRhrnivtMlruZ5g7DFxBuXLut8j7sA/d43Yr5CIpJsYAJ7DN2/27Bsw1gwAb3I8wLOp+g4w6+nw/6HddOyszqWDg/Qv2bXFwH4+1SyhyUYtI1YLc85wXn/ORAagWdPVRKUqh3AJwtdTLeWq2rbCoP76cm3bjeLG6ELjZim03XJujyJqXF6rtmeDvGNzMN/ajEAZi2rKOD67t00jVgN7+3dnFgqdsu5XRc6tiS/eUGvBTTNengBIVZPuYG7LcYPjdluYk++bTw++pGyQ34bSy9B35Vs5zEYGfgJfg+x7H/ADoy2VfnrtXoAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.maps, +.x-button .x-button-icon.x-icon-mask.maps { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAADl0lEQVRoBe2b24tNURzHjfutXEPycDAltwhJbuMSJUqSB/HiES/+AK9ePc6T8uCFkImQW5KGkdwSxYyMGkZu45bbDOPzyZyTrJnjnDkGrVm/+szas2bv397f33ftPS+/Vdba2toj5igj0NcfRkG/3qWIJdcIrs/AO6gDq7cKPkOjUNAmxr8ePJsix8NUWAvLoapowSQawIUzYCZUwAqohF3QAjtgGTyCy5x/nfEu1MNDCmAxuiS4Vy8ST4DZMB9WwiTIRUGC26q1gKtWwyyYBsPB5aLIL5CNTxzotDeWTeA5DUKuO4xXoQbxHpcUbSIzJFkDi0EzdLYnBNGuYJJ4ch+YAhvB5TAORsKvib4x97vwPpk2FjJuhibu85zxAlyCangBLRQib06u68t5vk4uVYVqgO+oqy9v5ASTRLd0LQNLYB24bAfBnw5zikX0HtuhGW5ANY9ylvEBvIY3FOArcz7rWHCpboBFMAxyGjguKIZy1jzYCqfAD5BLslB8J3dCP/AdOgo+fKHXd3Sebh+EctCMieBK6Oj8QuYrXZ7roQr88PiSD4b/IVyyfhB9jQy/uppTUijYhANLytJ1F/sxzL7POpg97vQdFfwVTNYtQsHdKpLg2O1ODieHI6tAWtKRGRrISQ4HJYlsIjkcmaGBnORwUJLIJpLDkRkayEkOByWJbCI5HJmhgZzkcFCSyCaSw5EZGshJDgcliWwiORyZoYGc5HBQksgmksORGRrISQ4HJYlsIjkcmaGBnORwUJLIJpLDkRkayEkOByWJbKLbOVx0r3E7httIbttwNvzddt//JWxIfQynYX8pgu2TbgBbjw9Ds53sNHJv49gOehu5bUe2DfjXojDVpWG/9iu4CEegBp7xfO+LFfyGC5+AiQ7BFXj/c8s+xw+Z24PwvYwKnQxLoQLccGEB7Hsu9t5ckjcU2QjuozgA5+Apz9PCmItCbvqWs2vhJpwBl8ZrEuVtOebPtiWLbf2ymyL0ZVT8XJgDbgHIgFsPOhPmr4d7oAnHue9txg6jI8EfueIaHIOrcAuafieSc/IG19vw7TYD6UEBbE4vhwxMB7cizIYhYPT6MeR+WjBFPoCToEgF1hb6bD8LNpHLwT0L56EOGkhUchc6edoNcruvQWoQ7/6GMTAa3E2zACxGNjRhH9wHV4zP9oGxqCjj7C0wA06Ay/YliRT/T4MCuGnEfQ4feJ5mfvdfaG+OXSWdju+VpAoIK3D9tAAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.locate, +.x-button .x-button-icon.x-icon-mask.locate { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAIDklEQVRoBe2aaaxeQxiA3eqCltpLkWotLUUtsUuJrbUFtSSaiIjljz8kQhOJiAQRQYREYvmFSPrDFiSExFpL49JSS6u0Re1bLUVRz3N7ph1z53zfud8956sf3uS5s7/zvjNzZuac7/asXr16g25IT0/PKPrZAfaFXWAMvAEL4GNYgS1/EjYqPU07jKNb4sGZcBocB0MhlYVkPAgPYM+itLDWtA43BYY6m7PBZVSFXuqd2ZQ96m3S2ZkY/0lFR+PBcFlf3ZTTjTiMwQfCR4WzfxO+D8/BTxA7Vxb/nXqzmnC6docxdDg8WTj2F+EtMBrMPxiqzvqn1N2nbqebcHg6hoaZfJn4sNho0hdB2cym+bOoOzRuP9j4EBTWJuzII1F2OngEuZQfwcBVhLG8FifaxM+jfHybOgMqrtVhet4OfH6VHsjpn9xXWu3PRKrtXK1qtVo5g6q1zNfyzJ1UFOnwCcz6ZqEq8bHErwzpCqE6JtHOsBap2+FNsGrjyLIjid+PvYfBDOJPwJSovEp0wyqVqtbJ3Xqqts3Vy83EKVSUTiWns1Nd2WesY2U0XAHfDkZBpu3vbHzu3rVI3Uv6G6z6oBbL1il5b1108LG6Hf4ak+YO3qy1Gl4ltnhtqoZIrQ6z8lZi06PwWw22qUJdn9Wkq09NrQ4Xhs0hfLgGI99Fx30MotfT+sT9oG6wbhzMAzebTviRdufUbZf6anc2GInBh8A7HTj8A23Ogw2DrjrDxhzuG80118KHMP7XCo57934Ljq/TwVRX4594cGADblmXEEyDqeCrYiy+XPhC8RzcioHfETYmXXE4WI/jXi1PDOkiXE44CUd9pWxcmtilWxnt0k5lVbecteNuO+xsplLrOZsqT9PddviL1ADSn2fyGsvqtsO5N59c3v8O1zUC3Z7hDzHcm1cs5nVNuu2wr4+pNHrupp3V/cUj1d+X5vwdTsS+RmYqjKDcT0N/cjz9kSmvNav2iwfGj8HCfcDflXaGbcGPezpsuBfEsoTEMvAnFmf7K1gCXjPnMwhfEtYmg3YYB30s9oeT4TDYCbYocGY7EWf6+wJ/qZgDj0MvA+Cdu2PpyOFiifrJ9SS4AHYDv1bW+oURfUF8J/bjgj+l3gteUZd38ggMyGEc1aHJcDb4k4nLtZW4RMMy/YW4LwonQHz29hZ1NiV0yW9VhASl4rK/G2bDAhyv/JGgssM4668K58OFMB5io0muFZ+518CPb34EWAga9VuxMvxlMIhH1FGUvUCZb1G7wu4wBfaAg8E9ISe2/RjugbvQUe1rKRXbvhOj8Ax4AxxJO0pxw3kEnHk3pezLO/mbgV81Q3v17ZmzgXxXk7rU+TSENmlo3y/C9JyeNK+lsyix08vAWUs7Mq3BL8GxMDpVnqapMwqc/aDL9lum9dI0ddwETwX7ctMK7UNonndybc0OdtBZ6jANh8GV4DMYFMfhj+TfCBsFZe1C6urwXAh6Kjkc9NLO5/wW+DXSEXQZausVUPoTa9ZhGvh8OqI+F7HCEP+I/JnBkKohbXS4N9HZdoZT/bR3JssmwpmelrYJ6aEU5mRPMp09l1JOlpI5lo1mFmHYvDyPXfqzUb6CMCc+b4thv6LQgTMvK8VGdhaFblwu2yD2uQRy9m1L/s20XYYd7xH/twTPQ0ipl4XrwY/pYUbT0DKPmBgNnwc7BV1pSJm674Sg73Xio9J6IW0Z+MyrO+7Li0nZsla39unD8KArhLkZ9iw8F0ZAmbQq+6asEfnO0nx4rIgvIiydYYz8mZnSATfPVNxjysSB9X/DboWv40o5h4+igod/Tj4j02XoaOdkHkauzBWYR5nOOcNSVeZQ0UtLTrR/AuyYFLrkvQn66HikrZMw1SGk5BooW84ukxGh7voOsWUjuBnCIxKHDvylqY1uNKnEm0Na5kiOTjPXR5ql7ixuD3uU9G/55mlZzuGfqeRI5cQb11T6yj0KufpN5vlcHwRHl3TixH2YluUMf5NKXghysgmZHuzzcXoRy6VsYHJt/QXCAZ4A6gkyoMu/jQo9vm9fBWUbqD4shH9LusYp9WxbBo5Q/EzE8Qcom5i2bZemjTelBYnerdq1S8tpvzf4Y3lsUxzXdk+ALfq17ZexZiO4g8q+1cRK0vjblM9I27dKawD8EOl1FgZ006L+TNCZ1J44re03Qb8Ntt/Vkko+7FOh7OoWK/bMdefeoZWjoYx6nvFx+8oO2wdcB98nOmJ9Ie6V+PDQbxz2c9hCZGNwhNrNspU1+hO4FiZDq5uTDls/GGZ869igOK4uUKe67SNuG3SkoUeq9fvdsvp8izuI4zTYBeZClU5Cp559D8GFcCCMh82DXuJukrE+nzV/OewbeOuCbQ4FdahLnUF/u9CLzfMwLuhMw5ZfPNgNp9H4NtgdXOoDkRVUfh/cKX3mloM76u0QdOmA1793wSW7G0yEKTAcBiIOnndzLxvev/OSjkCappVL6hlw9NqN8PoqX4Vt3s/Hp/an6ewz3K/SmhvNDSj86T/otDZp25jU7ly6ksM2RIbADHgFBvJcNTXrOvpCYdOQnHO5vMoOh8Z0sA1cDi9Cq3fSphy1z2fhYsjuxMHWXNhy00JhqbCheWtyJ54Ox8D+0KT0ovwp0NmXcMYjc8DSscOhJxwfRnxHGAfHwQFwBIyEwcgvNNY5HyHxHF6Kox5rHcugHY57xnnPWS8t4lHmIHjEeNyMBXf67WACeJNbDH+Ag+ax5fE1D5YWcd/cVuKkR04t8g94XuILUVeybgAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.home, +.x-button .x-button-icon.x-icon-mask.home { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAEK0lEQVRoBe2Zy28NURzHe/vwqEepYkFIQzxWaCOC2HhELEgQImhXIrqyIEXikVQi+gdIwx9AItg1NiJELMSGhKQbobY2VY9Srfp8m5lmTO/cOXN7Zu656f0ln8zMnTNnft/z+505j5sbGxurmk5WPZ3ESuu0E1xbigjncrka3jsbftClIvsU5RZ65aLK5Lj/C75SzSjHWCuJYLxqhPXwBgYhylq4sRaixChDP8EzGIJ4UwNnCR6tgFswANegKer93LsLim4herm/JKqO8O+ZRdhL42acOwunYAacg2Hu3ePYj3Ph1A1fU2ySmZSZeCiTjxaC1LAboRs6QGJl8+AKXIU1kLqlHmHEqlFboQv2gD40QdPHqx3qKdtJkD8Hb9o+TzXCXmT1cboB+cT6evTVPgIXeWYl6DoVSy3COF2Hx0rjTthp4L0a/4xXrofn33OeqH8avKMqFcE4O4uXb4ULsNfEEa+M0v00LIIuCKc/P03NrAtGrD5Iiuh10Dia1JTOR0EZsjjpw3HlrQpGbD0v3AzFig36e4CLkeAPNs6tCUbsHBxS+mpsLSayYT2KtLBqVgQjdgFe7QP1u9VWPbRc2ZQFe2LV5zSBWG7ZP+vVTUkwYhvx6DicB+fFqvWKFuyJ1QxJ00It48rCNNgnNi+N23hQaVw2YiU0cYQRq9Q9CJdBKV1q02zMeEaWSDBil1L5JTgBDeCCzcUJ8cXImfACOeqayjbBffgDfqu6cPyJP3dgVZTvwd9jdzuoSFmgicRDGAYXRIZ9+I5fPbA6KC7feUHBVKD5rJZ1EutaZMOiv+HjbWjJJ9T/LVIwDyqyh+ApuC7WFy/RCk4r5HyRwWNewRSW2N3wGv6CX2E5HBWcB9AaFOqfTxJMQa1lNewosqNQDiLDPmqv+hFsgzpfrI7/CeamVjwnQZEtV7G+eEX6MeyHGl/0hGB+1MJdYt+B/1C5H9UdX8J2qJ6IMBfz4Ri8hXIXGfZfmdoLWr5W1zJ7ktg2aId18BuiTHNvDVUumQSNxDikLSdtBzdok0yCD8MyiLNmCqhxXBL9An+egNI3yqRT9z+O92FO/O2UuOMuymoqF06bUl53489MQw21Gm8lWmkRa6R/oVaMfT6lAmrsUVMNRa2HU3I8k2orgjNp5hK+ZLwPp/x+fR+0ONfMp9BfJ+qLmulpyze1zMtC8AACbkI/xAneQZkO0JiZimUheAjPn0MfxAnWVo3RiEG5oiwLwXJsmGFDK5iCxrCnGZNSOzVLra+EPDZ9T6EMCFVZ3KWpI8XV7uBTFcEOBsWqS5UIW21OByurRNjBoFh1qRJhq83pYGWVCDsYFKsuVSJstTkdrGz8L0VTv1i+NVF2CyTJDC0LX7E8HIx7D/Vrb3wDaLvY1D5QsI/6jXZUEwk29cDlckki5bIOY9+mneB/GfbU3e4Ey5kAAAAASUVORK5CYII='); +} + +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-action, .x-toolbar .x-button.x-button-action, .x-button.x-button-action-round, .x-toolbar .x-button.x-button-action-round, .x-button.x-button-action-small, .x-toolbar .x-button.x-button-action-small { + border: 1px solid #002f50; + border-top-color: #003e6a; + color: white; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-action.x-button-back:before, .x-button.x-button-action.x-button-forward:before, .x-toolbar .x-button.x-button-action.x-button-back:before, .x-toolbar .x-button.x-button-action.x-button-forward:before, .x-button.x-button-action-round.x-button-back:before, .x-button.x-button-action-round.x-button-forward:before, .x-toolbar .x-button.x-button-action-round.x-button-back:before, .x-toolbar .x-button.x-button-action-round.x-button-forward:before, .x-button.x-button-action-small.x-button-back:before, .x-button.x-button-action-small.x-button-forward:before, .x-toolbar .x-button.x-button-action-small.x-button-back:before, .x-toolbar .x-button.x-button-action-small.x-button-forward:before { + background: #002f50; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-action, .x-button.x-button-action.x-button-back:after, .x-button.x-button-action.x-button-forward:after, .x-toolbar .x-button.x-button-action, .x-toolbar .x-button.x-button-action.x-button-back:after, .x-toolbar .x-button.x-button-action.x-button-forward:after, .x-button.x-button-action-round, .x-button.x-button-action-round.x-button-back:after, .x-button.x-button-action-round.x-button-forward:after, .x-toolbar .x-button.x-button-action-round, .x-toolbar .x-button.x-button-action-round.x-button-back:after, .x-toolbar .x-button.x-button-action-round.x-button-forward:after, .x-button.x-button-action-small, .x-button.x-button-action-small.x-button-back:after, .x-button.x-button-action-small.x-button-forward:after, .x-toolbar .x-button.x-button-action-small, .x-toolbar .x-button.x-button-action-small.x-button-back:after, .x-toolbar .x-button.x-button-action-small.x-button-forward:after { + background-color: #006bb6; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #50b7ff), color-stop(2%, #0080da), color-stop(100%, #005692)); + background-image: -webkit-linear-gradient(#50b7ff, #0080da 2%, #005692); + background-image: linear-gradient(#50b7ff, #0080da 2%, #005692); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-action .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-action .x-button-icon.x-icon-mask, .x-button.x-button-action-round .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-action-round .x-button-icon.x-icon-mask, .x-button.x-button-action-small .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-action-small .x-button-icon.x-icon-mask { + background-color: white; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #ffffff), color-stop(100%, #dbf0ff)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 2%, #dbf0ff); + background-image: linear-gradient(#ffffff, #ffffff 2%, #dbf0ff); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-action.x-button-pressing, .x-button.x-button-action.x-button-pressing:after, .x-button.x-button-action.x-button-pressed, .x-button.x-button-action.x-button-pressed:after, .x-button.x-button-action.x-button-active, .x-button.x-button-action.x-button-active:after, .x-toolbar .x-button.x-button-action.x-button-pressing, .x-toolbar .x-button.x-button-action.x-button-pressing:after, .x-toolbar .x-button.x-button-action.x-button-pressed, .x-toolbar .x-button.x-button-action.x-button-pressed:after, .x-toolbar .x-button.x-button-action.x-button-active, .x-toolbar .x-button.x-button-action.x-button-active:after, .x-button.x-button-action-round.x-button-pressing, .x-button.x-button-action-round.x-button-pressing:after, .x-button.x-button-action-round.x-button-pressed, .x-button.x-button-action-round.x-button-pressed:after, .x-button.x-button-action-round.x-button-active, .x-button.x-button-action-round.x-button-active:after, .x-toolbar .x-button.x-button-action-round.x-button-pressing, .x-toolbar .x-button.x-button-action-round.x-button-pressing:after, .x-toolbar .x-button.x-button-action-round.x-button-pressed, .x-toolbar .x-button.x-button-action-round.x-button-pressed:after, .x-toolbar .x-button.x-button-action-round.x-button-active, .x-toolbar .x-button.x-button-action-round.x-button-active:after, .x-button.x-button-action-small.x-button-pressing, .x-button.x-button-action-small.x-button-pressing:after, .x-button.x-button-action-small.x-button-pressed, .x-button.x-button-action-small.x-button-pressed:after, .x-button.x-button-action-small.x-button-active, .x-button.x-button-action-small.x-button-active:after, .x-toolbar .x-button.x-button-action-small.x-button-pressing, .x-toolbar .x-button.x-button-action-small.x-button-pressing:after, .x-toolbar .x-button.x-button-action-small.x-button-pressed, .x-toolbar .x-button.x-button-action-small.x-button-pressed:after, .x-toolbar .x-button.x-button-action-small.x-button-active, .x-toolbar .x-button.x-button-action-small.x-button-active:after { + background-color: #0062a7; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #004474), color-stop(10%, #00538d), color-stop(65%, #0062a7), color-stop(100%, #0064a9)); + background-image: -webkit-linear-gradient(#004474, #00538d 10%, #0062a7 65%, #0064a9); + background-image: linear-gradient(#004474, #00538d 10%, #0062a7 65%, #0064a9); +} + +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-confirm, .x-toolbar .x-button.x-button-confirm, .x-button.x-button-confirm-round, .x-toolbar .x-button.x-button-confirm-round, .x-button.x-button-confirm-small, .x-toolbar .x-button.x-button-confirm-small { + border: 1px solid #263501; + border-top-color: #374e02; + color: white; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-confirm.x-button-back:before, .x-button.x-button-confirm.x-button-forward:before, .x-toolbar .x-button.x-button-confirm.x-button-back:before, .x-toolbar .x-button.x-button-confirm.x-button-forward:before, .x-button.x-button-confirm-round.x-button-back:before, .x-button.x-button-confirm-round.x-button-forward:before, .x-toolbar .x-button.x-button-confirm-round.x-button-back:before, .x-toolbar .x-button.x-button-confirm-round.x-button-forward:before, .x-button.x-button-confirm-small.x-button-back:before, .x-button.x-button-confirm-small.x-button-forward:before, .x-toolbar .x-button.x-button-confirm-small.x-button-back:before, .x-toolbar .x-button.x-button-confirm-small.x-button-forward:before { + background: #263501; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-confirm, .x-button.x-button-confirm.x-button-back:after, .x-button.x-button-confirm.x-button-forward:after, .x-toolbar .x-button.x-button-confirm, .x-toolbar .x-button.x-button-confirm.x-button-back:after, .x-toolbar .x-button.x-button-confirm.x-button-forward:after, .x-button.x-button-confirm-round, .x-button.x-button-confirm-round.x-button-back:after, .x-button.x-button-confirm-round.x-button-forward:after, .x-toolbar .x-button.x-button-confirm-round, .x-toolbar .x-button.x-button-confirm-round.x-button-back:after, .x-toolbar .x-button.x-button-confirm-round.x-button-forward:after, .x-button.x-button-confirm-small, .x-button.x-button-confirm-small.x-button-back:after, .x-button.x-button-confirm-small.x-button-forward:after, .x-toolbar .x-button.x-button-confirm-small, .x-toolbar .x-button.x-button-confirm-small.x-button-back:after, .x-toolbar .x-button.x-button-confirm-small.x-button-forward:after { + background-color: #6c9804; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c2fa3b), color-stop(2%, #85bb05), color-stop(100%, #547503)); + background-image: -webkit-linear-gradient(#c2fa3b, #85bb05 2%, #547503); + background-image: linear-gradient(#c2fa3b, #85bb05 2%, #547503); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-confirm .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-confirm .x-button-icon.x-icon-mask, .x-button.x-button-confirm-round .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-confirm-round .x-button-icon.x-icon-mask, .x-button.x-button-confirm-small .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-confirm-small .x-button-icon.x-icon-mask { + background-color: white; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #ffffff), color-stop(100%, #f4fedc)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 2%, #f4fedc); + background-image: linear-gradient(#ffffff, #ffffff 2%, #f4fedc); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-confirm.x-button-pressing, .x-button.x-button-confirm.x-button-pressing:after, .x-button.x-button-confirm.x-button-pressed, .x-button.x-button-confirm.x-button-pressed:after, .x-button.x-button-confirm.x-button-active, .x-button.x-button-confirm.x-button-active:after, .x-toolbar .x-button.x-button-confirm.x-button-pressing, .x-toolbar .x-button.x-button-confirm.x-button-pressing:after, .x-toolbar .x-button.x-button-confirm.x-button-pressed, .x-toolbar .x-button.x-button-confirm.x-button-pressed:after, .x-toolbar .x-button.x-button-confirm.x-button-active, .x-toolbar .x-button.x-button-confirm.x-button-active:after, .x-button.x-button-confirm-round.x-button-pressing, .x-button.x-button-confirm-round.x-button-pressing:after, .x-button.x-button-confirm-round.x-button-pressed, .x-button.x-button-confirm-round.x-button-pressed:after, .x-button.x-button-confirm-round.x-button-active, .x-button.x-button-confirm-round.x-button-active:after, .x-toolbar .x-button.x-button-confirm-round.x-button-pressing, .x-toolbar .x-button.x-button-confirm-round.x-button-pressing:after, .x-toolbar .x-button.x-button-confirm-round.x-button-pressed, .x-toolbar .x-button.x-button-confirm-round.x-button-pressed:after, .x-toolbar .x-button.x-button-confirm-round.x-button-active, .x-toolbar .x-button.x-button-confirm-round.x-button-active:after, .x-button.x-button-confirm-small.x-button-pressing, .x-button.x-button-confirm-small.x-button-pressing:after, .x-button.x-button-confirm-small.x-button-pressed, .x-button.x-button-confirm-small.x-button-pressed:after, .x-button.x-button-confirm-small.x-button-active, .x-button.x-button-confirm-small.x-button-active:after, .x-toolbar .x-button.x-button-confirm-small.x-button-pressing, .x-toolbar .x-button.x-button-confirm-small.x-button-pressing:after, .x-toolbar .x-button.x-button-confirm-small.x-button-pressed, .x-toolbar .x-button.x-button-confirm-small.x-button-pressed:after, .x-toolbar .x-button.x-button-confirm-small.x-button-active, .x-toolbar .x-button.x-button-confirm-small.x-button-active:after { + background-color: #628904; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #3e5702), color-stop(10%, #507003), color-stop(65%, #628904), color-stop(100%, #648c04)); + background-image: -webkit-linear-gradient(#3e5702, #507003 10%, #628904 65%, #648c04); + background-image: linear-gradient(#3e5702, #507003 10%, #628904 65%, #648c04); +} + +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-decline, .x-toolbar .x-button.x-button-decline, .x-button.x-button-decline-round, .x-toolbar .x-button.x-button-decline-round, .x-button.x-button-decline-small, .x-toolbar .x-button.x-button-decline-small { + border: 1px solid #630303; + border-top-color: #7c0303; + color: white; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-decline.x-button-back:before, .x-button.x-button-decline.x-button-forward:before, .x-toolbar .x-button.x-button-decline.x-button-back:before, .x-toolbar .x-button.x-button-decline.x-button-forward:before, .x-button.x-button-decline-round.x-button-back:before, .x-button.x-button-decline-round.x-button-forward:before, .x-toolbar .x-button.x-button-decline-round.x-button-back:before, .x-toolbar .x-button.x-button-decline-round.x-button-forward:before, .x-button.x-button-decline-small.x-button-back:before, .x-button.x-button-decline-small.x-button-forward:before, .x-toolbar .x-button.x-button-decline-small.x-button-back:before, .x-toolbar .x-button.x-button-decline-small.x-button-forward:before { + background: #630303; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-decline, .x-button.x-button-decline.x-button-back:after, .x-button.x-button-decline.x-button-forward:after, .x-toolbar .x-button.x-button-decline, .x-toolbar .x-button.x-button-decline.x-button-back:after, .x-toolbar .x-button.x-button-decline.x-button-forward:after, .x-button.x-button-decline-round, .x-button.x-button-decline-round.x-button-back:after, .x-button.x-button-decline-round.x-button-forward:after, .x-toolbar .x-button.x-button-decline-round, .x-toolbar .x-button.x-button-decline-round.x-button-back:after, .x-toolbar .x-button.x-button-decline-round.x-button-forward:after, .x-button.x-button-decline-small, .x-button.x-button-decline-small.x-button-back:after, .x-button.x-button-decline-small.x-button-forward:after, .x-toolbar .x-button.x-button-decline-small, .x-toolbar .x-button.x-button-decline-small.x-button-back:after, .x-toolbar .x-button.x-button-decline-small.x-button-forward:after { + background-color: #c70505; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fb6a6a), color-stop(2%, #ea0606), color-stop(100%, #a40404)); + background-image: -webkit-linear-gradient(#fb6a6a, #ea0606 2%, #a40404); + background-image: linear-gradient(#fb6a6a, #ea0606 2%, #a40404); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-decline .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-decline .x-button-icon.x-icon-mask, .x-button.x-button-decline-round .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-decline-round .x-button-icon.x-icon-mask, .x-button.x-button-decline-small .x-button-icon.x-icon-mask, .x-toolbar .x-button.x-button-decline-small .x-button-icon.x-icon-mask { + background-color: white; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #ffffff), color-stop(100%, #fedcdc)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 2%, #fedcdc); + background-image: linear-gradient(#ffffff, #ffffff 2%, #fedcdc); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-button.x-button-decline.x-button-pressing, .x-button.x-button-decline.x-button-pressing:after, .x-button.x-button-decline.x-button-pressed, .x-button.x-button-decline.x-button-pressed:after, .x-button.x-button-decline.x-button-active, .x-button.x-button-decline.x-button-active:after, .x-toolbar .x-button.x-button-decline.x-button-pressing, .x-toolbar .x-button.x-button-decline.x-button-pressing:after, .x-toolbar .x-button.x-button-decline.x-button-pressed, .x-toolbar .x-button.x-button-decline.x-button-pressed:after, .x-toolbar .x-button.x-button-decline.x-button-active, .x-toolbar .x-button.x-button-decline.x-button-active:after, .x-button.x-button-decline-round.x-button-pressing, .x-button.x-button-decline-round.x-button-pressing:after, .x-button.x-button-decline-round.x-button-pressed, .x-button.x-button-decline-round.x-button-pressed:after, .x-button.x-button-decline-round.x-button-active, .x-button.x-button-decline-round.x-button-active:after, .x-toolbar .x-button.x-button-decline-round.x-button-pressing, .x-toolbar .x-button.x-button-decline-round.x-button-pressing:after, .x-toolbar .x-button.x-button-decline-round.x-button-pressed, .x-toolbar .x-button.x-button-decline-round.x-button-pressed:after, .x-toolbar .x-button.x-button-decline-round.x-button-active, .x-toolbar .x-button.x-button-decline-round.x-button-active:after, .x-button.x-button-decline-small.x-button-pressing, .x-button.x-button-decline-small.x-button-pressing:after, .x-button.x-button-decline-small.x-button-pressed, .x-button.x-button-decline-small.x-button-pressed:after, .x-button.x-button-decline-small.x-button-active, .x-button.x-button-decline-small.x-button-active:after, .x-toolbar .x-button.x-button-decline-small.x-button-pressing, .x-toolbar .x-button.x-button-decline-small.x-button-pressing:after, .x-toolbar .x-button.x-button-decline-small.x-button-pressed, .x-toolbar .x-button.x-button-decline-small.x-button-pressed:after, .x-toolbar .x-button.x-button-decline-small.x-button-active, .x-toolbar .x-button.x-button-decline-small.x-button-active:after { + background-color: #b80505; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #860303), color-stop(10%, #9f0404), color-stop(65%, #b80505), color-stop(100%, #ba0505)); + background-image: -webkit-linear-gradient(#860303, #9f0404 10%, #b80505 65%, #ba0505); + background-image: linear-gradient(#860303, #9f0404 10%, #b80505 65%, #ba0505); +} + +/* line 35, ../themes/stylesheets/sencha-touch/default/widgets/_sheets.scss */ +.x-sheet, .x-sheet-action { + padding: 0.7em; + border-top: 1px solid #092e47; + height: auto; + background-color: rgba(3, 17, 26, 0.9); + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(20, 104, 162, 0.9)), color-stop(2%, rgba(7, 37, 58, 0.9)), color-stop(100%, rgba(0, 0, 0, 0.9))); + background-image: -webkit-linear-gradient(rgba(20, 104, 162, 0.9), rgba(7, 37, 58, 0.9) 2%, rgba(0, 0, 0, 0.9)); + background-image: linear-gradient(rgba(20, 104, 162, 0.9), rgba(7, 37, 58, 0.9) 2%, rgba(0, 0, 0, 0.9)); + -webkit-border-radius: 0; + border-radius: 0; +} + +/* line 44, ../themes/stylesheets/sencha-touch/default/widgets/_sheets.scss */ +.x-sheet-inner > .x-button, .x-sheet-action-inner > .x-button { + margin-bottom: 0.5em; +} +/* line 47, ../themes/stylesheets/sencha-touch/default/widgets/_sheets.scss */ +.x-sheet-inner > .x-button:last-child, .x-sheet-action-inner > .x-button:last-child { + margin-bottom: 0; +} + +/* line 14, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker { + padding: 0; +} + +/* line 18, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner { + position: relative; + background-color: #fff; + -webkit-border-radius: 0.4em; + border-radius: 0.4em; + -webkit-background-clip: padding; + background-clip: padding-box; + overflow: hidden; + margin: 0.7em; +} +/* line 27, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner:before, .x-sheet.x-picker .x-sheet-inner:after { + z-index: 1; + content: ""; + position: absolute; + width: 100%; + height: 30%; + top: 0; + left: 0; +} +/* line 32, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner:before { + top: auto; + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; + bottom: 0; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #bbbbbb)); + background-image: -webkit-linear-gradient(#ffffff, #bbbbbb); + background-image: linear-gradient(#ffffff, #bbbbbb); +} +/* line 38, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner:after { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #bbbbbb), color-stop(100%, #ffffff)); + background-image: -webkit-linear-gradient(#bbbbbb, #ffffff); + background-image: linear-gradient(#bbbbbb, #ffffff); +} +/* line 45, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner .x-picker-slot .x-body { + border-left: 1px solid #999999; + border-right: 1px solid #ACACAC; +} +/* line 51, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner .x-picker-slot.x-first .x-body { + border-left: 0; +} +/* line 57, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-sheet.x-picker .x-sheet-inner .x-picker-slot.x-last .x-body { + border-left: 0; + border-right: 0; +} + +/* line 65, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot .x-scroll-view { + z-index: 2; + position: relative; + -webkit-box-shadow: rgba(0, 0, 0, 0.4) -1px 0 1px; +} +/* line 72, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot .x-scroll-view:first-child { + -webkit-box-shadow: none; +} + +/* line 77, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-mask { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 3; + display: -webkit-box; + display: box; + -webkit-box-align: stretch; + box-align: stretch; + -webkit-box-orient: vertical; + box-orient: vertical; + -webkit-box-pack: center; + box-pack: center; + pointer-events: none; +} + +/* line 91, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-bar { + border-top: 0.12em solid #006bb6; + border-bottom: 0.12em solid #006bb6; + height: 2.5em; + background-color: rgba(13, 148, 242, 0.3); + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(158, 212, 250, 0.3)), color-stop(2%, rgba(47, 163, 244, 0.3)), color-stop(100%, rgba(11, 127, 208, 0.3))); + background-image: -webkit-linear-gradient(rgba(158, 212, 250, 0.3), rgba(47, 163, 244, 0.3) 2%, rgba(11, 127, 208, 0.3)); + background-image: linear-gradient(rgba(158, 212, 250, 0.3), rgba(47, 163, 244, 0.3) 2%, rgba(11, 127, 208, 0.3)); + -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0.2em 0.2em; +} + +/* line 102, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-use-titles .x-picker-bar { + margin-top: 1.5em; +} + +/* line 107, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot-title { + height: 1.5em; + position: relative; + z-index: 2; + background-color: #1295f1; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #a2d6f9), color-stop(2%, #34a4f3), color-stop(100%, #0d81d2)); + background-image: -webkit-linear-gradient(#a2d6f9, #34a4f3 2%, #0d81d2); + background-image: linear-gradient(#a2d6f9, #34a4f3 2%, #0d81d2); + border-top: 1px solid #1295f1; + border-bottom: 1px solid #095b94; + -webkit-box-shadow: 0px 0.1em 0.3em rgba(0, 0, 0, 0.3); + padding: 0.2em 1.02em; +} +/* line 117, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot-title > div { + font-weight: bold; + font-size: 0.8em; + color: #113b59; + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; +} + +/* line 128, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot .x-dataview-inner { + width: 100%; +} +/* line 132, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot .x-dataview-item { + vertical-align: middle; + height: 2.5em; + line-height: 2.5em; + font-weight: bold; + padding: 0 10px; +} +/* line 140, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-slot .x-picker-item { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/* line 145, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-right { + text-align: right; +} + +/* line 148, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-center { + text-align: center; +} + +/* line 151, ../themes/stylesheets/sencha-touch/default/widgets/_picker.scss */ +.x-picker-left { + text-align: left; +} + +/* line 126, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-top { + border-bottom-width: .1em; + border-bottom-style: solid; + height: 2.6em; + padding: 0 .8em; +} +/* line 132, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-top .x-tab { + padding: 0.4em 0.8em; + height: 1.8em; + -webkit-border-radius: 0.9em; + border-radius: 0.9em; +} +/* line 138, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-top .x-button-label, .x-tabbar.x-docked-top .x-hasbadge .x-badge, .x-hasbadge .x-tabbar.x-docked-top .x-badge { + font-size: .8em; + line-height: 1.2em; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; +} + +/* line 149, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-bottom { + border-top-width: .1em; + border-top-style: solid; + height: 3em; + padding: 0; +} +/* line 155, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-bottom .x-tab { + -webkit-border-radius: 0.25em; + border-radius: 0.25em; + min-width: 3.3em; + position: relative; + padding-top: .2em; +} +/* line 161, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-bottom .x-tab .x-button-icon { + -webkit-mask-size: 1.65em; + width: 1.65em; + height: 1.65em; + display: block; + margin: 0 auto; + position: relative; +} +/* line 170, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar.x-docked-bottom .x-tab .x-button-label, .x-tabbar.x-docked-bottom .x-tab .x-hasbadge .x-badge, .x-hasbadge .x-tabbar.x-docked-bottom .x-tab .x-badge { + margin: 0; + padding: .1em 0 .2em 0; + font-size: 9px; + line-height: 12px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.bookmarks, +.x-button .x-button-icon.x-icon-mask.bookmarks { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAHC0lEQVRoBe2aW4hVVRiAx8t4qXFMvGZGeLcblUVWdJEoiTIhI9KoHiIyKyh6SOvBh166vPTQQ2IXkKyIktIyLQzLUoMkSbKoVEwtK2+VZWrl9H3bs4Y1e/a5eDxzDsycHz7X2muv9f/r//+11p6zt91aWloaupJ070rO6mvd4c6e8XqGO3uGe5biYDck188y1LOGeuS3Hvs8AVrrWZ0LtUU27VbIbrCRlMVsluQwBptgHEyHS+BcGAxBDlLZCOvhY/gQ/oD/oFxxuw2Fy2AKTIIJ0AuUf2EbrIF18A7shcOQX0xCPhh1KsyEVWAES+U7+j4Co/PpLtTOOB2bA7uhVJu/0fdZmFRQd9ZNBvWB6+AjKNVgVr+vGX8fNEO3LFuhzftgRu+HrZClr5S2fYydC8Ohe9AfynbZpdPJ8CTsgSwDLiWXjcs4cIj6P3AUssYsoH0kZDptO4yHFZA13rYjoJ1g8+9cWz6bn3D/UmjjdDIBGhPhoOhL5WmYBY1J47F/gkGNfAEb4Ptjt5J9ehp19/XF4N7uDToRxL28Gu4m0mavVXKH02ganoGprTeOVXTG4Bp8HdgEv4L7WxsT4WoYlLvuQRmLc50Nn2NXHwhnbg9T9QDTWTMYR9nM7YTH4WzoDy55HQp4kPQDHX8AvgEzEuuxvhD6BZu5OZxO23JIZ8rxHkj3wDBoApMQbOq0q3E43AKr4U9I61lP25hgM3GYBpVMASMZT/IvrpdCwYMgKAsl/UfAc+CKiPUZPAPXI+esWZqf6mP//eD4gUFnsZK+JuEx2AGxTesvQHNiM2fYCfooiTsaYU+9IcWMZd1nnBl4Anw8xXpdkpPB+zMgvaJ09mHI3O9ZtuI2xt0EuyC2adZd2tpM9oKHVNzBTLwKJ8XKyqmjw1PXgybWv5LrK+CrVPsBrm8rx048Bh3T4KeUbgM9CZI9kI7Il7SPjZWUW0ePS+098OAKTptF92ccCIP8FPQs11YYhw4zOQ888IJNy9eh4cZUo0tsdhhciRJ90+GXlJ14ItYN8qhK2FMH0gye7LGdI0aiF8RipN+IGypQfxcdnxXQo81lTHRrgT7HdQtdnh2LUoMadTgJR3TDa5daxQTjHoBvgqd+lvjYW5Z14wTb2vmRnFoZSn1MVVqWoNBHRloMsEtvXfpGBa7b+ZHP4QrYaqsit8QWt21Nrn7n35e576Ojw6VqDuc8WUuZdsy95oldFam2w+7ltBwlu/5FVhWptsPt9lRVvIyMVNvhyHRtqnWHaxP36lmtZ7h6sa6NpXqGaxP36lmtZ7h6sa6NpXqGaxP36lntchn25XtJkvtC0JfOvhLyxVz8Q8Af8f4SksP8+vGVTUUk9zVEm841/TrKn5q+qNNmSb+4ijqMwQEoHA5nwjlwBoyHeHX4RnI7+PbzW8b4iWMHk/iZ8riF8QZUm+PgPBgDg8EvELEc4sL3YNsYs4FyC+zCrm9FMyWfw4dQ0MSIa+F6uAb6gxH2c0c60jQl35XMrFl2Ip+iYznlKibgpIoK/Z3PRXADTIFRoPPa9F4PiMWV5Qcz7WrTd2YfoOctSl8ZOZd24itUBwZcGnfB27AbVOLSCfdLLZ3APlgLD0JvmAzx+2l1bSEgFMmHsYWUm8G3IOkvEqXadb6+dPcD+SuQHpe8M44bde5HcMJxe1y3T0AHCgXE6DsBjT8EaUd20nYnuA0MdiFd3tNeMZvO1b3tx7V43i0ePGY4/XLNTvGhxGWDX9j3ghnbAlvBfhofASPB5egydN93h1gMoJkbEjdSNwDqHQTpJWsAfMm3AQyIifDaubmtxsBYuBAc3wwFxX2RJbGzLmv3w4uwHpy4WZMg6hH323i4AybDaAjiPUmL44amGn2fvBH8ILAEDJQZMzhmWXGOjTk8b66EaXA5DIO8YobbpD26XkHdyRu9Xu61YtBPB8ywE1gE+yGf/qz2TfR/FAxWUzF74T59DeZAmAFrIEu3be32sI1Ocg64RMr6uMU4l7TP7anwA+SbQGg3c/NhApQU3OBsXDLWgJvhueAqDPpD2c5h9+pM6BMrKreOHidwFbgHg9F0qbMvgSuprO/C6fmhx6fCLNgDsb02Duvs7dCYVnAi1+jzMDofXK6x8VB/nvZTTsRG1lh0erDNBvd/sNXqsI33QkWdDRNBr0vc88KgBuOWK2Fw6FfpEt06vQB8mmiv4eZc5X3KAZU2GOtDv8t7HriENe7z+YK4T0fUsXEW+GhLHL6VymaY2BHG0jqx0w9eA4273Nr8P6p0/0pcawOmwEEj7jNvPoo9VDpcsHOAv3VdYp7gS7k22x0qORv+jb3Yh/co2E+jj6KqCIZ93PnM3I5d91ZVBLtjdVj8gyJZ39WwjOHEZi3stvmvh9VwttY23MxdSuoOd/Z01zPc2TP8PxKYOEKWmL1pAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.download, +.x-button .x-button-icon.x-icon-mask.download { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAGb0lEQVRoBd2aX4gVVRzH3V1dU5JMk9Q2wVxCo0QNTYRYS4l6CBFBomA1qjcjSOgPPUgR0VNBFBT0Bx96qAiSXipCH4rKIhGNUqE2SK3MqKwsLbXPZ7rnMo73jnPnzF6v9wefPefMnPP7/b7z58yZudtz6tSpMaNlPT09E/DdDxPhMpgNJyBtfTRG4AAchePk9BflqFhP1YIRqbCZsACWwjWwGIrYZ3TaDZ/ATjhIfh6IyqwywQhdRlaLYBVcB5Mgxn5n8HbYAjsQ/lGMs/pYz3AMOFLgG/AzeH+MBvo2xqqYXB1bSiyBe2EJvAaH4SSMhtC0T2MYy5jG7i0jvmXBBJoMj4D3VjuEpkVbN6axzWFyq6JbEkyAhfAqOJtmE2l32xzMZWErogsLxvE62As+Vtotrlk8czGndUVFFxKMw41wEM7FJdxMbNhuTua2sYjoXME4cVHwEDhZhACdWpqjufblCW8qmIHOxHfCT9CpIrN5mas5N53B8wS7kPgKOumezQrMts3VnJc1O8sNV1qsmq5k0LNwI3hZx9ovONgEPk4amcvRR+HiRjtb3KborbAB0fvOGJs9EnRwwf88HIHsESzbVuisbKzQdh/Yp6z/7DhzV8OEECOU3qd148z20FgDK+DC+o74in59Y2pm7rNPVWbualhT01T3e5pgts6D9eARrzIB3LXVzF0N60FNdasL5kj0sXUtzIf+eo/zt6IGtaytaUuU1AXTugKuhyomjsR5B/xRi5rUllgimCMwltYQzAHr3WJqUdNQTWOyuFDcpbASptnoMlOT2tQ4phfl3uBzwes9byZl93lpalLbXLV6SXtzr4BuPLvISkxtauxX8DjwW5Qv9t1qalPjOAX7vJoB3TRZIec0U5saZyl4ELr57CIvMTUOKngAqlxGJt478I8aBxQ8Hbpxds4eczVOV/BUuCC7twvbapyq4Ha8JPQVOIBF+hRwk9slWVLm9miy8xjbj0PRA/YHfU828eVm99mnyFziu6/9XT+Mh5as7KPIoE/BB/BPgYgeoP05/dx3OxQR4LrBF4IHoWUrK9j7wZeNzXxJGGk5amYAPvyovj2zuWGT1eEcdjwOpeYdL8mytpyBr5BAW5akroOxy4n5MiyFUqZg78W8+yvPsZfWEyQy3WzyOsbsq/n2Q9+TYMwypsbjCj4EXlJlzPHDcD/48W+0TN8PgF9kyh5YNR4y4e/AGbKsOVveC8OcCSeUSg2fir0H7oayc445qVGtY5bBHnDmjeFXxt8GY8Mn0dhSX+Ds/RvE5OZYNao1eQ/+kNJrPNapoocg9/edIgdCH3AL6DM2L7WpcZqXtKd6L/wJsXYRDl6ABVyK+i5ltbGLGfw06DPW1KbG5NY1MS+bbyD2SIbxO/G1HFo+046BG+ALCP5iS7WpsTf5MY3KPPgYTkCs8zD+XXzNLHL5hj70dwb2WbsNgp/YUk1qm2ecINh/MXoMfoTYAGG8gV6ES4Kgs5X2hZegivkk5KEmtU2qC04q/082u9gROlZRmvgmSH6lzBNMHx9pJlZF3LQPNQ2F2PXfh9noEvF18AGdHhBb/xd/d4SAzUr63AX2jY2XHq8WNU0LceuC3YCtBiecqgP7HF0XgmZL9m2AI5BONrauBrWsTsfLCnbV9AxU8ezLJnwAv2vSwa27DX6AbP/YthrU0p+OeZrgWgLO2FvB99zYoNnx+/B5dUiA+kL4FrL9YtvmroZkZg7xEn3pRqjTcRhGIDZwo/E+rpyNZ4D1Rn1it43gdzjoSZdnnGF3Yq5h74Oq76sg5D18b4PQrrI0Z3NvuKZvKLgmegqDNkPVs3aV4rK+zNWcp6TParreVHBN9ACDt8DfkHXeaW1zNNeBtMBsPVdwTfQgTt6CThZtbuY4mBWYbZ9VcEr0mx0qWrHmdlaxiZbsEWjWxuFkeBhcm7pkPNeXtDmYizkV/r/pQmc4HAQc+934ZtgBVa/GWjmAxjYHcxkf8itStiQ4OCTIbHgO9kM7z7axjGns2SGfVspSgkMAgq4EZ0b/i3U0hevbGMZaGeKXKRv+cylOCxufY/xCcS3cCl5ii6AXqjCFeum+A2/D54j0Pbu0RQsOkRHu+6zP7avgJvDsz4VWxStyD7wPrsi+hP0ILfIbFl3zrTLB6TCId3KbCK6X58MSmAOuocW69jUcrmH9U9gF38NRRB6jrNT+AwkLDdxcvfCRAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.favorites, +.x-button .x-button-icon.x-icon-mask.favorites { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAFfUlEQVRoBd2aXahVRRTHz/Ujv+2mZRGZB7W6mtpFikC7+UWUZiqBD0JPFdRL1EMFPfjoU4baS0FUD/UWZBEVShA+BCpmWApRSkgllNpDmZWZt9//eOay72afvWfWOTPn3rvgz8yeWbPW+s/XmT379AwODtZSSQ+CryVgA/gVfIx/pelEhFMBVlvBOaBeFo6Cean8y09KsnMg932TqCOs9M2UhMfhMJVsxtHcAmcbmekLCsqjFKUkvAYG1xSwmEHZqoLyKEVJCDOCNxH9HUCbVl6mULAuXxjrOQlhgl8Bbi0h0Uen3FBS37GqVIQHiHh2SdR16jTlo0t0woycpuxiUDSdHcFeMv3uIWYanTDB3wIWVZBQHP10zuQKvbarUxDWT1HRz1E++Ds99fLtgp6jEmbExhPNcs+IbkZPiCpRCRP5TPCQJ4MJ6A3QSUqjSWzC2ozuC4j+fnSnB+gHq8YmvJKIJgVEpRPX9QH6waqxCa8PjEhHT981H2j6qno0wqzF63BhOUxsom3Zb7aJqGsUjTAONFJlpysXQz7VuXpavrBTzzEJaz1adlzNjHs6RTBvJyZhjZTF/kTaWZZCnlvhsyWgQkPZQpagzsX1bFlAXjGtDdAPUu1p3PPQhCCXkdwG/mta0PWLds060AuAnqtEOjpdbQR3VymX1P9F3UfgGJA9X9F92c/ADaQ2P8V0DJ4/kDbeYKaSvgI2AN0+OGJK1VAbSIhTOXEOybYll2kte77yD4rqrHyb85S9Cl4HtReAyI11/A7HpRq5PSD6oR0f3Rad+H7S1DvV7UgS+tc1cU3n3V/AWJ/SX8BxVuMinow2rNNjlPQVeH0GFg378kDBfLAPXARjZbTPwmUXmOG+bgz71EKFfqKeAUWfREZbJxyCxyOOqEuHER4qrNUWovwy0CFktBHV4eNZMNvxyaaFhKWAaBt/HJwEo4W0luSKLMF8viVhp4iBeeBd8CcYqcQ1qi+CKS7uVmklYdcQY0+C42Ckkf6EmO51cVal3oRlCFkCdKgfCWtbo7obDO3AVWQbHHyUsjo40E6uq9cvQbdG+wN892fj8s0HjXDWKA51/t4JUo72H/jTDtybjSUkbyYsJ0gdfAtSjfTn+JoWQjCv2+57a4M1QaQSvZvrMsIs7RJejGcdUlLJUhzpZsYsZsJcCen6ZwCE3IaYA2021OfUdU3fJltmwni7Fvh+KDMF16KR3ux0lWuSdgjPxeNdJq/tNdKNqJaSSUyEmVK6JNPomtqbIh3eSKNsEmvAarfJ5LEzjbbR59MtpqyEb8eZjpndkhtxvNri3Er4YZxpx+yW6Jdhi8V5MOHm+n0QZ9afo0u0fQO8A5S3iPaQ1cTSG9w4f/SqesZBH/gRWI6T+gyyxfkgvw2cMdrS+/lTzpZvGnyWxsnTwHLRd4R2a/OBqQyoztKBe/P2qp6DCBOUptKHhuA+pU1fq2Co0/F0L9CVaghxXTbWW9ktKg8lrFfCrwODeh/9wgu1bEDo6OT2Fvgb+JLWq+nQEsnaa5UPJbwKBxc8A9KXPG1O3u+u6E4F24GvD3XMDjCxFcF8uTdhjGpHfwn49L42lCeAdyDZwGi3HpwAPr6+Q29htn1ZPoSwfuz3ewShXVcBNz62lzkvq6O9DjZHgQ9p72kdQljvob9VBPAN9Q+UEQmpw5b+Sf8e0FotI/4a9ZN8bIcQXlnh9AD1y3ychuhgU0tpJyhb14epn+ljN+Sk9S9G1ct50d8SdgF9x9EO3lHB5hXwPEYfA8dbGD9LuWZBtfj0inSQWUDTKzu1dAB5Dkz2tdOOHn70LvwVyMag/FYwzse295Rukq5j+G1wEOib66PAy5FPMD46+NPmqTV7CpwGGvkJPm2l8z8GWDNDloqpGQAAAABJRU5ErkJggg=='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.info, +.x-button .x-button-icon.x-icon-mask.info { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAHOElEQVRoBdWbXYgVZRjHXdf8ysjUQl011lbRIFEjM6Uu0iyiEDG86EItKoIuuhDJCgoioouugqKbgi4CKwulILG0mxLTUtMyTWQNPzLTPszU1cx+v+OZw9nZM3POmZl3zQd+zMz7zvs8z//MvF+z2nLhwoU+oaylpWUQvvvDYGiDdjgP1dbKRSccglNwlpxOcwxiLUULRqTCRsNUmAk3wS3QiG3hpp2wCbbDYfLzhyjMChOM0FlkNR3mw61wFeSxv2j8FayBrQjfmMdZpa1POA84UuD7cBzsHyHQtzHm58nVtpnEErgvzIB34Rj8CyGEVvs0hrGMaey+WcQ3LZhAQ+FZsG/1htBq0Z4b09jmMLRZ0U0JJsA0eAccTeOJ9Pa1OZjLtGZENywYx0tgDzit9La4pHjmYk5LGhXdkGAcLoPDcCle4SSxUbk5mduyRkSnCsaJi4IV4GARBSj6eALfR8sxunLEMUdzbU0TniiYho7ED8GvULRI/UV9cDbnrsauheXQCVnjmas5J47gaYJdSPwAIfqsPlfEnwRl/eBBOAlZROvXnGfFfUfXNQXTYCKsg38gS+B6bT6MEogfiTcKNuaIa87mPjHu2+segrnRBf8bYN+ql3jW+ntrJVNK6OJGw+VkVt+2M3c1DIrHsZ9WjPVwCxcLYQ4MqVQUf/Jjikt3VnnX4eauhoVlTZVw3QRTOhmWwjhQfCi7ppZjkjOf62FCrfomysxdDUtBTRWrCCZYK6WLYAo4aoa0JxKcu2x9CsYk1DdTrAa1LCpru9g2ese58lddD+cgT/9ppK2j8ONR7HLf9Um8B0XOCmpR04QoVmnQosDp4BHYD40kXMQ9zsPfgSI/hyNQhN+4j/34VVu/0g9b/nXbKFgJf0O8weV+rSa1tam1b3kUm0SB77sj5KUw18OhTE1qm6RWBy07t0O4S7veto8J6FLwbng+YHC1qbE0GDtnrYXeGKzsHj7NT2AejKgMJn36DODaASZEF1KbGof4hJ2vXM45cIW2nwjwKDyA0HXgDicyl4RpC5LovixHtalxnCcd4PwX0hTjcvEFRO5ICBRyoWNINXYo2Ek+5DJyP/6fgZWI9XVNs3r1aW3r1alxjIJHQqjR+Vt8L0fnpxzrmU+45pKzXsMG69U4UsHDYWCDjRq9zYFpCzwGLi5K5qyA+KQpSMHt5VtDHNQ4XMEh+s5R/L4CuxSIUKeDO8BX1pG4lrlDmlqrosCy0jxcoL+KK5PvgFbEOka8CKsgbRd0u/dDUPMJh7ArcXon/A4PwwxwyvkKkuwuKi5bwYqaDbdBNAP8wvn3kGQ+4RDdq1u8UE/YINUjv313L/35bLfo5Qte+xs5va5WXdFlrrRMImnkLCreaRxtSnE2i7q8n3VS3Jeq1HhWwY6o7k1Dmn/r3ZgSYCZ1g1Lqi6hS41EFHwC/QIQ0P5D7vbiH8Tq7DnD7Frr/qvGAgvfBnxDSNqcsOJx7Xe2FNjXuU/BeOAah1rHn8f0FJJkDlk85pKlNjXsV7KPeA34KCWUuM5OsN760qE2NJxXcBevBfhbCOnFqsB5G/72aQj8vVVuIN01tauyKFvPbuHBhEGJ6+hK/SSLaqBsPmrFfhZe9KND0q7ZtjiM+Ye0guIXzPS/atuPQflzLxlI4Go6AOys/wq+Gn6EoU5Pa1Fj6G7Dfpp0nfeT+EkXaOZx9jf+kJ+xqbAPcxy1vwhnOd8MuKMrUtB7fauz2HcsgBuuAQVCEHcLJ8RRHrr42kExpWqRPu3mYDTektGmmyhVe9x+QYJU/mVK5AHwF/QblU8nLWnyMrY6Rds69T4Kvd964tleDWhZUx6yItRBzo+7A8QcUEXQVfkZVB6x1zj3GfQ587YqIqw81qKV/dcxugsuiJ3OT/cr+lzf4S/gYXB0wfk69HwX8YRxN88aL2pu7Gib3iBcv8BpbDJ0QOch6fB0fNf+1HOVXwD2wE7L6T2rXic/FNbXVLLw4mNmfTuRMZi/tx8djUDYHPgAHlaSks5abs7mX/lrYI3a8ILqmwTB4G9xWZQ1uu7egHQbC/aBQR+88PpPamqs5D4t0xI89+nD1DTT0A9waOANJQeqVu+j4Ddx3u26vd3/WenM01zHVGuLnqYK9GXNeXg15RGcV0Wg7czPHjrjA+HVdwVWifRX/j6LNydzqii1pif8CSdc4HApPg0u1IqeQRp9i/D5zMBdzqjkT1NLS0BOOGuLYv+E6lWyFolZjcSGNXBvbHMxlQJRfI8emBEcOCeKo+xq4A+nNp20sYxq7PcqnmWMmwVEAgs4FR0Y32CGF69sYxpobxc9yzP3feMo7nJtJxDnWV2w6RPtsTnOZQn1118JH8A0ik/bWVNe33IKjEAh3qei87Ue5eeDTnwTNilfkbvgM1oHb1oMIdX2c2woTXJ0J4h3c3NyPgikwA9zjjigT7Xf3ce0XCfF8M+wAv3icQmQXx0LtP/qKurS9uZqyAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.more, +.x-button .x-button-icon.x-icon-mask.more { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAADJ0lEQVRoBe2YS2sUQRSFp5MgvmLU+CAMiBJFDBHcCeoPEFciuHMjroMK4lZBcONG0JW60U1UEgRx59IXuNMoKEElKL7GRwyIqNHxO0N66FT3UNU9IHRNFXz0VNW5t+vW6RcT1ev1Sie1rk4qVrWGgn13PDgcHPZsB8Il7ZmhqXKCw6kt8WwgOOyZoalygsOpLfFsIDjsmaGpcoLDqS3xbCA47JmhqXKCw6kt8Wyg6XAURV2wEy7BM5iFtzAKu2BB0dqJ7YEtcBYmQblfwzjshUVt5O4mfhjOwwQodw3GYA8snpd77n9pFXMYvoP+qDaZZewcVKXPAzE64Qn4CmZe9f/AFSiSu4e4IzANrXJfZ24gXjO/KxEcg9+QFZQcU/CSONh2RKsraMQhr85xE/psOeN5tCr2APyA5Bqzfl9D06tYtX3wC7KE5pg2ZX98UtsR7XZo5ayZW/1DENnyzi18CO1nyMqTNXYcrTapcitHkBLJiZW2RaGRuxcg6+Stxu6i73fI3Y3uZM7cU+hXQeVvzsBP6Dc5LupxztzaiEGH3AvR3S+Qe4dc0D2cp/Uj1oPI1pR7g030n+erWlTe9pMA3cu2Jre+2ERtzBdZe01BL3Ke9Al6vQZsTbfKQ5vImH9PXxtqa3qVPbWJjHk94J6r4DPGhK17A8EHm4j7UAWP2nTG/GX6NWMs1SW3rrCroLeLaxtDqDdG4368zbHVkzM5Polus+2hEs+j7YNxx9zv0FkfhoncvegvOuZ+iW6rYhtfTXTWgV7OyeLM3w+Y3xaf0PVIzAqwFf0IzW7XnLGOmLUg58y1JvsTzA83Y5o/eLcyMQISJAN0z56G9bE275HYNXAU7kAy9xv6p2Bj3pyxntjVcBDuQTL3FH19Dg/FWh0bXzUMNhsf23JkOQzCK9B1P4NY39OFG3kjgpeB8g/AR/gG0+3mJkeF9Lp9lkIVZkDfC1r3vPs8VTAir1uRd1mpNyQUXGr7HBYfHHbYpFJLgsOlts9h8cFhh00qtSQ4XGr7HBYfHHbYpFJLgsOlts9h8cFhh00qtSQ4XGr7HBYfHHbYpFJLOs7hf5j4Vg3iLoGkAAAAAElFTkSuQmCC'); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.time, +.x-button .x-button-icon.x-icon-mask.time { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAIPElEQVRoBdWae4gVVRzH97qr66vyhWbmurY+MA111dRMkLIXRuhG/pMVSUKGBGYPMTLDR0iaJBFUlIp/FJJlpWJS6vrAlCwTe1iaippSZipmPjL7fC/3XGbnzjkzc3fudTvwYWbO73d+jzlnzjkz96YuX75cUqiSSqWaYVs0hvZQBY3AW/7gYg/8A+fgPDFd5FiQkko6YZJUYj2hNwyDAXADlIOrHEO4A3bDVvgZ9hLfBY6JlUQSJkn14CAYAiNgFPh7kqpY5SDay2EjbCfxo7Fa25TVw/UBuw/BWvgT9HwUgl3YnQXX1ydWtc0rWRyr9zRcV8FpKESSfpuX8LMXnoDm+SYeO2GcXQfz4Cz4gyrGtSa3TaDHp1HcxGMljIN+sAGKkViYj+PEMRkax0k6csIYfgoOQVggxZa/R0ydoiYdaZZmFp6C0ZmgNTVu0YSzBQ6A1tuTYEqKk5ugA/SFkdAU4pbVNHiYpLWmu4vrztBSy83TcAai9pyeba2lz0E1tIFysD5vyMrgKugIY0GToW5MVJ/SWwltXPlIZh3SNNbdV9B/QRTH59GrhQehSZhjl5z2pucXc/4rRPEvHfV0B6dtm5CGI+B3iOLse/SehVgTiM23tx6bGuafwb8QJRY909ZlK7CHadATtOZFcfAmel28QSZ9jn0914/AYQiLScvW45Cen/yx5CSMYhNYA2GGtdGfDS38Rm3X6GpO0PNsKLPpBtXTbij8BGGxaWQODrThr0RxEuguuYzqeZ0Opf72tmt09TKxHU57+JLz7rY2QfXo3wpRkt6MXs7QrtPDKHSDfeBKVpPYjKBgXHW0mQVBz+HzrnZBMuwo6b3gilNb0Yn+9v6E30UpKCiv4WnoBD4ffuPea9q8YrE91asX9Rxb2loeBG9s/nO9YlZ6bWZf4dhc9EB4B2hJsBXtYd/AgAzHLfm0cfnYhvBlUE/aSlcE473CdMIkqyTvhU5eoe9cE8E8cvXulHwqxbvM3PRFeFzn8FqKbDTpdTQ6pof1BlQDtt5V7yzDySemYUM4Eo8mz4WgFwlb0RJbbYQm4e5U6JmwFe125tiEV7KepLWlFJp7goqW2WH0spbEkkacqOJ+UPfbylIMK+mGWl4lsLOO4DR69Tynv1y04DhSF5aiDcY7FllDqdbLSq0jmB7IKiXXkNYDrXFuK+sRHLMJG0I9o09zzEeOWDQ3DWI0lyphPbuqsJU1CFzDxdau2PVfhMSpiaupEh7uiEyJfsUNtE0IjqZFF2mmdi1R+j6eTriLI7T9yLT+/h/KBYLUHttWtPSWqYevtWlQfxjOOORJiJIaPRcJ5pAjIC1LnZVwL4fSEWSFTvhqh//IoszEtSekQYUSdpUTCLUsFbI8wOw5HvRNq75Fb3LOEpawa/Z2Gg4Q2mxpjdQ6v4KkBwa0i1Nl85G1EZZwVjGBE/Mx0GbqNgQfkvQECA3cZiSkPqWEtQG3lQoEiTxj2FkCW8E1SXVG/josJecqjnGLNlGuck4Jf+PQaIcsn4/vOSaZVLTE3Q0LwLVz095en3rXknQNlHMeWtBTLl1DFHdIri2ZtmZBaFnqo51bkmBT79660UE+vXV6DOZCVZh/dJrDUvC2956fRtYeSmaAV+A/vy/MWT5yfGr4PQNa9vw+/df6VDMRrB8NkWk0/gL+tuZ6G7JroOQeh5KU50Csz6lRbwB2NQyHwhYI+1Kqbe770D7IPvXaOmp+MAn6j5pDmkH6hywZ8yuY653I2gY5SaoO+y1hKujHMOPXdnwJnZwOoG52SNsJildFzlaCzYHqRyWVnMsOfsaAetsVyzTkdX674lrP7z5HO80F/U3CGlb6G4HLSS3ynLvqCj5fGX5ag37o/g38MX1HXc6Qzui7HolPTbv07MtFPzgKfgfm+m9kY/JNIp92+BsCmmhMDJrcJvltUaeXn689ekbfe3wSefrnWpOw9rHa3nmV/OebkLf2OyzkNf606XkNDsLbkPPrJHUa4hfAH6+51kipNnFm11cqtTa6Gko20zRsCEfiuREOgEku6LgKeXY58yasRTlsaGgjkr1bVzJp4tDHx8UQlKSp0+ozzhtnNmFVUh6DsI3At+hUeo0U+xz/KVgIJjHbcTU6dR4Df8Lat34cwdAGdDoWO9FMp5Tiezq4Hj/dAHVceinyxlkn4YxB7ViibADWo1fUnsafOmQW6KOErVdN/Yvo5PzKmZNwJmmtg6ah66gXgAHeO1ioc/y0g7kR49qIXqugWGwJl9EgyjOim6GJbCaE/mUoKIAoddgeDdvBdfONTDuuXja7gQlLmdIKwrZ5xol2ObqrYyC7BNicRq3HVm9YBPpUbHy5jifQe9Rl35pwJunBGNgV0ZkC0Z5V29BR0AHKXc79MvS1zdVmoy/Mg+PgStAr0yQ1BZw3PP1Qo2QtfEnQJLYY+liVggVHqF4O60DDXjsezax6ETf7Xo0iTUQ6toZb4Ha4E+IUbX1f4AbOD2sUmrAMkLR6egHo3TWfcopGO0G9oG2ieR2t4lw92g0qIZ+iz0XzSVYjIrz4h5XtGkvqgagTmXeoFfJcb0+B/8ey5mETBNVjvClMhjjPViES1s8qy6AiKE5XnXPSCmqIE23rBsIK0PNYiIRcNn/E53jI6/08dsLem4DTcbADdMddQSYh0we6t6BeW9pIkxZOrIUJrS3Cm6EG7gJ9TE+qaFbXLP8BbOZm76mv4XonbAIg8ZacV0B/GAvDQRNdPkVfOvQe+znsJ1HXh/tY9hNL2OuV5PWu2hyqQZsIra/6FCO6gClapn6AU7AbtDfXxuUknCHRSxwTLf8Bgi31NJnvpzwAAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.user, +.x-button .x-button-icon.x-icon-mask.user { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAEWElEQVRoBe2aS0gVYRiGO1lmF8nQQlETutGFokAiqEV0ISKwgmrdMtzUpnW7drWKbFGbQAKpJIhuUGIUFUkW0T1Jq4V2U4ui7GLPexpDD+ecuX1jHqcPHseZ+f9vvnf++e8n0d/fPyZONjZOYqU1doLHRV3CiURCz5gMxTANJsJg+8XJJ+iBt9BHNdO1SCwRZR1GbAFRl8F8WAFLoRwGLME/ffAM7kETvIYPxPWDo7lFIhiheURaCVtgBywHXXOzbhJcggZoRvR7twy+76uELSEAtQsqySPwGdQN+KWDPHuh2DI2+TIVm3T455M9G0Bk6ktRvd4NBZaiTQUT3AQnSNW/VAFBzl/iZw0kq56FcOtuaQHB7QIv9ZVkrqZ2YA9Mck3pMYGZYKeh2sBz1SJb2mqcmfk0E0xQ6l9rwNoKcWjm11JwEYFVW6t1/K218mspeB5B5VsFluKnIuU88Kml4PGBo3DPqBGZiVkKNgvKRFkGJ5aCv2Z4xoi6bCm4DWUaXERhZhMJS8FfolDq+DSbRFgKjrIOa8poYpaCTQKK2sl/wSHfcFSNlll1sSzhn7ys3pAvLFP275lu+L1uKVhBPfYbgMf0zz2mc01mKfgbT7vi+kT/CeT3sv9s6XNYCtbg4CJ0pX9U4Kv3yXk3cO6UjGaCWX5Rg/UArqY8I8yp1qdPQ08YJ4Pzmgl2nCqwc2DVyKjunuddqkE0MVPBBKYSuQ7tJtEhFj9apDczU8FOVB0ctZiuHYUw9obMjbxErW2bmblgApTQengVIkq1B83QEsJH2qzmgp2n3ObYCEGndZ3krbcuXcUWiWACldCjoA0yv6a8J6HJb0Yv6SMRrAcj+gmHA+B3aneDPHXk/8jR3LR3a2rOfnAlTmfDVPDb6Khrq8bPDI5PoRPxZpMSk+1SgtOKpTa8l8BC0JaLmAkloA1xr/aOhJqEtINGWeqW7jjHXrQHbRdw4WxSJf8L8Aeh2m1QaWoBfiUsA61PTwGtUYeZ1qlP1zhan3YraBSnz/0mdAUVHqiEESoxKs0a2AxloJIMI5DsWU0vQH2z2oZToAnFI7+fu2/BiF3PgzbCKqgC1bXhNH3S6rba4BocR7TquifzLBih5XjcCSrROaAGKbJWHt9uJuGq67fgAki4zrNaVsGIzCP3dNgE20B1VJ+uro8UUz3Xr39UvxugCeEZl3UzCkZsBZn1+W6HRaB6qtZ4pJp2PtTna+58DFoR3sVxqHFxyM8euFsIW6EeXoDeoPrBXEEbAlpqqoN1kD9YY6rYxSQ4DGoE9KOSXBGZLk4NYB7CfigZEP1XMBfVEJ0BJUznIFevaSBzEEolOimYkyo4AfocclVYtrjViB0C9SzJEdE+jrn+CWcTrHvdUKuRUSm0gPrZ0W7tGjjMhTiIVWFWSbAGEnGxhAT/y+HhsL9oiVWFjo3FqnRVqrETrG5pFmiSEAuTYC3TFMVCLSIzTg9H6wuIXR2OneDfMJq1NmzzbS8AAAAASUVORK5CYII='); +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-tab .x-button-icon.team, +.x-button .x-button-icon.x-icon-mask.team { + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAFI0lEQVRoBe2ZSYgdVRSG+yUmnagRQYU4NbZKNLYKWTgg4gQOaDYqJIIGl4LixhBwoy50LSIiulEjCkpAUBBRURpdGceFMQ7YtgkOJE4xTjGa9vuedUl1Vd2qevSrFqvrwJ97695zzj3/PXd6nd7MzMzIQpJFC4msXDvCbc94l+Euwy2bgW5JtyyhOTpdhnNT0rKGLsMtS2iOTpfh3JS0rOGQ+eLT6/VWMNYJ4NjUmN9T/xLs4WfqvPxO7TU9DkTdNmvBbeAskJ7kv/n+AjwKXiSW7yibFQk3BSIPZHdTl5xZzML238DDYFlTsQS/jZF1AGQ1mAZZkkXfe9FbGwJrqmz6lL4cEmOgjhyO0jq2gGVj0hhhAl9M1FeB3gDRn4Pu/5NwQnJ0ALKqrgKHDmgzkHpjGR4oioPKP1H96+Dn8GvpKyLqneV5Lp0XgnHggTMFJjlYPqAcpnyLsz/LHBLL0fRfCzwbvNN3gLeI5WXKaik7DbF2/20A28HPYF+CPZQfg9tj9vS5h18DRSdyrO0j9FeW+PQenwTe138AJ+d34OPFa215zDa0l15LOLgamM0DIBukbQ60JjhLl7RL+HWQtSv7jhLGz1FgM3DJZ30Yy69gYzqGonrVHr4eJ+OgB7Ji2xi4lGUW8+PsD0vOwNGNwInMirF42K0nlmXZzvR3LNARDN3fx6WVI3VJF50Fzvr7EZtY8zQdLtUiOYXGIrJpXUmvTDdk61HCKEqiagD9SSwnLCeX3RYwSJafRd/zoUj2FzVm2hyzMJ6gV0Y46Myl/BzjeqfnyMg36G5NJqpoTPvnLGWEnS0f9lVStL/7NgT/C5XNoHTW6XesV4En/1wlGo+Oo4QJ1ivoxxqju+fKCG2lf1uFH7P3eEl2K8xndRt3VKKEE4sPKWOHiCreg28TaPR1RN/X6GwEO0GReJ3cg95kUWeqzT8W6KtMpujcVaZQRfgFjL8qcbCDvndi/Zz0h4Hr6L8JHBHRW0L7DejdAU6K6Nj8CfBQi4mH4xYmrmy1sXlK/gCAAyfkQaAT91kWj9HW/6tJ8MO3NmeC+4CHlqdu1q7o25Xk5Hqynw+WBp+hpO1K4JItsnfr5GyCbSirCHstnQpcKulBXMK+o1frCPGgWAomwL2gLsm0z3S9ny38XARWgEXJOI7xNMiS9ns9MN5ZCQhEQ1lIGCOXmZf4ZeAW8C4IAblv3wBXAIn6sjkZ3Arc80FvGKW/nu4H/nhZDiR0IngI+LYPY3i43gWuAeNgFBQSn0UYJZejRH3CPQ8cMDi19Jp6AviuVfd48ADwRZXWG3Z9J/6fApeAJUm2TYRE02OZjPfA3WAM9HVDdvt2iXHI1HkoPQd2g7SjUHef+NyU7AXgFRD65qOcZrybQXgFmtUDIDu2xE3CBuCWWBxIU+8vk9MozdQukDUO3x4qm5IJOp36ZyW6waaJci/jrkviWEV9qiQOdd8Ebr/+T0fKkYvBp6AqOB2fnQz0SA39Kn9z6Z9mfPeze/UlUOXrB3Q2AW36a77KwP7tYCwh7Mupjk1TOmZuNInlyZqxuN8n3ItrQF1xryvRl9W/3Y3/60QGCTGF71h5JB0Tbn7vsDqyP6Vkva5dymxoVQ+lIE6+3+lJCH3Zcp+E78y2Fny7Evw7kstC8YA7BtQZRP1hiwTDKnuGun8aSiekaDxXwrbG/zOtaOT/ss3MLSjpCLc93V2Guwy3bAa6Jd2yhObodBnOTUnLGroMtyyhOTpdhnNT0rKGfwD3f6JVZi/xSQAAAABJRU5ErkJggg=='); +} + +/* line 218, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light { + background-color: #2583c4; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #97c9eb), color-stop(2%, #3495d9), color-stop(100%, #1f6fa6)); + background-image: -webkit-linear-gradient(#97c9eb, #3495d9 2%, #1f6fa6); + background-image: linear-gradient(#97c9eb, #3495d9 2%, #1f6fa6); + border-top-color: #2175af; + border-bottom-color: #195884; +} +/* line 223, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light .x-tab { + color: #c1dff4; +} +/* line 227, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light .x-tab-active { + color: white; + border-bottom: 1px solid #278bd1; +} +/* line 232, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light .x-tab-pressed { + color: white; +} + +/* line 239, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light.x-docked-bottom .x-tab { + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} +/* line 241, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light.x-docked-bottom .x-tab .x-button-icon { + background-color: #6cb2e3; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ecf5fc), color-stop(2%, #8ac2e9), color-stop(100%, #4da3de)); + background-image: -webkit-linear-gradient(#ecf5fc, #8ac2e9 2%, #4da3de); + background-image: linear-gradient(#ecf5fc, #8ac2e9 2%, #4da3de); +} +/* line 246, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light.x-docked-bottom .x-tab-active { + background-color: #2175af; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #195884), color-stop(10%, #1d6699), color-stop(65%, #2175af), color-stop(100%, #2176b1)); + background-image: -webkit-linear-gradient(#195884, #1d6699 10%, #2175af 65%, #2176b1); + background-image: linear-gradient(#195884, #1d6699 10%, #2175af 65%, #2176b1); + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; + -webkit-box-shadow: #1d6699 0 0 0.25em inset; + box-shadow: #1d6699 0 0 0.25em inset; +} +/* line 254, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light.x-docked-bottom .x-tab-active .x-button-icon { + background-color: #1da2ff; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b6e1ff), color-stop(2%, #41b1ff), color-stop(100%, #0093f8)); + background-image: -webkit-linear-gradient(#b6e1ff, #41b1ff 2%, #0093f8); + background-image: linear-gradient(#b6e1ff, #41b1ff 2%, #0093f8); +} + +/* line 263, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-light.x-docked-top .x-tab-active { + background-color: #2175af; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #195884), color-stop(10%, #1d6699), color-stop(65%, #2175af), color-stop(100%, #2176b1)); + background-image: -webkit-linear-gradient(#195884, #1d6699 10%, #2175af 65%, #2176b1); + background-image: linear-gradient(#195884, #1d6699 10%, #2175af 65%, #2176b1); + color: white; +} + +/* line 218, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark { + background-color: #0e4b75; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #359ee7), color-stop(2%, #125f95), color-stop(100%, #0a3655)); + background-image: -webkit-linear-gradient(#359ee7, #125f95 2%, #0a3655); + background-image: linear-gradient(#359ee7, #125f95 2%, #0a3655); + border-top-color: #0b3c5e; + border-bottom-color: #061f31; +} +/* line 223, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark .x-tab { + color: #63b4ec; +} +/* line 227, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark .x-tab-active { + color: white; + border-bottom: 1px solid #105483; +} +/* line 232, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark .x-tab-pressed { + color: white; +} + +/* line 239, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark.x-docked-bottom .x-tab { + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} +/* line 241, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark.x-docked-bottom .x-tab .x-button-icon { + background-color: #1985d0; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #90caf2), color-stop(2%, #2897e5), color-stop(100%, #1571b0)); + background-image: -webkit-linear-gradient(#90caf2, #2897e5 2%, #1571b0); + background-image: linear-gradient(#90caf2, #2897e5 2%, #1571b0); +} +/* line 246, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark.x-docked-bottom .x-tab-active { + background-color: #0b3c5e; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #061f31), color-stop(10%, #092e47), color-stop(65%, #0b3c5e), color-stop(100%, #0c3e60)); + background-image: -webkit-linear-gradient(#061f31, #092e47 10%, #0b3c5e 65%, #0c3e60); + background-image: linear-gradient(#061f31, #092e47 10%, #0b3c5e 65%, #0c3e60); + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; + -webkit-box-shadow: #092e47 0 0 0.25em inset; + box-shadow: #092e47 0 0 0.25em inset; +} +/* line 254, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark.x-docked-bottom .x-tab-active .x-button-icon { + background-color: #50b7ff; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e9f6ff), color-stop(2%, #74c6ff), color-stop(100%, #2ca9ff)); + background-image: -webkit-linear-gradient(#e9f6ff, #74c6ff 2%, #2ca9ff); + background-image: linear-gradient(#e9f6ff, #74c6ff 2%, #2ca9ff); +} + +/* line 263, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-dark.x-docked-top .x-tab-active { + background-color: #0b3c5e; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #061f31), color-stop(10%, #092e47), color-stop(65%, #0b3c5e), color-stop(100%, #0c3e60)); + background-image: -webkit-linear-gradient(#061f31, #092e47 10%, #0b3c5e 65%, #0c3e60); + background-image: linear-gradient(#061f31, #092e47 10%, #0b3c5e 65%, #0c3e60); + color: white; +} + +/* line 218, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral { + background-color: #e0e0e0; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #f2f2f2), color-stop(100%, #cecece)); + background-image: -webkit-linear-gradient(#ffffff, #f2f2f2 2%, #cecece); + background-image: linear-gradient(#ffffff, #f2f2f2 2%, #cecece); + border-top-color: #d3d3d3; + border-bottom-color: #bababa; +} +/* line 223, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral .x-tab { + color: #7a7a7a; +} +/* line 227, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral .x-tab-active { + color: black; + border-bottom: 1px solid #e8e8e8; +} +/* line 232, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral .x-tab-pressed { + color: black; +} + +/* line 239, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral.x-docked-bottom .x-tab { + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; +} +/* line 241, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral.x-docked-bottom .x-tab .x-button-icon { + background-color: #adadad; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #fafafa), color-stop(2%, #bfbfbf), color-stop(100%, #9b9b9b)); + background-image: -webkit-linear-gradient(#fafafa, #bfbfbf 2%, #9b9b9b); + background-image: linear-gradient(#fafafa, #bfbfbf 2%, #9b9b9b); +} +/* line 246, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral.x-docked-bottom .x-tab-active { + background-color: #d3d3d3; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #bababa), color-stop(10%, #c7c7c7), color-stop(65%, #d3d3d3), color-stop(100%, #d5d5d5)); + background-image: -webkit-linear-gradient(#bababa, #c7c7c7 10%, #d3d3d3 65%, #d5d5d5); + background-image: linear-gradient(#bababa, #c7c7c7 10%, #d3d3d3 65%, #d5d5d5); + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; + -webkit-box-shadow: #c7c7c7 0 0 0.25em inset; + box-shadow: #c7c7c7 0 0 0.25em inset; +} +/* line 254, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral.x-docked-bottom .x-tab-active .x-button-icon { + background-color: #7a7a7a; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c7c7c7), color-stop(2%, #8c8c8c), color-stop(100%, #686868)); + background-image: -webkit-linear-gradient(#c7c7c7, #8c8c8c 2%, #686868); + background-image: linear-gradient(#c7c7c7, #8c8c8c 2%, #686868); +} + +/* line 263, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tabbar-neutral.x-docked-top .x-tab-active { + background-color: #d3d3d3; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #bababa), color-stop(10%, #c7c7c7), color-stop(65%, #d3d3d3), color-stop(100%, #d5d5d5)); + background-image: -webkit-linear-gradient(#bababa, #c7c7c7 10%, #d3d3d3 65%, #d5d5d5); + background-image: linear-gradient(#bababa, #c7c7c7 10%, #d3d3d3 65%, #d5d5d5); + color: black; +} + +/* line 111, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tab.x-item-disabled span.x-button-label, .x-tab.x-item-disabled .x-hasbadge span.x-badge, .x-hasbadge .x-tab.x-item-disabled span.x-badge, .x-tab.x-item-disabled .x-button-icon { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + opacity: 0.5; +} + +/* line 114, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tab.x-draggable { + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); + opacity: 0.7; +} + +/* line 118, ../themes/stylesheets/sencha-touch/default/widgets/_tabs.scss */ +.x-tab { + -webkit-user-select: none; + overflow: visible !important; +} + +/* line 36, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar { + padding: 0 0.2em; + overflow: hidden; + position: relative; + height: 2.6em; +} +/* line 42, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar > * { + z-index: 1; +} +/* line 46, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar.x-docked-top { + border-bottom: .1em solid; +} +/* line 50, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar.x-docked-bottom { + border-top: .1em solid; +} +/* line 54, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar.x-docked-left { + width: 7em; + height: auto; + padding: 0.2em; + border-right: .1em solid; +} +/* line 61, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar.x-docked-right { + width: 7em; + height: auto; + padding: 0.2em; + border-left: .1em solid; +} + +/* line 69, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-title { + line-height: 2.1em; + font-size: 1.2em; + text-align: center; + font-weight: bold; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + margin: 0 0.3em; + max-width: 100%; +} +/* line 80, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-title .x-innerhtml { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + padding: 0 .3em; +} + +/* line 120, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark { + background-color: #1468a2; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #63b4ec), color-stop(2%, #177cc2), color-stop(100%, #105483)); + background-image: -webkit-linear-gradient(#63b4ec, #177cc2 2%, #105483); + background-image: linear-gradient(#63b4ec, #177cc2 2%, #105483); + border-color: black; +} +/* line 124, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark .x-title { + color: white; + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} +/* line 129, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark.x-docked-top { + border-bottom-color: black; +} +/* line 133, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark.x-docked-bottom { + border-top-color: black; +} +/* line 137, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark.x-docked-left { + border-right-color: black; +} +/* line 141, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark.x-docked-right { + border-left-color: black; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-dark .x-button, .x-toolbar .x-toolbar-dark .x-button, .x-toolbar-dark .x-field-select .x-component-outer, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer, .x-toolbar-dark .x-field-select .x-component-outer:before, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before { + border: 1px solid #061f31; + border-top-color: #092e47; + color: white; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-dark .x-button.x-button-back:before, .x-toolbar-dark .x-button.x-button-forward:before, .x-toolbar .x-toolbar-dark .x-button.x-button-back:before, .x-toolbar .x-toolbar-dark .x-button.x-button-forward:before, .x-toolbar-dark .x-field-select .x-component-outer.x-button-back:before, .x-toolbar-dark .x-field-select .x-component-outer.x-button-forward:before, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-back:before, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-forward:before, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-back:before, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-forward:before, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-back:before, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-forward:before { + background: #061f31; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-dark .x-button, .x-toolbar-dark .x-button.x-button-back:after, .x-toolbar-dark .x-button.x-button-forward:after, .x-toolbar .x-toolbar-dark .x-button, .x-toolbar .x-toolbar-dark .x-button.x-button-back:after, .x-toolbar .x-toolbar-dark .x-button.x-button-forward:after, .x-toolbar-dark .x-field-select .x-component-outer, .x-toolbar-dark .x-field-select .x-component-outer.x-button-back:after, .x-toolbar-dark .x-field-select .x-component-outer.x-button-forward:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-back:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-forward:after, .x-toolbar-dark .x-field-select .x-component-outer:before, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-back:after, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-forward:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-back:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-forward:after { + background-color: #11598c; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4ca9e9), color-stop(2%, #156eac), color-stop(100%, #0d456c)); + background-image: -webkit-linear-gradient(#4ca9e9, #156eac 2%, #0d456c); + background-image: linear-gradient(#4ca9e9, #156eac 2%, #0d456c); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-dark .x-button .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-dark .x-button .x-button-icon.x-icon-mask, .x-toolbar-dark .x-field-select .x-component-outer .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer .x-button-icon.x-icon-mask, .x-toolbar-dark .x-field-select .x-component-outer:before .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before .x-button-icon.x-icon-mask { + background-color: white; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #ffffff), color-stop(100%, #dff0fb)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 2%, #dff0fb); + background-image: linear-gradient(#ffffff, #ffffff 2%, #dff0fb); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-dark .x-button.x-button-pressing, .x-toolbar-dark .x-button.x-button-pressing:after, .x-toolbar-dark .x-button.x-button-pressed, .x-toolbar-dark .x-button.x-button-pressed:after, .x-toolbar-dark .x-button.x-button-active, .x-toolbar-dark .x-button.x-button-active:after, .x-toolbar .x-toolbar-dark .x-button.x-button-pressing, .x-toolbar .x-toolbar-dark .x-button.x-button-pressing:after, .x-toolbar .x-toolbar-dark .x-button.x-button-pressed, .x-toolbar .x-toolbar-dark .x-button.x-button-pressed:after, .x-toolbar .x-toolbar-dark .x-button.x-button-active, .x-toolbar .x-toolbar-dark .x-button.x-button-active:after, .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressing, .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressing:after, .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressed, .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressed:after, .x-toolbar-dark .x-field-select .x-component-outer.x-button-active, .x-toolbar-dark .x-field-select .x-component-outer.x-button-active:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressing, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressing:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressed, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-pressed:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-active, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer.x-button-active:after, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressing, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressing:after, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressed, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressed:after, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-active, .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-active:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressing, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressing:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressed, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-pressed:after, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-active, .x-toolbar .x-toolbar-dark .x-field-select .x-component-outer:before.x-button-active:after { + background-color: #0f517e; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0a3351), color-stop(10%, #0c4267), color-stop(65%, #0f517e), color-stop(100%, #0f5280)); + background-image: -webkit-linear-gradient(#0a3351, #0c4267 10%, #0f517e 65%, #0f5280); + background-image: linear-gradient(#0a3351, #0c4267 10%, #0f517e 65%, #0f5280); +} +/* line 151, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-dark .x-form-label { + color: white; + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} + +/* line 120, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light { + background-color: #1985d0; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #90caf2), color-stop(2%, #2897e5), color-stop(100%, #1571b0)); + background-image: -webkit-linear-gradient(#90caf2, #2897e5 2%, #1571b0); + background-image: linear-gradient(#90caf2, #2897e5 2%, #1571b0); + border-color: black; +} +/* line 124, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light .x-title { + color: white; + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} +/* line 129, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light.x-docked-top { + border-bottom-color: black; +} +/* line 133, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light.x-docked-bottom { + border-top-color: black; +} +/* line 137, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light.x-docked-left { + border-right-color: black; +} +/* line 141, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light.x-docked-right { + border-left-color: black; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-light .x-button, .x-toolbar .x-toolbar-light .x-button, .x-toolbar-light .x-field-select .x-component-outer, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer, .x-toolbar-light .x-field-select .x-component-outer:before, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before { + border: 1px solid #0b3c5e; + border-top-color: #0e4b75; + color: white; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-light .x-button.x-button-back:before, .x-toolbar-light .x-button.x-button-forward:before, .x-toolbar .x-toolbar-light .x-button.x-button-back:before, .x-toolbar .x-toolbar-light .x-button.x-button-forward:before, .x-toolbar-light .x-field-select .x-component-outer.x-button-back:before, .x-toolbar-light .x-field-select .x-component-outer.x-button-forward:before, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-back:before, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-forward:before, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-back:before, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-forward:before, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-back:before, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-forward:before { + background: #0b3c5e; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-light .x-button, .x-toolbar-light .x-button.x-button-back:after, .x-toolbar-light .x-button.x-button-forward:after, .x-toolbar .x-toolbar-light .x-button, .x-toolbar .x-toolbar-light .x-button.x-button-back:after, .x-toolbar .x-toolbar-light .x-button.x-button-forward:after, .x-toolbar-light .x-field-select .x-component-outer, .x-toolbar-light .x-field-select .x-component-outer.x-button-back:after, .x-toolbar-light .x-field-select .x-component-outer.x-button-forward:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-back:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-forward:after, .x-toolbar-light .x-field-select .x-component-outer:before, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-back:after, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-forward:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-back:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-forward:after { + background-color: #1676b9; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7abfef), color-stop(2%, #1a8bd9), color-stop(100%, #126299)); + background-image: -webkit-linear-gradient(#7abfef, #1a8bd9 2%, #126299); + background-image: linear-gradient(#7abfef, #1a8bd9 2%, #126299); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-light .x-button .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-light .x-button .x-button-icon.x-icon-mask, .x-toolbar-light .x-field-select .x-component-outer .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer .x-button-icon.x-icon-mask, .x-toolbar-light .x-field-select .x-component-outer:before .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before .x-button-icon.x-icon-mask { + background-color: white; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #ffffff), color-stop(100%, #dff0fb)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 2%, #dff0fb); + background-image: linear-gradient(#ffffff, #ffffff 2%, #dff0fb); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-light .x-button.x-button-pressing, .x-toolbar-light .x-button.x-button-pressing:after, .x-toolbar-light .x-button.x-button-pressed, .x-toolbar-light .x-button.x-button-pressed:after, .x-toolbar-light .x-button.x-button-active, .x-toolbar-light .x-button.x-button-active:after, .x-toolbar .x-toolbar-light .x-button.x-button-pressing, .x-toolbar .x-toolbar-light .x-button.x-button-pressing:after, .x-toolbar .x-toolbar-light .x-button.x-button-pressed, .x-toolbar .x-toolbar-light .x-button.x-button-pressed:after, .x-toolbar .x-toolbar-light .x-button.x-button-active, .x-toolbar .x-toolbar-light .x-button.x-button-active:after, .x-toolbar-light .x-field-select .x-component-outer.x-button-pressing, .x-toolbar-light .x-field-select .x-component-outer.x-button-pressing:after, .x-toolbar-light .x-field-select .x-component-outer.x-button-pressed, .x-toolbar-light .x-field-select .x-component-outer.x-button-pressed:after, .x-toolbar-light .x-field-select .x-component-outer.x-button-active, .x-toolbar-light .x-field-select .x-component-outer.x-button-active:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-pressing, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-pressing:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-pressed, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-pressed:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-active, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer.x-button-active:after, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressing, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressing:after, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressed, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressed:after, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-active, .x-toolbar-light .x-field-select .x-component-outer:before.x-button-active:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressing, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressing:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressed, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-pressed:after, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-active, .x-toolbar .x-toolbar-light .x-field-select .x-component-outer:before.x-button-active:after { + background-color: #156eac; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0f517e), color-stop(10%, #125f95), color-stop(65%, #156eac), color-stop(100%, #156fae)); + background-image: -webkit-linear-gradient(#0f517e, #125f95 10%, #156eac 65%, #156fae); + background-image: linear-gradient(#0f517e, #125f95 10%, #156eac 65%, #156fae); +} +/* line 151, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-light .x-form-label { + color: white; + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} + +/* line 120, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral { + background-color: #e0e0e0; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #f2f2f2), color-stop(100%, #cecece)); + background-image: -webkit-linear-gradient(#ffffff, #f2f2f2 2%, #cecece); + background-image: linear-gradient(#ffffff, #f2f2f2 2%, #cecece); + border-color: #616161; +} +/* line 124, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral .x-title { + color: black; + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; +} +/* line 129, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral.x-docked-top { + border-bottom-color: #616161; +} +/* line 133, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral.x-docked-bottom { + border-top-color: #616161; +} +/* line 137, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral.x-docked-left { + border-right-color: #616161; +} +/* line 141, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral.x-docked-right { + border-left-color: #616161; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-neutral .x-button, .x-toolbar .x-toolbar-neutral .x-button, .x-toolbar-neutral .x-field-select .x-component-outer, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer, .x-toolbar-neutral .x-field-select .x-component-outer:before, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before { + border: 1px solid #a0a0a0; + border-top-color: #adadad; + color: black; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-neutral .x-button.x-button-back:before, .x-toolbar-neutral .x-button.x-button-forward:before, .x-toolbar .x-toolbar-neutral .x-button.x-button-back:before, .x-toolbar .x-toolbar-neutral .x-button.x-button-forward:before, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-back:before, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-forward:before, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-back:before, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-forward:before, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-back:before, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-forward:before, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-back:before, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-forward:before { + background: #a0a0a0; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-neutral .x-button, .x-toolbar-neutral .x-button.x-button-back:after, .x-toolbar-neutral .x-button.x-button-forward:after, .x-toolbar .x-toolbar-neutral .x-button, .x-toolbar .x-toolbar-neutral .x-button.x-button-back:after, .x-toolbar .x-toolbar-neutral .x-button.x-button-forward:after, .x-toolbar-neutral .x-field-select .x-component-outer, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-back:after, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-forward:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-back:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-forward:after, .x-toolbar-neutral .x-field-select .x-component-outer:before, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-back:after, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-forward:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-back:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-forward:after { + background-color: #d3d3d3; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #e5e5e5), color-stop(100%, #c1c1c1)); + background-image: -webkit-linear-gradient(#ffffff, #e5e5e5 2%, #c1c1c1); + background-image: linear-gradient(#ffffff, #e5e5e5 2%, #c1c1c1); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-neutral .x-button .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-neutral .x-button .x-button-icon.x-icon-mask, .x-toolbar-neutral .x-field-select .x-component-outer .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer .x-button-icon.x-icon-mask, .x-toolbar-neutral .x-field-select .x-component-outer:before .x-button-icon.x-icon-mask, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before .x-button-icon.x-icon-mask { + background-color: black; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4d4d4d), color-stop(2%, #121212), color-stop(100%, #000000)); + background-image: -webkit-linear-gradient(#4d4d4d, #121212 2%, #000000); + background-image: linear-gradient(#4d4d4d, #121212 2%, #000000); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-toolbar-neutral .x-button.x-button-pressing, .x-toolbar-neutral .x-button.x-button-pressing:after, .x-toolbar-neutral .x-button.x-button-pressed, .x-toolbar-neutral .x-button.x-button-pressed:after, .x-toolbar-neutral .x-button.x-button-active, .x-toolbar-neutral .x-button.x-button-active:after, .x-toolbar .x-toolbar-neutral .x-button.x-button-pressing, .x-toolbar .x-toolbar-neutral .x-button.x-button-pressing:after, .x-toolbar .x-toolbar-neutral .x-button.x-button-pressed, .x-toolbar .x-toolbar-neutral .x-button.x-button-pressed:after, .x-toolbar .x-toolbar-neutral .x-button.x-button-active, .x-toolbar .x-toolbar-neutral .x-button.x-button-active:after, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressing, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressing:after, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressed, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressed:after, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-active, .x-toolbar-neutral .x-field-select .x-component-outer.x-button-active:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressing, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressing:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressed, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-pressed:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-active, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer.x-button-active:after, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressing, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressing:after, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressed, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressed:after, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-active, .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-active:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressing, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressing:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressed, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-pressed:after, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-active, .x-toolbar .x-toolbar-neutral .x-field-select .x-component-outer:before.x-button-active:after { + background-color: #cccccc; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b2b2b2), color-stop(10%, #bfbfbf), color-stop(65%, #cccccc), color-stop(100%, #cdcdcd)); + background-image: -webkit-linear-gradient(#b2b2b2, #bfbfbf 10%, #cccccc 65%, #cdcdcd); + background-image: linear-gradient(#b2b2b2, #bfbfbf 10%, #cccccc 65%, #cdcdcd); +} +/* line 151, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-toolbar-neutral .x-form-label { + color: black; + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; +} + +/* line 95, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss */ +.x-navigation-bar .x-container { + overflow: visible; +} + +/* line 43, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-spinner .x-input-el, +.x-field-select .x-input-el { + -webkit-text-fill-color: #000; + -webkit-opacity: 1; +} + +/* line 49, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-spinner.x-item-disabled .x-input-el, +.x-field-select.x-item-disabled .x-input-el { + -webkit-text-fill-color: currentcolor; +} + +/* line 54, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select .x-input-el { + -webkit-text-fill-color: #fff; +} + +/* line 58, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select.x-item-disabled .x-input-el { + -webkit-text-fill-color: rgba(255, 255, 255, 0.6); +} + +/* line 63, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-form-field-container { + padding: 0 .3em; +} +/* line 67, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field { + width: 13em; + margin: .5em; + min-height: 0; + border-bottom: 0; + background: transparent; +} +/* line 74, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field .x-clear-icon { + background-size: 50% 50%; + right: -0.8em; + margin-top: -1.06em; +} +/* line 81, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-input { + padding-right: 1.6em !important; +} +/* line 89, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-textarea .x-component-outer, .x-toolbar .x-field-text .x-component-outer, .x-toolbar .x-field-number .x-component-outer, .x-toolbar .x-field-search .x-component-outer { + -webkit-border-radius: 0.3em; + border-radius: 0.3em; + background-color: white; + -webkit-box-shadow: inset rgba(0, 0, 0, 0.5) 0 0.1em 0, inset rgba(0, 0, 0, 0.5) 0 -0.1em 0, inset rgba(0, 0, 0, 0.5) 0.1em 0 0, inset rgba(0, 0, 0, 0.5) -0.1em 0 0, inset rgba(0, 0, 0, 0.5) 0 0.15em 0.4em; +} +/* line 99, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-form-label { + background: transparent; + border: 0; + padding: 0; + line-height: 1.4em; +} +/* line 106, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-form-field { + height: 1.6em; + color: #6e6e6e; + background: transparent; + min-height: 0; + -webkit-appearance: none; + padding: 0em .3em; + margin: 0; +} +/* line 115, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-form-field:focus { + color: black; +} +/* line 122, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select .x-component-outer, .x-toolbar .x-field-search .x-component-outer { + -webkit-border-radius: 0.8em; + border-radius: 0.8em; +} +/* line 128, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-search .x-field-input { + background-position: .5em 50%; +} +/* line 133, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select { + -webkit-box-shadow: none; +} +/* line 136, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select .x-form-field { + height: 1.4em; +} +/* line 141, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select { + background: transparent; +} +/* line 145, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select .x-component-outer:after { + right: .4em; +} +/* line 151, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select.x-item-disabled .x-component-outer:after { + opacity: .6; +} +/* line 157, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select .x-component-outer:before { + width: 3em; + border-left: none; + -webkit-border-top-right-radius: 0.8em; + border-top-right-radius: 0.8em; + -webkit-border-bottom-right-radius: 0.8em; + border-bottom-right-radius: 0.8em; + -webkit-mask: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAABCAYAAACc0f2yAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADJJREFUeNpi/P//PwMjIyMbAwMDOxRzAjEXFHMDMQ8a5kXC6HLcSHo5kcwEmU9TABBgAOcTBAFcRiSpAAAAAElFTkSuQmCC'); + -webkit-mask-position: right top; + -webkit-mask-repeat: repeat-y; + -webkit-mask-size: 3em 0.05em; +} +/* line 172, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-toolbar .x-field-select .x-input-text { + color: #fff; +} + +/* line 178, ../themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss */ +.x-android .x-field-search .x-field-input { + padding-left: .2em !important; + padding-right: 2.2em !important; +} + +/* line 29, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-indexbar-wrapper { + -webkit-box-pack: end !important; + box-pack: end !important; + pointer-events: none; +} + +/* line 35, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-indexbar-vertical { + width: 1.1em; + -webkit-box-orient: vertical; + box-orient: vertical; + margin-right: 8px; +} + +/* line 41, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-indexbar-horizontal { + height: 1.1em; + -webkit-box-orient: horizontal; + box-orient: horizontal; + margin-bottom: 8px; +} + +/* line 47, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-indexbar { + pointer-events: auto; + z-index: 2; + padding: .3em 0; + min-height: 0 !important; + height: auto !important; + -webkit-box-flex: 0 !important; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-indexbar > div { + color: #155988; + font-size: 0.6em; + text-align: center; + line-height: 1.1em; + font-weight: bold; + display: block; +} + +/* line 66, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-phone.x-landscape .x-indexbar > div { + font-size: 0.38em; + line-height: 1em; +} + +/* line 72, ../themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss */ +.x-indexbar-pressed { + -webkit-border-radius: 0.55em; + border-radius: 0.55em; + background-color: rgba(143, 155, 163, 0.8); +} + +/* line 80, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list { + position: relative; + background-color: #f7f7f7; +} +/* line 84, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-inner { + width: 100%; +} +/* line 88, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-disclosure { + position: absolute; + bottom: 0.44em; + right: 0.44em; +} +/* line 94, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-disclosure { + overflow: visible; + -webkit-mask: 0 0 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpFNkNCM0JGNTZFMjI2ODExQkNGQjkwMzk3MDc3MkZFQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3M0MzQUU1QUFDQkQxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3M0MzQUU1OUFDQkQxMURGOEQ2MUVDMjM0MzY2NTBDQSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU3Q0IzQkY1NkUyMjY4MTFCQ0ZCOTAzOTcwNzcyRkVCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU2Q0IzQkY1NkUyMjY4MTFCQ0ZCOTAzOTcwNzcyRkVCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+uoWjuwAACh9JREFUeNrUm2toVdkVx7eJRqPRaHzFGBOjidGYaLQaX9GREXXAkloYQVpT+qFYBkcqLS0zTKFQWpwv86F0KLRfHFqnWDq0UCsMFYqlqHSwGo2v4Du+X9FoNL5P12/N3rLn9Cb33HNvrnHDujfnnHvO2f+91l57/dfaGWBe8xYEQUq/H5ilftWIVIoU2+Ov2e/jIt0inSKnRVpEnvdlR/oK8CKRt0QaRd4QyU3hXkDvFvmXyOeZHoABGXzWWJF3RL4rUuFfKC4uNmPHjjUjRozQ44kTJ+r3jRs3zNOnT013d7e5deuWuXTpknnx4oV/602RP4n8TqQ1EyadCcBlIh9YoHmcqKioMFOnTjXl5eVm1KhR5smTJwrs+fPnCohvOjpw4ECTk5Ojwt/5+fnmzp075vr16+bkyZPm1KlT/nv+KvJLkf++KsCAe89KPidmz55t5s6dawoLC839+/fNo0ePFCwgHjx4oMe0u3fv6vfw4cNNbm6uGTRokCkoKNDBycvLU+DDhg3TQTp27Jg5fPiwuXfvnnvvJyI/EunIJmCczqci1RzMmzfPLFiwQF9Ox65cuWKuXr2qZoqk0ikGa/z48WbcuHFm0qRJOihDhw41LS0tZu/evToI1sl9W2RXNgC/K/IRGp42bZpZsmSJasSZ4fnz51WbmWiDBw9W0NXV1TrvOd6zZ49pbX05nd8XwB/2FWA87a+tYzKLFi0yixcvVoCY3NmzZ8MOJ6OttLRUpwy+4dy5c2bnzp3u0h9FvifAuzMJmPm6Q+SbHGzYsEHn3P79+83Ro0fVCWWrVVZWmqVLl+rfO3bsUA8v7QuRbwjoa5l6z2/xD7KsBJs3bw7WrVsXiINh8rwSGTJkSLBmzRrtS1lZmTv/H5wnc7o3iTpnA1k69AXLli0LZAmJ1VGeQWfFEek3x3FBc684ymDLli0+6E/TBfymyDMeJmasL4jbSe4bPXp0MGvWLJX6+vpAApJAlqTYoAcMGBDU1NQEmzZtCsRxuvPvxQVM7Hubh4gnDsRJxdYsInM+kOUrkHVXj/lmAGVOBuJ909K0rBZBc3OzO4eCmuIA/jcPkEAiWLVqVVqdQjA7WWLc8TZ3ns7W1tYGstaqxuI8m8GbM2dOIKuGO3dDpCAVwCw9QUlJSbB+/XrfXGLLzJkzffMtFNko8pjjyZMnq4njFONOGRSyevVqNXF77hdRARc4U167dm0wZsyYjHhW5m0IsLFMCm0EEl0FDQ0NgZCMl2afqjBgTU1N7vg+PCUK4B9yw/Tp0wNZ6NOatxEAO/JxxC03mCWmH8eZMVBVVVVBXV2dO/ebMOCcEFhIwI/5g1j2woUL5tmzZ30dS7SLLBb5DHKxb98+jaVhXDIAKT2IAIgYnnjcto3iF6r934QBr4G+Tpkyxdy+fdt0dXVlK4DiRetEfs7BgQMHtPPE6rAm6XTkBz18+FDJC2GoDYc39ga4mQ9ZL5UMZEG74fYzC7zrzJkzSitlaqnG4MxRGvH8zZs3daBs+5YMWG6iFE+R1bA+HD6bNBCXkcfsioqKNJsBl+1JGwT9J06ciNLnz0TaRP5+8eLFMvohnlfJCVQzihLQMoMF05JnFNsAanf4dxCDoLy8XIOBKGsiyxXLjUyBQEY0FQdTGDFltMdFVAQ+MmiR4wGiONZme7w1kdNayYcsQ0rio8SdaBa2wuhnigOH8lmryGfRF5gZaSDYEvw7qVMQ/4PF+djCc7iBD9ItUTtPNoK5blu5pZtRpDMi6Cci3xfZjBNua2tTc8WZ8e7e5jWK8GhrvVhJng841+aOdY643FPSjEBubrac2cciK8hjQf6vXbumzowcWE99ACyKGzlypMNX6QNmYueTO3r8+HFWCX0KjTz1AtK1WNXx48c19TNhwgS1ykQNLFiCR4ZeAsZBqMe1SbL+2k7bIGUX2iNIIectsbjmu8INLN7yNNEHXKBrlDiFfqrdcJDydZEPXZDinG0is/YcV6EPWA+42JeJuAy390XW49hI2JNjC8cAYEGJvlJzzOvb8mztStPFeOUkS2muH2l1OxOIGsK94kZU+BdLL1W7xM/hBhYvMuv0NdzhvFoWl5q4rY6pC1iWnIULFxI+6vocbpizt8R2+IDb/egkFXaS5Ub4u496HYU64b2GYARml8j3hIKo9rCGOyh84d69id6f2gfWjAsIOgAMGaEwlwisIzaucGe+LL5/hS1RiH4Tk+5n6zGB8+9F3uaAWhZ9O3ToUK+MDqURSFkNd4lDaw976f18YPPeYp00w9DHrcxWFN6GMKxYsUKJzZEjR5LSV8B6DviLROThn3wQtuEMonhrXko6xrYLGaaHb1iwdSUlJapZ4mjMOEqsT0jZ2fmSo+xOBBgNd7icUBQK1tHRob8jJeTFrJlopGX+QYxP4qCqqkqLdlQqoyQAMGeXtbFtV6KMR7fNNmzExZPBSEYTGWm4MLy4trZWHV4iD8854t3t27frjoAkwcRHtp6lmQ46jgnjfKIWw1iXWW3IeuCb5L7WRIBpnwAY+kUBmpRKb86LDhDhXL58WcH3Ng0izPevBBPLly/XKXPw4MGUkgs4XTKunnb/kOweFnWtBGQqCZ8kL+2CibNcE2sJVq5cGQj1i1XeIRlPzcpLxhf1lpemsVNGQzWSYB7byEowIQOtjglCQOSXSmPuwo897X4sIDt6S9PS2B7Uwh4qzBAvnIn4uof593/BBPOVKRKHteE48T04N0sjfxX13kY/W0gBO12TnjFjhl+UI8PyZ3eNcix1pXTeQ5mGSqfMX3fuB6mWS3Wbg5iI1pjSLZeWlpZqldAen3JpXgkmtBZEh+M+G99ATQmx5w7hv1IFDGE+aWwNFw2lA5r6L46LEqyx9WKcU0VFRVoFOwposqKohdhz0KaauFse6o2t4eI1SYTH7RzTg2Q9SXuhdLobAPOLWwQ3tvpPebWxsdE/35zuphaCdt3nQSmTykQ6+zLoJLXgdIvsaNaB9erJWzOxi4f2jnvR/Pnz1cTTmXNxC95OZKnUGnII7LZkYFPdpviueyHOAUeGV01n61GcaYFlUKzHI3vXtvXkpNIB7Mz7ofPemDhOJ50NKalolXcSReEHvGtbowB1EieXgyNjG6JW1mEylDwIFoi9U42OkjXSNLA3oj6Ykle4g/t9R0D8LZXnxU1esWRttXM7lwwJNA6qCL2EpMO44iYIXNaFyMlFeu3t7Zq78ugeBbZz2d4RX2mBa/oFTRPLQs+ggfBlGA/gYV09hYvQR5eScRvF+Zt7iOm92JjMxU9snam3kLXPALvWYHlsoztBmgjtIGiazkMhw6ABC4+GpADa/QuA5bJ+Temn5sv/f4gSo/c5YNfYKd9kGVBdOCmO5hI1pkAC3t1uExKfmwTbFfoL4HACDlN/y5p+RZLfU/Fvs+BgbK1psLBXAjhR+qauh2unTfRdAa8N4D5pqQL+nwADAKGFDQ//Deb9AAAAAElFTkSuQmCC') no-repeat; + -webkit-mask-size: 1.7em; + background-color: #006bb6; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #50b7ff), color-stop(2%, #0080da), color-stop(100%, #005692)); + background-image: -webkit-linear-gradient(#50b7ff, #0080da 2%, #005692); + background-image: linear-gradient(#50b7ff, #0080da 2%, #005692); + width: 1.7em; + height: 1.7em; +} +/* line 103, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list.x-list-indexed .x-list-disclosure { + margin-right: 1em; +} +/* line 107, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-item-selected .x-list-disclosure { + background: #fff none; +} +/* line 111, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-item { + position: relative; + color: black; +} +/* line 115, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-item .x-list-item-label { + min-height: 2.6em; + padding: 0.65em 0.8em; +} +/* line 121, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-item.x-item-pressed .x-list-item-label { + background: #b6e1ff none; +} +/* line 127, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list .x-list-item.x-item-selected .x-list-item-label { + background-color: #006bb6; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #50b7ff), color-stop(2%, #0080da), color-stop(100%, #005692)); + background-image: -webkit-linear-gradient(#50b7ff, #0080da 2%, #005692); + background-image: linear-gradient(#50b7ff, #0080da 2%, #005692); + color: white; + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} + +/* line 136, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-header { + position: relative; +} + +/* line 140, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-header-swap { + position: absolute; + left: 0; + width: 100%; + z-index: 1; +} + +/* line 147, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-ios .x-list-header-swap { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} + +/* line 153, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-normal .x-list-header { + background-color: #5ab5f5; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eaf6fe), color-stop(2%, #7cc4f7), color-stop(100%, #38a6f3)); + background-image: -webkit-linear-gradient(#eaf6fe, #7cc4f7 2%, #38a6f3); + background-image: linear-gradient(#eaf6fe, #7cc4f7 2%, #38a6f3); + color: #0a6aac; + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; + border-top: 1px solid #5ab5f5; + border-bottom: 1px solid #0d87dc; + font-weight: bold; + font-size: 0.8em; + padding: 0.2em 1.02em; + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; +} +/* line 178, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-normal .x-list-item .x-list-item-label { + border-top: 1px solid #dedede; +} +/* line 181, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-normal .x-list-item:last-child .x-list-item-label { + border-bottom: 1px solid #dedede; +} +/* line 186, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-normal .x-list-item:first-child .x-list-item-label { + border-top: 0; +} +/* line 191, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-normal .x-list-item.x-item-pressed .x-list-item-label { + border-top-color: #b6e1ff; + background-color: #b6e1ff; +} +/* line 196, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-normal .x-list-item.x-item-selected .x-list-item-label { + border-top-color: #006bb6; + border-bottom-color: #003e6a; +} + +/* line 207, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round .x-scroll-view { + background-color: #EEEEEE !important; +} +/* line 211, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round .x-list-disclosure { + overflow: hidden; + -webkit-mask: 0 0 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAA9CAYAAAAeYmHpAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAABO5JREFUeNrsm1toXFUUhr8kEDNVkzjYCwTyUCMtsfGCMBJaS7EolsDUqMUHXxQrgiBUWm94a0WpWlt9kSBGKwEh0GJpaDFEbEMJBAN9ChaUqKX1UolNG1MyWlt/H2YdmY65zJ7Z+8wE/GE/zayz1r/PXuustfbeVZIIiHbgdqANWAFcAzQALfb7GDAJXAC+AUaB48BwSKOqPJOuAe4GOoE0sKzI55wB+oADwBfAZa+sJfkYrZI+lXRe/nHent3qydaSSTdJ6pZ0SfGg23SWhXSDpJ2SphU/pk13Q7Gki/HpDmAvsJjyYhx4FDjsKljtGKR2AocqgDBmwyGzqSZE9E4A++wtVyL6gfuBjC/SSeBzIEVlYwTYAEyUSjoBDC4AwrnE1833xufy6VqgNyDhaRs+kTKba4sl/bplVb4hoAt4CBgK8Py02e6ckXUE+L5elvSRpNWSkpKqJW2UdDrQ97zDJTlJSjrrmWy3pDslXZ+nq07S1kAZ3VnjUhDpDzwp/UvSh5LWzkA2d9R71DlT2jov6XZPyrbZm11cYGrYIulIIOLt+fryA9kOjyXmCUsVC8EY8B7wY4DAtmOuQJbyOLu/SHpF0iKHQqBO0haLAb6Rmm15f+ZZ0W+SNjlWQPWSugKQ3jcT6WSgMnFU0m2OxFskHQ1QjibzffpBSzl9YxXwPLDEQWYMeAf4yaMdCeN4RUbWGTAfTgNbrSFYKL4E3vZsR2duIKuNoQNyTtIjZfbvaeNKtSXpCcKiEXgZuMNB5ndb5oMel3gqWt5xlY3LgVeBZgeZ74C3PPp3e0T61hjr3XuALUC9g8yg+bePBn1bRLo5RtI11szb5CDzhzUiuzzob45IN8Xc3Wi0z9haB5kpYBdwrETdTRHpZBnaOi3AG8BKB5mT1hwYKUFvMiJdQ3mwBngKuNrx+725RPdy6nv7xgXgZ8cAVQfcVKrialNeDvRacJp2IPwk8H6JE1020l9ZYJpwkLkL2FZiDJqMSJ+JmfBpK+y/dZC5AXgJWFqi7vGI9KkYCU8B7wIDDjL1wAtRNlUiTkWkR2Mk3QN8QuEnCxLA48BjnvSPRqSHYyJ8xPz4nIPMevNjXxiOSstEDKXl95LWOJaWN0oa8lxaJqLSMhNoeyX3M/Gmo45G4DlgtUc7hozrv8nJgUCELwEfA/sd697NHv04wv78FnBS0p8BlvVBSUsdl/V91kIO3hicoIizGwU0ALYDvzrIrLDAtcyzLYevSIQCNfu/lvSA4xtutF3NEEjNtZc14EnJE5KucyC8SNKzkv4OQHhgvr2s1zwtp/XAw8DNzHMqwHCvtZGqAgTT/3KaYdb3epzlHyQ9LWmVpKtmecsrPX+Pc9FTrk15STppm3O3SLo2z497AhF22pRHUjqQIZOSthv5JZKeCeTHMg7OZ0N3B0xLRyS9KOlYoOfvLvZsaC1w0ILMQkI/sBG4ONsf/j88NwMyZI8ejiwQwhso4HxoId3QCZu9/gpf0usK7bkV2gLOmJ/sqUDCe8y2TKECxRxyT5PdW0qWmewE2X2xvmL63q7oI7vtustldj0iY293eTGEZ0tDXUazncqLC92ms6y3daLRJqlX0lQAolP27DZfV5R8X0arJXsZLY2fy2h9ZC+jXfRppG/S+Wi3xKbVRoLshZPmnOb7uPnpCRvHAzcqg5OuSPwzAGYd6fed/rrcAAAAAElFTkSuQmCC') no-repeat; + -webkit-mask-size: 1.5em; + background-color: #419cdb; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c1dff4), color-stop(2%, #5face1), color-stop(100%, #278bd1)); + background-image: -webkit-linear-gradient(#c1dff4, #5face1 2%, #278bd1); + background-image: linear-gradient(#c1dff4, #5face1 2%, #278bd1); + width: 1.5em; + height: 1.5em; + bottom: 0.5em; +} +/* line 221, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round .x-list-header { + color: #777; + font-size: 1em; + font-weight: bold; + padding-left: 26px; + line-height: 1.7em; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(30%, rgba(238, 238, 238, 0.9)), color-stop(100%, rgba(238, 238, 238, 0.4))); + background-image: -webkit-linear-gradient(top, #eeeeee, rgba(238, 238, 238, 0.9) 30%, rgba(238, 238, 238, 0.4)); + background-image: linear-gradient(top, #eeeeee, rgba(238, 238, 238, 0.9) 30%, rgba(238, 238, 238, 0.4)); +} +/* line 231, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round .x-list-container { + padding: 13px 13px 0 13px; +} +/* line 234, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round .x-list-container .x-list-header { + padding-left: 13px; + background-image: none; +} +/* line 242, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-ungrouped .x-list-item-label, .x-list-round.x-list-grouped .x-list-item-label { + border: solid #DDDDDD; + border-width: 1px 1px 0 1px; + background: #fff; +} +/* line 252, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-ungrouped .x-list-item:first-child .x-list-item-label { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; +} +/* line 257, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-ungrouped .x-list-item:last-child { + margin-bottom: 13px; +} +/* line 258, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-ungrouped .x-list-item:last-child .x-list-item-label { + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; + border-width: 1px; +} +/* line 270, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-grouped .x-list-header-item .x-list-item-label { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; +} +/* line 275, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-grouped .x-list-footer-item { + margin-bottom: 13px; +} +/* line 278, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-round.x-list-grouped .x-list-footer-item .x-list-item-label { + border-width: 1px; + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; +} + +/* line 287, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-dataview-inlineblock .x-dataview-item { + display: inline-block !important; +} + +/* line 293, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-dataview-nowrap .x-dataview-container { + white-space: nowrap !important; +} + +/* line 299, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-inlineblock .x-list-item { + display: inline-block !important; +} + +/* line 305, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-nowrap .x-list-inner { + width: auto; +} +/* line 308, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-nowrap .x-list-container { + white-space: nowrap !important; +} + +/* line 315, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-paging { + height: 50px; +} +/* line 317, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-paging .x-loading-spinner { + display: none; + margin: auto; +} +/* line 322, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-paging .x-list-paging-msg { + text-align: center; + color: #006bb6; + padding-top: 10px; + -webkit-border-radius: 6px; + border-radius: 6px; +} +/* line 330, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-paging.x-loading .x-loading-spinner { + display: block; +} +/* line 334, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-paging.x-loading .x-list-paging-msg { + display: none; +} + +/* line 342, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh { + display: -webkit-box; + display: box; + -webkit-box-orient: horizontal; + box-orient: horizontal; + -webkit-box-align: center; + box-align: center; + -webkit-box-pack: center; + box-pack: center; + position: absolute; + top: -5em; + left: 0; + width: 100%; + height: 4.5em; +} +/* line 353, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh .x-loading-spinner { + display: none; +} + +/* line 358, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh-arrow { + width: 2.5em; + height: 4.5em; + background: center center url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAA8CAYAAAAUufjgAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjFJREFUeNrsmU8oREEYwOexdtNuKBfFwdVhCyfuysnFiXISS+1BLopyUpKLXETkRLaUi1LK3Q2lpPbiQLnIn03a/Hm+z86Ttv0zM++bfbOar36Hbad5v535Zp7v47iuy0wOpyoEHccRHV9L9NxPkUE/bhKCOKiOSPAdn69DsJ5I8E2HYA0QJRJ8Bb50CDYRCT7pEMQD0kwk+CByUFQEW4gE73UIhoA2IsFb4ENEMCQ5MdU1IxwygpT3oKNLMGyyYFVscdhusc8tDpu+xRG7xf95BW0O2kNiV1AgIvaQ2BzUJNgJNJYZGyUU7OG1cal4Bi68oqkDPszy2teEwJp5Cdyu/lZ1g8CwIYJ7wEF+2YmrNw90Byx3BizgKhaqizEP1wg7CLLxCEzy/CtauMeBlQDyEfNuGrgU6SyM8F9SyVgHdmRaH6tAb4XkToEp2d4M5mOK0TWMigU2koa8vJMRZPxEb2ss2LEVPMpPLlMRxBgDZjQJLgNbxb6Uab9tAn3EcifAeKkBMoLY+j0GWonk7oB+lmsFkwhidAGHBPmIeTcAnJcbKCuIMQEs+hScAzZEBqoIYuzyFVCJI36lMJ2CDfxibZeUu+EX/4uMIFP8ZyLejxkgK0hG5a8kP4IYSZbr1IuQVHmAX0HGX4VuGfZVJ6cQxPd1uoRcWqDW0SroFVzZAnJZ/h0LWhAjUUAw4XdSSsH8fExRTEgtGAOuOTETBb16Jk412e+bxOSwglYw6PgWYABvLk8P7zGJFwAAAABJRU5ErkJggg==') no-repeat; + background-size: 2em 3em; + /*-webkit-transition-property: -webkit-transform;*/ + /*-webkit-transition-duration: 200ms;*/ + -webkit-transform: rotate(0deg); + transform: rotate(0deg); +} + +/* line 369, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh-release .x-list-pullrefresh-arrow { + -webkit-transform: rotate(-180deg); + transform: rotate(-180deg); +} + +/* line 373, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh-wrap { + width: 20em; + font-size: 0.7em; +} + +/* line 378, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh-message { + font-weight: bold; + font-size: 1.3em; + margin-bottom: 0.1em; + text-align: center; +} + +/* line 385, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh-updated { + text-align: center; +} + +/* line 389, ../themes/stylesheets/sencha-touch/default/widgets/_list.scss */ +.x-list-pullrefresh-loading { + /*position: relative;*/ + /*top: 0;*/ + /*.x-loading-spinner { + display: block; + } + + .x-list-pullrefresh-arrow { + display: none; + }*/ +} + +/* line 2, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +html, body { + width: 100%; + height: 100%; +} + +/* line 7, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-translatable { + position: absolute; + top: 100%; + left: 100%; + z-index: 1; +} + +/* line 14, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-translatable-container { + position: relative; +} + +/* line 18, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-translatable-wrapper { + width: 100%; + height: 100%; + position: absolute; + overflow: hidden; +} + +/* line 25, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-translatable-stretcher { + width: 300%; + height: 300%; + position: absolute; + visibility: hidden; + z-index: -1; +} + +/* line 33, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-translatable-nested-stretcher { + width: 100%; + height: 100%; + left: 100%; + top: 100%; + position: absolute; + visibility: hidden; + z-index: -1; +} + +/* line 44, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-fit, +.x-layout-card { + position: relative; + overflow: hidden; +} + +/* line 49, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-fit-item, .x-layout-card-item { + position: absolute !important; + width: 100%; + height: 100%; +} + +/* line 55, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-hbox, .x-layout-vbox { + display: -webkit-box; +} +/* line 57, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-hbox > *, .x-layout-vbox > * { + -webkit-box-flex: 0; +} + +/* line 62, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-hbox { + -webkit-box-orient: horizontal; +} + +/* line 66, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-vbox { + -webkit-box-orient: vertical; +} + +/* line 70, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-hbox > .x-layout-box-item { + width: 0 !important; +} + +/* line 74, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-layout-vbox > .x-layout-box-item { + height: 0 !important; +} + +/* line 78, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-table-inner { + display: table !important; + width: 100%; + height: 100%; +} + +/* line 84, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-table-inner.x-table-fixed { + table-layout: fixed !important; +} + +/* line 88, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-table-row { + display: table-row !important; +} + +/* line 92, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-table-row > * { + display: table-cell !important; + vertical-align: middle; +} + +/* line 97, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-container, .x-body { + display: -webkit-box; +} + +/* line 101, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-body { + overflow: hidden; + -webkit-box-flex: 1; + min-width: 100%; + min-height: 100%; +} + +/* line 108, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-body > .x-inner, .x-container > .x-inner { + -webkit-box-flex: 1; + min-width: 100%; + min-height: 100%; + position: relative; +} + +/* line 115, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-docking-horizontal { + display: -webkit-box; + -webkit-box-flex: 1; + -webkit-box-orient: horizontal; + min-width: 100%; + min-height: 100%; +} + +/* line 123, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-docking-vertical { + display: -webkit-box; + -webkit-box-flex: 1; + -webkit-box-orient: vertical; + min-width: 100%; + min-height: 100%; +} + +/* line 131, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-centered { + position: absolute !important; + width: 100%; + height: 100%; + display: -webkit-box; + -webkit-box-align: center; + -webkit-box-pack: center; +} + +/* line 140, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-floating { + position: absolute !important; +} + +/* line 144, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-centered > * { + position: relative !important; + -webkit-box-flex: 0 !important; +} + +/* line 149, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-size-change-detector { + visibility: hidden; + position: absolute; + left: 0; + top: 0; + z-index: -1; + width: 100%; + height: 100%; + overflow: hidden; +} + +/* line 160, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-size-change-detector > * { + visibility: hidden; +} + +/* line 164, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-size-change-detector-shrink > * { + width: 200%; + height: 200%; +} + +/* line 169, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-size-change-detector-expand > * { + width: 100000px; + height: 100000px; +} + +/* line 174, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-view { + position: relative; + display: block; +} + +/* line 179, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-container { + position: absolute; + overflow: hidden; + width: 100%; + height: 100%; +} + +/* line 186, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-scroller { + position: absolute; + min-width: 100%; + min-height: 100%; +} + +/* line 192, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-ios .x-scroll-scroller { + -webkit-transform: translate3d(0, 0, 0); +} + +/* line 196, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-stretcher { + position: absolute; + visibility: hidden; +} + +/* line 201, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid-wrapper { + position: absolute; + width: 100%; + height: 100%; +} + +/* line 207, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid { + display: table; + width: 100%; + height: 100%; +} +/* line 212, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid > * { + display: table-row; +} +/* line 216, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid > * > * { + display: table-cell; +} +/* line 220, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid > :first-child > :first-child { + width: 100%; + height: 100%; +} +/* line 225, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid > :first-child > :nth-child(2) { + padding: 3px 3px 0 0; +} +/* line 229, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-grid > :nth-child(2) > :first-child { + padding: 0 0 3px 3px; +} + +/* line 234, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar { + position: relative; + overflow: hidden; +} + +/* line 239, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-stretcher { + position: absolute; + visibility: hidden; + width: 100%; + height: 100%; +} + +/* line 246, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-x { + width: 100%; +} +/* line 249, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-x > .x-scroll-bar-stretcher { + width: 300%; +} +/* line 253, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-x.active { + height: 6px; +} + +/* line 258, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-y { + height: 100%; +} +/* line 261, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-y > .x-scroll-bar-stretcher { + height: 300%; +} +/* line 265, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-bar-y.active { + width: 6px; +} + +/* line 270, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator { + background: #333; + position: absolute; + z-index: 2; + opacity: 0.5; +} + +/* line 277, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.default { + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; +} + +/* line 284, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-list-light .x-scroll-indicator, +.x-dataview-light .x-scroll-indicator { + background: #fff; + opacity: 1; +} + +/* line 290, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator-x { + height: 100%; +} + +/* line 294, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator-y { + width: 100%; +} + +/* line 298, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform { + background: none; + /*-webkit-transition: opacity 0.2s ease-out;*/ +} +/* line 302, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform > * { + position: absolute; + background-color: #333; +} +/* line 307, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform > :nth-child(2) { + -webkit-transform-origin: 0% 0%; + background: none; + content: url(data:image/bmp;base64,Qk08AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABAAAAAAAAYAAAASCwAAEgsAAAAAAAAAAAAAxhgAAAAA); +} +/* line 314, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-light > * { + background-color: #eee; +} +/* line 318, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-light > :nth-child(2) { + content: url(data:image/bmp;base64,Qk08AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABAAAAAAAAYAAAASCwAAEgsAAAAAAAAAAAAAvXcAAAAA); +} +/* line 324, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-y > * { + width: 100%; +} +/* line 328, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-y > :first-child { + height: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; +} +/* line 333, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-y > :nth-child(2) { + height: 1px; +} +/* line 337, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-y > :last-child { + height: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; +} +/* line 344, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-x > * { + height: 100%; +} +/* line 348, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-x > :first-child { + width: 3px; + -webkit-border-top-left-radius: 3px; + border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; +} +/* line 353, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-x > :nth-child(2) { + width: 1px; +} +/* line 356, ../themes/stylesheets/sencha-touch/default/core/_layout.scss */ +.x-scroll-indicator.csstransform.x-scroll-indicator-x > :last-child { + width: 3px; + -webkit-border-top-right-radius: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; +} + +/* line 51, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel { + position: relative; + overflow: hidden; +} + +/* line 56, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-item { + position: absolute; + width: 100%; + height: 100%; +} +/* line 61, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-item > * { + position: absolute; + width: 100%; + height: 100%; +} + +/* line 68, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator { + padding: 0; + -webkit-border-radius: 0; + border-radius: 0; + -webkit-box-shadow: none; + background-color: transparent; + background-image: none; +} + +/* line 78, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator { + -webkit-box-flex: 1; + display: -webkit-box; + display: box; + -webkit-box-pack: center; + box-pack: center; + -webkit-box-align: center; + box-align: center; +} +/* line 85, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator span { + display: block; + width: 0.5em; + height: 0.5em; + -webkit-border-radius: 0.25em; + border-radius: 0.25em; + margin: 0.2em; +} + +/* line 94, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator-horizontal { + height: 1.5em; + width: 100%; +} + +/* line 99, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator-vertical { + -webkit-box-orient: vertical; + box-orient: vertical; + width: 1.5em; + height: 100%; +} + +/* line 34, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator-light span { + background-color: rgba(255, 255, 255, 0.1); + background-image: none; +} +/* line 37, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator-light span.x-carousel-indicator-active { + background-color: rgba(255, 255, 255, 0.3); + background-image: none; +} + +/* line 34, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator-dark span { + background-color: rgba(0, 0, 0, 0.1); + background-image: none; +} +/* line 37, ../themes/stylesheets/sencha-touch/default/widgets/_carousel.scss */ +.x-carousel-indicator-dark span.x-carousel-indicator-active { + background-color: rgba(0, 0, 0, 0.3); + background-image: none; +} + +/* line 131, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form .x-scroll-container { + background-color: #eeeeee; +} +/* line 134, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form .x-scroll-container > .x-inner { + padding: 1em; +} + +/* line 141, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-label { + text-shadow: #fff 0 1px 1px; + color: #333333; + text-shadow: rgba(255, 255, 255, 0.25) 0 0.08em 0; + padding: 0.6em; + display: none !important; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + background-color: #f7f7f7; +} +/* line 149, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-label span { + font-size: .8em; + font-weight: bold; +} + +/* line 156, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field { + min-height: 2.5em; + background: #fff; +} +/* line 160, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field .x-field-input { + position: relative; +} +/* line 165, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field .x-field-input, .x-field .x-input-el { + width: 100%; +} +/* line 170, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field.x-field-labeled .x-form-label { + display: block !important; +} +/* line 175, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field:last-child { + border-bottom: 0; +} + +/* line 182, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-left .x-component-outer, +.x-label-align-right .x-component-outer { + -webkit-box-flex: 1; + box-flex: 1; +} + +/* line 189, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-left:first-child .x-form-label { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; +} +/* line 195, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-left:last-child .x-form-label { + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; +} + +/* line 205, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-right { + -webkit-box-direction: reverse; + box-direction: reverse; +} +/* line 209, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-right:first-child .x-form-label { + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; +} +/* line 214, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-right:last-child { + border-bottom: 0; +} +/* line 217, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-right:last-child .x-form-label { + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; +} + +/* line 227, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-top, +.x-label-align-bottom { + -webkit-box-orient: vertical; + box-orient: vertical; +} + +/* line 236, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-top:first-child .x-form-label { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; +} + +/* line 245, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-label-align-bottom:last-child .x-form-label { + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; +} + +/* line 251, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-input-el { + padding: .4em; + min-height: 2.5em; + display: block; + border-width: 0; + background: transparent; + -webkit-appearance: none; +} + +/* line 260, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-mask { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +/* line 267, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-required label:after, .x-field-required .x-form-label:after { + content: "*"; + display: inline; +} + +/* line 275, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-item-disabled label:after, .x-item-disabled .x-form-label:after { + color: #666 !important; +} + +/* line 282, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-textarea textarea { + min-height: 6em; + padding-top: .5em; +} + +/* line 294, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-checkmark-base, .x-field .x-input-radio:after, +.x-field .x-input-checkbox:after, .x-field .x-input-radio:checked:after, +.x-field .x-input-checkbox:checked:after, .x-field.x-item-disabled .x-input-radio:checked:after, .x-field.x-item-disabled .x-input-checkbox:checked:after, .x-select-overlay .x-item-selected .x-list-item-label:before, .x-select-overlay .x-item-selected .x-list-item-label:after { + content: ""; + position: absolute; + width: 1.4em; + height: 1.4em; + top: 50%; + left: auto; + right: 1.1em; + -webkit-mask-size: 1.4em; + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAE+klEQVRoBe2aS28URxRGsY0h2FmwCQuEWLHjvUNgZAQ4PMwrEkIRIGEgySKwB8QvYIvEP+ANO0CwsJAA88wGBEKBZJUVQkJCQrwJ5nxN31Z5pnpc7e4ZT9vT0peqqanquqfurVvlIW3Dw8NTJtPTPplgxdoCnugeb3m45eEJtgJTJwJPGw8cP8V6TfmC4/Z/H9uEAAZsIdqHZiMBn2UNbvigSw8M2AIAD6PtqBPpmYe+8t1NoL9GLfYf3bTKKhiWo9PoA9KV0dUgn/tRh8tXWg/Hnj0KUB8yz1JNnjXUuhFd264A/f0O7dKXpQ7EIiTPfkKuVyvrSlx3US+KPF26cMbwxeg8Gg3W4LWHFd6rUUepQprQnI/Rh9A25AtjmqseHVkK7w59UxpgYFdg7wH0CwqFpWvyrKI23GZ7OWluwgqwOnqOobVoWh4Tm97DwCpBHUFp2TiUX3v5QVMnLQzMmqAsUVWWyta3UX/TAmOcwjjk6KmE830W7GbU0ZTAGKYEJdj3yAcQ2qYw1jmsG9e0KF8122UDw/SHwFX0EYWC+fpZGG/hPcn1sqk8jGHas+dQ6KXCB6o2g91IPfKsObZpgDGsqAT1hXdpz25A7QZqZU1gBsxFSh5zbEA9yniOU5R5PSvvCnYTSsLYtdkLTGf9uKdD/gS6gI6jPndgUXXe24OKSFAK4zsoSVA+G6uAGaC758/oBrIs+Zb6rbg9up35Xpa1jffpUqEEldezysbJ0VPLjhHADOpEfUiw2gtuUtAKDiGtYNXeqDWJ7zveYQnqM3V3nqx1s2s97xmRoLzzWqMgkLLaTVQJa0ZoJe+hXjRmaMYKVlslr2dlp5wgu4PsiTyszmg5qgVr0CqvoZW2WFlKxhV5gxJsdIMKtYH+Eew6yksoNLy0soJeFzqR+vEI9gx6h9wFzFoPSlA+25g3SlChnnUNU3grkWmxRg0n+ihBnUR5w9j2bCbPGjzzR3sgbc+6gL66TV4zkTHHEqSfZSzr+94V0mbzKUF1GkSWknG5QktGyoj7qBdVeZo2S1Ch2yUNXOMVUcEJyrcQjOeP4vzQCu9BpBtOck5T70HybN4w1iJcR7ouem9QPjhfG+On7EBPUNrKhrYLWp7+FS1FCjtdKvJ6VvM/Q9o2uWC1AHq60QB6hELh0voJ+im6iHReF+FZwe5HP/g8lrXNzuEfeeFu9C9Kg8nSrr9lBZ9ljK/v37xjL5qRFSytf3K15KXy9EH0D/JN3ui2Qj1rC5AAq4FnJvoDPUSNBnTnUy4YQF1maFHlCOAYuouJFN6PkWtEo+ryrH5sL2TPVi5UFXAMrfDegxrtae3ZfWh6paFFffYCx9BKZLtQo/a0YLXIhSUo3yKlAsfQ8vSBBkALtrCjxwdqbTWBY2glst9REee0Lw/ULUEZpFuOChxD1yuRybNbUV0SlAtq9SDgGFp7ushEJlhdKuqWoAzSLYOBHeidGPkc+cIztE2wA6iuCcoFtXom4Bha4f0nGmv2FqyOnoaFscFG9rsfQusYq0T2G8qayASrbdEdOlfR/TJ72AzAaHla5/QD9BnVCucvfK/fjZXtx8WzZneu/+WBf53XOb0G6XetHjQXyfv2vKLyH7qLLqMhJn5DOW5PLmBZDfRUilloGUoD/ovvXgIrT4/rkxt4XK0fw+TtYxhT6iEt4FK7L8D4locDFqnUXSadh78Bx5bEl2CLG+8AAAAASUVORK5CYII='); + margin-top: -0.7em; +} + +/* line 303, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field .x-input-radio, +.x-field .x-input-checkbox { + position: relative; +} +/* line 305, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field .x-input-radio:after, +.x-field .x-input-checkbox:after { + background-color: #dddddd; +} +/* line 308, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field .x-input-radio:checked:after, +.x-field .x-input-checkbox:checked:after { + background-color: #006bb6; +} + +/* line 316, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field.x-item-disabled .x-input-radio:checked:after, .x-field.x-item-disabled .x-input-checkbox:checked:after { + background-color: #9abad1; +} + +/* line 324, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-component-outer { + display: -webkit-box; + display: box; +} +/* line 327, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-component-outer > * { + width: auto; +} +/* line 332, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-field-input { + -webkit-box-flex: 1; +} +/* line 335, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-field-input .x-input-el { + -webkit-text-fill-color: #000; + width: 100%; + text-align: center; +} +/* line 343, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-field-input input::-webkit-outer-spin-button, .x-spinner .x-field-input input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} +/* line 350, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner.x-item-disabled .x-input-el { + -webkit-text-fill-color: #B3B3B3; +} +/* line 354, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner.x-item-disabled .x-spinner-button { + color: #aaa !important; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner.x-item-disabled .x-spinner-button, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button { + border: 1px solid #c4c4c4; + border-top-color: #d0d0d0; + color: black; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner.x-item-disabled .x-spinner-button.x-button-back:before, .x-spinner.x-item-disabled .x-spinner-button.x-button-forward:before, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-back:before, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-forward:before { + background: #c4c4c4; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner.x-item-disabled .x-spinner-button, .x-spinner.x-item-disabled .x-spinner-button.x-button-back:after, .x-spinner.x-item-disabled .x-spinner-button.x-button-forward:after, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-back:after, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-forward:after { + background-color: #f7f7f7; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #ffffff), color-stop(100%, #e5e5e5)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 2%, #e5e5e5); + background-image: linear-gradient(#ffffff, #ffffff 2%, #e5e5e5); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner.x-item-disabled .x-spinner-button .x-button-icon.x-icon-mask, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button .x-button-icon.x-icon-mask { + background-color: black; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4d4d4d), color-stop(2%, #121212), color-stop(100%, #000000)); + background-image: -webkit-linear-gradient(#4d4d4d, #121212 2%, #000000); + background-image: linear-gradient(#4d4d4d, #121212 2%, #000000); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner.x-item-disabled .x-spinner-button.x-button-pressing, .x-spinner.x-item-disabled .x-spinner-button.x-button-pressing:after, .x-spinner.x-item-disabled .x-spinner-button.x-button-pressed, .x-spinner.x-item-disabled .x-spinner-button.x-button-pressed:after, .x-spinner.x-item-disabled .x-spinner-button.x-button-active, .x-spinner.x-item-disabled .x-spinner-button.x-button-active:after, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-pressing, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-pressing:after, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-pressed, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-pressed:after, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-active, .x-toolbar .x-spinner.x-item-disabled .x-spinner-button.x-button-active:after { + background-color: #efefef; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d5d5d5), color-stop(10%, #e2e2e2), color-stop(65%, #efefef), color-stop(100%, #f0f0f0)); + background-image: -webkit-linear-gradient(#d5d5d5, #e2e2e2 10%, #efefef 65%, #f0f0f0); + background-image: linear-gradient(#d5d5d5, #e2e2e2 10%, #efefef 65%, #f0f0f0); +} +/* line 360, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-spinner-button { + margin-top: .25em; + margin-bottom: .25em; + width: 2em; + padding: .23em 0 .27em; + font-weight: bold; + text-align: center; + border: 1px solid #dddddd !important; + -webkit-border-radius: 1em; + border-radius: 1em; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner .x-spinner-button, .x-toolbar .x-spinner .x-spinner-button { + border: 1px solid #b7b7b7; + border-top-color: #c4c4c4; + color: black; +} +/* line 60, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner .x-spinner-button.x-button-back:before, .x-spinner .x-spinner-button.x-button-forward:before, .x-toolbar .x-spinner .x-spinner-button.x-button-back:before, .x-toolbar .x-spinner .x-spinner-button.x-button-forward:before { + background: #b7b7b7; +} +/* line 64, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner .x-spinner-button, .x-spinner .x-spinner-button.x-button-back:after, .x-spinner .x-spinner-button.x-button-forward:after, .x-toolbar .x-spinner .x-spinner-button, .x-toolbar .x-spinner .x-spinner-button.x-button-back:after, .x-toolbar .x-spinner .x-spinner-button.x-button-forward:after { + background-color: #eaeaea; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #fcfcfc), color-stop(100%, #d8d8d8)); + background-image: -webkit-linear-gradient(#ffffff, #fcfcfc 2%, #d8d8d8); + background-image: linear-gradient(#ffffff, #fcfcfc 2%, #d8d8d8); +} +/* line 68, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner .x-spinner-button .x-button-icon.x-icon-mask, .x-toolbar .x-spinner .x-spinner-button .x-button-icon.x-icon-mask { + background-color: black; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #4d4d4d), color-stop(2%, #121212), color-stop(100%, #000000)); + background-image: -webkit-linear-gradient(#4d4d4d, #121212 2%, #000000); + background-image: linear-gradient(#4d4d4d, #121212 2%, #000000); +} +/* line 73, ../themes/stylesheets/sencha-touch/default/_mixins.scss */ +.x-spinner .x-spinner-button.x-button-pressing, .x-spinner .x-spinner-button.x-button-pressing:after, .x-spinner .x-spinner-button.x-button-pressed, .x-spinner .x-spinner-button.x-button-pressed:after, .x-spinner .x-spinner-button.x-button-active, .x-spinner .x-spinner-button.x-button-active:after, .x-toolbar .x-spinner .x-spinner-button.x-button-pressing, .x-toolbar .x-spinner .x-spinner-button.x-button-pressing:after, .x-toolbar .x-spinner .x-spinner-button.x-button-pressed, .x-toolbar .x-spinner .x-spinner-button.x-button-pressed:after, .x-toolbar .x-spinner .x-spinner-button.x-button-active, .x-toolbar .x-spinner .x-spinner-button.x-button-active:after { + background-color: #e2e2e2; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c9c9c9), color-stop(10%, #d5d5d5), color-stop(65%, #e2e2e2), color-stop(100%, #e3e3e3)); + background-image: -webkit-linear-gradient(#c9c9c9, #d5d5d5 10%, #e2e2e2 65%, #e3e3e3); + background-image: linear-gradient(#c9c9c9, #d5d5d5 10%, #e2e2e2 65%, #e3e3e3); +} +/* line 372, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-spinner-button-down { + margin-left: .25em; +} +/* line 375, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner .x-spinner-button-up { + margin-right: .25em; +} +/* line 380, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner.x-field-grouped-buttons .x-input-el { + text-align: left; +} +/* line 384, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-spinner.x-field-grouped-buttons .x-spinner-button-down { + margin-right: .5em; +} + +/* line 391, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-android .x-spinner-button { + padding: .40em 0 .11em !important; +} + +/* line 396, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-phone .x-select-overlay { + min-width: 14em; + min-height: 12.5em; +} + +/* line 402, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-select-overlay { + min-width: 18em; + min-height: 22em; +} +/* line 406, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-select-overlay .x-list-item-label { + height: 2.6em; +} +/* line 410, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-select-overlay .x-list-label { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: block; +} +/* line 416, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-select-overlay .x-item-selected .x-list-label { + margin-right: 2.6em; +} +/* line 421, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-select-overlay .x-item-selected .x-list-item-label:before { + background-color: rgba(0, 0, 0, 0.3); + margin-top: -0.8em; +} +/* line 426, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-select-overlay .x-item-selected .x-list-item-label:after { + background-color: #dddddd; +} + +/* line 11, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-slider-field .x-component-outer, .x-toggle-field .x-component-outer { + padding: 0.6em; +} + +/* line 17, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-slider, +.x-toggle { + position: relative; + height: 2.2em; + min-height: 0; + min-width: 0; +} +/* line 23, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-slider > *, +.x-toggle > * { + position: absolute; + width: 100%; + height: 100%; +} + +/* line 30, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-slider.x-item-disabled { + opacity: .6; +} + +/* line 57, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-thumb { + position: absolute; + height: 2.2em; + width: 2.2em; +} +/* line 63, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-thumb:before { + content: ""; + position: absolute; + width: 1.85em; + height: 1.85em; + top: 0.175em; + left: 0.175em; + border: 1px solid #919191; + -webkit-border-radius: 0.925em; + border-radius: 0.925em; + background-color: #dddddd; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #efefef), color-stop(100%, #cbcbcb)); + background-image: -webkit-linear-gradient(#ffffff, #efefef 2%, #cbcbcb); + background-image: linear-gradient(#ffffff, #efefef 2%, #cbcbcb); + -webkit-background-clip: padding; + background-clip: padding-box; +} +/* line 72, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-thumb.x-dragging { + opacity: 1; +} +/* line 73, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-thumb.x-dragging:before { + background-color: #d0d0d0; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(2%, #e2e2e2), color-stop(100%, #bebebe)); + background-image: -webkit-linear-gradient(#ffffff, #e2e2e2 2%, #bebebe); + background-image: linear-gradient(#ffffff, #e2e2e2 2%, #bebebe); +} + +/* line 81, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-slider:after { + content: ""; + position: absolute; + width: auto; + height: 0.8em; + top: 0.737em; + left: 0; + right: 0; + margin: 0 0.925em; + background-color: #dddddd; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c4c4c4), color-stop(10%, #d0d0d0), color-stop(65%, #dddddd), color-stop(100%, #dedede)); + background-image: -webkit-linear-gradient(#c4c4c4, #d0d0d0 10%, #dddddd 65%, #dedede); + background-image: linear-gradient(#c4c4c4, #d0d0d0 10%, #dddddd 65%, #dedede); + border: 0.1em solid rgba(0, 0, 0, 0.1); + border-bottom: 0; + -webkit-box-shadow: rgba(255, 255, 255, 0.7) 0 0.1em 0; + -webkit-border-radius: 0.4em; + border-radius: 0.4em; +} + +/* line 93, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-toggle { + width: 4.4em; + -webkit-border-radius: 1.1em; + border-radius: 1.1em; + overflow: hidden; + border: 1px solid #b7b7b7; + background-color: #dddddd; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #c4c4c4), color-stop(10%, #d0d0d0), color-stop(65%, #dddddd), color-stop(100%, #dedede)); + background-image: -webkit-linear-gradient(#c4c4c4, #d0d0d0 10%, #dddddd 65%, #dedede); + background-image: linear-gradient(#c4c4c4, #d0d0d0 10%, #dddddd 65%, #dedede); + -webkit-box-flex: 0; +} +/* line 113, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-toggle .x-thumb.x-dragging { + opacity: 1; +} +/* line 117, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-toggle .x-thumb:before { + top: 0.175em; +} + +/* line 146, ../themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss */ +.x-toggle-on { + background-color: #92cf00; + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #6e9c00), color-stop(10%, #80b500), color-stop(65%, #92cf00), color-stop(100%, #94d200)); + background-image: -webkit-linear-gradient(#6e9c00, #80b500 10%, #92cf00 65%, #94d200); + background-image: linear-gradient(#6e9c00, #80b500 10%, #92cf00 65%, #94d200); +} + +/* line 438, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; +} + +/* line 444, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-number input::-webkit-outer-spin-button, .x-field-number input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +/* line 451, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-search .x-field-input { + position: relative; +} +/* line 454, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-search .x-field-input:before { + content: ""; + position: absolute; + width: 0.86em; + height: 0.86em; + top: 50%; + left: 0.5em; + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAGdElEQVRoBdWaa4ycUxjHd9rpbm2bqKhiUavbVZdo0LCyLl3iHhGEkkZsKBYJX4RISHwQIYIPNJoQlUjTuCakUZ9oVGRF0GywslvqbgkpDarqsn7/6XsmM5n38pzzvtudeZL/nplznvM8z//cz5ktTU5OtuWRUqk0i/qdoAN0gcXgP+CkzIcx8APYBXbi82/SaZFSKGGILiTibnA+GADHgbkgSXZT8CF4GwyDEXxvI92r4k0Yoj1EeAG4CvSDEggRkX8VbID4lhADQXXUwxZgfAF4CGwFmgdFYQJb68HJljjy6mSSJZAZ4CLwESiKZJydb7A/CGblJZVWP5UwzueBB8AfIC7IovO0mK0B89KCzlOWSBinWoBeAkWTstiT3948xJLqxhLG2Xzw4jSRdQ0yiv/upMBD8xsI40Rzdu00k3WknyeO+aHk4urFEb4TJ/80CWEdYB4BhS1kdfswe+zpGNf80RYUIr9QSdgOdNCYCfaLcABpqFxBbymu3FIlDFkdD18B5wRYHaHOJvAeGCU4fa8IdnXUPAaoMZeDk4CvfEKFM7CrhswnbpxjZQX4C7j5Y0m1d64EXc5OWoqeFsPLwTvAYt/p/Iv+6jTb1rLKHMbYgWCjZxCb0T/e6qhWj3o6hz8HRMSRykp17l5WayfksyN8oafzTegfHOLQ1aG+blc6ZGQRdeVawB4GlWno7Pim1G9rB08AZzgrfRfdw3wdxelHvl/38K01Itc2Rf22Q8BPIIuoynXQL/SQj71DwcfA4n8nev1xjWfN0yGjD2gxsYh6432LolWHQL9F91Gj/j7oacUPFhE+11hbLxbrCFBzqWh5A4PDRqN90RZqVK9XE+ET67MSv41D9s3E0nwFX1Ndu4RFjkZpjkUxTkeEdTDIEvXqW1lKoeU0pOavXj10OsuSI1CYnaWUVC7COvpliR7f9CQzlaK5/LPBQRc6mstBIsIW0WXiO4tiDh35mIr1oS4kK2ENOctwqzPu+SX0MdDLjZWw9Pb1suyv7EPYR7cuEithLRLL6moW/0VriaVRtT1qTQkSER411Cyjc4pBL4/KEirPNRj4FZ3gXy5EWM+vWaIhtJQNf2GWYkg5dtWzui9bhuqn6OkVNUhE+ANjTZG91Kjrq6bDxHnGStqvcxHWsU5bQpZ0orCK3rDs21m2quXY6+DLTWBBNTP9wxbOKZZ4E63omLYZWG4r0nkQtOtwVASwdYeH723o9uTxS/3Ks+ytHk5/R3cI5LqIK2hEDw86XVkb+wV0Z+YiHDnWCjnu4Vj3Ug3DzhDn1NPacTX4HljJ6gFPr5e5RpZ74tFz6l0ezhWk5tFTYJFPEOjrLKxhrEazktWR8zVQ9vEVp1ttLYyplyeANQinN0ydIXBUnAOXR7nsrwAbgatrTbX3nu1s5Ul1oKgIRsZYMR/jy72gY0+u6a8OJMJX1P+C9MsaqDcPAseCHtANQkRTwHIoybZd21qR0Q2k1pZP0tNJSIubLhxJOr75egO/sjbekM/VIe0qY1RDb6p//PYl6/QniO0sF2tI2kBYRpBTgVrUOWqm9DPiGgghW+GWVBGj/UCvEM1E1sWinr4sKfa0/NgedhUwqsVITzvOUTOl6gxv0qmERRw5HOi/bHz2zb3VMHp28hremYQj0rq23QhGwFSQ0ZVPu8NvAfa3Use8kJkI1wzxxRhfDcYDAotrKF0GngYnRA17D599f7KVXcVzmoszLfUi7AxhfBG4GKwFPudhBacnmpfBStDwnzrkrQIhpDW8L3ExJqXV/wBA2Vs4WelquT9Qzy8FvdHnDlKR01RQ8OrJMaAp8TnYQUA7SBsEm6pzPXgcyI6PaCG7Hdu6VcVLUkuE5ONBR8ByDGb42sPGteBPEDcV0vK0ZZ2Z5C9oSCcZKzqfwO8OJK2FbCAunqYmrICRQaA3rLRejSvTWtGwTzc94Yj0DQS/O4C05nQd6VYhrIVMpEN6Wqv3crBngY4b582aR9DXgJCFTPt05T+AtKq2jNARzxLs/UBbnY/0onwLO97sXPuwj8cidQn8OuytAe0edjUyuluqh2vIPcNnPS1rIbOKfkRf0pKEGdqSJyFwM/AZ3j+2JGHXpZDWWf4+sMvlpaTal7e3xLYEsdQ4ITIIsras29AppxrKctRM5ZDRLUvv13GnLl1p5yjellylCb5BolvWkRQMgT6g6apXmnVgPWQrc/1/boJCaHVWyukAAAAASUVORK5CYII='); + -webkit-mask-size: .86em; + background-color: #ccc; + -webkit-mask-repeat: no-repeat; + margin-top: -0.43em; +} +/* line 462, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-search .x-field-input .x-form-field { + margin-left: 1.0em; +} + +/* line 472, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-input .x-clear-icon { + display: none; + background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAADHmlDQ1BJQ0MgUHJvZmlsZQAAeAGFVN9r01AU/tplnbDhizpnEQk+aJFuZFN0Q5y2a1e6zVrqNrchSJumbVyaxiTtfrAH2YtvOsV38Qc++QcM2YNve5INxhRh+KyIIkz2IrOemzRNJ1MDufe73/nuOSfn5F6g+XFa0xQvDxRVU0/FwvzE5BTf8gFeHEMr/GhNi4YWSiZHQA/Tsnnvs/MOHsZsdO5v36v+Y9WalQwR8BwgvpQ1xCLhWaBpXNR0E+DWie+dMTXCzUxzWKcECR9nOG9jgeGMjSOWZjQ1QJoJwgfFQjpLuEA4mGng8w3YzoEU5CcmqZIuizyrRVIv5WRFsgz28B9zg/JfsKiU6Zut5xCNbZoZTtF8it4fOX1wjOYA1cE/Xxi9QbidcFg246M1fkLNJK4RJr3n7nRpmO1lmpdZKRIlHCS8YlSuM2xp5gsDiZrm0+30UJKwnzS/NDNZ8+PtUJUE6zHF9fZLRvS6vdfbkZMH4zU+pynWf0D+vff1corleZLw67QejdX0W5I6Vtvb5M2mI8PEd1E/A0hCgo4cZCjgkUIMYZpjxKr4TBYZIkqk0ml0VHmyONY7KJOW7RxHeMlfDrheFvVbsrj24Pue3SXXjrwVhcW3o9hR7bWB6bqyE5obf3VhpaNu4Te55ZsbbasLCFH+iuWxSF5lyk+CUdd1NuaQU5f8dQvPMpTuJXYSWAy6rPBe+CpsCk+FF8KXv9TIzt6tEcuAcSw+q55TzcbsJdJM0utkuL+K9ULGGPmQMUNanb4kTZyKOfLaUAsnBneC6+biXC/XB567zF3h+rkIrS5yI47CF/VFfCHwvjO+Pl+3b4hhp9u+02TrozFa67vTkbqisXqUj9sn9j2OqhMZsrG+sX5WCCu0omNqSrN0TwADJW1Ol/MFk+8RhAt8iK4tiY+rYleQTysKb5kMXpcMSa9I2S6wO4/tA7ZT1l3maV9zOfMqcOkb/cPrLjdVBl4ZwNFzLhegM3XkCbB8XizrFdsfPJ63gJE722OtPW1huos+VqvbdC5bHgG7D6vVn8+q1d3n5H8LeKP8BqkjCtbCoV8yAAAACXBIWXMAAAsTAAALEwEAmpwYAAABbmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNC40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrlPw1BAAAIWklEQVRoBdVbS2hVRxiee83LmJeaRBOTCKWgtIiJoQYNFAnSRSF205AqKEJ3urDQlq7aECuuCqUUzK5gS20XBUMLlQYaH3TRoGJsaTURN0mMryQGE40mJun3He65zL2ZmTPnZZOBm3POzPz//N/MN/88k1hcXBRxh2vXrlUsLCxsWbVq1WaUV5JIJIpRZi5+0/iewvc40gdvI7S1tc3GaU8iDsBXr17dlpOTsxeGt+C3G791NiBgyzzA30De83jvffLkye/Nzc1TNrK2eSIDDJBVAHkIhh6E0a/bGmDKB10zSO9G659ubGzswXdoOoYGfOXKlVcA9BOAPAzj8kwAwqQB67+QP3nr1q0fQfv5oLoCA+7r6yvJz88/joKPAmxOUAMCyN2cn58/umPHjt4AsiIQ4P7+/ndQWBeAVgUpNAoZtPgP0HOkvr5+0o8+X4ABMAGP+xkeHSgk4aegmPIOQO++7du3D9rqtwYMp1SIYeU0wL5rq/xl5ENLT8KmdoDusSkvaZPp8uXLtXBMfyw3sLQdNpUB9K/oZsdssHi2MMHm5ub2QfH/1l9tgDAPhq8TDQ0Nn5ryGwGTxmxZKGgwKVlOaQB9AKDp0JRBS2m0aIJ9FlIrBiwRJpPJb0DvN5Roma5LSHnjZeWgdLZmxRfguxv2V2fFO59KwBxn0cAcelZkgO3V+J29cOHCkgnRkojUDKoLSI3jbF1dnVi7dq22QsbGxsSdO3e06aaE2tpasW6dfr0xMjIixsfHTSrovXeWlZV9gExfyBmXtDCni8js6ZEJZm5uTtaV8b5+/XpRVFSUEWfzQRlTRT5+/FhMTEzYqCLoDjRgjZw5AzAXAkg8KmfQvWM+K4aGhnTJLEzU1NTQiWjzZCe4MnyqwosXLwRbF+OuKlkVV1RQUNApJ2RYk1r1LKG5LCC/Y70qHj58KEdlvIMtoqrKkyxpmY0bNwrK6ALBmlilkkPlHMTwWuempQFzPYuaPewm2DxZ0/fv3xfPnj3TZmdftKF2YWGhKC8v1+ohjUlnvwGYctGQH7lyacCIPIRI3+tZUnt4eNjVt+RJSm/atMmh+JJEKYJ5dPSfnZ0Vd+/e9UNlSbOg3MFz58451EkDZmRGLh8fMzMzjkE6EdK0ulo5LDoiGzZsEKtXr9aJO/2W/TdoQCuXobu0Ut4BDDpvQ2TgbRlSm8ME+7QqQLfjeVXUhlNxqMw8qvDgwQMxPT2tSvIVB/bsp4ADGHTe60takZnU5lCFuawiVQhMU51WzqYtWx7lK2XIHDpFVmjYAB0tnZ2d6TGjJaxCytN5sa/pAluTntgNprGaIFmBYajslsMnad3a2trg9uFmOTHoO4189OiR1pvK1M7LyxOVlZVaZ3bv3j3x9OnToKYo5VD+7hxukoNm+jmiUlQfSWqzlTnMqKjKOI7N9LwErQpTU1PObCoKKsv6AXhrEkq3ypFRvHtRmx65pKREWRQpzNaNispyIQC8JcnjDzkyqvfJyUmH3ip9pHa283LzcSITNZVd3WjczUl4VZ7zRB7orTmkPH/+3Fq3qZKslRgyoqJLkvgTC2CWS2qzxWz6IiuGeekD4gqwo5hemqd4sQWOpXRQXoEOzDTb8pK3TM8l4PDTGE1pnGxw2mhaAbmi7NfMy7E6xjBNLx3pcaRsLBfy2HWQo4zvrBiOzayoOAIqdYp92LxXErBkjsNsMVWgQ9P1a1ZSaWmpSix0HMocp5ceDK0pSwEnF5xCqiYezMp1Lfu2LnBiElN/HkzymgGQR+Ya2Re56C8uVjt/d23L2ZhucuFWWNTUhm0DSd6pwMsNXW37jSeV5QWCLE8ac2wmaC75OO/WUZszMdKbFRhVAJuvu4uH81EoZcuYdjcIUt5e5RTStD1EakfotRcB+KIDGLUc6DRdriS2REVFhbbvkb6jo6OyiLN2ZpxussHpJyswCmoD41+4JzLmAOZtGUTovUiGmeoP7mZwSFEF0pYLeVVrelF7zZo1guvmsNSGDb/QNgdw6mpQt8pYmzhSmXvQukCPzL6rC2xl05w7Cq8NtnzH8t0+THp9qzPIFM+ap0G6tS30eh65kAGm7SGWz+OXENT+070WkQYMfv+Ggnk1yFegNzWdA/GMyWa5R2qbjlDovDiRCUjtL11QacAAy52yk26CzRM3A4xUJk3piW0Dx2YTtekU2ad9hoHu7u6fXJk0YEbw0hceN91E05M1zX6rm02x/nyeAzle20uGp5Z+qA07jnd0dKS3UjMA84YbgtVhGmms26ZhRXFSQZr6DdljdbY8WcWhyiYA7CXc4zoj51Xe8cCB+Bm0oLNxLWdeSe8AOwcMDXBW/8h2Z7SwlHAE7wPS94p7BeBj2WAJQgk4dZ1vH4R8XetbLrUCu0/hJk+Xyh4lYGbkuAVKtEM4spWUyoAY4nqxGai9pKYFnALdg+eHMRgVi0o0zm2M+W179uzRHjUaAdMq0PsrzJZOxGJhhEoJFox8e9euXcYLIJ6AaROv8wH0Abzqj/ojNN6vKoA9j/n6TnZDL1krwFTC63xQ/CZ+mWs8rxJiToc9p9Bn3/JqWdcM5TjsJqqevOEG6pzFb6cq/WXFAegcfsd03lhnh3ULuwpQwChqtBmFfYw4/1MpV1GIJ8q+hAqHKeqhx6TadwvLynjpC6uYThjA/2SJ9QQjVe4AyvocjvR72Q4/775bWFbe1NQ0AkfxPubfryL+axgT10SlD/rbsep5LQxY2h6qhalADrwahM2AfWjt9wC+BU/7YwdZkXPTaPFv6PiZOxU23jdTXP8VKWC5GF4g4Z0KgG7Gbwt+WwFgM57FeHLTml1gGt/8d7wxvHNmN4Dh7zp+F7nhJuuL6v0/Vc+vwPfknLsAAAAASUVORK5CYII=') no-repeat; + background-position: center center; + background-size: 55% 55%; + width: 2.2em; + height: 2.2em; + margin: .5em; + margin-top: -1.1em; + position: absolute; + top: 50%; + right: -0.5em; +} + +/* line 488, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-clearable .x-clear-icon { + display: block; +} +/* line 492, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-clearable .x-field-input { + padding-right: 2.2em; +} + +/* line 497, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-android .x-input-el { + -webkit-text-fill-color: #000; +} + +/* line 501, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-android .x-empty .x-input-el { + -webkit-text-fill-color: #A9A9A9; +} + +/* line 512, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-item-disabled .x-form-label span, +.x-item-disabled input, +.x-item-disabled .x-input-el, +.x-item-disabled .x-spinner-body, +.x-item-disabled select, +.x-item-disabled textarea, +.x-item-disabled .x-field-clear-container { + color: #b3b3b3; + -webkit-text-fill-color: #b3b3b3; + pointer-events: none; +} + +/* line 519, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset { + margin: 0 0 1.5em; +} +/* line 522, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset .x-form-label { + border-top: 1px solid white; +} +/* line 526, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset .x-form-fieldset-inner { + border: 1px solid #dddddd; + background: #fff; + padding: 0; + -webkit-border-radius: 0.4em; + border-radius: 0.4em; + overflow: hidden; +} +/* line 535, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset .x-field { + border-bottom: 1px solid #dddddd; + background: transparent; +} +/* line 539, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset .x-field:first-child { + -webkit-border-top-left-radius: 0.4em; + border-top-left-radius: 0.4em; + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; +} +/* line 545, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset .x-field:last-child { + border-bottom: 0; + -webkit-border-bottom-left-radius: 0.4em; + border-bottom-left-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; +} + +/* line 555, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset-title { + text-shadow: #fff 0 1px 1px; + color: #333333; + margin: 1em 0.7em 0.3em; + color: #333333; + font-weight: bold; + white-space: nowrap; +} + +/* line 563, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-form-fieldset-instructions { + text-shadow: #fff 0 1px 1px; + color: #333333; + color: gray; + margin: 1em 0.7em 0.3em; + font-size: .8em; + text-align: center; +} + +/* line 572, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-selectmark-base, .x-field-select .x-component-outer:after { + content: ""; + position: absolute; + width: 1em; + height: 1em; + top: 50%; + left: auto; + right: 0.7em; + -webkit-mask-size: 1em; + -webkit-mask-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpGRTdGMTE3NDA3MjA2ODExOTJDQUMyNUQwRUE4NjdEQiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxQTFBMDFDQ0I5NEYxMURGQUU1RjlGMEFERUNDQTVEMCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMkRCMDIxMkI5NEUxMURGQUU1RjlGMEFERUNDQTVEMCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjMwRTE0QzVBNDIyMjY4MTFCQ0ZCOTAzOTcwNzcyRkVCIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZFN0YxMTc0MDcyMDY4MTE5MkNBQzI1RDBFQTg2N0RCIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+HfrH/AAAAeVJREFUeNrs2cFHBGEUAPA3zYqIiIhOnTpFRHSKrp26RqeuEV077R/QqWtE166dOkVERHRa9hQRnZalFcv0Hk/W1Mx+38z3vvlm5j3eZW+/9+abne+9KEkSaFPMQMtCwQpWsIIVrGAFK1jBClawgo2ik/4hiqJGwLKuvfpIc5xSkWqYr5hzU1s/mRNxXTPsJ+ZqluvXlwOmSj3XBDvG3M1rpAmYYoUrFzr4ZNqTawqm2MH8Dhh7ZXJUbcAUx4FinzBnJcAUl4FhP/jIgRSYKvkYCJaO2LbNv08RMMUy5nsA4COTLy0XYIqtil9iF6aflq7AwBWuAvuQ9ZKSBgNX2ieWjtKSzeXBNZgqfe8J+4W5aXtbcg0GrvibB/BhkeuhBJhigzsghT0veh+WAlMcCGHvMOMQwcCdcIntYy6WmXhIg2PuiAvsEHO97IhHGgzckb4D8L6LmZYPMHBnhiWwXVdDPF9g4A4Vwd66nFr6BAN3ygbbw1yoMzjmjplgB5hrrufSvsHAHesZDOD2JAbxVYCBOzfIAZ9JbR6qAgN3cPwP9kZy1VIlGLiTdluCmoOBO/pnS9Bk8DzmS3pL4BMcpZEe1qX0GI/atC4dQYXRMa1MU0IX4gpWsIIVrGAFK1jBCnYUPwIMAPUPAyFL+nRdAAAAAElFTkSuQmCC'); + margin-top: -0.5em; +} + +/* line 582, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-select { + position: relative; +} +/* line 586, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-select .x-component-outer:after { + background-color: #dddddd; + z-index: 2; +} +/* line 592, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-select .x-component-outer:before, .x-field-select .x-component-outer:after { + pointer-events: none; + position: absolute; + display: block; +} +/* line 598, ../themes/stylesheets/sencha-touch/default/widgets/_form.scss */ +.x-field-select .x-component-outer:before { + content: ""; + position: absolute; + width: 4em; + height: auto; + top: 0; + left: auto; + right: 0; + bottom: 0; + -webkit-border-top-right-radius: 0.4em; + border-top-right-radius: 0.4em; + -webkit-border-bottom-right-radius: 0.4em; + border-bottom-right-radius: 0.4em; + background: -webkit-gradient(linear, 0% 0%, 100% 0%, from(rgba(255, 255, 255, 0)), color-stop(0.5, white)); + z-index: 1; +} + +/* line 7, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox { + min-width: 15em; + max-width: 20em; + padding: 0.8em; + margin: .5em; + -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 0.1em 0.5em; + -webkit-border-radius: 0.3em; + border-radius: 0.3em; + border: 0.15em solid #1985d0; +} +/* line 16, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-icon { + margin-left: 1.3em; +} +/* line 20, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-title { + font-size: .9em; + line-height: 1.4em; +} +/* line 25, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-body { + background: transparent !important; +} +/* line 29, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-toolbar { + background: transparent none; + -webkit-box-shadow: none; +} +/* line 33, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-toolbar.x-docked-top { + border-bottom: 0; + height: 1.3em; +} +/* line 38, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-toolbar.x-docked-bottom { + border-top: 0; +} +/* line 43, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-field { + min-height: 2em; + background: #fff; + -webkit-border-radius: 0.2em; + border-radius: 0.2em; +} +/* line 49, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-form-field { + min-height: 1.5em; + padding-right: 0 !important; + -webkit-appearance: none; +} +/* line 55, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox .x-field-input { + padding-right: 2.2em; +} + +/* line 60, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox-text { + text-align: center; + padding: 6px 0; + line-height: 1.4em; +} + +/* line 66, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox-buttons { + padding: 0.4em 0; + height: auto; +} +/* line 70, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox-buttons .x-button { + min-width: 4.5em; +} +/* line 74, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox-buttons .x-button-normal span { + opacity: .7; +} + +/* line 85, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox-dark .x-msgbox-text { + color: rgba(190, 224, 247, 0.9); + text-shadow: rgba(0, 0, 0, 0.5) 0 -0.08em 0; +} +/* line 89, ../themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss */ +.x-msgbox-dark .x-msgbox-input { + background-color: rgba(190, 224, 247, 0.9); + background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(144, 202, 242, 0.9)), color-stop(10%, rgba(167, 213, 244, 0.9)), color-stop(65%, rgba(190, 224, 247, 0.9)), color-stop(100%, rgba(192, 225, 247, 0.9))); + background-image: -webkit-linear-gradient(rgba(144, 202, 242, 0.9), rgba(167, 213, 244, 0.9) 10%, rgba(190, 224, 247, 0.9) 65%, rgba(192, 225, 247, 0.9)); + background-image: linear-gradient(rgba(144, 202, 242, 0.9), rgba(167, 213, 244, 0.9) 10%, rgba(190, 224, 247, 0.9) 65%, rgba(192, 225, 247, 0.9)); + border: 0.1em solid rgba(25, 133, 208, 0.9); +} + +/* line 20, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner { + font-size: 250%; + height: 1em; + width: 1em; + position: relative; + -webkit-transform-origin: 0.5em 0.5em; + /* Shared Properties for all the bars */ +} +/* line 29, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span, .x-loading-spinner > span:before, .x-loading-spinner > span:after { + display: block; + position: absolute; + width: 0.1em; + height: 0.25em; + top: 0; + -webkit-transform-origin: 0.05em 0.5em; + -webkit-border-radius: 0.05em; + border-radius: 0.05em; + content: " "; +} +/* line 41, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-top { + background-color: rgba(170, 170, 170, 0.99); +} +/* line 42, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-top::after { + background-color: rgba(170, 170, 170, 0.9); +} +/* line 43, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-left::before { + background-color: rgba(170, 170, 170, 0.8); +} +/* line 44, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-left { + background-color: rgba(170, 170, 170, 0.7); +} +/* line 45, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-left::after { + background-color: rgba(170, 170, 170, 0.6); +} +/* line 46, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-bottom::before { + background-color: rgba(170, 170, 170, 0.5); +} +/* line 47, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-bottom { + background-color: rgba(170, 170, 170, 0.4); +} +/* line 48, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-bottom::after { + background-color: rgba(170, 170, 170, 0.35); +} +/* line 49, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-right::before { + background-color: rgba(170, 170, 170, 0.3); +} +/* line 50, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-right { + background-color: rgba(170, 170, 170, 0.25); +} +/* line 51, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-right::after { + background-color: rgba(170, 170, 170, 0.2); +} +/* line 52, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-top::before { + background-color: rgba(170, 170, 170, 0.15); +} + +/* line 56, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span { + left: 50%; + margin-left: -0.05em; +} + +/* Rotate each of the 4 Spans */ +/* line 65, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-top { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); +} + +/* line 66, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-right { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); +} + +/* line 67, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-bottom { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); +} + +/* line 68, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span.x-loading-left { + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); +} + +/* These are the two lines that surround each of the 4 Span lines */ +/* line 72, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span::before { + -webkit-transform: rotate(30deg); + -moz-transform: rotate(30deg); +} + +/* line 73, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner > span::after { + -webkit-transform: rotate(-30deg); + -moz-transform: rotate(-30deg); +} + +/* Set Animation */ +/* line 77, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ +.x-loading-spinner { + -webkit-animation-name: x-loading-spinner-rotate; + -webkit-animation-duration: .5s; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; +} + +@-webkit-keyframes x-loading-spinner-rotate { + /* line 85, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 0% { + -webkit-transform: rotate(0deg); + } + + /* line 86, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 8.32% { + -webkit-transform: rotate(0deg); + } + + /* line 88, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 8.33% { + -webkit-transform: rotate(30deg); + } + + /* line 89, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 16.65% { + -webkit-transform: rotate(30deg); + } + + /* line 91, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 16.66% { + -webkit-transform: rotate(60deg); + } + + /* line 92, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 24.99% { + -webkit-transform: rotate(60deg); + } + + /* line 94, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 25% { + -webkit-transform: rotate(90deg); + } + + /* line 95, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 33.32% { + -webkit-transform: rotate(90deg); + } + + /* line 97, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 33.33% { + -webkit-transform: rotate(120deg); + } + + /* line 98, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 41.65% { + -webkit-transform: rotate(120deg); + } + + /* line 100, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 41.66% { + -webkit-transform: rotate(150deg); + } + + /* line 101, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 49.99% { + -webkit-transform: rotate(150deg); + } + + /* line 103, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 50% { + -webkit-transform: rotate(180deg); + } + + /* line 104, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 58.32% { + -webkit-transform: rotate(180deg); + } + + /* line 106, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 58.33% { + -webkit-transform: rotate(210deg); + } + + /* line 107, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 66.65% { + -webkit-transform: rotate(210deg); + } + + /* line 109, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 66.66% { + -webkit-transform: rotate(240deg); + } + + /* line 110, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 74.99% { + -webkit-transform: rotate(240deg); + } + + /* line 112, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 75% { + -webkit-transform: rotate(270deg); + } + + /* line 113, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 83.32% { + -webkit-transform: rotate(270deg); + } + + /* line 115, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 83.33% { + -webkit-transform: rotate(300deg); + } + + /* line 116, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 91.65% { + -webkit-transform: rotate(300deg); + } + + /* line 118, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 91.66% { + -webkit-transform: rotate(330deg); + } + + /* line 119, ../themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss */ + 100% { + -webkit-transform: rotate(330deg); + } +} diff --git a/sencha/resources/icons/Icon.png b/sencha/resources/icons/Icon.png new file mode 100644 index 0000000..c23d27d Binary files /dev/null and b/sencha/resources/icons/Icon.png differ diff --git a/sencha/resources/icons/Icon@2x.png b/sencha/resources/icons/Icon@2x.png new file mode 100644 index 0000000..4211d8b Binary files /dev/null and b/sencha/resources/icons/Icon@2x.png differ diff --git a/sencha/resources/icons/Icon~ipad.png b/sencha/resources/icons/Icon~ipad.png new file mode 100644 index 0000000..28a757d Binary files /dev/null and b/sencha/resources/icons/Icon~ipad.png differ diff --git a/sencha/resources/icons/Icon~ipad@2x.png b/sencha/resources/icons/Icon~ipad@2x.png new file mode 100644 index 0000000..31ca9df Binary files /dev/null and b/sencha/resources/icons/Icon~ipad@2x.png differ diff --git a/sencha/resources/icons/iTunesArtwork.png b/sencha/resources/icons/iTunesArtwork.png new file mode 100644 index 0000000..64ce220 Binary files /dev/null and b/sencha/resources/icons/iTunesArtwork.png differ diff --git a/sencha/resources/icons/icon-spot~ipad.png b/sencha/resources/icons/icon-spot~ipad.png new file mode 100644 index 0000000..0cc2646 Binary files /dev/null and b/sencha/resources/icons/icon-spot~ipad.png differ diff --git a/sencha/resources/images/twitter-logo.png b/sencha/resources/images/twitter-logo.png new file mode 100644 index 0000000..185faf7 Binary files /dev/null and b/sencha/resources/images/twitter-logo.png differ diff --git a/sencha/resources/images/twitter-logo.small.png b/sencha/resources/images/twitter-logo.small.png new file mode 100644 index 0000000..db86d90 Binary files /dev/null and b/sencha/resources/images/twitter-logo.small.png differ diff --git a/sencha/resources/loading/Default-LandscapeLeft~ipad.png b/sencha/resources/loading/Default-LandscapeLeft~ipad.png new file mode 100644 index 0000000..30f6f2d Binary files /dev/null and b/sencha/resources/loading/Default-LandscapeLeft~ipad.png differ diff --git a/sencha/resources/loading/Default-LandscapeRight~ipad.png b/sencha/resources/loading/Default-LandscapeRight~ipad.png new file mode 100644 index 0000000..c959144 Binary files /dev/null and b/sencha/resources/loading/Default-LandscapeRight~ipad.png differ diff --git a/sencha/resources/loading/Default-Landscape~ipad.png b/sencha/resources/loading/Default-Landscape~ipad.png new file mode 100644 index 0000000..d540812 Binary files /dev/null and b/sencha/resources/loading/Default-Landscape~ipad.png differ diff --git a/sencha/resources/loading/Default-PortraitUpsideDown~ipad.png b/sencha/resources/loading/Default-PortraitUpsideDown~ipad.png new file mode 100644 index 0000000..67d45ce Binary files /dev/null and b/sencha/resources/loading/Default-PortraitUpsideDown~ipad.png differ diff --git a/sencha/resources/loading/Default-Portrait~ipad.png b/sencha/resources/loading/Default-Portrait~ipad.png new file mode 100644 index 0000000..1ae4343 Binary files /dev/null and b/sencha/resources/loading/Default-Portrait~ipad.png differ diff --git a/sencha/resources/loading/Default.png b/sencha/resources/loading/Default.png new file mode 100644 index 0000000..0ed9f67 Binary files /dev/null and b/sencha/resources/loading/Default.png differ diff --git a/sencha/resources/loading/Default@2x.png b/sencha/resources/loading/Default@2x.png new file mode 100644 index 0000000..7d798a7 Binary files /dev/null and b/sencha/resources/loading/Default@2x.png differ diff --git a/sencha/resources/loading/Default~ipad.png b/sencha/resources/loading/Default~ipad.png new file mode 100644 index 0000000..163f4c5 Binary files /dev/null and b/sencha/resources/loading/Default~ipad.png differ diff --git a/sencha/resources/loading/Homescreen.jpg b/sencha/resources/loading/Homescreen.jpg new file mode 100644 index 0000000..d246bc6 Binary files /dev/null and b/sencha/resources/loading/Homescreen.jpg differ diff --git a/sencha/resources/loading/Homescreen~ipad.jpg b/sencha/resources/loading/Homescreen~ipad.jpg new file mode 100644 index 0000000..7f9b01b Binary files /dev/null and b/sencha/resources/loading/Homescreen~ipad.jpg differ diff --git a/sencha/resources/sass/app.scss b/sencha/resources/sass/app.scss new file mode 100644 index 0000000..4d1ffab --- /dev/null +++ b/sencha/resources/sass/app.scss @@ -0,0 +1,19 @@ +@import 'sencha-touch/default/all'; + +// You may remove any of the following modules that you +// do not use in order to create a smaller css file. +@include sencha-panel; +@include sencha-buttons; +@include sencha-sheet; +@include sencha-picker; +@include sencha-tabs; +@include sencha-toolbar; +@include sencha-toolbar-forms; +@include sencha-indexbar; +@include sencha-list; +@include sencha-layout; +@include sencha-carousel; +@include sencha-form; +@include sencha-msgbox; + +// Your custom code goes here... \ No newline at end of file diff --git a/sencha/resources/sass/config.rb b/sencha/resources/sass/config.rb new file mode 100644 index 0000000..bf95855 --- /dev/null +++ b/sencha/resources/sass/config.rb @@ -0,0 +1,14 @@ +# Get the directory that this configuration file exists in +dir = File.dirname(__FILE__) + +# Load the sencha-touch framework automatically. +load File.join(dir, '..', '..', 'sdk', 'resources', 'themes') + +# Compass configurations +sass_path = dir +css_path = File.join(dir, "..", "css") + +# Require any additional compass plugins here. +images_dir = File.join(dir, "..", "images") +output_style = :compressed +environment = :production diff --git a/sencha/sdk/command/bin/sencha b/sencha/sdk/command/bin/sencha new file mode 100755 index 0000000..d432e61 --- /dev/null +++ b/sencha/sdk/command/bin/sencha @@ -0,0 +1,9 @@ +#!/bin/sh +if test -e ".senchasdk" +then + sdkpath=`cat .senchasdk` + $sdkpath/command/sencha $* +else + DIR=$(dirname $(which $0))"/../command" + jsdb -path $DIR $DIR/sencha.js $* +fi \ No newline at end of file diff --git a/sencha/sdk/command/bin/sencha.bat b/sencha/sdk/command/bin/sencha.bat new file mode 100644 index 0000000..d975d3b --- /dev/null +++ b/sencha/sdk/command/bin/sencha.bat @@ -0,0 +1,10 @@ +@echo off + +IF EXIST .senchasdk ( + SET /P sdkpath= < .senchasdk + + "%sdkpath%\command\sencha" %* +) ELSE ( + set dir=%~dp0 + jsdb -path "%dir%..\command" "%dir%..\command\sencha.js" %* +) \ No newline at end of file diff --git a/sencha/sdk/command/sencha b/sencha/sdk/command/sencha new file mode 100755 index 0000000..0862811 --- /dev/null +++ b/sencha/sdk/command/sencha @@ -0,0 +1,4 @@ +#!/bin/sh +DIR=$(dirname $(which $0)) +export NODE_PATH=$DIR/vendor/nodejs/node_modules +$DIR/vendor/nodejs/osx/node $DIR/sencha.js $* \ No newline at end of file diff --git a/sencha/sdk/command/sencha.bat b/sencha/sdk/command/sencha.bat new file mode 100644 index 0000000..7c117ea --- /dev/null +++ b/sencha/sdk/command/sencha.bat @@ -0,0 +1,14 @@ +@echo off + +IF EXIST .\sdk\command\sencha ( + set NODE_PATH=.\sdk\command\vendor\nodejs\node_modules + .\sdk\command\vendor\nodejs\win\node sdk\command\sencha.js %* +) ELSE ( + IF EXIST .\command\sencha ( + set NODE_PATH=.\command\vendor\nodejs\node_modules + .\command\vendor\nodejs\win\node command\sencha.js %* + ) ELSE ( + set dir=%~dp0 + jsdb -path "%dir%..\command" "%dir%..\command\sencha.js" %* + ) +) \ No newline at end of file diff --git a/sencha/sdk/command/sencha.js b/sencha/sdk/command/sencha.js new file mode 100644 index 0000000..12ef265 --- /dev/null +++ b/sencha/sdk/command/sencha.js @@ -0,0 +1,57 @@ +(function() { + var coreFiles = [ + "Ext.js", + "version/Version.js", + "lang/String.js", + "lang/Number.js", + "lang/Array.js", + "lang/Function.js", + "lang/Object.js", + "lang/Date.js", + "lang/JSON.js", + "class/Base.js", + "class/Class.js", + "class/ClassManager.js", + "class/Loader.js", + "lang/Error.js" + ], + path = require('path'), + currentPath = __dirname, + srcPath = path.resolve(currentPath, '../src'), + corePath = path.join(srcPath, 'core'), + command; + + coreFiles.forEach(function(file) { + require(path.join(corePath, file)); + }); + + Ext.Loader.setConfig({ + enabled: true, + paths: { + Ext: srcPath, + Command: path.join(currentPath, 'src') + } + }); + + command = Ext.create('Command.Cli', { + version: '2.0.0', + currentPath: currentPath, + modules: { + 'app': 'Application', + 'fs': 'FileSystem', + 'manifest': 'Manifest', + 'test': 'Test', + 'generate': 'Generate', + 'package': 'Package' + }, + logger: Ext.create('Ext.log.Logger', { + writers: { + cli: Ext.create('Command.log.writer.Cli', { + formatter: Ext.create('Command.log.formatter.Cli') + }) + }, + minPriority: 'verbose' + }) + }); + command.run(Array.prototype.slice.call(process.argv, 2)); +})(); diff --git a/sencha/sdk/command/senchadebug b/sencha/sdk/command/senchadebug new file mode 100755 index 0000000..df48796 --- /dev/null +++ b/sencha/sdk/command/senchadebug @@ -0,0 +1,4 @@ +#!/bin/sh +DIR=$(dirname $(which $0)) +export NODE_PATH=$DIR/vendor/nodejs/node_modules +$DIR/vendor/nodejs/osx/node --debug-brk $DIR/sencha.js $* diff --git a/sencha/sdk/command/src/Cli.js b/sencha/sdk/command/src/Cli.js new file mode 100644 index 0000000..736273d --- /dev/null +++ b/sencha/sdk/command/src/Cli.js @@ -0,0 +1,300 @@ +/** + * @class Command.Cli + * @author Jacky Nguyen + */ +Ext.define('Command.Cli', { + config: { + version: '', + logger: null, + currentPath: '', + modules: {} + }, + + modules: {}, + + templates: {}, + + constructor: function(config) { + var platformName = process.platform; + + if (platformName === 'win32') { + platformName = 'win'; + } + else if (platformName === 'darwin') { + platformName = 'osx'; + } + else { + platformName = 'linux'; + + if (/64/.test(process.arch)) { + platformName += '64'; + } + } + + this.platformName = platformName; + + this.initConfig(config); + }, + + applyVersion: function(version) { + return new Ext.Version(version); + }, + + applyModules: function(modules) { + var classManager = Ext.ClassManager, + alias, name; + + for (alias in modules) { + if (modules.hasOwnProperty(alias)) { + name = modules[alias]; + classManager.setAlias('Command.module.' + name, 'module.' + alias); + } + } + + return modules; + }, + + run: function(args) { + var options = this.parseArguments(args), + targets = options.targets, + moduleName = targets.shift(), + action = targets.shift(), + module; + + if (!moduleName || !(module = this.getModule(moduleName))) { + return this.printUsage(); + } + + if (!action || !module.hasAction(action)) { + return this.printUsage(moduleName); + } + + try { + this.execute(module, action, options); + } + catch (e) { + this.error(e.message); + this.printUsage(moduleName, action); + } + }, + + getModule: function(name) { + var modules = this.modules, + module = modules[name]; + + if (!module) { + try { + module = Ext.createByAlias('module.' + name, this); + } + catch (e) { + return null; + } + + modules[name] = module; + } + + return module; + }, + + execute: function(module, action, options) { + var rules = module.getActionRules(action).slice(1), + args = [], + targets = options.targets, + i, ln, arg, value, name, longName, shortName, type, defaultValue; + + for (i = 0,ln = rules.length; i < ln; i++) { + arg = rules[i]; + + longName = arg[0]; + shortName = arg[1]; + type = arg[3]; + defaultValue = arg[4]; + name = '--' + longName; + + if (options.hasOwnProperty(longName)) { + value = this.formatArgumentValue(options[longName], type, name); + } + else if (shortName && options.hasOwnProperty(shortName)) { + name = '-' + shortName; + value = this.formatArgumentValue(options[shortName], type, name); + } + else { + value = targets.shift(); + + if (value !== undefined) { + value = this.formatArgumentValue(value, type, name); + } + else if (defaultValue !== undefined && defaultValue !== null) { + value = defaultValue; + } + else { + throw new Error("Missing required value for argument: '" + name + "'"); + } + } + + args.push(value); + } + + module[action].apply(module, args); + }, + + formatArgumentValue: function(value, type, name) { + var errorMessagePrefix = "Invalid value of: '" + value + "' for argument: '" + name + "', "; + + switch (type) { + case "number": + if (isNaN(value)) { + throw new Error(errorMessagePrefix + "must be a valid number"); + } + return Number(value); + break; + + case "array": + if (typeof value != 'string') { + throw new Error(errorMessagePrefix + "must be a valid comma-separated list of items"); + } + return value.split(','); + break; + + case "boolean": + if (value === "yes") { + value = true; + } + else if (value === "no") { + value = false; + } + return Boolean(value); + break; + + default: + return String(value); + } + }, + + getTemplate: function(name) { + var templates = this.templates, + template = templates[name], + filePath; + + if (!template) { + filePath = require('path').resolve(this.getCurrentPath(), 'templates/' + name + '.tpl'); + templates[name] = template = Ext.create('Ext.XTemplate', this.getModule('fs').read(filePath)); + } + + return template; + }, + + printUsage: function(moduleName, actionName) { + var modules = [], + actions = [], + module, info; + + if (!moduleName) { + Ext.Object.each(this.getModules(), function(alias) { + modules.push({ + name: alias, + description: this.getModule(alias).description + }); + }, this); + + console.log(this.getTemplate('modules').apply({ + version: this.getVersion().toString(), + modules: modules + })); + } + else if (!actionName) { + module = this.getModule(moduleName); + + Ext.Object.each(module.actions, function(name, args) { + actions.push({ + name: name, + description: args[0], + args: args.slice(1) + }); + }); + + console.log(this.getTemplate('actions').apply({ + name: moduleName, + description: module.description, + actions: actions + })); + } + else { + module = this.getModule(moduleName); + info = module.actions[actionName]; + + console.log(this.getTemplate('action').apply({ + module: moduleName, + name: actionName, + description: info[0], + args: info.slice(1) + })); + } + }, + + parseArguments: function(args) { + var targets = [], + options = { + targets: targets + }, + key = null, + i, ln, option, match; + + for (i = 0, ln = args.length; i < ln; i++) { + option = args[i]; + + if (key !== null) { + if (!option.match(/^-{1,2}([^-])/i)) { + options[key] = option; + key = null; + continue; + } + + options[key] = true; + key = null; + } + + + if (match = option.match(/^--([^=]+)=(.*)$/i)) { + options[match[1]] = match[2]; + } + else if ((match = option.match(/^--(.+)$/i)) || (match = option.match(/^-(.)$/i))) { + key = match[1]; + } + else if (match = option.match(/^-(.+)$/i)) { + match[1].split('').forEach(function(a) { + options[a] = true; + }); + } + else { + targets.push(option); + } + } + + if (key !== null) { + options[key] = true; + } + + return options; + }, + + doLog: function(message, priority, stackLevel) { + return this.getLogger().log(message, priority, (stackLevel !== undefined) ? stackLevel : 2); + }, + + log: function(message) { + return this.doLog(message, 'verbose'); + }, + + info: function(message) { + return this.doLog(message, 'info'); + }, + + warn: function(message) { + return this.doLog(message, 'warn'); + }, + + error: function(message) { + return this.doLog(message, 'error'); + } +}); diff --git a/sencha/sdk/command/src/Preprocessor.js b/sencha/sdk/command/src/Preprocessor.js new file mode 100644 index 0000000..f23f1c6 --- /dev/null +++ b/sencha/sdk/command/src/Preprocessor.js @@ -0,0 +1,179 @@ +/** + * @class Command.Preprocessor + * @author Jacky Nguyen + */ +Ext.define('Command.Preprocessor', { + statics: { + getInstance: function() { + if (!this.instance) { + this.instance = new this(); + } + + return this.instance; + } + }, + + params: {}, + + process: function(filePath) { + // This is currently not memory-efficient since it reads the whole file's content at once. + // However nodejs doesn't have a proper / easy way to "readLine" synchronously + // And it takes a ridiculous amount of effort to do so + var lineStack = Ext.create('Command.preprocessor.LineStack', filePath); + + return Ext.create('Command.preprocessor.Statement').process(lineStack); + }, + + evaluate: function(name, value) { + var params = this.params, + modifier = null, + param = (params.hasOwnProperty(name)) ? params[name] : false, + match; + + if (value === undefined) { + value = true; + } + + if (Ext.isString(value)) { + match = value.match(/^(!=*|<=|>=|<|>|=+)/); + + if (match) { + modifier = match[0]; + value = value.slice(modifier.length); + } + + // Boolean + if (value === 'true') { + value = true; + } + else if (value === 'false') { + value = false; + } + // Numeric + else if (!isNaN(value)) { + value = parseFloat(value); + } + } + +// Logger.log('[DEBUG][Parser#evaluate] name:"' + name + '", modifier:'+modifier+', param:"' + param + '", value:"' + value + '"'); + + switch (modifier) { + case '!==': + case '!=': + case '!': + return (param !== value); + case '>': + return (param > value); + case '<': + return (param < value); + case '<=': + return (param <= value); + case '>=': + return (param >= value); + case '==': + return (param == value); + case '=': + case '===': + default: + return (param === value); + } + }, + + setParams: function(params) { + this.params = params || {}; + }, + + isCloseOf: function(string, statement) { + if (!statement.type) { + return false; + } + + return string.trim().match(new RegExp("^\\/\\/(?:\\t|\\s)*<\\/" + ((statement.isInverted) ? "!" : "") + + statement.type + ">$")) !== null; + }, + + isStatement: function(string) { + return this.parseStatementParts(string) !== null; + }, + + parseStatementParts: function(string) { + return string.trim().match(/^\/\/(?:\t|\s)*<([^\/]+)>$/); + }, + + parseStatementProperties: function(string) { + var properties = {}, + expect = function(regexp) { + var result = string.match(regexp); + + if (result !== null) { + string = string.slice(result[0].length); + return result[0]; + } + + return null; + }, + name, equalSign, valueWrapper, valueCheck, value; + + while (string.length > 0) { + expect(/^[^\w]+/i); + name = expect(/^[\w\.\-_]+/i); + + if (name === null) { + break; + } + + equalSign = expect(/^=/); + + if (equalSign === null) { + properties[name] = true; + continue; + } + + valueWrapper = expect(/^('|")/i); + valueCheck = valueWrapper || "\\s"; + + value = expect(new RegExp('^[^' + valueCheck + ']+')); + + if (valueWrapper !== null) { + expect(new RegExp(valueWrapper)); + } + + properties[name] = value; + } + + return properties; + }, + + parseStatement: function(string) { + string = string.trim(); + + var parts = this.parseStatementParts(string), + typeMatch, statement; + + // Check if it's actually a valid statement + if (parts === null) { + return false; + } + + string = parts[1]; + + typeMatch = string.match(/^(!)?([\w]+)/i); + + if (typeMatch === null) { + return false; + } + + statement = { + properties: {} + }; + + statement.type = typeMatch[2]; + statement.isInverted = (typeMatch[1] !== undefined); + + string = string.substr(typeMatch[0].length, string.length).trim(); + statement.properties = this.parseStatementProperties(string); + + return statement; + } + +}); diff --git a/sencha/sdk/command/src/log/formatter/Cli.js b/sencha/sdk/command/src/log/formatter/Cli.js new file mode 100644 index 0000000..293ab20 --- /dev/null +++ b/sencha/sdk/command/src/log/formatter/Cli.js @@ -0,0 +1,53 @@ +Ext.define('Command.log.formatter.Cli', { + extend: 'Ext.log.formatter.Default', + + styles: { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + //grayscale + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + //colors + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] + }, + + priorityStyle: { + verbose: ['grey', 'bold'], + info: ['green', 'bold'], + deprecate: ['yellow', 'bold'], + warn: ['magenta', 'bold'], + error: ['red', 'bold'] + }, + + format: function(event) { + var priority = event.priorityName, + priorityStyles = this.priorityStyle[priority]; + + return require('util').format('%s %s', + this.style('['+priority.toUpperCase()+']', priorityStyles), +// this.style('['+event.callerDisplayName+']', ['grey']), + event.message); + }, + + style: function(text, styles) { + var style, i, ln, data; + + styles = Ext.Array.from(styles); + + for (i = 0,ln = styles.length; i < ln; i++) { + style = styles[i]; + data = this.styles[style]; + text = '\033['+data[0]+'m' + text + '\033['+data[1]+'m'; + } + + return text; + } +}); diff --git a/sencha/sdk/command/src/log/writer/Cli.js b/sencha/sdk/command/src/log/writer/Cli.js new file mode 100644 index 0000000..99b4a39 --- /dev/null +++ b/sencha/sdk/command/src/log/writer/Cli.js @@ -0,0 +1,7 @@ +Ext.define('Command.log.writer.Cli', { + extend: 'Ext.log.writer.Writer', + + doWrite: function(event) { + console.log(event.message); + } +}); diff --git a/sencha/sdk/command/src/module/Abstract.js b/sencha/sdk/command/src/module/Abstract.js new file mode 100644 index 0000000..16e6426 --- /dev/null +++ b/sencha/sdk/command/src/module/Abstract.js @@ -0,0 +1,67 @@ +/** + * @class Command.module.Abstract + * @author Jacky Nguyen + */ +Ext.define('Command.module.Abstract', { + actions: {}, + + constructor: function(cli) { + this.cli = cli; + }, + + getModule: function(name) { + return this.cli.getModule(name); + }, + + getTemplate: function(name) { + return this.cli.getTemplate(name); + }, + + hasAction: function(action) { + return this.actions.hasOwnProperty(action); + }, + + getActionRules: function(action) { + return this.actions[action]; + }, + + getVendorPath: function(name) { + return require('path').resolve(this.cli.getCurrentPath(), 'vendor/' + name); + }, + + escapeShell: function(cmd) { + if (!cmd) { + return ''; + } + + return '"' + cmd + '"'; + }, + + exec: function(command, args, callback) { + var util = require('util'); + + if (typeof args == 'function') { + callback = args; + args = []; + } + + args = args.map(function(arg) { + return this.escapeShell(arg); + }, this); + args.unshift(command); + + command = util.format.apply(util, args); + callback = callback.bind(this); + + require('child_process').exec(command, callback); + } + +}, function() { + ['log', 'info', 'warn', 'error'].forEach(function(name) { + this.addMember(name, function() { + var args = Ext.Array.from(arguments); + args.push(name); + return this.cli.doLog.apply(this.cli, args); + }); + }, this); +}); diff --git a/sencha/sdk/command/src/module/Application.js b/sencha/sdk/command/src/module/Application.js new file mode 100644 index 0000000..3b88674 --- /dev/null +++ b/sencha/sdk/command/src/module/Application.js @@ -0,0 +1,316 @@ +/** + * @class Command.module.Application + * @author Jacky Nguyen + */ +Ext.define('Command.module.Application', { + extend: 'Command.module.Abstract', + + description: 'Resolve application dependencies and build for production', + + actions: { + create: [ + "(Alias to 'sencha generate app') Generate a new project with the recommended structure", + ['name', 'n', 'The namespace of the application to create. ' + + 'This will be used as the prefix for all your classes', 'string', null, 'MyApp'], + ['path', 'p', 'The directory path to generate this application to.', 'string', null, '/path/to/myapp'], + ['library', 'l', "The library's build to develop your application with, either 'core' or 'all'. " + + "Defaults to 'core'", 'string', 'core', 'all'] + ], + resolve: [ + "Generate a list of dependencies in the exact loading order for the given application. " + + "Note that the resolved paths are relative to the given application's HTML document", + ['uri', 'u', 'The URI to the application\'s HTML document', 'string', null, 'http://localhost/myapp/index.html'], + ['output', 'o', 'The file path to write the results to in JSON format.', 'string', null, 'dependencies.json'] + ], + build: [ + "Build the application at the current working directory to the given path", + ['environment', 'e', "The build environment, either 'testing', 'package', 'production', or 'native'" + + "\n " + + "+ 'testing' is meant for QA prior to production. All JavaScript and CSS Files are bundled, but not minified" + + "\n " + + "+ 'package' creates a self-contained, re-distributable production build that " + + "\n " + + "normally runs from local file system without the need for a web server" + + "\n " + + "+ 'production' creates a production build that is normally hosted on a web server and " + + "\n " + + "serve multiple clients (devices). The build is offline-capable and has built-in " + + "\n " + + "OTA delta updating feature" + + "\n " + + "+ 'native' first generates a 'package' build, then packages it as a native " + + "\n " + + "application, ready to be deployed to native platforms", + 'string', null, 'production'], + ['destination', 'd', "The directory path to build this application to. " + + "\n " + + "If none given, the default path specified inside 'app.json' is used", 'string', '', '/path/to/deploy/myapp'], + ['archive', 'a', "The directory path where all previous builds were stored," + + "\n " + + "needed to generate deltas between updates (for production only). " + + "\n " + + "If none given, the default path specified inside 'app.json' is used", + 'string', '', '/path/to/myapp/archive'] + ] + }, + + create: function() { + var module = this.getModule('generate'); + + module.app.apply(module, arguments); + }, + + resolve: function(uri, output, callback) { + var parsedUri = require('url').parse(uri); + + if (!/^file|http/.test(parsedUri.protocol)) { + uri = 'file:///' + require('path').resolve(uri).replace(/\\/g, '/'); + } + + this.exec('%s %s %s', [ + this.getVendorPath('phantomjs/' + this.cli.platformName + '/phantomjs'), + this.getVendorPath('phantomjs/dependencies.js'), + uri + ], function(error, stdout) { + if (error) { + this.error(stdout); + } + else { + if (output) { + this.getModule('fs').write(output, stdout); + } + + if (callback) { + callback(JSON.parse(stdout)); + } + } + }); + }, + + build: function(environment, destination, archive) { + var nativePackaging = false; + + if (environment == 'native') { + environment = 'package'; + nativePackaging = true; + } + + if (!/^testing|package|production$/.test(environment)) { + throw new Error("Invalid environment argument of: '"+environment+"'," + + " must be either 'testing', 'package', 'production' or 'native'"); + } + + var path = require('path'), + src = process.cwd(), + fs = this.getModule('fs'), + sdk = path.resolve(src, fs.read('.senchasdk').trim()), + config = fs.readJson(path.join(src, 'app.json')), + jsAssets = config.js || [], + cssAssets = config.css || [], + extras = config.extras, + appCache = config.appCache, + preprocessor = Ext.require('Command.Preprocessor').getInstance(), + nodeFs = require('fs'), + indexHtml, assets, file, destinationFile, files, + appJs, assetsCount, processedAssetsCount, + packagerConfig, packagerJson, processIndex; + + preprocessor.setParams(config.buildOptions || {}); + + if (!destination) { + destination = config.buildPaths[environment]; + } + + if (!archive) { + archive = config.archivePath; + } + + destination = path.resolve(destination); + archive = path.resolve(archive); + + appJs = path.join(destination, 'app.js'); + + this.info("Deploying your application to " + destination); + + fs.mkdir(destination); + + jsAssets = jsAssets.map(function(asset) { + if (typeof asset == 'string') { + asset = { path: asset }; + } + asset.type = 'js'; + return asset; + }); + + cssAssets = cssAssets.map(function(asset) { + if (typeof asset == 'string') { + asset = { path: asset }; + } + asset.type = 'css'; + return asset; + }); + + assets = jsAssets.concat(cssAssets).filter(function(asset) { + return !asset.shared || (environment != 'production'); + }); + + assets.forEach(function(asset) { + file = asset.path; + fs.copyFile(path.join(src, file), path.join(destination, file)); + this.info("Copied " + file); + }, this); + + extras.forEach(function(extra) { + fs.copy(path.join(src, extra), path.join(destination, extra)); + this.info("Copied " + extra); + }, this); + + processIndex = function(callback) { + var appJson = JSON.stringify({ + id: config.id, + js: jsAssets, + css: cssAssets + }); + + fs.write(path.join(destination, 'app.json'), appJson); + this.info("Generated app.json"); + + indexHtml = fs.read(path.join(src, 'index.html')); + + if (environment == 'production' && appCache) { + indexHtml = indexHtml.replace('/, + ''); + + fs.write(path.join(destination, 'index.html'), indexHtml); + this.info("Embedded microloader into index.html"); + + if (callback) { + callback(); + } + }.bind(this)); + }.bind(this); + + this.info("Resolving your application dependencies..."); + this.resolve(path.join(src, 'index.html'), null, function(dependencies) { + this.info("Found " + dependencies.length + " dependencies. Concatenating all into app.js..."); + + files = dependencies.map(function(dependency) { + return path.join(src, dependency.path); + }); + + files.push(appJs); + + fs.concat(files, path.join(destination, 'app.all.js'), "\n"); + + nodeFs.unlinkSync(appJs); + nodeFs.renameSync(path.join(destination, 'app.all.js'), appJs); + + processedAssetsCount = 0; + assetsCount = assets.length; + assets.forEach(function(asset) { + file = asset.path; + destinationFile = path.join(destination, file); + + if (asset.type == 'js') { + fs.write(destinationFile, preprocessor.process(destinationFile)); + this.info("Processed " + file); + } + + if (environment == 'testing') { + return; + } + + this.info("Minifying " + file); + + fs.minify(destinationFile, destinationFile, null, function(destinationFile, file, asset) { + this.info("Minified " + file); + + if (environment == 'production') { + var version = fs.checksum(destinationFile); + asset.version = version; + + fs.prependFile(destinationFile, '/*' + version + '*/'); + fs.copyFile(destinationFile, path.join(archive, file, version)); + + if (asset.update === 'delta') { + nodeFs.readdirSync(path.join(archive, file)).forEach(function(archivedVersion) { + if (archivedVersion === version) { + return; + } + + var deltaFile = path.join(destination, 'deltas', file, archivedVersion + '.json'); + + fs.write(deltaFile, ''); + fs.delta( + path.join(archive, file, archivedVersion), destinationFile, deltaFile, + function() { + this.info("Generated delta for: '" + file + "' from hash: '" + + archivedVersion + "' to hash: '" + version + "'"); + }.bind(this) + ); + + }, this); + } + } + + if (++processedAssetsCount == assetsCount) { + processIndex(function() { + if (environment == 'production' && appCache) { + appCache.cache = appCache.cache.map(function(cache) { + var checksum = ''; + + if (!/^(\/|(.*):\/\/)/.test(cache)) { + this.info("Generating checksum for appCache item: " + cache); + checksum = fs.checksum(path.join(destination, cache)); + } + + return { + uri: cache, + checksum: checksum + } + }, this); + + fs.write(path.join(destination, 'cache.manifest'), this.getTemplate('cache.manifest').apply(appCache)); + this.info("Generated cache.manifest"); + } + + if (nativePackaging) { + packagerJson = fs.read(path.join(src, 'packager.json')); + packagerConfig = Ext.JSON.decode(packagerJson); + + if (packagerConfig.platform.match(/iOS/)) { + fs.copyDirectory(path.join(src, 'resources', 'icons'), destination); + fs.copyDirectory(path.join(src, 'resources', 'loading'), destination); + } + + packagerConfig.inputPath = destination; + packagerConfig.outputPath = path.resolve(config.buildPaths.native); + fs.mkdir(packagerConfig.outputPath); + fs.writeJson(path.join(src, 'packager.temp.json'), packagerConfig); + + this.info("Packaging your application as a native app..."); + + this.getModule('package').run('packager.temp.json', function() { + nodeFs.unlinkSync(path.join(src, 'packager.temp.json')); + }); + } + }.bind(this)); + } + }.bind(this, destinationFile, file, asset)); + }, this); + + if (environment == 'testing') { + processIndex(); + } + + }.bind(this)); + } +}); diff --git a/sencha/sdk/command/src/module/FileSystem.js b/sencha/sdk/command/src/module/FileSystem.js new file mode 100644 index 0000000..acf1f33 --- /dev/null +++ b/sencha/sdk/command/src/module/FileSystem.js @@ -0,0 +1,297 @@ +/** + * @class Command.module.FileSystem + * @author Jacky Nguyen + */ +Ext.define('Command.module.FileSystem', { + extend: 'Command.module.Abstract', + + description: 'A set of useful utility actions to work with files. ' + + 'Most commonly used actions are: concat, minify, delta', + + actions: { + concat: [ + "Concatenate multiple files into one", + ['from', 'f', 'List of files to concatenate, comma-separated', 'array', null, 'foo.js,bar.js,baz.js'], + ['to', 't', 'The destination file to write concatenated content', 'string', null, 'target.js'] + ], + minify: [ + "Minify a JavaScript file, currently support YUICompressor (default), Closure Compiler and UglifyJS", + ['from', 'f', 'Path to the file to minify', 'string', null, 'app.js'], + ['to', 't', 'Path to the destination file to write minified content to.', 'string', null, 'app-minified.js'], + ['compressor', 'c', + 'The name of the compressor to use, can be either: "yuicompressor", ' + + '"uglifyjs" or "closurecompiler". Defaults to "yuicompressor"', 'string', 'yuicompressor', 'uglifyjs'] + ], + delta: [ + "Generates deltas between two files in JSON format", + ['from', 'f', 'Path to the dictionary file', 'string', null, 'version1.js'], + ['to', 't', 'Path to the target file to compare to', 'string', null, 'version2.js'], + ['delta', 'd', 'Path to a JSON file to write the delta content to', 'string', null, 'delta.json'] + ] + }, + + /** + * Concatenate multiple files into one + * @param fromFiles + * @param toFile + */ + concat: function(fromFiles, toFile, separator) { + var fs = require('fs'), + i, ln, fromFile, fd; + + separator = separator || ''; + + fd = fs.openSync(toFile, 'w'); + + for (i = 0,ln = fromFiles.length; i < ln; i++) { + fromFile = fromFiles[i]; + fs.writeSync(fd, this.read(fromFile) + separator); + } + + fs.closeSync(fd); + }, + + /** + * Minify a JavaScript file, currently support YUICompressor (default), Closure Compiler and UglifyJS + * @param fromFiles + * @param toFile + */ + minify: function(fromFile, toFile, compressor, callback) { + var command, jarPath, toArg, content; + + callback = callback || Ext.emptyFn; + + if (compressor === 'uglifyjs') { + var uglifyjs = require('uglify-js'), + jsp = uglifyjs.parser, + pro = uglifyjs.uglify, + ast = jsp.parse(this.read(fromFile)); + + ast = pro.ast_mangle(ast); // get a new AST with mangled names + ast = pro.ast_squeeze(ast); // get an AST with compression optimizations + content = pro.gen_code(ast); + + if (toFile) { + this.write(toFile, content); + callback(); + } + else { + callback(content); + } + } + else { + if (compressor === 'closurecompiler') { + command = 'java -jar %s ' + (toFile ? '--js_output_file %s' : '%s') + ' --js %s'; + jarPath = this.getVendorPath('closurecompiler/compiler.jar'); + } + else { + command = 'java -jar %s ' + (toFile ? '-o %s' : '%s') + ' %s'; + jarPath = this.getVendorPath('yuicompressor/yuicompressor.jar'); + } + + this.exec(command, [jarPath, toFile, fromFile], function(error, stdout, stderr) { + if (error) { + this.error(error); + this.error(stderr); + } + else { + if (!toFile) { + callback(stdout); + } + else { + if (stdout) { + this.info(stdout); + } + callback(); + } + } + }); + } + }, + + /** + * Generates deltas between two files in JSON format + * @param fromFile + * @param toFile + * @param delta + */ + delta: function(fromFile, toFile, delta, callback) { + this.exec('%s encode -json -dictionary %s -target %s -delta %s --stats', [ + this.getVendorPath('vcdiff/' + this.cli.platformName + '/vcdiff'), + fromFile, + toFile, + delta + ], function(error, stdout, stderr) { + if (error) { + this.error(stderr); + } + else { + if (stdout) { + this.info(stdout); + } + + // Fix malformed JSON generated from vcdiff (trailing comma), e.g [1,2,3,] -> [1,2,3] + var content = this.read(delta); + this.write(delta, content.substring(0, content.length - 2) + ']'); + callback(); + } + }); + }, + + mkdir: function() { + var fs = require('fs'), + path = require('path'), + names = Array.prototype.slice.call(arguments), + ln = names.length, + i, j, subLn, name, parentDirName, dirNames; + + for (i = 0; i < ln; i++) { + name = names[i]; + dirNames = []; + + while (!path.existsSync(name)) { + dirNames.unshift(name); + parentDirName = path.dirname(name); + + if (parentDirName === name) { + break; + } + + name = parentDirName; + } + + for (j = 0, subLn = dirNames.length; j < subLn; j++) { + name = dirNames[j]; + fs.mkdirSync(name); + } + } + }, + + read: function(file) { + return require('fs').readFileSync(file, 'utf8'); + }, + + readJson: function(file) { + return Ext.JSON.decode(this.read(file)); + }, + + write: function(file, content) { + var path = require('path'); + + if (!path.existsSync(file)) { + this.mkdir(path.dirname(file)); + } + + require('fs').writeFileSync(file, content, 'utf8'); + }, + + writeJson: function(file, object, beautify) { + return this.write(file, beautify ? JSON.stringify(object, null, 4) : JSON.stringify(object)); + }, + + prependFile: function(file, content) { + this.write(file, content + this.read(file)); + }, + + appendFile: function(file, content) { + var fs = require('fs'), + fd = fs.openSync(file, 'a'); + + fs.writeSync(fd, content); + fs.closeSync(fd); + }, + + copyFile: function(src, destination) { + var fs = require('fs'), + path = require('path'); + + if (!path.existsSync(destination)) { + this.mkdir(path.dirname(destination)); + } + + fs.writeFileSync(destination, fs.readFileSync(src)); + fs.chmodSync(destination, fs.statSync(src).mode.toString(8).substr(-3)); + }, + + removeDirectory: function(directory) { + var fs = require('fs'), + path = require('path'), + files, filePath, fileStats, i, filesLength; + + files = fs.readdirSync(directory); + filesLength = files.length; + + if (filesLength) { + for (i = 0; i < filesLength; i += 1) { + filePath = path.join(directory, files[i]); + + fileStats = fs.statSync(filePath); + + if (fileStats.isFile()) { + fs.unlinkSync(filePath); + } + else if (fileStats.isDirectory()) { + this.removeDirectory(filePath); + } + } + } + + fs.rmdirSync(directory); + }, + + copyDirectory: function(src, destination) { + var fs = require('fs'), + path = require('path'), + files, file, stats, i, ln, link, srcFile, destinationFile; +// +// try { +// if (fs.statSync(destination).isDirectory()) { +// this.removeDirectory(destination); +// } +// } +// catch (e) {} + + this.mkdir(destination); + + files = fs.readdirSync(src); + + for (i = 0,ln = files.length; i < ln; i++) { + file = files[i]; + srcFile = path.join(src, file); + destinationFile = path.join(destination, file); + + stats = fs.lstatSync(srcFile); + + if (stats.isDirectory()) { + this.copyDirectory(srcFile, destinationFile); + } + else if (stats.isSymbolicLink()) { + try { + link = fs.readlinkSync(srcFile); + fs.symlinkSync(link, destinationFile); + } + catch (e) {} + } + else { + this.copyFile(srcFile, destinationFile); + } + } + }, + + checksum: function(file) { + var hash = require('crypto').createHash('sha1'); + + hash.update(this.read(file)); + + return hash.digest('hex'); + }, + + copy: function(src, destination) { + if (require('fs').statSync(src).isDirectory()) { + return this.copyDirectory(src, destination); + } + else { + return this.copyFile(src, destination); + } + } +}); diff --git a/sencha/sdk/command/src/module/Generate.js b/sencha/sdk/command/src/module/Generate.js new file mode 100644 index 0000000..5363075 --- /dev/null +++ b/sencha/sdk/command/src/module/Generate.js @@ -0,0 +1,71 @@ +Ext.define('Command.module.Generate', { + extend: 'Command.module.Abstract', + + description: 'Automates the generation of projects and files', + + actions: { + app: [ + "Generate a new project with the recommended structure", + ['name', 'n', 'The namespace of the application to create. ' + + 'This will be used as the prefix for all your classes', 'string', null, 'MyApp'], + ['path', 'p', 'The directory path to generate this application to.', 'string', null, '/path/to/myapp'], + ['library', 'l', "The library's build to develop your application with, either 'core' or 'all'. " + + "Defaults to 'core'." + + "\n " + + "+ Use 'all' if your application make use of almost every class available in the whole framework" + + "\n " + + "+ Use 'core' if your application only make use of a portion of the framework. " + + "\n " + + "When you deploy the application, it only includes exactly what it needs.", + 'string', 'core', 'all'] + ], + model: [ + "Generate a Model for an existing project", + ['name', 'n', 'The name of the Model to create', 'string', null, 'User'], + ['fields', 'f', 'The set of fields to add to the Model', 'array', null, 'id:int,name,email'] + ], + controller: [ + "Generate a Controller for an existing project", + ['name', 'n', 'The name of the Controller to create', 'string', null, 'User'] + ], + profile: [ + "Generate a Profile for an existing project", + ['name', 'n', 'The name of the Profile to create', 'string', null, 'Phone'] + ] + // form: [ + // "Generate a Form for an existing project", + // ['name', 'n', 'The name of the Form to create', 'string', null, 'User'], + // ['fields', 'f', 'The set of fields to add to the Form', 'string', null, 'name:string,email:email,message:string'] + // ] + }, + + /** + * For each action defined above we automatically create the function that invokes its generator. This just creates + * those functions, passing the arguments in as an object instead of an array + */ + constructor: function() { + var actions = this.actions, + actionName; + + for (actionName in actions) { + this[actionName] = function(actionName) { + return function() { + var params = this.actions[actionName].slice(1), + length = params.length, + args = [], + paramName, i; + + for (i = 0; i < length; i++) { + paramName = params[i][0]; + + args[paramName] = arguments[i]; + } + + Ext.create('Command.module.generate.' + Ext.String.capitalize(actionName), args, this.cli); + }; + }(actionName); + } + + this.callParent(arguments); + } +}); diff --git a/sencha/sdk/command/src/module/Manifest.js b/sencha/sdk/command/src/module/Manifest.js new file mode 100644 index 0000000..40837c6 --- /dev/null +++ b/sencha/sdk/command/src/module/Manifest.js @@ -0,0 +1,156 @@ +/** + * @class Command.module.Manifest + * @author Jacky Nguyen + */ +Ext.define('Command.module.Manifest', { + extend: 'Command.module.Abstract', + + description: 'Extract class metadata', + + actions: { + create: [ + "Generate a list of metadata for all classes found in the given directories", + ['path', 'p', 'The directory path(s) that contains all classes', 'array', null, '/path/to/src,/path/to/another/src'], + ['output', 'o', 'The file path to write the results to in JSON format.', 'string', null, 'metadata.json'] + ] + }, + + compareAst: function(branch, matcher) { + var i, ln, toBranch, fromBranch; + + for (i = 0,ln = matcher.length; i < ln; i++) { + toBranch = matcher[i]; + fromBranch = branch[i]; + + if (Ext.isArray(toBranch)) { + if (!this.compareAst(fromBranch, toBranch)) { + return false; + } + } + else { + if (toBranch !== undefined && toBranch !== fromBranch) { + return false; + } + } + } + + return true; + }, + + walkAst: function(ast, matcher, single, matches) { + var i, ln, block; + + if (!single && !matches) { + matches = []; + } + + for (i = 0, ln = ast.length; i < ln; i++) { + block = ast[i]; + + if (Ext.isArray(block)) { + if (this.compareAst(block, matcher)) { + if (!single) { + matches.push(block); + } + else { + return block; + } + } + + if (!single) { + this.walkAst(block, matcher, single, matches); + } + else { + return this.walkAst(block, matcher, single, matches); + } + } + } + + return matches || null; + }, + + create: function(paths, output) { + var uglifyjs = require('uglify-js'), + findit = require('findit'), + fsModule = this.getModule('fs'), + fileNameMatcher = /\.js$/, + parser = uglifyjs.parser, + assembler = uglifyjs.uglify, + properties = { + extend: true, + singleton: true, + requires: true, + alias: true, + mixins: true, + alternateClassName: true + }, + defineMatcher = [ + "stat", + [ + "call", + [ + "dot", + [ + "name", + "Ext" + ], + "define" + ], + [ + [ + "string", + undefined + ], + [ + "object" + ] + ] + ] + ], + results = [], + ast, files, + match, body, metadata; + + paths.forEach(function(path) { + files = findit.sync(path); + + files.forEach(function(file) { + if (fileNameMatcher.test(file)) { + try { + ast = parser.parse(fsModule.read(file)); + } + catch (e) { + throw new Error(require('util').format( + "Failed parsing file: %s\nReason: %s\nLine: %s\nColumn: %s", + file, e.message, e.line, e.col + )); + } + + match = this.walkAst(ast, defineMatcher, true); + + if (match) { + metadata = {}; + metadata.name = match[1][2][0][1]; + + body = match[1][2][1][1]; + + body.forEach(function(property) { + if (properties.hasOwnProperty(property[0])) { + metadata[property[0]] = eval("(" + assembler.gen_code(property[1]) + ")"); + } + }); + + results.push(metadata); + } + } + }, this); + + }, this); + + if (output) { + fsModule.write(output, JSON.stringify(results, null, 4)); + } + + return output; + } +}); diff --git a/sencha/sdk/command/src/module/Package.js b/sencha/sdk/command/src/module/Package.js new file mode 100644 index 0000000..38a5288 --- /dev/null +++ b/sencha/sdk/command/src/module/Package.js @@ -0,0 +1,61 @@ +Ext.define('Command.module.Package', { + extend: 'Command.module.Abstract', + description: "Packages a Sencha Touch 2 application for native app stores", + + actions: { + generate: [ + "Generates a Packager configuration JSON file", + ['path', 'p', 'What to call the configuration file', 'string', 'packager.json', 'myconfigfile.json'] + ], + + build: [ + "Packages an app with the given configuration JSON file", + ['path', 'p', 'What to call the configuration file', 'string', 'packager.json', 'myconfigfile.json'] + ], + + run: [ + "Packages and tries to run the application for the given configuration JSON file", + ['path', 'p', 'What to call the configuration file', 'string', 'packager.json', 'myconfigfile.json'] + ] + }, + + generate: function(fileName) { + this.exec('stbuild generate %s', [fileName], function(error, stdout, stderr) { + if (stdout) { + this.info(stdout); + } + + if (stderr) { + this.error(stderr); + } + }); + }, + + build: function(fileName) { + this.exec('stbuild package %s', [fileName], function(error, stdout, stderr) { + if (stdout) { + this.info(stdout); + } + + if (stderr) { + this.error(stderr); + } + }); + }, + + run: function(fileName, callback) { + this.exec('stbuild run %s', [fileName], function(error, stdout, stderr) { + if (callback) { + callback(); + } + + if (stdout) { + this.info(stdout); + } + + if (stderr) { + this.error(stderr); + } + }); + } +}); diff --git a/sencha/sdk/command/src/module/Project.js b/sencha/sdk/command/src/module/Project.js new file mode 100644 index 0000000..40b9034 --- /dev/null +++ b/sencha/sdk/command/src/module/Project.js @@ -0,0 +1,82 @@ +Ext.define('Command.module.Project', { + extend: 'Command.module.Abstract', + + description: 'Utility actions to work a project', + + actions: { + create: [ + "Generate a new project with the recommended structure", + ['name', 'p', 'The name of the application to create', 'string', null, 'MyApp'] + ] + }, + + constructor: function() { + this.templates = {}; + + this.callParent(arguments); + }, + + create: function(name) { + this.args = { + name: name + }; + + console.log(this.args); + + this.createDirectories(name); + this.copyFiles(name); + + }, + + createDirectories: function(name) { + var fs = require('fs'), + path = require('path'); + + fs.mkdirSync(name); + + fs.mkdirSync(path.join(name, 'app')); + fs.mkdirSync(path.join(name, 'app', 'model')); + fs.mkdirSync(path.join(name, 'app', 'view')); + fs.mkdirSync(path.join(name, 'app', 'controller')); + fs.mkdirSync(path.join(name, 'app', 'store')); + fs.mkdirSync(path.join(name, 'app', 'profile')); + + fs.mkdirSync(path.join(name, 'deploy')); + }, + + template: function(template, destination) { + var fs = require('fs'), + path = require('path'); + + template = this.getTemplate(template); + + console.log(template.apply(this.args)); + + fs.writeFile(path || template, template.apply(this.args)); + }, + + copyFiles: function(name) { + var fs = require('fs'), + path = require('path'); + + this.template('index.html') + }, + + getTemplate: function(name) { + var templates = this.templates, + template = templates[name], + filePath; + + if (!template) { + filePath = require('path').resolve(this.cli.getCurrentPath(), 'src/module/Project/templates/' + name + '.tpl'); + templates[name] = template = Ext.create('Ext.XTemplate', this.getModule('fs').read(filePath)); + } + + return template; + } +}); + +// this.log("Generate application at " + path + " with namespace: " + namespace); +// this.info("Generate application at " + path + " with namespace: " + namespace); +// this.warn("Generate application at " + path + " with namespace: " + namespace); +// this.error("Generate application at " + path + " with namespace: " + namespace); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/Test.js b/sencha/sdk/command/src/module/Test.js new file mode 100644 index 0000000..96b1c6b --- /dev/null +++ b/sencha/sdk/command/src/module/Test.js @@ -0,0 +1,22 @@ +/** + * @class Command.module.Test + * @author Jacky Nguyen + */ +Ext.define('Command.module.Test', { + extend: 'Command.module.Abstract', + + description: 'Unit testing using Jasmine', + + actions: { + run: [ + "Run Jasmine's unit tests", + ['path', 'p', 'The *absolute* path to the directory that contains all spec files', 'string', null, '/path/to/specs'], + ['verbose', 'v', 'Whether to print extra information per each test run', 'boolean', false, 'yes'], + ['color', 'c', 'Whether to use color coding for output', 'boolean', true, 'no'] + ] + }, + + run: function(path, verbose, color) { + require('jasmine-node').executeSpecsInFolder(path, Ext.emptyFn, verbose, color); + } +}); diff --git a/sencha/sdk/command/src/module/generate/App.js b/sencha/sdk/command/src/module/generate/App.js new file mode 100644 index 0000000..0c65389 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App.js @@ -0,0 +1,68 @@ +Ext.define('Command.module.generate.App', { + extend: 'Command.module.generate.Generator', + + description: 'Automates the generation of a new project', + + getUniqueId: function() { + return require('node-uuid').v1(); + }, + + execute: function(args) { + var path = require('path'), + fs = this.cli.getModule('fs'), + cwd = process.cwd(), + sdkVersionFile = path.join(cwd, 'version.txt'), + sdkVersion = new Ext.Version(require('fs').readFileSync(sdkVersionFile, 'utf8').trim()), + appPath = path.resolve(args.path); + + this.mkdir( + appPath, + path.join(appPath, 'app'), + path.join(appPath, 'app', 'model'), + path.join(appPath, 'app', 'view'), + path.join(appPath, 'app', 'controller'), + path.join(appPath, 'app', 'store'), + path.join(appPath, 'app', 'profile'), + path.join(appPath, 'sdk'), + path.join(appPath, 'sdk', 'command'), + path.join(appPath, 'sdk', 'src'), + path.join(appPath, 'sdk', 'resources'), + path.join(appPath, 'resources'), + path.join(appPath, 'resources', 'css'), + path.join(appPath, 'resources', 'images'), + path.join(appPath, 'resources', 'icons'), + path.join(appPath, 'resources', 'sass') + ); + + this.template('.senchasdk', path.join(appPath, '.senchasdk')); + this.template('index.html', path.join(appPath, 'index.html')); + this.template('app.js', path.join(appPath, 'app.js')); + this.template('packager.json', path.join(appPath, 'packager.json')); + this.template('app.json', path.join(appPath, 'app.json'), { + name: args.name, + sdkShortVersion: sdkVersion.getShortVersion(), + sdkVersion: sdkVersion.toString(), + library: args.library, + uniqueId: this.getUniqueId() + }); + this.template('app/view/Main.js', path.join(appPath, 'app', 'view', 'Main.js')); + + this.directory(path.join(cwd, 'src'), path.join(appPath, 'sdk', 'src')); + this.directory(path.join(cwd, 'resources'), path.join(appPath, 'sdk', 'resources')); + this.directory(path.join(cwd, 'command', 'src', 'module', 'generate', 'App', 'resources', 'icons'), path.join(appPath, 'resources', 'icons')); + this.directory(path.join(cwd, 'command', 'src', 'module', 'generate', 'App', 'resources', 'loading'), path.join(appPath, 'resources', 'loading')); + this.directory(path.join(cwd, 'command'), path.join(appPath, 'sdk', 'command')); + + this.file(path.join(cwd, 'microloader/development.js'), path.join(appPath, 'sdk', 'microloader/development.js')); + this.file(path.join(cwd, 'microloader/testing.js'), path.join(appPath, 'sdk', 'microloader/testing.js')); + this.file(path.join(cwd, 'microloader/production.js'), path.join(appPath, 'sdk', 'microloader/production.js')); + + this.file(path.join(cwd, 'version.txt'), path.join(appPath, 'sdk', 'version.txt')); + this.file(path.join(cwd, 'sencha-touch-debug.js'), path.join(appPath, 'sdk', 'sencha-touch.js')); + this.file(path.join(cwd, 'sencha-touch-all-debug.js'), path.join(appPath, 'sdk', 'sencha-touch-all.js')); + + this.template('resources/sass/app.scss', path.join(appPath, 'resources' , 'sass', 'app.scss')); + this.template('resources/sass/config.rb', path.join(appPath, 'resources' , 'sass', 'config.rb')); + this.file(path.join(cwd, 'resources/css-debug/sencha-touch.css'), path.join(appPath, 'resources', 'css', 'app.css')); + } +}); diff --git a/sencha/sdk/command/src/module/generate/App/.senchasdk.tpl b/sencha/sdk/command/src/module/generate/App/.senchasdk.tpl new file mode 100644 index 0000000..5a43536 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/.senchasdk.tpl @@ -0,0 +1 @@ +sdk diff --git a/sencha/sdk/command/src/module/generate/App/app.js.tpl b/sencha/sdk/command/src/module/generate/App/app.js.tpl new file mode 100644 index 0000000..aabe91e --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/app.js.tpl @@ -0,0 +1,43 @@ +// +Ext.Loader.setPath({ + 'Ext': 'sdk/src' +{[ "\}"]}); +// + +Ext.application({ + name: '{name}', + + requires: [ + 'Ext.MessageBox' + ], + + views: ['Main'], + + icon: { + 57: 'resources/icons/Icon.png', + 72: 'resources/icons/Icon~ipad.png', + 114: 'resources/icons/Icon@2x.png', + 144: 'resources/icons/Icon~ipad@2x.png' + {[ "\}"]}, + + phoneStartupScreen: 'resources/loading/Homescreen.jpg', + tabletStartupScreen: 'resources/loading/Homescreen~ipad.jpg', + + launch: function() { + // Destroy the #appLoadingIndicator element + Ext.fly('appLoadingIndicator').destroy(); + + // Initialize the main view + Ext.Viewport.add(Ext.create('{name}.view.Main')); + {[ "\}"]}, + + onUpdated: function() { + Ext.Msg.confirm( + "Application Update", + "This application has just successfully been updated to the latest version. Reload now?", + function() { + window.location.reload(); + {[ "\}"]} + ); + {[ "\}"]} +{[ "\}"]}); diff --git a/sencha/sdk/command/src/module/generate/App/app.json.tpl b/sencha/sdk/command/src/module/generate/App/app.json.tpl new file mode 100644 index 0000000..9e88847 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/app.json.tpl @@ -0,0 +1,112 @@ +{ + /** + * The application's namespace, used by Sencha Command to generate classes + */ + "name": "{name}", + + /** + * List of all JavaScript assets in the right execution order. + * Each item is an object with the following format: + * { + * "path": "path/to/script.js" // Relative path to this app.json file + * "update": "delta" // (Optional) + * // - If not specified, this file will only be loaded once, and + * // cached inside localStorage until this value is changed. + * // - "delta" to enable over-the-air delta update for this file + * // - "full" means full update will be made when this file changes + * + * {[ "\}"]} + */ + "js": [ + { + "path": "sdk/sencha-touch-all.js" + {[ "\}"]}, + { + "path": "app.js", + "update": "delta" + {[ "\}"]} + ], + + /** + * List of all CSS assets in the right inclusion order. + * Each item is an object with the following format: + * { + * "path": "path/to/item.css" // Relative path to this app.json file + * "update": "delta" // (Optional) + * // - If not specified, this file will only be loaded once, and + * // cached inside localStorage until this value is changed to either one below + * // - "delta" to enable over-the-air delta update for this file + * // - "full" means full update will be made when this file changes + * + * {[ "\}"]} + */ + "css": [ + { + "path": "resources/css/app.css", + "update": "delta" + {[ "\}"]} + ], + + /** + * Used to automatically generate cache.manifest (HTML 5 application cache manifest) file when you build + */ + "appCache": { + /** + * List of items in the CACHE MANIFEST section + */ + "cache": [ + "index.html" + ], + /** + * List of items in the NETWORK section + */ + "network": [ + "*" + ], + /** + * List of items in the FALLBACK section + */ + "fallback": [] + {[ "\}"]}, + + /** + * Extra resources to be copied along when build + */ + "extras": [ + "resources/images", + "resources/icons", + "resources/loading" + ], + + /** + * Directory path to store all previous production builds. Note that the content generated inside this directory + * must be kept intact for proper generation of delta between updates + */ + "archivePath": "archive", + + /** + * Default paths to build this application to for each environment + */ + "buildPaths": { + "testing": "build/testing", + "production": "build/production", + "package": "build/package", + "native": "build/native" + {[ "\}"]}, + + /** + * Build options + */ + "buildOptions": { + "product": "touch", + "minVersion": 3, + "debug": false, + "logger": "no" + {[ "\}"]}, + + /** + * Uniquely generated id for this application, used as prefix for localStorage keys. + * Normally you should never change this value. + */ + "id": "{uniqueId}" +{[ "\}"]} diff --git a/sencha/sdk/command/src/module/generate/App/app/view/Main.js.tpl b/sencha/sdk/command/src/module/generate/App/app/view/Main.js.tpl new file mode 100644 index 0000000..d38d872 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/app/view/Main.js.tpl @@ -0,0 +1,47 @@ +Ext.define("{name}.view.Main", { + extend: 'Ext.tab.Panel', + requires: ['Ext.TitleBar'], + + config: { + tabBarPosition: 'bottom', + + items: [ + { + title: 'Welcome', + iconCls: 'home', + + styleHtmlContent: true, + scrollable: true, + + items: { + docked: 'top', + xtype: 'titlebar', + title: 'Welcome to Sencha Touch 2' + {[ "\}"]}, + + html: [ + "You've just generated a new Sencha Touch 2 project. What you're looking at right now is the ", + "contents of app/view/Main.js - edit that file ", + "and refresh to change what's rendered here." + ].join("") + }, + { + title: 'Get Started', + iconCls: 'action', + + items: [ + { + docked: 'top', + xtype: 'titlebar', + title: 'Getting Started' + {[ "\}"]}, + { + xtype: 'video', + url: 'http://av.vimeo.com/64284/137/87347327.mp4?token=1330978144_f9b698fea38cd408d52a2393240c896c', + posterUrl: 'http://b.vimeocdn.com/ts/261/062/261062119_640.jpg' + {[ "\}"]} + ] + {[ "\}"]} + ] + {[ "\}"]} +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/App/index.html.tpl b/sencha/sdk/command/src/module/generate/App/index.html.tpl new file mode 100644 index 0000000..8d749d2 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/index.html.tpl @@ -0,0 +1,76 @@ + + + + + {name} + + + + +
+
+
+
+
+ + diff --git a/sencha/sdk/command/src/module/generate/App/packager.json.tpl b/sencha/sdk/command/src/module/generate/App/packager.json.tpl new file mode 100644 index 0000000..ae51b14 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/packager.json.tpl @@ -0,0 +1,126 @@ +{ + /** + * @cfg {String{[ "\}"]} applicationName + * @required + * This is the name of your application, which is displayed on the device when the app is installed. On IOS, this should match + * the name of your application in the Apple Provisioning Portal. + */ + "applicationName":"My Application", + + /** + * @cfg {String{[ "\}"]} applicationId + * This is the name namespace for your application. On IOS, this should match the name of your application in the Apple Provisioning Portal. + */ + "applicationId":"com.mycompany.myAppID", + + /** + * @cfg {String{[ "\}"]} versionString + * @required + * This is the version of your application. + */ + "versionString":"1.0", + + /** + * @cfg {String{[ "\}"]} iconName + * This is file name of your icon. This should be in the same directory of this configuration file. + * + * For iOS, please refer to their documentation about icon sizes: + * https://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html + * + * For Android, please refer to the Google Launcher icons guide: + * http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html + */ + "iconName":"resources/icons/Icon~ipad.png", + + /** + * @cfg {String{[ "\}"]} inputPath + * @required + * This is location of your Sencha Touch 2 application, relative to this configuration file. + */ + "inputPath":"build/native", + + /** + * @cfg {String{[ "\}"]} outputPath + * @required + * This is where the built application file with be saved. + */ + "outputPath":"build/", + + /** + * @cfg {String{[ "\}"]} configuration + * @required + * This is configuration for your application. `Debug` should always be used unless you are submitting your app to an online + * store - in which case `Release` should be specified. + */ + "configuration":"Debug", + + /** + * @cfg {String{[ "\}"]} platform + * @required + * This is the platform where you will be running your application. Available options are: + * - iOSSimulator + * - iOS + * - Android + * - AndroidEmulator + */ + "platform":"iOSSimulator", + + /** + * @cfg {String{[ "\}"]} deviceType + * @required + * This is device type that your application will be running on. + * + * If you are developing for Android, this is not necessary. + * + * Available options are: + * - iPhone + * - iPad + * - Universal + */ + "deviceType":"Universal", + + /** + * @cfg {String{[ "\}"]} certificatePath + * This is the location of your certificate. + * This is required when you are developing for Android or you are developing on Windows. + */ + "certificatePath":"/path/to/certificate.file", + + /** + * @cfg {String{[ "\}"]} certificateAlias + * This is the name of your certificate. + * + * IF you do not specify this on OSX, we will try and automatically find the certificate for you using the applicationId. + * + * This can be just a simple matcher. For example, if your certificate name is "iPhone Developer: Robert Dougan (ABCDEFGHIJ)", you + * can just put "iPhone Developer". + * + * When using a certificatePath on Windows, you do not need to specify this. + */ + "certificateAlias":"", + + /** + * @cfg {String{[ "\}"]} sdkPath + * This is the path to the Android SDK, if you are developing an Android application. + */ + "sdkPath":"/path/to/android-sdk", + + /** + * @cfg {String} androidAPILevel + * This is android API level, the version of Android SDK to use, you can read more about it here: http://developer.android.com/guide/appendix/api-levels.html. + * Be sure to install corresponding platform API in android SDK manager (android_sdk/tools/android) + */ + "androidAPILevel":"15", + + /** + * @cfg {Array[String]} orientations + * @required + * This is orientations that this application can run. + */ + "orientations": [ + "portrait", + "landscapeLeft", + "landscapeRight", + "portraitUpsideDown" + ] +{[ "\}"]} diff --git a/sencha/sdk/command/src/module/generate/App/resources/icons/Icon.png b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon.png new file mode 100644 index 0000000..c23d27d Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/icons/Icon@2x.png b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon@2x.png new file mode 100644 index 0000000..4211d8b Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon@2x.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/icons/Icon~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon~ipad.png new file mode 100644 index 0000000..28a757d Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/icons/Icon~ipad@2x.png b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon~ipad@2x.png new file mode 100644 index 0000000..31ca9df Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/icons/Icon~ipad@2x.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/icons/iTunesArtwork.png b/sencha/sdk/command/src/module/generate/App/resources/icons/iTunesArtwork.png new file mode 100644 index 0000000..64ce220 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/icons/iTunesArtwork.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/icons/icon-spot~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/icons/icon-spot~ipad.png new file mode 100644 index 0000000..0cc2646 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/icons/icon-spot~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default-LandscapeLeft~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-LandscapeLeft~ipad.png new file mode 100644 index 0000000..30f6f2d Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-LandscapeLeft~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default-LandscapeRight~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-LandscapeRight~ipad.png new file mode 100644 index 0000000..c959144 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-LandscapeRight~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default-Landscape~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-Landscape~ipad.png new file mode 100644 index 0000000..d540812 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-Landscape~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default-PortraitUpsideDown~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-PortraitUpsideDown~ipad.png new file mode 100644 index 0000000..67d45ce Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-PortraitUpsideDown~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default-Portrait~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-Portrait~ipad.png new file mode 100644 index 0000000..1ae4343 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default-Portrait~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default.png new file mode 100644 index 0000000..0ed9f67 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default@2x.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default@2x.png new file mode 100644 index 0000000..7d798a7 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default@2x.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Default~ipad.png b/sencha/sdk/command/src/module/generate/App/resources/loading/Default~ipad.png new file mode 100644 index 0000000..163f4c5 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Default~ipad.png differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Homescreen.jpg b/sencha/sdk/command/src/module/generate/App/resources/loading/Homescreen.jpg new file mode 100644 index 0000000..d246bc6 Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Homescreen.jpg differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/loading/Homescreen~ipad.jpg b/sencha/sdk/command/src/module/generate/App/resources/loading/Homescreen~ipad.jpg new file mode 100644 index 0000000..7f9b01b Binary files /dev/null and b/sencha/sdk/command/src/module/generate/App/resources/loading/Homescreen~ipad.jpg differ diff --git a/sencha/sdk/command/src/module/generate/App/resources/sass/app.scss.tpl b/sencha/sdk/command/src/module/generate/App/resources/sass/app.scss.tpl new file mode 100644 index 0000000..4d1ffab --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/resources/sass/app.scss.tpl @@ -0,0 +1,19 @@ +@import 'sencha-touch/default/all'; + +// You may remove any of the following modules that you +// do not use in order to create a smaller css file. +@include sencha-panel; +@include sencha-buttons; +@include sencha-sheet; +@include sencha-picker; +@include sencha-tabs; +@include sencha-toolbar; +@include sencha-toolbar-forms; +@include sencha-indexbar; +@include sencha-list; +@include sencha-layout; +@include sencha-carousel; +@include sencha-form; +@include sencha-msgbox; + +// Your custom code goes here... \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/App/resources/sass/config.rb.tpl b/sencha/sdk/command/src/module/generate/App/resources/sass/config.rb.tpl new file mode 100644 index 0000000..bf95855 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/App/resources/sass/config.rb.tpl @@ -0,0 +1,14 @@ +# Get the directory that this configuration file exists in +dir = File.dirname(__FILE__) + +# Load the sencha-touch framework automatically. +load File.join(dir, '..', '..', 'sdk', 'resources', 'themes') + +# Compass configurations +sass_path = dir +css_path = File.join(dir, "..", "css") + +# Require any additional compass plugins here. +images_dir = File.join(dir, "..", "images") +output_style = :compressed +environment = :production diff --git a/sencha/sdk/command/src/module/generate/Controller.js b/sencha/sdk/command/src/module/generate/Controller.js new file mode 100644 index 0000000..1f1f32f --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Controller.js @@ -0,0 +1,21 @@ +Ext.define('Command.module.generate.Controller', { + extend: 'Command.module.generate.Generator', + + description: 'Automates the generation of a new Controller', + + execute: function(args) { + var path = require('path'), + proj = this.getProjectDetails(); + + args = Ext.applyIf(args, proj); + args.appName = proj.name; + + this.mkdir( + path.join('app'), + path.join('app', 'controller') + ); + + this.template('controller.js', path.join('app', 'controller', args.name + '.js')); + this.addToApp('controllers', args.name); + } +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Controller/controller.js.tpl b/sencha/sdk/command/src/module/generate/Controller/controller.js.tpl new file mode 100644 index 0000000..c9ead40 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Controller/controller.js.tpl @@ -0,0 +1,17 @@ +Ext.define('{appName}.controller.{name}', { + extend: 'Ext.app.Controller', + + config: { + refs: { + + {[ "\}"]}, + control: { + + {[ "\}"]} + {[ "\}"]}, + + //called when the Application is launched, remove if not needed + launch: function(app) { + + {[ "\}"]} +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Form.js b/sencha/sdk/command/src/module/generate/Form.js new file mode 100644 index 0000000..392ddde --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Form.js @@ -0,0 +1,36 @@ +Ext.define('Command.module.generate.Form', { + extend: 'Command.module.generate.Generator', + + description: 'Automates the generation of a new Form', + + execute: function() { + var path = require('path'), + fields = this.args.fields.split(','), + length = fields.length, + i; + + //parse fields + for (i = 0; i < length; i++) { + splits = fields[i].split(":"); + + fields[i] = { + name: splits[0], + type: splits[1] || 'text', + label: Ext.String.capitalize(splits[0]) + }; + } + + Ext.apply(this.args, { + fields: fields, + xtype: this.args.name.toLowerCase() + }); + + this.mkdir( + path.join('app'), + path.join('app', 'view') + ); + + this.template('form.js', path.join('app', 'view', this.args.name + '.js')); + this.addToApp('views', this.args.name); + } +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Form/form.js.tpl b/sencha/sdk/command/src/module/generate/Form/form.js.tpl new file mode 100644 index 0000000..6b3f475 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Form/form.js.tpl @@ -0,0 +1,21 @@ +Ext.define('{appName}.view.{name}', { + extend: 'Ext.form.FieldSet', + xtype: '{xtype}', + + config: { + title: '{name}', + + items: [ + { + name: '{name}', + xtype: '{type}field', + label: '{label}' + }, + { + xtype: 'button', + text: 'Submit', + ui: 'confirm' + } + ] + } +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Generator.js b/sencha/sdk/command/src/module/generate/Generator.js new file mode 100644 index 0000000..1a0b657 --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Generator.js @@ -0,0 +1,106 @@ +Ext.define('Command.module.generate.Generator', { + constructor: function(args, cli) { + this.templates = {}; + this.args = Ext.applyIf(args, this.getProjectDetails()); + this.cli = cli; + + this.execute(args); + }, + + template: function(templateName, destination, args) { + var fs = require('fs'), + path = require('path'), + template = this.getTemplate(templateName); + + args = args || this.args; + + template = this.getTemplate(templateName); + + fs.writeFile(destination, template.apply(args)); + this.cli.info('Created file ' + destination); + }, + + getTemplate: function(name) { + var templates = this.templates, + template = templates[name], + + splits = this.$className.split('.'), + className = splits[splits.length - 1], + templateDir = require('path').join('src', 'module', 'generate', className, name + '.tpl'), + filePath; + + if (!template) { + filePath = require('path').resolve(this.cli.getCurrentPath(), templateDir); + templates[name] = template = Ext.create('Ext.XTemplate', this.cli.getModule('fs').read(filePath)); + } + + return template; + }, + + mkdir: function() { + this.cli.getModule('fs').mkdir.apply(this.cli, arguments); + }, + + file: function(src, destination, log) { + this.cli.getModule('fs').copyFile(src, destination); + + if (log !== false) { + this.cli.info('Copied file: ' + destination); + } + }, + + directory: function(src, destination, log) { + this.cli.getModule('fs').copyDirectory(src, destination); + + if (log !== false) { + this.cli.info('Copied dir: ' + destination); + } + }, + + getProjectDetails: function() { + var details = {}; + + try { + details = Ext.JSON.decode(require('fs').readFileSync('app.json')); + } catch(e) {} + + details.appName = details.name; + + return details; + }, + + /** + * Adds an item to the app.js definition, usage: + * this.addToApp('models', "MyModel"); + * This will look for a "models: [*]" in your app.js, prepending to it if it's already present, or creating it if not + * @param {String} section The section to add to (e.g. 'models', 'views', 'controllers') + * @param {String} item The name of the class to add + * @param {Boolean} log Pass false to suppress logging + */ + addToApp: function(section, item, log) { + var fs = require('fs'), + file = fs.readFileSync('app.js').toString(); + + //if this section isn't present at all + if (!file.match(section + "\\s*\\:")) { + file = file.replace(/(Ext.application\(\{\n)/, "$1 " + section + ': ["' + item + '"],\n\n'); + } + + //if the section is present and empty + else if (file.match(section + "\\s*\\:\\s*\\[\\s*\n*\]")) { + file = file.replace(new RegExp("(" + section + "\\s*\\:\\s*\\[)",'g'), '$1"' + item + '"'); + } + + //if the seconds if present and not empty + // else if (file.match(section + "\\s*\\:\\s*\\[\\" + '"' + "+]")) { + else { + file = file.replace(new RegExp("(" + section + "\\s*\\:\\s*\\[)",'g'), '$1"' + item + '", '); + } + + if (log !== false) { + this.cli.info('Adding ' + item + ' into app.js'); + } + + fs.writeFileSync('app.js', file); + } +}); diff --git a/sencha/sdk/command/src/module/generate/Model.js b/sencha/sdk/command/src/module/generate/Model.js new file mode 100644 index 0000000..f75ff5d --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Model.js @@ -0,0 +1,45 @@ +Ext.define('Command.module.generate.Model', { + extend: 'Command.module.generate.Generator', + + description: 'Automates the generation of a new Model', + + execute: function(args) { + var path = require('path'), + proj = this.getProjectDetails(); + + args = Ext.applyIf(args, proj); + args.appName = proj.name; + + var fields = args.fields, + length = fields.length, + field, splits, i; + + for (i = 0; i < length; i++) { + splits = fields[i].split(":"); + + if (splits.length == 2) { + field = { + name: splits[0], + type: splits[1] + }; + } else { + field = { + name: fields[i], + type: 'auto' + } + } + + fields[i] = field; + } + + args.fields = fields; + + this.mkdir( + path.join('app'), + path.join('app', 'model') + ); + + this.template('model.js', path.join('app', 'model', args.name + '.js')); + this.addToApp('models', args.name); + } +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Model/model.js.tpl b/sencha/sdk/command/src/module/generate/Model/model.js.tpl new file mode 100644 index 0000000..13cf89c --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Model/model.js.tpl @@ -0,0 +1,9 @@ +Ext.define('{appName}.model.{name}', { + extend: 'Ext.data.Model', + + config: { + fields: [ + {name: '{name}', type: '{type}'}{[xindex == xcount ? '' : ',']} + ] + } +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Profile.js b/sencha/sdk/command/src/module/generate/Profile.js new file mode 100644 index 0000000..001175a --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Profile.js @@ -0,0 +1,21 @@ +Ext.define('Command.module.generate.Profile', { + extend: 'Command.module.generate.Generator', + + description: 'Automates the generation of a new Profile', + + execute: function(args) { + var path = require('path'), + proj = this.getProjectDetails(); + + args = Ext.applyIf(args, proj); + args.appName = proj.name; + + this.mkdir( + path.join('app'), + path.join('app', 'profile') + ); + + this.template('profile.js', path.join('app', 'profile', args.name + '.js')); + this.addToApp('profiles', args.name); + } +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/module/generate/Profile/profile.js.tpl b/sencha/sdk/command/src/module/generate/Profile/profile.js.tpl new file mode 100644 index 0000000..ad95bde --- /dev/null +++ b/sencha/sdk/command/src/module/generate/Profile/profile.js.tpl @@ -0,0 +1,16 @@ +Ext.define('{appName}.profile.{name}', { + extend: 'Ext.app.Profile', + + //define any additional classes your Profile needs here + config: { + views: [], + models: [], + stores: [], + controllers: [] + {[ "\}"]}, + + //this profile will be activated if we detect we're running on a {name} + isActive: function(app) { + return Ext.os.is.{name}; + {[ "\}"]} +}); \ No newline at end of file diff --git a/sencha/sdk/command/src/preprocessor/LineStack.js b/sencha/sdk/command/src/preprocessor/LineStack.js new file mode 100644 index 0000000..0814df5 --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/LineStack.js @@ -0,0 +1,30 @@ +/** + * @class Command.preprocessor.LineStack + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.LineStack', { + constructor: function(filePath) { + this.stack = require('fs').readFileSync(filePath, 'utf8').split("\n"); + this.currentLineNumber = 0; + }, + + getCurrentLineNumber: function() { + return this.currentLineNumber; + }, + + isEmpty: function() { + return this.stack.length == 0; + }, + + shift: function() { + this.currentLineNumber++; + return this.stack.shift(); + }, + + unshift: function(line) { + this.currentLineNumber--; + this.stack.unshift(line); + + return this; + } +}); diff --git a/sencha/sdk/command/src/preprocessor/Statement.js b/sencha/sdk/command/src/preprocessor/Statement.js new file mode 100644 index 0000000..98d9647 --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/Statement.js @@ -0,0 +1,121 @@ +/** + * @class Command.preprocessor.Statement + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.Statement', { + requires: 'Command.Preprocessor', + + isInverted: false, + properties: {}, + buffer: '', + parent: null, + + statics: { + factory: function(type, properties, isInverted) { + var className, classFile, classReference, statement; + + if (Ext.isObject(type)) { + properties = type.properties; + isInverted = type.isInverted; + type = type.type; + } + + type = type.toLowerCase(); + + className = 'Command.preprocessor.statement.' + Ext.String.capitalize(type); + + classReference = Ext.ClassManager.get(className); + + if (!classReference) { + classFile = Ext.Loader.getPath(className); + + if (require('path').existsSync(classFile)) { + classReference = Ext.require(className); + } + else { + // Not supported + Ext.Logger.info("Statement type '" + type + "' is currently not supported, ignored"); + return false; + } + } + + statement = new classReference(properties, isInverted); + statement.type = type; + + return statement; + } + }, + + constructor: function(properties, isInverted) { + if (properties === undefined) { + properties = {}; + } + + if (isInverted === undefined) { + isInverted = false; + } + + this.properties = properties; + this.isInverted = isInverted; + }, + + setProperty: function(name, value) { + this.properties[name] = value; + }, + + getProperty: function(name) { + var properties = this.properties; + + return properties.hasOwnProperty(name) ? properties[name] : null; + }, + + removeProperty: function(name) { + delete this.properties[name]; + }, + + isEnd: function(line, lineStack) { + return this.preprocessor.isCloseOf(line, this); + }, + + pushBuffer: function(content, withNewLine) { + if (withNewLine === undefined) { + withNewLine = false; + } + + this.buffer += content + ((withNewLine) ? "\n" : ""); + }, + + resetBuffer: function() { + this.buffer = ''; + }, + + process: function(lineStack) { + var preprocessor = this.preprocessor, + line, subStatementData, subStatement; + + while (!lineStack.isEmpty()) { + line = lineStack.shift(); + + if (this.isEnd(line, lineStack)) { + break; + } + + if ((subStatementData = preprocessor.parseStatement(line)) && (subStatement = this.statics().factory(subStatementData))) { + subStatement.parent = this; + this.onSubStatement(subStatement, lineStack); + } + else { + this.pushBuffer(line, !lineStack.isEmpty()); + } + } + + return this.buffer; + }, + + onSubStatement: function(statement, lineStack) { + this.pushBuffer(statement.process(lineStack)); + } + +}, function() { + this.addMember('preprocessor', Command.Preprocessor.getInstance()); +}); diff --git a/sencha/sdk/command/src/preprocessor/statement/Debug.js b/sencha/sdk/command/src/preprocessor/statement/Debug.js new file mode 100644 index 0000000..839217f --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/statement/Debug.js @@ -0,0 +1,38 @@ +/** + * @class Command.preprocessor.statement.Debug + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.statement.Debug', { + extend: 'Command.preprocessor.statement.If', + + priorities: { + error: 3, + warn: 2, + info: 1 + }, + + constructor: function() { + var priorities = this.priorities, + priority, name; + + this.callParent(arguments); + + this.setProperty('debug', true); + + for (name in priorities) { + if (priorities.hasOwnProperty(name)) { + if (this.getProperty(name)) { + priority = priorities[name]; + this.removeProperty(name); + break; + } + } + } + + if (!priority) { + priority = 1; + } + + this.setProperty('debugLevel', '<=' + priority); + } +}); diff --git a/sencha/sdk/command/src/preprocessor/statement/Deprecated.js b/sencha/sdk/command/src/preprocessor/statement/Deprecated.js new file mode 100644 index 0000000..7cd78bc --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/statement/Deprecated.js @@ -0,0 +1,36 @@ +/** + * @class Command.preprocessor.statement.Deprecated + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.statement.Deprecated', { + extend: 'Command.preprocessor.statement.If', + + constructor: function() { + var since, product; + + this.callParent(arguments); + + since = this.getProperty('since'); + product = this.getProperty('product'); + + this.removeProperty('since'); + + if (since == null) { + this.setProperty('deprecated', 'true'); + return this; + // throw new Error("[Parser.Statement.Deprecated] 'since' property is required for deprecated statement"); + } + + if (product != null) { + if (this.preprocessor.evaluate('product', '=' + product)) { + this.removeProperty('product'); + } + else { + this.setProperty('product', '!' + product); + return; + } + } + + this.setProperty('minVersion', '<=' + since); + } +}); diff --git a/sencha/sdk/command/src/preprocessor/statement/Else.js b/sencha/sdk/command/src/preprocessor/statement/Else.js new file mode 100644 index 0000000..c0347d6 --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/statement/Else.js @@ -0,0 +1,18 @@ +/** + * @class Command.preprocessor.statement.Else + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.statement.Else', { + extend: 'Command.preprocessor.statement.If', + + isEnd: function(line, lineStack) { + var parent = this.parent; + + if (parent.isEnd.apply(parent, arguments)) { + lineStack.unshift(line); + return true; + } + + return false; + } +}); diff --git a/sencha/sdk/command/src/preprocessor/statement/Elseif.js b/sencha/sdk/command/src/preprocessor/statement/Elseif.js new file mode 100644 index 0000000..9e439fe --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/statement/Elseif.js @@ -0,0 +1,28 @@ +/** + * @class Command.preprocessor.statement.Elseif + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.statement.Elseif', { + extend: 'Command.preprocessor.statement.If', + + isEnd: function(line, lineStack) { + var isEnd = false, + parent = this.parent, + statement = this.preprocessor.parseStatement(line); + + if (statement) { + if (statement.type === 'elseif' || statement.type === 'else') { + isEnd = true; + } + } + else if (parent.isEnd.apply(parent, arguments)) { + isEnd = true; + } + + if (isEnd) { + lineStack.unshift(line); + } + + return isEnd; + } +}); diff --git a/sencha/sdk/command/src/preprocessor/statement/Feature.js b/sencha/sdk/command/src/preprocessor/statement/Feature.js new file mode 100644 index 0000000..a13ffed --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/statement/Feature.js @@ -0,0 +1,20 @@ +/** + * @class Command.preprocessor.statement.Feature + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.statement.Feature', { + extend: 'Command.preprocessor.statement.If', + + constructor: function() { + this.callParent(arguments); + + var properties = this.properties, + name; + + for (name in properties) { + if (properties.hasOwnProperty(name)) { + this.setProperty(name, '!no'); + } + } + } +}); diff --git a/sencha/sdk/command/src/preprocessor/statement/If.js b/sencha/sdk/command/src/preprocessor/statement/If.js new file mode 100644 index 0000000..a8fb623 --- /dev/null +++ b/sencha/sdk/command/src/preprocessor/statement/If.js @@ -0,0 +1,69 @@ +/** + * @class Command.preprocessor.statement.If + * @author Jacky Nguyen + */ +Ext.define('Command.preprocessor.statement.If', { + extend: 'Command.preprocessor.Statement', + + satisfied: false, + + evaluate: function() { + var ret = true, + preprocessor = this.preprocessor, + properties = this.properties, + name; + + for (name in properties) { + if (properties.hasOwnProperty(name) && !preprocessor.evaluate(name, properties[name])) { + ret = false; +// Logger.log('[DEBUG][Parser.Statement.If#evaluate] ' + ret + ' because "' + Parser.params[n] + '" doesn\'t evaluate to "' + this.properties[n] + '"'); + break; + } + } + + return (this.isInverted ? !ret : ret); + }, + + process: function(lineStack) { + if (this.evaluate()) { + this.satisfied = true; + } + + this.callParent(arguments); + + if (!this.satisfied) { + return ''; + } + + return this.buffer; + }, + + onSubStatement: function(statement, lineStack) { + var processed = statement.process(lineStack), + satisfied = false; + + if (statement.type === 'elseif') { + if (!this.satisfied) { + if (statement.evaluate()) { + this.satisfied = true; + satisfied = true; + } + } + } + else if (statement.type === 'else') { + if (!this.satisfied) { + this.satisfied = true; + satisfied = true; + } + } + else { + this.pushBuffer(processed); + return; + } + + if (satisfied) { + this.resetBuffer(); + this.pushBuffer(processed); + } + } +}); diff --git a/sencha/sdk/command/templates/action.tpl b/sencha/sdk/command/templates/action.tpl new file mode 100644 index 0000000..b263e76 --- /dev/null +++ b/sencha/sdk/command/templates/action.tpl @@ -0,0 +1,20 @@ + +\033[4mUsage:\033[24m + \033[31m\033[1msencha {module} {name} [arguments...]\033[22m\033[39m + +\033[4mDescription:\033[24m + {description} + +\033[4mArguments:\033[24m (\033[31m\033[1m*\033[22m\033[39m) denotes required parameter +{% var maxLength = 0; values.args.forEach(function(arg){ maxLength = Math.max(maxLength,arg[0].length) }); %} + -{[values[1]]}, --{[values[0]]}{[Array(maxLength - values[0].length + 1).join(" ")]} \033[31m\033[1m*\033[22m\033[39m {[values[2]]} + +\033[4mExamples:\033[24m + Long: + \033[31m\033[1msencha {module} {name} --{[values[0]]}={[values[5]]} \033[22m\033[39m + + Short: + \033[31m\033[1msencha {module} {name} -{[values[1]]} {[values[5]]} \033[22m\033[39m + + Shortest (arguments must be in the right order): + \033[31m\033[1msencha {module} {name} {[values[5]]} \033[22m\033[39m diff --git a/sencha/sdk/command/templates/actions.tpl b/sencha/sdk/command/templates/actions.tpl new file mode 100644 index 0000000..1605e66 --- /dev/null +++ b/sencha/sdk/command/templates/actions.tpl @@ -0,0 +1,19 @@ + +\033[4mUsage:\033[24m + \033[31m\033[1msencha {name} [action] [arguments...]\033[22m\033[39m + +\033[4mDescription:\033[24m + {description} + +\033[4mAvailable actions:\033[24m \033[24m(\033[31m\033[1m*\033[22m\033[39m) denotes required parameter + + \033[31m\033[1m{name}\033[22m\033[39m {description} + {% var maxLength = 0; values.args.forEach(function(arg){ maxLength = Math.max(maxLength,arg[0].length) }); %} + -{[values[1]]}, --{[values[0]]}{[Array(maxLength - values[0].length + 1).join(" ")]} \033[31m\033[1m*\033[22m\033[39m {[values[2]]} + + +For more information on a specific action, simply type: + sencha {name} [action] + +For example: + sencha {name} {[values.actions[0].name]} diff --git a/sencha/sdk/command/templates/cache.manifest.tpl b/sencha/sdk/command/templates/cache.manifest.tpl new file mode 100644 index 0000000..a30d962 --- /dev/null +++ b/sencha/sdk/command/templates/cache.manifest.tpl @@ -0,0 +1,9 @@ +CACHE MANIFEST +# {checksum} +{uri} + +FALLBACK: +{.} + +NETWORK: +{.} diff --git a/sencha/sdk/command/templates/modules.tpl b/sencha/sdk/command/templates/modules.tpl new file mode 100644 index 0000000..587d582 --- /dev/null +++ b/sencha/sdk/command/templates/modules.tpl @@ -0,0 +1,24 @@ +Sencha Command v{version} for Sencha Touch 2 +Copyright (c) 2012 Sencha Inc. + +\033[4mUsage:\033[24m + \033[31m\033[1msencha [module] [action] [arguments...]\033[22m\033[39m + +\033[4mExample:\033[24m + sencha fs minify --from app.js --to app-minified.js --compressor closurecompiler + +\033[4mAvailable modules:\033[24m + {% values.maxAliasLength = 0; values.modules.forEach(function(module){ values.maxAliasLength = Math.max(values.maxAliasLength, module.name.length) }); %} + \033[31m\033[1m{name}\033[22m\033[39m{[Array(parent.maxAliasLength - values.name.length + 1).join(" ")]} {description} + +For more information on a specific module, simply type: + sencha [module] + +For example: + sencha fs + +For more information on a specific action of a specific module, simply type: + sencha [module] [action] + +For example: + sencha fs minify diff --git a/sencha/sdk/command/test/unit/specs/PreprocessorSpec.js b/sencha/sdk/command/test/unit/specs/PreprocessorSpec.js new file mode 100644 index 0000000..3216745 --- /dev/null +++ b/sencha/sdk/command/test/unit/specs/PreprocessorSpec.js @@ -0,0 +1,92 @@ +describe("Command.Preprocessor", function() { + var preprocessor = Ext.create('Command.Preprocessor'); + + beforeEach(function() { + preprocessor.setParams({ + browser: 'ie', + browserVersion: 6, + version: 3.1, + minVersion: 2.0, + debug: true + }); + }); + + describe("evaluate()", function() { + it("Browser is IE", function() { + expect(preprocessor.evaluate('browser', 'ie')).toBe(true); + }); + + it("Browser is not firefox", function() { + expect(preprocessor.evaluate('browser', '!firefox')).toBe(true); + }); + + it("Browser version is greater than 5", function() { + expect(preprocessor.evaluate('browserVersion', '>5')).toBe(true); + }); + + it("Browser version is less than 7", function() { + expect(preprocessor.evaluate('browserVersion', '<7')).toBe(true); + }); + + it("Browser version is greater or equal to 6", function() { + expect(preprocessor.evaluate('browserVersion', '>=6')).toBe(true); + }); + + it("Nonexistent", function() { + expect(preprocessor.evaluate('nonexistent')).toBe(false); + }); + }); + + describe("isStatement()", function() { + it("// is a valid statement", function() { + expect(preprocessor.isStatement('//')).toBe(true); + }); + + it(" // (tab in front) is a valid statement", function() { + expect(preprocessor.isStatement(' //')).toBe(true); + }); + + it("// (spaces at the end) is a valid statement", function() { + expect(preprocessor.isStatement('// ')).toBe(true); + }); + + it("// is not a valid opening statement", function() { + expect(preprocessor.isStatement('//')).toBe(false); + }); + }); + + describe("isCloseOf()", function() { + it("// is valid close of if", function() { + expect(preprocessor.isCloseOf('//', { type: 'if', isInverted: false })).toBe(true); + }); + + it("// is valid close of inverted if", function() { + expect(preprocessor.isCloseOf('//', { type: 'if', isInverted: true })).toBe(true); + }); + }); + + describe("parseStatementProperties()", function() { + it("'browser=ie debug' => { browser: 'ie', debug: true }", function() { + expect(preprocessor.parseStatementProperties('browser=ie debug')).toEqual({ browser: 'ie', debug: true }); + }); + + it("'browser=\"ie\" browserVersion='!7' debug=false' " + + "=> { browser: 'ie', browserVersion: '!7', debug: \"false\" }", function() { + expect(preprocessor.parseStatementProperties('browser="ie" browserVersion=\'!7\' debug=false')).toEqual({ + browser: 'ie', + browserVersion: '!7', + debug: "false" + }); + }); + }); + + describe("parseStatement()", function() { + it("// => { properties: { since: '3.0' }, type: 'deprecated', isInverted: false }", function() { + expect(preprocessor.parseStatement('//')).toEqual({ + properties: { since: '3.0' }, + type: 'deprecated', + isInverted: false + }); + }); + }); +}); diff --git a/sencha/sdk/command/test/unit/specs/SampleSpec.js b/sencha/sdk/command/test/unit/specs/SampleSpec.js new file mode 100644 index 0000000..88db989 --- /dev/null +++ b/sencha/sdk/command/test/unit/specs/SampleSpec.js @@ -0,0 +1,9 @@ +describe('jasmine-node-flat', function() { + it('should pass', function() { + expect(1 + 2).toEqual(3); + }); + + it("should be ok", function() { + expect(Ext); + }); +}); diff --git a/sencha/sdk/command/test/unit/specs/preprocessor/statement/IfSpec.js b/sencha/sdk/command/test/unit/specs/preprocessor/statement/IfSpec.js new file mode 100644 index 0000000..9bf19fe --- /dev/null +++ b/sencha/sdk/command/test/unit/specs/preprocessor/statement/IfSpec.js @@ -0,0 +1,14 @@ +Ext.require('Command.preprocessor.statement.If'); + +describe("Command.preprocessor.statement.If", function() { + function readFile(name) { + return require('fs').readFileSync(require('path').resolve(__dirname, '../../../helpers/preprocessor/' + name), 'utf8'); + } + + var from = readFile('before1.js'), + to = readFile('after1.js'); + + it("should pass", function() { + + }); +}); diff --git a/sencha/sdk/command/vendor/closurecompiler/COPYING b/sencha/sdk/command/vendor/closurecompiler/COPYING new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/sencha/sdk/command/vendor/closurecompiler/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/sencha/sdk/command/vendor/closurecompiler/README b/sencha/sdk/command/vendor/closurecompiler/README new file mode 100644 index 0000000..e6d12c4 --- /dev/null +++ b/sencha/sdk/command/vendor/closurecompiler/README @@ -0,0 +1,292 @@ +/* + * Copyright 2009 The Closure Compiler Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// +// Contents +// + +The Closure Compiler performs checking, instrumentation, and +optimizations on JavaScript code. The purpose of this README is to +explain how to build and run the Closure Compiler. + +The Closure Compiler requires Java 6 or higher. +http://www.java.com/ + + +// +// Building The Closure Compiler +// + +There are three ways to get a Closure Compiler executable. + +1) Use one we built for you. + +Pre-built Closure binaries can be found at +http://code.google.com/p/closure-compiler/downloads/list + + +2) Check out the source and build it with Apache Ant. + +First, check out the full source tree of the Closure Compiler. There +are instructions on how to do this at the project site. +http://code.google.com/p/closure-compiler/source/checkout + +Apache Ant is a cross-platform build tool. +http://ant.apache.org/ + +At the root of the source tree, there is an Ant file named +build.xml. To use it, navigate to the same directory and type the +command + +ant jar + +This will produce a jar file called "build/compiler.jar". + + +3) Check out the source and build it with Eclipse. + +Eclipse is a cross-platform IDE. +http://www.eclipse.org/ + +Under Eclipse's File menu, click "New > Project ..." and create a +"Java Project." You will see an options screen. Give the project a +name, select "Create project from existing source," and choose the +root of the checked-out source tree as the existing directory. Verify +that you are using JRE version 6 or higher. + +Eclipse can use the build.xml file to discover rules. When you +navigate to the build.xml file, you will see all the build rules in +the "Outline" pane. Run the "jar" rule to build the compiler in +build/compiler.jar. + + +// +// Running The Closure Compiler +// + +Once you have the jar binary, running the Closure Compiler is straightforward. + +On the command line, type + +java -jar compiler.jar + +This starts the compiler in interactive mode. Type + +var x = 17 + 25; + +then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux) +and "Enter" again. The Compiler will respond: + +var x=42; + +The Closure Compiler has many options for reading input from a file, +writing output to a file, checking your code, and running +optimizations. To learn more, type + +java -jar compiler.jar --help + +You can read more detailed documentation about the many flags at +http://code.google.com/closure/compiler/docs/gettingstarted_app.html + + +// +// Compiling Multiple Scripts +// + +If you have multiple scripts, you should compile them all together with +one compile command. + +java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js + +The Closure Compiler will concatenate the files in the order they're +passed at the command line. + +If you need to compile many, many scripts together, you may start to +run into problems with managing dependencies between scripts. You +should check out the Closure Library. It contains functions for +enforcing dependencies between scripts, and a tool called calcdeps.py +that knows how to give scripts to the Closure Compiler in the right +order. + +http://code.google.com/p/closure-library/ + +// +// Licensing +// + +Unless otherwise stated, all source files are licensed under +the Apache License, Version 2.0. + + +----- +Code under: +src/com/google/javascript/rhino +test/com/google/javascript/rhino + +URL: http://www.mozilla.org/rhino +Version: 1.5R3, with heavy modifications +License: Netscape Public License and MPL / GPL dual license + +Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an +implementation of JavaScript for the JVM. The JavaScript parser and +the parse tree data structures were extracted and modified +significantly for use by Google's JavaScript compiler. + +Local Modifications: The packages have been renamespaced. All code not +relavant to parsing has been removed. A JSDoc parser and static typing +system have been added. + + +----- +Code in: +lib/rhino + +Rhino +URL: http://www.mozilla.org/rhino +Version: Trunk +License: Netscape Public License and MPL / GPL dual license + +Description: Mozilla Rhino is an implementation of JavaScript for the JVM. + +Local Modifications: Minor changes to parsing JSDoc that usually get pushed +up-stream to Rhino trunk. + + +----- +Code in: +lib/args4j.jar + +Args4j +URL: https://args4j.dev.java.net/ +Version: 2.0.12 +License: MIT + +Description: +args4j is a small Java class library that makes it easy to parse command line +options/arguments in your CUI application. + +Local Modifications: None. + + +----- +Code in: +lib/guava.jar + +Guava Libraries +URL: http://code.google.com/p/guava-libraries/ +Version: r08 +License: Apache License 2.0 + +Description: Google's core Java libraries. + +Local Modifications: None. + + +----- +Code in: +lib/jsr305.jar + +Annotations for software defect detection +URL: http://code.google.com/p/jsr-305/ +Version: svn revision 47 +License: BSD License + +Description: Annotations for software defect detection. + +Local Modifications: None. + + +----- +Code in: +lib/jarjar.jar + +Jar Jar Links +URL: http://jarjar.googlecode.com/ +Version: 1.1 +License: Apache License 2.0 + +Description: +A utility for repackaging Java libraries. + +Local Modifications: None. + + +---- +Code in: +lib/junit.jar + +JUnit +URL: http://sourceforge.net/projects/junit/ +Version: 4.8.2 +License: Common Public License 1.0 + +Description: A framework for writing and running automated tests in Java. + +Local Modifications: None. + + +--- +Code in: +lib/protobuf-java.jar + +Protocol Buffers +URL: http://code.google.com/p/protobuf/ +Version: 2.3.0 +License: New BSD License + +Description: Supporting libraries for protocol buffers, +an encoding of structured data. + +Local Modifications: None + + +--- +Code in: +lib/ant.jar +lib/ant-launcher.jar + +URL: http://ant.apache.org/bindownload.cgi +Version: 1.8.1 +License: Apache License 2.0 +Description: + Ant is a Java based build tool. In theory it is kind of like "make" + without make's wrinkles and with the full portability of pure java code. + +Local Modifications: None + + +--- +Code in: +lib/json.jar +URL: http://json.org/java/index.html +Version: JSON version 20090211 +License: MIT license +Description: +JSON is a set of java files for use in transmitting data in JSON format. + +Local Modifications: None + +--- +Code in: +tools/maven-ant-tasks-2.1.1.jar +URL: http://maven.apache.org +Version 2.1.1 +License: Apache License 2.0 +Description: + Maven Ant tasks are used to manage dependencies and to install/deploy to + maven repositories. + +Local Modifications: None diff --git a/sencha/sdk/command/vendor/closurecompiler/compiler.jar b/sencha/sdk/command/vendor/closurecompiler/compiler.jar new file mode 100644 index 0000000..87a299d Binary files /dev/null and b/sencha/sdk/command/vendor/closurecompiler/compiler.jar differ diff --git a/sencha/sdk/command/vendor/nodejs/LICENSE b/sencha/sdk/command/vendor/nodejs/LICENSE new file mode 100644 index 0000000..57f9f46 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/LICENSE @@ -0,0 +1,86 @@ +Node's license follows: + +==== + +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +==== + +This license applies to all parts of Node that are not externally +maintained libraries. + +The externally maintained libraries used by Node are: + + - v8, located at deps/v8. v8 is copyright Google, Inc, and released + under a BSD license. + + - libev, located at deps/libev, and libeio, located at deps/libeio. libev + and libeio are copyright Marc Alexander Lehmann, and dual-licensed + under the MIT license and GPL2. + + - WAF build system, located at tools/waf. WAF is copyright Thomas Nagy, + and released under the MIT license. + + - The SCONS build system, located at tools/scons. SCONS is copyright + the SCONS Foundation and released under the MIT license. + + - C-Ares, an asynchronous DNS client, located at deps/c-ares. C-Ares is + copyright the Massachusetts Institute of Technology, authored by + Greg Hudson, Daniel Stenberg and others, and released under the MIT + license. + + - Node, optionally, links to OpenSSL, it is located at deps/openssl. + OpenSSL is cryptographic software written by Eric Young + (eay@cryptsoft.com) to provide SSL/TLS encryption. OpenSSL is copyright + The OpenSSL Project and released under the OpenSSL license. + + - tools/doctool/markdown.js is copyright 2009-2010 Dominic Baggott and Ash + Berli and released under the MIT license. + + - HTTP Parser, located at deps/http_parser, is a small C library + copyright Ryan Lienhart Dahl and released under the MIT license. + + - src/platform_darwin_proctitle.cc, has code taken from the Chromium + project copyright Google Inc. and released under a BSD license. + + - tools/closure_linter is copyright The Closure Linter Authors and + Google Inc. and released under the Apache License, version 2.0. + + - tools/cpplint.py is copyright Google Inc. and released under a + BSD license. + + - lib/buffer_ieee754.js is copyright 2008 Fair Oaks Labs, Inc. and released + under the New BSD license. + + - lib/punycode.js is copyright 2011 Mathias Bynens + and released under the MIT license. + + - tools/gyp GYP is a meta-build system copyright 2009 Google Inc and + licensed under the three clause BSD license. See tools/gyp/LICENSE. + + - deps/zlib copyright 1995-2010 Jean-loup Gailly and Mark Adler + licensed under a permissive free software license. See + deps/zlib/LICENSE. + + - deps/npm npm is a package manager program copyright 2009, 2010, 2011 + Isaac Z. Schlueter and licensed under MIT. npm includes several + subpackages MIT or Apache licenses, see deps/npm/LICENSE for more + information. npm is included in the Node .msi and .pkg distributions + but not in the Node binary itself. \ No newline at end of file diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/.bin/jasmine-node b/sencha/sdk/command/vendor/nodejs/node_modules/.bin/jasmine-node new file mode 100755 index 0000000..86e4492 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/.bin/jasmine-node @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +if( !process.env.NODE_ENV ) process.env.NODE_ENV = 'test'; + +var path = require('path'); +var fs = require('fs'); +require(path.join(__dirname,'../lib/jasmine-node/cli.js')); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/.bin/uglifyjs b/sencha/sdk/command/vendor/nodejs/node_modules/.bin/uglifyjs new file mode 100755 index 0000000..e7ba627 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/.bin/uglifyjs @@ -0,0 +1,323 @@ +#!/usr/bin/env node +// -*- js -*- + +global.sys = require(/^v0\.[012]/.test(process.version) ? "sys" : "util"); +var fs = require("fs"); +var uglify = require("uglify-js"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js + jsp = uglify.parser, + pro = uglify.uglify; + +var options = { + ast: false, + mangle: true, + mangle_toplevel: false, + no_mangle_functions: false, + squeeze: true, + make_seqs: true, + dead_code: true, + verbose: false, + show_copyright: true, + out_same_file: false, + max_line_length: 32 * 1024, + unsafe: false, + reserved_names: null, + defines: { }, + lift_vars: false, + codegen_options: { + ascii_only: false, + beautify: false, + indent_level: 4, + indent_start: 0, + quote_keys: false, + space_colon: false, + inline_script: false + }, + make: false, + output: true // stdout +}; + +var args = jsp.slice(process.argv, 2); +var filename; + +out: while (args.length > 0) { + var v = args.shift(); + switch (v) { + case "-b": + case "--beautify": + options.codegen_options.beautify = true; + break; + case "-i": + case "--indent": + options.codegen_options.indent_level = args.shift(); + break; + case "-q": + case "--quote-keys": + options.codegen_options.quote_keys = true; + break; + case "-mt": + case "--mangle-toplevel": + options.mangle_toplevel = true; + break; + case "-nmf": + case "--no-mangle-functions": + options.no_mangle_functions = true; + break; + case "--no-mangle": + case "-nm": + options.mangle = false; + break; + case "--no-squeeze": + case "-ns": + options.squeeze = false; + break; + case "--no-seqs": + options.make_seqs = false; + break; + case "--no-dead-code": + options.dead_code = false; + break; + case "--no-copyright": + case "-nc": + options.show_copyright = false; + break; + case "-o": + case "--output": + options.output = args.shift(); + break; + case "--overwrite": + options.out_same_file = true; + break; + case "-v": + case "--verbose": + options.verbose = true; + break; + case "--ast": + options.ast = true; + break; + case "--unsafe": + options.unsafe = true; + break; + case "--max-line-len": + options.max_line_length = parseInt(args.shift(), 10); + break; + case "--reserved-names": + options.reserved_names = args.shift().split(","); + break; + case "--lift-vars": + options.lift_vars = true; + break; + case "-d": + case "--define": + var defarg = args.shift(); + try { + var defsym = function(sym) { + // KEYWORDS_ATOM doesn't include NaN or Infinity - should we check + // for them too ?? We don't check reserved words and the like as the + // define values are only substituted AFTER parsing + if (jsp.KEYWORDS_ATOM.hasOwnProperty(sym)) { + throw "Don't define values for inbuilt constant '"+sym+"'"; + } + return sym; + }, + defval = function(v) { + if (v.match(/^"(.*)"$/) || v.match(/^'(.*)'$/)) { + return [ "string", RegExp.$1 ]; + } + else if (!isNaN(parseFloat(v))) { + return [ "num", parseFloat(v) ]; + } + else if (v.match(/^[a-z\$_][a-z\$_0-9]*$/i)) { + return [ "name", v ]; + } + else if (!v.match(/"/)) { + return [ "string", v ]; + } + else if (!v.match(/'/)) { + return [ "string", v ]; + } + throw "Can't understand the specified value: "+v; + }; + if (defarg.match(/^([a-z_\$][a-z_\$0-9]*)(=(.*))?$/i)) { + var sym = defsym(RegExp.$1), + val = RegExp.$2 ? defval(RegExp.$2.substr(1)) : [ 'name', 'true' ]; + options.defines[sym] = val; + } + else { + throw "The --define option expects SYMBOL[=value]"; + } + } catch(ex) { + sys.print("ERROR: In option --define "+defarg+"\n"+ex+"\n"); + process.exit(1); + } + break; + case "--define-from-module": + var defmodarg = args.shift(), + defmodule = require(defmodarg), + sym, + val; + for (sym in defmodule) { + if (defmodule.hasOwnProperty(sym)) { + options.defines[sym] = function(val) { + if (typeof val == "string") + return [ "string", val ]; + if (typeof val == "number") + return [ "num", val ]; + if (val === true) + return [ 'name', 'true' ]; + if (val === false) + return [ 'name', 'false' ]; + if (val === null) + return [ 'name', 'null' ]; + if (val === undefined) + return [ 'name', 'undefined' ]; + sys.print("ERROR: In option --define-from-module "+defmodarg+"\n"); + sys.print("ERROR: Unknown object type for: "+sym+"="+val+"\n"); + process.exit(1); + return null; + }(defmodule[sym]); + } + } + break; + case "--ascii": + options.codegen_options.ascii_only = true; + break; + case "--make": + options.make = true; + break; + case "--inline-script": + options.codegen_options.inline_script = true; + break; + default: + filename = v; + break out; + } +} + +if (options.verbose) { + pro.set_logger(function(msg){ + sys.debug(msg); + }); +} + +jsp.set_logger(function(msg){ + sys.debug(msg); +}); + +if (options.make) { + options.out_same_file = false; // doesn't make sense in this case + var makefile = JSON.parse(fs.readFileSync(filename || "Makefile.uglify.js").toString()); + output(makefile.files.map(function(file){ + var code = fs.readFileSync(file.name); + if (file.module) { + code = "!function(exports, global){global = this;\n" + code + "\n;this." + file.module + " = exports;}({})"; + } + else if (file.hide) { + code = "(function(){" + code + "}());"; + } + return squeeze_it(code); + }).join("\n")); +} +else if (filename) { + fs.readFile(filename, "utf8", function(err, text){ + if (err) throw err; + output(squeeze_it(text)); + }); +} +else { + var stdin = process.openStdin(); + stdin.setEncoding("utf8"); + var text = ""; + stdin.on("data", function(chunk){ + text += chunk; + }); + stdin.on("end", function() { + output(squeeze_it(text)); + }); +} + +function output(text) { + var out; + if (options.out_same_file && filename) + options.output = filename; + if (options.output === true) { + out = process.stdout; + } else { + out = fs.createWriteStream(options.output, { + flags: "w", + encoding: "utf8", + mode: 0644 + }); + } + out.write(text.replace(/;*$/, ";")); + if (options.output !== true) { + out.end(); + } +}; + +// --------- main ends here. + +function show_copyright(comments) { + var ret = ""; + for (var i = 0; i < comments.length; ++i) { + var c = comments[i]; + if (c.type == "comment1") { + ret += "//" + c.value + "\n"; + } else { + ret += "/*" + c.value + "*/"; + } + } + return ret; +}; + +function squeeze_it(code) { + var result = ""; + if (options.show_copyright) { + var tok = jsp.tokenizer(code), c; + c = tok(); + result += show_copyright(c.comments_before); + } + try { + var ast = time_it("parse", function(){ return jsp.parse(code); }); + if (options.lift_vars) { + ast = time_it("lift", function(){ return pro.ast_lift_variables(ast); }); + } + if (options.mangle) ast = time_it("mangle", function(){ + return pro.ast_mangle(ast, { + toplevel : options.mangle_toplevel, + defines : options.defines, + except : options.reserved_names, + no_functions : options.no_mangle_functions + }); + }); + if (options.squeeze) ast = time_it("squeeze", function(){ + ast = pro.ast_squeeze(ast, { + make_seqs : options.make_seqs, + dead_code : options.dead_code, + keep_comps : !options.unsafe + }); + if (options.unsafe) + ast = pro.ast_squeeze_more(ast); + return ast; + }); + if (options.ast) + return sys.inspect(ast, null, null); + result += time_it("generate", function(){ return pro.gen_code(ast, options.codegen_options) }); + if (!options.codegen_options.beautify && options.max_line_length) { + result = time_it("split", function(){ return pro.split_lines(result, options.max_line_length) }); + } + return result; + } catch(ex) { + sys.debug(ex.stack); + sys.debug(sys.inspect(ex)); + sys.debug(JSON.stringify(ex)); + process.exit(1); + } +}; + +function time_it(name, cont) { + if (!options.verbose) + return cont(); + var t1 = new Date().getTime(); + try { return cont(); } + finally { sys.debug("// " + name + ": " + ((new Date().getTime() - t1) / 1000).toFixed(3) + " sec."); } +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/findit/README.markdown new file mode 100644 index 0000000..d622819 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/README.markdown @@ -0,0 +1,101 @@ +findit +====== + +Recursively walk directory trees. Think `/usr/bin/find`. + +example time! +============= + +callback style +-------------- + +````javascript +require('findit').find(__dirname, function (file) { + console.log(file); +}) +```` + +emitter style +------------- + +````javascript +var finder = require('findit').find(__dirname); + +finder.on('directory', function (dir, stat) { + console.log(dir + '/'); +}); + +finder.on('file', function (file, stat) { + console.log(file); +}); + +finder.on('link', function (link, stat) { + console.log(link); +}); +```` + +synchronous +----------- + +````javascript +var files = require('findit').sync(__dirname); + console.dir(files); +```` + +methods +======= + +find(basedir, options, cb) +----------------- + +Do an asynchronous recursive walk starting at `basedir`. + +Optionally supply an options object. Setting the property 'follow_symlinks' +will follow symlinks. + +Optionally supply a callback that will get the same arguments as the path event +documented below in "events". + +If `basedir` is actually a non-directory regular file, findit emits a single +"file" event for it then emits "end". + +Findit uses `fs.lstat()` so symlinks are not traversed automatically. To have it +follow symlinks, supply the options argument with 'follow_symlinks' set to true. +Findit won't traverse an inode that it has seen before so directories can have +symlink cycles and findit won't blow up. + +Returns an EventEmitter. See "events". + +sync(basedir, options, cb) +----------------- + +Return an array of files and directories from a synchronous recursive walk +starting at `basedir`. + +Optionally supply an options object. Setting the property 'follow_symlinks' +will follow symlinks. + +An optional callback `cb` will get called with `cb(file, stat)` if specified. + +events +====== + +file: [ file, stat ] +-------------------- + +Emitted for just files which are not directories. + +directory : [ directory, stat ] +------------------------------- + +Emitted for directories. + +path : [ file, stat ] +--------------------- + +Emitted for both files and directories. + +end +--- + +Emitted when the recursive walk is done. diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/callback.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/callback.js new file mode 100644 index 0000000..829630e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/callback.js @@ -0,0 +1,3 @@ +require('findit').find(__dirname, function (file) { + console.log(file); +}) diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/emitter.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/emitter.js new file mode 100644 index 0000000..f97adf3 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/emitter.js @@ -0,0 +1,9 @@ +var finder = require('findit').find(__dirname); + +finder.on('directory', function (dir) { + console.log(dir + '/'); +}); + +finder.on('file', function (file) { + console.log(file); +}); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/sync.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/sync.js new file mode 100644 index 0000000..b09e0b2 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/examples/sync.js @@ -0,0 +1,2 @@ +var files = require('findit').findSync(__dirname); +console.dir(files); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/index.js new file mode 100644 index 0000000..c1d9eb9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/index.js @@ -0,0 +1,142 @@ +var fs = require('fs'); +var path = require('path'); +var EventEmitter = require('events').EventEmitter; +var Seq = require('seq'); + +function createInodeChecker() { + var inodes = {}; + return function inodeSeen(inode) { + if (inodes[inode]) { + return true; + } else { + inodes[inode] = true; + return false; + } + } +} + +exports = module.exports = find; +exports.find = find; +function find (base, options, cb) { + cb = arguments[arguments.length - 1]; + if (typeof(cb) !== 'function') { + cb = undefined; + } + var em = new EventEmitter; + var inodeSeen = createInodeChecker(); + + function finder (dir, f) { + Seq() + .seq(fs.readdir, dir, Seq) + .flatten() + .seqEach(function (file) { + var p = dir + '/' + file; + fs.lstat(p, this.into(p)); + }) + .seq(function () { + this(null, Object.keys(this.vars)); + }) + .flatten() + .seqEach(function (file) { + var stat = this.vars[file]; + if (cb) cb(file, stat); + + if (inodeSeen(stat.ino)) { + // already seen this inode, probably a recursive symlink + this(null); + } + else { + em.emit('path', file, stat); + + if (stat.isSymbolicLink()) { + em.emit('link', file, stat); + if (options && options.follow_symlinks) { + path.exists(file, function(exists) { + if (exists) { + fs.readlink(file, function(err, resolvedPath) { + if (err) { + em.emit('error', err); + } else { + finder(path.resolve(path.dir(file), resolvedPath)); + } + }); + } + }); + } else { + this(null); + } + } + else if (stat.isDirectory()) { + em.emit('directory', file, stat); + finder(file, this); + } + else { + em.emit('file', file, stat); + this(null); + } + } + }) + .seq(f.bind({}, null)) + .catch(em.emit.bind(em, 'error')) + ; + } + + fs.lstat(base, function (err, s) { + if (err) { + em.emit('error', err); + } + if (s.isDirectory()) { + finder(base, em.emit.bind(em, 'end')); + } + else if (s.isSymbolicLink()) { + if (cb) cb(base, s); + em.emit('link', base, s); + em.emit('end'); + } + else { + if (cb) cb(base, s); + em.emit('file', base, s); + em.emit('end'); + } + }); + + return em; +}; + +exports.findSync = function findSync(dir, options, callback) { + cb = arguments[arguments.length - 1]; + if (typeof(cb) !== 'function') { + cb = undefined; + } + var inodeSeen = createInodeChecker(); + var files = []; + var fileQueue = []; + var processFile = function processFile(file) { + var stat = fs.lstatSync(file); + if (inodeSeen(stat.ino)) { + return; + } + files.push(file); + cb && cb(file, stat) + if (stat.isDirectory()) { + fs.readdirSync(file).forEach(function(f) { fileQueue.push(path.join(file, f)); }); + } else if (stat.isSymbolicLink()) { + if (options && options.follow_symlinks && path.existsSync(file)) { + fileQueue.push(fs.realpathSync(file)); + } + } + }; + /* we don't include the starting directory unless it is a file */ + var stat = fs.lstatSync(dir); + if (stat.isDirectory()) { + fs.readdirSync(dir).forEach(function(f) { fileQueue.push(path.join(dir, f)); }); + } else { + fileQueue.push(dir); + } + while (fileQueue.length > 0) { + processFile(fileQueue.shift()); + } + return files; +}; + +exports.find.sync = exports.findSync; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/README.markdown new file mode 100644 index 0000000..3689261 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/README.markdown @@ -0,0 +1,442 @@ +Seq +=== + +Seq is an asynchronous flow control library with a chainable interface for +sequential and parallel actions. Even the error handling is chainable. + +Each action in the chain operates on a stack of values. +There is also a variables hash for storing values by name. + +[TOC] + + + +Examples +======== + +stat_all.js +----------- + +````javascript +var fs = require('fs'); +var Hash = require('hashish'); +var Seq = require('seq'); + +Seq() + .seq(function () { + fs.readdir(__dirname, this); + }) + .flatten() + .parEach(function (file) { + fs.stat(__dirname + '/' + file, this.into(file)); + }) + .seq(function () { + var sizes = Hash.map(this.vars, function (s) { return s.size }) + console.dir(sizes); + }) +; +```` + +Output: + + { 'stat_all.js': 404, 'parseq.js': 464 } + +parseq.js +--------- + +````javascript +var fs = require('fs'); +var exec = require('child_process').exec; + +var Seq = require('seq'); +Seq() + .seq(function () { + exec('whoami', this) + }) + .par(function (who) { + exec('groups ' + who, this); + }) + .par(function (who) { + fs.readFile(__filename, 'ascii', this); + }) + .seq(function (groups, src) { + console.log('Groups: ' + groups.trim()); + console.log('This file has ' + src.length + ' bytes'); + }) +; +```` + +Output: + + Groups: substack : substack dialout cdrom floppy audio src video plugdev games netdev fuse www + This file has 464 bytes + + + + +API +=== + +Each method executes callbacks with a context (its `this`) described in the next +section. Every method returns `this`. + +Whenever `this()` is called with a non-falsy first argument, the error value +propagates down to the first `catch` it sees, skipping over all actions in +between. There is an implicit `catch` at the end of all chains that prints the +error stack if available and otherwise just prints the error. + + + +Seq(xs=[]) +---------- + +The constructor function creates a new `Seq` chain with the methods described +below. The optional array argument becomes the new context stack. + +Array argument is new in 0.3. `Seq()` now behaves like `Seq.ap()`. + + +.seq(cb) +-------- +.seq(key, cb, *args) +-------------------- + +This eponymous function executes actions sequentially. +Once all running parallel actions are finished executing, +the supplied callback is `apply()`'d with the context stack. + +To execute the next action in the chain, call `this()`. The first +argument must be the error value. The rest of the values will become the stack +for the next action in the chain and are also available at `this.args`. + +If `key` is specified, the second argument sent to `this` goes to +`this.vars[key]` in addition to the stack and `this.args`. +`this.vars` persists across all requests unless it is overwritten. + +All arguments after `cb` will be bound to `cb`, which is useful because +`.bind()` makes you set `this`. If you pass in `Seq` in the arguments list, +it'll get transformed into `this` so that you can do: + +````javascript +Seq() + .seq(fs.readdir, __dirname, Seq) + .seq(function (files) { console.dir(files) }) +; +```` + +which prints an array of files in `__dirname`. + + +.par(cb) +-------- +.par(key, cb, *args) +-------------------- + +Use `par` to execute actions in parallel. +Chain multiple parallel actions together and collect all the responses on the +stack with a sequential operation like `seq`. + +Each `par` sets one element in the stack with the second argument to `this()` in +the order in which it appears, so multiple `par`s can be chained together. + +Like with `seq`, the first argument to `this()` should be the error value and +the second will get pushed to the stack. Further arguments are available in +`this.args`. + +If `key` is specified, the result from the second argument send to `this()` goes +to `this.vars[key]`. +`this.vars` persists across all requests unless it is overwritten. + +All arguments after `cb` will be bound to `cb`, which is useful because +`.bind()` makes you set `this`. Like `.seq()`, you can pass along `Seq` in these +bound arguments and it will get tranformed into `this`. + + +.catch(cb) +---------- + +Catch errors. Whenever a function calls `this` with a non-falsy first argument, +the message propagates down the chain to the first `catch` it sees. +The callback `cb` fires with the error object as its first argument and the key +that the action that caused the error was populating, which may be undefined. + +`catch` is a sequential action and further actions may appear after a `catch` in +a chain. If the execution reaches a `catch` in a chain and no error has occured, +the `catch` is skipped over. + +For convenience, there is a default error handler at the end of all chains. +This default error handler looks like this: + +````javascript +.catch(function (err) { + console.error(err.stack ? err.stack : err) +}) +```` + + +.forEach(cb) +------------ + +Execute each action in the stack under the context of the chain object. +`forEach` does not wait for any of the actions to finish and does not itself +alter the stack, but the callback may alter the stack itself by modifying +`this.stack`. + +The callback is executed `cb(x,i)` where `x` is the element and `i` is the +index. + +`forEach` is a sequential operation like `seq` and won't run until all pending +parallel requests yield results. + + +.seqEach(cb) +------------ + +Like `forEach`, call `cb` for each element on the stack, but unlike `forEach`, +`seqEach` waits for the callback to yield with `this` before moving on to the +next element in the stack. + +The callback is executed `cb(x,i)` where `x` is the element and `i` is the +index. + +If `this()` is supplied non-falsy error, the error propagates downward but any +other arguments are ignored. `seqEach` does not modify the stack itself. + + +.parEach(cb) +------------ +.parEach(limit, cb) +------------------- + +Like `forEach`, calls cb for each element in the stack and doesn't wait for the +callback to yield a result with `this()` before moving on to the next iteration. +Unlike `forEach`, `parEach` waits for all actions to call `this()` before moving +along to the next action in the chain. + +The callback is executed `cb(x,i)` where `x` is the element and `i` is the +index. + +`parEach` does not modify the stack itself and errors supplied to `this()` +propagate. + +Optionally, if limit is supplied to `parEach`, at most `limit` callbacks will be +active at a time. + + +.seqMap(cb) +----------- + +Like `seqEach`, but collect the values supplied to `this` and set the stack to +these values. + + +.parMap(cb) +----------- +.parMap(limit, cb) +------------------ + +Like `parEach`, but collect the values supplied to `this` and set the stack to +these values. + + +.seqFilter(cb) +----------- + +Executes the callback `cb(x, idx)` against each element on the stack, waiting for the +callback to yield with `this` before moving on to the next element. If the callback +returns an error or a falsey value, the element will not be included in the resulting +stack. + +Any errors from the callback are consumed and **do not** propagate. + +Calls to `this.into(i)` will place the value, if accepted by the callback, at the index in +the results as if it were ordered at i-th index on the stack before filtering (with ties +broken by the values). This implies `this.into` will never override another stack value +even if their indices collide. Finally, the value will only actually appear at `i` if the +callback accepts or moves enough values before `i`. + + +.parFilter(cb) +----------- +.parFilter(limit, cb) +------------------ + +Executes the callback `cb(x, idx)` against each element on the stack, but **does not** +wait for it to yield before moving on to the next element. If the callback returns an +error or a falsey value, the element will not be included in the resulting stack. + +Any errors from the callback are consumed and **do not** propagate. + +Calls to `this.into(i)` will place the value, if accepted by the callback, at the index in +the results as if it were ordered at i-th index on the stack before filtering (with ties +broken by the values). This implies `this.into` will never override another stack value +even if their indices collide. Finally, the value will only actually appear at `i` if the +callback accepts or moves enough values before `i`. + +Optionally, if limit is supplied to `parEach`, at most `limit` callbacks will be +active at a time. + + +.do(cb) +------- +Create a new nested context. `cb`'s first argument is the previous context, and `this` +is the nested `Seq` object. + + +.flatten(fully=true) +-------------------- + +Recursively flatten all the arrays in the stack. Set `fully=false` to flatten +only one level. + + +.unflatten() +------------ + +Turn the contents of the stack into a single array item. You can think of it +as the inverse of `flatten(false)`. + + +.extend([x,y...]) +----------------- + +Like `push`, but takes an array. This is like python's `[].extend()`. + + +.set(xs) +-------- + +Set the stack to a new array. This assigns the reference, it does not copy. + + +.empty() +-------- + +Set the stack to []. + + +.push(x,y...), .pop(), .shift(), .unshift(x), .splice(...), reverse() +--------------------------------------------------------------------- +.map(...), .filter(...), .reduce(...) +------------------------------------- + +Executes an array operation on the stack. + +The methods `map`, `filter`, and `reduce` are also proxies to their Array counterparts: +they have identical signatures to the Array methods, operate synchronously on the context +stack, and do not pass a Context object (unlike `seqMap` and `parMap`). + +The result of the transformation is assigned to the context stack; in the case of `reduce`, +if you do not return an array, the value will be wrapped in one. + +````javascript +Seq([1, 2, 3]) + .reduce(function(sum, x){ return sum + x; }, 0) + .seq(function(sum){ + console.log('sum: %s', sum); + // sum: 6 + console.log('stack is Array?', Array.isArray(this.stack)); + // stack is Array: true + console.log('stack:', this.stack); + // stack: [6] + }) +; +```` + + + + +Explicit Parameters +------------------- + +For environments like coffee-script or nested logic where threading `this` is +bothersome, you can use: + +* seq_ +* par_ +* forEach_ +* seqEach_ +* parEach_ +* seqMap_ +* parMap_ + +which work exactly like their un-underscored counterparts except for the first +parameter to the supplied callback is set to the context, `this`. + + + +Context Object +============== + +Each callback gets executed with its `this` set to a function in order to yield +results, error values, and control. The function also has these useful fields: + +this.stack +---------- + +The execution stack. + +this.stack_ +----------- + +The previous stack value, mostly used internally for hackish purposes. + +this.vars +--------- + +A hash of key/values populated with `par(key, ...)`, `seq(key, ...)` and +`this.into(key)`. + +this.into(key) +-------------- + +Instead of sending values to the stack, sets a key and returns `this`. +Use `this.into(key)` interchangeably with `this` for yielding keyed results. +`into` overrides the optional key set by `par(key, ...)` and `seq(key, ...)`. + +this.ok +------- + +Set the `err` to null. Equivalent to `this.bind(this, null)`. + +this.args +--------- + +`this.args` is like `this.stack`, but it contains all the arguments to `this()` +past the error value, not just the first. `this.args` is an array with the same +indices as `this.stack` but also stores keyed values for the last sequential +operation. Each element in `this.array` is set to `[].slice.call(arguments, 1)` +from inside `this()`. + +this.error +---------- + +This is used for error propagation. You probably shouldn't mess with it. + + + +Installation +============ + +With [npm](http://github.com/isaacs/npm), just do: + + npm install seq + +or clone this project on github: + + git clone http://github.com/substack/node-seq.git + +To run the tests with [expresso](http://github.com/visionmedia/expresso), +just do: + + expresso + + + +Dependencies +------------ + +This module uses [chainsaw](http://github.com/substack/node-chainsaw) +When you `npm install seq` this dependency will automatically be installed. + + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/join.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/join.js new file mode 100644 index 0000000..cc05c4f --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/join.js @@ -0,0 +1,18 @@ +var Seq = require('seq'); +Seq() + .par(function () { + var that = this; + setTimeout(function () { that(null, 'a') }, 300); + }) + .par(function () { + var that = this; + setTimeout(function () { that(null, 'b') }, 200); + }) + .par(function () { + var that = this; + setTimeout(function () { that(null, 'c') }, 100); + }) + .seq(function (a, b, c) { + console.dir([ a, b, c ]) + }) +; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/parseq.coffee b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/parseq.coffee new file mode 100644 index 0000000..d4ca0ab --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/parseq.coffee @@ -0,0 +1,12 @@ +fs = require 'fs' +exec = require('child_process').exec +Seq = require 'seq' + +Seq() + .seq_((next) -> exec 'whoami', next) + .par_((next, who) -> exec('groups ' + who, next)) + .par_((next, who) -> fs.readFile(__filename, 'utf8', next)) + .seq_((next, groups, src) -> + console.log('Groups: ' + groups.trim()) + console.log('This file has ' + src.length + ' bytes') + ) diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/parseq.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/parseq.js new file mode 100644 index 0000000..2cdcf21 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/parseq.js @@ -0,0 +1,19 @@ +var fs = require('fs'); +var exec = require('child_process').exec; + +var Seq = require('seq'); +Seq() + .seq(function () { + exec('whoami', this) + }) + .par(function (who) { + exec('groups ' + who, this); + }) + .par(function (who) { + fs.readFile(__filename, 'utf8', this); + }) + .seq(function (groups, src) { + console.log('Groups: ' + groups.trim()); + console.log('This file has ' + src.length + ' bytes'); + }) +; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/stat_all.coffee b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/stat_all.coffee new file mode 100644 index 0000000..83ec0b2 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/stat_all.coffee @@ -0,0 +1,16 @@ +fs = require 'fs' +Hash = require 'hashish' +Seq = require 'seq' + +Seq() + .seq_((next) -> + fs.readdir(__dirname, next) + ) + .flatten() + .parEach_((next, file) -> + fs.stat(__dirname + '/' + file, next.into(file)) + ) + .seq_((next) -> + sizes = Hash.map(next.vars, (s) -> s.size) + console.dir sizes + ) diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/stat_all.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/stat_all.js new file mode 100644 index 0000000..b9962eb --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/examples/stat_all.js @@ -0,0 +1,17 @@ +var fs = require('fs'); +var Hash = require('hashish'); +var Seq = require('seq'); + +Seq() + .seq(function () { + fs.readdir(__dirname, this); + }) + .flatten() + .parEach(function (file) { + fs.stat(__dirname + '/' + file, this.into(file)); + }) + .seq(function () { + var sizes = Hash.map(this.vars, function (s) { return s.size }) + console.dir(sizes); + }) +; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/index.js new file mode 100755 index 0000000..4e0888b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/index.js @@ -0,0 +1,520 @@ +var EventEmitter = require('events').EventEmitter; +var Hash = require('hashish'); +var Chainsaw = require('chainsaw'); + +module.exports = Seq; +function Seq (xs) { + if (xs && !Array.isArray(xs) || arguments.length > 1) { + throw new Error('Optional argument to Seq() is exactly one Array'); + } + + var ch = Chainsaw(function (saw) { + builder.call(this, saw, xs || []); + }); + + process.nextTick(function () { + ch['catch'](function (err) { + console.error(err.stack ? err.stack : err) + }); + }); + return ch; +} + +Seq.ap = Seq; // for compatability with versions <0.3 + +function builder (saw, xs) { + var context = { + vars : {}, + args : {}, + stack : xs, + error : null + }; + context.stack_ = context.stack; + + function action (step, key, f, g) { + var cb = function (err) { + var args = [].slice.call(arguments, 1); + if (err) { + context.error = { message : err, key : key }; + saw.jump(lastPar); + saw.down('catch'); + g(); + } + else { + if (typeof key == 'number') { + context.stack_[key] = args[0]; + context.args[key] = args; + } + else { + context.stack_.push.apply(context.stack_, args); + if (key !== undefined) { + context.vars[key] = args[0]; + context.args[key] = args; + } + } + if (g) g(args, key); + } + }; + Hash(context).forEach(function (v,k) { cb[k] = v }); + + cb.into = function (k) { + key = k; + return cb; + }; + + cb.next = function (err, xs) { + context.stack_.push.apply(context.stack_, xs); + cb.apply(cb, [err].concat(context.stack)); + }; + + cb.pass = function (err) { + cb.apply(cb, [err].concat(context.stack)); + }; + + cb.ok = cb.bind(cb, null); + + f.apply(cb, context.stack); + } + + var running = 0; + var errors = 0; + + this.seq = function (key, cb) { + var bound = [].slice.call(arguments, 2); + + if (typeof key === 'function') { + if (arguments.length > 1) bound.unshift(cb); + cb = key; + key = undefined; + } + + if (context.error) saw.next() + else if (running === 0) { + action(saw.step, key, + function () { + context.stack_ = []; + var args = [].slice.call(arguments); + args.unshift.apply(args, bound.map(function (arg) { + return arg === Seq ? this : arg + }, this)); + + cb.apply(this, args); + }, function () { + context.stack = context.stack_; + saw.next() + } + ); + } + }; + + var lastPar = null; + this.par = function (key, cb) { + lastPar = saw.step; + + if (running == 0) { + // empty the active stack for the first par() in a chain + context.stack_ = []; + } + + var bound = [].slice.call(arguments, 2); + if (typeof key === 'function') { + if (arguments.length > 1) bound.unshift(cb); + cb = key; + key = context.stack_.length; + context.stack_.push(null); + } + var cb_ = function () { + var args = [].slice.call(arguments); + args.unshift.apply(args, bound.map(function (arg) { + return arg === Seq ? this : arg + }, this)); + + cb.apply(this, args); + }; + + running ++; + + var step = saw.step; + process.nextTick(function () { + action(step, key, cb_, function (args) { + if (!args) errors ++; + + running --; + if (running == 0) { + context.stack = context.stack_.slice(); + saw.step = lastPar; + if (errors > 0) saw.down('catch'); + errors = 0; + saw.next(); + } + }); + }); + saw.next(); + }; + + [ 'seq', 'par' ].forEach(function (name) { + this[name + '_'] = function (key) { + var args = [].slice.call(arguments); + + var cb = typeof key === 'function' + ? args[0] : args[1]; + + var fn = function () { + var argv = [].slice.call(arguments); + argv.unshift(this); + cb.apply(this, argv); + }; + + if (typeof key === 'function') { + args[0] = fn; + } + else { + args[1] = fn; + } + + this[name].apply(this, args); + }; + }, this); + + this['catch'] = function (cb) { + if (context.error) { + cb.call(context, context.error.message, context.error.key); + context.error = null; + } + saw.next(); + }; + + this.forEach = function (cb) { + this.seq(function () { + context.stack_ = context.stack.slice(); + var end = context.stack.length; + + if (end === 0) this(null) + else context.stack.forEach(function (x, i) { + action(saw.step, i, function () { + cb.call(this, x, i); + if (i == end - 1) saw.next(); + }); + }); + }); + }; + + this.seqEach = function (cb) { + this.seq(function () { + context.stack_ = context.stack.slice(); + var xs = context.stack.slice(); + if (xs.length === 0) this(null); + else (function next (i) { + action( + saw.step, i, + function () { cb.call(this, xs[i], i) }, + function (args) { + if (!args || i === xs.length - 1) saw.next(); + else next(i + 1); + } + ); + }).bind(this)(0); + }); + }; + + this.parEach = function (limit, cb) { + var xs = context.stack.slice(); + if (cb === undefined) { cb = limit; limit = xs.length } + context.stack_ = []; + + var active = 0; + var finished = 0; + var queue = []; + + if (xs.length === 0) saw.next() + else xs.forEach(function call (x, i) { + if (active >= limit) { + queue.push(call.bind(this, x, i)); + } + else { + active ++; + action(saw.step, i, + function () { + cb.call(this, x, i); + }, + function () { + active --; + finished ++; + if (queue.length > 0) queue.shift()(); + else if (finished === xs.length) { + saw.next(); + } + } + ); + } + }); + }; + + this.parMap = function (limit, cb) { + var res = []; + var len = context.stack.length; + if (cb === undefined) { cb = limit; limit = len } + var res = []; + + Seq() + .extend(context.stack) + .parEach(limit, function (x, i) { + var self = this; + + var next = function () { + res[i] = arguments[1]; + self.apply(self, arguments); + }; + + next.stack = self.stack; + next.stack_ = self.stack_; + next.vars = self.vars; + next.args = self.args; + next.error = self.error; + + next.into = function (key) { + return function () { + res[key] = arguments[1]; + self.apply(self, arguments); + }; + }; + + next.ok = function () { + var args = [].slice.call(arguments); + args.unshift(null); + return next.apply(next, args); + }; + + cb.apply(next, arguments); + }) + .seq(function () { + context.stack = res; + saw.next(); + }) + ; + }; + + this.seqMap = function (cb) { + var res = []; + var lastIdx = context.stack.length - 1; + + this.seqEach(function (x, i) { + var self = this; + + var next = function () { + res[i] = arguments[1]; + if (i === lastIdx) + context.stack = res; + self.apply(self, arguments); + }; + + next.stack = self.stack; + next.stack_ = self.stack_; + next.vars = self.vars; + next.args = self.args; + next.error = self.error; + + next.into = function (key) { + return function () { + res[key] = arguments[1]; + if (i === lastIdx) + context.stack = res; + self.apply(self, arguments); + }; + }; + + next.ok = function () { + var args = [].slice.call(arguments); + args.unshift(null); + return next.apply(next, args); + }; + + cb.apply(next, arguments); + }); + }; + + /** + * Consumes any errors that occur in `cb`. Calls to `this.into(i)` will place + * that value, if accepted by the filter, at the index in the results as + * if it were the i-th index before filtering. (This means it will never + * override another value, and will only actually appear at i if the filter + * accepts all values before i.) + */ + this.parFilter = function (limit, cb) { + var res = []; + var len = context.stack.length; + if (cb === undefined) { cb = limit; limit = len } + var res = []; + + Seq() + .extend(context.stack) + .parEach(limit, function (x, i) { + var self = this; + + var next = function (err, ok) { + if (!err && ok) + res.push([i, x]); + arguments[0] = null; // discard errors + self.apply(self, arguments); + }; + + next.stack = self.stack; + next.stack_ = self.stack_; + next.vars = self.vars; + next.args = self.args; + next.error = self.error; + + next.into = function (key) { + return function (err, ok) { + if (!err && ok) + res.push([key, x]); + arguments[0] = null; // discard errors + self.apply(self, arguments); + }; + }; + + next.ok = function () { + var args = [].slice.call(arguments); + args.unshift(null); + return next.apply(next, args); + }; + + cb.apply(next, arguments); + }) + .seq(function () { + context.stack = res.sort().map(function(pair){ return pair[1]; }); + saw.next(); + }) + ; + }; + + /** + * Consumes any errors that occur in `cb`. Calls to `this.into(i)` will place + * that value, if accepted by the filter, at the index in the results as + * if it were the i-th index before filtering. (This means it will never + * override another value, and will only actually appear at i if the filter + * accepts all values before i.) + */ + this.seqFilter = function (cb) { + var res = []; + var lastIdx = context.stack.length - 1; + + this.seqEach(function (x, i) { + var self = this; + + var next = function (err, ok) { + if (!err && ok) + res.push([i, x]); + if (i === lastIdx) + context.stack = res.sort().map(function(pair){ return pair[1]; }); + arguments[0] = null; // discard errors + self.apply(self, arguments); + }; + + next.stack = self.stack; + next.stack_ = self.stack_; + next.vars = self.vars; + next.args = self.args; + next.error = self.error; + + next.into = function (key) { + return function (err, ok) { + if (!err && ok) + res.push([key, x]); + if (i === lastIdx) + context.stack = res.sort().map(function(pair){ return pair[1]; }); + arguments[0] = null; // discard errors + self.apply(self, arguments); + }; + }; + + next.ok = function () { + var args = [].slice.call(arguments); + args.unshift(null); + return next.apply(next, args); + }; + + cb.apply(next, arguments); + }); + }; + + [ 'forEach', 'seqEach', 'parEach', 'seqMap', 'parMap', 'seqFilter', 'parFilter' ] + .forEach(function (name) { + this[name + '_'] = function (cb) { + this[name].call(this, function () { + var args = [].slice.call(arguments); + args.unshift(this); + cb.apply(this, args); + }); + }; + }, this) + ; + + ['push','pop','shift','unshift','splice','reverse'] + .forEach(function (name) { + this[name] = function () { + context.stack[name].apply( + context.stack, + [].slice.call(arguments) + ); + saw.next(); + return this; + }; + }, this) + ; + + [ 'map', 'filter', 'reduce' ] + .forEach(function (name) { + this[name] = function () { + var res = context.stack[name].apply( + context.stack, + [].slice.call(arguments) + ); + // stack must be an array, or bad things happen + context.stack = (Array.isArray(res) ? res : [res]); + saw.next(); + return this; + }; + }, this) + ; + + this.extend = function (xs) { + if (!Array.isArray(xs)) { + throw new Error('argument to .extend() is not an Array'); + } + context.stack.push.apply(context.stack, xs); + saw.next(); + }; + + this.flatten = function (pancake) { + var xs = []; + // should we fully flatten this array? (default: true) + if (pancake === undefined) { pancake = true; } + context.stack.forEach(function f (x) { + if (Array.isArray(x) && pancake) x.forEach(f); + else if (Array.isArray(x)) xs = xs.concat(x); + else xs.push(x); + }); + context.stack = xs; + saw.next(); + }; + + this.unflatten = function () { + context.stack = [context.stack]; + saw.next(); + }; + + this.empty = function () { + context.stack = []; + saw.next(); + }; + + this.set = function (stack) { + context.stack = stack; + saw.next(); + }; + + this['do'] = function (cb) { + saw.nest(cb, context); + }; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/README.markdown new file mode 100644 index 0000000..9bb1259 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/README.markdown @@ -0,0 +1,140 @@ +Chainsaw +======== + +Build chainable fluent interfaces the easy way in node.js. + +With this meta-module you can write modules with chainable interfaces. +Chainsaw takes care of all of the boring details and makes nested flow control +super simple too. + +Just call `Chainsaw` with a constructor function like in the examples below. +In your methods, just do `saw.next()` to move along to the next event and +`saw.nest()` to create a nested chain. + +Examples +======== + +add_do.js +--------- + +This silly example adds values with a chainsaw. + + var Chainsaw = require('chainsaw'); + + function AddDo (sum) { + return Chainsaw(function (saw) { + this.add = function (n) { + sum += n; + saw.next(); + }; + + this.do = function (cb) { + saw.nest(cb, sum); + }; + }); + } + + AddDo(0) + .add(5) + .add(10) + .do(function (sum) { + if (sum > 12) this.add(-10); + }) + .do(function (sum) { + console.log('Sum: ' + sum); + }) + ; + +Output: + Sum: 5 + +prompt.js +--------- + +This example provides a wrapper on top of stdin with the help of +[node-lazy](https://github.com/pkrumins/node-lazy) for line-processing. + + var Chainsaw = require('chainsaw'); + var Lazy = require('lazy'); + + module.exports = Prompt; + function Prompt (stream) { + var waiting = []; + var lines = []; + var lazy = Lazy(stream).lines.map(String) + .forEach(function (line) { + if (waiting.length) { + var w = waiting.shift(); + w(line); + } + else lines.push(line); + }) + ; + + var vars = {}; + return Chainsaw(function (saw) { + this.getline = function (f) { + var g = function (line) { + saw.nest(f, line, vars); + }; + + if (lines.length) g(lines.shift()); + else waiting.push(g); + }; + + this.do = function (cb) { + saw.nest(cb, vars); + }; + }); + } + +And now for the new Prompt() module in action: + + var util = require('util'); + var stdin = process.openStdin(); + + Prompt(stdin) + .do(function () { + util.print('x = '); + }) + .getline(function (line, vars) { + vars.x = parseInt(line, 10); + }) + .do(function () { + util.print('y = '); + }) + .getline(function (line, vars) { + vars.y = parseInt(line, 10); + }) + .do(function (vars) { + if (vars.x + vars.y < 10) { + util.print('z = '); + this.getline(function (line) { + vars.z = parseInt(line, 10); + }) + } + else { + vars.z = 0; + } + }) + .do(function (vars) { + console.log('x + y + z = ' + (vars.x + vars.y + vars.z)); + process.exit(); + }) + ; + +Installation +============ + +With [npm](http://github.com/isaacs/npm), just do: + npm install chainsaw + +or clone this project on github: + + git clone http://github.com/substack/node-chainsaw.git + +To run the tests with [expresso](http://github.com/visionmedia/expresso), +just do: + + expresso + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/add_do.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/add_do.js new file mode 100644 index 0000000..378705d --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/add_do.js @@ -0,0 +1,25 @@ +var Chainsaw = require('chainsaw'); + +function AddDo (sum) { + return Chainsaw(function (saw) { + this.add = function (n) { + sum += n; + saw.next(); + }; + + this.do = function (cb) { + saw.nest(cb, sum); + }; + }); +} + +AddDo(0) + .add(5) + .add(10) + .do(function (sum) { + if (sum > 12) this.add(-10); + }) + .do(function (sum) { + console.log('Sum: ' + sum); + }) +; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/prompt.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/prompt.js new file mode 100644 index 0000000..0a06d71 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/examples/prompt.js @@ -0,0 +1,67 @@ +var Chainsaw = require('chainsaw'); +var Lazy = require('lazy'); + +module.exports = Prompt; +function Prompt (stream) { + var waiting = []; + var lines = []; + var lazy = Lazy(stream).lines.map(String) + .forEach(function (line) { + if (waiting.length) { + var w = waiting.shift(); + w(line); + } + else lines.push(line); + }) + ; + + var vars = {}; + return Chainsaw(function (saw) { + this.getline = function (f) { + var g = function (line) { + saw.nest(f, line, vars); + }; + + if (lines.length) g(lines.shift()); + else waiting.push(g); + }; + + this.do = function (cb) { + saw.nest(cb, vars); + }; + }); +} + +var util = require('util'); +if (__filename === process.argv[1]) { + var stdin = process.openStdin(); + Prompt(stdin) + .do(function () { + util.print('x = '); + }) + .getline(function (line, vars) { + vars.x = parseInt(line, 10); + }) + .do(function () { + util.print('y = '); + }) + .getline(function (line, vars) { + vars.y = parseInt(line, 10); + }) + .do(function (vars) { + if (vars.x + vars.y < 10) { + util.print('z = '); + this.getline(function (line) { + vars.z = parseInt(line, 10); + }) + } + else { + vars.z = 0; + } + }) + .do(function (vars) { + console.log('x + y + z = ' + (vars.x + vars.y + vars.z)); + process.exit(); + }) + ; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/index.js new file mode 100755 index 0000000..597cc48 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/index.js @@ -0,0 +1,108 @@ +var Traverse = require('traverse'); +var EventEmitter = require('events').EventEmitter; + +module.exports = Chainsaw; +function Chainsaw (builder) { + var saw = Chainsaw.saw(builder, {}); + var r = builder.call(saw.handlers, saw); + if (r !== undefined) saw.handlers = r; + return saw.chain(); +}; + +Chainsaw.saw = function (builder, handlers) { + var saw = new EventEmitter; + saw.handlers = handlers; + saw.actions = []; + saw.step = 0; + + saw.chain = function () { + var ch = Traverse(saw.handlers).map(function (node) { + if (this.isRoot) return node; + var ps = this.path; + + if (typeof node === 'function') { + this.update(function () { + saw.actions.push({ + path : ps, + args : [].slice.call(arguments) + }); + return ch; + }); + } + }); + + process.nextTick(function () { + saw.emit('begin'); + saw.next(); + }); + + return ch; + }; + + saw.next = function () { + var action = saw.actions[saw.step]; + saw.step ++; + + if (!action) { + saw.emit('end'); + } + else if (!action.trap) { + var node = saw.handlers; + action.path.forEach(function (key) { node = node[key] }); + node.apply(saw.handlers, action.args); + } + }; + + saw.nest = function (cb) { + var args = [].slice.call(arguments, 1); + var autonext = true; + + if (typeof cb === 'boolean') { + var autonext = cb; + cb = args.shift(); + } + + var s = Chainsaw.saw(builder, {}); + var r = builder.call(s.handlers, s); + + if (r !== undefined) s.handlers = r; + cb.apply(s.chain(), args); + if (autonext !== false) s.on('end', saw.next); + }; + + saw.trap = function (name, cb) { + var ps = Array.isArray(name) ? name : [name]; + saw.actions.push({ + path : ps, + step : saw.step, + cb : cb, + trap : true + }); + }; + + saw.down = function (name) { + var ps = (Array.isArray(name) ? name : [name]).join('/'); + var i = saw.actions.slice(saw.step).map(function (x) { + if (x.trap && x.step <= saw.step) return false; + return x.path.join('/') == ps; + }).indexOf(true); + + if (i >= 0) saw.step += i; + else saw.step = saw.actions.length; + + var act = saw.actions[saw.step - 1]; + if (act && act.trap) { + // It's a trap! + saw.step = act.step; + act.cb(); + } + else saw.next(); + }; + + saw.jump = function (step) { + saw.step = step; + saw.next(); + }; + + return saw; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/LICENSE b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/LICENSE new file mode 100644 index 0000000..7b75500 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/LICENSE @@ -0,0 +1,24 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: +http://www.opensource.org/licenses/mit-license.php + +Copyright 2010 James Halliday (mail@substack.net) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/README.markdown new file mode 100644 index 0000000..5728639 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/README.markdown @@ -0,0 +1,247 @@ +traverse +======== + +Traverse and transform objects by visiting every node on a recursive walk. + +examples +======== + +transform negative numbers in-place +----------------------------------- + +negative.js + +````javascript +var traverse = require('traverse'); +var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + +traverse(obj).forEach(function (x) { + if (x < 0) this.update(x + 128); +}); + +console.dir(obj); +```` + +Output: + + [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ] + +collect leaf nodes +------------------ + +leaves.js + +````javascript +var traverse = require('traverse'); + +var obj = { + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 }, +}; + +var leaves = traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; +}, []); + +console.dir(leaves); +```` + +Output: + + [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] + +context +======= + +Each method that takes a callback has a context (its `this` object) with these +attributes: + +this.node +--------- + +The present node on the recursive walk + +this.path +--------- + +An array of string keys from the root to the present node + +this.parent +----------- + +The context of the node's parent. +This is `undefined` for the root node. + +this.key +-------- + +The name of the key of the present node in its parent. +This is `undefined` for the root node. + +this.isRoot, this.notRoot +------------------------- + +Whether the present node is the root node + +this.isLeaf, this.notLeaf +------------------------- + +Whether or not the present node is a leaf node (has no children) + +this.level +---------- + +Depth of the node within the traversal + +this.circular +------------- + +If the node equals one of its parents, the `circular` attribute is set to the +context of that parent and the traversal progresses no deeper. + +this.update(value) +------------------ + +Set a new value for the present node. + +this.remove() +------------- + +Remove the current element from the output. If the node is in an Array it will +be spliced off. Otherwise it will be deleted from its parent. + +this.delete() +------------- + +Delete the current element from its parent in the output. Calls `delete` even on +Arrays. + +this.before(fn) +--------------- + +Call this function before any of the children are traversed. + +this.after(fn) +-------------- + +Call this function after any of the children are traversed. + +this.pre(fn) +------------ + +Call this function before each of the children are traversed. + +this.post(fn) +------------- + +Call this function after each of the children are traversed. + +methods +======= + +.map(fn) +-------- + +Execute `fn` for each node in the object and return a new object with the +results of the walk. To update nodes in the result use `this.update(value)`. + +.forEach(fn) +------------ + +Execute `fn` for each node in the object but unlike `.map()`, when +`this.update()` is called it updates the object in-place. + +.reduce(fn, acc) +---------------- + +For each node in the object, perform a +[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) +with the return value of `fn(acc, node)`. + +If `acc` isn't specified, `acc` is set to the root object for the first step +and the root element is skipped. + +.deepEqual(obj) +--------------- + +Returns a boolean, whether the instance value is equal to the supplied object +along a deep traversal using some opinionated choices. + +Some notes: + +* RegExps are equal if their .toString()s match, but not functions since +functions can close over different variables. + +* Date instances are compared using `.getTime()` just like `assert.deepEqual()`. + +* Circular references must refer to the same paths within the data structure for +both objects. For instance, in this snippet: + +````javascript +var a = [1]; +a.push(a); // a = [ 1, *a ] + +var b = [1]; +b.push(a); // b = [ 1, [ 1, *a ] ] +```` + +`a` is not the same as `b` since even though the expansion is the same, the +circular references in each refer to different paths into the data structure. + +However, in: + +````javascript +var c = [1]; +c.push(c); // c = [ 1, *c ]; +```` + +`c` is equal to `a` in a `deepEqual()` because they have the same terminal node +structure. + +* Arguments objects are not arrays and neither are they the same as regular +objects. + +* Instances created with `new` of String, Boolean, and Number types are never +equal to the native versions. + +.paths() +-------- + +Return an `Array` of every possible non-cyclic path in the object. +Paths are `Array`s of string keys. + +.nodes() +-------- + +Return an `Array` of every node in the object. + +.clone() +-------- + +Create a deep clone of the object. + +installation +============ + +Using npm: + npm install traverse + +Or check out the repository and link your development copy: + git clone http://github.com/substack/js-traverse.git + cd js-traverse + npm link . + +You can test traverse with "expresso":http://github.com/visionmedia/expresso +(`npm install expresso`): + js-traverse $ expresso + + 100% wahoo, your stuff is not broken! + +hash transforms +=============== + +This library formerly had a hash transformation component. It has been +[moved to the hashish package](https://github.com/substack/node-hashish). diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/json.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/json.js new file mode 100755 index 0000000..f3bd989 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/json.js @@ -0,0 +1,16 @@ +var Traverse = require('traverse'); + +var id = 54; +var callbacks = {}; +var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; + +var scrubbed = Traverse(obj).map(function (x) { + if (typeof x === 'function') { + callbacks[id] = { id : id, f : x, path : this.path }; + this.update('[Function]'); + id++; + } +}); + +console.dir(scrubbed); +console.dir(callbacks); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/leaves.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/leaves.js new file mode 100755 index 0000000..ef5325f --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/leaves.js @@ -0,0 +1,15 @@ +var Traverse = require('traverse'); + +var obj = { + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 }, +}; + +var leaves = Traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; +}, []); + +console.dir(leaves); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/negative.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/negative.js new file mode 100755 index 0000000..a3996c5 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/negative.js @@ -0,0 +1,8 @@ +var Traverse = require('traverse'); +var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + +Traverse(obj).forEach(function (x) { + if (x < 0) this.update(x + 128); +}); + +console.dir(obj); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/stringify.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/stringify.js new file mode 100755 index 0000000..0cef7ec --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/examples/stringify.js @@ -0,0 +1,38 @@ +#!/usr/bin/env node +var Traverse = require('traverse'); + +var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + +var s = ''; +Traverse(obj).forEach(function to_s (node) { + if (Array.isArray(node)) { + this.before(function () { s += '[' }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += ']' }); + } + else if (typeof node == 'object') { + this.before(function () { s += '{' }); + this.pre(function (x, key) { + to_s(key); + s += ':'; + }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += '}' }); + } + else if (typeof node == 'string') { + s += '"' + node.toString().replace(/"/g, '\\"') + '"'; + } + else if (typeof node == 'function') { + s += 'null'; + } + else { + s += node.toString(); + } +}); + +console.log('JSON.stringify: ' + JSON.stringify(obj)); +console.log('this stringify: ' + s); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/index.js new file mode 100755 index 0000000..7a34c8a --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/index.js @@ -0,0 +1,322 @@ +module.exports = Traverse; +function Traverse (obj) { + if (!(this instanceof Traverse)) return new Traverse(obj); + this.value = obj; +} + +Traverse.prototype.get = function (ps) { + var node = this.value; + for (var i = 0; i < ps.length; i ++) { + var key = ps[i]; + if (!Object.hasOwnProperty.call(node, key)) { + node = undefined; + break; + } + node = node[key]; + } + return node; +}; + +Traverse.prototype.set = function (ps, value) { + var node = this.value; + for (var i = 0; i < ps.length - 1; i ++) { + var key = ps[i]; + if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; + node = node[key]; + } + node[ps[i]] = value; + return value; +}; + +Traverse.prototype.map = function (cb) { + return walk(this.value, cb, true); +}; + +Traverse.prototype.forEach = function (cb) { + this.value = walk(this.value, cb, false); + return this.value; +}; + +Traverse.prototype.reduce = function (cb, init) { + var skip = arguments.length === 1; + var acc = skip ? this.value : init; + this.forEach(function (x) { + if (!this.isRoot || !skip) { + acc = cb.call(this, acc, x); + } + }); + return acc; +}; + +Traverse.prototype.deepEqual = function (obj) { + if (arguments.length !== 1) { + throw new Error( + 'deepEqual requires exactly one object to compare against' + ); + } + + var equal = true; + var node = obj; + + this.forEach(function (y) { + var notEqual = (function () { + equal = false; + //this.stop(); + return undefined; + }).bind(this); + + //if (node === undefined || node === null) return notEqual(); + + if (!this.isRoot) { + /* + if (!Object.hasOwnProperty.call(node, this.key)) { + return notEqual(); + } + */ + if (typeof node !== 'object') return notEqual(); + node = node[this.key]; + } + + var x = node; + + this.post(function () { + node = x; + }); + + var toS = function (o) { + return Object.prototype.toString.call(o); + }; + + if (this.circular) { + if (Traverse(obj).get(this.circular.path) !== x) notEqual(); + } + else if (typeof x !== typeof y) { + notEqual(); + } + else if (x === null || y === null || x === undefined || y === undefined) { + if (x !== y) notEqual(); + } + else if (x.__proto__ !== y.__proto__) { + notEqual(); + } + else if (x === y) { + // nop + } + else if (typeof x === 'function') { + if (x instanceof RegExp) { + // both regexps on account of the __proto__ check + if (x.toString() != y.toString()) notEqual(); + } + else if (x !== y) notEqual(); + } + else if (typeof x === 'object') { + if (toS(y) === '[object Arguments]' + || toS(x) === '[object Arguments]') { + if (toS(x) !== toS(y)) { + notEqual(); + } + } + else if (x instanceof Date || y instanceof Date) { + if (!(x instanceof Date) || !(y instanceof Date) + || x.getTime() !== y.getTime()) { + notEqual(); + } + } + else { + var kx = Object.keys(x); + var ky = Object.keys(y); + if (kx.length !== ky.length) return notEqual(); + for (var i = 0; i < kx.length; i++) { + var k = kx[i]; + if (!Object.hasOwnProperty.call(y, k)) { + notEqual(); + } + } + } + } + }); + + return equal; +}; + +Traverse.prototype.paths = function () { + var acc = []; + this.forEach(function (x) { + acc.push(this.path); + }); + return acc; +}; + +Traverse.prototype.nodes = function () { + var acc = []; + this.forEach(function (x) { + acc.push(this.node); + }); + return acc; +}; + +Traverse.prototype.clone = function () { + var parents = [], nodes = []; + + return (function clone (src) { + for (var i = 0; i < parents.length; i++) { + if (parents[i] === src) { + return nodes[i]; + } + } + + if (typeof src === 'object' && src !== null) { + var dst = copy(src); + + parents.push(src); + nodes.push(dst); + + Object.keys(src).forEach(function (key) { + dst[key] = clone(src[key]); + }); + + parents.pop(); + nodes.pop(); + return dst; + } + else { + return src; + } + })(this.value); +}; + +function walk (root, cb, immutable) { + var path = []; + var parents = []; + var alive = true; + + return (function walker (node_) { + var node = immutable ? copy(node_) : node_; + var modifiers = {}; + + var state = { + node : node, + node_ : node_, + path : [].concat(path), + parent : parents.slice(-1)[0], + key : path.slice(-1)[0], + isRoot : path.length === 0, + level : path.length, + circular : null, + update : function (x) { + if (!state.isRoot) { + state.parent.node[state.key] = x; + } + state.node = x; + }, + 'delete' : function () { + delete state.parent.node[state.key]; + }, + remove : function () { + if (Array.isArray(state.parent.node)) { + state.parent.node.splice(state.key, 1); + } + else { + delete state.parent.node[state.key]; + } + }, + before : function (f) { modifiers.before = f }, + after : function (f) { modifiers.after = f }, + pre : function (f) { modifiers.pre = f }, + post : function (f) { modifiers.post = f }, + stop : function () { alive = false } + }; + + if (!alive) return state; + + if (typeof node === 'object' && node !== null) { + state.isLeaf = Object.keys(node).length == 0; + + for (var i = 0; i < parents.length; i++) { + if (parents[i].node_ === node_) { + state.circular = parents[i]; + break; + } + } + } + else { + state.isLeaf = true; + } + + state.notLeaf = !state.isLeaf; + state.notRoot = !state.isRoot; + + // use return values to update if defined + var ret = cb.call(state, state.node); + if (ret !== undefined && state.update) state.update(ret); + if (modifiers.before) modifiers.before.call(state, state.node); + + if (typeof state.node == 'object' + && state.node !== null && !state.circular) { + parents.push(state); + + var keys = Object.keys(state.node); + keys.forEach(function (key, i) { + path.push(key); + + if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); + + var child = walker(state.node[key]); + if (immutable && Object.hasOwnProperty.call(state.node, key)) { + state.node[key] = child.node; + } + + child.isLast = i == keys.length - 1; + child.isFirst = i == 0; + + if (modifiers.post) modifiers.post.call(state, child); + + path.pop(); + }); + parents.pop(); + } + + if (modifiers.after) modifiers.after.call(state, state.node); + + return state; + })(root).node; +} + +Object.keys(Traverse.prototype).forEach(function (key) { + Traverse[key] = function (obj) { + var args = [].slice.call(arguments, 1); + var t = Traverse(obj); + return t[key].apply(t, args); + }; +}); + +function copy (src) { + if (typeof src === 'object' && src !== null) { + var dst; + + if (Array.isArray(src)) { + dst = []; + } + else if (src instanceof Date) { + dst = new Date(src); + } + else if (src instanceof Boolean) { + dst = new Boolean(src); + } + else if (src instanceof Number) { + dst = new Number(src); + } + else if (src instanceof String) { + dst = new String(src); + } + else { + dst = Object.create(Object.getPrototypeOf(src)); + } + + Object.keys(src).forEach(function (key) { + dst[key] = src[key]; + }); + return dst; + } + else return src; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/package.json new file mode 100644 index 0000000..5ab3fc6 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/package.json @@ -0,0 +1,18 @@ +{ + "name" : "traverse", + "version" : "0.3.9", + "description" : "Traverse and transform objects by visiting every node on a recursive walk", + "author" : "James Halliday", + "license" : "MIT/X11", + "main" : "./index", + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/js-traverse.git" + }, + "devDependencies" : { + "expresso" : "0.7.x" + }, + "scripts" : { + "test" : "expresso" + } +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/circular.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/circular.js new file mode 100644 index 0000000..e1eef3f --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/circular.js @@ -0,0 +1,114 @@ +var assert = require('assert'); +var Traverse = require('traverse'); +var util = require('util'); + +exports.circular = function () { + var obj = { x : 3 }; + obj.y = obj; + var foundY = false; + Traverse(obj).forEach(function (x) { + if (this.path.join('') == 'y') { + assert.equal( + util.inspect(this.circular.node), + util.inspect(obj) + ); + foundY = true; + } + }); + assert.ok(foundY); +}; + +exports.deepCirc = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + + var times = 0; + Traverse(obj).forEach(function (x) { + if (this.circular) { + assert.deepEqual(this.circular.path, []); + assert.deepEqual(this.path, [ 'y', 2 ]); + times ++; + } + }); + + assert.deepEqual(times, 1); +}; + +exports.doubleCirc = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + var circs = []; + Traverse(obj).forEach(function (x) { + if (this.circular) { + circs.push({ circ : this.circular, self : this, node : x }); + } + }); + + assert.deepEqual(circs[0].self.path, [ 'x', 3, 2 ]); + assert.deepEqual(circs[0].circ.path, []); + + assert.deepEqual(circs[1].self.path, [ 'y', 2 ]); + assert.deepEqual(circs[1].circ.path, []); + + assert.deepEqual(circs.length, 2); +}; + +exports.circDubForEach = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + Traverse(obj).forEach(function (x) { + if (this.circular) this.update('...'); + }); + + assert.deepEqual(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); +}; + +exports.circDubMap = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + var c = Traverse(obj).map(function (x) { + if (this.circular) { + this.update('...'); + } + }); + + assert.deepEqual(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); +}; + +exports.circClone = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + var clone = Traverse.clone(obj); + assert.ok(obj !== clone); + + assert.ok(clone.y[2] === clone); + assert.ok(clone.y[2] !== obj); + assert.ok(clone.x[3][2] === clone); + assert.ok(clone.x[3][2] !== obj); + assert.deepEqual(clone.x.slice(0,3), [1,2,3]); + assert.deepEqual(clone.y.slice(0,2), [4,5]); +}; + +exports.circMapScrub = function () { + var obj = { a : 1, b : 2 }; + obj.c = obj; + + var scrubbed = Traverse(obj).map(function (node) { + if (this.circular) this.remove(); + }); + assert.deepEqual( + Object.keys(scrubbed).sort(), + [ 'a', 'b' ] + ); + assert.ok(Traverse.deepEqual(scrubbed, { a : 1, b : 2 })); + + assert.equal(obj.c, obj); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/date.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/date.js new file mode 100644 index 0000000..2cb8252 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/date.js @@ -0,0 +1,35 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports.dateEach = function () { + var obj = { x : new Date, y : 10, z : 5 }; + + var counts = {}; + + Traverse(obj).forEach(function (node) { + var t = (node instanceof Date && 'Date') || typeof node; + counts[t] = (counts[t] || 0) + 1; + }); + + assert.deepEqual(counts, { + object : 1, + Date : 1, + number : 2, + }); +}; + +exports.dateMap = function () { + var obj = { x : new Date, y : 10, z : 5 }; + + var res = Traverse(obj).map(function (node) { + if (typeof node === 'number') this.update(node + 100); + }); + + assert.ok(obj.x !== res.x); + assert.deepEqual(res, { + x : obj.x, + y : 110, + z : 105, + }); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/equal.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/equal.js new file mode 100644 index 0000000..4d732fa --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/equal.js @@ -0,0 +1,219 @@ +var assert = require('assert'); +var traverse = require('traverse'); + +exports.deepDates = function () { + assert.ok( + traverse.deepEqual( + { d : new Date, x : [ 1, 2, 3 ] }, + { d : new Date, x : [ 1, 2, 3 ] } + ), + 'dates should be equal' + ); + + var d0 = new Date; + setTimeout(function () { + assert.ok( + !traverse.deepEqual( + { d : d0, x : [ 1, 2, 3 ], }, + { d : new Date, x : [ 1, 2, 3 ] } + ), + 'microseconds should count in date equality' + ); + }, 5); +}; + +exports.deepCircular = function () { + var a = [1]; + a.push(a); // a = [ 1, *a ] + + var b = [1]; + b.push(a); // b = [ 1, [ 1, *a ] ] + + assert.ok( + !traverse.deepEqual(a, b), + 'circular ref mount points count towards equality' + ); + + var c = [1]; + c.push(c); // c = [ 1, *c ] + assert.ok( + traverse.deepEqual(a, c), + 'circular refs are structurally the same here' + ); + + var d = [1]; + d.push(a); // c = [ 1, [ 1, *d ] ] + assert.ok( + traverse.deepEqual(b, d), + 'non-root circular ref structural comparison' + ); +}; + +exports.deepInstances = function () { + assert.ok( + !traverse.deepEqual([ new Boolean(false) ], [ false ]), + 'boolean instances are not real booleans' + ); + + assert.ok( + !traverse.deepEqual([ new String('x') ], [ 'x' ]), + 'string instances are not real strings' + ); + + assert.ok( + !traverse.deepEqual([ new Number(4) ], [ 4 ]), + 'number instances are not real numbers' + ); + + assert.ok( + traverse.deepEqual([ new RegExp('x') ], [ /x/ ]), + 'regexp instances are real regexps' + ); + + assert.ok( + !traverse.deepEqual([ new RegExp(/./) ], [ /../ ]), + 'these regexps aren\'t the same' + ); + + assert.ok( + !traverse.deepEqual( + [ function (x) { return x * 2 } ], + [ function (x) { return x * 2 } ] + ), + 'functions with the same .toString() aren\'t necessarily the same' + ); + + var f = function (x) { return x * 2 }; + assert.ok( + traverse.deepEqual([ f ], [ f ]), + 'these functions are actually equal' + ); +}; + +exports.deepEqual = function () { + assert.ok( + !traverse.deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }), + 'arrays are not objects' + ); +}; + +exports.falsy = function () { + assert.ok( + !traverse.deepEqual([ undefined ], [ null ]), + 'null is not undefined!' + ); + + assert.ok( + !traverse.deepEqual([ null ], [ undefined ]), + 'undefined is not null!' + ); + + assert.ok( + !traverse.deepEqual( + { a : 1, b : 2, c : [ 3, undefined, 5 ] }, + { a : 1, b : 2, c : [ 3, null, 5 ] } + ), + 'undefined is not null, however deeply!' + ); + + assert.ok( + !traverse.deepEqual( + { a : 1, b : 2, c : [ 3, undefined, 5 ] }, + { a : 1, b : 2, c : [ 3, null, 5 ] } + ), + 'null is not undefined, however deeply!' + ); + + assert.ok( + !traverse.deepEqual( + { a : 1, b : 2, c : [ 3, undefined, 5 ] }, + { a : 1, b : 2, c : [ 3, null, 5 ] } + ), + 'null is not undefined, however deeply!' + ); +}; + +exports.deletedArrayEqual = function () { + var xs = [ 1, 2, 3, 4 ]; + delete xs[2]; + + var ys = Object.create(Array.prototype); + ys[0] = 1; + ys[1] = 2; + ys[3] = 4; + + assert.ok( + traverse.deepEqual(xs, ys), + 'arrays with deleted elements are only equal to' + + ' arrays with similarly deleted elements' + ); + + assert.ok( + !traverse.deepEqual(xs, [ 1, 2, undefined, 4 ]), + 'deleted array elements cannot be undefined' + ); + + assert.ok( + !traverse.deepEqual(xs, [ 1, 2, null, 4 ]), + 'deleted array elements cannot be null' + ); +}; + +exports.deletedObjectEqual = function () { + var obj = { a : 1, b : 2, c : 3 }; + delete obj.c; + + assert.ok( + traverse.deepEqual(obj, { a : 1, b : 2 }), + 'deleted object elements should not show up' + ); + + assert.ok( + !traverse.deepEqual(obj, { a : 1, b : 2, c : undefined }), + 'deleted object elements are not undefined' + ); + + assert.ok( + !traverse.deepEqual(obj, { a : 1, b : 2, c : null }), + 'deleted object elements are not null' + ); +}; + +exports.emptyKeyEqual = function () { + assert.ok(!traverse.deepEqual( + { a : 1 }, { a : 1, '' : 55 } + )); +}; + +exports.deepArguments = function () { + assert.ok( + !traverse.deepEqual( + [ 4, 5, 6 ], + (function () { return arguments })(4, 5, 6) + ), + 'arguments are not arrays' + ); + + assert.ok( + traverse.deepEqual( + (function () { return arguments })(4, 5, 6), + (function () { return arguments })(4, 5, 6) + ), + 'arguments should equal' + ); +}; + +exports.deepUn = function () { + assert.ok(!traverse.deepEqual({ a : 1, b : 2 }, undefined)); + assert.ok(!traverse.deepEqual({ a : 1, b : 2 }, {})); + assert.ok(!traverse.deepEqual(undefined, { a : 1, b : 2 })); + assert.ok(!traverse.deepEqual({}, { a : 1, b : 2 })); + assert.ok(traverse.deepEqual(undefined, undefined)); + assert.ok(traverse.deepEqual(null, null)); + assert.ok(!traverse.deepEqual(undefined, null)); +}; + +exports.deepLevels = function () { + var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ]; + assert.ok(!traverse.deepEqual(xs, [])); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/instance.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/instance.js new file mode 100644 index 0000000..501981f --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/instance.js @@ -0,0 +1,17 @@ +var assert = require('assert'); +var Traverse = require('traverse'); +var EventEmitter = require('events').EventEmitter; + +exports['check instanceof on node elems'] = function () { + + var counts = { emitter : 0 }; + + Traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }]) + .forEach(function (node) { + if (node instanceof EventEmitter) counts.emitter ++; + }) + ; + + assert.equal(counts.emitter, 2); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/interface.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/interface.js new file mode 100644 index 0000000..df5b037 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/interface.js @@ -0,0 +1,42 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports['interface map'] = function () { + var obj = { a : [ 5,6,7 ], b : { c : [8] } }; + + assert.deepEqual( + Traverse.paths(obj) + .sort() + .map(function (path) { return path.join('/') }) + .slice(1) + .join(' ') + , + 'a a/0 a/1 a/2 b b/c b/c/0' + ); + + assert.deepEqual( + Traverse.nodes(obj), + [ + { a: [ 5, 6, 7 ], b: { c: [ 8 ] } }, + [ 5, 6, 7 ], 5, 6, 7, + { c: [ 8 ] }, [ 8 ], 8 + ] + ); + + assert.deepEqual( + Traverse.map(obj, function (node) { + if (typeof node == 'number') { + return node + 1000; + } + else if (Array.isArray(node)) { + return node.join(' '); + } + }), + { a: '5 6 7', b: { c: '8' } } + ); + + var nodes = 0; + Traverse.forEach(obj, function (node) { nodes ++ }); + assert.deepEqual(nodes, 8); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/json.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/json.js new file mode 100644 index 0000000..bf36620 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/json.js @@ -0,0 +1,47 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports['json test'] = function () { + var id = 54; + var callbacks = {}; + var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; + + var scrubbed = Traverse(obj).map(function (x) { + if (typeof x === 'function') { + callbacks[id] = { id : id, f : x, path : this.path }; + this.update('[Function]'); + id++; + } + }); + + assert.equal( + scrubbed.moo, '[Function]', + 'obj.moo replaced with "[Function]"' + ); + + assert.equal( + scrubbed.foo[3], '[Function]', + 'obj.foo[3] replaced with "[Function]"' + ); + + assert.deepEqual(scrubbed, { + moo : '[Function]', + foo : [ 2, 3, 4, "[Function]" ] + }, 'Full JSON string matches'); + + assert.deepEqual( + typeof obj.moo, 'function', + 'Original obj.moo still a function' + ); + + assert.deepEqual( + typeof obj.foo[3], 'function', + 'Original obj.foo[3] still a function' + ); + + assert.deepEqual(callbacks, { + 54: { id: 54, f : obj.moo, path: [ 'moo' ] }, + 55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] }, + }, 'Check the generated callbacks list'); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/leaves.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/leaves.js new file mode 100644 index 0000000..4e8d280 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/leaves.js @@ -0,0 +1,21 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports['leaves test'] = function () { + var acc = []; + Traverse({ + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 } + }).forEach(function (x) { + if (this.isLeaf) acc.push(x); + }); + + assert.equal( + acc.join(' '), + '1 2 3 4 5 6 7 8 9', + 'Traversal in the right(?) order' + ); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/mutability.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/mutability.js new file mode 100644 index 0000000..5a4d6dd --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/mutability.js @@ -0,0 +1,203 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports.mutate = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).forEach(function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, res); + assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.mutateT = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse.forEach(obj, function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, res); + assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.map = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).map(function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.mapT = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse.map(obj, function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.clone = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).clone(); + assert.deepEqual(obj, res); + assert.ok(obj !== res); + obj.a ++; + assert.deepEqual(res.a, 1); + obj.c.push(5); + assert.deepEqual(res.c, [ 3, 4 ]); +}; + +exports.cloneT = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse.clone(obj); + assert.deepEqual(obj, res); + assert.ok(obj !== res); + obj.a ++; + assert.deepEqual(res.a, 1); + obj.c.push(5); + assert.deepEqual(res.c, [ 3, 4 ]); +}; + +exports.reduce = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; + }, []); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, [ 1, 2, 3, 4 ]); +}; + +exports.reduceInit = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).reduce(function (acc, x) { + if (this.isRoot) assert.fail('got root'); + return acc; + }); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, obj); +}; + +exports.remove = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + Traverse(obj).forEach(function (x) { + if (this.isLeaf && x % 2 == 0) this.remove(); + }); + + assert.deepEqual(obj, { a : 1, c : [ 3 ] }); +}; + +exports.removeMap = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).map(function (x) { + if (this.isLeaf && x % 2 == 0) this.remove(); + }); + + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, { a : 1, c : [ 3 ] }); +}; + +exports.delete = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + Traverse(obj).forEach(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(!Traverse.deepEqual( + obj, { a : 1, c : [ 3, undefined ] } + )); + + assert.ok(Traverse.deepEqual( + obj, { a : 1, c : [ 3 ] } + )); + + assert.ok(!Traverse.deepEqual( + obj, { a : 1, c : [ 3, null ] } + )); +}; + +exports.deleteRedux = function () { + var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; + Traverse(obj).forEach(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(!Traverse.deepEqual( + obj, { a : 1, c : [ 3, undefined, 5 ] } + )); + + assert.ok(Traverse.deepEqual( + obj, { a : 1, c : [ 3 ,, 5 ] } + )); + + assert.ok(!Traverse.deepEqual( + obj, { a : 1, c : [ 3, null, 5 ] } + )); + + assert.ok(!Traverse.deepEqual( + obj, { a : 1, c : [ 3, 5 ] } + )); +}; + +exports.deleteMap = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).map(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(Traverse.deepEqual( + obj, + { a : 1, b : 2, c : [ 3, 4 ] } + )); + + var xs = [ 3, 4 ]; + delete xs[1]; + + assert.ok(Traverse.deepEqual( + res, { a : 1, c : xs } + )); + + assert.ok(Traverse.deepEqual( + res, { a : 1, c : [ 3, ] } + )); + + assert.ok(Traverse.deepEqual( + res, { a : 1, c : [ 3 ] } + )); +}; + +exports.deleteMapRedux = function () { + var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; + var res = Traverse(obj).map(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(Traverse.deepEqual( + obj, + { a : 1, b : 2, c : [ 3, 4, 5 ] } + )); + + var xs = [ 3, 4, 5 ]; + delete xs[1]; + + assert.ok(Traverse.deepEqual( + res, { a : 1, c : xs } + )); + + assert.ok(!Traverse.deepEqual( + res, { a : 1, c : [ 3, 5 ] } + )); + + assert.ok(Traverse.deepEqual( + res, { a : 1, c : [ 3 ,, 5 ] } + )); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/negative.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/negative.js new file mode 100644 index 0000000..6cf287d --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/negative.js @@ -0,0 +1,20 @@ +var Traverse = require('traverse'); +var assert = require('assert'); + +exports['negative update test'] = function () { + var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + var fixed = Traverse.map(obj, function (x) { + if (x < 0) this.update(x + 128); + }); + + assert.deepEqual(fixed, + [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ], + 'Negative values += 128' + ); + + assert.deepEqual(obj, + [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ], + 'Original references not modified' + ); +} + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/obj.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/obj.js new file mode 100644 index 0000000..9c3b0db --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/obj.js @@ -0,0 +1,15 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports['traverse an object with nested functions'] = function () { + var to = setTimeout(function () { + assert.fail('never ran'); + }, 1000); + + function Cons (x) { + clearTimeout(to); + assert.equal(x, 10); + }; + Traverse(new Cons(10)); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stop.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stop.js new file mode 100644 index 0000000..ef6b36e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stop.js @@ -0,0 +1,41 @@ +var assert = require('assert'); +var traverse = require('traverse'); + +exports.stop = function () { + var visits = 0; + traverse('abcdefghij'.split('')).forEach(function (node) { + if (typeof node === 'string') { + visits ++; + if (node === 'e') this.stop() + } + }); + + assert.equal(visits, 5); +}; + +exports.stopMap = function () { + var s = traverse('abcdefghij'.split('')).map(function (node) { + if (typeof node === 'string') { + if (node === 'e') this.stop() + return node.toUpperCase(); + } + }).join(''); + + assert.equal(s, 'ABCDEfghij'); +}; + +exports.stopReduce = function () { + var obj = { + a : [ 4, 5 ], + b : [ 6, [ 7, 8, 9 ] ] + }; + var xs = traverse(obj).reduce(function (acc, node) { + if (this.isLeaf) { + if (node === 7) this.stop(); + else acc.push(node) + } + return acc; + }, []); + + assert.deepEqual(xs, [ 4, 5, 6 ]); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stringify.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stringify.js new file mode 100644 index 0000000..bf36f63 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/stringify.js @@ -0,0 +1,36 @@ +var assert = require('assert'); +var Traverse = require('traverse'); + +exports.stringify = function () { + var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + + var s = ''; + Traverse(obj).forEach(function (node) { + if (Array.isArray(node)) { + this.before(function () { s += '[' }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += ']' }); + } + else if (typeof node == 'object') { + this.before(function () { s += '{' }); + this.pre(function (x, key) { + s += '"' + key + '"' + ':'; + }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += '}' }); + } + else if (typeof node == 'function') { + s += 'null'; + } + else { + s += node.toString(); + } + }); + + assert.equal(s, JSON.stringify(obj)); +} + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/super_deep.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/super_deep.js new file mode 100644 index 0000000..974181e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/node_modules/traverse/test/super_deep.js @@ -0,0 +1,54 @@ +var assert = require('assert'); +var traverse = require('traverse'); + +exports.super_deep = function () { + var util = require('util'); + var a0 = make(); + var a1 = make(); + assert.ok(traverse.deepEqual(a0, a1)); + + a0.c.d.moo = true; + assert.ok(!traverse.deepEqual(a0, a1)); + + a1.c.d.moo = true; + assert.ok(traverse.deepEqual(a0, a1)); + + // TODO: this one + //a0.c.a = a1; + //assert.ok(!traverse.deepEqual(a0, a1)); +}; + +function make () { + var a = { self : 'a' }; + var b = { self : 'b' }; + var c = { self : 'c' }; + var d = { self : 'd' }; + var e = { self : 'e' }; + + a.a = a; + a.b = b; + a.c = c; + + b.a = a; + b.b = b; + b.c = c; + + c.a = a; + c.b = b; + c.c = c; + c.d = d; + + d.a = a; + d.b = b; + d.c = c; + d.d = d; + d.e = e; + + e.a = a; + e.b = b; + e.c = c; + e.d = d; + e.e = e; + + return a; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/package.json new file mode 100644 index 0000000..01aedf4 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/package.json @@ -0,0 +1,23 @@ +{ + "name" : "chainsaw", + "version" : "0.0.9", + "description" : "Build chainable fluent interfaces the easy way... with a freakin' chainsaw!", + "main" : "./index.js", + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-chainsaw.git" + }, + "dependencies" : { + "traverse" : ">=0.3.0 <0.4" + }, + "keywords" : [ + "chain", + "fluent", + "interface", + "monad", + "monadic" + ], + "author" : "James Halliday (http://substack.net)", + "license" : "MIT/X11", + "engine" : { "node" : ">=0.4.0" } +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/test/chainsaw.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/test/chainsaw.js new file mode 100644 index 0000000..0c24729 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/chainsaw/test/chainsaw.js @@ -0,0 +1,418 @@ +var assert = require('assert'); +var Chainsaw = require('chainsaw'); + +exports.getset = function () { + var to = setTimeout(function () { + assert.fail('builder never fired'); + }, 1000); + + var ch = Chainsaw(function (saw) { + clearTimeout(to); + var num = 0; + + this.get = function (cb) { + cb(num); + saw.next(); + }; + + this.set = function (n) { + num = n; + saw.next(); + }; + + var ti = setTimeout(function () { + assert.fail('end event not emitted'); + }, 50); + + saw.on('end', function () { + clearTimeout(ti); + assert.equal(times, 3); + }); + }); + + var times = 0; + ch + .get(function (x) { + assert.equal(x, 0); + times ++; + }) + .set(10) + .get(function (x) { + assert.equal(x, 10); + times ++; + }) + .set(20) + .get(function (x) { + assert.equal(x, 20); + times ++; + }) + ; +}; + +exports.nest = function () { + var ch = (function () { + var vars = {}; + return Chainsaw(function (saw) { + this.do = function (cb) { + saw.nest(cb, vars); + }; + }); + })(); + + var order = []; + var to = setTimeout(function () { + assert.fail("Didn't get to the end"); + }, 50); + + ch + .do(function (vars) { + vars.x = 'y'; + order.push(1); + + this + .do(function (vs) { + order.push(2); + vs.x = 'x'; + }) + .do(function (vs) { + order.push(3); + vs.z = 'z'; + }) + ; + }) + .do(function (vars) { + vars.y = 'y'; + order.push(4); + }) + .do(function (vars) { + assert.eql(order, [1,2,3,4]); + assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); + clearTimeout(to); + }) + ; +}; + +exports.nestWait = function () { + var ch = (function () { + var vars = {}; + return Chainsaw(function (saw) { + this.do = function (cb) { + saw.nest(cb, vars); + }; + + this.wait = function (n) { + setTimeout(function () { + saw.next(); + }, n); + }; + }); + })(); + + var order = []; + var to = setTimeout(function () { + assert.fail("Didn't get to the end"); + }, 1000); + + var times = {}; + + ch + .do(function (vars) { + vars.x = 'y'; + order.push(1); + + this + .do(function (vs) { + order.push(2); + vs.x = 'x'; + times.x = Date.now(); + }) + .wait(50) + .do(function (vs) { + order.push(3); + vs.z = 'z'; + + times.z = Date.now(); + var dt = times.z - times.x; + assert.ok(dt >= 50 && dt < 75); + }) + ; + }) + .do(function (vars) { + vars.y = 'y'; + order.push(4); + + times.y = Date.now(); + }) + .wait(100) + .do(function (vars) { + assert.eql(order, [1,2,3,4]); + assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); + clearTimeout(to); + + times.end = Date.now(); + var dt = times.end - times.y; + assert.ok(dt >= 100 && dt < 125) + }) + ; +}; + +exports.nestNext = function () { + var ch = (function () { + var vars = {}; + return Chainsaw(function (saw) { + this.do = function (cb) { + saw.nest(false, function () { + var args = [].slice.call(arguments); + args.push(saw.next); + cb.apply(this, args); + }, vars); + }; + }); + })(); + + var order = []; + var to = setTimeout(function () { + assert.fail("Didn't get to the end"); + }, 500); + + var times = []; + + ch + .do(function (vars, next_) { + vars.x = 'y'; + order.push(1); + + this + .do(function (vs, next) { + order.push(2); + vs.x = 'x'; + setTimeout(next, 30); + }) + .do(function (vs, next) { + order.push(3); + vs.z = 'z'; + setTimeout(next, 10); + }) + .do(function () { + setTimeout(next_, 20); + }) + ; + }) + .do(function (vars, next) { + vars.y = 'y'; + order.push(4); + setTimeout(next, 5); + }) + .do(function (vars) { + assert.eql(order, [1,2,3,4]); + assert.eql(vars, { x : 'x', y : 'y', z : 'z' }); + + clearTimeout(to); + }) + ; +}; + +exports.builder = function () { + var cx = Chainsaw(function (saw) { + this.x = function () {}; + }); + assert.ok(cx.x); + + var cy = Chainsaw(function (saw) { + return { y : function () {} }; + }); + assert.ok(cy.y); + + var cz = Chainsaw(function (saw) { + return { z : function (cb) { saw.nest(cb) } }; + }); + assert.ok(cz.z); + + var to = setTimeout(function () { + assert.fail("Nested z didn't run"); + }, 50); + + cz.z(function () { + clearTimeout(to); + assert.ok(this.z); + }); +}; + +this.attr = function () { + var to = setTimeout(function () { + assert.fail("attr chain didn't finish"); + }, 50); + + var xy = []; + var ch = Chainsaw(function (saw) { + this.h = { + x : function () { + xy.push('x'); + saw.next(); + }, + y : function () { + xy.push('y'); + saw.next(); + assert.eql(xy, ['x','y']); + clearTimeout(to); + } + }; + }); + assert.ok(ch.h); + assert.ok(ch.h.x); + assert.ok(ch.h.y); + + ch.h.x().h.y(); +}; + +exports.down = function () { + var error = null; + var s; + var ch = Chainsaw(function (saw) { + s = saw; + this.raise = function (err) { + error = err; + saw.down('catch'); + }; + + this.do = function (cb) { + cb.call(this); + }; + + this.catch = function (cb) { + if (error) { + saw.nest(cb, error); + error = null; + } + else saw.next(); + }; + }); + + var to = setTimeout(function () { + assert.fail(".do() after .catch() didn't fire"); + }, 50); + + ch + .do(function () { + this.raise('pow'); + }) + .do(function () { + assert.fail("raise didn't skip over this do block"); + }) + .catch(function (err) { + assert.equal(err, 'pow'); + }) + .do(function () { + clearTimeout(to); + }) + ; +}; + +exports.trap = function () { + var error = null; + var ch = Chainsaw(function (saw) { + var pars = 0; + var stack = []; + var i = 0; + + this.par = function (cb) { + pars ++; + var j = i ++; + cb.call(function () { + pars --; + stack[j] = [].slice.call(arguments); + saw.down('result'); + }); + saw.next(); + }; + + this.join = function (cb) { + saw.trap('result', function () { + if (pars == 0) { + cb.apply(this, stack); + saw.next(); + } + }); + }; + + this.raise = function (err) { + error = err; + saw.down('catch'); + }; + + this.do = function (cb) { + cb.call(this); + }; + + this.catch = function (cb) { + if (error) { + saw.nest(cb, error); + error = null; + } + else saw.next(); + }; + }); + + var to = setTimeout(function () { + assert.fail(".do() after .join() didn't fire"); + }, 100); + var tj = setTimeout(function () { + assert.fail('.join() never fired'); + }, 100); + + var joined = false; + ch + .par(function () { + setTimeout(this.bind(null, 1), 50); + }) + .par(function () { + setTimeout(this.bind(null, 2), 25); + }) + .join(function (x, y) { + assert.equal(x[0], 1); + assert.equal(y[0], 2); + clearTimeout(tj); + joined = true; + }) + .do(function () { + clearTimeout(to); + assert.ok(joined); + }) + ; +}; + +exports.jump = function () { + var to = setTimeout(function () { + assert.fail('builder never fired'); + }, 50); + + var xs = [ 4, 5, 6, -4, 8, 9, -1, 8 ]; + var xs_ = []; + + var ch = Chainsaw(function (saw) { + this.x = function (i) { + xs_.push(i); + saw.next(); + }; + + this.y = function (step) { + var x = xs.shift(); + if (x > 0) saw.jump(step); + else saw.next(); + }; + + saw.on('end', function () { + clearTimeout(to); + assert.eql(xs, [ 8 ]); + assert.eql(xs_, [ 1, 1, 1, 1, 2, 3, 2, 3, 2, 3 ]); + }); + }); + + ch + .x(1) + .y(0) + .x(2) + .x(3) + .y(2) + ; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/README.markdown new file mode 100644 index 0000000..1f39d59 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/README.markdown @@ -0,0 +1,191 @@ +Hashish +======= + +Hashish is a node.js library for manipulating hash data structures. +It is distilled from the finest that ruby, perl, and haskell have to offer by +way of hash/map interfaces. + +Hashish provides a chaining interface, where you can do: + + var Hash = require('hashish'); + + Hash({ a : 1, b : 2, c : 3, d : 4 }) + .map(function (x) { return x * 10 }) + .filter(function (x) { return x < 30 }) + .forEach(function (x, key) { + console.log(key + ' => ' + x); + }) + ; + +Output: + + a => 10 + b => 20 + +Some functions and attributes in the chaining interface are terminal, like +`.items` or `.detect()`. They return values of their own instead of the chain +context. + +Each function in the chainable interface is also attached to `Hash` in chainless +form: + + var Hash = require('hashish'); + var obj = { a : 1, b : 2, c : 3, d : 4 }; + + var mapped = Hash.map(obj, function (x) { + return x * 10 + }); + + console.dir(mapped); + +Output: + + { a: 10, b: 20, c: 30, d: 40 } + +In either case, the 'this' context of the function calls is the same object that +the chained functions return, so you can make nested chains. + +Methods +======= + +forEach(cb) +----------- + +For each key/value in the hash, calls `cb(value, key)`. + +map(cb) +------- + +For each key/value in the hash, calls `cb(value, key)`. +The return value of `cb` is the new value at `key` in the resulting hash. + +filter(cb) +---------- + +For each key/value in the hash, calls `cb(value, key)`. +The resulting hash omits key/value pairs where `cb` returned a falsy value. + +detect(cb) +---------- + +Returns the first value in the hash for which `cb(value, key)` is non-falsy. +Order of hashes is not well-defined so watch out for that. + +reduce(cb) +---------- + +Returns the accumulated value of a left-fold over the key/value pairs. + +some(cb) +-------- + +Returns a boolean: whether or not `cb(value, key)` ever returned a non-falsy +value. + +update(obj1, [obj2, obj3, ...]) +----------- + +Mutate the context hash, merging the key/value pairs from the passed objects +and overwriting keys from the context hash if the current `obj` has keys of +the same name. Falsy arguments are silently ignored. + +updateAll([ obj1, obj2, ... ]) +------------------------------ + +Like multi-argument `update()` but operate on an array directly. + +merge(obj1, [obj2, obj3, ...]) +---------- + +Merge the key/value pairs from the passed objects into the resultant hash +without modifying the context hash. Falsy arguments are silently ignored. + +mergeAll([ obj1, obj2, ... ]) +------------------------------ + +Like multi-argument `merge()` but operate on an array directly. + +has(key) +-------- + +Return whether the hash has a key, `key`. + +valuesAt(keys) +-------------- + +Return an Array with the values at the keys from `keys`. + +tap(cb) +------- + +Call `cb` with the present raw hash. +This function is chainable. + +extract(keys) +------------- + +Filter by including only those keys in `keys` in the resulting hash. + +exclude(keys) +------------- + +Filter by excluding those keys in `keys` in the resulting hash. + +Attributes +========== + +These are attributes in the chaining interface and functions in the `Hash.xxx` +interface. + +keys +---- + +Return all the enumerable attribute keys in the hash. + +values +------ + +Return all the enumerable attribute values in the hash. + +compact +------- + +Filter out values which are `=== undefined`. + +clone +----- + +Make a deep copy of the hash. + +copy +---- + +Make a shallow copy of the hash. + +length +------ + +Return the number of key/value pairs in the hash. +Note: use `Hash.size()` for non-chain mode. + +size +---- + +Alias for `length` since `Hash.length` is masked by `Function.prototype`. + +See Also +======== + +See also [creationix's pattern/hash](http://github.com/creationix/pattern), +which does a similar thing except with hash inputs and array outputs. + +Installation +============ + +To install with [npm](http://github.com/isaacs/npm): + + npm install hashish + +To run the tests with [expresso](http://github.com/visionmedia/expresso): + + expresso diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/examples/chain.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/examples/chain.js new file mode 100644 index 0000000..74ded5e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/examples/chain.js @@ -0,0 +1,9 @@ +var Hash = require('hashish'); + +Hash({ a : 1, b : 2, c : 3, d : 4 }) + .map(function (x) { return x * 10 }) + .filter(function (x) { return x < 30 }) + .forEach(function (x, key) { + console.log(key + ' => ' + x); + }) +; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/examples/map.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/examples/map.js new file mode 100644 index 0000000..119d3d9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/examples/map.js @@ -0,0 +1,7 @@ +var Hash = require('hashish'); +var obj = { a : 1, b : 2, c : 3, d : 4 }; + +var mapped = Hash.map(obj, function (x) { + return x * 10 +}); +console.dir(mapped); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/index.js new file mode 100644 index 0000000..1bc28e2 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/index.js @@ -0,0 +1,253 @@ +module.exports = Hash; +var Traverse = require('traverse'); + +function Hash (hash, xs) { + if (Array.isArray(hash) && Array.isArray(xs)) { + var to = Math.min(hash.length, xs.length); + var acc = {}; + for (var i = 0; i < to; i++) { + acc[hash[i]] = xs[i]; + } + return Hash(acc); + } + + if (hash === undefined) return Hash({}); + + var self = { + map : function (f) { + var acc = { __proto__ : hash.__proto__ }; + Object.keys(hash).forEach(function (key) { + acc[key] = f.call(self, hash[key], key); + }); + return Hash(acc); + }, + forEach : function (f) { + Object.keys(hash).forEach(function (key) { + f.call(self, hash[key], key); + }); + return self; + }, + filter : function (f) { + var acc = { __proto__ : hash.__proto__ }; + Object.keys(hash).forEach(function (key) { + if (f.call(self, hash[key], key)) { + acc[key] = hash[key]; + } + }); + return Hash(acc); + }, + detect : function (f) { + for (var key in hash) { + if (f.call(self, hash[key], key)) { + return hash[key]; + } + } + return undefined; + }, + reduce : function (f, acc) { + var keys = Object.keys(hash); + if (acc === undefined) acc = keys.shift(); + keys.forEach(function (key) { + acc = f.call(self, acc, hash[key], key); + }); + return acc; + }, + some : function (f) { + for (var key in hash) { + if (f.call(self, hash[key], key)) return true; + } + return false; + }, + update : function (obj) { + if (arguments.length > 1) { + self.updateAll([].slice.call(arguments)); + } + else { + Object.keys(obj).forEach(function (key) { + hash[key] = obj[key]; + }); + } + return self; + }, + updateAll : function (xs) { + xs.filter(Boolean).forEach(function (x) { + self.update(x); + }); + return self; + }, + merge : function (obj) { + if (arguments.length > 1) { + return self.copy.updateAll([].slice.call(arguments)); + } + else { + return self.copy.update(obj); + } + }, + mergeAll : function (xs) { + return self.copy.updateAll(xs); + }, + has : function (key) { // only operates on enumerables + return Array.isArray(key) + ? key.every(function (k) { return self.has(k) }) + : self.keys.indexOf(key.toString()) >= 0; + }, + valuesAt : function (keys) { + return Array.isArray(keys) + ? keys.map(function (key) { return hash[key] }) + : hash[keys] + ; + }, + tap : function (f) { + f.call(self, hash); + return self; + }, + extract : function (keys) { + var acc = {}; + keys.forEach(function (key) { + acc[key] = hash[key]; + }); + return Hash(acc); + }, + exclude : function (keys) { + return self.filter(function (_, key) { + return keys.indexOf(key) < 0 + }); + }, + end : hash, + items : hash + }; + + var props = { + keys : function () { return Object.keys(hash) }, + values : function () { + return Object.keys(hash).map(function (key) { return hash[key] }); + }, + compact : function () { + return self.filter(function (x) { return x !== undefined }); + }, + clone : function () { return Hash(Hash.clone(hash)) }, + copy : function () { return Hash(Hash.copy(hash)) }, + length : function () { return Object.keys(hash).length }, + size : function () { return self.length } + }; + + if (Object.defineProperty) { + // es5-shim has an Object.defineProperty but it throws for getters + try { + for (var key in props) { + Object.defineProperty(self, key, { get : props[key] }); + } + } + catch (err) { + for (var key in props) { + if (key !== 'clone' && key !== 'copy' && key !== 'compact') { + // ^ those keys use Hash() so can't call them without + // a stack overflow + self[key] = props[key](); + } + } + } + } + else if (self.__defineGetter__) { + for (var key in props) { + self.__defineGetter__(key, props[key]); + } + } + else { + // non-lazy version for browsers that suck >_< + for (var key in props) { + self[key] = props[key](); + } + } + + return self; +}; + +// deep copy +Hash.clone = function (ref) { + return Traverse.clone(ref); +}; + +// shallow copy +Hash.copy = function (ref) { + var hash = { __proto__ : ref.__proto__ }; + Object.keys(ref).forEach(function (key) { + hash[key] = ref[key]; + }); + return hash; +}; + +Hash.map = function (ref, f) { + return Hash(ref).map(f).items; +}; + +Hash.forEach = function (ref, f) { + Hash(ref).forEach(f); +}; + +Hash.filter = function (ref, f) { + return Hash(ref).filter(f).items; +}; + +Hash.detect = function (ref, f) { + return Hash(ref).detect(f); +}; + +Hash.reduce = function (ref, f, acc) { + return Hash(ref).reduce(f, acc); +}; + +Hash.some = function (ref, f) { + return Hash(ref).some(f); +}; + +Hash.update = function (a /*, b, c, ... */) { + var args = Array.prototype.slice.call(arguments, 1); + var hash = Hash(a); + return hash.update.apply(hash, args).items; +}; + +Hash.merge = function (a /*, b, c, ... */) { + var args = Array.prototype.slice.call(arguments, 1); + var hash = Hash(a); + return hash.merge.apply(hash, args).items; +}; + +Hash.has = function (ref, key) { + return Hash(ref).has(key); +}; + +Hash.valuesAt = function (ref, keys) { + return Hash(ref).valuesAt(keys); +}; + +Hash.tap = function (ref, f) { + return Hash(ref).tap(f).items; +}; + +Hash.extract = function (ref, keys) { + return Hash(ref).extract(keys).items; +}; + +Hash.exclude = function (ref, keys) { + return Hash(ref).exclude(keys).items; +}; + +Hash.concat = function (xs) { + var hash = Hash({}); + xs.forEach(function (x) { hash.update(x) }); + return hash.items; +}; + +Hash.zip = function (xs, ys) { + return Hash(xs, ys).items; +}; + +// .length is already defined for function prototypes +Hash.size = function (ref) { + return Hash(ref).size; +}; + +Hash.compact = function (ref) { + return Hash(ref).compact.items; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/LICENSE b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/LICENSE new file mode 100644 index 0000000..7b75500 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/LICENSE @@ -0,0 +1,24 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: +http://www.opensource.org/licenses/mit-license.php + +Copyright 2010 James Halliday (mail@substack.net) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/README.markdown new file mode 100644 index 0000000..75a0ec1 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/README.markdown @@ -0,0 +1,256 @@ +traverse +======== + +Traverse and transform objects by visiting every node on a recursive walk. + +examples +======== + +transform negative numbers in-place +----------------------------------- + +negative.js + +````javascript +var traverse = require('traverse'); +var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + +traverse(obj).forEach(function (x) { + if (x < 0) this.update(x + 128); +}); + +console.dir(obj); +```` + +Output: + + [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ] + +collect leaf nodes +------------------ + +leaves.js + +````javascript +var traverse = require('traverse'); + +var obj = { + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 }, +}; + +var leaves = traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; +}, []); + +console.dir(leaves); +```` + +Output: + + [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] + +scrub circular references +------------------------- + +scrub.js: + +````javascript +var traverse = require('traverse'); + +var obj = { a : 1, b : 2, c : [ 3, 4 ] }; +obj.c.push(obj); + +var scrubbed = traverse(obj).map(function (x) { + if (this.circular) this.remove() +}); +console.dir(scrubbed); +```` + +output: + + { a: 1, b: 2, c: [ 3, 4 ] } + +methods +======= + +Each method that takes an `fn` uses the context documented below in the context +section. + +.map(fn) +-------- + +Execute `fn` for each node in the object and return a new object with the +results of the walk. To update nodes in the result use `this.update(value)`. + +.forEach(fn) +------------ + +Execute `fn` for each node in the object but unlike `.map()`, when +`this.update()` is called it updates the object in-place. + +.reduce(fn, acc) +---------------- + +For each node in the object, perform a +[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) +with the return value of `fn(acc, node)`. + +If `acc` isn't specified, `acc` is set to the root object for the first step +and the root element is skipped. + +.paths() +-------- + +Return an `Array` of every possible non-cyclic path in the object. +Paths are `Array`s of string keys. + +.nodes() +-------- + +Return an `Array` of every node in the object. + +.clone() +-------- + +Create a deep clone of the object. + +.get(path) +---------- + +Get the element at the array `path`. + +.set(path, value) +----------------- + +Set the element at the array `path` to `value`. + +.has(path) +---------- + +Return whether the element at the array `path` exists. + +context +======= + +Each method that takes a callback has a context (its `this` object) with these +attributes: + +this.node +--------- + +The present node on the recursive walk + +this.path +--------- + +An array of string keys from the root to the present node + +this.parent +----------- + +The context of the node's parent. +This is `undefined` for the root node. + +this.key +-------- + +The name of the key of the present node in its parent. +This is `undefined` for the root node. + +this.isRoot, this.notRoot +------------------------- + +Whether the present node is the root node + +this.isLeaf, this.notLeaf +------------------------- + +Whether or not the present node is a leaf node (has no children) + +this.level +---------- + +Depth of the node within the traversal + +this.circular +------------- + +If the node equals one of its parents, the `circular` attribute is set to the +context of that parent and the traversal progresses no deeper. + +this.update(value, stopHere=false) +---------------------------------- + +Set a new value for the present node. + +All the elements in `value` will be recursively traversed unless `stopHere` is +true. + +this.remove(stopHere=false) +------------- + +Remove the current element from the output. If the node is in an Array it will +be spliced off. Otherwise it will be deleted from its parent. + +this.delete(stopHere=false) +------------- + +Delete the current element from its parent in the output. Calls `delete` even on +Arrays. + +this.before(fn) +--------------- + +Call this function before any of the children are traversed. + +You can assign into `this.keys` here to traverse in a custom order. + +this.after(fn) +-------------- + +Call this function after any of the children are traversed. + +this.pre(fn) +------------ + +Call this function before each of the children are traversed. + +this.post(fn) +------------- + +Call this function after each of the children are traversed. + + +install +======= + +Using [npm](http://npmjs.org) do: + + $ npm install traverse + +test +==== + +Using [expresso](http://github.com/visionmedia/expresso) do: + + $ expresso + + 100% wahoo, your stuff is not broken! + +in the browser +============== + +Use [browserify](https://github.com/substack/node-browserify) to run traverse in +the browser. + +traverse has been tested and works with: + +* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0 +* Firefox 3.5 +* Chrome 6.0 +* Opera 10.6 +* Safari 5.0 diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/json.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/json.js new file mode 100755 index 0000000..50d612e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/json.js @@ -0,0 +1,16 @@ +var traverse = require('traverse'); + +var id = 54; +var callbacks = {}; +var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; + +var scrubbed = traverse(obj).map(function (x) { + if (typeof x === 'function') { + callbacks[id] = { id : id, f : x, path : this.path }; + this.update('[Function]'); + id++; + } +}); + +console.dir(scrubbed); +console.dir(callbacks); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/leaves.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/leaves.js new file mode 100755 index 0000000..c1b310b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/leaves.js @@ -0,0 +1,15 @@ +var traverse = require('traverse'); + +var obj = { + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 }, +}; + +var leaves = traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; +}, []); + +console.dir(leaves); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/negative.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/negative.js new file mode 100755 index 0000000..78608a0 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/negative.js @@ -0,0 +1,8 @@ +var traverse = require('traverse'); +var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + +traverse(obj).forEach(function (x) { + if (x < 0) this.update(x + 128); +}); + +console.dir(obj); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/scrub.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/scrub.js new file mode 100755 index 0000000..5d15b91 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/scrub.js @@ -0,0 +1,10 @@ +// scrub out circular references +var traverse = require('traverse'); + +var obj = { a : 1, b : 2, c : [ 3, 4 ] }; +obj.c.push(obj); + +var scrubbed = traverse(obj).map(function (x) { + if (this.circular) this.remove() +}); +console.dir(scrubbed); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/stringify.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/stringify.js new file mode 100755 index 0000000..167b68b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/examples/stringify.js @@ -0,0 +1,38 @@ +#!/usr/bin/env node +var traverse = require('traverse'); + +var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + +var s = ''; +traverse(obj).forEach(function to_s (node) { + if (Array.isArray(node)) { + this.before(function () { s += '[' }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += ']' }); + } + else if (typeof node == 'object') { + this.before(function () { s += '{' }); + this.pre(function (x, key) { + to_s(key); + s += ':'; + }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += '}' }); + } + else if (typeof node == 'string') { + s += '"' + node.toString().replace(/"/g, '\\"') + '"'; + } + else if (typeof node == 'function') { + s += 'null'; + } + else { + s += node.toString(); + } +}); + +console.log('JSON.stringify: ' + JSON.stringify(obj)); +console.log('this stringify: ' + s); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/index.js new file mode 100644 index 0000000..f3076a7 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/index.js @@ -0,0 +1,279 @@ +module.exports = Traverse; +function Traverse (obj) { + if (!(this instanceof Traverse)) return new Traverse(obj); + this.value = obj; +} + +Traverse.prototype.get = function (ps) { + var node = this.value; + for (var i = 0; i < ps.length; i ++) { + var key = ps[i]; + if (!Object.hasOwnProperty.call(node, key)) { + node = undefined; + break; + } + node = node[key]; + } + return node; +}; + +Traverse.prototype.has = function (ps) { + var node = this.value; + for (var i = 0; i < ps.length; i ++) { + var key = ps[i]; + if (!Object.hasOwnProperty.call(node, key)) { + return false; + } + node = node[key]; + } + return true; +}; + +Traverse.prototype.set = function (ps, value) { + var node = this.value; + for (var i = 0; i < ps.length - 1; i ++) { + var key = ps[i]; + if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; + node = node[key]; + } + node[ps[i]] = value; + return value; +}; + +Traverse.prototype.map = function (cb) { + return walk(this.value, cb, true); +}; + +Traverse.prototype.forEach = function (cb) { + this.value = walk(this.value, cb, false); + return this.value; +}; + +Traverse.prototype.reduce = function (cb, init) { + var skip = arguments.length === 1; + var acc = skip ? this.value : init; + this.forEach(function (x) { + if (!this.isRoot || !skip) { + acc = cb.call(this, acc, x); + } + }); + return acc; +}; + +Traverse.prototype.paths = function () { + var acc = []; + this.forEach(function (x) { + acc.push(this.path); + }); + return acc; +}; + +Traverse.prototype.nodes = function () { + var acc = []; + this.forEach(function (x) { + acc.push(this.node); + }); + return acc; +}; + +Traverse.prototype.clone = function () { + var parents = [], nodes = []; + + return (function clone (src) { + for (var i = 0; i < parents.length; i++) { + if (parents[i] === src) { + return nodes[i]; + } + } + + if (typeof src === 'object' && src !== null) { + var dst = copy(src); + + parents.push(src); + nodes.push(dst); + + forEach(Object_keys(src), function (key) { + dst[key] = clone(src[key]); + }); + + parents.pop(); + nodes.pop(); + return dst; + } + else { + return src; + } + })(this.value); +}; + +function walk (root, cb, immutable) { + var path = []; + var parents = []; + var alive = true; + + return (function walker (node_) { + var node = immutable ? copy(node_) : node_; + var modifiers = {}; + + var keepGoing = true; + + var state = { + node : node, + node_ : node_, + path : [].concat(path), + parent : parents[parents.length - 1], + parents : parents, + key : path.slice(-1)[0], + isRoot : path.length === 0, + level : path.length, + circular : null, + update : function (x, stopHere) { + if (!state.isRoot) { + state.parent.node[state.key] = x; + } + state.node = x; + if (stopHere) keepGoing = false; + }, + 'delete' : function (stopHere) { + delete state.parent.node[state.key]; + if (stopHere) keepGoing = false; + }, + remove : function (stopHere) { + if (Array_isArray(state.parent.node)) { + state.parent.node.splice(state.key, 1); + } + else { + delete state.parent.node[state.key]; + } + if (stopHere) keepGoing = false; + }, + keys : null, + before : function (f) { modifiers.before = f }, + after : function (f) { modifiers.after = f }, + pre : function (f) { modifiers.pre = f }, + post : function (f) { modifiers.post = f }, + stop : function () { alive = false }, + block : function () { keepGoing = false } + }; + + if (!alive) return state; + + if (typeof node === 'object' && node !== null) { + state.keys = Object_keys(node); + + state.isLeaf = state.keys.length == 0; + + for (var i = 0; i < parents.length; i++) { + if (parents[i].node_ === node_) { + state.circular = parents[i]; + break; + } + } + } + else { + state.isLeaf = true; + } + + state.notLeaf = !state.isLeaf; + state.notRoot = !state.isRoot; + + // use return values to update if defined + var ret = cb.call(state, state.node); + if (ret !== undefined && state.update) state.update(ret); + + if (modifiers.before) modifiers.before.call(state, state.node); + + if (!keepGoing) return state; + + if (typeof state.node == 'object' + && state.node !== null && !state.circular) { + parents.push(state); + + forEach(state.keys, function (key, i) { + path.push(key); + + if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); + + var child = walker(state.node[key]); + if (immutable && Object.hasOwnProperty.call(state.node, key)) { + state.node[key] = child.node; + } + + child.isLast = i == state.keys.length - 1; + child.isFirst = i == 0; + + if (modifiers.post) modifiers.post.call(state, child); + + path.pop(); + }); + parents.pop(); + } + + if (modifiers.after) modifiers.after.call(state, state.node); + + return state; + })(root).node; +} + +function copy (src) { + if (typeof src === 'object' && src !== null) { + var dst; + + if (Array_isArray(src)) { + dst = []; + } + else if (src instanceof Date) { + dst = new Date(src); + } + else if (src instanceof Boolean) { + dst = new Boolean(src); + } + else if (src instanceof Number) { + dst = new Number(src); + } + else if (src instanceof String) { + dst = new String(src); + } + else if (Object.create && Object.getPrototypeOf) { + dst = Object.create(Object.getPrototypeOf(src)); + } + else if (src.__proto__ || src.constructor.prototype) { + var proto = src.__proto__ || src.constructor.prototype || {}; + var T = function () {}; + T.prototype = proto; + dst = new T; + if (!dst.__proto__) dst.__proto__ = proto; + } + + forEach(Object_keys(src), function (key) { + dst[key] = src[key]; + }); + return dst; + } + else return src; +} + +var Object_keys = Object.keys || function keys (obj) { + var res = []; + for (var key in obj) res.push(key) + return res; +}; + +var Array_isArray = Array.isArray || function isArray (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +var forEach = function (xs, fn) { + if (xs.forEach) return xs.forEach(fn) + else for (var i = 0; i < xs.length; i++) { + fn(xs[i], i, xs); + } +}; + +forEach(Object_keys(Traverse.prototype), function (key) { + Traverse[key] = function (obj) { + var args = [].slice.call(arguments, 1); + var t = Traverse(obj); + return t[key].apply(t, args); + }; +}); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/package.json new file mode 100644 index 0000000..80dabdb --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/package.json @@ -0,0 +1,18 @@ +{ + "name" : "traverse", + "version" : "0.6.0", + "description" : "Traverse and transform objects by visiting every node on a recursive walk", + "author" : "James Halliday", + "license" : "MIT/X11", + "main" : "./index", + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/js-traverse.git" + }, + "devDependencies" : { + "expresso" : "0.7.x" + }, + "scripts" : { + "test" : "expresso" + } +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/circular.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/circular.js new file mode 100644 index 0000000..9162601 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/circular.js @@ -0,0 +1,115 @@ +var assert = require('assert'); +var Traverse = require('../'); +var deepEqual = require('./lib/deep_equal'); +var util = require('util'); + +exports.circular = function () { + var obj = { x : 3 }; + obj.y = obj; + var foundY = false; + Traverse(obj).forEach(function (x) { + if (this.path.join('') == 'y') { + assert.equal( + util.inspect(this.circular.node), + util.inspect(obj) + ); + foundY = true; + } + }); + assert.ok(foundY); +}; + +exports.deepCirc = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + + var times = 0; + Traverse(obj).forEach(function (x) { + if (this.circular) { + assert.deepEqual(this.circular.path, []); + assert.deepEqual(this.path, [ 'y', 2 ]); + times ++; + } + }); + + assert.deepEqual(times, 1); +}; + +exports.doubleCirc = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + var circs = []; + Traverse(obj).forEach(function (x) { + if (this.circular) { + circs.push({ circ : this.circular, self : this, node : x }); + } + }); + + assert.deepEqual(circs[0].self.path, [ 'x', 3, 2 ]); + assert.deepEqual(circs[0].circ.path, []); + + assert.deepEqual(circs[1].self.path, [ 'y', 2 ]); + assert.deepEqual(circs[1].circ.path, []); + + assert.deepEqual(circs.length, 2); +}; + +exports.circDubForEach = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + Traverse(obj).forEach(function (x) { + if (this.circular) this.update('...'); + }); + + assert.deepEqual(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); +}; + +exports.circDubMap = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + var c = Traverse(obj).map(function (x) { + if (this.circular) { + this.update('...'); + } + }); + + assert.deepEqual(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); +}; + +exports.circClone = function () { + var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; + obj.y[2] = obj; + obj.x.push(obj.y); + + var clone = Traverse.clone(obj); + assert.ok(obj !== clone); + + assert.ok(clone.y[2] === clone); + assert.ok(clone.y[2] !== obj); + assert.ok(clone.x[3][2] === clone); + assert.ok(clone.x[3][2] !== obj); + assert.deepEqual(clone.x.slice(0,3), [1,2,3]); + assert.deepEqual(clone.y.slice(0,2), [4,5]); +}; + +exports.circMapScrub = function () { + var obj = { a : 1, b : 2 }; + obj.c = obj; + + var scrubbed = Traverse(obj).map(function (node) { + if (this.circular) this.remove(); + }); + assert.deepEqual( + Object.keys(scrubbed).sort(), + [ 'a', 'b' ] + ); + assert.ok(deepEqual(scrubbed, { a : 1, b : 2 })); + + assert.equal(obj.c, obj); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/date.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/date.js new file mode 100644 index 0000000..4ca06dc --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/date.js @@ -0,0 +1,35 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports.dateEach = function () { + var obj = { x : new Date, y : 10, z : 5 }; + + var counts = {}; + + Traverse(obj).forEach(function (node) { + var t = (node instanceof Date && 'Date') || typeof node; + counts[t] = (counts[t] || 0) + 1; + }); + + assert.deepEqual(counts, { + object : 1, + Date : 1, + number : 2, + }); +}; + +exports.dateMap = function () { + var obj = { x : new Date, y : 10, z : 5 }; + + var res = Traverse(obj).map(function (node) { + if (typeof node === 'number') this.update(node + 100); + }); + + assert.ok(obj.x !== res.x); + assert.deepEqual(res, { + x : obj.x, + y : 110, + z : 105, + }); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/equal.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/equal.js new file mode 100644 index 0000000..decc755 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/equal.js @@ -0,0 +1,220 @@ +var assert = require('assert'); +var traverse = require('../'); +var deepEqual = require('./lib/deep_equal'); + +exports.deepDates = function () { + assert.ok( + deepEqual( + { d : new Date, x : [ 1, 2, 3 ] }, + { d : new Date, x : [ 1, 2, 3 ] } + ), + 'dates should be equal' + ); + + var d0 = new Date; + setTimeout(function () { + assert.ok( + !deepEqual( + { d : d0, x : [ 1, 2, 3 ], }, + { d : new Date, x : [ 1, 2, 3 ] } + ), + 'microseconds should count in date equality' + ); + }, 5); +}; + +exports.deepCircular = function () { + var a = [1]; + a.push(a); // a = [ 1, *a ] + + var b = [1]; + b.push(a); // b = [ 1, [ 1, *a ] ] + + assert.ok( + !deepEqual(a, b), + 'circular ref mount points count towards equality' + ); + + var c = [1]; + c.push(c); // c = [ 1, *c ] + assert.ok( + deepEqual(a, c), + 'circular refs are structurally the same here' + ); + + var d = [1]; + d.push(a); // c = [ 1, [ 1, *d ] ] + assert.ok( + deepEqual(b, d), + 'non-root circular ref structural comparison' + ); +}; + +exports.deepInstances = function () { + assert.ok( + !deepEqual([ new Boolean(false) ], [ false ]), + 'boolean instances are not real booleans' + ); + + assert.ok( + !deepEqual([ new String('x') ], [ 'x' ]), + 'string instances are not real strings' + ); + + assert.ok( + !deepEqual([ new Number(4) ], [ 4 ]), + 'number instances are not real numbers' + ); + + assert.ok( + deepEqual([ new RegExp('x') ], [ /x/ ]), + 'regexp instances are real regexps' + ); + + assert.ok( + !deepEqual([ new RegExp(/./) ], [ /../ ]), + 'these regexps aren\'t the same' + ); + + assert.ok( + !deepEqual( + [ function (x) { return x * 2 } ], + [ function (x) { return x * 2 } ] + ), + 'functions with the same .toString() aren\'t necessarily the same' + ); + + var f = function (x) { return x * 2 }; + assert.ok( + deepEqual([ f ], [ f ]), + 'these functions are actually equal' + ); +}; + +exports.deepEqual = function () { + assert.ok( + !deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }), + 'arrays are not objects' + ); +}; + +exports.falsy = function () { + assert.ok( + !deepEqual([ undefined ], [ null ]), + 'null is not undefined!' + ); + + assert.ok( + !deepEqual([ null ], [ undefined ]), + 'undefined is not null!' + ); + + assert.ok( + !deepEqual( + { a : 1, b : 2, c : [ 3, undefined, 5 ] }, + { a : 1, b : 2, c : [ 3, null, 5 ] } + ), + 'undefined is not null, however deeply!' + ); + + assert.ok( + !deepEqual( + { a : 1, b : 2, c : [ 3, undefined, 5 ] }, + { a : 1, b : 2, c : [ 3, null, 5 ] } + ), + 'null is not undefined, however deeply!' + ); + + assert.ok( + !deepEqual( + { a : 1, b : 2, c : [ 3, undefined, 5 ] }, + { a : 1, b : 2, c : [ 3, null, 5 ] } + ), + 'null is not undefined, however deeply!' + ); +}; + +exports.deletedArrayEqual = function () { + var xs = [ 1, 2, 3, 4 ]; + delete xs[2]; + + var ys = Object.create(Array.prototype); + ys[0] = 1; + ys[1] = 2; + ys[3] = 4; + + assert.ok( + deepEqual(xs, ys), + 'arrays with deleted elements are only equal to' + + ' arrays with similarly deleted elements' + ); + + assert.ok( + !deepEqual(xs, [ 1, 2, undefined, 4 ]), + 'deleted array elements cannot be undefined' + ); + + assert.ok( + !deepEqual(xs, [ 1, 2, null, 4 ]), + 'deleted array elements cannot be null' + ); +}; + +exports.deletedObjectEqual = function () { + var obj = { a : 1, b : 2, c : 3 }; + delete obj.c; + + assert.ok( + deepEqual(obj, { a : 1, b : 2 }), + 'deleted object elements should not show up' + ); + + assert.ok( + !deepEqual(obj, { a : 1, b : 2, c : undefined }), + 'deleted object elements are not undefined' + ); + + assert.ok( + !deepEqual(obj, { a : 1, b : 2, c : null }), + 'deleted object elements are not null' + ); +}; + +exports.emptyKeyEqual = function () { + assert.ok(!deepEqual( + { a : 1 }, { a : 1, '' : 55 } + )); +}; + +exports.deepArguments = function () { + assert.ok( + !deepEqual( + [ 4, 5, 6 ], + (function () { return arguments })(4, 5, 6) + ), + 'arguments are not arrays' + ); + + assert.ok( + deepEqual( + (function () { return arguments })(4, 5, 6), + (function () { return arguments })(4, 5, 6) + ), + 'arguments should equal' + ); +}; + +exports.deepUn = function () { + assert.ok(!deepEqual({ a : 1, b : 2 }, undefined)); + assert.ok(!deepEqual({ a : 1, b : 2 }, {})); + assert.ok(!deepEqual(undefined, { a : 1, b : 2 })); + assert.ok(!deepEqual({}, { a : 1, b : 2 })); + assert.ok(deepEqual(undefined, undefined)); + assert.ok(deepEqual(null, null)); + assert.ok(!deepEqual(undefined, null)); +}; + +exports.deepLevels = function () { + var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ]; + assert.ok(!deepEqual(xs, [])); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/has.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/has.js new file mode 100644 index 0000000..af0c83c --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/has.js @@ -0,0 +1,13 @@ +var assert = require('assert'); +var traverse = require('../'); + +exports.has = function () { + var obj = { a : 2, b : [ 4, 5, { c : 6 } ] }; + + assert.equal(traverse(obj).has([ 'b', 2, 'c' ]), true) + assert.equal(traverse(obj).has([ 'b', 2, 'c', 0 ]), false) + assert.equal(traverse(obj).has([ 'b', 2, 'd' ]), false) + assert.equal(traverse(obj).has([]), true) + assert.equal(traverse(obj).has([ 'a' ]), true) + assert.equal(traverse(obj).has([ 'a', 2 ]), false) +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/instance.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/instance.js new file mode 100644 index 0000000..8d73525 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/instance.js @@ -0,0 +1,17 @@ +var assert = require('assert'); +var Traverse = require('../'); +var EventEmitter = require('events').EventEmitter; + +exports['check instanceof on node elems'] = function () { + + var counts = { emitter : 0 }; + + Traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }]) + .forEach(function (node) { + if (node instanceof EventEmitter) counts.emitter ++; + }) + ; + + assert.equal(counts.emitter, 2); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/interface.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/interface.js new file mode 100644 index 0000000..fce5bf9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/interface.js @@ -0,0 +1,42 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports['interface map'] = function () { + var obj = { a : [ 5,6,7 ], b : { c : [8] } }; + + assert.deepEqual( + Traverse.paths(obj) + .sort() + .map(function (path) { return path.join('/') }) + .slice(1) + .join(' ') + , + 'a a/0 a/1 a/2 b b/c b/c/0' + ); + + assert.deepEqual( + Traverse.nodes(obj), + [ + { a: [ 5, 6, 7 ], b: { c: [ 8 ] } }, + [ 5, 6, 7 ], 5, 6, 7, + { c: [ 8 ] }, [ 8 ], 8 + ] + ); + + assert.deepEqual( + Traverse.map(obj, function (node) { + if (typeof node == 'number') { + return node + 1000; + } + else if (Array.isArray(node)) { + return node.join(' '); + } + }), + { a: '5 6 7', b: { c: '8' } } + ); + + var nodes = 0; + Traverse.forEach(obj, function (node) { nodes ++ }); + assert.deepEqual(nodes, 8); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/json.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/json.js new file mode 100644 index 0000000..0a04529 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/json.js @@ -0,0 +1,47 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports['json test'] = function () { + var id = 54; + var callbacks = {}; + var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; + + var scrubbed = Traverse(obj).map(function (x) { + if (typeof x === 'function') { + callbacks[id] = { id : id, f : x, path : this.path }; + this.update('[Function]'); + id++; + } + }); + + assert.equal( + scrubbed.moo, '[Function]', + 'obj.moo replaced with "[Function]"' + ); + + assert.equal( + scrubbed.foo[3], '[Function]', + 'obj.foo[3] replaced with "[Function]"' + ); + + assert.deepEqual(scrubbed, { + moo : '[Function]', + foo : [ 2, 3, 4, "[Function]" ] + }, 'Full JSON string matches'); + + assert.deepEqual( + typeof obj.moo, 'function', + 'Original obj.moo still a function' + ); + + assert.deepEqual( + typeof obj.foo[3], 'function', + 'Original obj.foo[3] still a function' + ); + + assert.deepEqual(callbacks, { + 54: { id: 54, f : obj.moo, path: [ 'moo' ] }, + 55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] }, + }, 'Check the generated callbacks list'); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/keys.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/keys.js new file mode 100644 index 0000000..7ecd545 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/keys.js @@ -0,0 +1,29 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports['sort test'] = function () { + var acc = []; + Traverse({ + a: 30, + b: 22, + id: 9 + }).forEach(function (node) { + if ((! Array.isArray(node)) && typeof node === 'object') { + this.before(function(node) { + this.keys = Object.keys(node); + this.keys.sort(function(a, b) { + a = [a === "id" ? 0 : 1, a]; + b = [b === "id" ? 0 : 1, b]; + return a < b ? -1 : a > b ? 1 : 0; + }); + }); + } + if (this.isLeaf) acc.push(node); + }); + + assert.equal( + acc.join(' '), + '9 30 22', + 'Traversal in a custom order' + ); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/leaves.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/leaves.js new file mode 100644 index 0000000..e520b72 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/leaves.js @@ -0,0 +1,21 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports['leaves test'] = function () { + var acc = []; + Traverse({ + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 } + }).forEach(function (x) { + if (this.isLeaf) acc.push(x); + }); + + assert.equal( + acc.join(' '), + '1 2 3 4 5 6 7 8 9', + 'Traversal in the right(?) order' + ); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/lib/deep_equal.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/lib/deep_equal.js new file mode 100644 index 0000000..4fa07bb --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/lib/deep_equal.js @@ -0,0 +1,92 @@ +var traverse = require('../../'); + +module.exports = function (a, b) { + if (arguments.length !== 2) { + throw new Error( + 'deepEqual requires exactly two objects to compare against' + ); + } + + var equal = true; + var node = b; + + traverse(a).forEach(function (y) { + var notEqual = (function () { + equal = false; + //this.stop(); + return undefined; + }).bind(this); + + //if (node === undefined || node === null) return notEqual(); + + if (!this.isRoot) { + /* + if (!Object.hasOwnProperty.call(node, this.key)) { + return notEqual(); + } + */ + if (typeof node !== 'object') return notEqual(); + node = node[this.key]; + } + + var x = node; + + this.post(function () { + node = x; + }); + + var toS = function (o) { + return Object.prototype.toString.call(o); + }; + + if (this.circular) { + if (traverse(b).get(this.circular.path) !== x) notEqual(); + } + else if (typeof x !== typeof y) { + notEqual(); + } + else if (x === null || y === null || x === undefined || y === undefined) { + if (x !== y) notEqual(); + } + else if (x.__proto__ !== y.__proto__) { + notEqual(); + } + else if (x === y) { + // nop + } + else if (typeof x === 'function') { + if (x instanceof RegExp) { + // both regexps on account of the __proto__ check + if (x.toString() != y.toString()) notEqual(); + } + else if (x !== y) notEqual(); + } + else if (typeof x === 'object') { + if (toS(y) === '[object Arguments]' + || toS(x) === '[object Arguments]') { + if (toS(x) !== toS(y)) { + notEqual(); + } + } + else if (x instanceof Date || y instanceof Date) { + if (!(x instanceof Date) || !(y instanceof Date) + || x.getTime() !== y.getTime()) { + notEqual(); + } + } + else { + var kx = Object.keys(x); + var ky = Object.keys(y); + if (kx.length !== ky.length) return notEqual(); + for (var i = 0; i < kx.length; i++) { + var k = kx[i]; + if (!Object.hasOwnProperty.call(y, k)) { + notEqual(); + } + } + } + } + }); + + return equal; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/mutability.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/mutability.js new file mode 100644 index 0000000..2236f56 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/mutability.js @@ -0,0 +1,252 @@ +var assert = require('assert'); +var Traverse = require('../'); +var deepEqual = require('./lib/deep_equal'); + +exports.mutate = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).forEach(function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, res); + assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.mutateT = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse.forEach(obj, function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, res); + assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.map = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).map(function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.mapT = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse.map(obj, function (x) { + if (typeof x === 'number' && x % 2 === 0) { + this.update(x * 10); + } + }); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); +}; + +exports.clone = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).clone(); + assert.deepEqual(obj, res); + assert.ok(obj !== res); + obj.a ++; + assert.deepEqual(res.a, 1); + obj.c.push(5); + assert.deepEqual(res.c, [ 3, 4 ]); +}; + +exports.cloneT = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse.clone(obj); + assert.deepEqual(obj, res); + assert.ok(obj !== res); + obj.a ++; + assert.deepEqual(res.a, 1); + obj.c.push(5); + assert.deepEqual(res.c, [ 3, 4 ]); +}; + +exports.reduce = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).reduce(function (acc, x) { + if (this.isLeaf) acc.push(x); + return acc; + }, []); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, [ 1, 2, 3, 4 ]); +}; + +exports.reduceInit = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).reduce(function (acc, x) { + if (this.isRoot) assert.fail('got root'); + return acc; + }); + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, obj); +}; + +exports.remove = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + Traverse(obj).forEach(function (x) { + if (this.isLeaf && x % 2 == 0) this.remove(); + }); + + assert.deepEqual(obj, { a : 1, c : [ 3 ] }); +}; + +exports.removeNoStop = function() { + var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; + + var keys = []; + Traverse(obj).forEach(function (x) { + keys.push(this.key) + if (this.key == 'c') this.remove(); + }); + + assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'd', 'e', 'f']) +} + +exports.removeStop = function() { + var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; + + var keys = []; + Traverse(obj).forEach(function (x) { + keys.push(this.key) + if (this.key == 'c') this.remove(true); + }); + + assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'f']) +} + +exports.removeMap = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).map(function (x) { + if (this.isLeaf && x % 2 == 0) this.remove(); + }); + + assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); + assert.deepEqual(res, { a : 1, c : [ 3 ] }); +}; + +exports.delete = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + Traverse(obj).forEach(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(!deepEqual( + obj, { a : 1, c : [ 3, undefined ] } + )); + + assert.ok(deepEqual( + obj, { a : 1, c : [ 3 ] } + )); + + assert.ok(!deepEqual( + obj, { a : 1, c : [ 3, null ] } + )); +}; + +exports.deleteNoStop = function() { + var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; + + var keys = []; + Traverse(obj).forEach(function (x) { + keys.push(this.key) + if (this.key == 'c') this.delete(); + }); + + assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'd', 'e']) +} + +exports.deleteStop = function() { + var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; + + var keys = []; + Traverse(obj).forEach(function (x) { + keys.push(this.key) + if (this.key == 'c') this.delete(true); + }); + + assert.deepEqual(keys, [undefined, 'a', 'b', 'c']) +} + +exports.deleteRedux = function () { + var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; + Traverse(obj).forEach(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(!deepEqual( + obj, { a : 1, c : [ 3, undefined, 5 ] } + )); + + assert.ok(deepEqual( + obj, { a : 1, c : [ 3 ,, 5 ] } + )); + + assert.ok(!deepEqual( + obj, { a : 1, c : [ 3, null, 5 ] } + )); + + assert.ok(!deepEqual( + obj, { a : 1, c : [ 3, 5 ] } + )); +}; + +exports.deleteMap = function () { + var obj = { a : 1, b : 2, c : [ 3, 4 ] }; + var res = Traverse(obj).map(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(deepEqual( + obj, + { a : 1, b : 2, c : [ 3, 4 ] } + )); + + var xs = [ 3, 4 ]; + delete xs[1]; + + assert.ok(deepEqual( + res, { a : 1, c : xs } + )); + + assert.ok(deepEqual( + res, { a : 1, c : [ 3, ] } + )); + + assert.ok(deepEqual( + res, { a : 1, c : [ 3 ] } + )); +}; + +exports.deleteMapRedux = function () { + var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; + var res = Traverse(obj).map(function (x) { + if (this.isLeaf && x % 2 == 0) this.delete(); + }); + + assert.ok(deepEqual( + obj, + { a : 1, b : 2, c : [ 3, 4, 5 ] } + )); + + var xs = [ 3, 4, 5 ]; + delete xs[1]; + + assert.ok(deepEqual( + res, { a : 1, c : xs } + )); + + assert.ok(!deepEqual( + res, { a : 1, c : [ 3, 5 ] } + )); + + assert.ok(deepEqual( + res, { a : 1, c : [ 3 ,, 5 ] } + )); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/negative.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/negative.js new file mode 100644 index 0000000..f92dfb0 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/negative.js @@ -0,0 +1,20 @@ +var Traverse = require('../'); +var assert = require('assert'); + +exports['negative update test'] = function () { + var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + var fixed = Traverse.map(obj, function (x) { + if (x < 0) this.update(x + 128); + }); + + assert.deepEqual(fixed, + [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ], + 'Negative values += 128' + ); + + assert.deepEqual(obj, + [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ], + 'Original references not modified' + ); +} + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/obj.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/obj.js new file mode 100644 index 0000000..d46fd38 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/obj.js @@ -0,0 +1,15 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports['traverse an object with nested functions'] = function () { + var to = setTimeout(function () { + assert.fail('never ran'); + }, 1000); + + function Cons (x) { + clearTimeout(to); + assert.equal(x, 10); + }; + Traverse(new Cons(10)); +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/siblings.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/siblings.js new file mode 100644 index 0000000..99c0f1b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/siblings.js @@ -0,0 +1,35 @@ +var assert = require('assert'); +var traverse = require('../'); + +exports.siblings = function () { + var obj = { a : 1, b : 2, c : [ 4, 5, 6 ] }; + + var res = traverse(obj).reduce(function (acc, x) { + var p = '/' + this.path.join('/'); + if (this.parent) { + acc[p] = { + siblings : this.parent.keys, + key : this.key, + index : this.parent.keys.indexOf(this.key) + }; + } + else { + acc[p] = { + siblings : [], + key : this.key, + index : -1 + } + } + return acc; + }, {}); + + assert.deepEqual(res, { + '/' : { siblings : [], key : undefined, index : -1 }, + '/a' : { siblings : [ 'a', 'b', 'c' ], key : 'a', index : 0 }, + '/b' : { siblings : [ 'a', 'b', 'c' ], key : 'b', index : 1 }, + '/c' : { siblings : [ 'a', 'b', 'c' ], key : 'c', index : 2 }, + '/c/0' : { siblings : [ '0', '1', '2' ], key : '0', index : 0 }, + '/c/1' : { siblings : [ '0', '1', '2' ], key : '1', index : 1 }, + '/c/2' : { siblings : [ '0', '1', '2' ], key : '2', index : 2 } + }); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stop.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stop.js new file mode 100644 index 0000000..3529847 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stop.js @@ -0,0 +1,41 @@ +var assert = require('assert'); +var traverse = require('../'); + +exports.stop = function () { + var visits = 0; + traverse('abcdefghij'.split('')).forEach(function (node) { + if (typeof node === 'string') { + visits ++; + if (node === 'e') this.stop() + } + }); + + assert.equal(visits, 5); +}; + +exports.stopMap = function () { + var s = traverse('abcdefghij'.split('')).map(function (node) { + if (typeof node === 'string') { + if (node === 'e') this.stop() + return node.toUpperCase(); + } + }).join(''); + + assert.equal(s, 'ABCDEfghij'); +}; + +exports.stopReduce = function () { + var obj = { + a : [ 4, 5 ], + b : [ 6, [ 7, 8, 9 ] ] + }; + var xs = traverse(obj).reduce(function (acc, node) { + if (this.isLeaf) { + if (node === 7) this.stop(); + else acc.push(node) + } + return acc; + }, []); + + assert.deepEqual(xs, [ 4, 5, 6 ]); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stringify.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stringify.js new file mode 100644 index 0000000..932f5d3 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/stringify.js @@ -0,0 +1,36 @@ +var assert = require('assert'); +var Traverse = require('../'); + +exports.stringify = function () { + var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; + + var s = ''; + Traverse(obj).forEach(function (node) { + if (Array.isArray(node)) { + this.before(function () { s += '[' }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += ']' }); + } + else if (typeof node == 'object') { + this.before(function () { s += '{' }); + this.pre(function (x, key) { + s += '"' + key + '"' + ':'; + }); + this.post(function (child) { + if (!child.isLast) s += ','; + }); + this.after(function () { s += '}' }); + } + else if (typeof node == 'function') { + s += 'null'; + } + else { + s += node.toString(); + } + }); + + assert.equal(s, JSON.stringify(obj)); +} + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/subexpr.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/subexpr.js new file mode 100644 index 0000000..a217beb --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/subexpr.js @@ -0,0 +1,34 @@ +var traverse = require('../'); +var assert = require('assert'); + +exports.subexpr = function () { + var obj = [ 'a', 4, 'b', 5, 'c', 6 ]; + var r = traverse(obj).map(function (x) { + if (typeof x === 'number') { + this.update([ x - 0.1, x, x + 0.1 ], true); + } + }); + + assert.deepEqual(obj, [ 'a', 4, 'b', 5, 'c', 6 ]); + assert.deepEqual(r, [ + 'a', [ 3.9, 4, 4.1 ], + 'b', [ 4.9, 5, 5.1 ], + 'c', [ 5.9, 6, 6.1 ], + ]); +}; + +exports.block = function () { + var obj = [ [ 1 ], [ 2 ], [ 3 ] ]; + var r = traverse(obj).map(function (x) { + if (Array.isArray(x) && !this.isRoot) { + if (x[0] === 5) this.block() + else this.update([ [ x[0] + 1 ] ]) + } + }); + + assert.deepEqual(r, [ + [ [ [ [ [ 5 ] ] ] ] ], + [ [ [ [ 5 ] ] ] ], + [ [ [ 5 ] ] ], + ]); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/super_deep.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/super_deep.js new file mode 100644 index 0000000..acac2fd --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/test/super_deep.js @@ -0,0 +1,55 @@ +var assert = require('assert'); +var traverse = require('../'); +var deepEqual = require('./lib/deep_equal'); + +exports.super_deep = function () { + var util = require('util'); + var a0 = make(); + var a1 = make(); + assert.ok(deepEqual(a0, a1)); + + a0.c.d.moo = true; + assert.ok(!deepEqual(a0, a1)); + + a1.c.d.moo = true; + assert.ok(deepEqual(a0, a1)); + + // TODO: this one + //a0.c.a = a1; + //assert.ok(!deepEqual(a0, a1)); +}; + +function make () { + var a = { self : 'a' }; + var b = { self : 'b' }; + var c = { self : 'c' }; + var d = { self : 'd' }; + var e = { self : 'e' }; + + a.a = a; + a.b = b; + a.c = c; + + b.a = a; + b.b = b; + b.c = c; + + c.a = a; + c.b = b; + c.c = c; + c.d = d; + + d.a = a; + d.b = b; + d.c = c; + d.d = d; + d.e = e; + + e.a = a; + e.b = b; + e.c = c; + e.d = d; + e.e = e; + + return a; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/testling/leaves.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/testling/leaves.js new file mode 100644 index 0000000..099a1b9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/node_modules/traverse/testling/leaves.js @@ -0,0 +1,22 @@ +var traverse = require('traverse'); +var test = require('testling'); + +test('leaves', function (t) { + var obj = { + a : [1,2,3], + b : 4, + c : [5,6], + d : { e : [7,8], f : 9 } + }; + + var acc = []; + traverse(obj).forEach(function (x) { + if (this.isLeaf) acc.push(x); + }); + + t.deepEqual( + acc, [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], + 'traversal in the proper order' + ); + t.end(); +}); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/package.json new file mode 100644 index 0000000..33c7f22 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/package.json @@ -0,0 +1,33 @@ +{ + "name" : "hashish", + "version" : "0.0.4", + "description" : "Hash data structure manipulation functions", + "main" : "./index.js", + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-hashish.git" + }, + "keywords": [ + "hash", + "object", + "convenience", + "manipulation", + "data structure" + ], + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "dependencies" : { + "traverse" : ">=0.2.4" + }, + "devDependencies" : { + "expresso" : ">=0.6.0" + }, + "scripts" : { + "test" : "expresso" + }, + "license" : "MIT/X11", + "engine" : ["node >=0.2.0"] +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/test/hash.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/test/hash.js new file mode 100644 index 0000000..6afce60 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/test/hash.js @@ -0,0 +1,250 @@ +var Hash = require('hashish'); +var assert = require('assert'); + +exports.map = function () { + var ref = { a : 1, b : 2 }; + var items = Hash(ref).map(function (v) { return v + 1 }).items; + var hash = Hash.map(ref, function (v) { return v + 1 }); + assert.deepEqual(ref, { a : 1, b : 2 }); + assert.deepEqual(items, { a : 2, b : 3 }); + assert.deepEqual(hash, { a : 2, b : 3 }); +}; + +exports['cloned map'] = function () { + var ref = { foo : [1,2], bar : [4,5] }; + var hash = Hash(ref).clone.map( + function (v) { v.unshift(v[0] - 1); return v } + ).items; + assert.deepEqual(ref.foo, [1,2]); + assert.deepEqual(ref.bar, [4,5]); + assert.deepEqual(hash.foo, [0,1,2]); + assert.deepEqual(hash.bar, [3,4,5]); +}; + +exports.forEach = function () { + var ref = { a : 5, b : 2, c : 7, 1337 : 'leet' }; + var xs = []; + Hash(ref).forEach(function (x, i) { + xs.push([ i, x ]); + }); + + assert.eql( + xs.map(function (x) { return x[0] }).sort(), + [ '1337', 'a', 'b', 'c' ] + ); + + assert.eql( + xs.map(function (x) { return x[1] }).sort(), + [ 2, 5, 7, 'leet' ] + ); + + var ys = []; + Hash.forEach(ref, function (x, i) { + ys.push([ i, x ]); + }); + + assert.eql(xs.sort(), ys.sort()); +}; + +exports.filter_items = function () { + var ref = { a : 5, b : 2, c : 7, 1337 : 'leet' }; + var items = Hash(ref).filter(function (v, k) { + return v > 5 || k > 5 + }).items; + var hash = Hash.filter(ref, function (v, k) { return v > 5 || k > 5 }); + assert.deepEqual(items, { 1337 : 'leet', c : 7 }); + assert.deepEqual(hash, { 1337 : 'leet', c : 7 }); + assert.deepEqual(ref, { a : 5, b : 2, c : 7, 1337 : 'leet' }); + assert.equal(Hash(ref).length, 4); +}; + +exports.detect = function () { + var h = { a : 5, b : 6, c : 7, d : 8 }; + var hh = Hash(h); + var gt6hh = hh.detect(function (x) { return x > 6 }); + assert.ok(gt6hh == 7 || gt6hh == 8); + var gt6h = Hash.detect(h, function (x) { return x > 6 }); + assert.ok(gt6h == 7 || gt6h == 8); + assert.equal(hh.detect(function (x) { return x > 100 }), undefined); +}; + +exports.reduce = function () { + var ref = { foo : [1,2], bar : [4,5] }; + + var sum1 = Hash(ref).reduce(function (acc, v) { + return acc + v.length + }, 0); + assert.equal(sum1, 4); + + var sum2 = Hash.reduce(ref, function (acc, v) { + return acc + v.length + }, 0); + assert.equal(sum2, 4); +}; + +exports.some = function () { + var h = { a : 5, b : 6, c : 7, d : 8 }; + var hh = Hash(h); + assert.ok(Hash.some(h, function (x) { return x > 7 })); + assert.ok(Hash.some(h, function (x) { return x < 6 })); + assert.ok(!Hash.some(h, function (x) { return x > 10 })); + assert.ok(!Hash.some(h, function (x) { return x < 0 })); + + assert.ok(hh.some(function (x) { return x > 7 })); + assert.ok(hh.some(function (x) { return x < 6 })); + assert.ok(!hh.some(function (x) { return x > 10 })); + assert.ok(!hh.some(function (x) { return x < 0 })); +}; + +exports.update = function () { + var ref = { a : 1, b : 2 }; + var items = Hash(ref).clone.update({ c : 3, a : 0 }).items; + assert.deepEqual(ref, { a : 1, b : 2 }); + assert.deepEqual(items, { a : 0, b : 2, c : 3 }); + + var hash = Hash.update(ref, { c : 3, a : 0 }); + assert.deepEqual(ref, hash); + assert.deepEqual(hash, { a : 0, b : 2, c : 3 }); + + var ref2 = {a: 1}; + var hash2 = Hash.update(ref2, { b: 2, c: 3 }, undefined, { d: 4 }); + assert.deepEqual(ref2, { a: 1, b: 2, c: 3, d: 4 }); +}; + +exports.merge = function () { + var ref = { a : 1, b : 2 }; + var items = Hash(ref).merge({ b : 3, c : 3.14 }).items; + var hash = Hash.merge(ref, { b : 3, c : 3.14 }); + + assert.deepEqual(ref, { a : 1, b : 2 }); + assert.deepEqual(items, { a : 1, b : 3, c : 3.14 }); + assert.deepEqual(hash, { a : 1, b : 3, c : 3.14 }); + + var ref2 = { a : 1 }; + var hash2 = Hash.merge(ref, { b: 2, c: 3 }, undefined, { d: 4 }); + assert.deepEqual(hash2, { a: 1, b: 2, c: 3, d: 4 }); +}; + +exports.has = function () { + var h = { a : 4, b : 5 }; + var hh = Hash(h); + + assert.ok(hh.has('a')); + assert.equal(hh.has('c'), false); + assert.ok(hh.has(['a','b'])); + assert.equal(hh.has(['a','b','c']), false); + + assert.ok(Hash.has(h, 'a')); + assert.equal(Hash.has(h, 'c'), false); + assert.ok(Hash.has(h, ['a','b'])); + assert.equal(Hash.has(h, ['a','b','c']), false); +}; + +exports.valuesAt = function () { + var h = { a : 4, b : 5, c : 6 }; + assert.equal(Hash(h).valuesAt('a'), 4); + assert.equal(Hash(h).valuesAt(['a'])[0], 4); + assert.deepEqual(Hash(h).valuesAt(['a','b']), [4,5]); + assert.equal(Hash.valuesAt(h, 'a'), 4); + assert.deepEqual(Hash.valuesAt(h, ['a']), [4]); + assert.deepEqual(Hash.valuesAt(h, ['a','b']), [4,5]); +}; + +exports.tap = function () { + var h = { a : 4, b : 5, c : 6 }; + var hh = Hash(h); + hh.tap(function (x) { + assert.ok(this === hh) + assert.eql(x, h); + }); + + Hash.tap(h, function (x) { + assert.eql( + Object.keys(this).sort(), + Object.keys(hh).sort() + ); + assert.eql(x, h); + }); +}; + +exports.extract = function () { + var hash = Hash({ a : 1, b : 2, c : 3 }).clone; + var extracted = hash.extract(['a','b']); + assert.equal(extracted.length, 2); + assert.deepEqual(extracted.items, { a : 1, b : 2 }); +}; + +exports.exclude = function () { + var hash = Hash({ a : 1, b : 2, c : 3 }).clone; + var extracted = hash.exclude(['a','b']); + assert.equal(extracted.length, 1); + assert.deepEqual(extracted.items, { c : 3 }); +}; + +exports.concat = function () { + var ref1 = { a : 1, b : 2 }; + var ref2 = { foo : 100, bar : 200 }; + var ref3 = { b : 3, c : 4, bar : 300 }; + + assert.deepEqual( + Hash.concat([ ref1, ref2 ]), + { a : 1, b : 2, foo : 100, bar : 200 } + ); + + assert.deepEqual( + Hash.concat([ ref1, ref2, ref3 ]), + { a : 1, b : 3, c : 4, foo : 100, bar : 300 } + ); +}; + +exports.zip = function () { + var xs = ['a','b','c']; + var ys = [1,2,3,4]; + var h = Hash(xs,ys); + assert.equal(h.length, 3); + assert.deepEqual(h.items, { a : 1, b : 2, c : 3 }); + + var zipped = Hash.zip(xs,ys); + assert.deepEqual(zipped, { a : 1, b : 2, c : 3 }); +}; + +exports.length = function () { + assert.equal(Hash({ a : 1, b : [2,3], c : 4 }).length, 3); + assert.equal(Hash({ a : 1, b : [2,3], c : 4 }).size, 3); + assert.equal(Hash.size({ a : 1, b : [2,3], c : 4 }), 3); +}; + +exports.compact = function () { + var hash = { + a : 1, + b : undefined, + c : false, + d : 4, + e : [ undefined, 4 ], + f : null + }; + var compacted = Hash(hash).compact; + assert.deepEqual( + { + a : 1, + b : undefined, + c : false, + d : 4, + e : [ undefined, 4 ], + f : null + }, + hash, 'compact modified the hash' + ); + assert.deepEqual( + compacted.items, + { + a : 1, + c : false, + d : 4, + e : [ undefined, 4 ], + f : null + } + ); + var h = Hash.compact(hash); + assert.deepEqual(h, compacted.items); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/test/property.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/test/property.js new file mode 100644 index 0000000..1183c5d --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/node_modules/hashish/test/property.js @@ -0,0 +1,69 @@ +var Hash = require('hashish'); +var assert = require('assert'); +var vm = require('vm'); +var fs = require('fs'); + +var src = fs.readFileSync(__dirname + '/../index.js', 'utf8'); + +exports.defineGetter = function () { + var context = { + module : { exports : {} }, + Object : { + keys : Object.keys, + defineProperty : undefined, + }, + require : require, + }; + context.exports = context.module.exports; + + vm.runInNewContext('(function () {' + src + '})()', context); + var Hash_ = context.module.exports; + + var times = 0; + Hash_.__proto__.__proto__.__defineGetter__ = function () { + times ++; + return Object.__defineGetter__.apply(this, arguments); + }; + + assert.equal(vm.runInNewContext('Object.defineProperty', context), null); + + assert.deepEqual( + Hash_({ a : 1, b : 2, c : 3 }).values, + [ 1, 2, 3 ] + ); + + assert.ok(times > 5); +}; + +exports.defineProperty = function () { + var times = 0; + var context = { + module : { exports : {} }, + Object : { + keys : Object.keys, + defineProperty : function (prop) { + times ++; + if (prop.get) throw new TypeError('engine does not support') + assert.fail('should have asserted by now'); + }, + }, + require : require + }; + context.exports = context.module.exports; + + vm.runInNewContext('(function () {' + src + '})()', context); + var Hash_ = context.module.exports; + + Hash_.__proto__.__proto__.__defineGetter__ = function () { + assert.fail('getter called when a perfectly good' + + ' defineProperty was available' + ); + }; + + assert.deepEqual( + Hash_({ a : 1, b : 2, c : 3 }).values, + [ 1, 2, 3 ] + ); + + assert.equal(times, 1); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/package.json new file mode 100644 index 0000000..0c971d6 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/package.json @@ -0,0 +1,33 @@ +{ + "name" : "seq", + "version" : "0.3.5", + "description" : "Chainable asynchronous flow control with sequential and parallel primitives and pipeline-style error handling", + "main" : "./index.js", + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-seq.git" + }, + "dependencies" : { + "chainsaw" : ">=0.0.7 <0.1", + "hashish" : ">=0.0.2 <0.1" + }, + "devDependencies" : { + "expresso" : ">=0.7.x" + }, + "script" : { + "test" : "expresso" + }, + "keywords" : [ + "flow-control", "flow", "control", "async", "asynchronous", "chain", + "pipeline", "sequence", "sequential", "parallel", "error" + ], + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "license" : "MIT/X11", + "engine" : { + "node" : ">=0.4.0" + } +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/readdir.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/readdir.js new file mode 100644 index 0000000..fe1a38b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/readdir.js @@ -0,0 +1,35 @@ +var assert = require('assert'); +var Seq = require('seq'); +var fs = require('fs'); + +exports.readdir = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 500); + + Seq() + .seq(fs.readdir, __dirname, Seq) + .seq(function (files) { + clearTimeout(to); + assert.ok(files.length >= 2); + }) + .catch(assert.fail) + ; +}; + +exports.readdirs = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 500); + + Seq() + .par(fs.readdir, __dirname, Seq) + .par(fs.readdir, __dirname + '/../examples', Seq) + .seq(function (tests, examples) { + clearTimeout(to); + assert.ok(tests.length >= 2); + assert.ok(examples.length >= 2); + }) + .catch(assert.fail) + ; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/seq.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/seq.js new file mode 100644 index 0000000..2e34aec --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/seq.js @@ -0,0 +1,946 @@ +var Seq = require('seq'); +var assert = require('assert'); + +exports.seq = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 100); + + Seq([0]) + .seq('pow', function (n) { + this(null, 1); + }) + .seq(function (n) { + assert.eql(n, 1); + assert.eql(n, this.vars.pow); + var seq = this; + setTimeout(function () { seq(null, 2) }, 25); + assert.eql(this.stack, [n]); + }) + .seq(function (n) { + assert.eql(n, 2); + assert.eql(this.stack, [n]); + this(null, 5, 6, 7); + }) + .seq(function (x, y, z) { + clearTimeout(to); + assert.eql([x,y,z], [5,6,7]); + }) + ; +}; + +exports.into = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 10); + var calls = 0; + + Seq([3,4,5]) + .seq(function () { + this.into('w')(null, 5); + }) + .seq(function (w) { + clearTimeout(to); + assert.eql(w, this.vars.w); + assert.eql(arguments.length, 1); + assert.eql(w, 5); + }) + ; +}; + +exports.catchSeq = function () { + var to = setTimeout(function () { + assert.fail('never caught the error'); + }, 100); + + var tf = setTimeout(function () { + assert.fail('final action never executed'); + }, 100); + + var calls = {}; + Seq([1]) + .seq(function (n) { + assert.eql(n, 1); + calls.before = true; + this('pow!'); + calls.after = true; + }) + .seq(function (n) { + calls.next = true; + assert.fail('should have skipped this'); + }) + .catch(function (err) { + assert.eql(err, 'pow!'); + assert.ok(calls.before); + assert.ok(!calls.after); + assert.ok(!calls.next); + clearTimeout(to); + }) + .do(function () { + //assert.ok(calls.after); + clearTimeout(tf); + }) + ; +}; + +exports.par = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 1000); + + Seq() + .seq(function () { + this(null, 'mew'); + }) + .par(function () { + var seq = this; + setTimeout(function () { seq(null, 'x') }, 50); + }) + .par(function () { + var seq = this; + setTimeout(function () { seq(null, 'y') }, 25); + }) + .par('z', function () { + this(null, 42); + }) + .seq(function (x, y, z) { + clearTimeout(to); + assert.eql(x, 'x'); + assert.eql(y, 'y'); + assert.eql(z, 42); + assert.eql(this.args, { 0 : ['x'], 1 : ['y'], z : [42] }); + assert.eql(this.stack, [ 'x', 'y', 42 ]); + assert.eql(this.vars, { z : 42 }); + }) + ; +}; + +exports.catchPar = function () { + var done = false, caught = false; + var tc = setTimeout(function () { + assert.fail('error not caught'); + }, 1000); + + Seq() + .par('one', function () { + setTimeout(this.bind({}, 'rawr'), 25); + }) + .par('two', function () { + setTimeout(this.bind({}, null, 'y'), 50); + }) + .seq(function (x, y) { + assert.fail('seq fired with error above'); + }) + .catch(function (err, key) { + clearTimeout(tc); + assert.eql(err, 'rawr'); + assert.eql(key, 'one'); + }) + ; +}; + +exports.catchParWithoutSeq = function () { + var done = false, caught = false; + var tc = setTimeout(function () { + assert.fail('error not caught'); + }, 5000); + + Seq() + .par('one', function () { + setTimeout(this.bind({}, 'rawr'), 25); + }) + .par('two', function () { + setTimeout(this.bind({}, null, 'y'), 50); + }) + .catch(function (err, key) { + clearTimeout(tc); + assert.eql(err, 'rawr'); + assert.eql(key, 'one'); + }) + ; +} + +exports.catchParMultipleErrors = function() { + var caught={}; + var to = setTimeout(function() { + assert.fail('Never finished'); + }, 1000); + var times = 0; + + Seq() + .par('one', function() { + setTimeout(this.bind({}, 'rawr1'), 25); + }) + .par('two', function() { + setTimeout(this.bind({}, 'rawr2'), 50); + }) + .catch(function(err,key) { + caught[key] = err; + }) + .seq(function() { + clearTimeout(to); + times ++; + assert.eql(times, 1); + assert.eql(caught, { one:'rawr1', two:'rawr2' }); + }) + ; +}; + +exports.catchParThenSeq = function () { + var tc = setTimeout(function () { + assert.fail('error not caught'); + }, 1000); + var tf = setTimeout(function () { + assert.fail('final seq not run'); + }, 500); + var times = 0; + var errs = [ + { key : 'one', msg : 'rawr' }, + { key : 'four', msg : 'pow' }, + ]; + + Seq() + .par('one', function () { + setTimeout(this.bind({}, 'rawr'), 25); + }) + .par('two', function () { + setTimeout(this.bind({}, null, 'y'), 50); + }) + .par('three', function () { + setTimeout(this.bind({}, null, 'z'), 30); + }) + .par('four', function () { + setTimeout(this.bind({}, 'pow'), 45); + }) + .seq(function (x, y) { + assert.fail('seq fired with error above'); + }) + .catch(function (err, key) { + clearTimeout(tc); + var e = errs.shift(); + assert.eql(err, e.msg); + assert.eql(key, e.key); + }) + .seq(function () { + clearTimeout(tf); + times ++; + assert.eql(times, 1); + }) + ; +} + +exports.forEach = function () { + var to = setTimeout(function () { + assert.fail('seq never fired after forEach'); + }, 25); + + var count = 0; + Seq([1,2,3]) + .push(4) + .forEach(function (x, i) { + assert.eql(x - 1, i); + count ++; + }) + .seq(function () { + clearTimeout(to); + assert.eql(count, 4); + }) + ; +}; + +exports.seqEach = function () { + var to = setTimeout(function () { + assert.fail('seqEach never finished'); + }, 25); + + var count = 0; + var ii = 0; + Seq([1,2,3]) + .seqEach(function (x, i) { + assert.eql(i, ii++); + assert.eql(x, [1,2,3][i]); + count ++; + this(null); + }) + .seq(function () { + clearTimeout(to); + assert.eql(count, 3); + }) + ; +}; + +exports.seqEachCatch = function () { + var to = setTimeout(function () { + assert.fail('never caught the error'); + }, 25); + var tf = setTimeout(function () { + assert.fail('never resumed afterwards'); + }, 25); + + var meows = []; + + var values = []; + Seq([1,2,3,4]) + .seqEach(function (x, i) { + values.push([i,x]); + assert.eql(x - 1, i); + if (i >= 2) this('meow ' + i) + else this(null, x * 10); + }) + .seq(function (xs) { + assert.fail('should fail before this action'); + }) + .catch(function (err) { + clearTimeout(to); + meows.push(err); + assert.eql(err, 'meow 2'); + assert.eql(values, [[0,1],[1,2],[2,3]]); + }) + .seq(function () { + clearTimeout(tf); + }) + ; +}; + +exports.parEach = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + var values = []; + Seq([1,2,3,4]) + .parEach(function (x, i) { + values.push([i,x]); + setTimeout(this.bind({}, null), 20); + }) + .seq(function () { + assert.deepEqual(this.stack, [1,2,3,4]) + assert.deepEqual(values, [[0,1],[1,2],[2,3],[3,4]]); + clearTimeout(to); + }) + ; +}; + +exports.parEachVars = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 1000); + var values = []; + + Seq() + .seq('abc', function () { + this(null, 'a', 'b', 'c'); + }) + .parEach(function (x) { + values.push(x); + setTimeout(this.bind(this, null), Math.floor(Math.random() * 50)); + }) + .seq(function () { + clearTimeout(to); + assert.eql(values, ['a','b','c']); + assert.eql(this.stack, ['a','b','c']); + assert.eql(this.vars.abc, 'a'); + }) + ; +}; + +exports.parEachInto = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + Seq([1,2,3,4]) + .parEach(function (x, i) { + setTimeout((function () { + this.into('abcd'.charAt(i))(null, x); + }).bind(this), 20); + }) + .seq(function () { + clearTimeout(to); + assert.deepEqual(this.stack, [1,2,3,4]) + assert.deepEqual(this.vars, { a : 1, b : 2, c : 3, d : 4 }); + }) + ; +}; + +exports.parEachCatch = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + var values = []; + Seq([1,2,3,4]) + .parEach(function (x, i) { + values.push([i,x]); + setTimeout(this.bind({}, 'zing'), 10); + }) + .seq(function () { + assert.fail('should have errored before this point') + }) + .catch(function (err) { + clearTimeout(to); + assert.eql(err, 'zing'); + assert.deepEqual(values, [[0,1],[1,2],[2,3],[3,4]]); + }) + ; +}; + +exports.parEachLimited = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .parEach(3, function (x, i) { + running ++; + + assert.ok(running <= 3); + + values.push([i,x]); + setTimeout((function () { + running --; + this(null); + }).bind(this), 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(values, + [[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],[6,7],[7,8],[8,9],[9,10]] + ); + }) + ; +}; + +exports.parMap = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .parMap(2, function (x, i) { + running ++; + + assert.ok(running <= 2); + + setTimeout((function () { + running --; + this(null, x * 10); + }).bind(this), Math.floor(Math.random() * 100)); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [10,20,30,40,50,60,70,80,90,100]); + assert.eql(this.stack, [].slice.call(arguments)); + }) + ; +}; + +exports.parMapFast = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .parMap(function (x, i) { + this(null, x * 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [10,20,30,40,50,60,70,80,90,100]); + assert.eql(this.stack, [].slice.call(arguments)); + }) + ; +}; + +exports.parMapInto = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .parMap(function (x, i) { + this.into(9 - i)(null, x * 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [100, 90, 80, 70, 60, 50, 40, 30, 20, 10]); + assert.eql(this.stack, [].slice.call(arguments)); + }) + ; +}; + +exports.seqMap = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .seqMap(function (x, i) { + running ++; + + assert.eql(running, 1); + + setTimeout((function () { + running --; + this(null, x * 10); + }).bind(this), 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [10,20,30,40,50,60,70,80,90,100]); + }) + ; +}; + + +exports.seqMapInto = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .seqMap(function (x, i) { + running ++; + + assert.eql(running, 1); + + setTimeout((function () { + running --; + this.into(9 - i)(null, x * 10); + }).bind(this), 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [100, 90, 80, 70, 60, 50, 40, 30, 20, 10]); + }) + ; +}; + +exports.parFilter = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .parFilter(2, function (x, i) { + running ++; + + assert.ok(running <= 2); + + setTimeout((function () { + running --; + this(null, x % 2 === 0); + }).bind(this), Math.floor(Math.random() * 100)); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [2,4,6,8,10]); + assert.eql(this.stack, [].slice.call(arguments)); + }) + ; +}; + +exports.seqFilter = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .seqFilter(function (x, i) { + running ++; + + assert.eql(running, 1); + + setTimeout((function () { + running --; + this(null, x % 2 === 0); + }).bind(this), 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [2,4,6,8,10]); + }) + ; +}; + +exports.parFilterInto = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .parFilter(2, function (x, i) { + running ++; + + assert.ok(running <= 2); + + setTimeout((function () { + running --; + this.into(x % 3)(null, x % 2 === 0); + }).bind(this), Math.floor(Math.random() * 100)); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [ 6, 10, 4, 2, 8 ]); + assert.eql(this.stack, [].slice.call(arguments)); + }) + ; +}; + +exports.seqFilterInto = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 500); + + var running = 0; + var values = []; + Seq([1,2,3,4,5,6,7,8,9,10]) + .seqFilter(function (x, i) { + running ++; + + assert.eql(running, 1); + + setTimeout((function () { + running --; + this.into(x % 3)(null, x % 2 === 0); + }).bind(this), 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(this.stack, [ 6, 10, 4, 2, 8 ]); + }) + ; +}; + +exports.stack = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + Seq([4,5,6]) + .seq(function (x, y, z) { + assert.eql(arguments.length, 3); + assert.eql([x,y,z], [4,5,6]); + assert.eql(this.stack, [4,5,6]); + this(null); + }) + .set([3,4]) + .seq(function (x, y) { + assert.eql(arguments.length, 2); + assert.eql([x,y], [3,4]); + assert.eql(this.stack, [3,4]); + this(null); + }) + .empty() + .seq(function () { + assert.eql(arguments.length, 0); + assert.eql(this.stack, []); + this.next(null, ['a']); + }) + .extend(['b','c']) + .seq(function (a, b, c) { + assert.eql(arguments.length, 3); + assert.eql([a,b,c], ['a','b','c']); + assert.eql(this.stack, ['a','b','c']); + this.pass(null); + }) + .pop() + .push('c', 'd', 'e') + .seq(function (a, b, c, d, e) { + assert.eql(arguments.length, 5); + assert.eql([a,b,c,d,e], ['a','b','c','d','e']); + assert.eql(this.stack, ['a','b','c','d','e']); + this.pass(null); + }) + .shift() + .shift() + .seq(function (c, d, e) { + assert.eql(arguments.length, 3); + assert.eql([c,d,e], ['c','d','e']); + assert.eql(this.stack, ['c','d','e']); + this.pass(null); + }) + .set([['a',['b']],['c','d',['e']]]) + .flatten(false) // only flatten one level + .seq(function (a, b, c, d, e) { + assert.eql(arguments.length, 5); + assert.eql([a,b,c,d,e], ['a',['b'],'c','d',['e']]); + assert.eql(this.stack, ['a',['b'],'c','d',['e']]); + this.pass(null); + }) + .set([['a','b'],['c','d',['e']]]) + .flatten() + .seq(function (a, b, c, d, e) { + assert.eql(arguments.length, 5); + assert.eql([a,b,c,d,e], ['a','b','c','d','e']); + assert.eql(this.stack, ['a','b','c','d','e']); + this.pass(null); + }) + .splice(2, 2) + .seq(function (a, b, e) { + assert.eql(arguments.length, 3); + assert.eql([a,b,e], ['a','b','e']); + assert.eql(this.stack, ['a','b','e']); + this.pass(null); + }) + .reverse() + .seq(function (a, b, e){ + assert.eql(arguments.length, 3); + assert.eql([a,b,e], ['e','b','a']); + assert.eql(this.stack, ['e','b','a']); + this.pass(null); + }) + .map(function(ch){ return ch.toUpperCase(); }) + .seq(function (A, B, E){ + assert.eql(arguments.length, 3); + assert.eql([A,B,E], ['E','B','A']); + assert.eql(this.stack, ['E','B','A']); + this.pass(null); + }) + .reduce(function(s, ch){ return s + ':' + ch; }) + .seq(function (acc){ + assert.eql(arguments.length, 1); + assert.eql(acc, 'E:B:A'); + assert.eql(this.stack, ['E:B:A']); + this.pass(null); + }) + .seq(function () { + clearTimeout(to); + this(null); + }) + ; +}; + +exports.ap = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + var cmp = [1,2,3]; + Seq.ap([1,2,3]) + .seqEach(function (x) { + assert.eql(cmp.shift(), x); + this(null); + }) + .seq(function () { + clearTimeout(to); + assert.eql(cmp, []); + }) + ; + + assert.throws(function () { + Seq.ap({ a : 1, b : 2 }); + }); +}; + +exports.seqBind = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + Seq([4,5]) + .seq(function (a, b, c, d) { + assert.eql(a, 2); + assert.eql(b, 3); + assert.eql(c, 4); + assert.eql(d, 5); + this(null); + }, 2, 3) + .seq(function () { + clearTimeout(to); + }) + ; +}; + +exports.parBind = function () { + var t1 = setTimeout(function () { + assert.fail('1 never finished'); + }, 500); + var t2 = setTimeout(function () { + assert.fail('2 never finished'); + }, 500); + var t3 = setTimeout(function () { + assert.fail('3 never finished'); + }, 500); + + Seq(['c']) + .par(function (a, b, c) { + clearTimeout(t1); + assert.eql(a, 'a'); + assert.eql(b, 'b'); + assert.eql(c, 'c'); + this(null); + }, 'a', 'b') + .par(function (x, c) { + clearTimeout(t2); + assert.eql(x, 'x'); + assert.eql(c, 'c'); + this(null); + }, 'x') + .seq(function () { + clearTimeout(t3); + }) + ; +}; + +exports.emptySeqEach = function () { + var to = setTimeout(function () { + assert.fail('never finished'); + }, 100); + + Seq() + .seqEach(function (x) { + assert.fail('no elements'); + }) + .seq(function () { + clearTimeout(to); + }) + ; +}; + +exports.emptyForEach = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 500); + + Seq() + .forEach(function () { + assert.fail('non-empty stack'); + }) + .seq(function () { + clearTimeout(to); + }) + ; +}; + +exports.emptyParEach = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 500); + + Seq() + .parEach(function () { + assert.fail('non-empty stack'); + }) + .seq(function () { + clearTimeout(to); + }) + ; +}; + +exports.emptyParMap = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 500); + + Seq() + .parMap(function () { + assert.fail('non-empty stack'); + }) + .seq(function () { + clearTimeout(to); + }) + ; +}; + +exports.emptySeqMap = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 500); + + Seq() + .seqMap(function () { + assert.fail('non-empty stack'); + }) + .seq(function () { + clearTimeout(to); + }) + ; +}; + +exports.ok = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 500); + + function moo1 (cb) { cb(3) } + function moo2 (cb) { cb(4) } + + Seq() + .par(function () { moo1(this.ok) }) + .par(function () { moo2(this.ok) }) + .seq(function (x, y) { + clearTimeout(to); + assert.eql(x, 3); + assert.eql(y, 4); + }) + ; +}; + +exports.nextOk = function () { + var to = setTimeout(function () { + assert.fail('seq never fired'); + }, 500); + + function moo1 (cb) { cb(3) } + function moo2 (cb) { cb(4) } + + Seq() + .par_(function (next) { moo1(next.ok) }) + .par_(function (next) { moo2(next.ok) }) + .seq_(function (next, x, y) { + assert.eql(x, 3); + assert.eql(y, 4); + next.ok([ 1, 2, 3 ]) + }) + .flatten() + .parMap_(function (next, x) { + next.ok(x * 100) + }) + .seq_(function (next) { + clearTimeout(to); + assert.deepEqual(next.stack, [ 100, 200, 300 ]); + }) + ; +}; + +exports.regressionTestForAccidentalDeepTraversalOfTheContext = function () { + // Create a single-item stack with a bunch of references to other objects: + var stack = [{}]; + for (var i = 0 ; i < 10000 ; i += 1) { + stack[0][i] = stack[0]; + } + + var startTime = new Date(), + numCalled = 0, + to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 1000); + + Seq(stack) + .parEach(function (item) { + numCalled += 1; + this(); + }) + .seq(function () { + clearTimeout(to); + assert.eql(numCalled, 1); + assert.ok((new Date().getTime() - startTime) < 1000, 'if this test takes longer than a second, the bug must have been reintroduced'); + }); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/seq_.js b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/seq_.js new file mode 100644 index 0000000..369cc86 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/node_modules/seq/test/seq_.js @@ -0,0 +1,149 @@ +var Seq = require('seq'); +var assert = require('assert'); + +exports.seq_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + Seq(['xxx']) + .seq_('pow', function (next, x) { + assert.eql(next, this); + assert.eql(x, 'xxx'); + next(null, 'yyy'); + }) + .seq(function (y) { + clearTimeout(to); + assert.eql(y, 'yyy'); + assert.eql(this.vars.pow, 'yyy'); + }) + ; +}; + +exports.par_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + Seq() + .par_(function (next) { + assert.eql(next, this); + next(null, 111); + }) + .par_(function (next) { + assert.eql(next, this); + next(null, 222); + }) + .seq(function (x, y) { + clearTimeout(to); + assert.eql(x, 111); + assert.eql(y, 222); + }) + ; +}; + +exports.forEach_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + var acc = []; + Seq([7,8,9]) + .forEach_(function (next, x) { + assert.eql(next, this); + acc.push(x); + }) + .seq(function () { + clearTimeout(to); + assert.eql(acc, [ 7, 8, 9 ]); + }) + ; +}; + +exports.seqEach_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + var acc = []; + Seq([7,8,9]) + .seqEach_(function (next, x) { + assert.eql(next, this); + acc.push(x); + setTimeout(function () { + next(null, x); + }, Math.random() * 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(acc, [ 7, 8, 9 ]); + assert.eql(this.stack, [ 7, 8, 9 ]); + }) + ; +}; + +exports.parEach_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + var acc = []; + Seq([7,8,9]) + .parEach_(function (next, x) { + assert.eql(next, this); + acc.push(x); + setTimeout(function () { + next(null, x); + }, Math.random() * 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(acc, [ 7, 8, 9 ]); + assert.eql(this.stack, [ 7, 8, 9 ]); + }) + ; +}; + +exports.seqMap_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + var acc = []; + Seq([7,8,9]) + .seqMap_(function (next, x) { + assert.eql(next, this); + acc.push(x); + setTimeout(function () { + next(null, x * 10); + }, Math.random() * 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(acc, [ 7, 8, 9 ]); + assert.eql(this.stack, [ 70, 80, 90 ]); + }) + ; +}; + +exports.parMap_ = function () { + var to = setTimeout(function () { + assert.fail('never got to the end of the chain'); + }, 5000); + + var acc = []; + Seq([7,8,9]) + .parMap_(function (next, x) { + assert.eql(next, this); + acc.push(x); + setTimeout(function () { + next(null, x * 10); + }, Math.random() * 10); + }) + .seq(function () { + clearTimeout(to); + assert.eql(acc, [ 7, 8, 9 ]); + assert.eql(this.stack, [ 70, 80, 90 ]); + }) + ; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/findit/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/findit/package.json new file mode 100644 index 0000000..8bc0229 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/findit/package.json @@ -0,0 +1,34 @@ +{ + "name" : "findit", + "version" : "0.1.2", + "description" : "Walk a directory tree.", + "main" : "./index.js", + "dependencies" : { + "seq" : ">=0.1.7" + }, + "devDependencies" : { + "hashish" : ">=0.0.2 <0.1", + "expresso" : "0.7.x" + }, + "scripts" : { + "test" : "expresso" + }, + "repository" : { + "type" : "git", + "url" : "http://github.com/substack/node-findit.git" + }, + "keywords" : [ + "find", + "walk", + "directory", + "recursive", + "tree" + ], + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "license" : "MIT/X11", + "engine" : ["node >=0.2.0"] +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node.js new file mode 100644 index 0000000..a944870 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node.js @@ -0,0 +1,142 @@ +(function() { + var fs = require('fs'); + var util = require('util'); + + try { + util = require('util') + } catch (e) { + util = require('sys') + } + + var path = require('path'); + + var filename = __dirname + '/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js'; + + global.window = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval + }; + + var src = fs.readFileSync(filename); + var jasmine; + var minorVersion = process.version.match(/\d\.(\d)\.\d/)[1]; + + switch (minorVersion) { + case "1": + case "2": + jasmine = process.compile(src + '\njasmine;', filename); + break; + default: + jasmine = require('vm').runInThisContext(src + "\njasmine;", filename); + } + + delete global.window; + require("jasmine-node/lib/jasmine-node/async-callback"); + + var jasmineNode = require('jasmine-node/lib/jasmine-node/reporter').jasmineNode; + + jasmine.loadHelpersInFolder = function(folder, matcher) { + var helpers = [], + helperCollection = require('jasmine-node/lib/jasmine-node/spec-collection'); + + helperCollection.load(folder, matcher); + helpers = helperCollection.getSpecs(); + + for (var i = 0, len = helpers.length; i < len; ++i) { + var file = helpers[i].path(); + var helper = require(file.replace(/\.*$/, "")); + for (var key in helper) + global[key] = helper[key]; + } + }; + + function removeJasmineFrames(text) { + var lines = []; + text.split(/\n/).forEach(function(line) { + if (line.indexOf(filename) == -1) { + lines.push(line); + } + }); + return lines.join('\n'); + } + + jasmine.executeSpecsInFolder = function(folder, done, isVerbose, showColors, teamcity, useRequireJs, matcher, junitreport) { + var fileMatcher = matcher || new RegExp(".(js)$", "i"), + colors = showColors || false, + specs = require('jasmine-node/lib/jasmine-node/spec-collection'), + jasmineEnv = jasmine.getEnv(); + + specs.load(folder, fileMatcher); + + if (junitreport && junitreport.report) { + if (!path.existsSync(junitreport.savePath)) { + util.puts('creating junit xml report save path: ' + junitreport.savePath); + fs.mkdirSync(junitreport.savePath, "0755"); + } + jasmineEnv.addReporter(new jasmine.JUnitXmlReporter(junitreport.savePath, + junitreport.consolidate, + junitreport.useDotNotation)); + } + + if (teamcity) { + jasmineEnv.addReporter(new jasmine.TeamcityReporter()); + } else if (isVerbose) { + jasmineEnv.addReporter(new jasmineNode.TerminalVerboseReporter({ print: util.print, + color: showColors, + onComplete: done, + stackFilter: removeJasmineFrames})); + } else { + jasmineEnv.addReporter(new jasmineNode.TerminalReporter({print: util.print, + color: showColors, + onComplete: done, + stackFilter: removeJasmineFrames})); + } + + if (useRequireJs) { + require('jasmine-node/lib/jasmine-node/requirejs-runner').executeJsRunner(specs, done, jasmineEnv); + } else { + var specsList = specs.getSpecs(); + + for (var i = 0, len = specsList.length; i < len; ++i) { + var filename = specsList[i]; + require(filename.path().replace(/\.\w+$/, "")); + } + + jasmineEnv.execute(); + } + }; + + function now() { + return new Date().getTime(); + } + + jasmine.asyncSpecWait = function() { + var wait = jasmine.asyncSpecWait; + wait.start = now(); + wait.done = false; + (function innerWait() { + waits(10); + runs(function() { + if (wait.start + wait.timeout < now()) { + expect('timeout waiting for spec').toBeNull(); + } + else if (wait.done) { + wait.done = false; + } + else { + innerWait(); + } + }); + })(); + }; + jasmine.asyncSpecWait.timeout = 4 * 1000; + jasmine.asyncSpecDone = function() { + jasmine.asyncSpecWait.done = true; + }; + + for (var key in jasmine) { + exports[key] = jasmine[key]; + } +})(); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/.npmignore new file mode 100755 index 0000000..c72cd43 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/.npmignore @@ -0,0 +1,12 @@ +.DS_Store +.idea +*.iml +*.ipr +*.iws +*.tmproj +.project +.settings +.externalToolBuilders +*.swp +node_modules +*~ diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/LICENSE b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/LICENSE new file mode 100755 index 0000000..b6ad6d3 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2010 Adam Abrons and Misko Hevery http://getangular.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/README.md b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/README.md new file mode 100644 index 0000000..c3892df --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/README.md @@ -0,0 +1,56 @@ +jasmine-node +====== + +This node.js module makes the wonderful Pivotal Lab's jasmine +(http://github.com/pivotal/jasmine) spec framework available in +node.js. + +install +------ + npm install jasmine-node -g + +usage +------ + +Write the specifications for your code in *.js and *.coffee files in the +spec/ directory (note: your specification files must end with either +.spec.js or .spec.coffee; otherwise jasmine-node won't find them!). You +can use sub-directories to better organise your specs. + +If you have installed the npm package, you can run it with: + + jasmine-node + +If you aren't using npm, you should add `pwd`/lib to the $NODE_PATH +environment variable, then run: + + node lib/jasmine-node/cli.js + + +You can supply the following arguments: + + * --autotest, provides automatic execution of specs after + each changes + * --coffee, allow execution of .coffee specs + * --color, indicates spec output should uses color to +indicates passing (green) or failing (red) specs + * --noColor, do not use color in the output + * --verbose, verbose output as the specs are run + * --junitreport, export tests results as junitreport xml format' + +Checkout spec/SampleSpecs.js to see how to use it. + + +development +----------- +Install the dependent packages by running: + + npm install + +Run the specs before you send your pull request: + + scripts/specs + +or + + scripts/specs --verbose diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/bin/jasmine-node b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/bin/jasmine-node new file mode 100755 index 0000000..86e4492 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/bin/jasmine-node @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +if( !process.env.NODE_ENV ) process.env.NODE_ENV = 'test'; + +var path = require('path'); +var fs = require('fs'); +require(path.join(__dirname,'../lib/jasmine-node/cli.js')); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/async-callback.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/async-callback.js new file mode 100644 index 0000000..5c188b9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/async-callback.js @@ -0,0 +1,41 @@ +(function() { + var withoutAsync = {}; + + ["it", "beforeEach", "afterEach"].forEach(function(jasmineFunction) { + withoutAsync[jasmineFunction] = jasmine.Env.prototype[jasmineFunction]; + return jasmine.Env.prototype[jasmineFunction] = function() { + var args = Array.prototype.slice.call(arguments, 0); + var specFunction = args.pop(); + if (specFunction.length === 0) { + args.push(specFunction); + } else { + args.push(function() { + return asyncSpec(specFunction, this); + }); + } + return withoutAsync[jasmineFunction].apply(this, args); + }; + }); + + function asyncSpec(specFunction, spec, timeout) { + if (timeout == null) timeout = 1000; + var done = false; + spec.runs(function() { + try { + return specFunction(function(error) { + done = true; + if (error != null) return spec.fail(error); + }); + } catch (e) { + done = true; + throw e; + } + }); + return spec.waitsFor(function() { + if (done === true) { + return true; + } + }, "spec to complete", timeout); + }; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/autotest.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/autotest.js new file mode 100644 index 0000000..9d8701b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/autotest.js @@ -0,0 +1,86 @@ +var findit = require('findit'); +var collection = require('./spec-collection'); +var path = require('path'); +var fs = require('fs'); +var child_process = require('child_process'); + +var baseArgv = []; + +for(var i = 0; i < process.argv.length; i++) { + if(process.argv[i] !== '--autotest') { + baseArgv.push(process.argv[i]); + } +} + +var run_external = function(command, args, callback) { + var child = child_process.spawn(command, args); + child.stdout.on('data', function(data) { + process.stdout.write(data); + }); + if(typeof callback == 'function') { + child.on('exit', callback); + } +} + +var run_everything = function() { + // run the suite when it starts + var argv = [].concat(baseArgv); + run_external(argv.shift(), argv, function() { console.log(arguments) }); +} + +var last_run_succesful = true; + +var watchFile = function(file, stat) { + + var file = path.normalize(file) + + var prevStats = stat; + + var watcher = fs.watch(file, function(ev) { + + if(!path.existsSync(file)) { + watcher.close(); + return; + } + + var currStats = fs.statSync( file ); + + if(prevStats.mtime.getTime() != currStats.mtime.getTime()) { + + // narrow down a pattern to reduce the specs runned + var match = path.basename(file, path.extname(file)) + ".*"; + match = match.replace(new RegExp("spec", "i"), ""); + + // so we need to rerun the jasmine suite + var argv = [].concat(baseArgv, ["--match", match]); + run_external(argv.shift(), argv, function(code) { + // run everything if we fixed some bugs + if(code == 0) { + if(!last_run_succesful) { + run_everything(); + } + last_run_succesful = true; + } else { + last_run_succesful = false; + } + }); + } + }); +} + + +exports.start = function(loadpath, pattern) { + + var finder = findit.find(loadpath); + + finder.on('file', function(file, stat) { + var basename = path.basename(file); + + if(pattern.test(basename)) { + watchFile(file,stat); + } + + }); + + run_everything(); +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/cli.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/cli.js new file mode 100755 index 0000000..987a5d3 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/cli.js @@ -0,0 +1,174 @@ +var jasmine = require('./index'); +var util, + Path= require('path'); +try { + util = require('util') +} catch(e) { + util = require('sys') +} + +var helperCollection = require('./spec-collection'); + +var specFolder = null; + +for (var key in jasmine) + global[key] = jasmine[key]; + +var isVerbose = false; +var showColors = true; +var teamcity = process.env.TEAMCITY_PROJECT_NAME || false; +var useRequireJs = false; +var extentions = "js"; +var match = '.'; +var matchall = false; +var autotest = false; +var useHelpers = true; + +var junitreport = { + report: false, + savePath : "./reports/", + useDotNotation: true, + consolidate: true +} + +var args = process.argv.slice(2); + +while(args.length) { + var arg = args.shift(); + + switch(arg) + { + case '--color': + showColors = true; + break; + case '--noColor': + case '--nocolor': + showColors = false; + break; + case '--verbose': + isVerbose = true; + break; + case '--coffee': + require('coffee-script'); + extentions = "js|coffee"; + break; + case '-m': + case '--match': + match = args.shift(); + break; + case '--matchall': + matchall = true; + break; + case '--junitreport': + junitreport.report = true; + break; + case '--output': + junitreport.savePath = args.shift(); + break; + case '--teamcity': + teamcity = true; + break; + case '--runWithRequireJs': + useRequireJs = true; + break; + case '--nohelpers': + useHelpers = false; + break; + case '--test-dir': + var dir = args.shift(); + + if(!Path.existsSync(dir)) + throw new Error("Test root path '" + dir + "' doesn't exist!"); + + specFolder = dir; // NOTE: Does not look from current working directory. + break; + case '--autotest': + autotest = true; + break; + case '-h': + help(); + default: + if (arg.match(/^--/)) help(); + if (arg.match(/^\/.*/)) { + specFolder = arg; + } else { + specFolder = Path.join(process.cwd(), arg); + } + break; + } +} + +if (!specFolder) { + help(); +} + +if (autotest) { + require('./autotest').start(specFolder, + new RegExp(".+\\.(" + extentions + ")$", "i")); + return; +} + +var exitCode = 0; + +process.on("exit", onExit); + +function onExit() { + process.removeListener("exit", onExit); + process.exit(exitCode); +} + +var onComplete = function(runner, log) { + util.print('\n'); + if (runner.results().failedCount == 0) { + exitCode = 0; + } else { + exitCode = 1; + } +}; + +var regExpSpec = new RegExp(match + (matchall ? "" : "spec\\.") + "(" + extentions + ")$", 'i') + +helperCollection.load(specFolder, regExpSpec); + +if(helperCollection.getSpecs().length === 0) { + match = ""; +} + +if(useHelpers){ + jasmine.loadHelpersInFolder(specFolder, + new RegExp("helpers?\\.(" + extentions + ")$", 'i')); +} + +jasmine.executeSpecsInFolder(specFolder, + onComplete, + isVerbose, + showColors, + teamcity, + useRequireJs, + regExpSpec, + junitreport); + +function help(){ + util.print([ + 'USAGE: jasmine-node [--color|--noColor] [--verbose] [--coffee] directory' + , '' + , 'Options:' + , ' --autotest - rerun automatically the specs when a file changes' + , ' --color - use color coding for output' + , ' --noColor - do not use color coding for output' + , ' -m, --match REGEXP - load only specs containing "REGEXPspec"' + , ' --matchall - relax requirement of "spec" in spec file names' + , ' --verbose - print extra information per each test run' + , ' --coffee - load coffee-script which allows execution .coffee files' + , ' --junitreport - export tests results as junitreport xml format' + , ' --output - defines the output folder for junitreport files' + , ' --teamcity - converts all console output to teamcity custom test runner commands. (Normally auto detected.)' + , ' --runWithRequireJs - loads all specs using requirejs instead of node\'s native require method' + , ' --test-dir - the absolute root directory path where tests are located' + , ' --nohelpers - does not load helpers.' + , ' -h, --help - display this help and exit' + , '' + ].join("\n")); + + process.exit(-1); +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/index.js new file mode 100755 index 0000000..e12e737 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/index.js @@ -0,0 +1,145 @@ +var fs = require('fs'); +var util; +try { + util = require('util') +} catch(e) { + util = require('sys') +} + +var path = require('path'); + +var filename = __dirname + '/jasmine-2.0.0.rc1.js'; +global.window = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + setInterval: setInterval, + clearInterval: clearInterval +}; + +var src = fs.readFileSync(filename); +var jasmine; +var minorVersion = process.version.match(/\d\.(\d)\.\d/)[1]; +switch (minorVersion) { + case "1": + case "2": + jasmine = process.compile(src + '\njasmine;', filename); + break; + default: + jasmine = require('vm').runInThisContext(src + "\njasmine;", filename); +} + +delete global.window; +require("./async-callback"); +require("jasmine-reporters"); + +var jasmineNode = require('./reporter').jasmineNode; + +jasmine.loadHelpersInFolder=function(folder, matcher) +{ + var helpers = [], + helperCollection = require('./spec-collection'); + + helperCollection.load(folder, matcher); + helpers = helperCollection.getSpecs(); + + for (var i = 0, len = helpers.length; i < len; ++i) + { + var file = helpers[i].path(); + var helper= require(file.replace(/\.*$/, "")); + for (var key in helper) + global[key]= helper[key]; + } +}; + +function removeJasmineFrames(text) { + var lines = []; + text.split(/\n/).forEach(function(line){ + if (line.indexOf(filename) == -1) { + lines.push(line); + } + }); + return lines.join('\n'); +} + +jasmine.executeSpecsInFolder = function(folder, + done, + isVerbose, + showColors, + teamcity, + useRequireJs, + matcher, + junitreport){ + var fileMatcher = matcher || new RegExp(".(js)$", "i"), + colors = showColors || false, + specs = require('./spec-collection'), + jasmineEnv = jasmine.getEnv(); + + specs.load(folder, fileMatcher); + + if(junitreport && junitreport.report) { + if(!path.existsSync(junitreport.savePath)) { + util.puts('creating junit xml report save path: ' + junitreport.savePath); + fs.mkdirSync(junitreport.savePath, "0755"); + } + jasmineEnv.addReporter(new jasmine.JUnitXmlReporter(junitreport.savePath, + junitreport.consolidate, + junitreport.useDotNotation)); + } + + if(teamcity){ + jasmineEnv.addReporter(new jasmine.TeamcityReporter()); + } else if(isVerbose) { + jasmineEnv.addReporter(new jasmineNode.TerminalVerboseReporter({ print: util.print, + color: showColors, + onComplete: done, + stackFilter: removeJasmineFrames})); + } else { + jasmineEnv.addReporter(new jasmineNode.TerminalReporter({print: util.print, + color: showColors, + onComplete: done, + stackFilter: removeJasmineFrames})); + } + + if (useRequireJs) { + require('./requirejs-runner').executeJsRunner(specs, done, jasmineEnv); + } else { + var specsList = specs.getSpecs(); + + for (var i = 0, len = specsList.length; i < len; ++i) { + var filename = specsList[i]; + require(filename.path().replace(/\.\w+$/, "")); + } + + jasmineEnv.execute(); + } +}; + +function now(){ + return new Date().getTime(); +} + +jasmine.asyncSpecWait = function(){ + var wait = jasmine.asyncSpecWait; + wait.start = now(); + wait.done = false; + (function innerWait(){ + waits(10); + runs(function() { + if (wait.start + wait.timeout < now()) { + expect('timeout waiting for spec').toBeNull(); + } else if (wait.done) { + wait.done = false; + } else { + innerWait(); + } + }); + })(); +}; +jasmine.asyncSpecWait.timeout = 4 * 1000; +jasmine.asyncSpecDone = function(){ + jasmine.asyncSpecWait.done = true; +}; + +for ( var key in jasmine) { + exports[key] = jasmine[key]; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js new file mode 100644 index 0000000..eeac8ae --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js @@ -0,0 +1,2479 @@ +var isCommonJS = typeof window == "undefined"; + +/** + * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework. + * + * @namespace + */ +var jasmine = {}; +if (isCommonJS) exports.jasmine = jasmine; +/** + * @private + */ +jasmine.unimplementedMethod_ = function() { + throw new Error("unimplemented method"); +}; + +/** + * Use jasmine.undefined instead of undefined, since undefined is just + * a plain old variable and may be redefined by somebody else. + * + * @private + */ +jasmine.undefined = jasmine.___undefined___; + +/** + * Show diagnostic messages in the console if set to true + * + */ +jasmine.VERBOSE = false; + +/** + * Default interval in milliseconds for event loop yields (e.g. to allow network activity or to refresh the screen with the HTML-based runner). Small values here may result in slow test running. Zero means no updates until all tests have completed. + * + */ +jasmine.DEFAULT_UPDATE_INTERVAL = 250; + +/** + * Default timeout interval in milliseconds for waitsFor() blocks. + */ +jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; + +jasmine.getGlobal = function() { + function getGlobal() { + return this; + } + + return getGlobal(); +}; + +/** + * Allows for bound functions to be compared. Internal use only. + * + * @ignore + * @private + * @param base {Object} bound 'this' for the function + * @param name {Function} function to find + */ +jasmine.bindOriginal_ = function(base, name) { + var original = base[name]; + if (original.apply) { + return function() { + return original.apply(base, arguments); + }; + } else { + // IE support + return jasmine.getGlobal()[name]; + } +}; + +jasmine.setTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'setTimeout'); +jasmine.clearTimeout = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearTimeout'); +jasmine.setInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'setInterval'); +jasmine.clearInterval = jasmine.bindOriginal_(jasmine.getGlobal(), 'clearInterval'); + +jasmine.MessageResult = function(values) { + this.type = 'log'; + this.values = values; + this.trace = new Error(); // todo: test better +}; + +jasmine.MessageResult.prototype.toString = function() { + var text = ""; + for (var i = 0; i < this.values.length; i++) { + if (i > 0) text += " "; + if (jasmine.isString_(this.values[i])) { + text += this.values[i]; + } else { + text += jasmine.pp(this.values[i]); + } + } + return text; +}; + +jasmine.ExpectationResult = function(params) { + this.type = 'expect'; + this.matcherName = params.matcherName; + this.passed_ = params.passed; + this.expected = params.expected; + this.actual = params.actual; + this.message = this.passed_ ? 'Passed.' : params.message; + + var trace = (params.trace || new Error(this.message)); + this.trace = this.passed_ ? '' : trace; +}; + +jasmine.ExpectationResult.prototype.toString = function () { + return this.message; +}; + +jasmine.ExpectationResult.prototype.passed = function () { + return this.passed_; +}; + +/** + * Getter for the Jasmine environment. Ensures one gets created + */ +jasmine.getEnv = function() { + var env = jasmine.currentEnv_ = jasmine.currentEnv_ || new jasmine.Env(); + return env; +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isArray_ = function(value) { + return jasmine.isA_("Array", value); +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isString_ = function(value) { + return jasmine.isA_("String", value); +}; + +/** + * @ignore + * @private + * @param value + * @returns {Boolean} + */ +jasmine.isNumber_ = function(value) { + return jasmine.isA_("Number", value); +}; + +/** + * @ignore + * @private + * @param {String} typeName + * @param value + * @returns {Boolean} + */ +jasmine.isA_ = function(typeName, value) { + return Object.prototype.toString.apply(value) === '[object ' + typeName + ']'; +}; + +/** + * Pretty printer for expecations. Takes any object and turns it into a human-readable string. + * + * @param value {Object} an object to be outputted + * @returns {String} + */ +jasmine.pp = function(value) { + var stringPrettyPrinter = new jasmine.StringPrettyPrinter(); + stringPrettyPrinter.format(value); + return stringPrettyPrinter.string; +}; + +/** + * Returns true if the object is a DOM Node. + * + * @param {Object} obj object to check + * @returns {Boolean} + */ +jasmine.isDomNode = function(obj) { + return obj.nodeType > 0; +}; + +/** + * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter. + * + * @example + * // don't care about which function is passed in, as long as it's a function + * expect(mySpy).toHaveBeenCalledWith(jasmine.any(Function)); + * + * @param {Class} clazz + * @returns matchable object of the type clazz + */ +jasmine.any = function(clazz) { + return new jasmine.Matchers.Any(clazz); +}; + +/** + * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks. + * + * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine + * expectation syntax. Spies can be checked if they were called or not and what the calling params were. + * + * A Spy has the following fields: wasCalled, callCount, mostRecentCall, and argsForCall (see docs). + * + * Spies are torn down at the end of every spec. + * + * Note: Do not call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj. + * + * @example + * // a stub + * var myStub = jasmine.createSpy('myStub'); // can be used anywhere + * + * // spy example + * var foo = { + * not: function(bool) { return !bool; } + * } + * + * // actual foo.not will not be called, execution stops + * spyOn(foo, 'not'); + + // foo.not spied upon, execution will continue to implementation + * spyOn(foo, 'not').andCallThrough(); + * + * // fake example + * var foo = { + * not: function(bool) { return !bool; } + * } + * + * // foo.not(val) will return val + * spyOn(foo, 'not').andCallFake(function(value) {return value;}); + * + * // mock example + * foo.not(7 == 7); + * expect(foo.not).toHaveBeenCalled(); + * expect(foo.not).toHaveBeenCalledWith(true); + * + * @constructor + * @see spyOn, jasmine.createSpy, jasmine.createSpyObj + * @param {String} name + */ +jasmine.Spy = function(name) { + /** + * The name of the spy, if provided. + */ + this.identity = name || 'unknown'; + /** + * Is this Object a spy? + */ + this.isSpy = true; + /** + * The actual function this spy stubs. + */ + this.plan = function() { + }; + /** + * Tracking of the most recent call to the spy. + * @example + * var mySpy = jasmine.createSpy('foo'); + * mySpy(1, 2); + * mySpy.mostRecentCall.args = [1, 2]; + */ + this.mostRecentCall = {}; + + /** + * Holds arguments for each call to the spy, indexed by call count + * @example + * var mySpy = jasmine.createSpy('foo'); + * mySpy(1, 2); + * mySpy(7, 8); + * mySpy.mostRecentCall.args = [7, 8]; + * mySpy.argsForCall[0] = [1, 2]; + * mySpy.argsForCall[1] = [7, 8]; + */ + this.argsForCall = []; + this.calls = []; +}; + +/** + * Tells a spy to call through to the actual implemenatation. + * + * @example + * var foo = { + * bar: function() { // do some stuff } + * } + * + * // defining a spy on an existing property: foo.bar + * spyOn(foo, 'bar').andCallThrough(); + */ +jasmine.Spy.prototype.andCallThrough = function() { + this.plan = this.originalValue; + return this; +}; + +/** + * For setting the return value of a spy. + * + * @example + * // defining a spy from scratch: foo() returns 'baz' + * var foo = jasmine.createSpy('spy on foo').andReturn('baz'); + * + * // defining a spy on an existing property: foo.bar() returns 'baz' + * spyOn(foo, 'bar').andReturn('baz'); + * + * @param {Object} value + */ +jasmine.Spy.prototype.andReturn = function(value) { + this.plan = function() { + return value; + }; + return this; +}; + +/** + * For throwing an exception when a spy is called. + * + * @example + * // defining a spy from scratch: foo() throws an exception w/ message 'ouch' + * var foo = jasmine.createSpy('spy on foo').andThrow('baz'); + * + * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch' + * spyOn(foo, 'bar').andThrow('baz'); + * + * @param {String} exceptionMsg + */ +jasmine.Spy.prototype.andThrow = function(exceptionMsg) { + this.plan = function() { + throw exceptionMsg; + }; + return this; +}; + +/** + * Calls an alternate implementation when a spy is called. + * + * @example + * var baz = function() { + * // do some stuff, return something + * } + * // defining a spy from scratch: foo() calls the function baz + * var foo = jasmine.createSpy('spy on foo').andCall(baz); + * + * // defining a spy on an existing property: foo.bar() calls an anonymnous function + * spyOn(foo, 'bar').andCall(function() { return 'baz';} ); + * + * @param {Function} fakeFunc + */ +jasmine.Spy.prototype.andCallFake = function(fakeFunc) { + this.plan = fakeFunc; + return this; +}; + +/** + * Resets all of a spy's the tracking variables so that it can be used again. + * + * @example + * spyOn(foo, 'bar'); + * + * foo.bar(); + * + * expect(foo.bar.callCount).toEqual(1); + * + * foo.bar.reset(); + * + * expect(foo.bar.callCount).toEqual(0); + */ +jasmine.Spy.prototype.reset = function() { + this.wasCalled = false; + this.callCount = 0; + this.argsForCall = []; + this.calls = []; + this.mostRecentCall = {}; +}; + +jasmine.createSpy = function(name) { + + var spyObj = function() { + spyObj.wasCalled = true; + spyObj.callCount++; + var args = jasmine.util.argsToArray(arguments); + spyObj.mostRecentCall.object = this; + spyObj.mostRecentCall.args = args; + spyObj.argsForCall.push(args); + spyObj.calls.push({object: this, args: args}); + return spyObj.plan.apply(this, arguments); + }; + + var spy = new jasmine.Spy(name); + + for (var prop in spy) { + spyObj[prop] = spy[prop]; + } + + spyObj.reset(); + + return spyObj; +}; + +/** + * Determines whether an object is a spy. + * + * @param {jasmine.Spy|Object} putativeSpy + * @returns {Boolean} + */ +jasmine.isSpy = function(putativeSpy) { + return putativeSpy && putativeSpy.isSpy; +}; + +/** + * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something + * large in one call. + * + * @param {String} baseName name of spy class + * @param {Array} methodNames array of names of methods to make spies + */ +jasmine.createSpyObj = function(baseName, methodNames) { + if (!jasmine.isArray_(methodNames) || methodNames.length === 0) { + throw new Error('createSpyObj requires a non-empty array of method names to create spies for'); + } + var obj = {}; + for (var i = 0; i < methodNames.length; i++) { + obj[methodNames[i]] = jasmine.createSpy(baseName + '.' + methodNames[i]); + } + return obj; +}; + +/** + * All parameters are pretty-printed and concatenated together, then written to the current spec's output. + * + * Be careful not to leave calls to jasmine.log in production code. + */ +jasmine.log = function() { + var spec = jasmine.getEnv().currentSpec; + spec.log.apply(spec, arguments); +}; + +/** + * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy. + * + * @example + * // spy example + * var foo = { + * not: function(bool) { return !bool; } + * } + * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops + * + * @see jasmine.createSpy + * @param obj + * @param methodName + * @returns a Jasmine spy that can be chained with all spy methods + */ +var spyOn = function(obj, methodName) { + return jasmine.getEnv().currentSpec.spyOn(obj, methodName); +}; +if (isCommonJS) exports.spyOn = spyOn; + +/** + * Creates a Jasmine spec that will be added to the current suite. + * + * // TODO: pending tests + * + * @example + * it('should be true', function() { + * expect(true).toEqual(true); + * }); + * + * @param {String} desc description of this specification + * @param {Function} func defines the preconditions and expectations of the spec + */ +var it = function(desc, func) { + return jasmine.getEnv().it(desc, func); +}; +if (isCommonJS) exports.it = it; + +/** + * Creates a disabled Jasmine spec. + * + * A convenience method that allows existing specs to be disabled temporarily during development. + * + * @param {String} desc description of this specification + * @param {Function} func defines the preconditions and expectations of the spec + */ +var xit = function(desc, func) { + return jasmine.getEnv().xit(desc, func); +}; +if (isCommonJS) exports.xit = xit; + +/** + * Starts a chain for a Jasmine expectation. + * + * It is passed an Object that is the actual value and should chain to one of the many + * jasmine.Matchers functions. + * + * @param {Object} actual Actual value to test against and expected value + */ +var expect = function(actual) { + return jasmine.getEnv().currentSpec.expect(actual); +}; +if (isCommonJS) exports.expect = expect; + +/** + * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs. + * + * @param {Function} func Function that defines part of a jasmine spec. + */ +var runs = function(func) { + jasmine.getEnv().currentSpec.runs(func); +}; +if (isCommonJS) exports.runs = runs; + +/** + * Waits a fixed time period before moving to the next block. + * + * @deprecated Use waitsFor() instead + * @param {Number} timeout milliseconds to wait + */ +var waits = function(timeout) { + jasmine.getEnv().currentSpec.waits(timeout); +}; +if (isCommonJS) exports.waits = waits; + +/** + * Waits for the latchFunction to return true before proceeding to the next block. + * + * @param {Function} latchFunction + * @param {String} optional_timeoutMessage + * @param {Number} optional_timeout + */ +var waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { + jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec, arguments); +}; +if (isCommonJS) exports.waitsFor = waitsFor; + +/** + * A function that is called before each spec in a suite. + * + * Used for spec setup, including validating assumptions. + * + * @param {Function} beforeEachFunction + */ +var beforeEach = function(beforeEachFunction) { + jasmine.getEnv().beforeEach(beforeEachFunction); +}; +if (isCommonJS) exports.beforeEach = beforeEach; + +/** + * A function that is called after each spec in a suite. + * + * Used for restoring any state that is hijacked during spec execution. + * + * @param {Function} afterEachFunction + */ +var afterEach = function(afterEachFunction) { + jasmine.getEnv().afterEach(afterEachFunction); +}; +if (isCommonJS) exports.afterEach = afterEach; + +/** + * Defines a suite of specifications. + * + * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared + * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization + * of setup in some tests. + * + * @example + * // TODO: a simple suite + * + * // TODO: a simple suite with a nested describe block + * + * @param {String} description A string, usually the class under test. + * @param {Function} specDefinitions function that defines several specs. + */ +var describe = function(description, specDefinitions) { + return jasmine.getEnv().describe(description, specDefinitions); +}; +if (isCommonJS) exports.describe = describe; + +/** + * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development. + * + * @param {String} description A string, usually the class under test. + * @param {Function} specDefinitions function that defines several specs. + */ +var xdescribe = function(description, specDefinitions) { + return jasmine.getEnv().xdescribe(description, specDefinitions); +}; +if (isCommonJS) exports.xdescribe = xdescribe; + + +// Provide the XMLHttpRequest class for IE 5.x-6.x: +jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { + function tryIt(f) { + try { + return f(); + } catch(e) { + } + return null; + } + + var xhr = tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP.6.0"); + }) || + tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP.3.0"); + }) || + tryIt(function() { + return new ActiveXObject("Msxml2.XMLHTTP"); + }) || + tryIt(function() { + return new ActiveXObject("Microsoft.XMLHTTP"); + }); + + if (!xhr) throw new Error("This browser does not support XMLHttpRequest."); + + return xhr; +} : XMLHttpRequest; +/** + * @namespace + */ +jasmine.util = {}; + +/** + * Declare that a child class inherit it's prototype from the parent class. + * + * @private + * @param {Function} childClass + * @param {Function} parentClass + */ +jasmine.util.inherit = function(childClass, parentClass) { + /** + * @private + */ + var subclass = function() { + }; + subclass.prototype = parentClass.prototype; + childClass.prototype = new subclass(); +}; + +jasmine.util.formatException = function(e) { + var lineNumber; + if (e.line) { + lineNumber = e.line; + } + else if (e.lineNumber) { + lineNumber = e.lineNumber; + } + + var file; + + if (e.sourceURL) { + file = e.sourceURL; + } + else if (e.fileName) { + file = e.fileName; + } + + var message = (e.name && e.message) ? (e.name + ': ' + e.message) : e.toString(); + + if (file && lineNumber) { + message += ' in ' + file + ' (line ' + lineNumber + ')'; + } + + return message; +}; + +jasmine.util.htmlEscape = function(str) { + if (!str) return str; + return str.replace(/&/g, '&') + .replace(//g, '>'); +}; + +jasmine.util.argsToArray = function(args) { + var arrayOfArgs = []; + for (var i = 0; i < args.length; i++) arrayOfArgs.push(args[i]); + return arrayOfArgs; +}; + +jasmine.util.extend = function(destination, source) { + for (var property in source) destination[property] = source[property]; + return destination; +}; + +/** + * Environment for Jasmine + * + * @constructor + */ +jasmine.Env = function() { + this.currentSpec = null; + this.currentSuite = null; + this.currentRunner_ = new jasmine.Runner(this); + + this.reporter = new jasmine.MultiReporter(); + + this.updateInterval = jasmine.DEFAULT_UPDATE_INTERVAL; + this.defaultTimeoutInterval = jasmine.DEFAULT_TIMEOUT_INTERVAL; + this.lastUpdate = 0; + this.specFilter = function() { + return true; + }; + + this.nextSpecId_ = 0; + this.nextSuiteId_ = 0; + this.equalityTesters_ = []; + + // wrap matchers + this.matchersClass = function() { + jasmine.Matchers.apply(this, arguments); + }; + jasmine.util.inherit(this.matchersClass, jasmine.Matchers); + + jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype, this.matchersClass); +}; + + +jasmine.Env.prototype.setTimeout = jasmine.setTimeout; +jasmine.Env.prototype.clearTimeout = jasmine.clearTimeout; +jasmine.Env.prototype.setInterval = jasmine.setInterval; +jasmine.Env.prototype.clearInterval = jasmine.clearInterval; + +/** + * @returns an object containing jasmine version build info, if set. + */ +jasmine.Env.prototype.version = function () { + if (jasmine.version_) { + return jasmine.version_; + } else { + throw new Error('Version not set'); + } +}; + +/** + * @returns string containing jasmine version build info, if set. + */ +jasmine.Env.prototype.versionString = function() { + if (jasmine.version_) { + var version = this.version(); + var versionString = version.major + "." + version.minor + "." + version.build; + if (version.release_candidate) { + versionString += ".rc" + version.release_candidate + } + versionString += " revision " + version.revision + return versionString; + } else { + return "version unknown"; + } +}; + +/** + * @returns a sequential integer starting at 0 + */ +jasmine.Env.prototype.nextSpecId = function () { + return this.nextSpecId_++; +}; + +/** + * @returns a sequential integer starting at 0 + */ +jasmine.Env.prototype.nextSuiteId = function () { + return this.nextSuiteId_++; +}; + +/** + * Register a reporter to receive status updates from Jasmine. + * @param {jasmine.Reporter} reporter An object which will receive status updates. + */ +jasmine.Env.prototype.addReporter = function(reporter) { + this.reporter.addReporter(reporter); +}; + +jasmine.Env.prototype.execute = function() { + this.currentRunner_.execute(); +}; + +jasmine.Env.prototype.describe = function(description, specDefinitions) { + var suite = new jasmine.Suite(this, description, specDefinitions, this.currentSuite); + + var parentSuite = this.currentSuite; + if (parentSuite) { + parentSuite.add(suite); + } else { + this.currentRunner_.add(suite); + } + + this.currentSuite = suite; + + var declarationError = null; + try { + specDefinitions.call(suite); + } catch(e) { + declarationError = e; + } + + if (declarationError) { + this.it("encountered a declaration exception", function() { + throw declarationError; + }); + } + + this.currentSuite = parentSuite; + + return suite; +}; + +jasmine.Env.prototype.beforeEach = function(beforeEachFunction) { + if (this.currentSuite) { + this.currentSuite.beforeEach(beforeEachFunction); + } else { + this.currentRunner_.beforeEach(beforeEachFunction); + } +}; + +jasmine.Env.prototype.currentRunner = function () { + return this.currentRunner_; +}; + +jasmine.Env.prototype.afterEach = function(afterEachFunction) { + if (this.currentSuite) { + this.currentSuite.afterEach(afterEachFunction); + } else { + this.currentRunner_.afterEach(afterEachFunction); + } + +}; + +jasmine.Env.prototype.xdescribe = function(desc, specDefinitions) { + return { + execute: function() { + } + }; +}; + +jasmine.Env.prototype.it = function(description, func) { + var spec = new jasmine.Spec(this, this.currentSuite, description); + this.currentSuite.add(spec); + this.currentSpec = spec; + + if (func) { + spec.runs(func); + } + + return spec; +}; + +jasmine.Env.prototype.xit = function(desc, func) { + return { + id: this.nextSpecId(), + runs: function() { + } + }; +}; + +jasmine.Env.prototype.compareObjects_ = function(a, b, mismatchKeys, mismatchValues) { + if (a.__Jasmine_been_here_before__ === b && b.__Jasmine_been_here_before__ === a) { + return true; + } + + a.__Jasmine_been_here_before__ = b; + b.__Jasmine_been_here_before__ = a; + + var hasKey = function(obj, keyName) { + return obj !== null && obj[keyName] !== jasmine.undefined; + }; + + for (var property in b) { + if (!hasKey(a, property) && hasKey(b, property)) { + mismatchKeys.push("expected has key '" + property + "', but missing from actual."); + } + } + for (property in a) { + if (!hasKey(b, property) && hasKey(a, property)) { + mismatchKeys.push("expected missing key '" + property + "', but present in actual."); + } + } + for (property in b) { + if (property == '__Jasmine_been_here_before__') continue; + if (!this.equals_(a[property], b[property], mismatchKeys, mismatchValues)) { + mismatchValues.push("'" + property + "' was '" + (b[property] ? jasmine.util.htmlEscape(b[property].toString()) : b[property]) + "' in expected, but was '" + (a[property] ? jasmine.util.htmlEscape(a[property].toString()) : a[property]) + "' in actual."); + } + } + + if (jasmine.isArray_(a) && jasmine.isArray_(b) && a.length != b.length) { + mismatchValues.push("arrays were not the same length"); + } + + delete a.__Jasmine_been_here_before__; + delete b.__Jasmine_been_here_before__; + return (mismatchKeys.length === 0 && mismatchValues.length === 0); +}; + +jasmine.Env.prototype.equals_ = function(a, b, mismatchKeys, mismatchValues) { + mismatchKeys = mismatchKeys || []; + mismatchValues = mismatchValues || []; + + for (var i = 0; i < this.equalityTesters_.length; i++) { + var equalityTester = this.equalityTesters_[i]; + var result = equalityTester(a, b, this, mismatchKeys, mismatchValues); + if (result !== jasmine.undefined) return result; + } + + if (a === b) return true; + + if (a === jasmine.undefined || a === null || b === jasmine.undefined || b === null) { + return (a == jasmine.undefined && b == jasmine.undefined); + } + + if (jasmine.isDomNode(a) && jasmine.isDomNode(b)) { + return a === b; + } + + if (a instanceof Date && b instanceof Date) { + return a.getTime() == b.getTime(); + } + + if (a instanceof jasmine.Matchers.Any) { + return a.matches(b); + } + + if (b instanceof jasmine.Matchers.Any) { + return b.matches(a); + } + + if (jasmine.isString_(a) && jasmine.isString_(b)) { + return (a == b); + } + + if (jasmine.isNumber_(a) && jasmine.isNumber_(b)) { + return (a == b); + } + + if (typeof a === "object" && typeof b === "object") { + return this.compareObjects_(a, b, mismatchKeys, mismatchValues); + } + + //Straight check + return (a === b); +}; + +jasmine.Env.prototype.contains_ = function(haystack, needle) { + if (jasmine.isArray_(haystack)) { + for (var i = 0; i < haystack.length; i++) { + if (this.equals_(haystack[i], needle)) return true; + } + return false; + } + return haystack.indexOf(needle) >= 0; +}; + +jasmine.Env.prototype.addEqualityTester = function(equalityTester) { + this.equalityTesters_.push(equalityTester); +}; +/** No-op base class for Jasmine reporters. + * + * @constructor + */ +jasmine.Reporter = function() { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerStarting = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportRunnerResults = function(runner) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecStarting = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.reportSpecResults = function(spec) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.Reporter.prototype.log = function(str) { +}; + +/** + * Blocks are functions with executable code that make up a spec. + * + * @constructor + * @param {jasmine.Env} env + * @param {Function} func + * @param {jasmine.Spec} spec + */ +jasmine.Block = function(env, func, spec) { + this.env = env; + this.func = func; + this.spec = spec; +}; + +jasmine.Block.prototype.execute = function(onComplete) { + try { + this.func.apply(this.spec); + } catch (e) { + this.spec.fail(e); + } + onComplete(); +}; +/** JavaScript API reporter. + * + * @constructor + */ +jasmine.JsApiReporter = function() { + this.started = false; + this.finished = false; + this.suites_ = []; + this.results_ = {}; +}; + +jasmine.JsApiReporter.prototype.reportRunnerStarting = function(runner) { + this.started = true; + var suites = runner.topLevelSuites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + this.suites_.push(this.summarize_(suite)); + } +}; + +jasmine.JsApiReporter.prototype.suites = function() { + return this.suites_; +}; + +jasmine.JsApiReporter.prototype.summarize_ = function(suiteOrSpec) { + var isSuite = suiteOrSpec instanceof jasmine.Suite; + var summary = { + id: suiteOrSpec.id, + name: suiteOrSpec.description, + type: isSuite ? 'suite' : 'spec', + children: [] + }; + + if (isSuite) { + var children = suiteOrSpec.children(); + for (var i = 0; i < children.length; i++) { + summary.children.push(this.summarize_(children[i])); + } + } + return summary; +}; + +jasmine.JsApiReporter.prototype.results = function() { + return this.results_; +}; + +jasmine.JsApiReporter.prototype.resultsForSpec = function(specId) { + return this.results_[specId]; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportRunnerResults = function(runner) { + this.finished = true; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportSuiteResults = function(suite) { +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.reportSpecResults = function(spec) { + this.results_[spec.id] = { + messages: spec.results().getItems(), + result: spec.results().failedCount > 0 ? "failed" : "passed" + }; +}; + +//noinspection JSUnusedLocalSymbols +jasmine.JsApiReporter.prototype.log = function(str) { +}; + +jasmine.JsApiReporter.prototype.resultsForSpecs = function(specIds){ + var results = {}; + for (var i = 0; i < specIds.length; i++) { + var specId = specIds[i]; + results[specId] = this.summarizeResult_(this.results_[specId]); + } + return results; +}; + +jasmine.JsApiReporter.prototype.summarizeResult_ = function(result){ + var summaryMessages = []; + var messagesLength = result.messages.length; + for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) { + var resultMessage = result.messages[messageIndex]; + summaryMessages.push({ + text: resultMessage.type == 'log' ? resultMessage.toString() : jasmine.undefined, + passed: resultMessage.passed ? resultMessage.passed() : true, + type: resultMessage.type, + message: resultMessage.message, + trace: { + stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined + } + }); + } + + return { + result : result.result, + messages : summaryMessages + }; +}; + +/** + * @constructor + * @param {jasmine.Env} env + * @param actual + * @param {jasmine.Spec} spec + */ +jasmine.Matchers = function(env, actual, spec, opt_isNot) { + this.env = env; + this.actual = actual; + this.spec = spec; + this.isNot = opt_isNot || false; + this.reportWasCalled_ = false; +}; + +// todo: @deprecated as of Jasmine 0.11, remove soon [xw] +jasmine.Matchers.pp = function(str) { + throw new Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!"); +}; + +// todo: @deprecated Deprecated as of Jasmine 0.10. Rewrite your custom matchers to return true or false. [xw] +jasmine.Matchers.prototype.report = function(result, failing_message, details) { + throw new Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs"); +}; + +jasmine.Matchers.wrapInto_ = function(prototype, matchersClass) { + for (var methodName in prototype) { + if (methodName == 'report') continue; + var orig = prototype[methodName]; + matchersClass.prototype[methodName] = jasmine.Matchers.matcherFn_(methodName, orig); + } +}; + +jasmine.Matchers.matcherFn_ = function(matcherName, matcherFunction) { + return function() { + var matcherArgs = jasmine.util.argsToArray(arguments); + var result = matcherFunction.apply(this, arguments); + + if (this.isNot) { + result = !result; + } + + if (this.reportWasCalled_) return result; + + var message; + if (!result) { + if (this.message) { + message = this.message.apply(this, arguments); + if (jasmine.isArray_(message)) { + message = message[this.isNot ? 1 : 0]; + } + } else { + var englishyPredicate = matcherName.replace(/[A-Z]/g, function(s) { return ' ' + s.toLowerCase(); }); + message = "Expected " + jasmine.pp(this.actual) + (this.isNot ? " not " : " ") + englishyPredicate; + if (matcherArgs.length > 0) { + for (var i = 0; i < matcherArgs.length; i++) { + if (i > 0) message += ","; + message += " " + jasmine.pp(matcherArgs[i]); + } + } + message += "."; + } + } + var expectationResult = new jasmine.ExpectationResult({ + matcherName: matcherName, + passed: result, + expected: matcherArgs.length > 1 ? matcherArgs : matcherArgs[0], + actual: this.actual, + message: message + }); + this.spec.addMatcherResult(expectationResult); + return jasmine.undefined; + }; +}; + + + + +/** + * toBe: compares the actual to the expected using === + * @param expected + */ +jasmine.Matchers.prototype.toBe = function(expected) { + return this.actual === expected; +}; + +/** + * toNotBe: compares the actual to the expected using !== + * @param expected + * @deprecated as of 1.0. Use not.toBe() instead. + */ +jasmine.Matchers.prototype.toNotBe = function(expected) { + return this.actual !== expected; +}; + +/** + * toEqual: compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc. + * + * @param expected + */ +jasmine.Matchers.prototype.toEqual = function(expected) { + return this.env.equals_(this.actual, expected); +}; + +/** + * toNotEqual: compares the actual to the expected using the ! of jasmine.Matchers.toEqual + * @param expected + * @deprecated as of 1.0. Use not.toNotEqual() instead. + */ +jasmine.Matchers.prototype.toNotEqual = function(expected) { + return !this.env.equals_(this.actual, expected); +}; + +/** + * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes + * a pattern or a String. + * + * @param expected + */ +jasmine.Matchers.prototype.toMatch = function(expected) { + return new RegExp(expected).test(this.actual); +}; + +/** + * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch + * @param expected + * @deprecated as of 1.0. Use not.toMatch() instead. + */ +jasmine.Matchers.prototype.toNotMatch = function(expected) { + return !(new RegExp(expected).test(this.actual)); +}; + +/** + * Matcher that compares the actual to jasmine.undefined. + */ +jasmine.Matchers.prototype.toBeDefined = function() { + return (this.actual !== jasmine.undefined); +}; + +/** + * Matcher that compares the actual to jasmine.undefined. + */ +jasmine.Matchers.prototype.toBeUndefined = function() { + return (this.actual === jasmine.undefined); +}; + +/** + * Matcher that compares the actual to null. + */ +jasmine.Matchers.prototype.toBeNull = function() { + return (this.actual === null); +}; + +/** + * Matcher that boolean not-nots the actual. + */ +jasmine.Matchers.prototype.toBeTruthy = function() { + return !!this.actual; +}; + + +/** + * Matcher that boolean nots the actual. + */ +jasmine.Matchers.prototype.toBeFalsy = function() { + return !this.actual; +}; + + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was called. + */ +jasmine.Matchers.prototype.toHaveBeenCalled = function() { + if (arguments.length > 0) { + throw new Error('toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith'); + } + + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy " + this.actual.identity + " to have been called.", + "Expected spy " + this.actual.identity + " not to have been called." + ]; + }; + + return this.actual.wasCalled; +}; + +/** @deprecated Use expect(xxx).toHaveBeenCalled() instead */ +jasmine.Matchers.prototype.wasCalled = jasmine.Matchers.prototype.toHaveBeenCalled; + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was not called. + * + * @deprecated Use expect(xxx).not.toHaveBeenCalled() instead + */ +jasmine.Matchers.prototype.wasNotCalled = function() { + if (arguments.length > 0) { + throw new Error('wasNotCalled does not take arguments'); + } + + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy " + this.actual.identity + " to not have been called.", + "Expected spy " + this.actual.identity + " to have been called." + ]; + }; + + return !this.actual.wasCalled; +}; + +/** + * Matcher that checks to see if the actual, a Jasmine spy, was called with a set of parameters. + * + * @example + * + */ +jasmine.Matchers.prototype.toHaveBeenCalledWith = function() { + var expectedArgs = jasmine.util.argsToArray(arguments); + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + this.message = function() { + if (this.actual.callCount === 0) { + // todo: what should the failure message for .not.toHaveBeenCalledWith() be? is this right? test better. [xw] + return [ + "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but it was never called.", + "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but it was." + ]; + } else { + return [ + "Expected spy " + this.actual.identity + " to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall), + "Expected spy " + this.actual.identity + " not to have been called with " + jasmine.pp(expectedArgs) + " but was called with " + jasmine.pp(this.actual.argsForCall) + ]; + } + }; + + return this.env.contains_(this.actual.argsForCall, expectedArgs); +}; + +/** @deprecated Use expect(xxx).toHaveBeenCalledWith() instead */ +jasmine.Matchers.prototype.wasCalledWith = jasmine.Matchers.prototype.toHaveBeenCalledWith; + +/** @deprecated Use expect(xxx).not.toHaveBeenCalledWith() instead */ +jasmine.Matchers.prototype.wasNotCalledWith = function() { + var expectedArgs = jasmine.util.argsToArray(arguments); + if (!jasmine.isSpy(this.actual)) { + throw new Error('Expected a spy, but got ' + jasmine.pp(this.actual) + '.'); + } + + this.message = function() { + return [ + "Expected spy not to have been called with " + jasmine.pp(expectedArgs) + " but it was", + "Expected spy to have been called with " + jasmine.pp(expectedArgs) + " but it was" + ]; + }; + + return !this.env.contains_(this.actual.argsForCall, expectedArgs); +}; + +/** + * Matcher that checks that the expected item is an element in the actual Array. + * + * @param {Object} expected + */ +jasmine.Matchers.prototype.toContain = function(expected) { + return this.env.contains_(this.actual, expected); +}; + +/** + * Matcher that checks that the expected item is NOT an element in the actual Array. + * + * @param {Object} expected + * @deprecated as of 1.0. Use not.toNotContain() instead. + */ +jasmine.Matchers.prototype.toNotContain = function(expected) { + return !this.env.contains_(this.actual, expected); +}; + +jasmine.Matchers.prototype.toBeLessThan = function(expected) { + return this.actual < expected; +}; + +jasmine.Matchers.prototype.toBeGreaterThan = function(expected) { + return this.actual > expected; +}; + +/** + * Matcher that checks that the expected item is equal to the actual item + * up to a given level of decimal precision (default 2). + * + * @param {Number} expected + * @param {Number} precision + */ +jasmine.Matchers.prototype.toBeCloseTo = function(expected, precision) { + if (!(precision === 0)) { + precision = precision || 2; + } + var multiplier = Math.pow(10, precision); + var actual = Math.round(this.actual * multiplier); + expected = Math.round(expected * multiplier); + return expected == actual; +}; + +/** + * Matcher that checks that the expected exception was thrown by the actual. + * + * @param {String} expected + */ +jasmine.Matchers.prototype.toThrow = function(expected) { + var result = false; + var exception; + if (typeof this.actual != 'function') { + throw new Error('Actual is not a function'); + } + try { + this.actual(); + } catch (e) { + exception = e; + } + if (exception) { + result = (expected === jasmine.undefined || this.env.equals_(exception.message || exception, expected.message || expected)); + } + + var not = this.isNot ? "not " : ""; + + this.message = function() { + if (exception && (expected === jasmine.undefined || !this.env.equals_(exception.message || exception, expected.message || expected))) { + return ["Expected function " + not + "to throw", expected ? expected.message || expected : "an exception", ", but it threw", exception.message || exception].join(' '); + } else { + return "Expected function to throw an exception."; + } + }; + + return result; +}; + +jasmine.Matchers.Any = function(expectedClass) { + this.expectedClass = expectedClass; +}; + +jasmine.Matchers.Any.prototype.matches = function(other) { + if (this.expectedClass == String) { + return typeof other == 'string' || other instanceof String; + } + + if (this.expectedClass == Number) { + return typeof other == 'number' || other instanceof Number; + } + + if (this.expectedClass == Function) { + return typeof other == 'function' || other instanceof Function; + } + + if (this.expectedClass == Object) { + return typeof other == 'object'; + } + + return other instanceof this.expectedClass; +}; + +jasmine.Matchers.Any.prototype.toString = function() { + return ''; +}; + +/** + * @constructor + */ +jasmine.MultiReporter = function() { + this.subReporters_ = []; +}; +jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter); + +jasmine.MultiReporter.prototype.addReporter = function(reporter) { + this.subReporters_.push(reporter); +}; + +(function() { + var functionNames = [ + "reportRunnerStarting", + "reportRunnerResults", + "reportSuiteResults", + "reportSpecStarting", + "reportSpecResults", + "log" + ]; + for (var i = 0; i < functionNames.length; i++) { + var functionName = functionNames[i]; + jasmine.MultiReporter.prototype[functionName] = (function(functionName) { + return function() { + for (var j = 0; j < this.subReporters_.length; j++) { + var subReporter = this.subReporters_[j]; + if (subReporter[functionName]) { + subReporter[functionName].apply(subReporter, arguments); + } + } + }; + })(functionName); + } +})(); +/** + * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults + * + * @constructor + */ +jasmine.NestedResults = function() { + /** + * The total count of results + */ + this.totalCount = 0; + /** + * Number of passed results + */ + this.passedCount = 0; + /** + * Number of failed results + */ + this.failedCount = 0; + /** + * Was this suite/spec skipped? + */ + this.skipped = false; + /** + * @ignore + */ + this.items_ = []; +}; + +/** + * Roll up the result counts. + * + * @param result + */ +jasmine.NestedResults.prototype.rollupCounts = function(result) { + this.totalCount += result.totalCount; + this.passedCount += result.passedCount; + this.failedCount += result.failedCount; +}; + +/** + * Adds a log message. + * @param values Array of message parts which will be concatenated later. + */ +jasmine.NestedResults.prototype.log = function(values) { + this.items_.push(new jasmine.MessageResult(values)); +}; + +/** + * Getter for the results: message & results. + */ +jasmine.NestedResults.prototype.getItems = function() { + return this.items_; +}; + +/** + * Adds a result, tracking counts (total, passed, & failed) + * @param {jasmine.ExpectationResult|jasmine.NestedResults} result + */ +jasmine.NestedResults.prototype.addResult = function(result) { + if (result.type != 'log') { + if (result.items_) { + this.rollupCounts(result); + } else { + this.totalCount++; + if (result.passed()) { + this.passedCount++; + } else { + this.failedCount++; + } + } + } + this.items_.push(result); +}; + +/** + * @returns {Boolean} True if everything below passed + */ +jasmine.NestedResults.prototype.passed = function() { + return this.passedCount === this.totalCount; +}; +/** + * Base class for pretty printing for expectation results. + */ +jasmine.PrettyPrinter = function() { + this.ppNestLevel_ = 0; +}; + +/** + * Formats a value in a nice, human-readable string. + * + * @param value + */ +jasmine.PrettyPrinter.prototype.format = function(value) { + if (this.ppNestLevel_ > 40) { + throw new Error('jasmine.PrettyPrinter: format() nested too deeply!'); + } + + this.ppNestLevel_++; + try { + if (value === jasmine.undefined) { + this.emitScalar('undefined'); + } else if (value === null) { + this.emitScalar('null'); + } else if (value === jasmine.getGlobal()) { + this.emitScalar(''); + } else if (value instanceof jasmine.Matchers.Any) { + this.emitScalar(value.toString()); + } else if (typeof value === 'string') { + this.emitString(value); + } else if (jasmine.isSpy(value)) { + this.emitScalar("spy on " + value.identity); + } else if (value instanceof RegExp) { + this.emitScalar(value.toString()); + } else if (typeof value === 'function') { + this.emitScalar('Function'); + } else if (typeof value.nodeType === 'number') { + this.emitScalar('HTMLNode'); + } else if (value instanceof Date) { + this.emitScalar('Date(' + value + ')'); + } else if (value.__Jasmine_been_here_before__) { + this.emitScalar(''); + } else if (jasmine.isArray_(value) || typeof value == 'object') { + value.__Jasmine_been_here_before__ = true; + if (jasmine.isArray_(value)) { + this.emitArray(value); + } else { + this.emitObject(value); + } + delete value.__Jasmine_been_here_before__; + } else { + this.emitScalar(value.toString()); + } + } finally { + this.ppNestLevel_--; + } +}; + +jasmine.PrettyPrinter.prototype.iterateObject = function(obj, fn) { + for (var property in obj) { + if (property == '__Jasmine_been_here_before__') continue; + fn(property, obj.__lookupGetter__ ? (obj.__lookupGetter__(property) !== jasmine.undefined && + obj.__lookupGetter__(property) !== null) : false); + } +}; + +jasmine.PrettyPrinter.prototype.emitArray = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitObject = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitScalar = jasmine.unimplementedMethod_; +jasmine.PrettyPrinter.prototype.emitString = jasmine.unimplementedMethod_; + +jasmine.StringPrettyPrinter = function() { + jasmine.PrettyPrinter.call(this); + + this.string = ''; +}; +jasmine.util.inherit(jasmine.StringPrettyPrinter, jasmine.PrettyPrinter); + +jasmine.StringPrettyPrinter.prototype.emitScalar = function(value) { + this.append(value); +}; + +jasmine.StringPrettyPrinter.prototype.emitString = function(value) { + this.append("'" + value + "'"); +}; + +jasmine.StringPrettyPrinter.prototype.emitArray = function(array) { + this.append('[ '); + for (var i = 0; i < array.length; i++) { + if (i > 0) { + this.append(', '); + } + this.format(array[i]); + } + this.append(' ]'); +}; + +jasmine.StringPrettyPrinter.prototype.emitObject = function(obj) { + var self = this; + this.append('{ '); + var first = true; + + this.iterateObject(obj, function(property, isGetter) { + if (first) { + first = false; + } else { + self.append(', '); + } + + self.append(property); + self.append(' : '); + if (isGetter) { + self.append(''); + } else { + self.format(obj[property]); + } + }); + + this.append(' }'); +}; + +jasmine.StringPrettyPrinter.prototype.append = function(value) { + this.string += value; +}; +jasmine.Queue = function(env) { + this.env = env; + this.blocks = []; + this.running = false; + this.index = 0; + this.offset = 0; + this.abort = false; +}; + +jasmine.Queue.prototype.addBefore = function(block) { + this.blocks.unshift(block); +}; + +jasmine.Queue.prototype.add = function(block) { + this.blocks.push(block); +}; + +jasmine.Queue.prototype.insertNext = function(block) { + this.blocks.splice((this.index + this.offset + 1), 0, block); + this.offset++; +}; + +jasmine.Queue.prototype.start = function(onComplete) { + this.running = true; + this.onComplete = onComplete; + this.next_(); +}; + +jasmine.Queue.prototype.isRunning = function() { + return this.running; +}; + +jasmine.Queue.LOOP_DONT_RECURSE = true; + +jasmine.Queue.prototype.next_ = function() { + var self = this; + var goAgain = true; + + while (goAgain) { + goAgain = false; + + if (self.index < self.blocks.length && !this.abort) { + var calledSynchronously = true; + var completedSynchronously = false; + + var onComplete = function () { + if (jasmine.Queue.LOOP_DONT_RECURSE && calledSynchronously) { + completedSynchronously = true; + return; + } + + if (self.blocks[self.index] && self.blocks[self.index].abort) { + self.abort = true; + } + + self.offset = 0; + self.index++; + + var now = new Date().getTime(); + if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { + self.env.lastUpdate = now; + self.env.setTimeout(function() { + self.next_(); + }, 0); + } else { + if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { + goAgain = true; + } else { + self.next_(); + } + } + }; + self.blocks[self.index].execute(onComplete); + + calledSynchronously = false; + if (completedSynchronously) { + onComplete(); + } + + } else { + self.running = false; + if (self.onComplete) { + self.onComplete(); + } + } + } +}; + +jasmine.Queue.prototype.results = function() { + var results = new jasmine.NestedResults(); + for (var i = 0; i < this.blocks.length; i++) { + if (this.blocks[i].results) { + results.addResult(this.blocks[i].results()); + } + } + return results; +}; + + +/** + * Runner + * + * @constructor + * @param {jasmine.Env} env + */ +jasmine.Runner = function(env) { + var self = this; + self.env = env; + self.queue = new jasmine.Queue(env); + self.before_ = []; + self.after_ = []; + self.suites_ = []; +}; + +jasmine.Runner.prototype.execute = function() { + var self = this; + if (self.env.reporter.reportRunnerStarting) { + self.env.reporter.reportRunnerStarting(this); + } + self.queue.start(function () { + self.finishCallback(); + }); +}; + +jasmine.Runner.prototype.beforeEach = function(beforeEachFunction) { + beforeEachFunction.typeName = 'beforeEach'; + this.before_.splice(0,0,beforeEachFunction); +}; + +jasmine.Runner.prototype.afterEach = function(afterEachFunction) { + afterEachFunction.typeName = 'afterEach'; + this.after_.splice(0,0,afterEachFunction); +}; + + +jasmine.Runner.prototype.finishCallback = function() { + this.env.reporter.reportRunnerResults(this); +}; + +jasmine.Runner.prototype.addSuite = function(suite) { + this.suites_.push(suite); +}; + +jasmine.Runner.prototype.add = function(block) { + if (block instanceof jasmine.Suite) { + this.addSuite(block); + } + this.queue.add(block); +}; + +jasmine.Runner.prototype.specs = function () { + var suites = this.suites(); + var specs = []; + for (var i = 0; i < suites.length; i++) { + specs = specs.concat(suites[i].specs()); + } + return specs; +}; + +jasmine.Runner.prototype.suites = function() { + return this.suites_; +}; + +jasmine.Runner.prototype.topLevelSuites = function() { + var topLevelSuites = []; + for (var i = 0; i < this.suites_.length; i++) { + if (!this.suites_[i].parentSuite) { + topLevelSuites.push(this.suites_[i]); + } + } + return topLevelSuites; +}; + +jasmine.Runner.prototype.results = function() { + return this.queue.results(); +}; +/** + * Internal representation of a Jasmine specification, or test. + * + * @constructor + * @param {jasmine.Env} env + * @param {jasmine.Suite} suite + * @param {String} description + */ +jasmine.Spec = function(env, suite, description) { + if (!env) { + throw new Error('jasmine.Env() required'); + } + if (!suite) { + throw new Error('jasmine.Suite() required'); + } + var spec = this; + spec.id = env.nextSpecId ? env.nextSpecId() : null; + spec.env = env; + spec.suite = suite; + spec.description = description; + spec.queue = new jasmine.Queue(env); + + spec.afterCallbacks = []; + spec.spies_ = []; + + spec.results_ = new jasmine.NestedResults(); + spec.results_.description = description; + spec.matchersClass = null; +}; + +jasmine.Spec.prototype.getFullName = function() { + return this.suite.getFullName() + ' ' + this.description + '.'; +}; + + +jasmine.Spec.prototype.results = function() { + return this.results_; +}; + +/** + * All parameters are pretty-printed and concatenated together, then written to the spec's output. + * + * Be careful not to leave calls to jasmine.log in production code. + */ +jasmine.Spec.prototype.log = function() { + return this.results_.log(arguments); +}; + +jasmine.Spec.prototype.runs = function (func) { + var block = new jasmine.Block(this.env, func, this); + this.addToQueue(block); + return this; +}; + +jasmine.Spec.prototype.addToQueue = function (block) { + if (this.queue.isRunning()) { + this.queue.insertNext(block); + } else { + this.queue.add(block); + } +}; + +/** + * @param {jasmine.ExpectationResult} result + */ +jasmine.Spec.prototype.addMatcherResult = function(result) { + this.results_.addResult(result); +}; + +jasmine.Spec.prototype.expect = function(actual) { + var positive = new (this.getMatchersClass_())(this.env, actual, this); + positive.not = new (this.getMatchersClass_())(this.env, actual, this, true); + return positive; +}; + +/** + * Waits a fixed time period before moving to the next block. + * + * @deprecated Use waitsFor() instead + * @param {Number} timeout milliseconds to wait + */ +jasmine.Spec.prototype.waits = function(timeout) { + var waitsFunc = new jasmine.WaitsBlock(this.env, timeout, this); + this.addToQueue(waitsFunc); + return this; +}; + +/** + * Waits for the latchFunction to return true before proceeding to the next block. + * + * @param {Function} latchFunction + * @param {String} optional_timeoutMessage + * @param {Number} optional_timeout + */ +jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessage, optional_timeout) { + var latchFunction_ = null; + var optional_timeoutMessage_ = null; + var optional_timeout_ = null; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + switch (typeof arg) { + case 'function': + latchFunction_ = arg; + break; + case 'string': + optional_timeoutMessage_ = arg; + break; + case 'number': + optional_timeout_ = arg; + break; + } + } + + var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this); + this.addToQueue(waitsForFunc); + return this; +}; + +jasmine.Spec.prototype.fail = function (e) { + var expectationResult = new jasmine.ExpectationResult({ + passed: false, + message: e ? jasmine.util.formatException(e) : 'Exception', + trace: { stack: e.stack } + }); + this.results_.addResult(expectationResult); +}; + +jasmine.Spec.prototype.getMatchersClass_ = function() { + return this.matchersClass || this.env.matchersClass; +}; + +jasmine.Spec.prototype.addMatchers = function(matchersPrototype) { + var parent = this.getMatchersClass_(); + var newMatchersClass = function() { + parent.apply(this, arguments); + }; + jasmine.util.inherit(newMatchersClass, parent); + jasmine.Matchers.wrapInto_(matchersPrototype, newMatchersClass); + this.matchersClass = newMatchersClass; +}; + +jasmine.Spec.prototype.finishCallback = function() { + this.env.reporter.reportSpecResults(this); +}; + +jasmine.Spec.prototype.finish = function(onComplete) { + this.removeAllSpies(); + this.finishCallback(); + if (onComplete) { + onComplete(); + } +}; + +jasmine.Spec.prototype.after = function(doAfter) { + if (this.queue.isRunning()) { + this.queue.add(new jasmine.Block(this.env, doAfter, this)); + } else { + this.afterCallbacks.unshift(doAfter); + } +}; + +jasmine.Spec.prototype.execute = function(onComplete) { + var spec = this; + if (!spec.env.specFilter(spec)) { + spec.results_.skipped = true; + spec.finish(onComplete); + return; + } + + this.env.reporter.reportSpecStarting(this); + + spec.env.currentSpec = spec; + + spec.addBeforesAndAftersToQueue(); + + spec.queue.start(function () { + spec.finish(onComplete); + }); +}; + +jasmine.Spec.prototype.addBeforesAndAftersToQueue = function() { + var runner = this.env.currentRunner(); + var i; + + for (var suite = this.suite; suite; suite = suite.parentSuite) { + for (i = 0; i < suite.before_.length; i++) { + this.queue.addBefore(new jasmine.Block(this.env, suite.before_[i], this)); + } + } + for (i = 0; i < runner.before_.length; i++) { + this.queue.addBefore(new jasmine.Block(this.env, runner.before_[i], this)); + } + for (i = 0; i < this.afterCallbacks.length; i++) { + this.queue.add(new jasmine.Block(this.env, this.afterCallbacks[i], this)); + } + for (suite = this.suite; suite; suite = suite.parentSuite) { + for (i = 0; i < suite.after_.length; i++) { + this.queue.add(new jasmine.Block(this.env, suite.after_[i], this)); + } + } + for (i = 0; i < runner.after_.length; i++) { + this.queue.add(new jasmine.Block(this.env, runner.after_[i], this)); + } +}; + +jasmine.Spec.prototype.explodes = function() { + throw 'explodes function should not have been called'; +}; + +jasmine.Spec.prototype.spyOn = function(obj, methodName, ignoreMethodDoesntExist) { + if (obj == jasmine.undefined) { + throw "spyOn could not find an object to spy upon for " + methodName + "()"; + } + + if (!ignoreMethodDoesntExist && obj[methodName] === jasmine.undefined) { + throw methodName + '() method does not exist'; + } + + if (!ignoreMethodDoesntExist && obj[methodName] && obj[methodName].isSpy) { + throw new Error(methodName + ' has already been spied upon'); + } + + var spyObj = jasmine.createSpy(methodName); + + this.spies_.push(spyObj); + spyObj.baseObj = obj; + spyObj.methodName = methodName; + spyObj.originalValue = obj[methodName]; + + obj[methodName] = spyObj; + + return spyObj; +}; + +jasmine.Spec.prototype.removeAllSpies = function() { + for (var i = 0; i < this.spies_.length; i++) { + var spy = this.spies_[i]; + spy.baseObj[spy.methodName] = spy.originalValue; + } + this.spies_ = []; +}; + +/** + * Internal representation of a Jasmine suite. + * + * @constructor + * @param {jasmine.Env} env + * @param {String} description + * @param {Function} specDefinitions + * @param {jasmine.Suite} parentSuite + */ +jasmine.Suite = function(env, description, specDefinitions, parentSuite) { + var self = this; + self.id = env.nextSuiteId ? env.nextSuiteId() : null; + self.description = description; + self.queue = new jasmine.Queue(env); + self.parentSuite = parentSuite; + self.env = env; + self.before_ = []; + self.after_ = []; + self.children_ = []; + self.suites_ = []; + self.specs_ = []; +}; + +jasmine.Suite.prototype.getFullName = function() { + var fullName = this.description; + for (var parentSuite = this.parentSuite; parentSuite; parentSuite = parentSuite.parentSuite) { + fullName = parentSuite.description + ' ' + fullName; + } + return fullName; +}; + +jasmine.Suite.prototype.finish = function(onComplete) { + this.env.reporter.reportSuiteResults(this); + this.finished = true; + if (typeof(onComplete) == 'function') { + onComplete(); + } +}; + +jasmine.Suite.prototype.beforeEach = function(beforeEachFunction) { + beforeEachFunction.typeName = 'beforeEach'; + this.before_.unshift(beforeEachFunction); +}; + +jasmine.Suite.prototype.afterEach = function(afterEachFunction) { + afterEachFunction.typeName = 'afterEach'; + this.after_.unshift(afterEachFunction); +}; + +jasmine.Suite.prototype.results = function() { + return this.queue.results(); +}; + +jasmine.Suite.prototype.add = function(suiteOrSpec) { + this.children_.push(suiteOrSpec); + if (suiteOrSpec instanceof jasmine.Suite) { + this.suites_.push(suiteOrSpec); + this.env.currentRunner().addSuite(suiteOrSpec); + } else { + this.specs_.push(suiteOrSpec); + } + this.queue.add(suiteOrSpec); +}; + +jasmine.Suite.prototype.specs = function() { + return this.specs_; +}; + +jasmine.Suite.prototype.suites = function() { + return this.suites_; +}; + +jasmine.Suite.prototype.children = function() { + return this.children_; +}; + +jasmine.Suite.prototype.execute = function(onComplete) { + var self = this; + this.queue.start(function () { + self.finish(onComplete); + }); +}; +jasmine.WaitsBlock = function(env, timeout, spec) { + this.timeout = timeout; + jasmine.Block.call(this, env, null, spec); +}; + +jasmine.util.inherit(jasmine.WaitsBlock, jasmine.Block); + +jasmine.WaitsBlock.prototype.execute = function (onComplete) { + if (jasmine.VERBOSE) { + this.env.reporter.log('>> Jasmine waiting for ' + this.timeout + ' ms...'); + } + this.env.setTimeout(function () { + onComplete(); + }, this.timeout); +}; +/** + * A block which waits for some condition to become true, with timeout. + * + * @constructor + * @extends jasmine.Block + * @param {jasmine.Env} env The Jasmine environment. + * @param {Number} timeout The maximum time in milliseconds to wait for the condition to become true. + * @param {Function} latchFunction A function which returns true when the desired condition has been met. + * @param {String} message The message to display if the desired condition hasn't been met within the given time period. + * @param {jasmine.Spec} spec The Jasmine spec. + */ +jasmine.WaitsForBlock = function(env, timeout, latchFunction, message, spec) { + this.timeout = timeout || env.defaultTimeoutInterval; + this.latchFunction = latchFunction; + this.message = message; + this.totalTimeSpentWaitingForLatch = 0; + jasmine.Block.call(this, env, null, spec); +}; +jasmine.util.inherit(jasmine.WaitsForBlock, jasmine.Block); + +jasmine.WaitsForBlock.TIMEOUT_INCREMENT = 10; + +jasmine.WaitsForBlock.prototype.execute = function(onComplete) { + if (jasmine.VERBOSE) { + this.env.reporter.log('>> Jasmine waiting for ' + (this.message || 'something to happen')); + } + var latchFunctionResult; + try { + latchFunctionResult = this.latchFunction.apply(this.spec); + } catch (e) { + this.spec.fail(e); + onComplete(); + return; + } + + if (latchFunctionResult) { + onComplete(); + } else if (this.totalTimeSpentWaitingForLatch >= this.timeout) { + var message = 'timed out after ' + this.timeout + ' msec waiting for ' + (this.message || 'something to happen'); + this.spec.fail({ + name: 'timeout', + message: message + }); + + this.abort = true; + onComplete(); + } else { + this.totalTimeSpentWaitingForLatch += jasmine.WaitsForBlock.TIMEOUT_INCREMENT; + var self = this; + this.env.setTimeout(function() { + self.execute(onComplete); + }, jasmine.WaitsForBlock.TIMEOUT_INCREMENT); + } +}; +// Mock setTimeout, clearTimeout +// Contributed by Pivotal Computer Systems, www.pivotalsf.com + +jasmine.FakeTimer = function() { + this.reset(); + + var self = this; + self.setTimeout = function(funcToCall, millis) { + self.timeoutsMade++; + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false); + return self.timeoutsMade; + }; + + self.setInterval = function(funcToCall, millis) { + self.timeoutsMade++; + self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true); + return self.timeoutsMade; + }; + + self.clearTimeout = function(timeoutKey) { + self.scheduledFunctions[timeoutKey] = jasmine.undefined; + }; + + self.clearInterval = function(timeoutKey) { + self.scheduledFunctions[timeoutKey] = jasmine.undefined; + }; + +}; + +jasmine.FakeTimer.prototype.reset = function() { + this.timeoutsMade = 0; + this.scheduledFunctions = {}; + this.nowMillis = 0; +}; + +jasmine.FakeTimer.prototype.tick = function(millis) { + var oldMillis = this.nowMillis; + var newMillis = oldMillis + millis; + this.runFunctionsWithinRange(oldMillis, newMillis); + this.nowMillis = newMillis; +}; + +jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) { + var scheduledFunc; + var funcsToRun = []; + for (var timeoutKey in this.scheduledFunctions) { + scheduledFunc = this.scheduledFunctions[timeoutKey]; + if (scheduledFunc != jasmine.undefined && + scheduledFunc.runAtMillis >= oldMillis && + scheduledFunc.runAtMillis <= nowMillis) { + funcsToRun.push(scheduledFunc); + this.scheduledFunctions[timeoutKey] = jasmine.undefined; + } + } + + if (funcsToRun.length > 0) { + funcsToRun.sort(function(a, b) { + return a.runAtMillis - b.runAtMillis; + }); + for (var i = 0; i < funcsToRun.length; ++i) { + try { + var funcToRun = funcsToRun[i]; + this.nowMillis = funcToRun.runAtMillis; + funcToRun.funcToCall(); + if (funcToRun.recurring) { + this.scheduleFunction(funcToRun.timeoutKey, + funcToRun.funcToCall, + funcToRun.millis, + true); + } + } catch(e) { + } + } + this.runFunctionsWithinRange(oldMillis, nowMillis); + } +}; + +jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) { + this.scheduledFunctions[timeoutKey] = { + runAtMillis: this.nowMillis + millis, + funcToCall: funcToCall, + recurring: recurring, + timeoutKey: timeoutKey, + millis: millis + }; +}; + +/** + * @namespace + */ +jasmine.Clock = { + defaultFakeTimer: new jasmine.FakeTimer(), + + reset: function() { + jasmine.Clock.assertInstalled(); + jasmine.Clock.defaultFakeTimer.reset(); + }, + + tick: function(millis) { + jasmine.Clock.assertInstalled(); + jasmine.Clock.defaultFakeTimer.tick(millis); + }, + + runFunctionsWithinRange: function(oldMillis, nowMillis) { + jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis); + }, + + scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) { + jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring); + }, + + useMock: function() { + if (!jasmine.Clock.isInstalled()) { + var spec = jasmine.getEnv().currentSpec; + spec.after(jasmine.Clock.uninstallMock); + + jasmine.Clock.installMock(); + } + }, + + installMock: function() { + jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer; + }, + + uninstallMock: function() { + jasmine.Clock.assertInstalled(); + jasmine.Clock.installed = jasmine.Clock.real; + }, + + real: { + setTimeout: jasmine.getGlobal().setTimeout, + clearTimeout: jasmine.getGlobal().clearTimeout, + setInterval: jasmine.getGlobal().setInterval, + clearInterval: jasmine.getGlobal().clearInterval + }, + + assertInstalled: function() { + if (!jasmine.Clock.isInstalled()) { + throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()"); + } + }, + + isInstalled: function() { + return jasmine.Clock.installed == jasmine.Clock.defaultFakeTimer; + }, + + installed: null +}; +jasmine.Clock.installed = jasmine.Clock.real; + +//else for IE support +jasmine.getGlobal().setTimeout = function(funcToCall, millis) { + if (jasmine.Clock.installed.setTimeout.apply) { + return jasmine.Clock.installed.setTimeout.apply(this, arguments); + } else { + return jasmine.Clock.installed.setTimeout(funcToCall, millis); + } +}; + +jasmine.getGlobal().setInterval = function(funcToCall, millis) { + if (jasmine.Clock.installed.setInterval.apply) { + return jasmine.Clock.installed.setInterval.apply(this, arguments); + } else { + return jasmine.Clock.installed.setInterval(funcToCall, millis); + } +}; + +jasmine.getGlobal().clearTimeout = function(timeoutKey) { + if (jasmine.Clock.installed.clearTimeout.apply) { + return jasmine.Clock.installed.clearTimeout.apply(this, arguments); + } else { + return jasmine.Clock.installed.clearTimeout(timeoutKey); + } +}; + +jasmine.getGlobal().clearInterval = function(timeoutKey) { + if (jasmine.Clock.installed.clearTimeout.apply) { + return jasmine.Clock.installed.clearInterval.apply(this, arguments); + } else { + return jasmine.Clock.installed.clearInterval(timeoutKey); + } +}; + + +jasmine.version_= { + "major": 2, + "minor": 0, + "build": 0, + "revision": 1315499111, + "release_candidate": 1 +}; + diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/reporter.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/reporter.js new file mode 100755 index 0000000..fc23840 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/reporter.js @@ -0,0 +1,275 @@ +(function() { + // + // Imports + // + var util; + try { + util = require('util') + } catch(e) { + util = require('sys') + } + + if (! jasmineNode) { + var jasmineNode = {}; + } + + // + // Helpers + // + function noop() {} + + jasmineNode.ANSIColors = { + pass: function() { return '\033[32m'; }, // Green + fail: function() { return '\033[31m'; }, // Red + neutral: function() { return '\033[0m'; } // Normal + }; + + jasmineNode.NoColors = { + pass: function() { return ''; }, + fail: function() { return ''; }, + neutral: function() { return ''; } + }; + + jasmineNode.TerminalReporter = function(config) { + this.print_ = config.print || util.print; + this.color_ = config.color ? jasmineNode.ANSIColors : jasmineNode.NoColors; + + this.started_ = false; + this.finished_ = false; + + this.callback_ = config.onComplete || false + + this.suites_ = []; + this.specResults_ = {}; + this.failures_ = []; + } + + jasmineNode.TerminalReporter.prototype = { + reportRunnerStarting: function(runner) { + this.started_ = true; + this.startedAt = new Date(); + var suites = runner.topLevelSuites(); + for (var i = 0; i < suites.length; i++) { + var suite = suites[i]; + this.suites_.push(this.summarize_(suite)); + } + }, + + summarize_: function(suiteOrSpec) { + var isSuite = suiteOrSpec instanceof jasmine.Suite; + + // We could use a separate object for suite and spec + var summary = { + id: suiteOrSpec.id, + name: suiteOrSpec.description, + type: isSuite? 'suite' : 'spec', + suiteNestingLevel: 0, + children: [] + }; + + if (isSuite) { + var calculateNestingLevel = function(examinedSuite) { + var nestingLevel = 0; + while (examinedSuite.parentSuite !== null) { + nestingLevel += 1; + examinedSuite = examinedSuite.parentSuite; + } + return nestingLevel; + }; + + summary.suiteNestingLevel = calculateNestingLevel(suiteOrSpec); + + var children = suiteOrSpec.children(); + for (var i = 0; i < children.length; i++) { + summary.children.push(this.summarize_(children[i])); + } + } + + return summary; + }, + + // This is heavily influenced by Jasmine's Html/Trivial Reporter + reportRunnerResults: function(runner) { + this.reportFailures_(); + + var results = runner.results(); + var resultColor = (results.failedCount > 0) ? this.color_.fail() : this.color_.pass(); + + var specs = runner.specs(); + var specCount = specs.length; + + var message = "\n\nFinished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + " seconds"; + this.printLine_(message); + + // This is what jasmine-html.js has + //message = "" + specCount + " spec" + ( specCount === 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount === 1) ? "" : "s"); + + this.printLine_(this.stringWithColor_(this.printRunnerResults_(runner), resultColor)); + + this.finished_ = true; + if(this.callback_) { this.callback_(runner); } + }, + + reportFailures_: function() { + if (this.failures_.length === 0) { + return; + } + + var indent = ' ', failure; + this.printLine_('\n'); + + this.print_('Failures:'); + + for (var i = 0; i < this.failures_.length; i++) { + failure = this.failures_[i]; + this.printLine_('\n'); + this.printLine_(' ' + (i + 1) + ') ' + failure.spec); + this.printLine_(' Message:'); + this.printLine_(' ' + this.stringWithColor_(failure.message, this.color_.fail())); + this.printLine_(' Stacktrace:'); + this.print_(' ' + failure.stackTrace); + } + }, + + reportSuiteResults: function(suite) { + // Not used in this context + }, + + reportSpecResults: function(spec) { + var result = spec.results(); + var msg = ''; + if (result.passed()) { + msg = this.stringWithColor_('.', this.color_.pass()); + // } else if (result.skipped) { TODO: Research why "result.skipped" returns false when "xit" is called on a spec? + // msg = (colors) ? (ansi.yellow + '*' + ansi.none) : '*'; + } else { + msg = this.stringWithColor_('F', this.color_.fail()); + this.addFailureToFailures_(spec); + } + this.spec_results += msg; + this.print_(msg); + }, + + addFailureToFailures_: function(spec) { + var result = spec.results(); + var failureItem = null; + + var items_length = result.items_.length; + for (var i = 0; i < items_length; i++) { + if (result.items_[i].passed_ === false) { + failureItem = result.items_[i]; + var failure = { + spec: spec.description, + message: failureItem.message, + stackTrace: failureItem.trace.stack + } + + this.failures_.push(failure); + } + } + }, + + printRunnerResults_: function(runner){ + var results = runner.results(); + var specs = runner.specs(); + var msg = ''; + msg += specs.length + ' test' + ((specs.length === 1) ? '' : 's') + ', '; + msg += results.totalCount + ' assertion' + ((results.totalCount === 1) ? '' : 's') + ', '; + msg += results.failedCount + ' failure' + ((results.failedCount === 1) ? '' : 's') + '\n'; + return msg; + }, + + // Helper Methods // + stringWithColor_: function(stringValue, color) { + return (color || this.color_.neutral()) + stringValue + this.color_.neutral(); + }, + + printLine_: function(stringValue) { + this.print_(stringValue); + this.print_('\n'); + } + }; + + // *************************************************************** + // TerminalVerboseReporter uses the TerminalReporter's constructor + // *************************************************************** + jasmineNode.TerminalVerboseReporter = function(config) { + jasmineNode.TerminalReporter.call(this, config); + // The extra field in this object + this.indent_ = 0; + } + + + jasmineNode.TerminalVerboseReporter.prototype = { + reportSpecResults: function(spec) { + if (spec.results().failedCount > 0) { + this.addFailureToFailures_(spec); + } + + this.specResults_[spec.id] = { + messages: spec.results().getItems(), + result: spec.results().failedCount > 0 ? 'failed' : 'passed' + }; + }, + + reportRunnerResults: function(runner) { + var messages = new Array(); + this.buildMessagesFromResults_(messages, this.suites_); + + var messages_length = messages.length; + for (var i = 0; i < messages_length-1; i++) { + this.printLine_(messages[i]); + } + + this.print_(messages[messages_length-1]); + + // Call the parent object's method + jasmineNode.TerminalReporter.prototype.reportRunnerResults.call(this, runner); + }, + + buildMessagesFromResults_: function(messages, results) { + var element, specResult, specIndentSpaces, msg = ''; + + var results_length = results.length; + for (var i = 0; i < results_length; i++) { + element = results[i]; + + if (element.type === 'spec') { + specResult = this.specResults_[element.id.toString()]; + + specIndentSpaces = this.indent_ + 2; + if (specResult.result === 'passed') { + msg = this.stringWithColor_(this.indentMessage_(element.name, specIndentSpaces), this.color_.pass()); + } else { + msg = this.stringWithColor_(this.indentMessage_(element.name, specIndentSpaces), this.color_.fail()); + } + + messages.push(msg); + } else { + this.indent_ = element.suiteNestingLevel * 2; + + messages.push(''); + messages.push(this.indentMessage_(element.name, this.indent_)); + } + + this.buildMessagesFromResults_(messages, element.children); + } + }, + + indentMessage_: function(message, indentCount) { + var _indent = ''; + for (var i = 0; i < indentCount; i++) { + _indent += ' '; + } + return (_indent + message); + } + }; + + // Inherit from TerminalReporter + jasmineNode.TerminalVerboseReporter.prototype.__proto__ = jasmineNode.TerminalReporter.prototype; + + // + // Exports + // + exports.jasmineNode = jasmineNode; +})(); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js new file mode 100644 index 0000000..e3e7f76 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-runner.js @@ -0,0 +1,70 @@ +exports.executeJsRunner = function(specCollection, done, jasmineEnv) { + var specs, + specLoader = require('./requirejs-spec-loader'), + requirejs = require('requirejs'), + vm = require('vm'), + fs = require('fs'), + template = fs.readFileSync(__dirname + '/requirejs-wrapper-template.js', 'utf8'), + buildNewContext = function(){ + return { + describe: describe, + it: it, + xdescribe: xdescribe, + xit: xit, + jasmine: jasmine, + expect: expect, + require: require, + console: console, + process: process, + module: module, + specLoader: specLoader + }; + }, + buildRelativeDirName = function(dir){ + var retVal = "", + thisDir = process.cwd();//.replace(/.:/, '\\c').split('\\'), + toDir = dir.split('/'), + index = 0, + colonMatches = __dirname.match(/.:/); + + for(var i = 0; i < (colonMatches && colonMatches.length) || 0; i++){ + thisDir = thisDir.replace(colonMatches[i], '\\' + colonMatches[i].substring(0,1)); + } + + thisDir = thisDir.split('\\'); + + for(; index < thisDir.length || index < toDir.length; index++) { + if(thisDir[index] != toDir[index]){ + for(var i = index; i < thisDir.length; i++){ + retVal += '../'; + } + + for(var i = index; i < toDir.length; i++){ + retVal += toDir[i] + '/'; + } + + break; + } + } + + return retVal.trim('/'); + }; + + specCollection.getSpecs().forEach(function(s){ + var script = fs.readFileSync(s.path(), 'utf8'), + dir = s.directory(), + colonMatches = dir.match(/.:/), + wrappedScript; + + for(var i = 0; i < (colonMatches && colonMatches.length) || 0; i++){ + dir = dir.replace(colonMatches[i], '/' + colonMatches[i].substring(0,1)); + } + + wrappedScript = template.replace(/#REPLACE URL#/, buildRelativeDirName(dir)) + .replace(/#REPLACE TEST SCRIPT#/, script); + + vm.runInNewContext(wrappedScript, buildNewContext(), s.path()); + }); + + specLoader.executeWhenAllSpecsAreComplete(jasmineEnv); +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js new file mode 100644 index 0000000..284db7d --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-spec-loader.js @@ -0,0 +1,48 @@ +var _ = require('underscore'), + registry = {}, + timeout = 120000, + now = function() { + return new Date().getTime(); + }, + loader = { + register: function(name) { + registry[name] = false; + }, + completed: function(name){ + registry[name] = true; + } + }, + specLoader = { + defineLoader: function(requirejs) { + requirejs.define('jasmine-spec-loader', function() { + return loader; + }); + }, + executeWhenAllSpecsAreComplete: function(jasmineEnv) { + var allComplete = false, + wait = now(), + timeoutCallback = function() { + allComplete = _.all(registry, function(value) { + return value; + }); + + if(!allComplete && wait + timeout > now()) { + setTimeout(timeoutCallback, 100); + } else if (!allComplete) { + console.log('Failed to load all specs within timeout window.'); + process.exit(-1); + } else { + jasmineEnv.execute(); + } + }; + + setTimeout(timeoutCallback, 100); + }, + setTimeoutInterval: function(value) { + timeout = value; + }, + }; + +for(var key in specLoader) { + exports[key] = specLoader[key]; +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js new file mode 100644 index 0000000..047e7cb --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/requirejs-wrapper-template.js @@ -0,0 +1,65 @@ +var test = function(require, define, undefined) { #REPLACE TEST SCRIPT# +}; + +var requirejsOrig = require('requirejs'), + ostring = Object.prototype.toString, + path = require('path'), + baseUrl = '#REPLACE URL#', + isArray = function(it){ + return ostring.call(it) === '[object Array]'; + }, + isFunction = function(it){ + return ostring.call(it) === '[object Function]'; + }, + requirejs = function(deps, callback){ + var retVal; + + if(!isArray(deps) && typeof deps !== 'string'){ + if(isArray(callback)){ + retVal = requirejsOrig(deps, callback, arguments[2]); + } else { + retVal = requirejsOrig(deps, [], callback); + } + } else { + retVal = requirejsOrig(deps, callback); + } + + return retVal; + }; + +requirejsOrig.config({ + baseUrl: baseUrl, + nodeRequire: require +}); + +for(var key in requirejsOrig) { + requirejs[key] = requirejsOrig[key]; +} + +requirejs.config = function(config){ + var alteredConfig = {}; + + for(var key in config) { + alteredConfig[key] = config[key]; + } + + if(alteredConfig.baseUrl){ + var base = baseUrl.replace(/\\/g, '/'), + splitUrl = alteredConfig.baseUrl.replace(/\\/g, '/').split('/'), + index = 0; + + for(; index < splitUrl.length; index++){ + if(splitUrl[index] === '..'){ + base = path.dirname(base); + } else { + base += '/' + splitUrl[index]; + } + } + + alteredConfig.baseUrl = base; + } + + return requirejsOrig.config(alteredConfig); +}; + +test(requirejs, requirejs.define); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js new file mode 100644 index 0000000..b770123 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/lib/jasmine-node/spec-collection.js @@ -0,0 +1,36 @@ +var findit = require('findit'); +var path = require('path'); +var fs = require('fs'); +var specs = []; + +var createSpecObj = function(path, root) { + return { + path: function() { return path; }, + relativePath: function() { return path.replace(root, '').replace(/^[\/\\]/, ''); }, + directory: function() { return path.replace(/[\/\\][\s\w\.-]*$/, ""); }, + relativeDirectory: function() { return relativePath().replace(/[\/\\][\s\w\.-]*$/, ""); }, + filename: function() { return path.replace(/^.*[\\\/]/, ''); } + }; +}; + +exports.load = function(loadpath, matcher) { + + var wannaBeSpecs = findit.sync(loadpath) + + for (var i = 0; i < wannaBeSpecs.length; i++) { + var file = wannaBeSpecs[i]; + try { + if (fs.statSync(file).isFile()) { + if (!/.*node_modules.*/.test(file) && matcher.test(path.basename(file))) { + specs.push(createSpecObj(file)); + } + } + } catch(e) { + // nothing to do here + } + } +}; + +exports.getSpecs = function() { + return specs; +}; diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/cake b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/cake new file mode 100755 index 0000000..5965f4e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/cake @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); + +require(lib + '/coffee-script/cake').run(); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/coffee b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/coffee new file mode 100755 index 0000000..3d1d71c --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/coffee @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); + +require(lib + '/coffee-script/command').run(); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/r.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/r.js new file mode 100755 index 0000000..6c5aab9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/.bin/r.js @@ -0,0 +1,9823 @@ +#!/usr/bin/env node +/** + * @license r.js 1.0.7 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/* + * This is a bootstrap script to allow running RequireJS in the command line + * in either a Java/Rhino or Node environment. It is modified by the top-level + * dist.js file to inject other files to completely enable this file. It is + * the shell of the r.js file. + */ + +/*jslint strict: false, evil: true, nomen: false */ +/*global readFile: true, process: false, Packages: false, print: false, +console: false, java: false, module: false */ + +var requirejs, require, define; +(function (console, args, readFileFunc) { + + var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire, + nodeDefine, exists, reqMain, loadedOptimizedLib, + version = '1.0.7', + jsSuffixRegExp = /\.js$/, + commandOption = '', + useLibLoaded = {}, + //Used by jslib/rhino/args.js + rhinoArgs = args, + readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null; + + function showHelp() { + console.log('See https://github.com/jrburke/r.js for usage.'); + } + + if (typeof Packages !== 'undefined') { + env = 'rhino'; + + fileName = args[0]; + + if (fileName && fileName.indexOf('-') === 0) { + commandOption = fileName.substring(1); + fileName = args[1]; + } + + //Set up execution context. + rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext(); + + exec = function (string, name) { + return rhinoContext.evaluateString(this, string, name, 0, null); + }; + + exists = function (fileName) { + return (new java.io.File(fileName)).exists(); + }; + + //Define a console.log for easier logging. Don't + //get fancy though. + if (typeof console === 'undefined') { + console = { + log: function () { + print.apply(undefined, arguments); + } + }; + } + } else if (typeof process !== 'undefined') { + env = 'node'; + + //Get the fs module via Node's require before it + //gets replaced. Used in require/node.js + fs = require('fs'); + vm = require('vm'); + path = require('path'); + nodeRequire = require; + nodeDefine = define; + reqMain = require.main; + + //Temporarily hide require and define to allow require.js to define + //them. + require = undefined; + define = undefined; + + readFile = function (path) { + return fs.readFileSync(path, 'utf8'); + }; + + exec = function (string, name) { + return vm.runInThisContext(this.requirejsVars.require.makeNodeWrapper(string), + name ? fs.realpathSync(name) : ''); + }; + + exists = function (fileName) { + return path.existsSync(fileName); + }; + + + fileName = process.argv[2]; + + if (fileName && fileName.indexOf('-') === 0) { + commandOption = fileName.substring(1); + fileName = process.argv[3]; + } + } + + /** vim: et:ts=4:sw=4:sts=4 + * @license RequireJS 1.0.7 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/*jslint strict: false, plusplus: false, sub: true */ +/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */ + + +(function () { + //Change this version number for each release. + var version = "1.0.7", + commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, + cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g, + currDirRegExp = /^\.\//, + jsSuffixRegExp = /\.js$/, + ostring = Object.prototype.toString, + ap = Array.prototype, + aps = ap.slice, + apsp = ap.splice, + isBrowser = !!(typeof window !== "undefined" && navigator && document), + isWebWorker = !isBrowser && typeof importScripts !== "undefined", + //PS3 indicates loaded and complete, but need to wait for complete + //specifically. Sequence is "loading", "loaded", execution, + // then "complete". The UA check is unfortunate, but not sure how + //to feature test w/o causing perf issues. + readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? + /^complete$/ : /^(complete|loaded)$/, + defContextName = "_", + //Oh the tragedy, detecting opera. See the usage of isOpera for reason. + isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]", + empty = {}, + contexts = {}, + globalDefQueue = [], + interactiveScript = null, + checkLoadedDepth = 0, + useInteractive = false, + reservedDependencies = { + require: true, + module: true, + exports: true + }, + req, cfg = {}, currentlyAddingScript, s, head, baseElement, scripts, script, + src, subPath, mainScript, dataMain, globalI, ctx, jQueryCheck, checkLoadedTimeoutId; + + function isFunction(it) { + return ostring.call(it) === "[object Function]"; + } + + function isArray(it) { + return ostring.call(it) === "[object Array]"; + } + + /** + * Simple function to mix in properties from source into target, + * but only if target does not already have a property of the same name. + * This is not robust in IE for transferring methods that match + * Object.prototype names, but the uses of mixin here seem unlikely to + * trigger a problem related to that. + */ + function mixin(target, source, force) { + for (var prop in source) { + if (!(prop in empty) && (!(prop in target) || force)) { + target[prop] = source[prop]; + } + } + return req; + } + + /** + * Constructs an error with a pointer to an URL with more information. + * @param {String} id the error ID that maps to an ID on a web page. + * @param {String} message human readable error. + * @param {Error} [err] the original error, if there is one. + * + * @returns {Error} + */ + function makeError(id, msg, err) { + var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); + if (err) { + e.originalError = err; + } + return e; + } + + /** + * Used to set up package paths from a packagePaths or packages config object. + * @param {Object} pkgs the object to store the new package config + * @param {Array} currentPackages an array of packages to configure + * @param {String} [dir] a prefix dir to use. + */ + function configurePackageDir(pkgs, currentPackages, dir) { + var i, location, pkgObj; + + for (i = 0; (pkgObj = currentPackages[i]); i++) { + pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj; + location = pkgObj.location; + + //Add dir to the path, but avoid paths that start with a slash + //or have a colon (indicates a protocol) + if (dir && (!location || (location.indexOf("/") !== 0 && location.indexOf(":") === -1))) { + location = dir + "/" + (location || pkgObj.name); + } + + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || "main") + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; + } + } + + /** + * jQuery 1.4.3-1.5.x use a readyWait/ready() pairing to hold DOM + * ready callbacks, but jQuery 1.6 supports a holdReady() API instead. + * At some point remove the readyWait/ready() support and just stick + * with using holdReady. + */ + function jQueryHoldReady($, shouldHold) { + if ($.holdReady) { + $.holdReady(shouldHold); + } else if (shouldHold) { + $.readyWait += 1; + } else { + $.ready(true); + } + } + + if (typeof define !== "undefined") { + //If a define is already in play via another AMD loader, + //do not overwrite. + return; + } + + if (typeof requirejs !== "undefined") { + if (isFunction(requirejs)) { + //Do not overwrite and existing requirejs instance. + return; + } else { + cfg = requirejs; + requirejs = undefined; + } + } + + //Allow for a require config object + if (typeof require !== "undefined" && !isFunction(require)) { + //assume it is a config object. + cfg = require; + require = undefined; + } + + /** + * Creates a new context for use in require and define calls. + * Handle most of the heavy lifting. Do not want to use an object + * with prototype here to avoid using "this" in require, in case it + * needs to be used in more super secure envs that do not want this. + * Also there should not be that many contexts in the page. Usually just + * one for the default context, but could be extra for multiversion cases + * or if a package needs a special context for a dependency that conflicts + * with the standard context. + */ + function newContext(contextName) { + var context, resume, + config = { + waitSeconds: 7, + baseUrl: "./", + paths: {}, + pkgs: {}, + catchError: {} + }, + defQueue = [], + specified = { + "require": true, + "exports": true, + "module": true + }, + urlMap = {}, + defined = {}, + loaded = {}, + waiting = {}, + waitAry = [], + urlFetched = {}, + managerCounter = 0, + managerCallbacks = {}, + plugins = {}, + //Used to indicate which modules in a build scenario + //need to be full executed. + needFullExec = {}, + fullExec = {}, + resumeDepth = 0; + + /** + * Trims the . and .. from an array of path segments. + * It will keep a leading path segment if a .. will become + * the first path segment, to help with module name lookups, + * which act like paths, but can be remapped. But the end result, + * all paths that use this function should look normalized. + * NOTE: this method MODIFIES the input array. + * @param {Array} ary the array of path segments. + */ + function trimDots(ary) { + var i, part; + for (i = 0; (part = ary[i]); i++) { + if (part === ".") { + ary.splice(i, 1); + i -= 1; + } else if (part === "..") { + if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { + //End of the line. Keep at least one non-dot + //path segment at the front so it can be mapped + //correctly to disk. Otherwise, there is likely + //no path mapping for a path starting with '..'. + //This can still fail, but catches the most reasonable + //uses of .. + break; + } else if (i > 0) { + ary.splice(i - 1, 2); + i -= 2; + } + } + } + } + + /** + * Given a relative module name, like ./something, normalize it to + * a real name that can be mapped to a path. + * @param {String} name the relative name + * @param {String} baseName a real name that the name arg is relative + * to. + * @returns {String} normalized name + */ + function normalize(name, baseName) { + var pkgName, pkgConfig; + + //Adjust any relative paths. + if (name && name.charAt(0) === ".") { + //If have a base name, try to normalize against it, + //otherwise, assume it is a top-level require that will + //be relative to baseUrl in the end. + if (baseName) { + if (config.pkgs[baseName]) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + baseName = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that "directory" and not name of the baseName's + //module. For instance, baseName of "one/two/three", maps to + //"one/two/three.js", but we want the directory, "one/two" for + //this normalization. + baseName = baseName.split("/"); + baseName = baseName.slice(0, baseName.length - 1); + } + + name = baseName.concat(name.split("/")); + trimDots(name); + + //Some use of packages may use a . path to reference the + //"main" module name, so normalize for that. + pkgConfig = config.pkgs[(pkgName = name[0])]; + name = name.join("/"); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } + } else if (name.indexOf("./") === 0) { + // No baseName, so this is ID is resolved relative + // to baseUrl, pull off the leading dot. + name = name.substring(2); + } + } + return name; + } + + /** + * Creates a module mapping that includes plugin prefix, module + * name, and path. If parentModuleMap is provided it will + * also normalize the name via require.normalize() + * + * @param {String} name the module name + * @param {String} [parentModuleMap] parent module map + * for the module name, used to resolve relative names. + * + * @returns {Object} + */ + function makeModuleMap(name, parentModuleMap) { + var index = name ? name.indexOf("!") : -1, + prefix = null, + parentName = parentModuleMap ? parentModuleMap.name : null, + originalName = name, + normalizedName, url, pluginModule; + + if (index !== -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } + + if (prefix) { + prefix = normalize(prefix, parentName); + } + + //Account for relative paths if there is a base name. + if (name) { + if (prefix) { + pluginModule = defined[prefix]; + if (pluginModule && pluginModule.normalize) { + //Plugin is loaded, use its normalize method. + normalizedName = pluginModule.normalize(name, function (name) { + return normalize(name, parentName); + }); + } else { + normalizedName = normalize(name, parentName); + } + } else { + //A regular module. + normalizedName = normalize(name, parentName); + + url = urlMap[normalizedName]; + if (!url) { + //Calculate url for the module, if it has a name. + //Use name here since nameToUrl also calls normalize, + //and for relative names that are outside the baseUrl + //this causes havoc. Was thinking of just removing + //parentModuleMap to avoid extra normalization, but + //normalize() still does a dot removal because of + //issue #142, so just pass in name here and redo + //the normalization. Paths outside baseUrl are just + //messy to support. + url = context.nameToUrl(name, null, parentModuleMap); + + //Store the URL mapping for later. + urlMap[normalizedName] = url; + } + } + } + + return { + prefix: prefix, + name: normalizedName, + parentMap: parentModuleMap, + url: url, + originalName: originalName, + fullName: prefix ? prefix + "!" + (normalizedName || '') : normalizedName + }; + } + + /** + * Determine if priority loading is done. If so clear the priorityWait + */ + function isPriorityDone() { + var priorityDone = true, + priorityWait = config.priorityWait, + priorityName, i; + if (priorityWait) { + for (i = 0; (priorityName = priorityWait[i]); i++) { + if (!loaded[priorityName]) { + priorityDone = false; + break; + } + } + if (priorityDone) { + delete config.priorityWait; + } + } + return priorityDone; + } + + function makeContextModuleFunc(func, relModuleMap, enableBuildCallback) { + return function () { + //A version of a require function that passes a moduleName + //value for items that may need to + //look up paths relative to the moduleName + var args = aps.call(arguments, 0), lastArg; + if (enableBuildCallback && + isFunction((lastArg = args[args.length - 1]))) { + lastArg.__requireJsBuild = true; + } + args.push(relModuleMap); + return func.apply(null, args); + }; + } + + /** + * Helper function that creates a require function object to give to + * modules that ask for it as a dependency. It needs to be specific + * per module because of the implication of path mappings that may + * need to be relative to the module name. + */ + function makeRequire(relModuleMap, enableBuildCallback, altRequire) { + var modRequire = makeContextModuleFunc(altRequire || context.require, relModuleMap, enableBuildCallback); + + mixin(modRequire, { + nameToUrl: makeContextModuleFunc(context.nameToUrl, relModuleMap), + toUrl: makeContextModuleFunc(context.toUrl, relModuleMap), + defined: makeContextModuleFunc(context.requireDefined, relModuleMap), + specified: makeContextModuleFunc(context.requireSpecified, relModuleMap), + isBrowser: req.isBrowser + }); + return modRequire; + } + + /* + * Queues a dependency for checking after the loader is out of a + * "paused" state, for example while a script file is being loaded + * in the browser, where it may have many modules defined in it. + */ + function queueDependency(manager) { + context.paused.push(manager); + } + + function execManager(manager) { + var i, ret, err, errFile, errModuleTree, + cb = manager.callback, + map = manager.map, + fullName = map.fullName, + args = manager.deps, + listeners = manager.listeners, + cjsModule; + + //Call the callback to define the module, if necessary. + if (cb && isFunction(cb)) { + if (config.catchError.define) { + try { + ret = req.execCb(fullName, manager.callback, args, defined[fullName]); + } catch (e) { + err = e; + } + } else { + ret = req.execCb(fullName, manager.callback, args, defined[fullName]); + } + + if (fullName) { + //If setting exports via "module" is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. + cjsModule = manager.cjsModule; + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== defined[fullName]) { + ret = defined[fullName] = manager.cjsModule.exports; + } else if (ret === undefined && manager.usingExports) { + //exports already set the defined value. + ret = defined[fullName]; + } else { + //Use the return value from the function. + defined[fullName] = ret; + //If this module needed full execution in a build + //environment, mark that now. + if (needFullExec[fullName]) { + fullExec[fullName] = true; + } + } + } + } else if (fullName) { + //May just be an object definition for the module. Only + //worry about defining if have a module name. + ret = defined[fullName] = cb; + + //If this module needed full execution in a build + //environment, mark that now. + if (needFullExec[fullName]) { + fullExec[fullName] = true; + } + } + + //Clean up waiting. Do this before error calls, and before + //calling back listeners, so that bookkeeping is correct + //in the event of an error and error is reported in correct order, + //since the listeners will likely have errors if the + //onError function does not throw. + if (waiting[manager.id]) { + delete waiting[manager.id]; + manager.isDone = true; + context.waitCount -= 1; + if (context.waitCount === 0) { + //Clear the wait array used for cycles. + waitAry = []; + } + } + + //Do not need to track manager callback now that it is defined. + delete managerCallbacks[fullName]; + + //Allow instrumentation like the optimizer to know the order + //of modules executed and their dependencies. + if (req.onResourceLoad && !manager.placeholder) { + req.onResourceLoad(context, map, manager.depArray); + } + + if (err) { + errFile = (fullName ? makeModuleMap(fullName).url : '') || + err.fileName || err.sourceURL; + errModuleTree = err.moduleTree; + err = makeError('defineerror', 'Error evaluating ' + + 'module "' + fullName + '" at location "' + + errFile + '":\n' + + err + '\nfileName:' + errFile + + '\nlineNumber: ' + (err.lineNumber || err.line), err); + err.moduleName = fullName; + err.moduleTree = errModuleTree; + return req.onError(err); + } + + //Let listeners know of this manager's value. + for (i = 0; (cb = listeners[i]); i++) { + cb(ret); + } + + return undefined; + } + + /** + * Helper that creates a callack function that is called when a dependency + * is ready, and sets the i-th dependency for the manager as the + * value passed to the callback generated by this function. + */ + function makeArgCallback(manager, i) { + return function (value) { + //Only do the work if it has not been done + //already for a dependency. Cycle breaking + //logic in forceExec could mean this function + //is called more than once for a given dependency. + if (!manager.depDone[i]) { + manager.depDone[i] = true; + manager.deps[i] = value; + manager.depCount -= 1; + if (!manager.depCount) { + //All done, execute! + execManager(manager); + } + } + }; + } + + function callPlugin(pluginName, depManager) { + var map = depManager.map, + fullName = map.fullName, + name = map.name, + plugin = plugins[pluginName] || + (plugins[pluginName] = defined[pluginName]), + load; + + //No need to continue if the manager is already + //in the process of loading. + if (depManager.loading) { + return; + } + depManager.loading = true; + + load = function (ret) { + depManager.callback = function () { + return ret; + }; + execManager(depManager); + + loaded[depManager.id] = true; + + //The loading of this plugin + //might have placed other things + //in the paused queue. In particular, + //a loader plugin that depends on + //a different plugin loaded resource. + resume(); + }; + + //Allow plugins to load other code without having to know the + //context or how to "complete" the load. + load.fromText = function (moduleName, text) { + /*jslint evil: true */ + var hasInteractive = useInteractive; + + //Indicate a the module is in process of loading. + loaded[moduleName] = false; + context.scriptCount += 1; + + //Indicate this is not a "real" module, so do not track it + //for builds, it does not map to a real file. + context.fake[moduleName] = true; + + //Turn off interactive script matching for IE for any define + //calls in the text, then turn it back on at the end. + if (hasInteractive) { + useInteractive = false; + } + + req.exec(text); + + if (hasInteractive) { + useInteractive = true; + } + + //Support anonymous modules. + context.completeLoad(moduleName); + }; + + //No need to continue if the plugin value has already been + //defined by a build. + if (fullName in defined) { + load(defined[fullName]); + } else { + //Use parentName here since the plugin's name is not reliable, + //could be some weird string with no path that actually wants to + //reference the parentName's path. + plugin.load(name, makeRequire(map.parentMap, true, function (deps, cb) { + var moduleDeps = [], + i, dep, depMap; + //Convert deps to full names and hold on to them + //for reference later, when figuring out if they + //are blocked by a circular dependency. + for (i = 0; (dep = deps[i]); i++) { + depMap = makeModuleMap(dep, map.parentMap); + deps[i] = depMap.fullName; + if (!depMap.prefix) { + moduleDeps.push(deps[i]); + } + } + depManager.moduleDeps = (depManager.moduleDeps || []).concat(moduleDeps); + return context.require(deps, cb); + }), load, config); + } + } + + /** + * Adds the manager to the waiting queue. Only fully + * resolved items should be in the waiting queue. + */ + function addWait(manager) { + if (!waiting[manager.id]) { + waiting[manager.id] = manager; + waitAry.push(manager); + context.waitCount += 1; + } + } + + /** + * Function added to every manager object. Created out here + * to avoid new function creation for each manager instance. + */ + function managerAdd(cb) { + this.listeners.push(cb); + } + + function getManager(map, shouldQueue) { + var fullName = map.fullName, + prefix = map.prefix, + plugin = prefix ? plugins[prefix] || + (plugins[prefix] = defined[prefix]) : null, + manager, created, pluginManager, prefixMap; + + if (fullName) { + manager = managerCallbacks[fullName]; + } + + if (!manager) { + created = true; + manager = { + //ID is just the full name, but if it is a plugin resource + //for a plugin that has not been loaded, + //then add an ID counter to it. + id: (prefix && !plugin ? + (managerCounter++) + '__p@:' : '') + + (fullName || '__r@' + (managerCounter++)), + map: map, + depCount: 0, + depDone: [], + depCallbacks: [], + deps: [], + listeners: [], + add: managerAdd + }; + + specified[manager.id] = true; + + //Only track the manager/reuse it if this is a non-plugin + //resource. Also only track plugin resources once + //the plugin has been loaded, and so the fullName is the + //true normalized value. + if (fullName && (!prefix || plugins[prefix])) { + managerCallbacks[fullName] = manager; + } + } + + //If there is a plugin needed, but it is not loaded, + //first load the plugin, then continue on. + if (prefix && !plugin) { + prefixMap = makeModuleMap(prefix); + + //Clear out defined and urlFetched if the plugin was previously + //loaded/defined, but not as full module (as in a build + //situation). However, only do this work if the plugin is in + //defined but does not have a module export value. + if (prefix in defined && !defined[prefix]) { + delete defined[prefix]; + delete urlFetched[prefixMap.url]; + } + + pluginManager = getManager(prefixMap, true); + pluginManager.add(function (plugin) { + //Create a new manager for the normalized + //resource ID and have it call this manager when + //done. + var newMap = makeModuleMap(map.originalName, map.parentMap), + normalizedManager = getManager(newMap, true); + + //Indicate this manager is a placeholder for the real, + //normalized thing. Important for when trying to map + //modules and dependencies, for instance, in a build. + manager.placeholder = true; + + normalizedManager.add(function (resource) { + manager.callback = function () { + return resource; + }; + execManager(manager); + }); + }); + } else if (created && shouldQueue) { + //Indicate the resource is not loaded yet if it is to be + //queued. + loaded[manager.id] = false; + queueDependency(manager); + addWait(manager); + } + + return manager; + } + + function main(inName, depArray, callback, relModuleMap) { + var moduleMap = makeModuleMap(inName, relModuleMap), + name = moduleMap.name, + fullName = moduleMap.fullName, + manager = getManager(moduleMap), + id = manager.id, + deps = manager.deps, + i, depArg, depName, depPrefix, cjsMod; + + if (fullName) { + //If module already defined for context, or already loaded, + //then leave. Also leave if jQuery is registering but it does + //not match the desired version number in the config. + if (fullName in defined || loaded[id] === true || + (fullName === "jquery" && config.jQuery && + config.jQuery !== callback().fn.jquery)) { + return; + } + + //Set specified/loaded here for modules that are also loaded + //as part of a layer, where onScriptLoad is not fired + //for those cases. Do this after the inline define and + //dependency tracing is done. + specified[id] = true; + loaded[id] = true; + + //If module is jQuery set up delaying its dom ready listeners. + if (fullName === "jquery" && callback) { + jQueryCheck(callback()); + } + } + + //Attach real depArray and callback to the manager. Do this + //only if the module has not been defined already, so do this after + //the fullName checks above. IE can call main() more than once + //for a module. + manager.depArray = depArray; + manager.callback = callback; + + //Add the dependencies to the deps field, and register for callbacks + //on the dependencies. + for (i = 0; i < depArray.length; i++) { + depArg = depArray[i]; + //There could be cases like in IE, where a trailing comma will + //introduce a null dependency, so only treat a real dependency + //value as a dependency. + if (depArg) { + //Split the dependency name into plugin and name parts + depArg = makeModuleMap(depArg, (name ? moduleMap : relModuleMap)); + depName = depArg.fullName; + depPrefix = depArg.prefix; + + //Fix the name in depArray to be just the name, since + //that is how it will be called back later. + depArray[i] = depName; + + //Fast path CommonJS standard dependencies. + if (depName === "require") { + deps[i] = makeRequire(moduleMap); + } else if (depName === "exports") { + //CommonJS module spec 1.1 + deps[i] = defined[fullName] = {}; + manager.usingExports = true; + } else if (depName === "module") { + //CommonJS module spec 1.1 + manager.cjsModule = cjsMod = deps[i] = { + id: name, + uri: name ? context.nameToUrl(name, null, relModuleMap) : undefined, + exports: defined[fullName] + }; + } else if (depName in defined && !(depName in waiting) && + (!(fullName in needFullExec) || + (fullName in needFullExec && fullExec[depName]))) { + //Module already defined, and not in a build situation + //where the module is a something that needs full + //execution and this dependency has not been fully + //executed. See r.js's requirePatch.js for more info + //on fullExec. + deps[i] = defined[depName]; + } else { + //Mark this dependency as needing full exec if + //the current module needs full exec. + if (fullName in needFullExec) { + needFullExec[depName] = true; + //Reset state so fully executed code will get + //picked up correctly. + delete defined[depName]; + urlFetched[depArg.url] = false; + } + + //Either a resource that is not loaded yet, or a plugin + //resource for either a plugin that has not + //loaded yet. + manager.depCount += 1; + manager.depCallbacks[i] = makeArgCallback(manager, i); + getManager(depArg, true).add(manager.depCallbacks[i]); + } + } + } + + //Do not bother tracking the manager if it is all done. + if (!manager.depCount) { + //All done, execute! + execManager(manager); + } else { + addWait(manager); + } + } + + /** + * Convenience method to call main for a define call that was put on + * hold in the defQueue. + */ + function callDefMain(args) { + main.apply(null, args); + } + + /** + * jQuery 1.4.3+ supports ways to hold off calling + * calling jQuery ready callbacks until all scripts are loaded. Be sure + * to track it if the capability exists.. Also, since jQuery 1.4.3 does + * not register as a module, need to do some global inference checking. + * Even if it does register as a module, not guaranteed to be the precise + * name of the global. If a jQuery is tracked for this context, then go + * ahead and register it as a module too, if not already in process. + */ + jQueryCheck = function (jqCandidate) { + if (!context.jQuery) { + var $ = jqCandidate || (typeof jQuery !== "undefined" ? jQuery : null); + + if ($) { + //If a specific version of jQuery is wanted, make sure to only + //use this jQuery if it matches. + if (config.jQuery && $.fn.jquery !== config.jQuery) { + return; + } + + if ("holdReady" in $ || "readyWait" in $) { + context.jQuery = $; + + //Manually create a "jquery" module entry if not one already + //or in process. Note this could trigger an attempt at + //a second jQuery registration, but does no harm since + //the first one wins, and it is the same value anyway. + callDefMain(["jquery", [], function () { + return jQuery; + }]); + + //Ask jQuery to hold DOM ready callbacks. + if (context.scriptCount) { + jQueryHoldReady($, true); + context.jQueryIncremented = true; + } + } + } + } + }; + + function findCycle(manager, traced) { + var fullName = manager.map.fullName, + depArray = manager.depArray, + fullyLoaded = true, + i, depName, depManager, result; + + if (manager.isDone || !fullName || !loaded[fullName]) { + return result; + } + + //Found the cycle. + if (traced[fullName]) { + return manager; + } + + traced[fullName] = true; + + //Trace through the dependencies. + if (depArray) { + for (i = 0; i < depArray.length; i++) { + //Some array members may be null, like if a trailing comma + //IE, so do the explicit [i] access and check if it has a value. + depName = depArray[i]; + if (!loaded[depName] && !reservedDependencies[depName]) { + fullyLoaded = false; + break; + } + depManager = waiting[depName]; + if (depManager && !depManager.isDone && loaded[depName]) { + result = findCycle(depManager, traced); + if (result) { + break; + } + } + } + if (!fullyLoaded) { + //Discard the cycle that was found, since it cannot + //be forced yet. Also clear this module from traced. + result = undefined; + delete traced[fullName]; + } + } + + return result; + } + + function forceExec(manager, traced) { + var fullName = manager.map.fullName, + depArray = manager.depArray, + i, depName, depManager, prefix, prefixManager, value; + + + if (manager.isDone || !fullName || !loaded[fullName]) { + return undefined; + } + + if (fullName) { + if (traced[fullName]) { + return defined[fullName]; + } + + traced[fullName] = true; + } + + //Trace through the dependencies. + if (depArray) { + for (i = 0; i < depArray.length; i++) { + //Some array members may be null, like if a trailing comma + //IE, so do the explicit [i] access and check if it has a value. + depName = depArray[i]; + if (depName) { + //First, make sure if it is a plugin resource that the + //plugin is not blocked. + prefix = makeModuleMap(depName).prefix; + if (prefix && (prefixManager = waiting[prefix])) { + forceExec(prefixManager, traced); + } + depManager = waiting[depName]; + if (depManager && !depManager.isDone && loaded[depName]) { + value = forceExec(depManager, traced); + manager.depCallbacks[i](value); + } + } + } + } + + return defined[fullName]; + } + + /** + * Checks if all modules for a context are loaded, and if so, evaluates the + * new ones in right dependency order. + * + * @private + */ + function checkLoaded() { + var waitInterval = config.waitSeconds * 1000, + //It is possible to disable the wait interval by using waitSeconds of 0. + expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), + noLoads = "", hasLoadedProp = false, stillLoading = false, + cycleDeps = [], + i, prop, err, manager, cycleManager, moduleDeps; + + //If there are items still in the paused queue processing wait. + //This is particularly important in the sync case where each paused + //item is processed right away but there may be more waiting. + if (context.pausedCount > 0) { + return undefined; + } + + //Determine if priority loading is done. If so clear the priority. If + //not, then do not check + if (config.priorityWait) { + if (isPriorityDone()) { + //Call resume, since it could have + //some waiting dependencies to trace. + resume(); + } else { + return undefined; + } + } + + //See if anything is still in flight. + for (prop in loaded) { + if (!(prop in empty)) { + hasLoadedProp = true; + if (!loaded[prop]) { + if (expired) { + noLoads += prop + " "; + } else { + stillLoading = true; + if (prop.indexOf('!') === -1) { + //No reason to keep looking for unfinished + //loading. If the only stillLoading is a + //plugin resource though, keep going, + //because it may be that a plugin resource + //is waiting on a non-plugin cycle. + cycleDeps = []; + break; + } else { + moduleDeps = managerCallbacks[prop] && managerCallbacks[prop].moduleDeps; + if (moduleDeps) { + cycleDeps.push.apply(cycleDeps, moduleDeps); + } + } + } + } + } + } + + //Check for exit conditions. + if (!hasLoadedProp && !context.waitCount) { + //If the loaded object had no items, then the rest of + //the work below does not need to be done. + return undefined; + } + if (expired && noLoads) { + //If wait time expired, throw error of unloaded modules. + err = makeError("timeout", "Load timeout for modules: " + noLoads); + err.requireType = "timeout"; + err.requireModules = noLoads; + err.contextName = context.contextName; + return req.onError(err); + } + + //If still loading but a plugin is waiting on a regular module cycle + //break the cycle. + if (stillLoading && cycleDeps.length) { + for (i = 0; (manager = waiting[cycleDeps[i]]); i++) { + if ((cycleManager = findCycle(manager, {}))) { + forceExec(cycleManager, {}); + break; + } + } + + } + + //If still waiting on loads, and the waiting load is something + //other than a plugin resource, or there are still outstanding + //scripts, then just try back later. + if (!expired && (stillLoading || context.scriptCount)) { + //Something is still waiting to load. Wait for it, but only + //if a timeout is not already in effect. + if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { + checkLoadedTimeoutId = setTimeout(function () { + checkLoadedTimeoutId = 0; + checkLoaded(); + }, 50); + } + return undefined; + } + + //If still have items in the waiting cue, but all modules have + //been loaded, then it means there are some circular dependencies + //that need to be broken. + //However, as a waiting thing is fired, then it can add items to + //the waiting cue, and those items should not be fired yet, so + //make sure to redo the checkLoaded call after breaking a single + //cycle, if nothing else loaded then this logic will pick it up + //again. + if (context.waitCount) { + //Cycle through the waitAry, and call items in sequence. + for (i = 0; (manager = waitAry[i]); i++) { + forceExec(manager, {}); + } + + //If anything got placed in the paused queue, run it down. + if (context.paused.length) { + resume(); + } + + //Only allow this recursion to a certain depth. Only + //triggered by errors in calling a module in which its + //modules waiting on it cannot finish loading, or some circular + //dependencies that then may add more dependencies. + //The value of 5 is a bit arbitrary. Hopefully just one extra + //pass, or two for the case of circular dependencies generating + //more work that gets resolved in the sync node case. + if (checkLoadedDepth < 5) { + checkLoadedDepth += 1; + checkLoaded(); + } + } + + checkLoadedDepth = 0; + + //Check for DOM ready, and nothing is waiting across contexts. + req.checkReadyState(); + + return undefined; + } + + /** + * Resumes tracing of dependencies and then checks if everything is loaded. + */ + resume = function () { + var manager, map, url, i, p, args, fullName; + + //Any defined modules in the global queue, intake them now. + context.takeGlobalQueue(); + + resumeDepth += 1; + + if (context.scriptCount <= 0) { + //Synchronous envs will push the number below zero with the + //decrement above, be sure to set it back to zero for good measure. + //require() calls that also do not end up loading scripts could + //push the number negative too. + context.scriptCount = 0; + } + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return req.onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + callDefMain(args); + } + } + + //Skip the resume of paused dependencies + //if current context is in priority wait. + if (!config.priorityWait || isPriorityDone()) { + while (context.paused.length) { + p = context.paused; + context.pausedCount += p.length; + //Reset paused list + context.paused = []; + + for (i = 0; (manager = p[i]); i++) { + map = manager.map; + url = map.url; + fullName = map.fullName; + + //If the manager is for a plugin managed resource, + //ask the plugin to load it now. + if (map.prefix) { + callPlugin(map.prefix, manager); + } else { + //Regular dependency. + if (!urlFetched[url] && !loaded[fullName]) { + req.load(context, fullName, url); + + //Mark the URL as fetched, but only if it is + //not an empty: URL, used by the optimizer. + //In that case we need to be sure to call + //load() for each module that is mapped to + //empty: so that dependencies are satisfied + //correctly. + if (url.indexOf('empty:') !== 0) { + urlFetched[url] = true; + } + } + } + } + + //Move the start time for timeout forward. + context.startTime = (new Date()).getTime(); + context.pausedCount -= p.length; + } + } + + //Only check if loaded when resume depth is 1. It is likely that + //it is only greater than 1 in sync environments where a factory + //function also then calls the callback-style require. In those + //cases, the checkLoaded should not occur until the resume + //depth is back at the top level. + if (resumeDepth === 1) { + checkLoaded(); + } + + resumeDepth -= 1; + + return undefined; + }; + + //Define the context object. Many of these fields are on here + //just to make debugging easier. + context = { + contextName: contextName, + config: config, + defQueue: defQueue, + waiting: waiting, + waitCount: 0, + specified: specified, + loaded: loaded, + urlMap: urlMap, + urlFetched: urlFetched, + scriptCount: 0, + defined: defined, + paused: [], + pausedCount: 0, + plugins: plugins, + needFullExec: needFullExec, + fake: {}, + fullExec: fullExec, + managerCallbacks: managerCallbacks, + makeModuleMap: makeModuleMap, + normalize: normalize, + /** + * Set a configuration for the context. + * @param {Object} cfg config object to integrate. + */ + configure: function (cfg) { + var paths, prop, packages, pkgs, packagePaths, requireWait; + + //Make sure the baseUrl ends in a slash. + if (cfg.baseUrl) { + if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== "/") { + cfg.baseUrl += "/"; + } + } + + //Save off the paths and packages since they require special processing, + //they are additive. + paths = config.paths; + packages = config.packages; + pkgs = config.pkgs; + + //Mix in the config values, favoring the new values over + //existing ones in context.config. + mixin(config, cfg, true); + + //Adjust paths if necessary. + if (cfg.paths) { + for (prop in cfg.paths) { + if (!(prop in empty)) { + paths[prop] = cfg.paths[prop]; + } + } + config.paths = paths; + } + + packagePaths = cfg.packagePaths; + if (packagePaths || cfg.packages) { + //Convert packagePaths into a packages config. + if (packagePaths) { + for (prop in packagePaths) { + if (!(prop in empty)) { + configurePackageDir(pkgs, packagePaths[prop], prop); + } + } + } + + //Adjust packages if necessary. + if (cfg.packages) { + configurePackageDir(pkgs, cfg.packages); + } + + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } + + //If priority loading is in effect, trigger the loads now + if (cfg.priority) { + //Hold on to requireWait value, and reset it after done + requireWait = context.requireWait; + + //Allow tracing some require calls to allow the fetching + //of the priority config. + context.requireWait = false; + //But first, call resume to register any defined modules that may + //be in a data-main built file before the priority config + //call. + resume(); + + context.require(cfg.priority); + + //Trigger a resume right away, for the case when + //the script with the priority load is done as part + //of a data-main call. In that case the normal resume + //call will not happen because the scriptCount will be + //at 1, since the script for data-main is being processed. + resume(); + + //Restore previous state. + context.requireWait = requireWait; + config.priorityWait = cfg.priority; + } + + //If a deps array or a config callback is specified, then call + //require with those args. This is useful when require is defined as a + //config object before require.js is loaded. + if (cfg.deps || cfg.callback) { + context.require(cfg.deps || [], cfg.callback); + } + }, + + requireDefined: function (moduleName, relModuleMap) { + return makeModuleMap(moduleName, relModuleMap).fullName in defined; + }, + + requireSpecified: function (moduleName, relModuleMap) { + return makeModuleMap(moduleName, relModuleMap).fullName in specified; + }, + + require: function (deps, callback, relModuleMap) { + var moduleName, fullName, moduleMap; + if (typeof deps === "string") { + if (isFunction(callback)) { + //Invalid call + return req.onError(makeError("requireargs", "Invalid require call")); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + //In this case deps is the moduleName and callback is + //the relModuleMap + if (req.get) { + return req.get(context, deps, callback); + } + + //Just return the module wanted. In this scenario, the + //second arg (if passed) is just the relModuleMap. + moduleName = deps; + relModuleMap = callback; + + //Normalize module name, if it contains . or .. + moduleMap = makeModuleMap(moduleName, relModuleMap); + fullName = moduleMap.fullName; + + if (!(fullName in defined)) { + return req.onError(makeError("notloaded", "Module name '" + + moduleMap.fullName + + "' has not been loaded yet for context: " + + contextName)); + } + return defined[fullName]; + } + + //Call main but only if there are dependencies or + //a callback to call. + if (deps && deps.length || callback) { + main(null, deps, callback, relModuleMap); + } + + //If the require call does not trigger anything new to load, + //then resume the dependency processing. + if (!context.requireWait) { + while (!context.scriptCount && context.paused.length) { + resume(); + } + } + return context.require; + }, + + /** + * Internal method to transfer globalQueue items to this context's + * defQueue. + */ + takeGlobalQueue: function () { + //Push all the globalDefQueue items into the context's defQueue + if (globalDefQueue.length) { + //Array splice in the values since the context code has a + //local var ref to defQueue, so cannot just reassign the one + //on context. + apsp.apply(context.defQueue, + [context.defQueue.length - 1, 0].concat(globalDefQueue)); + globalDefQueue = []; + } + }, + + /** + * Internal method used by environment adapters to complete a load event. + * A load event could be a script load or just a load pass from a synchronous + * load call. + * @param {String} moduleName the name of the module to potentially complete. + */ + completeLoad: function (moduleName) { + var args; + + context.takeGlobalQueue(); + + while (defQueue.length) { + args = defQueue.shift(); + + if (args[0] === null) { + args[0] = moduleName; + break; + } else if (args[0] === moduleName) { + //Found matching define call for this script! + break; + } else { + //Some other named define call, most likely the result + //of a build layer that included many define calls. + callDefMain(args); + args = null; + } + } + if (args) { + callDefMain(args); + } else { + //A script that does not call define(), so just simulate + //the call for it. Special exception for jQuery dynamic load. + callDefMain([moduleName, [], + moduleName === "jquery" && typeof jQuery !== "undefined" ? + function () { + return jQuery; + } : null]); + } + + //Doing this scriptCount decrement branching because sync envs + //need to decrement after resume, otherwise it looks like + //loading is complete after the first dependency is fetched. + //For browsers, it works fine to decrement after, but it means + //the checkLoaded setTimeout 50 ms cost is taken. To avoid + //that cost, decrement beforehand. + if (req.isAsync) { + context.scriptCount -= 1; + } + resume(); + if (!req.isAsync) { + context.scriptCount -= 1; + } + }, + + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt, relModuleMap) { + var index = moduleNamePlusExt.lastIndexOf("."), + ext = null; + + if (index !== -1) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap); + }, + + /** + * Converts a module name to a file path. Supports cases where + * moduleName may actually be just an URL. + */ + nameToUrl: function (moduleName, ext, relModuleMap) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + config = context.config; + + //Normalize module name if have a base relative module name to work from. + moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName); + + //If a colon is in the URL, it indicates a protocol is used and it is just + //an URL to a file, or if it starts with a slash or ends with .js, it is just a plain file. + //The slash is important for protocol-less URLs as well as full paths. + if (req.jsExtRegExp.test(moduleName)) { + //Just a plain path, not module name lookup, so just return it. + //Add extension if it is included. This is a bit wonky, only non-.js things pass + //an extension, this method probably needs to be reworked. + url = moduleName + (ext ? ext : ""); + } else { + //A module that needs to be converted to a path. + paths = config.paths; + pkgs = config.pkgs; + + syms = moduleName.split("/"); + //For each module name segment, see if there is a path + //registered for it. Start with most specific name + //and work up from it. + for (i = syms.length; i > 0; i--) { + parentModule = syms.slice(0, i).join("/"); + if (paths[parentModule]) { + syms.splice(0, i, paths[parentModule]); + break; + } else if ((pkg = pkgs[parentModule])) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; + } + } + + //Join the path parts together, then figure out if baseUrl is needed. + url = syms.join("/") + (ext || ".js"); + url = (url.charAt(0) === '/' || url.match(/^\w+:/) ? "" : config.baseUrl) + url; + } + + return config.urlArgs ? url + + ((url.indexOf('?') === -1 ? '?' : '&') + + config.urlArgs) : url; + } + }; + + //Make these visible on the context so can be called at the very + //end of the file to bootstrap + context.jQueryCheck = jQueryCheck; + context.resume = resume; + + return context; + } + + /** + * Main entry point. + * + * If the only argument to require is a string, then the module that + * is represented by that string is fetched for the appropriate context. + * + * If the first argument is an array, then it will be treated as an array + * of dependency string names to fetch. An optional function callback can + * be specified to execute when all of those dependencies are available. + * + * Make a local req variable to help Caja compliance (it assumes things + * on a require that are not standardized), and to give a short + * name for minification/local scope use. + */ + req = requirejs = function (deps, callback) { + + //Find the right context, use default + var contextName = defContextName, + context, config; + + // Determine if have config object in the call. + if (!isArray(deps) && typeof deps !== "string") { + // deps is a config object + config = deps; + if (isArray(callback)) { + // Adjust args if there are dependencies + deps = callback; + callback = arguments[2]; + } else { + deps = []; + } + } + + if (config && config.context) { + contextName = config.context; + } + + context = contexts[contextName] || + (contexts[contextName] = newContext(contextName)); + + if (config) { + context.configure(config); + } + + return context.require(deps, callback); + }; + + /** + * Support require.config() to make it easier to cooperate with other + * AMD loaders on globally agreed names. + */ + req.config = function (config) { + return req(config); + }; + + /** + * Export require as a global, but only if it does not already exist. + */ + if (!require) { + require = req; + } + + /** + * Global require.toUrl(), to match global require, mostly useful + * for debugging/work in the global space. + */ + req.toUrl = function (moduleNamePlusExt) { + return contexts[defContextName].toUrl(moduleNamePlusExt); + }; + + req.version = version; + + //Used to filter out dependencies that are already paths. + req.jsExtRegExp = /^\/|:|\?|\.js$/; + s = req.s = { + contexts: contexts, + //Stores a list of URLs that should not get async script tag treatment. + skipAsync: {} + }; + + req.isAsync = req.isBrowser = isBrowser; + if (isBrowser) { + head = s.head = document.getElementsByTagName("head")[0]; + //If BASE tag is in play, using appendChild is a problem for IE6. + //When that browser dies, this can be removed. Details in this jQuery bug: + //http://dev.jquery.com/ticket/2709 + baseElement = document.getElementsByTagName("base")[0]; + if (baseElement) { + head = s.head = baseElement.parentNode; + } + } + + /** + * Any errors that require explicitly generates will be passed to this + * function. Intercept/override it if you want custom error handling. + * @param {Error} err the error object. + */ + req.onError = function (err) { + throw err; + }; + + /** + * Does the request to load a module for the browser case. + * Make this a separate function to allow other environments + * to override it. + * + * @param {Object} context the require context to find state. + * @param {String} moduleName the name of the module. + * @param {Object} url the URL to the module. + */ + req.load = function (context, moduleName, url) { + req.resourcesReady(false); + + context.scriptCount += 1; + req.attach(url, context, moduleName); + + //If tracking a jQuery, then make sure its ready callbacks + //are put on hold to prevent its ready callbacks from + //triggering too soon. + if (context.jQuery && !context.jQueryIncremented) { + jQueryHoldReady(context.jQuery, true); + context.jQueryIncremented = true; + } + }; + + function getInteractiveScript() { + var scripts, i, script; + if (interactiveScript && interactiveScript.readyState === 'interactive') { + return interactiveScript; + } + + scripts = document.getElementsByTagName('script'); + for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) { + if (script.readyState === 'interactive') { + return (interactiveScript = script); + } + } + + return null; + } + + /** + * The function that handles definitions of modules. Differs from + * require() in that a string for the module should be the first argument, + * and the function to execute after dependencies are loaded should + * return a value to define the module corresponding to the first argument's + * name. + */ + define = function (name, deps, callback) { + var node, context; + + //Allow for anonymous functions + if (typeof name !== 'string') { + //Adjust args appropriately + callback = deps; + deps = name; + name = null; + } + + //This module may not have dependencies + if (!isArray(deps)) { + callback = deps; + deps = []; + } + + //If no name, and callback is a function, then figure out if it a + //CommonJS thing with dependencies. + if (!deps.length && isFunction(callback)) { + //Remove comments from the callback string, + //look for require calls, and pull them into the dependencies, + //but only if there are function args. + if (callback.length) { + callback + .toString() + .replace(commentRegExp, "") + .replace(cjsRequireRegExp, function (match, dep) { + deps.push(dep); + }); + + //May be a CommonJS thing even without require calls, but still + //could use exports, and module. Avoid doing exports and module + //work though if it just needs require. + //REQUIRES the function to expect the CommonJS variables in the + //order listed below. + deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps); + } + } + + //If in IE 6-8 and hit an anonymous define() call, do the interactive + //work. + if (useInteractive) { + node = currentlyAddingScript || getInteractiveScript(); + if (node) { + if (!name) { + name = node.getAttribute("data-requiremodule"); + } + context = contexts[node.getAttribute("data-requirecontext")]; + } + } + + //Always save off evaluating the def call until the script onload handler. + //This allows multiple modules to be in a file without prematurely + //tracing dependencies, and allows for anonymous module support, + //where the module name is not known until the script onload event + //occurs. If no context, use the global queue, and get it processed + //in the onscript load callback. + (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); + + return undefined; + }; + + define.amd = { + multiversion: true, + plugins: true, + jQuery: true + }; + + /** + * Executes the text. Normally just uses eval, but can be modified + * to use a more environment specific call. + * @param {String} text the text to execute/evaluate. + */ + req.exec = function (text) { + return eval(text); + }; + + /** + * Executes a module callack function. Broken out as a separate function + * solely to allow the build system to sequence the files in the built + * layer in the right sequence. + * + * @private + */ + req.execCb = function (name, callback, args, exports) { + return callback.apply(exports, args); + }; + + + /** + * Adds a node to the DOM. Public function since used by the order plugin. + * This method should not normally be called by outside code. + */ + req.addScriptToDom = function (node) { + //For some cache cases in IE 6-8, the script executes before the end + //of the appendChild execution, so to tie an anonymous define + //call to the module name (which is stored on the node), hold on + //to a reference to this node, but clear after the DOM insertion. + currentlyAddingScript = node; + if (baseElement) { + head.insertBefore(node, baseElement); + } else { + head.appendChild(node); + } + currentlyAddingScript = null; + }; + + /** + * callback for script loads, used to check status of loading. + * + * @param {Event} evt the event from the browser for the script + * that was loaded. + * + * @private + */ + req.onScriptLoad = function (evt) { + //Using currentTarget instead of target for Firefox 2.0's sake. Not + //all old browsers will be supported, but this one was easy enough + //to support and still makes sense. + var node = evt.currentTarget || evt.srcElement, contextName, moduleName, + context; + + if (evt.type === "load" || (node && readyRegExp.test(node.readyState))) { + //Reset interactive script so a script node is not held onto for + //to long. + interactiveScript = null; + + //Pull out the name of the module and the context. + contextName = node.getAttribute("data-requirecontext"); + moduleName = node.getAttribute("data-requiremodule"); + context = contexts[contextName]; + + contexts[contextName].completeLoad(moduleName); + + //Clean up script binding. Favor detachEvent because of IE9 + //issue, see attachEvent/addEventListener comment elsewhere + //in this file. + if (node.detachEvent && !isOpera) { + //Probably IE. If not it will throw an error, which will be + //useful to know. + node.detachEvent("onreadystatechange", req.onScriptLoad); + } else { + node.removeEventListener("load", req.onScriptLoad, false); + } + } + }; + + /** + * Attaches the script represented by the URL to the current + * environment. Right now only supports browser loading, + * but can be redefined in other environments to do the right thing. + * @param {String} url the url of the script to attach. + * @param {Object} context the context that wants the script. + * @param {moduleName} the name of the module that is associated with the script. + * @param {Function} [callback] optional callback, defaults to require.onScriptLoad + * @param {String} [type] optional type, defaults to text/javascript + * @param {Function} [fetchOnlyFunction] optional function to indicate the script node + * should be set up to fetch the script but do not attach it to the DOM + * so that it can later be attached to execute it. This is a way for the + * order plugin to support ordered loading in IE. Once the script is fetched, + * but not executed, the fetchOnlyFunction will be called. + */ + req.attach = function (url, context, moduleName, callback, type, fetchOnlyFunction) { + var node; + if (isBrowser) { + //In the browser so use a script tag + callback = callback || req.onScriptLoad; + node = context && context.config && context.config.xhtml ? + document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : + document.createElement("script"); + node.type = type || (context && context.config.scriptType) || + "text/javascript"; + node.charset = "utf-8"; + //Use async so Gecko does not block on executing the script if something + //like a long-polling comet tag is being run first. Gecko likes + //to evaluate scripts in DOM order, even for dynamic scripts. + //It will fetch them async, but only evaluate the contents in DOM + //order, so a long-polling script tag can delay execution of scripts + //after it. But telling Gecko we expect async gets us the behavior + //we want -- execute it whenever it is finished downloading. Only + //Helps Firefox 3.6+ + //Allow some URLs to not be fetched async. Mostly helps the order! + //plugin + node.async = !s.skipAsync[url]; + + if (context) { + node.setAttribute("data-requirecontext", context.contextName); + } + node.setAttribute("data-requiremodule", moduleName); + + //Set up load listener. Test attachEvent first because IE9 has + //a subtle issue in its addEventListener and script onload firings + //that do not match the behavior of all other browsers with + //addEventListener support, which fire the onload event for a + //script right after the script execution. See: + //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution + //UNFORTUNATELY Opera implements attachEvent but does not follow the script + //script execution mode. + if (node.attachEvent && !isOpera) { + //Probably IE. IE (at least 6-8) do not fire + //script onload right after executing the script, so + //we cannot tie the anonymous define call to a name. + //However, IE reports the script as being in "interactive" + //readyState at the time of the define call. + useInteractive = true; + + + if (fetchOnlyFunction) { + //Need to use old school onreadystate here since + //when the event fires and the node is not attached + //to the DOM, the evt.srcElement is null, so use + //a closure to remember the node. + node.onreadystatechange = function (evt) { + //Script loaded but not executed. + //Clear loaded handler, set the real one that + //waits for script execution. + if (node.readyState === 'loaded') { + node.onreadystatechange = null; + node.attachEvent("onreadystatechange", callback); + fetchOnlyFunction(node); + } + }; + } else { + node.attachEvent("onreadystatechange", callback); + } + } else { + node.addEventListener("load", callback, false); + } + node.src = url; + + //Fetch only means waiting to attach to DOM after loaded. + if (!fetchOnlyFunction) { + req.addScriptToDom(node); + } + + return node; + } else if (isWebWorker) { + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); + + //Account for anonymous modules + context.completeLoad(moduleName); + } + return null; + }; + + //Look for a data-main script attribute, which could also adjust the baseUrl. + if (isBrowser) { + //Figure out baseUrl. Get it from the script tag with require.js in it. + scripts = document.getElementsByTagName("script"); + + for (globalI = scripts.length - 1; globalI > -1 && (script = scripts[globalI]); globalI--) { + //Set the "head" where we can append children by + //using the script's parent. + if (!head) { + head = script.parentNode; + } + + //Look for a data-main attribute to set main script for the page + //to load. If it is there, the path to data main becomes the + //baseUrl, if it is not already set. + if ((dataMain = script.getAttribute('data-main'))) { + if (!cfg.baseUrl) { + //Pull off the directory of data-main for use as the + //baseUrl. + src = dataMain.split('/'); + mainScript = src.pop(); + subPath = src.length ? src.join('/') + '/' : './'; + + //Set final config. + cfg.baseUrl = subPath; + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = mainScript.replace(jsSuffixRegExp, ''); + } + + //Put the data-main script in the files to load. + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; + + break; + } + } + } + + //See if there is nothing waiting across contexts, and if not, trigger + //resourcesReady. + req.checkReadyState = function () { + var contexts = s.contexts, prop; + for (prop in contexts) { + if (!(prop in empty)) { + if (contexts[prop].waitCount) { + return; + } + } + } + req.resourcesReady(true); + }; + + /** + * Internal function that is triggered whenever all scripts/resources + * have been loaded by the loader. Can be overridden by other, for + * instance the domReady plugin, which wants to know when all resources + * are loaded. + */ + req.resourcesReady = function (isReady) { + var contexts, context, prop; + + //First, set the public variable indicating that resources are loading. + req.resourcesDone = isReady; + + if (req.resourcesDone) { + //If jQuery with DOM ready delayed, release it now. + contexts = s.contexts; + for (prop in contexts) { + if (!(prop in empty)) { + context = contexts[prop]; + if (context.jQueryIncremented) { + jQueryHoldReady(context.jQuery, false); + context.jQueryIncremented = false; + } + } + } + } + }; + + //FF < 3.6 readyState fix. Needed so that domReady plugin + //works well in that environment, since require.js is normally + //loaded via an HTML script tag so it will be there before window load, + //where the domReady plugin is more likely to be loaded after window load. + req.pageLoaded = function () { + if (document.readyState !== "complete") { + document.readyState = "complete"; + } + }; + if (isBrowser) { + if (document.addEventListener) { + if (!document.readyState) { + document.readyState = "loading"; + window.addEventListener("load", req.pageLoaded, false); + } + } + } + + //Set up default context. If require was a configuration object, use that as base config. + req(cfg); + + //If modules are built into require.js, then need to make sure dependencies are + //traced. Use a setTimeout in the browser world, to allow all the modules to register + //themselves. In a non-browser env, assume that modules are not built into require.js, + //which seems odd to do on the server. + if (req.isAsync && typeof setTimeout !== "undefined") { + ctx = s.contexts[(cfg.context || defContextName)]; + //Indicate that the script that includes require() is still loading, + //so that require()'d dependencies are not traced until the end of the + //file is parsed (approximated via the setTimeout call). + ctx.requireWait = true; + setTimeout(function () { + ctx.requireWait = false; + + if (!ctx.scriptCount) { + ctx.resume(); + } + req.checkReadyState(); + }, 0); + } +}()); + + + if (env === 'rhino') { + /** + * @license RequireJS rhino Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global require: false, java: false, load: false */ + +(function () { + + require.load = function (context, moduleName, url) { + //Indicate a the module is in process of loading. + context.scriptCount += 1; + + load(url); + + //Support anonymous modules. + context.completeLoad(moduleName); + }; + +}()); + } else if (env === 'node') { + this.requirejsVars = { + require: require, + requirejs: require, + define: define, + nodeRequire: nodeRequire + }; + require.nodeRequire = nodeRequire; + + /** + * @license RequireJS node Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint regexp: false, strict: false */ +/*global require: false, define: false, requirejsVars: false, process: false */ + +/** + * This adapter assumes that x.js has loaded it and set up + * some variables. This adapter just allows limited RequireJS + * usage from within the requirejs directory. The general + * node adapater is r.js. + */ + +(function () { + var nodeReq = requirejsVars.nodeRequire, + req = requirejsVars.require, + def = requirejsVars.define, + fs = nodeReq('fs'), + path = nodeReq('path'), + vm = nodeReq('vm'); + + //Supply an implementation that allows synchronous get of a module. + req.get = function (context, moduleName, relModuleMap) { + if (moduleName === "require" || moduleName === "exports" || moduleName === "module") { + req.onError(new Error("Explicit require of " + moduleName + " is not allowed.")); + } + + var ret, + moduleMap = context.makeModuleMap(moduleName, relModuleMap); + + //Normalize module name, if it contains . or .. + moduleName = moduleMap.fullName; + + if (moduleName in context.defined) { + ret = context.defined[moduleName]; + } else { + if (ret === undefined) { + //Try to dynamically fetch it. + req.load(context, moduleName, moduleMap.url); + //The above call is sync, so can do the next thing safely. + ret = context.defined[moduleName]; + } + } + + return ret; + }; + + //Add wrapper around the code so that it gets the requirejs + //API instead of the Node API, and it is done lexically so + //that it survives later execution. + req.makeNodeWrapper = function (contents) { + return '(function (require, requirejs, define) { ' + + contents + + '\n}(requirejsVars.require, requirejsVars.requirejs, requirejsVars.define));'; + }; + + req.load = function (context, moduleName, url) { + var contents, err; + + //Indicate a the module is in process of loading. + context.scriptCount += 1; + + if (path.existsSync(url)) { + contents = fs.readFileSync(url, 'utf8'); + + contents = req.makeNodeWrapper(contents); + try { + vm.runInThisContext(contents, fs.realpathSync(url)); + } catch (e) { + err = new Error('Evaluating ' + url + ' as module "' + + moduleName + '" failed with error: ' + e); + err.originalError = e; + err.moduleName = moduleName; + err.fileName = url; + return req.onError(err); + } + } else { + def(moduleName, function () { + try { + return (context.config.nodeRequire || req.nodeRequire)(moduleName); + } catch (e) { + err = new Error('Calling node\'s require("' + + moduleName + '") failed with error: ' + e); + err.originalError = e; + err.moduleName = moduleName; + return req.onError(err); + } + }); + } + + //Support anonymous modules. + context.completeLoad(moduleName); + + return undefined; + }; + + //Override to provide the function wrapper for define/require. + req.exec = function (text) { + /*jslint evil: true */ + text = req.makeNodeWrapper(text); + return eval(text); + }; +}()); + + } + + //Support a default file name to execute. Useful for hosted envs + //like Joyent where it defaults to a server.js as the only executed + //script. But only do it if this is not an optimization run. + if (commandOption !== 'o' && (!fileName || !jsSuffixRegExp.test(fileName))) { + fileName = 'main.js'; + } + + /** + * Loads the library files that can be used for the optimizer, or for other + * tasks. + */ + function loadLib() { + /** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global Packages: false, process: false, window: false, navigator: false, + document: false, define: false */ + +/** + * A plugin that modifies any /env/ path to be the right path based on + * the host environment. Right now only works for Node, Rhino and browser. + */ +(function () { + var pathRegExp = /(\/|^)env\/|\{env\}/, + env = 'unknown'; + + if (typeof Packages !== 'undefined') { + env = 'rhino'; + } else if (typeof process !== 'undefined') { + env = 'node'; + } else if (typeof window !== "undefined" && navigator && document) { + env = 'browser'; + } + + define('env', { + load: function (name, req, load, config) { + //Allow override in the config. + if (config.env) { + env = config.env; + } + + name = name.replace(pathRegExp, function (match, prefix) { + if (match.indexOf('{') === -1) { + return prefix + env + '/'; + } else { + return env; + } + }); + + req([name], function (mod) { + load(mod); + }); + } + }); +}()); +if(env === 'node') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, process: false */ + +define('node/args', function () { + //Do not return the "node" or "r.js" arguments + var args = process.argv.slice(2); + + //Ignore any command option used for rq.js + if (args[0] && args[0].indexOf('-' === 0)) { + args = args.slice(1); + } + + return args; +}); + +} + +if(env === 'rhino') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, process: false */ + +var jsLibRhinoArgs = (typeof rhinoArgs !== 'undefined' && rhinoArgs) || [].concat(Array.prototype.slice.call(arguments, 0)); + +define('rhino/args', function () { + var args = jsLibRhinoArgs; + + //Ignore any command option used for rq.js + if (args[0] && args[0].indexOf('-' === 0)) { + args = args.slice(1); + } + + return args; +}); + +} + +if(env === 'node') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, console: false */ + +define('node/load', ['fs'], function (fs) { + function load(fileName) { + var contents = fs.readFileSync(fileName, 'utf8'); + process.compile(contents, fileName); + } + + return load; +}); + +} + +if(env === 'rhino') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, load: false */ + +define('rhino/load', function () { + return load; +}); + +} + +if(env === 'node') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, octal:false, strict: false */ +/*global define: false, process: false */ + +define('node/file', ['fs', 'path'], function (fs, path) { + + var isWindows = process.platform === 'win32', + windowsDriveRegExp = /^[a-zA-Z]\:\/$/, + file; + + function frontSlash(path) { + return path.replace(/\\/g, '/'); + } + + function exists(path) { + if (isWindows && path.charAt(path.length - 1) === '/' && + path.charAt(path.length - 2) !== ':') { + path = path.substring(0, path.length - 1); + } + + try { + fs.statSync(path); + return true; + } catch (e) { + return false; + } + } + + function mkDir(dir) { + if (!exists(dir) && (!isWindows || !windowsDriveRegExp.test(dir))) { + fs.mkdirSync(dir, 511); + } + } + + function mkFullDir(dir) { + var parts = dir.split('/'), + currDir = '', + first = true; + + parts.forEach(function (part) { + //First part may be empty string if path starts with a slash. + currDir += part + '/'; + first = false; + + if (part) { + mkDir(currDir); + } + }); + } + + file = { + backSlashRegExp: /\\/g, + exclusionRegExp: /^\./, + getLineSeparator: function () { + return '/'; + }, + + exists: function (fileName) { + return exists(fileName); + }, + + parent: function (fileName) { + var parts = fileName.split('/'); + parts.pop(); + return parts.join('/'); + }, + + /** + * Gets the absolute file path as a string, normalized + * to using front slashes for path separators. + * @param {String} fileName + */ + absPath: function (fileName) { + return frontSlash(path.normalize(frontSlash(fs.realpathSync(fileName)))); + }, + + normalize: function (fileName) { + return frontSlash(path.normalize(fileName)); + }, + + isFile: function (path) { + return fs.statSync(path).isFile(); + }, + + isDirectory: function (path) { + return fs.statSync(path).isDirectory(); + }, + + getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths) { + //summary: Recurses startDir and finds matches to the files that match regExpFilters.include + //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, + //and it will be treated as the "include" case. + //Ignores files/directories that start with a period (.) unless exclusionRegExp + //is set to another value. + var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, + i, stat, filePath, ok, dirFiles, fileName; + + topDir = startDir; + + regExpInclude = regExpFilters.include || regExpFilters; + regExpExclude = regExpFilters.exclude || null; + + if (file.exists(topDir)) { + dirFileArray = fs.readdirSync(topDir); + for (i = 0; i < dirFileArray.length; i++) { + fileName = dirFileArray[i]; + filePath = path.join(topDir, fileName); + stat = fs.statSync(filePath); + if (stat.isFile()) { + if (makeUnixPaths) { + //Make sure we have a JS string. + if (filePath.indexOf("/") === -1) { + filePath = frontSlash(filePath); + } + } + + ok = true; + if (regExpInclude) { + ok = filePath.match(regExpInclude); + } + if (ok && regExpExclude) { + ok = !filePath.match(regExpExclude); + } + + if (ok && (!file.exclusionRegExp || + !file.exclusionRegExp.test(fileName))) { + files.push(filePath); + } + } else if (stat.isDirectory() && + (!file.exclusionRegExp || !file.exclusionRegExp.test(fileName))) { + dirFiles = this.getFilteredFileList(filePath, regExpFilters, makeUnixPaths); + files.push.apply(files, dirFiles); + } + } + } + + return files; //Array + }, + + copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { + //summary: copies files from srcDir to destDir using the regExpFilter to determine if the + //file should be copied. Returns a list file name strings of the destinations that were copied. + regExpFilter = regExpFilter || /\w/; + + //Normalize th directory names, but keep front slashes. + //path module on windows now returns backslashed paths. + srcDir = frontSlash(path.normalize(srcDir)); + destDir = frontSlash(path.normalize(destDir)); + + var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), + copiedFiles = [], i, srcFileName, destFileName; + + for (i = 0; i < fileNames.length; i++) { + srcFileName = fileNames[i]; + destFileName = srcFileName.replace(srcDir, destDir); + + if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { + copiedFiles.push(destFileName); + } + } + + return copiedFiles.length ? copiedFiles : null; //Array or null + }, + + copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { + //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if + //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. + var parentDir; + + //logger.trace("Src filename: " + srcFileName); + //logger.trace("Dest filename: " + destFileName); + + //If onlyCopyNew is true, then compare dates and only copy if the src is newer + //than dest. + if (onlyCopyNew) { + if (file.exists(destFileName) && fs.statSync(destFileName).mtime.getTime() >= fs.statSync(srcFileName).mtime.getTime()) { + return false; //Boolean + } + } + + //Make sure destination dir exists. + parentDir = path.dirname(destFileName); + if (!file.exists(parentDir)) { + mkFullDir(parentDir); + } + + fs.writeFileSync(destFileName, fs.readFileSync(srcFileName, 'binary'), 'binary'); + + return true; //Boolean + }, + + /** + * Renames a file. May fail if "to" already exists or is on another drive. + */ + renameFile: function (from, to) { + return fs.renameSync(from, to); + }, + + /** + * Reads a *text* file. + */ + readFile: function (/*String*/path, /*String?*/encoding) { + if (encoding === 'utf-8') { + encoding = 'utf8'; + } + if (!encoding) { + encoding = 'utf8'; + } + + var text = fs.readFileSync(path, encoding); + + //Hmm, would not expect to get A BOM, but it seems to happen, + //remove it just in case. + if (text.indexOf('\uFEFF') === 0) { + text = text.substring(1, text.length); + } + + return text; + }, + + saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { + //summary: saves a *text* file using UTF-8 encoding. + file.saveFile(fileName, fileContents, "utf8"); + }, + + saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { + //summary: saves a *text* file. + var parentDir; + + if (encoding === 'utf-8') { + encoding = 'utf8'; + } + if (!encoding) { + encoding = 'utf8'; + } + + //Make sure destination directories exist. + parentDir = path.dirname(fileName); + if (!file.exists(parentDir)) { + mkFullDir(parentDir); + } + + fs.writeFileSync(fileName, fileContents, encoding); + }, + + deleteFile: function (/*String*/fileName) { + //summary: deletes a file or directory if it exists. + var files, i, stat; + if (file.exists(fileName)) { + stat = fs.statSync(fileName); + if (stat.isDirectory()) { + files = fs.readdirSync(fileName); + for (i = 0; i < files.length; i++) { + this.deleteFile(path.join(fileName, files[i])); + } + fs.rmdirSync(fileName); + } else { + fs.unlinkSync(fileName); + } + } + } + }; + + return file; + +}); + +} + +if(env === 'rhino') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +//Helper functions to deal with file I/O. + +/*jslint plusplus: false, strict: false */ +/*global java: false, define: false */ + +define('rhino/file', function () { + var file = { + backSlashRegExp: /\\/g, + + exclusionRegExp: /^\./, + + getLineSeparator: function () { + return file.lineSeparator; + }, + + lineSeparator: java.lang.System.getProperty("line.separator"), //Java String + + exists: function (fileName) { + return (new java.io.File(fileName)).exists(); + }, + + parent: function (fileName) { + return file.absPath((new java.io.File(fileName)).getParentFile()); + }, + + normalize: function (fileName) { + return file.absPath(fileName); + }, + + isFile: function (path) { + return (new java.io.File(path)).isFile(); + }, + + isDirectory: function (path) { + return (new java.io.File(path)).isDirectory(); + }, + + /** + * Gets the absolute file path as a string, normalized + * to using front slashes for path separators. + * @param {java.io.File||String} file + */ + absPath: function (fileObj) { + if (typeof fileObj === "string") { + fileObj = new java.io.File(fileObj); + } + return (fileObj.getAbsolutePath() + "").replace(file.backSlashRegExp, "/"); + }, + + getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsJavaObject) { + //summary: Recurses startDir and finds matches to the files that match regExpFilters.include + //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, + //and it will be treated as the "include" case. + //Ignores files/directories that start with a period (.) unless exclusionRegExp + //is set to another value. + var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, + i, fileObj, filePath, ok, dirFiles; + + topDir = startDir; + if (!startDirIsJavaObject) { + topDir = new java.io.File(startDir); + } + + regExpInclude = regExpFilters.include || regExpFilters; + regExpExclude = regExpFilters.exclude || null; + + if (topDir.exists()) { + dirFileArray = topDir.listFiles(); + for (i = 0; i < dirFileArray.length; i++) { + fileObj = dirFileArray[i]; + if (fileObj.isFile()) { + filePath = fileObj.getPath(); + if (makeUnixPaths) { + //Make sure we have a JS string. + filePath = String(filePath); + if (filePath.indexOf("/") === -1) { + filePath = filePath.replace(/\\/g, "/"); + } + } + + ok = true; + if (regExpInclude) { + ok = filePath.match(regExpInclude); + } + if (ok && regExpExclude) { + ok = !filePath.match(regExpExclude); + } + + if (ok && (!file.exclusionRegExp || + !file.exclusionRegExp.test(fileObj.getName()))) { + files.push(filePath); + } + } else if (fileObj.isDirectory() && + (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.getName()))) { + dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true); + files.push.apply(files, dirFiles); + } + } + } + + return files; //Array + }, + + copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { + //summary: copies files from srcDir to destDir using the regExpFilter to determine if the + //file should be copied. Returns a list file name strings of the destinations that were copied. + regExpFilter = regExpFilter || /\w/; + + var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), + copiedFiles = [], i, srcFileName, destFileName; + + for (i = 0; i < fileNames.length; i++) { + srcFileName = fileNames[i]; + destFileName = srcFileName.replace(srcDir, destDir); + + if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { + copiedFiles.push(destFileName); + } + } + + return copiedFiles.length ? copiedFiles : null; //Array or null + }, + + copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { + //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if + //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. + var destFile = new java.io.File(destFileName), srcFile, parentDir, + srcChannel, destChannel; + + //logger.trace("Src filename: " + srcFileName); + //logger.trace("Dest filename: " + destFileName); + + //If onlyCopyNew is true, then compare dates and only copy if the src is newer + //than dest. + if (onlyCopyNew) { + srcFile = new java.io.File(srcFileName); + if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified()) { + return false; //Boolean + } + } + + //Make sure destination dir exists. + parentDir = destFile.getParentFile(); + if (!parentDir.exists()) { + if (!parentDir.mkdirs()) { + throw "Could not create directory: " + parentDir.getAbsolutePath(); + } + } + + //Java's version of copy file. + srcChannel = new java.io.FileInputStream(srcFileName).getChannel(); + destChannel = new java.io.FileOutputStream(destFileName).getChannel(); + destChannel.transferFrom(srcChannel, 0, srcChannel.size()); + srcChannel.close(); + destChannel.close(); + + return true; //Boolean + }, + + /** + * Renames a file. May fail if "to" already exists or is on another drive. + */ + renameFile: function (from, to) { + return (new java.io.File(from)).renameTo((new java.io.File(to))); + }, + + readFile: function (/*String*/path, /*String?*/encoding) { + //A file read function that can deal with BOMs + encoding = encoding || "utf-8"; + var fileObj = new java.io.File(path), + input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileObj), encoding)), + stringBuffer, line; + try { + stringBuffer = new java.lang.StringBuffer(); + line = input.readLine(); + + // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 + // http://www.unicode.org/faq/utf_bom.html + + // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 + if (line && line.length() && line.charAt(0) === 0xfeff) { + // Eat the BOM, since we've already found the encoding on this file, + // and we plan to concatenating this buffer with others; the BOM should + // only appear at the top of a file. + line = line.substring(1); + } + while (line !== null) { + stringBuffer.append(line); + stringBuffer.append(file.lineSeparator); + line = input.readLine(); + } + //Make sure we return a JavaScript string and not a Java string. + return String(stringBuffer.toString()); //String + } finally { + input.close(); + } + }, + + saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { + //summary: saves a file using UTF-8 encoding. + file.saveFile(fileName, fileContents, "utf-8"); + }, + + saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { + //summary: saves a file. + var outFile = new java.io.File(fileName), outWriter, parentDir, os; + + parentDir = outFile.getAbsoluteFile().getParentFile(); + if (!parentDir.exists()) { + if (!parentDir.mkdirs()) { + throw "Could not create directory: " + parentDir.getAbsolutePath(); + } + } + + if (encoding) { + outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding); + } else { + outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile)); + } + + os = new java.io.BufferedWriter(outWriter); + try { + os.write(fileContents); + } finally { + os.close(); + } + }, + + deleteFile: function (/*String*/fileName) { + //summary: deletes a file or directory if it exists. + var fileObj = new java.io.File(fileName), files, i; + if (fileObj.exists()) { + if (fileObj.isDirectory()) { + files = fileObj.listFiles(); + for (i = 0; i < files.length; i++) { + this.deleteFile(files[i]); + } + } + fileObj["delete"](); + } + } + }; + + return file; +}); + +} +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: true */ +/*global define */ + +define('lang', function () { + 'use strict'; + + var lang = { + backSlashRegExp: /\\/g, + ostring: Object.prototype.toString, + + isArray: Array.isArray || function (it) { + return lang.ostring.call(it) === "[object Array]"; + }, + + isFunction: function(it) { + return lang.ostring.call(it) === "[object Function]"; + }, + + isRegExp: function(it) { + return it && it instanceof RegExp; + }, + + _mixin: function(dest, source, override){ + var name; + for (name in source) { + if(source.hasOwnProperty(name) + && (override || !dest.hasOwnProperty(name))) { + dest[name] = source[name]; + } + } + + return dest; // Object + }, + + /** + * mixin({}, obj1, obj2) is allowed. If the last argument is a boolean, + * then the source objects properties are force copied over to dest. + */ + mixin: function(dest){ + var parameters = Array.prototype.slice.call(arguments), + override, i, l; + + if (!dest) { dest = {}; } + + if (parameters.length > 2 && typeof arguments[parameters.length-1] === 'boolean') { + override = parameters.pop(); + } + + for (i = 1, l = parameters.length; i < l; i++) { + lang._mixin(dest, parameters[i], override); + } + return dest; // Object + }, + + delegate: (function () { + // boodman/crockford delegation w/ cornford optimization + function TMP() {} + return function (obj, props) { + TMP.prototype = obj; + var tmp = new TMP(); + TMP.prototype = null; + if (props) { + lang.mixin(tmp, props); + } + return tmp; // Object + }; + }()) + }; + return lang; +}); + +if(env === 'node') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, console: false */ + +define('node/print', function () { + function print(msg) { + console.log(msg); + } + + return print; +}); + +} + +if(env === 'rhino') { +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false, print: false */ + +define('rhino/print', function () { + return print; +}); + +} +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint nomen: false, strict: false */ +/*global define: false */ + +define('logger', ['env!env/print'], function (print) { + var logger = { + TRACE: 0, + INFO: 1, + WARN: 2, + ERROR: 3, + SILENT: 4, + level: 0, + logPrefix: "", + + logLevel: function( level ) { + this.level = level; + }, + + trace: function (message) { + if (this.level <= this.TRACE) { + this._print(message); + } + }, + + info: function (message) { + if (this.level <= this.INFO) { + this._print(message); + } + }, + + warn: function (message) { + if (this.level <= this.WARN) { + this._print(message); + } + }, + + error: function (message) { + if (this.level <= this.ERROR) { + this._print(message); + } + }, + + _print: function (message) { + this._sysPrint((this.logPrefix ? (this.logPrefix + " ") : "") + message); + }, + + _sysPrint: function (message) { + print(message); + } + }; + + return logger; +}); +//Just a blank file to use when building the optimizer with the optimizer, +//so that the build does not attempt to inline some env modules, +//like Node's fs and path. + +//Just a blank file to use when building the optimizer with the optimizer, +//so that the build does not attempt to inline some env modules, +//like Node's fs and path. + +define('uglifyjs/parse-js', ["require", "exports", "module"], function(require, exports, module) { +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + + This version is suitable for Node.js. With minimal changes (the + exports stuff) it should work on any JS platform. + + This file contains the tokenizer/parser. It is a port to JavaScript + of parse-js [1], a JavaScript parser library written in Common Lisp + by Marijn Haverbeke. Thank you Marijn! + + [1] http://marijn.haverbeke.nl/parse-js/ + + Exported functions: + + - tokenizer(code) -- returns a function. Call the returned + function to fetch the next token. + + - parse(code) -- returns an AST of the given JavaScript code. + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2010 (c) Mihai Bazon + Based on parse-js (http://marijn.haverbeke.nl/parse-js/). + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS†AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +/* -----[ Tokenizer (constants) ]----- */ + +var KEYWORDS = array_to_hash([ + "break", + "case", + "catch", + "const", + "continue", + "default", + "delete", + "do", + "else", + "finally", + "for", + "function", + "if", + "in", + "instanceof", + "new", + "return", + "switch", + "throw", + "try", + "typeof", + "var", + "void", + "while", + "with" +]); + +var RESERVED_WORDS = array_to_hash([ + "abstract", + "boolean", + "byte", + "char", + "class", + "debugger", + "double", + "enum", + "export", + "extends", + "final", + "float", + "goto", + "implements", + "import", + "int", + "interface", + "long", + "native", + "package", + "private", + "protected", + "public", + "short", + "static", + "super", + "synchronized", + "throws", + "transient", + "volatile" +]); + +var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ + "return", + "new", + "delete", + "throw", + "else", + "case" +]); + +var KEYWORDS_ATOM = array_to_hash([ + "false", + "null", + "true", + "undefined" +]); + +var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); + +var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; +var RE_OCT_NUMBER = /^0[0-7]+$/; +var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; + +var OPERATORS = array_to_hash([ + "in", + "instanceof", + "typeof", + "new", + "void", + "delete", + "++", + "--", + "+", + "-", + "!", + "~", + "&", + "|", + "^", + "*", + "/", + "%", + ">>", + "<<", + ">>>", + "<", + ">", + "<=", + ">=", + "==", + "===", + "!=", + "!==", + "?", + "=", + "+=", + "-=", + "/=", + "*=", + "%=", + ">>=", + "<<=", + ">>>=", + "|=", + "^=", + "&=", + "&&", + "||" +]); + +var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); + +var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:")); + +var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); + +var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); + +/* -----[ Tokenizer ]----- */ + +// regexps adapted from http://xregexp.com/plugins/#unicode +var UNICODE = { + letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), + non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), + space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), + connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") +}; + +function is_letter(ch) { + return UNICODE.letter.test(ch); +}; + +function is_digit(ch) { + ch = ch.charCodeAt(0); + return ch >= 48 && ch <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9 +}; + +function is_alphanumeric_char(ch) { + return is_digit(ch) || is_letter(ch); +}; + +function is_unicode_combining_mark(ch) { + return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); +}; + +function is_unicode_connector_punctuation(ch) { + return UNICODE.connector_punctuation.test(ch); +}; + +function is_identifier_start(ch) { + return ch == "$" || ch == "_" || is_letter(ch); +}; + +function is_identifier_char(ch) { + return is_identifier_start(ch) + || is_unicode_combining_mark(ch) + || is_digit(ch) + || is_unicode_connector_punctuation(ch) + || ch == "\u200c" // zero-width non-joiner + || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) + ; +}; + +function parse_js_number(num) { + if (RE_HEX_NUMBER.test(num)) { + return parseInt(num.substr(2), 16); + } else if (RE_OCT_NUMBER.test(num)) { + return parseInt(num.substr(1), 8); + } else if (RE_DEC_NUMBER.test(num)) { + return parseFloat(num); + } +}; + +function JS_Parse_Error(message, line, col, pos) { + this.message = message; + this.line = line + 1; + this.col = col + 1; + this.pos = pos + 1; + this.stack = new Error().stack; +}; + +JS_Parse_Error.prototype.toString = function() { + return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; +}; + +function js_error(message, line, col, pos) { + throw new JS_Parse_Error(message, line, col, pos); +}; + +function is_token(token, type, val) { + return token.type == type && (val == null || token.value == val); +}; + +var EX_EOF = {}; + +function tokenizer($TEXT) { + + var S = { + text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), + pos : 0, + tokpos : 0, + line : 0, + tokline : 0, + col : 0, + tokcol : 0, + newline_before : false, + regex_allowed : false, + comments_before : [] + }; + + function peek() { return S.text.charAt(S.pos); }; + + function next(signal_eof, in_string) { + var ch = S.text.charAt(S.pos++); + if (signal_eof && !ch) + throw EX_EOF; + if (ch == "\n") { + S.newline_before = S.newline_before || !in_string; + ++S.line; + S.col = 0; + } else { + ++S.col; + } + return ch; + }; + + function eof() { + return !S.peek(); + }; + + function find(what, signal_eof) { + var pos = S.text.indexOf(what, S.pos); + if (signal_eof && pos == -1) throw EX_EOF; + return pos; + }; + + function start_token() { + S.tokline = S.line; + S.tokcol = S.col; + S.tokpos = S.pos; + }; + + function token(type, value, is_comment) { + S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || + (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || + (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); + var ret = { + type : type, + value : value, + line : S.tokline, + col : S.tokcol, + pos : S.tokpos, + endpos : S.pos, + nlb : S.newline_before + }; + if (!is_comment) { + ret.comments_before = S.comments_before; + S.comments_before = []; + } + S.newline_before = false; + return ret; + }; + + function skip_whitespace() { + while (HOP(WHITESPACE_CHARS, peek())) + next(); + }; + + function read_while(pred) { + var ret = "", ch = peek(), i = 0; + while (ch && pred(ch, i++)) { + ret += next(); + ch = peek(); + } + return ret; + }; + + function parse_error(err) { + js_error(err, S.tokline, S.tokcol, S.tokpos); + }; + + function read_num(prefix) { + var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; + var num = read_while(function(ch, i){ + if (ch == "x" || ch == "X") { + if (has_x) return false; + return has_x = true; + } + if (!has_x && (ch == "E" || ch == "e")) { + if (has_e) return false; + return has_e = after_e = true; + } + if (ch == "-") { + if (after_e || (i == 0 && !prefix)) return true; + return false; + } + if (ch == "+") return after_e; + after_e = false; + if (ch == ".") { + if (!has_dot && !has_x) + return has_dot = true; + return false; + } + return is_alphanumeric_char(ch); + }); + if (prefix) + num = prefix + num; + var valid = parse_js_number(num); + if (!isNaN(valid)) { + return token("num", valid); + } else { + parse_error("Invalid syntax: " + num); + } + }; + + function read_escaped_char(in_string) { + var ch = next(true, in_string); + switch (ch) { + case "n" : return "\n"; + case "r" : return "\r"; + case "t" : return "\t"; + case "b" : return "\b"; + case "v" : return "\u000b"; + case "f" : return "\f"; + case "0" : return "\0"; + case "x" : return String.fromCharCode(hex_bytes(2)); + case "u" : return String.fromCharCode(hex_bytes(4)); + case "\n": return ""; + default : return ch; + } + }; + + function hex_bytes(n) { + var num = 0; + for (; n > 0; --n) { + var digit = parseInt(next(true), 16); + if (isNaN(digit)) + parse_error("Invalid hex-character pattern in string"); + num = (num << 4) | digit; + } + return num; + }; + + function read_string() { + return with_eof_error("Unterminated string constant", function(){ + var quote = next(), ret = ""; + for (;;) { + var ch = next(true); + if (ch == "\\") { + // read OctalEscapeSequence (XXX: deprecated if "strict mode") + // https://github.com/mishoo/UglifyJS/issues/178 + var octal_len = 0, first = null; + ch = read_while(function(ch){ + if (ch >= "0" && ch <= "7") { + if (!first) { + first = ch; + return ++octal_len; + } + else if (first <= "3" && octal_len <= 2) return ++octal_len; + else if (first >= "4" && octal_len <= 1) return ++octal_len; + } + return false; + }); + if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); + else ch = read_escaped_char(true); + } + else if (ch == quote) break; + ret += ch; + } + return token("string", ret); + }); + }; + + function read_line_comment() { + next(); + var i = find("\n"), ret; + if (i == -1) { + ret = S.text.substr(S.pos); + S.pos = S.text.length; + } else { + ret = S.text.substring(S.pos, i); + S.pos = i; + } + return token("comment1", ret, true); + }; + + function read_multiline_comment() { + next(); + return with_eof_error("Unterminated multiline comment", function(){ + var i = find("*/", true), + text = S.text.substring(S.pos, i); + S.pos = i + 2; + S.line += text.split("\n").length - 1; + S.newline_before = text.indexOf("\n") >= 0; + + // https://github.com/mishoo/UglifyJS/issues/#issue/100 + if (/^@cc_on/i.test(text)) { + warn("WARNING: at line " + S.line); + warn("*** Found \"conditional comment\": " + text); + warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); + } + + return token("comment2", text, true); + }); + }; + + function read_name() { + var backslash = false, name = "", ch; + while ((ch = peek()) != null) { + if (!backslash) { + if (ch == "\\") backslash = true, next(); + else if (is_identifier_char(ch)) name += next(); + else break; + } + else { + if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); + ch = read_escaped_char(); + if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); + name += ch; + backslash = false; + } + } + return name; + }; + + function read_regexp(regexp) { + return with_eof_error("Unterminated regular expression", function(){ + var prev_backslash = false, ch, in_class = false; + while ((ch = next(true))) if (prev_backslash) { + regexp += "\\" + ch; + prev_backslash = false; + } else if (ch == "[") { + in_class = true; + regexp += ch; + } else if (ch == "]" && in_class) { + in_class = false; + regexp += ch; + } else if (ch == "/" && !in_class) { + break; + } else if (ch == "\\") { + prev_backslash = true; + } else { + regexp += ch; + } + var mods = read_name(); + return token("regexp", [ regexp, mods ]); + }); + }; + + function read_operator(prefix) { + function grow(op) { + if (!peek()) return op; + var bigger = op + peek(); + if (HOP(OPERATORS, bigger)) { + next(); + return grow(bigger); + } else { + return op; + } + }; + return token("operator", grow(prefix || next())); + }; + + function handle_slash() { + next(); + var regex_allowed = S.regex_allowed; + switch (peek()) { + case "/": + S.comments_before.push(read_line_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + case "*": + S.comments_before.push(read_multiline_comment()); + S.regex_allowed = regex_allowed; + return next_token(); + } + return S.regex_allowed ? read_regexp("") : read_operator("/"); + }; + + function handle_dot() { + next(); + return is_digit(peek()) + ? read_num(".") + : token("punc", "."); + }; + + function read_word() { + var word = read_name(); + return !HOP(KEYWORDS, word) + ? token("name", word) + : HOP(OPERATORS, word) + ? token("operator", word) + : HOP(KEYWORDS_ATOM, word) + ? token("atom", word) + : token("keyword", word); + }; + + function with_eof_error(eof_error, cont) { + try { + return cont(); + } catch(ex) { + if (ex === EX_EOF) parse_error(eof_error); + else throw ex; + } + }; + + function next_token(force_regexp) { + if (force_regexp != null) + return read_regexp(force_regexp); + skip_whitespace(); + start_token(); + var ch = peek(); + if (!ch) return token("eof"); + if (is_digit(ch)) return read_num(); + if (ch == '"' || ch == "'") return read_string(); + if (HOP(PUNC_CHARS, ch)) return token("punc", next()); + if (ch == ".") return handle_dot(); + if (ch == "/") return handle_slash(); + if (HOP(OPERATOR_CHARS, ch)) return read_operator(); + if (ch == "\\" || is_identifier_start(ch)) return read_word(); + parse_error("Unexpected character '" + ch + "'"); + }; + + next_token.context = function(nc) { + if (nc) S = nc; + return S; + }; + + return next_token; + +}; + +/* -----[ Parser (constants) ]----- */ + +var UNARY_PREFIX = array_to_hash([ + "typeof", + "void", + "delete", + "--", + "++", + "!", + "~", + "-", + "+" +]); + +var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); + +var ASSIGNMENT = (function(a, ret, i){ + while (i < a.length) { + ret[a[i]] = a[i].substr(0, a[i].length - 1); + i++; + } + return ret; +})( + ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], + { "=": true }, + 0 +); + +var PRECEDENCE = (function(a, ret){ + for (var i = 0, n = 1; i < a.length; ++i, ++n) { + var b = a[i]; + for (var j = 0; j < b.length; ++j) { + ret[b[j]] = n; + } + } + return ret; +})( + [ + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"] + ], + {} +); + +var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); + +var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); + +/* -----[ Parser ]----- */ + +function NodeWithToken(str, start, end) { + this.name = str; + this.start = start; + this.end = end; +}; + +NodeWithToken.prototype.toString = function() { return this.name; }; + +function parse($TEXT, exigent_mode, embed_tokens) { + + var S = { + input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, + token : null, + prev : null, + peeked : null, + in_function : 0, + in_loop : 0, + labels : [] + }; + + S.token = next(); + + function is(type, value) { + return is_token(S.token, type, value); + }; + + function peek() { return S.peeked || (S.peeked = S.input()); }; + + function next() { + S.prev = S.token; + if (S.peeked) { + S.token = S.peeked; + S.peeked = null; + } else { + S.token = S.input(); + } + return S.token; + }; + + function prev() { + return S.prev; + }; + + function croak(msg, line, col, pos) { + var ctx = S.input.context(); + js_error(msg, + line != null ? line : ctx.tokline, + col != null ? col : ctx.tokcol, + pos != null ? pos : ctx.tokpos); + }; + + function token_error(token, msg) { + croak(msg, token.line, token.col); + }; + + function unexpected(token) { + if (token == null) + token = S.token; + token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); + }; + + function expect_token(type, val) { + if (is(type, val)) { + return next(); + } + token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); + }; + + function expect(punc) { return expect_token("punc", punc); }; + + function can_insert_semicolon() { + return !exigent_mode && ( + S.token.nlb || is("eof") || is("punc", "}") + ); + }; + + function semicolon() { + if (is("punc", ";")) next(); + else if (!can_insert_semicolon()) unexpected(); + }; + + function as() { + return slice(arguments); + }; + + function parenthesised() { + expect("("); + var ex = expression(); + expect(")"); + return ex; + }; + + function add_tokens(str, start, end) { + return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); + }; + + function maybe_embed_tokens(parser) { + if (embed_tokens) return function() { + var start = S.token; + var ast = parser.apply(this, arguments); + ast[0] = add_tokens(ast[0], start, prev()); + return ast; + }; + else return parser; + }; + + var statement = maybe_embed_tokens(function() { + if (is("operator", "/") || is("operator", "/=")) { + S.peeked = null; + S.token = S.input(S.token.value.substr(1)); // force regexp + } + switch (S.token.type) { + case "num": + case "string": + case "regexp": + case "operator": + case "atom": + return simple_statement(); + + case "name": + return is_token(peek(), "punc", ":") + ? labeled_statement(prog1(S.token.value, next, next)) + : simple_statement(); + + case "punc": + switch (S.token.value) { + case "{": + return as("block", block_()); + case "[": + case "(": + return simple_statement(); + case ";": + next(); + return as("block"); + default: + unexpected(); + } + + case "keyword": + switch (prog1(S.token.value, next)) { + case "break": + return break_cont("break"); + + case "continue": + return break_cont("continue"); + + case "debugger": + semicolon(); + return as("debugger"); + + case "do": + return (function(body){ + expect_token("keyword", "while"); + return as("do", prog1(parenthesised, semicolon), body); + })(in_loop(statement)); + + case "for": + return for_(); + + case "function": + return function_(true); + + case "if": + return if_(); + + case "return": + if (S.in_function == 0) + croak("'return' outside of function"); + return as("return", + is("punc", ";") + ? (next(), null) + : can_insert_semicolon() + ? null + : prog1(expression, semicolon)); + + case "switch": + return as("switch", parenthesised(), switch_block_()); + + case "throw": + if (S.token.nlb) + croak("Illegal newline after 'throw'"); + return as("throw", prog1(expression, semicolon)); + + case "try": + return try_(); + + case "var": + return prog1(var_, semicolon); + + case "const": + return prog1(const_, semicolon); + + case "while": + return as("while", parenthesised(), in_loop(statement)); + + case "with": + return as("with", parenthesised(), statement()); + + default: + unexpected(); + } + } + }); + + function labeled_statement(label) { + S.labels.push(label); + var start = S.token, stat = statement(); + if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) + unexpected(start); + S.labels.pop(); + return as("label", label, stat); + }; + + function simple_statement() { + return as("stat", prog1(expression, semicolon)); + }; + + function break_cont(type) { + var name; + if (!can_insert_semicolon()) { + name = is("name") ? S.token.value : null; + } + if (name != null) { + next(); + if (!member(name, S.labels)) + croak("Label " + name + " without matching loop or statement"); + } + else if (S.in_loop == 0) + croak(type + " not inside a loop or switch"); + semicolon(); + return as(type, name); + }; + + function for_() { + expect("("); + var init = null; + if (!is("punc", ";")) { + init = is("keyword", "var") + ? (next(), var_(true)) + : expression(true, true); + if (is("operator", "in")) + return for_in(init); + } + return regular_for(init); + }; + + function regular_for(init) { + expect(";"); + var test = is("punc", ";") ? null : expression(); + expect(";"); + var step = is("punc", ")") ? null : expression(); + expect(")"); + return as("for", init, test, step, in_loop(statement)); + }; + + function for_in(init) { + var lhs = init[0] == "var" ? as("name", init[1][0]) : init; + next(); + var obj = expression(); + expect(")"); + return as("for-in", init, lhs, obj, in_loop(statement)); + }; + + var function_ = function(in_statement) { + var name = is("name") ? prog1(S.token.value, next) : null; + if (in_statement && !name) + unexpected(); + expect("("); + return as(in_statement ? "defun" : "function", + name, + // arguments + (function(first, a){ + while (!is("punc", ")")) { + if (first) first = false; else expect(","); + if (!is("name")) unexpected(); + a.push(S.token.value); + next(); + } + next(); + return a; + })(true, []), + // body + (function(){ + ++S.in_function; + var loop = S.in_loop; + S.in_loop = 0; + var a = block_(); + --S.in_function; + S.in_loop = loop; + return a; + })()); + }; + + function if_() { + var cond = parenthesised(), body = statement(), belse; + if (is("keyword", "else")) { + next(); + belse = statement(); + } + return as("if", cond, body, belse); + }; + + function block_() { + expect("{"); + var a = []; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + a.push(statement()); + } + next(); + return a; + }; + + var switch_block_ = curry(in_loop, function(){ + expect("{"); + var a = [], cur = null; + while (!is("punc", "}")) { + if (is("eof")) unexpected(); + if (is("keyword", "case")) { + next(); + cur = []; + a.push([ expression(), cur ]); + expect(":"); + } + else if (is("keyword", "default")) { + next(); + expect(":"); + cur = []; + a.push([ null, cur ]); + } + else { + if (!cur) unexpected(); + cur.push(statement()); + } + } + next(); + return a; + }); + + function try_() { + var body = block_(), bcatch, bfinally; + if (is("keyword", "catch")) { + next(); + expect("("); + if (!is("name")) + croak("Name expected"); + var name = S.token.value; + next(); + expect(")"); + bcatch = [ name, block_() ]; + } + if (is("keyword", "finally")) { + next(); + bfinally = block_(); + } + if (!bcatch && !bfinally) + croak("Missing catch/finally blocks"); + return as("try", body, bcatch, bfinally); + }; + + function vardefs(no_in) { + var a = []; + for (;;) { + if (!is("name")) + unexpected(); + var name = S.token.value; + next(); + if (is("operator", "=")) { + next(); + a.push([ name, expression(false, no_in) ]); + } else { + a.push([ name ]); + } + if (!is("punc", ",")) + break; + next(); + } + return a; + }; + + function var_(no_in) { + return as("var", vardefs(no_in)); + }; + + function const_() { + return as("const", vardefs()); + }; + + function new_() { + var newexp = expr_atom(false), args; + if (is("punc", "(")) { + next(); + args = expr_list(")"); + } else { + args = []; + } + return subscripts(as("new", newexp, args), true); + }; + + var expr_atom = maybe_embed_tokens(function(allow_calls) { + if (is("operator", "new")) { + next(); + return new_(); + } + if (is("punc")) { + switch (S.token.value) { + case "(": + next(); + return subscripts(prog1(expression, curry(expect, ")")), allow_calls); + case "[": + next(); + return subscripts(array_(), allow_calls); + case "{": + next(); + return subscripts(object_(), allow_calls); + } + unexpected(); + } + if (is("keyword", "function")) { + next(); + return subscripts(function_(false), allow_calls); + } + if (HOP(ATOMIC_START_TOKEN, S.token.type)) { + var atom = S.token.type == "regexp" + ? as("regexp", S.token.value[0], S.token.value[1]) + : as(S.token.type, S.token.value); + return subscripts(prog1(atom, next), allow_calls); + } + unexpected(); + }); + + function expr_list(closing, allow_trailing_comma, allow_empty) { + var first = true, a = []; + while (!is("punc", closing)) { + if (first) first = false; else expect(","); + if (allow_trailing_comma && is("punc", closing)) break; + if (is("punc", ",") && allow_empty) { + a.push([ "atom", "undefined" ]); + } else { + a.push(expression(false)); + } + } + next(); + return a; + }; + + function array_() { + return as("array", expr_list("]", !exigent_mode, true)); + }; + + function object_() { + var first = true, a = []; + while (!is("punc", "}")) { + if (first) first = false; else expect(","); + if (!exigent_mode && is("punc", "}")) + // allow trailing comma + break; + var type = S.token.type; + var name = as_property_name(); + if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { + a.push([ as_name(), function_(false), name ]); + } else { + expect(":"); + a.push([ name, expression(false) ]); + } + } + next(); + return as("object", a); + }; + + function as_property_name() { + switch (S.token.type) { + case "num": + case "string": + return prog1(S.token.value, next); + } + return as_name(); + }; + + function as_name() { + switch (S.token.type) { + case "name": + case "operator": + case "keyword": + case "atom": + return prog1(S.token.value, next); + default: + unexpected(); + } + }; + + function subscripts(expr, allow_calls) { + if (is("punc", ".")) { + next(); + return subscripts(as("dot", expr, as_name()), allow_calls); + } + if (is("punc", "[")) { + next(); + return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); + } + if (allow_calls && is("punc", "(")) { + next(); + return subscripts(as("call", expr, expr_list(")")), true); + } + return expr; + }; + + function maybe_unary(allow_calls) { + if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { + return make_unary("unary-prefix", + prog1(S.token.value, next), + maybe_unary(allow_calls)); + } + var val = expr_atom(allow_calls); + while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) { + val = make_unary("unary-postfix", S.token.value, val); + next(); + } + return val; + }; + + function make_unary(tag, op, expr) { + if ((op == "++" || op == "--") && !is_assignable(expr)) + croak("Invalid use of " + op + " operator"); + return as(tag, op, expr); + }; + + function expr_op(left, min_prec, no_in) { + var op = is("operator") ? S.token.value : null; + if (op && op == "in" && no_in) op = null; + var prec = op != null ? PRECEDENCE[op] : null; + if (prec != null && prec > min_prec) { + next(); + var right = expr_op(maybe_unary(true), prec, no_in); + return expr_op(as("binary", op, left, right), min_prec, no_in); + } + return left; + }; + + function expr_ops(no_in) { + return expr_op(maybe_unary(true), 0, no_in); + }; + + function maybe_conditional(no_in) { + var expr = expr_ops(no_in); + if (is("operator", "?")) { + next(); + var yes = expression(false); + expect(":"); + return as("conditional", expr, yes, expression(false, no_in)); + } + return expr; + }; + + function is_assignable(expr) { + if (!exigent_mode) return true; + switch (expr[0]+"") { + case "dot": + case "sub": + case "new": + case "call": + return true; + case "name": + return expr[1] != "this"; + } + }; + + function maybe_assign(no_in) { + var left = maybe_conditional(no_in), val = S.token.value; + if (is("operator") && HOP(ASSIGNMENT, val)) { + if (is_assignable(left)) { + next(); + return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); + } + croak("Invalid assignment"); + } + return left; + }; + + var expression = maybe_embed_tokens(function(commas, no_in) { + if (arguments.length == 0) + commas = true; + var expr = maybe_assign(no_in); + if (commas && is("punc", ",")) { + next(); + return as("seq", expr, expression(true, no_in)); + } + return expr; + }); + + function in_loop(cont) { + try { + ++S.in_loop; + return cont(); + } finally { + --S.in_loop; + } + }; + + return as("toplevel", (function(a){ + while (!is("eof")) + a.push(statement()); + return a; + })([])); + +}; + +/* -----[ Utilities ]----- */ + +function curry(f) { + var args = slice(arguments, 1); + return function() { return f.apply(this, args.concat(slice(arguments))); }; +}; + +function prog1(ret) { + if (ret instanceof Function) + ret = ret(); + for (var i = 1, n = arguments.length; --n > 0; ++i) + arguments[i](); + return ret; +}; + +function array_to_hash(a) { + var ret = {}; + for (var i = 0; i < a.length; ++i) + ret[a[i]] = true; + return ret; +}; + +function slice(a, start) { + return Array.prototype.slice.call(a, start || 0); +}; + +function characters(str) { + return str.split(""); +}; + +function member(name, array) { + for (var i = array.length; --i >= 0;) + if (array[i] == name) + return true; + return false; +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +var warn = function() {}; + +/* -----[ Exports ]----- */ + +exports.tokenizer = tokenizer; +exports.parse = parse; +exports.slice = slice; +exports.curry = curry; +exports.member = member; +exports.array_to_hash = array_to_hash; +exports.PRECEDENCE = PRECEDENCE; +exports.KEYWORDS_ATOM = KEYWORDS_ATOM; +exports.RESERVED_WORDS = RESERVED_WORDS; +exports.KEYWORDS = KEYWORDS; +exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; +exports.OPERATORS = OPERATORS; +exports.is_alphanumeric_char = is_alphanumeric_char; +exports.set_logger = function(logger) { + warn = logger; +}; + +}); +define('uglifyjs/squeeze-more', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) { + +var jsp = require("./parse-js"), + pro = require("./process"), + slice = jsp.slice, + member = jsp.member, + curry = jsp.curry, + MAP = pro.MAP, + PRECEDENCE = jsp.PRECEDENCE, + OPERATORS = jsp.OPERATORS; + +function ast_squeeze_more(ast) { + var w = pro.ast_walker(), walk = w.walk, scope; + function with_scope(s, cont) { + var save = scope, ret; + scope = s; + ret = cont(); + scope = save; + return ret; + }; + function _lambda(name, args, body) { + return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ]; + }; + return w.with_walkers({ + "toplevel": function(body) { + return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ]; + }, + "function": _lambda, + "defun": _lambda, + "new": function(ctor, args) { + if (ctor[0] == "name") { + if (ctor[1] == "Array" && !scope.has("Array")) { + if (args.length != 1) { + return [ "array", args ]; + } else { + return walk([ "call", [ "name", "Array" ], args ]); + } + } else if (ctor[1] == "Object" && !scope.has("Object")) { + if (!args.length) { + return [ "object", [] ]; + } else { + return walk([ "call", [ "name", "Object" ], args ]); + } + } else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) { + return walk([ "call", [ "name", ctor[1] ], args]); + } + } + }, + "call": function(expr, args) { + if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) { + // foo.toString() ==> foo+"" + return [ "binary", "+", expr[1], [ "string", "" ]]; + } + if (expr[0] == "name") { + if (expr[1] == "Array" && args.length != 1 && !scope.has("Array")) { + return [ "array", args ]; + } + if (expr[1] == "Object" && !args.length && !scope.has("Object")) { + return [ "object", [] ]; + } + if (expr[1] == "String" && !scope.has("String")) { + return [ "binary", "+", args[0], [ "string", "" ]]; + } + } + } + }, function() { + return walk(pro.ast_add_scope(ast)); + }); +}; + +exports.ast_squeeze_more = ast_squeeze_more; + +});define('uglifyjs/process', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) { + +/*********************************************************************** + + A JavaScript tokenizer / parser / beautifier / compressor. + + This version is suitable for Node.js. With minimal changes (the + exports stuff) it should work on any JS platform. + + This file implements some AST processors. They work on data built + by parse-js. + + Exported functions: + + - ast_mangle(ast, options) -- mangles the variable/function names + in the AST. Returns an AST. + + - ast_squeeze(ast) -- employs various optimizations to make the + final generated code even smaller. Returns an AST. + + - gen_code(ast, options) -- generates JS code from the AST. Pass + true (or an object, see the code for some options) as second + argument to get "pretty" (indented) code. + + -------------------------------- (C) --------------------------------- + + Author: Mihai Bazon + + http://mihai.bazon.net/blog + + Distributed under the BSD license: + + Copyright 2010 (c) Mihai Bazon + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS†AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + ***********************************************************************/ + +var jsp = require("./parse-js"), + slice = jsp.slice, + member = jsp.member, + PRECEDENCE = jsp.PRECEDENCE, + OPERATORS = jsp.OPERATORS; + +/* -----[ helper for AST traversal ]----- */ + +function ast_walker() { + function _vardefs(defs) { + return [ this[0], MAP(defs, function(def){ + var a = [ def[0] ]; + if (def.length > 1) + a[1] = walk(def[1]); + return a; + }) ]; + }; + function _block(statements) { + var out = [ this[0] ]; + if (statements != null) + out.push(MAP(statements, walk)); + return out; + }; + var walkers = { + "string": function(str) { + return [ this[0], str ]; + }, + "num": function(num) { + return [ this[0], num ]; + }, + "name": function(name) { + return [ this[0], name ]; + }, + "toplevel": function(statements) { + return [ this[0], MAP(statements, walk) ]; + }, + "block": _block, + "splice": _block, + "var": _vardefs, + "const": _vardefs, + "try": function(t, c, f) { + return [ + this[0], + MAP(t, walk), + c != null ? [ c[0], MAP(c[1], walk) ] : null, + f != null ? MAP(f, walk) : null + ]; + }, + "throw": function(expr) { + return [ this[0], walk(expr) ]; + }, + "new": function(ctor, args) { + return [ this[0], walk(ctor), MAP(args, walk) ]; + }, + "switch": function(expr, body) { + return [ this[0], walk(expr), MAP(body, function(branch){ + return [ branch[0] ? walk(branch[0]) : null, + MAP(branch[1], walk) ]; + }) ]; + }, + "break": function(label) { + return [ this[0], label ]; + }, + "continue": function(label) { + return [ this[0], label ]; + }, + "conditional": function(cond, t, e) { + return [ this[0], walk(cond), walk(t), walk(e) ]; + }, + "assign": function(op, lvalue, rvalue) { + return [ this[0], op, walk(lvalue), walk(rvalue) ]; + }, + "dot": function(expr) { + return [ this[0], walk(expr) ].concat(slice(arguments, 1)); + }, + "call": function(expr, args) { + return [ this[0], walk(expr), MAP(args, walk) ]; + }, + "function": function(name, args, body) { + return [ this[0], name, args.slice(), MAP(body, walk) ]; + }, + "defun": function(name, args, body) { + return [ this[0], name, args.slice(), MAP(body, walk) ]; + }, + "if": function(conditional, t, e) { + return [ this[0], walk(conditional), walk(t), walk(e) ]; + }, + "for": function(init, cond, step, block) { + return [ this[0], walk(init), walk(cond), walk(step), walk(block) ]; + }, + "for-in": function(vvar, key, hash, block) { + return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ]; + }, + "while": function(cond, block) { + return [ this[0], walk(cond), walk(block) ]; + }, + "do": function(cond, block) { + return [ this[0], walk(cond), walk(block) ]; + }, + "return": function(expr) { + return [ this[0], walk(expr) ]; + }, + "binary": function(op, left, right) { + return [ this[0], op, walk(left), walk(right) ]; + }, + "unary-prefix": function(op, expr) { + return [ this[0], op, walk(expr) ]; + }, + "unary-postfix": function(op, expr) { + return [ this[0], op, walk(expr) ]; + }, + "sub": function(expr, subscript) { + return [ this[0], walk(expr), walk(subscript) ]; + }, + "object": function(props) { + return [ this[0], MAP(props, function(p){ + return p.length == 2 + ? [ p[0], walk(p[1]) ] + : [ p[0], walk(p[1]), p[2] ]; // get/set-ter + }) ]; + }, + "regexp": function(rx, mods) { + return [ this[0], rx, mods ]; + }, + "array": function(elements) { + return [ this[0], MAP(elements, walk) ]; + }, + "stat": function(stat) { + return [ this[0], walk(stat) ]; + }, + "seq": function() { + return [ this[0] ].concat(MAP(slice(arguments), walk)); + }, + "label": function(name, block) { + return [ this[0], name, walk(block) ]; + }, + "with": function(expr, block) { + return [ this[0], walk(expr), walk(block) ]; + }, + "atom": function(name) { + return [ this[0], name ]; + } + }; + + var user = {}; + var stack = []; + function walk(ast) { + if (ast == null) + return null; + try { + stack.push(ast); + var type = ast[0]; + var gen = user[type]; + if (gen) { + var ret = gen.apply(ast, ast.slice(1)); + if (ret != null) + return ret; + } + gen = walkers[type]; + return gen.apply(ast, ast.slice(1)); + } finally { + stack.pop(); + } + }; + + function dive(ast) { + if (ast == null) + return null; + try { + stack.push(ast); + return walkers[ast[0]].apply(ast, ast.slice(1)); + } finally { + stack.pop(); + } + }; + + function with_walkers(walkers, cont){ + var save = {}, i; + for (i in walkers) if (HOP(walkers, i)) { + save[i] = user[i]; + user[i] = walkers[i]; + } + var ret = cont(); + for (i in save) if (HOP(save, i)) { + if (!save[i]) delete user[i]; + else user[i] = save[i]; + } + return ret; + }; + + return { + walk: walk, + dive: dive, + with_walkers: with_walkers, + parent: function() { + return stack[stack.length - 2]; // last one is current node + }, + stack: function() { + return stack; + } + }; +}; + +/* -----[ Scope and mangling ]----- */ + +function Scope(parent) { + this.names = {}; // names defined in this scope + this.mangled = {}; // mangled names (orig.name => mangled) + this.rev_mangled = {}; // reverse lookup (mangled => orig.name) + this.cname = -1; // current mangled name + this.refs = {}; // names referenced from this scope + this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes + this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes + this.parent = parent; // parent scope + this.children = []; // sub-scopes + if (parent) { + this.level = parent.level + 1; + parent.children.push(this); + } else { + this.level = 0; + } +}; + +var base54 = (function(){ + var DIGITS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"; + return function(num) { + var ret = ""; + do { + ret = DIGITS.charAt(num % 54) + ret; + num = Math.floor(num / 54); + } while (num > 0); + return ret; + }; +})(); + +Scope.prototype = { + has: function(name) { + for (var s = this; s; s = s.parent) + if (HOP(s.names, name)) + return s; + }, + has_mangled: function(mname) { + for (var s = this; s; s = s.parent) + if (HOP(s.rev_mangled, mname)) + return s; + }, + toJSON: function() { + return { + names: this.names, + uses_eval: this.uses_eval, + uses_with: this.uses_with + }; + }, + + next_mangled: function() { + // we must be careful that the new mangled name: + // + // 1. doesn't shadow a mangled name from a parent + // scope, unless we don't reference the original + // name from this scope OR from any sub-scopes! + // This will get slow. + // + // 2. doesn't shadow an original name from a parent + // scope, in the event that the name is not mangled + // in the parent scope and we reference that name + // here OR IN ANY SUBSCOPES! + // + // 3. doesn't shadow a name that is referenced but not + // defined (possibly global defined elsewhere). + for (;;) { + var m = base54(++this.cname), prior; + + // case 1. + prior = this.has_mangled(m); + if (prior && this.refs[prior.rev_mangled[m]] === prior) + continue; + + // case 2. + prior = this.has(m); + if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m)) + continue; + + // case 3. + if (HOP(this.refs, m) && this.refs[m] == null) + continue; + + // I got "do" once. :-/ + if (!is_identifier(m)) + continue; + + return m; + } + }, + set_mangle: function(name, m) { + this.rev_mangled[m] = name; + return this.mangled[name] = m; + }, + get_mangled: function(name, newMangle) { + if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use + var s = this.has(name); + if (!s) return name; // not in visible scope, no mangle + if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope + if (!newMangle) return name; // not found and no mangling requested + return s.set_mangle(name, s.next_mangled()); + }, + references: function(name) { + return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name]; + }, + define: function(name, type) { + if (name != null) { + if (type == "var" || !HOP(this.names, name)) + this.names[name] = type || "var"; + return name; + } + } +}; + +function ast_add_scope(ast) { + + var current_scope = null; + var w = ast_walker(), walk = w.walk; + var having_eval = []; + + function with_new_scope(cont) { + current_scope = new Scope(current_scope); + current_scope.labels = new Scope(); + var ret = current_scope.body = cont(); + ret.scope = current_scope; + current_scope = current_scope.parent; + return ret; + }; + + function define(name, type) { + return current_scope.define(name, type); + }; + + function reference(name) { + current_scope.refs[name] = true; + }; + + function _lambda(name, args, body) { + var is_defun = this[0] == "defun"; + return [ this[0], is_defun ? define(name, "defun") : name, args, with_new_scope(function(){ + if (!is_defun) define(name, "lambda"); + MAP(args, function(name){ define(name, "arg") }); + return MAP(body, walk); + })]; + }; + + function _vardefs(type) { + return function(defs) { + MAP(defs, function(d){ + define(d[0], type); + if (d[1]) reference(d[0]); + }); + }; + }; + + function _breacont(label) { + if (label) + current_scope.labels.refs[label] = true; + }; + + return with_new_scope(function(){ + // process AST + var ret = w.with_walkers({ + "function": _lambda, + "defun": _lambda, + "label": function(name, stat) { current_scope.labels.define(name) }, + "break": _breacont, + "continue": _breacont, + "with": function(expr, block) { + for (var s = current_scope; s; s = s.parent) + s.uses_with = true; + }, + "var": _vardefs("var"), + "const": _vardefs("const"), + "try": function(t, c, f) { + if (c != null) return [ + this[0], + MAP(t, walk), + [ define(c[0], "catch"), MAP(c[1], walk) ], + f != null ? MAP(f, walk) : null + ]; + }, + "name": function(name) { + if (name == "eval") + having_eval.push(current_scope); + reference(name); + } + }, function(){ + return walk(ast); + }); + + // the reason why we need an additional pass here is + // that names can be used prior to their definition. + + // scopes where eval was detected and their parents + // are marked with uses_eval, unless they define the + // "eval" name. + MAP(having_eval, function(scope){ + if (!scope.has("eval")) while (scope) { + scope.uses_eval = true; + scope = scope.parent; + } + }); + + // for referenced names it might be useful to know + // their origin scope. current_scope here is the + // toplevel one. + function fixrefs(scope, i) { + // do children first; order shouldn't matter + for (i = scope.children.length; --i >= 0;) + fixrefs(scope.children[i]); + for (i in scope.refs) if (HOP(scope.refs, i)) { + // find origin scope and propagate the reference to origin + for (var origin = scope.has(i), s = scope; s; s = s.parent) { + s.refs[i] = origin; + if (s === origin) break; + } + } + }; + fixrefs(current_scope); + + return ret; + }); + +}; + +/* -----[ mangle names ]----- */ + +function ast_mangle(ast, options) { + var w = ast_walker(), walk = w.walk, scope; + options = options || {}; + + function get_mangled(name, newMangle) { + if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel + if (options.except && member(name, options.except)) + return name; + return scope.get_mangled(name, newMangle); + }; + + function get_define(name) { + if (options.defines) { + // we always lookup a defined symbol for the current scope FIRST, so declared + // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value + if (!scope.has(name)) { + if (HOP(options.defines, name)) { + return options.defines[name]; + } + } + return null; + } + }; + + function _lambda(name, args, body) { + if (!options.no_functions) { + var is_defun = this[0] == "defun", extra; + if (name) { + if (is_defun) name = get_mangled(name); + else if (body.scope.references(name)) { + extra = {}; + if (!(scope.uses_eval || scope.uses_with)) + name = extra[name] = scope.next_mangled(); + else + extra[name] = name; + } + else name = null; + } + } + body = with_scope(body.scope, function(){ + args = MAP(args, function(name){ return get_mangled(name) }); + return MAP(body, walk); + }, extra); + return [ this[0], name, args, body ]; + }; + + function with_scope(s, cont, extra) { + var _scope = scope; + scope = s; + if (extra) for (var i in extra) if (HOP(extra, i)) { + s.set_mangle(i, extra[i]); + } + for (var i in s.names) if (HOP(s.names, i)) { + get_mangled(i, true); + } + var ret = cont(); + ret.scope = s; + scope = _scope; + return ret; + }; + + function _vardefs(defs) { + return [ this[0], MAP(defs, function(d){ + return [ get_mangled(d[0]), walk(d[1]) ]; + }) ]; + }; + + function _breacont(label) { + if (label) return [ this[0], scope.labels.get_mangled(label) ]; + }; + + return w.with_walkers({ + "function": _lambda, + "defun": function() { + // move function declarations to the top when + // they are not in some block. + var ast = _lambda.apply(this, arguments); + switch (w.parent()[0]) { + case "toplevel": + case "function": + case "defun": + return MAP.at_top(ast); + } + return ast; + }, + "label": function(label, stat) { + if (scope.labels.refs[label]) return [ + this[0], + scope.labels.get_mangled(label, true), + walk(stat) + ]; + return walk(stat); + }, + "break": _breacont, + "continue": _breacont, + "var": _vardefs, + "const": _vardefs, + "name": function(name) { + return get_define(name) || [ this[0], get_mangled(name) ]; + }, + "try": function(t, c, f) { + return [ this[0], + MAP(t, walk), + c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null, + f != null ? MAP(f, walk) : null ]; + }, + "toplevel": function(body) { + var self = this; + return with_scope(self.scope, function(){ + return [ self[0], MAP(body, walk) ]; + }); + } + }, function() { + return walk(ast_add_scope(ast)); + }); +}; + +/* -----[ + - compress foo["bar"] into foo.bar, + - remove block brackets {} where possible + - join consecutive var declarations + - various optimizations for IFs: + - if (cond) foo(); else bar(); ==> cond?foo():bar(); + - if (cond) foo(); ==> cond&&foo(); + - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw + - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} + ]----- */ + +var warn = function(){}; + +function best_of(ast1, ast2) { + return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1; +}; + +function last_stat(b) { + if (b[0] == "block" && b[1] && b[1].length > 0) + return b[1][b[1].length - 1]; + return b; +} + +function aborts(t) { + if (t) switch (last_stat(t)[0]) { + case "return": + case "break": + case "continue": + case "throw": + return true; + } +}; + +function boolean_expr(expr) { + return ( (expr[0] == "unary-prefix" + && member(expr[1], [ "!", "delete" ])) || + + (expr[0] == "binary" + && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) || + + (expr[0] == "binary" + && member(expr[1], [ "&&", "||" ]) + && boolean_expr(expr[2]) + && boolean_expr(expr[3])) || + + (expr[0] == "conditional" + && boolean_expr(expr[2]) + && boolean_expr(expr[3])) || + + (expr[0] == "assign" + && expr[1] === true + && boolean_expr(expr[3])) || + + (expr[0] == "seq" + && boolean_expr(expr[expr.length - 1])) + ); +}; + +function empty(b) { + return !b || (b[0] == "block" && (!b[1] || b[1].length == 0)); +}; + +function is_string(node) { + return (node[0] == "string" || + node[0] == "unary-prefix" && node[1] == "typeof" || + node[0] == "binary" && node[1] == "+" && + (is_string(node[2]) || is_string(node[3]))); +}; + +var when_constant = (function(){ + + var $NOT_CONSTANT = {}; + + // this can only evaluate constant expressions. If it finds anything + // not constant, it throws $NOT_CONSTANT. + function evaluate(expr) { + switch (expr[0]) { + case "string": + case "num": + return expr[1]; + case "name": + case "atom": + switch (expr[1]) { + case "true": return true; + case "false": return false; + case "null": return null; + } + break; + case "unary-prefix": + switch (expr[1]) { + case "!": return !evaluate(expr[2]); + case "typeof": return typeof evaluate(expr[2]); + case "~": return ~evaluate(expr[2]); + case "-": return -evaluate(expr[2]); + case "+": return +evaluate(expr[2]); + } + break; + case "binary": + var left = expr[2], right = expr[3]; + switch (expr[1]) { + case "&&" : return evaluate(left) && evaluate(right); + case "||" : return evaluate(left) || evaluate(right); + case "|" : return evaluate(left) | evaluate(right); + case "&" : return evaluate(left) & evaluate(right); + case "^" : return evaluate(left) ^ evaluate(right); + case "+" : return evaluate(left) + evaluate(right); + case "*" : return evaluate(left) * evaluate(right); + case "/" : return evaluate(left) / evaluate(right); + case "%" : return evaluate(left) % evaluate(right); + case "-" : return evaluate(left) - evaluate(right); + case "<<" : return evaluate(left) << evaluate(right); + case ">>" : return evaluate(left) >> evaluate(right); + case ">>>" : return evaluate(left) >>> evaluate(right); + case "==" : return evaluate(left) == evaluate(right); + case "===" : return evaluate(left) === evaluate(right); + case "!=" : return evaluate(left) != evaluate(right); + case "!==" : return evaluate(left) !== evaluate(right); + case "<" : return evaluate(left) < evaluate(right); + case "<=" : return evaluate(left) <= evaluate(right); + case ">" : return evaluate(left) > evaluate(right); + case ">=" : return evaluate(left) >= evaluate(right); + case "in" : return evaluate(left) in evaluate(right); + case "instanceof" : return evaluate(left) instanceof evaluate(right); + } + } + throw $NOT_CONSTANT; + }; + + return function(expr, yes, no) { + try { + var val = evaluate(expr), ast; + switch (typeof val) { + case "string": ast = [ "string", val ]; break; + case "number": ast = [ "num", val ]; break; + case "boolean": ast = [ "name", String(val) ]; break; + default: throw new Error("Can't handle constant of type: " + (typeof val)); + } + return yes.call(expr, ast, val); + } catch(ex) { + if (ex === $NOT_CONSTANT) { + if (expr[0] == "binary" + && (expr[1] == "===" || expr[1] == "!==") + && ((is_string(expr[2]) && is_string(expr[3])) + || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) { + expr[1] = expr[1].substr(0, 2); + } + else if (no && expr[0] == "binary" + && (expr[1] == "||" || expr[1] == "&&")) { + // the whole expression is not constant but the lval may be... + try { + var lval = evaluate(expr[2]); + expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) || + (expr[1] == "||" && (lval ? lval : expr[3])) || + expr); + } catch(ex2) { + // IGNORE... lval is not constant + } + } + return no ? no.call(expr, expr) : null; + } + else throw ex; + } + }; + +})(); + +function warn_unreachable(ast) { + if (!empty(ast)) + warn("Dropping unreachable code: " + gen_code(ast, true)); +}; + +function prepare_ifs(ast) { + var w = ast_walker(), walk = w.walk; + // In this first pass, we rewrite ifs which abort with no else with an + // if-else. For example: + // + // if (x) { + // blah(); + // return y; + // } + // foobar(); + // + // is rewritten into: + // + // if (x) { + // blah(); + // return y; + // } else { + // foobar(); + // } + function redo_if(statements) { + statements = MAP(statements, walk); + + for (var i = 0; i < statements.length; ++i) { + var fi = statements[i]; + if (fi[0] != "if") continue; + + if (fi[3] && walk(fi[3])) continue; + + var t = walk(fi[2]); + if (!aborts(t)) continue; + + var conditional = walk(fi[1]); + + var e_body = statements.slice(i + 1); + var e = e_body.length == 1 ? e_body[0] : [ "block", e_body ]; + + var ret = statements.slice(0, i).concat([ [ + fi[0], // "if" + conditional, // conditional + t, // then + e // else + ] ]); + + return redo_if(ret); + } + + return statements; + }; + + function redo_if_lambda(name, args, body) { + body = redo_if(body); + return [ this[0], name, args, body ]; + }; + + function redo_if_block(statements) { + return [ this[0], statements != null ? redo_if(statements) : null ]; + }; + + return w.with_walkers({ + "defun": redo_if_lambda, + "function": redo_if_lambda, + "block": redo_if_block, + "splice": redo_if_block, + "toplevel": function(statements) { + return [ this[0], redo_if(statements) ]; + }, + "try": function(t, c, f) { + return [ + this[0], + redo_if(t), + c != null ? [ c[0], redo_if(c[1]) ] : null, + f != null ? redo_if(f) : null + ]; + } + }, function() { + return walk(ast); + }); +}; + +function for_side_effects(ast, handler) { + var w = ast_walker(), walk = w.walk; + var $stop = {}, $restart = {}; + function stop() { throw $stop }; + function restart() { throw $restart }; + function found(){ return handler.call(this, this, w, stop, restart) }; + function unary(op) { + if (op == "++" || op == "--") + return found.apply(this, arguments); + }; + return w.with_walkers({ + "try": found, + "throw": found, + "return": found, + "new": found, + "switch": found, + "break": found, + "continue": found, + "assign": found, + "call": found, + "if": found, + "for": found, + "for-in": found, + "while": found, + "do": found, + "return": found, + "unary-prefix": unary, + "unary-postfix": unary, + "defun": found + }, function(){ + while (true) try { + walk(ast); + break; + } catch(ex) { + if (ex === $stop) break; + if (ex === $restart) continue; + throw ex; + } + }); +}; + +function ast_lift_variables(ast) { + var w = ast_walker(), walk = w.walk, scope; + function do_body(body, env) { + var _scope = scope; + scope = env; + body = MAP(body, walk); + var hash = {}, names = MAP(env.names, function(type, name){ + if (type != "var") return MAP.skip; + if (!env.references(name)) return MAP.skip; + hash[name] = true; + return [ name ]; + }); + if (names.length > 0) { + // looking for assignments to any of these variables. + // we can save considerable space by moving the definitions + // in the var declaration. + for_side_effects([ "block", body ], function(ast, walker, stop, restart) { + if (ast[0] == "assign" + && ast[1] === true + && ast[2][0] == "name" + && HOP(hash, ast[2][1])) { + // insert the definition into the var declaration + for (var i = names.length; --i >= 0;) { + if (names[i][0] == ast[2][1]) { + if (names[i][1]) // this name already defined, we must stop + stop(); + names[i][1] = ast[3]; // definition + names.push(names.splice(i, 1)[0]); + break; + } + } + // remove this assignment from the AST. + var p = walker.parent(); + if (p[0] == "seq") { + var a = p[2]; + a.unshift(0, p.length); + p.splice.apply(p, a); + } + else if (p[0] == "stat") { + p.splice(0, p.length, "block"); // empty statement + } + else { + stop(); + } + restart(); + } + stop(); + }); + body.unshift([ "var", names ]); + } + scope = _scope; + return body; + }; + function _vardefs(defs) { + var ret = null; + for (var i = defs.length; --i >= 0;) { + var d = defs[i]; + if (!d[1]) continue; + d = [ "assign", true, [ "name", d[0] ], d[1] ]; + if (ret == null) ret = d; + else ret = [ "seq", d, ret ]; + } + if (ret == null) { + if (w.parent()[0] == "for-in") + return [ "name", defs[0][0] ]; + return MAP.skip; + } + return [ "stat", ret ]; + }; + function _toplevel(body) { + return [ this[0], do_body(body, this.scope) ]; + }; + return w.with_walkers({ + "function": function(name, args, body){ + for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) + args.pop(); + if (!body.scope.references(name)) name = null; + return [ this[0], name, args, do_body(body, body.scope) ]; + }, + "defun": function(name, args, body){ + if (!scope.references(name)) return MAP.skip; + for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) + args.pop(); + return [ this[0], name, args, do_body(body, body.scope) ]; + }, + "var": _vardefs, + "toplevel": _toplevel + }, function(){ + return walk(ast_add_scope(ast)); + }); +}; + +function ast_squeeze(ast, options) { + options = defaults(options, { + make_seqs : true, + dead_code : true, + no_warnings : false, + keep_comps : true + }); + + var w = ast_walker(), walk = w.walk; + + function negate(c) { + var not_c = [ "unary-prefix", "!", c ]; + switch (c[0]) { + case "unary-prefix": + return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c; + case "seq": + c = slice(c); + c[c.length - 1] = negate(c[c.length - 1]); + return c; + case "conditional": + return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]); + case "binary": + var op = c[1], left = c[2], right = c[3]; + if (!options.keep_comps) switch (op) { + case "<=" : return [ "binary", ">", left, right ]; + case "<" : return [ "binary", ">=", left, right ]; + case ">=" : return [ "binary", "<", left, right ]; + case ">" : return [ "binary", "<=", left, right ]; + } + switch (op) { + case "==" : return [ "binary", "!=", left, right ]; + case "!=" : return [ "binary", "==", left, right ]; + case "===" : return [ "binary", "!==", left, right ]; + case "!==" : return [ "binary", "===", left, right ]; + case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]); + case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]); + } + break; + } + return not_c; + }; + + function make_conditional(c, t, e) { + var make_real_conditional = function() { + if (c[0] == "unary-prefix" && c[1] == "!") { + return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ]; + } else { + return e ? best_of( + [ "conditional", c, t, e ], + [ "conditional", negate(c), e, t ] + ) : [ "binary", "&&", c, t ]; + } + }; + // shortcut the conditional if the expression has a constant value + return when_constant(c, function(ast, val){ + warn_unreachable(val ? e : t); + return (val ? t : e); + }, make_real_conditional); + }; + + function rmblock(block) { + if (block != null && block[0] == "block" && block[1]) { + if (block[1].length == 1) + block = block[1][0]; + else if (block[1].length == 0) + block = [ "block" ]; + } + return block; + }; + + function _lambda(name, args, body) { + return [ this[0], name, args, tighten(body, "lambda") ]; + }; + + // this function does a few things: + // 1. discard useless blocks + // 2. join consecutive var declarations + // 3. remove obviously dead code + // 4. transform consecutive statements using the comma operator + // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... } + function tighten(statements, block_type) { + statements = MAP(statements, walk); + + statements = statements.reduce(function(a, stat){ + if (stat[0] == "block") { + if (stat[1]) { + a.push.apply(a, stat[1]); + } + } else { + a.push(stat); + } + return a; + }, []); + + statements = (function(a, prev){ + statements.forEach(function(cur){ + if (prev && ((cur[0] == "var" && prev[0] == "var") || + (cur[0] == "const" && prev[0] == "const"))) { + prev[1] = prev[1].concat(cur[1]); + } else { + a.push(cur); + prev = cur; + } + }); + return a; + })([]); + + if (options.dead_code) statements = (function(a, has_quit){ + statements.forEach(function(st){ + if (has_quit) { + if (st[0] == "function" || st[0] == "defun") { + a.push(st); + } + else if (st[0] == "var" || st[0] == "const") { + if (!options.no_warnings) + warn("Variables declared in unreachable code"); + st[1] = MAP(st[1], function(def){ + if (def[1] && !options.no_warnings) + warn_unreachable([ "assign", true, [ "name", def[0] ], def[1] ]); + return [ def[0] ]; + }); + a.push(st); + } + else if (!options.no_warnings) + warn_unreachable(st); + } + else { + a.push(st); + if (member(st[0], [ "return", "throw", "break", "continue" ])) + has_quit = true; + } + }); + return a; + })([]); + + if (options.make_seqs) statements = (function(a, prev) { + statements.forEach(function(cur){ + if (prev && prev[0] == "stat" && cur[0] == "stat") { + prev[1] = [ "seq", prev[1], cur[1] ]; + } else { + a.push(cur); + prev = cur; + } + }); + if (a.length >= 2 + && a[a.length-2][0] == "stat" + && (a[a.length-1][0] == "return" || a[a.length-1][0] == "throw") + && a[a.length-1][1]) + { + a.splice(a.length - 2, 2, + [ a[a.length-1][0], + [ "seq", a[a.length-2][1], a[a.length-1][1] ]]); + } + return a; + })([]); + + // this increases jQuery by 1K. Probably not such a good idea after all.. + // part of this is done in prepare_ifs anyway. + // if (block_type == "lambda") statements = (function(i, a, stat){ + // while (i < statements.length) { + // stat = statements[i++]; + // if (stat[0] == "if" && !stat[3]) { + // if (stat[2][0] == "return" && stat[2][1] == null) { + // a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ])); + // break; + // } + // var last = last_stat(stat[2]); + // if (last[0] == "return" && last[1] == null) { + // a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ])); + // break; + // } + // } + // a.push(stat); + // } + // return a; + // })(0, []); + + return statements; + }; + + function make_if(c, t, e) { + return when_constant(c, function(ast, val){ + if (val) { + t = walk(t); + warn_unreachable(e); + return t || [ "block" ]; + } else { + e = walk(e); + warn_unreachable(t); + return e || [ "block" ]; + } + }, function() { + return make_real_if(c, t, e); + }); + }; + + function make_real_if(c, t, e) { + c = walk(c); + t = walk(t); + e = walk(e); + + if (empty(t)) { + c = negate(c); + t = e; + e = null; + } else if (empty(e)) { + e = null; + } else { + // if we have both else and then, maybe it makes sense to switch them? + (function(){ + var a = gen_code(c); + var n = negate(c); + var b = gen_code(n); + if (b.length < a.length) { + var tmp = t; + t = e; + e = tmp; + c = n; + } + })(); + } + if (empty(e) && empty(t)) + return [ "stat", c ]; + var ret = [ "if", c, t, e ]; + if (t[0] == "if" && empty(t[3]) && empty(e)) { + ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ])); + } + else if (t[0] == "stat") { + if (e) { + if (e[0] == "stat") { + ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]); + } + } + else { + ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]); + } + } + else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) { + ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]); + } + else if (e && aborts(t)) { + ret = [ [ "if", c, t ] ]; + if (e[0] == "block") { + if (e[1]) ret = ret.concat(e[1]); + } + else { + ret.push(e); + } + ret = walk([ "block", ret ]); + } + else if (t && aborts(e)) { + ret = [ [ "if", negate(c), e ] ]; + if (t[0] == "block") { + if (t[1]) ret = ret.concat(t[1]); + } else { + ret.push(t); + } + ret = walk([ "block", ret ]); + } + return ret; + }; + + function _do_while(cond, body) { + return when_constant(cond, function(cond, val){ + if (!val) { + warn_unreachable(body); + return [ "block" ]; + } else { + return [ "for", null, null, null, walk(body) ]; + } + }); + }; + + return w.with_walkers({ + "sub": function(expr, subscript) { + if (subscript[0] == "string") { + var name = subscript[1]; + if (is_identifier(name)) + return [ "dot", walk(expr), name ]; + else if (/^[1-9][0-9]*$/.test(name) || name === "0") + return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ]; + } + }, + "if": make_if, + "toplevel": function(body) { + return [ "toplevel", tighten(body) ]; + }, + "switch": function(expr, body) { + var last = body.length - 1; + return [ "switch", walk(expr), MAP(body, function(branch, i){ + var block = tighten(branch[1]); + if (i == last && block.length > 0) { + var node = block[block.length - 1]; + if (node[0] == "break" && !node[1]) + block.pop(); + } + return [ branch[0] ? walk(branch[0]) : null, block ]; + }) ]; + }, + "function": _lambda, + "defun": _lambda, + "block": function(body) { + if (body) return rmblock([ "block", tighten(body) ]); + }, + "binary": function(op, left, right) { + return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){ + return best_of(walk(c), this); + }, function no() { + return function(){ + if(op != "==" && op != "!=") return; + var l = walk(left), r = walk(right); + if(l && l[0] == "unary-prefix" && l[1] == "!" && l[2][0] == "num") + left = ['num', +!l[2][1]]; + else if (r && r[0] == "unary-prefix" && r[1] == "!" && r[2][0] == "num") + right = ['num', +!r[2][1]]; + return ["binary", op, left, right]; + }() || this; + }); + }, + "conditional": function(c, t, e) { + return make_conditional(walk(c), walk(t), walk(e)); + }, + "try": function(t, c, f) { + return [ + "try", + tighten(t), + c != null ? [ c[0], tighten(c[1]) ] : null, + f != null ? tighten(f) : null + ]; + }, + "unary-prefix": function(op, expr) { + expr = walk(expr); + var ret = [ "unary-prefix", op, expr ]; + if (op == "!") + ret = best_of(ret, negate(expr)); + return when_constant(ret, function(ast, val){ + return walk(ast); // it's either true or false, so minifies to !0 or !1 + }, function() { return ret }); + }, + "name": function(name) { + switch (name) { + case "true": return [ "unary-prefix", "!", [ "num", 0 ]]; + case "false": return [ "unary-prefix", "!", [ "num", 1 ]]; + } + }, + "while": _do_while, + "assign": function(op, lvalue, rvalue) { + lvalue = walk(lvalue); + rvalue = walk(rvalue); + var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ]; + if (op === true && lvalue[0] === "name" && rvalue[0] === "binary" && + ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === "name" && + rvalue[2][1] === lvalue[1]) { + return [ this[0], rvalue[1], lvalue, rvalue[3] ] + } + return [ this[0], op, lvalue, rvalue ]; + } + }, function() { + for (var i = 0; i < 2; ++i) { + ast = prepare_ifs(ast); + ast = walk(ast); + } + return ast; + }); +}; + +/* -----[ re-generate code from the AST ]----- */ + +var DOT_CALL_NO_PARENS = jsp.array_to_hash([ + "name", + "array", + "object", + "string", + "dot", + "sub", + "call", + "regexp", + "defun" +]); + +function make_string(str, ascii_only) { + var dq = 0, sq = 0; + str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){ + switch (s) { + case "\\": return "\\\\"; + case "\b": return "\\b"; + case "\f": return "\\f"; + case "\n": return "\\n"; + case "\r": return "\\r"; + case "\t": return "\\t"; + case "\u2028": return "\\u2028"; + case "\u2029": return "\\u2029"; + case '"': ++dq; return '"'; + case "'": ++sq; return "'"; + case "\0": return "\\0"; + } + return s; + }); + if (ascii_only) str = to_ascii(str); + if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; + else return '"' + str.replace(/\x22/g, '\\"') + '"'; +}; + +function to_ascii(str) { + return str.replace(/[\u0080-\uffff]/g, function(ch) { + var code = ch.charCodeAt(0).toString(16); + while (code.length < 4) code = "0" + code; + return "\\u" + code; + }); +}; + +var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]); + +function gen_code(ast, options) { + options = defaults(options, { + indent_start : 0, + indent_level : 4, + quote_keys : false, + space_colon : false, + beautify : false, + ascii_only : false, + inline_script: false + }); + var beautify = !!options.beautify; + var indentation = 0, + newline = beautify ? "\n" : "", + space = beautify ? " " : ""; + + function encode_string(str) { + var ret = make_string(str, options.ascii_only); + if (options.inline_script) + ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); + return ret; + }; + + function make_name(name) { + name = name.toString(); + if (options.ascii_only) + name = to_ascii(name); + return name; + }; + + function indent(line) { + if (line == null) + line = ""; + if (beautify) + line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line; + return line; + }; + + function with_indent(cont, incr) { + if (incr == null) incr = 1; + indentation += incr; + try { return cont.apply(null, slice(arguments, 1)); } + finally { indentation -= incr; } + }; + + function add_spaces(a) { + if (beautify) + return a.join(" "); + var b = []; + for (var i = 0; i < a.length; ++i) { + var next = a[i + 1]; + b.push(a[i]); + if (next && + ((/[a-z0-9_\x24]$/i.test(a[i].toString()) && /^[a-z0-9_\x24]/i.test(next.toString())) || + (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString())))) { + b.push(" "); + } + } + return b.join(""); + }; + + function add_commas(a) { + return a.join("," + space); + }; + + function parenthesize(expr) { + var gen = make(expr); + for (var i = 1; i < arguments.length; ++i) { + var el = arguments[i]; + if ((el instanceof Function && el(expr)) || expr[0] == el) + return "(" + gen + ")"; + } + return gen; + }; + + function best_of(a) { + if (a.length == 1) { + return a[0]; + } + if (a.length == 2) { + var b = a[1]; + a = a[0]; + return a.length <= b.length ? a : b; + } + return best_of([ a[0], best_of(a.slice(1)) ]); + }; + + function needs_parens(expr) { + if (expr[0] == "function" || expr[0] == "object") { + // dot/call on a literal function requires the + // function literal itself to be parenthesized + // only if it's the first "thing" in a + // statement. This means that the parent is + // "stat", but it could also be a "seq" and + // we're the first in this "seq" and the + // parent is "stat", and so on. Messy stuff, + // but it worths the trouble. + var a = slice(w.stack()), self = a.pop(), p = a.pop(); + while (p) { + if (p[0] == "stat") return true; + if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) || + ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) { + self = p; + p = a.pop(); + } else { + return false; + } + } + } + return !HOP(DOT_CALL_NO_PARENS, expr[0]); + }; + + function make_num(num) { + var str = num.toString(10), a = [ str.replace(/^0\./, ".") ], m; + if (Math.floor(num) === num) { + if (num >= 0) { + a.push("0x" + num.toString(16).toLowerCase(), // probably pointless + "0" + num.toString(8)); // same. + } else { + a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless + "-0" + (-num).toString(8)); // same. + } + if ((m = /^(.*?)(0+)$/.exec(num))) { + a.push(m[1] + "e" + m[2].length); + } + } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { + a.push(m[2] + "e-" + (m[1].length + m[2].length), + str.substr(str.indexOf("."))); + } + return best_of(a); + }; + + var w = ast_walker(); + var make = w.walk; + return w.with_walkers({ + "string": encode_string, + "num": make_num, + "name": make_name, + "toplevel": function(statements) { + return make_block_statements(statements) + .join(newline + newline); + }, + "splice": function(statements) { + var parent = w.parent(); + if (HOP(SPLICE_NEEDS_BRACKETS, parent)) { + // we need block brackets in this case + return make_block.apply(this, arguments); + } else { + return MAP(make_block_statements(statements, true), + function(line, i) { + // the first line is already indented + return i > 0 ? indent(line) : line; + }).join(newline); + } + }, + "block": make_block, + "var": function(defs) { + return "var " + add_commas(MAP(defs, make_1vardef)) + ";"; + }, + "const": function(defs) { + return "const " + add_commas(MAP(defs, make_1vardef)) + ";"; + }, + "try": function(tr, ca, fi) { + var out = [ "try", make_block(tr) ]; + if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1])); + if (fi) out.push("finally", make_block(fi)); + return add_spaces(out); + }, + "throw": function(expr) { + return add_spaces([ "throw", make(expr) ]) + ";"; + }, + "new": function(ctor, args) { + args = args.length > 0 ? "(" + add_commas(MAP(args, function(expr){ + return parenthesize(expr, "seq"); + })) + ")" : ""; + return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){ + var w = ast_walker(), has_call = {}; + try { + w.with_walkers({ + "call": function() { throw has_call }, + "function": function() { return this } + }, function(){ + w.walk(expr); + }); + } catch(ex) { + if (ex === has_call) + return true; + throw ex; + } + }) + args ]); + }, + "switch": function(expr, body) { + return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]); + }, + "break": function(label) { + var out = "break"; + if (label != null) + out += " " + make_name(label); + return out + ";"; + }, + "continue": function(label) { + var out = "continue"; + if (label != null) + out += " " + make_name(label); + return out + ";"; + }, + "conditional": function(co, th, el) { + return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?", + parenthesize(th, "seq"), ":", + parenthesize(el, "seq") ]); + }, + "assign": function(op, lvalue, rvalue) { + if (op && op !== true) op += "="; + else op = "="; + return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]); + }, + "dot": function(expr) { + var out = make(expr), i = 1; + if (expr[0] == "num") { + if (!/\./.test(expr[1])) + out += "."; + } else if (needs_parens(expr)) + out = "(" + out + ")"; + while (i < arguments.length) + out += "." + make_name(arguments[i++]); + return out; + }, + "call": function(func, args) { + var f = make(func); + if (f.charAt(0) != "(" && needs_parens(func)) + f = "(" + f + ")"; + return f + "(" + add_commas(MAP(args, function(expr){ + return parenthesize(expr, "seq"); + })) + ")"; + }, + "function": make_function, + "defun": make_function, + "if": function(co, th, el) { + var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ]; + if (el) { + out.push("else", make(el)); + } + return add_spaces(out); + }, + "for": function(init, cond, step, block) { + var out = [ "for" ]; + init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space); + cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space); + step = (step != null ? make(step) : "").replace(/;*\s*$/, ""); + var args = init + cond + step; + if (args == "; ; ") args = ";;"; + out.push("(" + args + ")", make(block)); + return add_spaces(out); + }, + "for-in": function(vvar, key, hash, block) { + return add_spaces([ "for", "(" + + (vvar ? make(vvar).replace(/;+$/, "") : make(key)), + "in", + make(hash) + ")", make(block) ]); + }, + "while": function(condition, block) { + return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]); + }, + "do": function(condition, block) { + return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";"; + }, + "return": function(expr) { + var out = [ "return" ]; + if (expr != null) out.push(make(expr)); + return add_spaces(out) + ";"; + }, + "binary": function(operator, lvalue, rvalue) { + var left = make(lvalue), right = make(rvalue); + // XXX: I'm pretty sure other cases will bite here. + // we need to be smarter. + // adding parens all the time is the safest bet. + if (member(lvalue[0], [ "assign", "conditional", "seq" ]) || + lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] || + lvalue[0] == "function" && needs_parens(this)) { + left = "(" + left + ")"; + } + if (member(rvalue[0], [ "assign", "conditional", "seq" ]) || + rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] && + !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) { + right = "(" + right + ")"; + } + else if (!beautify && options.inline_script && (operator == "<" || operator == "<<") + && rvalue[0] == "regexp" && /^script/i.test(rvalue[1])) { + right = " " + right; + } + return add_spaces([ left, operator, right ]); + }, + "unary-prefix": function(operator, expr) { + var val = make(expr); + if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) + val = "(" + val + ")"; + return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val; + }, + "unary-postfix": function(operator, expr) { + var val = make(expr); + if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) + val = "(" + val + ")"; + return val + operator; + }, + "sub": function(expr, subscript) { + var hash = make(expr); + if (needs_parens(expr)) + hash = "(" + hash + ")"; + return hash + "[" + make(subscript) + "]"; + }, + "object": function(props) { + var obj_needs_parens = needs_parens(this); + if (props.length == 0) + return obj_needs_parens ? "({})" : "{}"; + var out = "{" + newline + with_indent(function(){ + return MAP(props, function(p){ + if (p.length == 3) { + // getter/setter. The name is in p[0], the arg.list in p[1][2], the + // body in p[1][3] and type ("get" / "set") in p[2]. + return indent(make_function(p[0], p[1][2], p[1][3], p[2])); + } + var key = p[0], val = parenthesize(p[1], "seq"); + if (options.quote_keys) { + key = encode_string(key); + } else if ((typeof key == "number" || !beautify && +key + "" == key) + && parseFloat(key) >= 0) { + key = make_num(+key); + } else if (!is_identifier(key)) { + key = encode_string(key); + } + return indent(add_spaces(beautify && options.space_colon + ? [ key, ":", val ] + : [ key + ":", val ])); + }).join("," + newline); + }) + newline + indent("}"); + return obj_needs_parens ? "(" + out + ")" : out; + }, + "regexp": function(rx, mods) { + return "/" + rx + "/" + mods; + }, + "array": function(elements) { + if (elements.length == 0) return "[]"; + return add_spaces([ "[", add_commas(MAP(elements, function(el, i){ + if (!beautify && el[0] == "atom" && el[1] == "undefined") return i === elements.length - 1 ? "," : ""; + return parenthesize(el, "seq"); + })), "]" ]); + }, + "stat": function(stmt) { + return make(stmt).replace(/;*\s*$/, ";"); + }, + "seq": function() { + return add_commas(MAP(slice(arguments), make)); + }, + "label": function(name, block) { + return add_spaces([ make_name(name), ":", make(block) ]); + }, + "with": function(expr, block) { + return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]); + }, + "atom": function(name) { + return make_name(name); + } + }, function(){ return make(ast) }); + + // The squeezer replaces "block"-s that contain only a single + // statement with the statement itself; technically, the AST + // is correct, but this can create problems when we output an + // IF having an ELSE clause where the THEN clause ends in an + // IF *without* an ELSE block (then the outer ELSE would refer + // to the inner IF). This function checks for this case and + // adds the block brackets if needed. + function make_then(th) { + if (th == null) return ";"; + if (th[0] == "do") { + // https://github.com/mishoo/UglifyJS/issues/#issue/57 + // IE croaks with "syntax error" on code like this: + // if (foo) do ... while(cond); else ... + // we need block brackets around do/while + return make_block([ th ]); + } + var b = th; + while (true) { + var type = b[0]; + if (type == "if") { + if (!b[3]) + // no else, we must add the block + return make([ "block", [ th ]]); + b = b[3]; + } + else if (type == "while" || type == "do") b = b[2]; + else if (type == "for" || type == "for-in") b = b[4]; + else break; + } + return make(th); + }; + + function make_function(name, args, body, keyword) { + var out = keyword || "function"; + if (name) { + out += " " + make_name(name); + } + out += "(" + add_commas(MAP(args, make_name)) + ")"; + out = add_spaces([ out, make_block(body) ]); + return needs_parens(this) ? "(" + out + ")" : out; + }; + + function must_has_semicolon(node) { + switch (node[0]) { + case "with": + case "while": + return empty(node[2]); // `with' or `while' with empty body? + case "for": + case "for-in": + return empty(node[4]); // `for' with empty body? + case "if": + if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else' + if (node[3]) { + if (empty(node[3])) return true; // `else' present but empty + return must_has_semicolon(node[3]); // dive into the `else' branch + } + return must_has_semicolon(node[2]); // dive into the `then' branch + } + }; + + function make_block_statements(statements, noindent) { + for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) { + var stat = statements[i]; + var code = make(stat); + if (code != ";") { + if (!beautify && i == last && !must_has_semicolon(stat)) { + code = code.replace(/;+\s*$/, ""); + } + a.push(code); + } + } + return noindent ? a : MAP(a, indent); + }; + + function make_switch_block(body) { + var n = body.length; + if (n == 0) return "{}"; + return "{" + newline + MAP(body, function(branch, i){ + var has_body = branch[1].length > 0, code = with_indent(function(){ + return indent(branch[0] + ? add_spaces([ "case", make(branch[0]) + ":" ]) + : "default:"); + }, 0.5) + (has_body ? newline + with_indent(function(){ + return make_block_statements(branch[1]).join(newline); + }) : ""); + if (!beautify && has_body && i < n - 1) + code += ";"; + return code; + }).join(newline) + newline + indent("}"); + }; + + function make_block(statements) { + if (!statements) return ";"; + if (statements.length == 0) return "{}"; + return "{" + newline + with_indent(function(){ + return make_block_statements(statements).join(newline); + }) + newline + indent("}"); + }; + + function make_1vardef(def) { + var name = def[0], val = def[1]; + if (val != null) + name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]); + return name; + }; + +}; + +function split_lines(code, max_line_length) { + var splits = [ 0 ]; + jsp.parse(function(){ + var next_token = jsp.tokenizer(code); + var last_split = 0; + var prev_token; + function current_length(tok) { + return tok.pos - last_split; + }; + function split_here(tok) { + last_split = tok.pos; + splits.push(last_split); + }; + function custom(){ + var tok = next_token.apply(this, arguments); + out: { + if (prev_token) { + if (prev_token.type == "keyword") break out; + } + if (current_length(tok) > max_line_length) { + switch (tok.type) { + case "keyword": + case "atom": + case "name": + case "punc": + split_here(tok); + break out; + } + } + } + prev_token = tok; + return tok; + }; + custom.context = function() { + return next_token.context.apply(this, arguments); + }; + return custom; + }()); + return splits.map(function(pos, i){ + return code.substring(pos, splits[i + 1] || code.length); + }).join("\n"); +}; + +/* -----[ Utilities ]----- */ + +function repeat_string(str, i) { + if (i <= 0) return ""; + if (i == 1) return str; + var d = repeat_string(str, i >> 1); + d += d; + if (i & 1) d += str; + return d; +}; + +function defaults(args, defs) { + var ret = {}; + if (args === true) + args = {}; + for (var i in defs) if (HOP(defs, i)) { + ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; + } + return ret; +}; + +function is_identifier(name) { + return /^[a-z_$][a-z0-9_$]*$/i.test(name) + && name != "this" + && !HOP(jsp.KEYWORDS_ATOM, name) + && !HOP(jsp.RESERVED_WORDS, name) + && !HOP(jsp.KEYWORDS, name); +}; + +function HOP(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +}; + +// some utilities + +var MAP; + +(function(){ + MAP = function(a, f, o) { + var ret = [], top = [], i; + function doit() { + var val = f.call(o, a[i], i); + if (val instanceof AtTop) { + val = val.v; + if (val instanceof Splice) { + top.push.apply(top, val.v); + } else { + top.push(val); + } + } + else if (val != skip) { + if (val instanceof Splice) { + ret.push.apply(ret, val.v); + } else { + ret.push(val); + } + } + }; + if (a instanceof Array) for (i = 0; i < a.length; ++i) doit(); + else for (i in a) if (HOP(a, i)) doit(); + return top.concat(ret); + }; + MAP.at_top = function(val) { return new AtTop(val) }; + MAP.splice = function(val) { return new Splice(val) }; + var skip = MAP.skip = {}; + function AtTop(val) { this.v = val }; + function Splice(val) { this.v = val }; +})(); + +/* -----[ Exports ]----- */ + +exports.ast_walker = ast_walker; +exports.ast_mangle = ast_mangle; +exports.ast_squeeze = ast_squeeze; +exports.ast_lift_variables = ast_lift_variables; +exports.gen_code = gen_code; +exports.ast_add_scope = ast_add_scope; +exports.set_logger = function(logger) { warn = logger }; +exports.make_string = make_string; +exports.split_lines = split_lines; +exports.MAP = MAP; + +// keep this last! +exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more; + +});define('uglifyjs/index', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) { + +//convienence function(src, [options]); +function uglify(orig_code, options){ + options || (options = {}); + var jsp = uglify.parser; + var pro = uglify.uglify; + + var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST + ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names + ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations + var final_code = pro.gen_code(ast, options.gen_options); // compressed code here + return final_code; +}; + +uglify.parser = require("./parse-js"); +uglify.uglify = require("./process"); + +module.exports = uglify + +});/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, strict: false */ +/*global define: false */ + +define('parse', ['./uglifyjs/index'], function (uglify) { + var parser = uglify.parser, + processor = uglify.uglify, + ostring = Object.prototype.toString, + isArray; + + if (Array.isArray) { + isArray = Array.isArray; + } else { + isArray = function (it) { + return ostring.call(it) === "[object Array]"; + }; + } + + /** + * Determines if the AST node is an array literal + */ + function isArrayLiteral(node) { + return node[0] === 'array'; + } + + /** + * Determines if the AST node is an object literal + */ + function isObjectLiteral(node) { + return node[0] === 'object'; + } + + /** + * Converts a regular JS array of strings to an AST node that + * represents that array. + * @param {Array} ary + * @param {Node} an AST node that represents an array of strings. + */ + function toAstArray(ary) { + var output = [ + 'array', + [] + ], + i, item; + + for (i = 0; (item = ary[i]); i++) { + output[1].push([ + 'string', + item + ]); + } + + return output; + } + + /** + * Validates a node as being an object literal (like for i18n bundles) + * or an array literal with just string members. If an array literal, + * only return array members that are full strings. So the caller of + * this function should use the return value as the new value for the + * node. + * + * This function does not need to worry about comments, they are not + * present in this AST. + * + * @param {Node} node an AST node. + * + * @returns {Node} an AST node to use for the valid dependencies. + * If null is returned, then it means the input node was not a valid + * dependency. + */ + function validateDeps(node) { + var newDeps = ['array', []], + arrayArgs, i, dep; + + if (!node) { + return null; + } + + if (isObjectLiteral(node) || node[0] === 'function') { + return node; + } + + //Dependencies can be an object literal or an array. + if (!isArrayLiteral(node)) { + return null; + } + + arrayArgs = node[1]; + + for (i = 0; i < arrayArgs.length; i++) { + dep = arrayArgs[i]; + if (dep[0] === 'string') { + newDeps[1].push(dep); + } + } + return newDeps[1].length ? newDeps : null; + } + + /** + * Gets dependencies from a node, but only if it is an array literal, + * and only if the dependency is a string literal. + * + * This function does not need to worry about comments, they are not + * present in this AST. + * + * @param {Node} node an AST node. + * + * @returns {Array} of valid dependencies. + * If null is returned, then it means the input node was not a valid + * array literal, or did not have any string literals.. + */ + function getValidDeps(node) { + var newDeps = [], + arrayArgs, i, dep; + + if (!node) { + return null; + } + + if (isObjectLiteral(node) || node[0] === 'function') { + return null; + } + + //Dependencies can be an object literal or an array. + if (!isArrayLiteral(node)) { + return null; + } + + arrayArgs = node[1]; + + for (i = 0; i < arrayArgs.length; i++) { + dep = arrayArgs[i]; + if (dep[0] === 'string') { + newDeps.push(dep[1]); + } + } + return newDeps.length ? newDeps : null; + } + + /** + * Main parse function. Returns a string of any valid require or define/require.def + * calls as part of one JavaScript source string. + * @param {String} moduleName the module name that represents this file. + * It is used to create a default define if there is not one already for the file. + * This allows properly tracing dependencies for builds. Otherwise, if + * the file just has a require() call, the file dependencies will not be + * properly reflected: the file will come before its dependencies. + * @param {String} moduleName + * @param {String} fileName + * @param {String} fileContents + * @param {Object} options optional options. insertNeedsDefine: true will + * add calls to require.needsDefine() if appropriate. + * @returns {String} JS source string or null, if no require or define/require.def + * calls are found. + */ + function parse(moduleName, fileName, fileContents, options) { + options = options || {}; + + //Set up source input + var moduleDeps = [], + result = '', + moduleList = [], + needsDefine = true, + astRoot = parser.parse(fileContents), + i, moduleCall, depString; + + parse.recurse(astRoot, function (callName, config, name, deps) { + //If name is an array, it means it is an anonymous module, + //so adjust args appropriately. An anonymous module could + //have a FUNCTION as the name type, but just ignore those + //since we just want to find dependencies. + if (name && isArrayLiteral(name)) { + deps = name; + name = null; + } + + if (!(deps = getValidDeps(deps))) { + deps = []; + } + + //Get the name as a string literal, if it is available. + if (name && name[0] === 'string') { + name = name[1]; + } else { + name = null; + } + + if (callName === 'define' && (!name || name === moduleName)) { + needsDefine = false; + } + + if (!name) { + //If there is no module name, the dependencies are for + //this file/default module name. + moduleDeps = moduleDeps.concat(deps); + } else { + moduleList.push({ + name: name, + deps: deps + }); + } + + //If define was found, no need to dive deeper, unless + //the config explicitly wants to dig deeper. + return !options.findNestedDependencies; + }, options); + + if (options.insertNeedsDefine && needsDefine) { + result += 'require.needsDefine("' + moduleName + '");'; + } + + if (moduleDeps.length || moduleList.length) { + for (i = 0; (moduleCall = moduleList[i]); i++) { + if (result) { + result += '\n'; + } + + //If this is the main module for this file, combine any + //"anonymous" dependencies (could come from a nested require + //call) with this module. + if (moduleCall.name === moduleName) { + moduleCall.deps = moduleCall.deps.concat(moduleDeps); + moduleDeps = []; + } + + depString = moduleCall.deps.length ? '["' + moduleCall.deps.join('","') + '"]' : '[]'; + result += 'define("' + moduleCall.name + '",' + depString + ');'; + } + if (moduleDeps.length) { + if (result) { + result += '\n'; + } + depString = moduleDeps.length ? '["' + moduleDeps.join('","') + '"]' : '[]'; + result += 'define("' + moduleName + '",' + depString + ');'; + } + } + + return result ? result : null; + } + + //Add some private methods to object for use in derived objects. + parse.isArray = isArray; + parse.isObjectLiteral = isObjectLiteral; + parse.isArrayLiteral = isArrayLiteral; + + /** + * Handles parsing a file recursively for require calls. + * @param {Array} parentNode the AST node to start with. + * @param {Function} onMatch function to call on a parse match. + * @param {Object} [options] This is normally the build config options if + * it is passed. + * @param {Function} [recurseCallback] function to call on each valid + * node, defaults to parse.parseNode. + */ + parse.recurse = function (parentNode, onMatch, options, recurseCallback) { + var hasHas = options && options.has, + i, node; + + recurseCallback = recurseCallback || this.parseNode; + + if (isArray(parentNode)) { + for (i = 0; i < parentNode.length; i++) { + node = parentNode[i]; + if (isArray(node)) { + //If has config is in play, if calls have been converted + //by this point to be true/false values. So, if + //options has a 'has' value, skip if branches that have + //literal false values. + + //uglify returns if constructs in an array: + //[0]: 'if' + //[1]: the condition, ['name', true | false] for the has replaced case. + //[2]: the block to process if true + //[3]: the block to process if false + //For if/else if/else, the else if is in the [3], + //so only ever have to deal with this structure. + if (hasHas && node[0] === 'if' && node[1] && node[1][0] === 'name' && + (node[1][1] === 'true' || node[1][1] === 'false')) { + if (node[1][1] === 'true') { + this.recurse([node[2]], onMatch, options, recurseCallback); + } else { + this.recurse([node[3]], onMatch, options, recurseCallback); + } + } else { + if (recurseCallback(node, onMatch)) { + //The onMatch indicated parsing should + //stop for children of this node. + continue; + } + this.recurse(node, onMatch, options, recurseCallback); + } + } + } + } + }; + + /** + * Determines if the file defines require(). + * @param {String} fileName + * @param {String} fileContents + * @returns {Boolean} + */ + parse.definesRequire = function (fileName, fileContents) { + var astRoot = parser.parse(fileContents); + return this.nodeHasRequire(astRoot); + }; + + /** + * Finds require("") calls inside a CommonJS anonymous module wrapped in a + * define(function(require, exports, module){}) wrapper. These dependencies + * will be added to a modified define() call that lists the dependencies + * on the outside of the function. + * @param {String} fileName + * @param {String} fileContents + * @returns {Array} an array of module names that are dependencies. Always + * returns an array, but could be of length zero. + */ + parse.getAnonDeps = function (fileName, fileContents) { + var astRoot = parser.parse(fileContents), + defFunc = this.findAnonDefineFactory(astRoot); + + return parse.getAnonDepsFromNode(defFunc); + }; + + /** + * Finds require("") calls inside a CommonJS anonymous module wrapped + * in a define function, given an AST node for the definition function. + * @param {Node} node the AST node for the definition function. + * @returns {Array} and array of dependency names. Can be of zero length. + */ + parse.getAnonDepsFromNode = function (node) { + var deps = [], + funcArgLength; + + if (node) { + this.findRequireDepNames(node, deps); + + //If no deps, still add the standard CommonJS require, exports, module, + //in that order, to the deps, but only if specified as function args. + //In particular, if exports is used, it is favored over the return + //value of the function, so only add it if asked. + funcArgLength = node[2] && node[2].length; + if (funcArgLength) { + deps = (funcArgLength > 1 ? ["require", "exports", "module"] : + ["require"]).concat(deps); + } + } + return deps; + }; + + /** + * Finds the function in define(function (require, exports, module){}); + * @param {Array} node + * @returns {Boolean} + */ + parse.findAnonDefineFactory = function (node) { + var callback, i, n, call, args; + + if (isArray(node)) { + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + if ((call[0] === 'name' && call[1] === 'define') || + (call[0] === 'dot' && call[1][1] === 'require' && call[2] === 'def')) { + + //There should only be one argument and it should be a function, + //or a named module with function as second arg + if (args.length === 1 && args[0][0] === 'function') { + return args[0]; + } else if (args.length === 2 && args[0][0] === 'string' && + args[1][0] === 'function') { + return args[1]; + } + } + } + + //Check child nodes + for (i = 0; i < node.length; i++) { + n = node[i]; + if ((callback = this.findAnonDefineFactory(n))) { + return callback; + } + } + } + + return null; + }; + + /** + * Finds any config that is passed to requirejs. + * @param {String} fileName + * @param {String} fileContents + * + * @returns {Object} a config object. Will be null if no config. + * Can throw an error if the config in the file cannot be evaluated in + * a build context to valid JavaScript. + */ + parse.findConfig = function (fileName, fileContents) { + /*jslint evil: true */ + //This is a litle bit inefficient, it ends up with two uglifyjs parser + //calls. Can revisit later, but trying to build out larger functional + //pieces first. + var foundConfig = null, + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (configNode) { + var jsConfig; + + if (!foundConfig && configNode) { + jsConfig = parse.nodeToString(configNode); + foundConfig = eval('(' + jsConfig + ')'); + return foundConfig; + } + return undefined; + }, null, parse.parseConfigNode); + + return foundConfig; + }; + + /** + * Finds all dependencies specified in dependency arrays and inside + * simplified commonjs wrappers. + * @param {String} fileName + * @param {String} fileContents + * + * @returns {Array} an array of dependency strings. The dependencies + * have not been normalized, they may be relative IDs. + */ + parse.findDependencies = function (fileName, fileContents, options) { + //This is a litle bit inefficient, it ends up with two uglifyjs parser + //calls. Can revisit later, but trying to build out larger functional + //pieces first. + var dependencies = [], + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (callName, config, name, deps) { + //Normalize the input args. + if (name && isArrayLiteral(name)) { + deps = name; + name = null; + } + + if ((deps = getValidDeps(deps))) { + dependencies = dependencies.concat(deps); + } + }, options); + + return dependencies; + }; + + /** + * Finds only CJS dependencies, ones that are the form require('stringLiteral') + */ + parse.findCjsDependencies = function (fileName, fileContents, options) { + //This is a litle bit inefficient, it ends up with two uglifyjs parser + //calls. Can revisit later, but trying to build out larger functional + //pieces first. + var dependencies = [], + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (dep) { + dependencies.push(dep); + }, options, function (node, onMatch) { + + var call, args; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + //A require('') use. + if (call[0] === 'name' && call[1] === 'require' && + args[0][0] === 'string') { + return onMatch(args[0][1]); + } + } + } + + return false; + + }); + + return dependencies; + }; + + /** + * Determines if define(), require({}|[]) or requirejs was called in the + * file. Also finds out if define() is declared and if define.amd is called. + */ + parse.usesAmdOrRequireJs = function (fileName, fileContents, options) { + var astRoot = parser.parse(fileContents), + uses; + + parse.recurse(astRoot, function (prop) { + if (!uses) { + uses = {}; + } + uses[prop] = true; + }, options, parse.findAmdOrRequireJsNode); + + return uses; + }; + + /** + * Determines if require(''), exports.x =, module.exports =, + * __dirname, __filename are used. So, not strictly traditional CommonJS, + * also checks for Node variants. + */ + parse.usesCommonJs = function (fileName, fileContents, options) { + var uses = null, + assignsExports = false, + astRoot = parser.parse(fileContents); + + parse.recurse(astRoot, function (prop) { + if (prop === 'varExports') { + assignsExports = true; + } else if (prop !== 'exports' || !assignsExports) { + if (!uses) { + uses = {}; + } + uses[prop] = true; + } + }, options, function (node, onMatch) { + + var call, args; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'name' && (node[1] === '__dirname' || node[1] === '__filename')) { + return onMatch(node[1].substring(2)); + } else if (node[0] === 'var' && node[1] && node[1][0] && node[1][0][0] === 'exports') { + //Hmm, a variable assignment for exports, so does not use cjs exports. + return onMatch('varExports'); + } else if (node[0] === 'assign' && node[2] && node[2][0] === 'dot') { + args = node[2][1]; + + if (args) { + //An exports or module.exports assignment. + if (args[0] === 'name' && args[1] === 'module' && + node[2][2] === 'exports') { + return onMatch('moduleExports'); + } else if (args[0] === 'name' && args[1] === 'exports') { + return onMatch('exports'); + } + } + } else if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + //A require('') use. + if (call[0] === 'name' && call[1] === 'require' && + args[0][0] === 'string') { + return onMatch('require'); + } + } + } + + return false; + + }); + + return uses; + }; + + + parse.findRequireDepNames = function (node, deps) { + var moduleName, i, n, call, args; + + if (isArray(node)) { + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call && call[0] === 'name' && call[1] === 'require') { + moduleName = args[0]; + if (moduleName[0] === 'string') { + deps.push(moduleName[1]); + } + } + + + } + + //Check child nodes + for (i = 0; i < node.length; i++) { + n = node[i]; + this.findRequireDepNames(n, deps); + } + } + }; + + /** + * Determines if a given node contains a require() definition. + * @param {Array} node + * @returns {Boolean} + */ + parse.nodeHasRequire = function (node) { + if (this.isDefineNode(node)) { + return true; + } + + if (isArray(node)) { + for (var i = 0, n; i < node.length; i++) { + n = node[i]; + if (this.nodeHasRequire(n)) { + return true; + } + } + } + + return false; + }; + + /** + * Is the given node the actual definition of define(). Actually uses + * the definition of define.amd to find require. + * @param {Array} node + * @returns {Boolean} + */ + parse.isDefineNode = function (node) { + //Actually look for the define.amd = assignment, since + //that is more indicative of RequireJS vs a plain require definition. + var assign; + if (!node) { + return null; + } + + if (node[0] === 'assign' && node[1] === true) { + assign = node[2]; + if (assign[0] === 'dot' && assign[1][0] === 'name' && + assign[1][1] === 'define' && assign[2] === 'amd') { + return true; + } + } + return false; + }; + + /** + * Determines if a specific node is a valid require or define/require.def call. + * @param {Array} node + * @param {Function} onMatch a function to call when a match is found. + * It is passed the match name, and the config, name, deps possible args. + * The config, name and deps args are not normalized. + * + * @returns {String} a JS source string with the valid require/define call. + * Otherwise null. + */ + parse.parseNode = function (node, onMatch) { + var call, name, config, deps, args, cjsDeps; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + if (call[0] === 'name' && + (call[1] === 'require' || call[1] === 'requirejs')) { + + //It is a plain require() call. + config = args[0]; + deps = args[1]; + if (isArrayLiteral(config)) { + deps = config; + config = null; + } + + if (!(deps = validateDeps(deps))) { + return null; + } + + return onMatch("require", null, null, deps); + + } else if (call[0] === 'name' && call[1] === 'define') { + + //A define call + name = args[0]; + deps = args[1]; + //Only allow define calls that match what is expected + //in an AMD call: + //* first arg should be string, array, function or object + //* second arg optional, or array, function or object. + //This helps weed out calls to a non-AMD define, but it is + //not completely robust. Someone could create a define + //function that still matches this shape, but this is the + //best that is possible, and at least allows UglifyJS, + //which does create its own internal define in one file, + //to be inlined. + if (((name[0] === 'string' || isArrayLiteral(name) || + name[0] === 'function' || isObjectLiteral(name))) && + (!deps || isArrayLiteral(deps) || + deps[0] === 'function' || isObjectLiteral(deps) || + // allow define(['dep'], factory) pattern + (isArrayLiteral(name) && deps[0] === 'name' && args.length === 2))) { + + //If first arg is a function, could be a commonjs wrapper, + //look inside for commonjs dependencies. + //Also, if deps is a function look for commonjs deps. + if (name && name[0] === 'function') { + cjsDeps = parse.getAnonDepsFromNode(name); + if (cjsDeps.length) { + name = toAstArray(cjsDeps); + } + } else if (deps && deps[0] === 'function') { + cjsDeps = parse.getAnonDepsFromNode(deps); + if (cjsDeps.length) { + deps = toAstArray(cjsDeps); + } + } + + return onMatch("define", null, name, deps); + } + } + } + } + + return false; + }; + + /** + * Looks for define(), require({} || []), requirejs({} || []) calls. + */ + parse.findAmdOrRequireJsNode = function (node, onMatch) { + var call, args, configNode, type; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'defun' && node[1] === 'define') { + type = 'declaresDefine'; + } else if (node[0] === 'assign' && node[2] && node[2][2] === 'amd' && + node[2][1] && node[2][1][0] === 'name' && + node[2][1][1] === 'define') { + type = 'defineAmd'; + } else if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + if ((call[0] === 'dot' && + (call[1] && call[1][0] === 'name' && + (call[1][1] === 'require' || call[1][1] === 'requirejs')) && + call[2] === 'config')) { + //A require.config() or requirejs.config() call. + type = call[1][1] + 'Config'; + } else if (call[0] === 'name' && + (call[1] === 'require' || call[1] === 'requirejs')) { + //A require() or requirejs() config call. + //Only want ones that start with an object or an array. + configNode = args[0]; + if (configNode[0] === 'object' || configNode[0] === 'array') { + type = call[1]; + } + } else if (call[0] === 'name' && call[1] === 'define') { + //A define call. + type = 'define'; + } + } + } + + if (type) { + return onMatch(type); + } + + return false; + }; + + /** + * Determines if a specific node is a valid require/requirejs config + * call. That includes calls to require/requirejs.config(). + * @param {Array} node + * @param {Function} onMatch a function to call when a match is found. + * It is passed the match name, and the config, name, deps possible args. + * The config, name and deps args are not normalized. + * + * @returns {String} a JS source string with the valid require/define call. + * Otherwise null. + */ + parse.parseConfigNode = function (node, onMatch) { + var call, configNode, args; + + if (!isArray(node)) { + return false; + } + + if (node[0] === 'call') { + call = node[1]; + args = node[2]; + + if (call) { + //A require.config() or requirejs.config() call. + if ((call[0] === 'dot' && + (call[1] && call[1][0] === 'name' && + (call[1][1] === 'require' || call[1][1] === 'requirejs')) && + call[2] === 'config') || + //A require() or requirejs() config call. + + (call[0] === 'name' && + (call[1] === 'require' || call[1] === 'requirejs')) + ) { + //It is a plain require() call. + configNode = args[0]; + + if (configNode[0] !== 'object') { + return null; + } + + return onMatch(configNode); + + } + } + } + + return false; + }; + + /** + * Converts an AST node into a JS source string. Does not maintain formatting + * or even comments from original source, just returns valid JS source. + * @param {Array} node + * @returns {String} a JS source string. + */ + parse.nodeToString = function (node) { + return processor.gen_code(node, true); + }; + + return parse; +}); +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint regexp: false, strict: false, plusplus: false */ +/*global define: false */ + +define('pragma', ['parse', 'logger'], function (parse, logger) { + + function Temp() {} + + function create(obj, mixin) { + Temp.prototype = obj; + var temp = new Temp(), prop; + + //Avoid any extra memory hanging around + Temp.prototype = null; + + if (mixin) { + for (prop in mixin) { + if (mixin.hasOwnProperty(prop) && !(prop in temp)) { + temp[prop] = mixin[prop]; + } + } + } + + return temp; // Object + } + + var pragma = { + conditionalRegExp: /(exclude|include)Start\s*\(\s*["'](\w+)["']\s*,(.*)\)/, + useStrictRegExp: /['"]use strict['"];/g, + hasRegExp: /has\s*\(\s*['"]([^'"]+)['"]\s*\)/g, + nsRegExp: /(^|[^\.])(requirejs|require|define)\s*\(/, + nsWrapRegExp: /\/\*requirejs namespace: true \*\//, + apiDefRegExp: /var requirejs, require, define;/, + defineCheckRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd/g, + defineJQueryRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd\s*&&\s*define\s*\.\s*amd\s*\.\s*jQuery/g, + defineHasRegExp: /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g, + defineTernaryRegExp: /typeof\s+define\s*===\s*['"]function["']\s*&&\s*define\s*\.\s*amd\s*\?\s*define/, + amdefineRegExp: /if\s*\(\s*typeof define\s*\!==\s*'function'\s*\)\s*\{\s*[^\{\}]+amdefine[^\{\}]+\}/g, + + removeStrict: function (contents, config) { + return config.useStrict ? contents : contents.replace(pragma.useStrictRegExp, ''); + }, + + namespace: function (fileContents, ns, onLifecycleName) { + if (ns) { + //Namespace require/define calls + fileContents = fileContents.replace(pragma.nsRegExp, '$1' + ns + '.$2('); + + //Namespace define ternary use: + fileContents = fileContents.replace(pragma.defineTernaryRegExp, + "typeof " + ns + ".define === 'function' && " + ns + ".define.amd ? " + ns + ".define"); + + //Namespace define jquery use: + fileContents = fileContents.replace(pragma.defineJQueryRegExp, + "typeof " + ns + ".define === 'function' && " + ns + ".define.amd && " + ns + ".define.amd.jQuery"); + + //Namespace has.js define use: + fileContents = fileContents.replace(pragma.defineHasRegExp, + "typeof " + ns + ".define === 'function' && typeof " + ns + ".define.amd === 'object' && " + ns + ".define.amd"); + + //Namespace define checks. + //Do this one last, since it is a subset of the more specific + //checks above. + fileContents = fileContents.replace(pragma.defineCheckRegExp, + "typeof " + ns + ".define === 'function' && " + ns + ".define.amd"); + + //Check for require.js with the require/define definitions + if (pragma.apiDefRegExp.test(fileContents) && + fileContents.indexOf("if (typeof " + ns + " === 'undefined')") === -1) { + //Wrap the file contents in a typeof check, and a function + //to contain the API globals. + fileContents = "var " + ns + ";(function () { if (typeof " + + ns + " === 'undefined') {\n" + + ns + ' = {};\n' + + fileContents + + "\n" + + ns + ".requirejs = requirejs;" + + ns + ".require = require;" + + ns + ".define = define;\n" + + "}\n}());"; + } + + //Finally, if the file wants a special wrapper because it ties + //in to the requirejs internals in a way that would not fit + //the above matches, do that. Look for /*requirejs namespace: true*/ + if (pragma.nsWrapRegExp.test(fileContents)) { + //Remove the pragma. + fileContents = fileContents.replace(pragma.nsWrapRegExp, ''); + + //Alter the contents. + fileContents = '(function () {\n' + + 'var require = ' + ns + '.require,' + + 'requirejs = ' + ns + '.requirejs,' + + 'define = ' + ns + '.define;\n' + + fileContents + + '\n}());' + } + } + + return fileContents; + }, + + /** + * processes the fileContents for some //>> conditional statements + */ + process: function (fileName, fileContents, config, onLifecycleName, pluginCollector) { + /*jslint evil: true */ + var foundIndex = -1, startIndex = 0, lineEndIndex, conditionLine, + matches, type, marker, condition, isTrue, endRegExp, endMatches, + endMarkerIndex, shouldInclude, startLength, lifecycleHas, deps, + i, dep, moduleName, + lifecyclePragmas, pragmas = config.pragmas, hasConfig = config.has, + //Legacy arg defined to help in dojo conversion script. Remove later + //when dojo no longer needs conversion: + kwArgs = pragmas; + + //Mix in a specific lifecycle scoped object, to allow targeting + //some pragmas/has tests to only when files are saved, or at different + //lifecycle events. Do not bother with kwArgs in this section, since + //the old dojo kwArgs were for all points in the build lifecycle. + if (onLifecycleName) { + lifecyclePragmas = config['pragmas' + onLifecycleName]; + lifecycleHas = config['has' + onLifecycleName]; + + if (lifecyclePragmas) { + pragmas = create(pragmas || {}, lifecyclePragmas); + } + + if (lifecycleHas) { + hasConfig = create(hasConfig || {}, lifecycleHas); + } + } + + //Replace has references if desired + if (hasConfig) { + fileContents = fileContents.replace(pragma.hasRegExp, function (match, test) { + if (test in hasConfig) { + return !!hasConfig[test]; + } + return match; + }); + } + + if (!config.skipPragmas) { + + while ((foundIndex = fileContents.indexOf("//>>", startIndex)) !== -1) { + //Found a conditional. Get the conditional line. + lineEndIndex = fileContents.indexOf("\n", foundIndex); + if (lineEndIndex === -1) { + lineEndIndex = fileContents.length - 1; + } + + //Increment startIndex past the line so the next conditional search can be done. + startIndex = lineEndIndex + 1; + + //Break apart the conditional. + conditionLine = fileContents.substring(foundIndex, lineEndIndex + 1); + matches = conditionLine.match(pragma.conditionalRegExp); + if (matches) { + type = matches[1]; + marker = matches[2]; + condition = matches[3]; + isTrue = false; + //See if the condition is true. + try { + isTrue = !!eval("(" + condition + ")"); + } catch (e) { + throw "Error in file: " + + fileName + + ". Conditional comment: " + + conditionLine + + " failed with this error: " + e; + } + + //Find the endpoint marker. + endRegExp = new RegExp('\\/\\/\\>\\>\\s*' + type + 'End\\(\\s*[\'"]' + marker + '[\'"]\\s*\\)', "g"); + endMatches = endRegExp.exec(fileContents.substring(startIndex, fileContents.length)); + if (endMatches) { + endMarkerIndex = startIndex + endRegExp.lastIndex - endMatches[0].length; + + //Find the next line return based on the match position. + lineEndIndex = fileContents.indexOf("\n", endMarkerIndex); + if (lineEndIndex === -1) { + lineEndIndex = fileContents.length - 1; + } + + //Should we include the segment? + shouldInclude = ((type === "exclude" && !isTrue) || (type === "include" && isTrue)); + + //Remove the conditional comments, and optionally remove the content inside + //the conditional comments. + startLength = startIndex - foundIndex; + fileContents = fileContents.substring(0, foundIndex) + + (shouldInclude ? fileContents.substring(startIndex, endMarkerIndex) : "") + + fileContents.substring(lineEndIndex + 1, fileContents.length); + + //Move startIndex to foundIndex, since that is the new position in the file + //where we need to look for more conditionals in the next while loop pass. + startIndex = foundIndex; + } else { + throw "Error in file: " + + fileName + + ". Cannot find end marker for conditional comment: " + + conditionLine; + + } + } + } + } + + //If need to find all plugin resources to optimize, do that now, + //before namespacing, since the namespacing will change the API + //names. + //If there is a plugin collector, scan the file for plugin resources. + if (config.optimizeAllPluginResources && pluginCollector) { + try { + deps = parse.findDependencies(fileName, fileContents); + if (deps.length) { + for (i = 0; (dep = deps[i]); i++) { + if (dep.indexOf('!') !== -1) { + (pluginCollector[moduleName] || + (pluginCollector[moduleName] = [])).push(dep); + } + } + } + } catch (eDep) { + logger.error('Parse error looking for plugin resources in ' + + fileName + ', skipping.'); + } + } + + //Strip amdefine use for node-shared modules. + fileContents = fileContents.replace(pragma.amdefineRegExp, ''); + + //Do namespacing + if (onLifecycleName === 'OnSave' && config.namespace) { + fileContents = pragma.namespace(fileContents, config.namespace, onLifecycleName); + } + + + return pragma.removeStrict(fileContents, config); + } + }; + + return pragma; +}); +if(env === 'node') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false */ +/*global define: false */ + +define('node/optimize', {}); + +} + +if(env === 'rhino') { +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint strict: false, plusplus: false */ +/*global define: false, java: false, Packages: false */ + +define('rhino/optimize', ['logger'], function (logger) { + + //Add .reduce to Rhino so UglifyJS can run in Rhino, + //inspired by https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce + //but rewritten for brevity, and to be good enough for use by UglifyJS. + if (!Array.prototype.reduce) { + Array.prototype.reduce = function (fn /*, initialValue */) { + var i = 0, + length = this.length, + accumulator; + + if (arguments.length >= 2) { + accumulator = arguments[1]; + } else { + do { + if (i in this) { + accumulator = this[i++]; + break; + } + } + while (true); + } + + for (; i < length; i++) { + if (i in this) { + accumulator = fn.call(undefined, accumulator, this[i], i, this); + } + } + + return accumulator; + }; + } + + var JSSourceFilefromCode, optimize; + + //Bind to Closure compiler, but if it is not available, do not sweat it. + try { + JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.JSSourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]); + } catch (e) {} + + //Helper for closure compiler, because of weird Java-JavaScript interactions. + function closurefromCode(filename, content) { + return JSSourceFilefromCode.invoke(null, [filename, content]); + } + + optimize = { + closure: function (fileName, fileContents, keepLines, config) { + config = config || {}; + var jscomp = Packages.com.google.javascript.jscomp, + flags = Packages.com.google.common.flags, + //Fake extern + externSourceFile = closurefromCode("fakeextern.js", " "), + //Set up source input + jsSourceFile = closurefromCode(String(fileName), String(fileContents)), + options, option, FLAG_compilation_level, compiler, + Compiler = Packages.com.google.javascript.jscomp.Compiler, + result; + + logger.trace("Minifying file: " + fileName); + + //Set up options + options = new jscomp.CompilerOptions(); + for (option in config.CompilerOptions) { + // options are false by default and jslint wanted an if statement in this for loop + if (config.CompilerOptions[option]) { + options[option] = config.CompilerOptions[option]; + } + + } + options.prettyPrint = keepLines || options.prettyPrint; + + FLAG_compilation_level = jscomp.CompilationLevel[config.CompilationLevel || 'SIMPLE_OPTIMIZATIONS']; + FLAG_compilation_level.setOptionsForCompilationLevel(options); + + //Trigger the compiler + Compiler.setLoggingLevel(Packages.java.util.logging.Level[config.loggingLevel || 'WARNING']); + compiler = new Compiler(); + + result = compiler.compile(externSourceFile, jsSourceFile, options); + if (!result.success) { + logger.error('Cannot closure compile file: ' + fileName + '. Skipping it.'); + } else { + fileContents = compiler.toSource(); + } + + return fileContents; + } + }; + + return optimize; +}); +} +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, nomen: false, regexp: false */ +/*global define: false */ + +define('optimize', [ 'lang', 'logger', 'env!env/optimize', 'env!env/file', 'parse', + 'pragma', 'uglifyjs/index'], +function (lang, logger, envOptimize, file, parse, + pragma, uglify) { + + var optimize, + cssImportRegExp = /\@import\s+(url\()?\s*([^);]+)\s*(\))?([\w, ]*)(;)?/g, + cssUrlRegExp = /\url\(\s*([^\)]+)\s*\)?/g; + + /** + * If an URL from a CSS url value contains start/end quotes, remove them. + * This is not done in the regexp, since my regexp fu is not that strong, + * and the CSS spec allows for ' and " in the URL if they are backslash escaped. + * @param {String} url + */ + function cleanCssUrlQuotes(url) { + //Make sure we are not ending in whitespace. + //Not very confident of the css regexps above that there will not be ending + //whitespace. + url = url.replace(/\s+$/, ""); + + if (url.charAt(0) === "'" || url.charAt(0) === "\"") { + url = url.substring(1, url.length - 1); + } + + return url; + } + + /** + * Inlines nested stylesheets that have @import calls in them. + * @param {String} fileName + * @param {String} fileContents + * @param {String} [cssImportIgnore] + */ + function flattenCss(fileName, fileContents, cssImportIgnore) { + //Find the last slash in the name. + fileName = fileName.replace(lang.backSlashRegExp, "/"); + var endIndex = fileName.lastIndexOf("/"), + //Make a file path based on the last slash. + //If no slash, so must be just a file name. Use empty string then. + filePath = (endIndex !== -1) ? fileName.substring(0, endIndex + 1) : ""; + + //Make sure we have a delimited ignore list to make matching faster + if (cssImportIgnore && cssImportIgnore.charAt(cssImportIgnore.length - 1) !== ",") { + cssImportIgnore += ","; + } + + return fileContents.replace(cssImportRegExp, function (fullMatch, urlStart, importFileName, urlEnd, mediaTypes) { + //Only process media type "all" or empty media type rules. + if (mediaTypes && ((mediaTypes.replace(/^\s\s*/, '').replace(/\s\s*$/, '')) !== "all")) { + return fullMatch; + } + + importFileName = cleanCssUrlQuotes(importFileName); + + //Ignore the file import if it is part of an ignore list. + if (cssImportIgnore && cssImportIgnore.indexOf(importFileName + ",") !== -1) { + return fullMatch; + } + + //Make sure we have a unix path for the rest of the operation. + importFileName = importFileName.replace(lang.backSlashRegExp, "/"); + + try { + //if a relative path, then tack on the filePath. + //If it is not a relative path, then the readFile below will fail, + //and we will just skip that import. + var fullImportFileName = importFileName.charAt(0) === "/" ? importFileName : filePath + importFileName, + importContents = file.readFile(fullImportFileName), i, + importEndIndex, importPath, fixedUrlMatch, colonIndex, parts; + + //Make sure to flatten any nested imports. + importContents = flattenCss(fullImportFileName, importContents); + + //Make the full import path + importEndIndex = importFileName.lastIndexOf("/"); + + //Make a file path based on the last slash. + //If no slash, so must be just a file name. Use empty string then. + importPath = (importEndIndex !== -1) ? importFileName.substring(0, importEndIndex + 1) : ""; + + //fix url() on relative import (#5) + importPath = importPath.replace(/^\.\//, ''); + + //Modify URL paths to match the path represented by this file. + importContents = importContents.replace(cssUrlRegExp, function (fullMatch, urlMatch) { + fixedUrlMatch = cleanCssUrlQuotes(urlMatch); + fixedUrlMatch = fixedUrlMatch.replace(lang.backSlashRegExp, "/"); + + //Only do the work for relative URLs. Skip things that start with / or have + //a protocol. + colonIndex = fixedUrlMatch.indexOf(":"); + if (fixedUrlMatch.charAt(0) !== "/" && (colonIndex === -1 || colonIndex > fixedUrlMatch.indexOf("/"))) { + //It is a relative URL, tack on the path prefix + urlMatch = importPath + fixedUrlMatch; + } else { + logger.trace(importFileName + "\n URL not a relative URL, skipping: " + urlMatch); + } + + //Collapse .. and . + parts = urlMatch.split("/"); + for (i = parts.length - 1; i > 0; i--) { + if (parts[i] === ".") { + parts.splice(i, 1); + } else if (parts[i] === "..") { + if (i !== 0 && parts[i - 1] !== "..") { + parts.splice(i - 1, 2); + i -= 1; + } + } + } + + return "url(" + parts.join("/") + ")"; + }); + + return importContents; + } catch (e) { + logger.trace(fileName + "\n Cannot inline css import, skipping: " + importFileName); + return fullMatch; + } + }); + } + + optimize = { + licenseCommentRegExp: /\/\*[\s\S]*?\*\//g, + + /** + * Optimizes a file that contains JavaScript content. Optionally collects + * plugin resources mentioned in a file, and then passes the content + * through an minifier if one is specified via config.optimize. + * + * @param {String} fileName the name of the file to optimize + * @param {String} outFileName the name of the file to use for the + * saved optimized content. + * @param {Object} config the build config object. + * @param {String} [moduleName] the module name to use for the file. + * Used for plugin resource collection. + * @param {Array} [pluginCollector] storage for any plugin resources + * found. + */ + jsFile: function (fileName, outFileName, config, moduleName, pluginCollector) { + var parts = (config.optimize + "").split('.'), + optimizerName = parts[0], + keepLines = parts[1] === 'keepLines', + fileContents; + + fileContents = file.readFile(fileName); + + fileContents = optimize.js(fileName, fileContents, optimizerName, + keepLines, config, pluginCollector); + + file.saveUtf8File(outFileName, fileContents); + }, + + /** + * Optimizes a file that contains JavaScript content. Optionally collects + * plugin resources mentioned in a file, and then passes the content + * through an minifier if one is specified via config.optimize. + * + * @param {String} fileName the name of the file that matches the + * fileContents. + * @param {String} fileContents the string of JS to optimize. + * @param {String} [optimizerName] optional name of the optimizer to + * use. 'uglify' is default. + * @param {Boolean} [keepLines] whether to keep line returns in the optimization. + * @param {Object} [config] the build config object. + * @param {Array} [pluginCollector] storage for any plugin resources + * found. + */ + js: function (fileName, fileContents, optimizerName, keepLines, config, pluginCollector) { + var licenseContents = '', + optFunc, match, comment; + + config = config || {}; + + //Apply pragmas/namespace renaming + fileContents = pragma.process(fileName, fileContents, config, 'OnSave', pluginCollector); + + //Optimize the JS files if asked. + if (optimizerName && optimizerName !== 'none') { + optFunc = envOptimize[optimizerName] || optimize.optimizers[optimizerName]; + if (!optFunc) { + throw new Error('optimizer with name of "' + + optimizerName + + '" not found for this environment'); + } + + if (config.preserveLicenseComments) { + //Pull out any license comments for prepending after optimization. + optimize.licenseCommentRegExp.lastIndex = 0; + while ((match = optimize.licenseCommentRegExp.exec(fileContents))) { + comment = match[0]; + //Only keep the comments if they are license comments. + if (comment.indexOf('@license') !== -1 || + comment.indexOf('/*!') === 0) { + licenseContents += comment + '\n'; + } + } + } + + fileContents = licenseContents + optFunc(fileName, fileContents, keepLines, + config[optimizerName]); + } + + return fileContents; + }, + + /** + * Optimizes one CSS file, inlining @import calls, stripping comments, and + * optionally removes line returns. + * @param {String} fileName the path to the CSS file to optimize + * @param {String} outFileName the path to save the optimized file. + * @param {Object} config the config object with the optimizeCss and + * cssImportIgnore options. + */ + cssFile: function (fileName, outFileName, config) { + //Read in the file. Make sure we have a JS string. + var originalFileContents = file.readFile(fileName), + fileContents = flattenCss(fileName, originalFileContents, config.cssImportIgnore), + startIndex, endIndex; + + //Do comment removal. + try { + startIndex = -1; + //Get rid of comments. + while ((startIndex = fileContents.indexOf("/*")) !== -1) { + endIndex = fileContents.indexOf("*/", startIndex + 2); + if (endIndex === -1) { + throw "Improper comment in CSS file: " + fileName; + } + fileContents = fileContents.substring(0, startIndex) + fileContents.substring(endIndex + 2, fileContents.length); + } + //Get rid of newlines. + if (config.optimizeCss.indexOf(".keepLines") === -1) { + fileContents = fileContents.replace(/[\r\n]/g, ""); + fileContents = fileContents.replace(/\s+/g, " "); + fileContents = fileContents.replace(/\{\s/g, "{"); + fileContents = fileContents.replace(/\s\}/g, "}"); + } else { + //Remove multiple empty lines. + fileContents = fileContents.replace(/(\r\n)+/g, "\r\n"); + fileContents = fileContents.replace(/(\n)+/g, "\n"); + } + } catch (e) { + fileContents = originalFileContents; + logger.error("Could not optimized CSS file: " + fileName + ", error: " + e); + } + + file.saveUtf8File(outFileName, fileContents); + }, + + /** + * Optimizes CSS files, inlining @import calls, stripping comments, and + * optionally removes line returns. + * @param {String} startDir the path to the top level directory + * @param {Object} config the config object with the optimizeCss and + * cssImportIgnore options. + */ + css: function (startDir, config) { + if (config.optimizeCss.indexOf("standard") !== -1) { + var i, fileName, + fileList = file.getFilteredFileList(startDir, /\.css$/, true); + if (fileList) { + for (i = 0; i < fileList.length; i++) { + fileName = fileList[i]; + logger.trace("Optimizing (" + config.optimizeCss + ") CSS file: " + fileName); + optimize.cssFile(fileName, fileName, config); + } + } + } + }, + + optimizers: { + uglify: function (fileName, fileContents, keepLines, config) { + var parser = uglify.parser, + processor = uglify.uglify, + ast; + + config = config || {}; + + logger.trace("Uglifying file: " + fileName); + + try { + ast = parser.parse(fileContents, config.strict_semicolons); + ast = processor.ast_mangle(ast, config); + ast = processor.ast_squeeze(ast, config); + + fileContents = processor.gen_code(ast, config); + } catch (e) { + logger.error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\n' + e.toString()); + } + return fileContents; + } + } + }; + + return optimize; +}); +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ +/* + * This file patches require.js to communicate with the build system. + */ + +/*jslint nomen: false, plusplus: false, regexp: false, strict: false */ +/*global require: false, define: true */ + +//NOT asking for require as a dependency since the goal is to modify the +//global require below +define('requirePatch', [ 'env!env/file', 'pragma', 'parse'], +function (file, pragma, parse) { + + var allowRun = true; + + //This method should be called when the patches to require should take hold. + return function () { + if (!allowRun) { + return; + } + allowRun = false; + + var layer, + pluginBuilderRegExp = /(["']?)pluginBuilder(["']?)\s*[=\:]\s*["']([^'"\s]+)["']/, + oldDef; + + + /** Print out some extrs info about the module tree that caused the error. **/ + require.onError = function (err) { + + var msg = '\nIn module tree:\n', + standardIndent = ' ', + tree = err.moduleTree, + i, j, mod; + + if (tree && tree.length > 0) { + for (i = tree.length - 1; i > -1 && (mod = tree[i]); i--) { + for (j = tree.length - i; j > -1; j--) { + msg += standardIndent; + } + msg += mod + '\n'; + } + + err = new Error(err.toString() + msg); + } + + throw err; + }; + + //Stored cached file contents for reuse in other layers. + require._cachedFileContents = {}; + + /** Reset state for each build layer pass. */ + require._buildReset = function () { + var oldContext = require.s.contexts._; + + //Clear up the existing context. + delete require.s.contexts._; + + //Set up new context, so the layer object can hold onto it. + require({}); + + layer = require._layer = { + buildPathMap: {}, + buildFileToModule: {}, + buildFilePaths: [], + pathAdded: {}, + modulesWithNames: {}, + needsDefine: {}, + existingRequireUrl: "", + context: require.s.contexts._ + }; + + //Return the previous context in case it is needed, like for + //the basic config object. + return oldContext; + }; + + require._buildReset(); + + /** + * Makes sure the URL is something that can be supported by the + * optimization tool. + * @param {String} url + * @returns {Boolean} + */ + require._isSupportedBuildUrl = function (url) { + //Ignore URLs with protocols, hosts or question marks, means either network + //access is needed to fetch it or it is too dynamic. Note that + //on Windows, full paths are used for some urls, which include + //the drive, like c:/something, so need to test for something other + //than just a colon. + return url.indexOf("://") === -1 && url.indexOf("?") === -1 && + url.indexOf('empty:') !== 0 && url.indexOf('//') !== 0; + }; + + //Override define() to catch modules that just define an object, so that + //a dummy define call is not put in the build file for them. They do + //not end up getting defined via require.execCb, so we need to catch them + //at the define call. + oldDef = define; + + //This function signature does not have to be exact, just match what we + //are looking for. + define = function (name, obj) { + if (typeof name === "string" && !layer.needsDefine[name]) { + layer.modulesWithNames[name] = true; + } + return oldDef.apply(require, arguments); + }; + + define.amd = oldDef.amd; + + //Add some utilities for plugins + require._readFile = file.readFile; + require._fileExists = function (path) { + return file.exists(path); + }; + + function normalizeUrlWithBase(context, moduleName, url) { + //Adjust the URL if it was not transformed to use baseUrl. + if (require.jsExtRegExp.test(moduleName)) { + url = (context.config.dir || context.config.dirBaseUrl) + url; + } + return url; + } + + //Override load so that the file paths can be collected. + require.load = function (context, moduleName, url) { + /*jslint evil: true */ + var contents, pluginBuilderMatch, builderName; + + context.scriptCount += 1; + + //Only handle urls that can be inlined, so that means avoiding some + //URLs like ones that require network access or may be too dynamic, + //like JSONP + if (require._isSupportedBuildUrl(url)) { + //Adjust the URL if it was not transformed to use baseUrl. + url = normalizeUrlWithBase(context, moduleName, url); + + //Save the module name to path and path to module name mappings. + layer.buildPathMap[moduleName] = url; + layer.buildFileToModule[url] = moduleName; + + if (moduleName in context.plugins) { + //plugins need to have their source evaled as-is. + context.needFullExec[moduleName] = true; + } + + try { + if (url in require._cachedFileContents && + (!context.needFullExec[moduleName] || context.fullExec[moduleName])) { + contents = require._cachedFileContents[url]; + } else { + //Load the file contents, process for conditionals, then + //evaluate it. + contents = file.readFile(url); + + //If there is a read filter, run it now. + if (context.config.onBuildRead) { + contents = context.config.onBuildRead(moduleName, url, contents); + } + + contents = pragma.process(url, contents, context.config, 'OnExecute'); + + //Find out if the file contains a require() definition. Need to know + //this so we can inject plugins right after it, but before they are needed, + //and to make sure this file is first, so that define calls work. + //This situation mainly occurs when the build is done on top of the output + //of another build, where the first build may include require somewhere in it. + try { + if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) { + layer.existingRequireUrl = url; + } + } catch (e1) { + throw new Error('Parse error using UglifyJS ' + + 'for file: ' + url + '\n' + e1); + } + + if (moduleName in context.plugins) { + //This is a loader plugin, check to see if it has a build extension, + //otherwise the plugin will act as the plugin builder too. + pluginBuilderMatch = pluginBuilderRegExp.exec(contents); + if (pluginBuilderMatch) { + //Load the plugin builder for the plugin contents. + builderName = context.normalize(pluginBuilderMatch[3], moduleName); + contents = file.readFile(context.nameToUrl(builderName)); + } + } + + //Parse out the require and define calls. + //Do this even for plugins in case they have their own + //dependencies that may be separate to how the pluginBuilder works. + try { + if (!context.needFullExec[moduleName]) { + contents = parse(moduleName, url, contents, { + insertNeedsDefine: true, + has: context.config.has, + findNestedDependencies: context.config.findNestedDependencies + }); + } + } catch (e2) { + throw new Error('Parse error using UglifyJS ' + + 'for file: ' + url + '\n' + e2); + } + + require._cachedFileContents[url] = contents; + } + + if (contents) { + eval(contents); + } + + //Need to close out completion of this module + //so that listeners will get notified that it is available. + try { + context.completeLoad(moduleName); + } catch (e) { + //Track which module could not complete loading. + (e.moduleTree || (e.moduleTree = [])).push(moduleName); + throw e; + } + + } catch (eOuter) { + if (!eOuter.fileName) { + eOuter.fileName = url; + } + throw eOuter; + } + } else { + //With unsupported URLs still need to call completeLoad to + //finish loading. + context.completeLoad(moduleName); + } + + //Mark the module loaded. + context.loaded[moduleName] = true; + }; + + + //Called when execManager runs for a dependency. Used to figure out + //what order of execution. + require.onResourceLoad = function (context, map) { + var fullName = map.fullName, + url; + + //Ignore "fake" modules, usually generated by plugin code, since + //they do not map back to a real file to include in the optimizer, + //or it will be included, but in a different form. + if (context.fake[fullName]) { + return; + } + + //A plugin. + if (map.prefix) { + if (!layer.pathAdded[fullName]) { + layer.buildFilePaths.push(fullName); + //For plugins the real path is not knowable, use the name + //for both module to file and file to module mappings. + layer.buildPathMap[fullName] = fullName; + layer.buildFileToModule[fullName] = fullName; + layer.modulesWithNames[fullName] = true; + layer.pathAdded[fullName] = true; + } + } else if (map.url && require._isSupportedBuildUrl(map.url)) { + //If the url has not been added to the layer yet, and it + //is from an actual file that was loaded, add it now. + url = normalizeUrlWithBase(context, map.fullName, map.url); + if (!layer.pathAdded[url] && layer.buildPathMap[fullName]) { + //Remember the list of dependencies for this layer. + layer.buildFilePaths.push(url); + layer.pathAdded[url] = true; + } + } + }; + + //Called by output of the parse() function, when a file does not + //explicitly call define, probably just require, but the parse() + //function normalizes on define() for dependency mapping and file + //ordering works correctly. + require.needsDefine = function (moduleName) { + layer.needsDefine[moduleName] = true; + }; + + //Marks module has having a name, and optionally executes the + //callback, but only if it meets certain criteria. + require.execCb = function (name, cb, args, exports) { + if (!layer.needsDefine[name]) { + layer.modulesWithNames[name] = true; + } + if (cb.__requireJsBuild || layer.context.needFullExec[name]) { + return cb.apply(exports, args); + } + return undefined; + }; + }; +}); +/** + * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: false, regexp: false, strict: false */ +/*global define: false, console: false */ + +define('commonJs', ['env!env/file', 'uglifyjs/index'], function (file, uglify) { + var commonJs = { + depRegExp: /require\s*\(\s*["']([\w-_\.\/]+)["']\s*\)/g, + + //Set this to false in non-rhino environments. If rhino, then it uses + //rhino's decompiler to remove comments before looking for require() calls, + //otherwise, it will use a crude regexp approach to remove comments. The + //rhino way is more robust, but he regexp is more portable across environments. + useRhino: true, + + //Set to false if you do not want this file to log. Useful in environments + //like node where you want the work to happen without noise. + useLog: true, + + convertDir: function (commonJsPath, savePath) { + var fileList, i, + jsFileRegExp = /\.js$/, + fileName, convertedFileName, fileContents; + + //Get list of files to convert. + fileList = file.getFilteredFileList(commonJsPath, /\w/, true); + + //Normalize on front slashes and make sure the paths do not end in a slash. + commonJsPath = commonJsPath.replace(/\\/g, "/"); + savePath = savePath.replace(/\\/g, "/"); + if (commonJsPath.charAt(commonJsPath.length - 1) === "/") { + commonJsPath = commonJsPath.substring(0, commonJsPath.length - 1); + } + if (savePath.charAt(savePath.length - 1) === "/") { + savePath = savePath.substring(0, savePath.length - 1); + } + + //Cycle through all the JS files and convert them. + if (!fileList || !fileList.length) { + if (commonJs.useLog) { + if (commonJsPath === "convert") { + //A request just to convert one file. + console.log('\n\n' + commonJs.convert(savePath, file.readFile(savePath))); + } else { + console.log("No files to convert in directory: " + commonJsPath); + } + } + } else { + for (i = 0; (fileName = fileList[i]); i++) { + convertedFileName = fileName.replace(commonJsPath, savePath); + + //Handle JS files. + if (jsFileRegExp.test(fileName)) { + fileContents = file.readFile(fileName); + fileContents = commonJs.convert(fileName, fileContents); + file.saveUtf8File(convertedFileName, fileContents); + } else { + //Just copy the file over. + file.copyFile(fileName, convertedFileName, true); + } + } + } + }, + + /** + * Removes the comments from a string. + * + * @param {String} fileContents + * @param {String} fileName mostly used for informative reasons if an error. + * + * @returns {String} a string of JS with comments removed. + */ + removeComments: function (fileContents, fileName) { + //Uglify's ast generation removes comments, so just convert to ast, + //then back to source code to get rid of comments. + return uglify.uglify.gen_code(uglify.parser.parse(fileContents), true); + }, + + /** + * Regexp for testing if there is already a require.def call in the file, + * in which case do not try to convert it. + */ + defRegExp: /define\s*\(\s*("|'|\[|function)/, + + /** + * Regexp for testing if there is a require([]) or require(function(){}) + * call, indicating the file is already in requirejs syntax. + */ + rjsRegExp: /require\s*\(\s*(\[|function)/, + + /** + * Does the actual file conversion. + * + * @param {String} fileName the name of the file. + * + * @param {String} fileContents the contents of a file :) + * + * @param {Boolean} skipDeps if true, require("") dependencies + * will not be searched, but the contents will just be wrapped in the + * standard require, exports, module dependencies. Only usable in sync + * environments like Node where the require("") calls can be resolved on + * the fly. + * + * @returns {String} the converted contents + */ + convert: function (fileName, fileContents, skipDeps) { + //Strip out comments. + try { + var deps = [], depName, match, + //Remove comments + tempContents = commonJs.removeComments(fileContents, fileName); + + //First see if the module is not already RequireJS-formatted. + if (commonJs.defRegExp.test(tempContents) || commonJs.rjsRegExp.test(tempContents)) { + return fileContents; + } + + //Reset the regexp to start at beginning of file. Do this + //since the regexp is reused across files. + commonJs.depRegExp.lastIndex = 0; + + if (!skipDeps) { + //Find dependencies in the code that was not in comments. + while ((match = commonJs.depRegExp.exec(tempContents))) { + depName = match[1]; + if (depName) { + deps.push('"' + depName + '"'); + } + } + } + + //Construct the wrapper boilerplate. + fileContents = 'define(["require", "exports", "module"' + + (deps.length ? ', ' + deps.join(",") : '') + '], ' + + 'function(require, exports, module) {\n' + + fileContents + + '\n});\n'; + } catch (e) { + console.log("COULD NOT CONVERT: " + fileName + ", so skipping it. Error was: " + e); + return fileContents; + } + + return fileContents; + } + }; + + return commonJs; +}); +/** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/*jslint plusplus: true, nomen: true */ +/*global define, require */ + + +define('build', [ 'lang', 'logger', 'env!env/file', 'parse', 'optimize', 'pragma', + 'env!env/load', 'requirePatch'], +function (lang, logger, file, parse, optimize, pragma, + load, requirePatch) { + 'use strict'; + + var build, buildBaseConfig, + endsWithSemiColonRegExp = /;\s*$/; + + buildBaseConfig = { + appDir: "", + pragmas: {}, + paths: {}, + optimize: "uglify", + optimizeCss: "standard.keepLines", + inlineText: true, + isBuild: true, + optimizeAllPluginResources: false, + findNestedDependencies: false, + preserveLicenseComments: true, + //By default, all files/directories are copied, unless + //they match this regexp, by default just excludes .folders + dirExclusionRegExp: file.dirExclusionRegExp + }; + + /** + * Some JS may not be valid if concatenated with other JS, in particular + * the style of omitting semicolons and rely on ASI. Add a semicolon in + * those cases. + */ + function addSemiColon(text) { + if (endsWithSemiColonRegExp.test(text)) { + return text; + } else { + return text + ";"; + } + } + + /** + * If the path looks like an URL, throw an error. This is to prevent + * people from using URLs with protocols in the build config, since + * the optimizer is not set up to do network access. However, be + * sure to allow absolute paths on Windows, like C:\directory. + */ + function disallowUrls(path) { + if ((path.indexOf('://') !== -1 || path.indexOf('//') === 0) && path !== 'empty:') { + throw new Error('Path is not supported: ' + path + + '\nOptimizer can only handle' + + ' local paths. Download the locally if necessary' + + ' and update the config to use a local path.\n' + + 'http://requirejs.org/docs/errors.html#pathnotsupported'); + } + } + + function endsWithSlash(dirName) { + if (dirName.charAt(dirName.length - 1) !== "/") { + dirName += "/"; + } + disallowUrls(dirName); + return dirName; + } + + //Method used by plugin writeFile calls, defined up here to avoid + //jslint warning about "making a function in a loop". + function makeWriteFile(anonDefRegExp, namespaceWithDot, layer) { + function writeFile(name, contents) { + logger.trace('Saving plugin-optimized file: ' + name); + file.saveUtf8File(name, contents); + } + + writeFile.asModule = function (moduleName, fileName, contents) { + writeFile(fileName, + build.toTransport(anonDefRegExp, namespaceWithDot, moduleName, fileName, contents, layer)); + }; + + return writeFile; + } + + /** + * Main API entry point into the build. The args argument can either be + * an array of arguments (like the onese passed on a command-line), + * or it can be a JavaScript object that has the format of a build profile + * file. + * + * If it is an object, then in addition to the normal properties allowed in + * a build profile file, the object should contain one other property: + * + * The object could also contain a "buildFile" property, which is a string + * that is the file path to a build profile that contains the rest + * of the build profile directives. + * + * This function does not return a status, it should throw an error if + * there is a problem completing the build. + */ + build = function (args) { + var buildFile, cmdConfig; + + if (!args || lang.isArray(args)) { + if (!args || args.length < 1) { + logger.error("build.js buildProfile.js\n" + + "where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file)."); + return undefined; + } + + //Next args can include a build file path as well as other build args. + //build file path comes first. If it does not contain an = then it is + //a build file path. Otherwise, just all build args. + if (args[0].indexOf("=") === -1) { + buildFile = args[0]; + args.splice(0, 1); + } + + //Remaining args are options to the build + cmdConfig = build.convertArrayToObject(args); + cmdConfig.buildFile = buildFile; + } else { + cmdConfig = args; + } + + return build._run(cmdConfig); + }; + + build._run = function (cmdConfig) { + var buildFileContents = "", + pluginCollector = {}, + buildPaths, fileName, fileNames, + prop, paths, i, + baseConfig, config, + modules, builtModule, srcPath, buildContext, + destPath, moduleName, moduleMap, parentModuleMap, context, + resources, resource, pluginProcessed = {}, plugin; + + //Can now run the patches to require.js to allow it to be used for + //build generation. Do it here instead of at the top of the module + //because we want normal require behavior to load the build tool + //then want to switch to build mode. + requirePatch(); + + config = build.createConfig(cmdConfig); + paths = config.paths; + + if (config.logLevel) { + logger.logLevel(config.logLevel); + } + + if (!config.out && !config.cssIn) { + //This is not just a one-off file build but a full build profile, with + //lots of files to process. + + //First copy all the baseUrl content + file.copyDir((config.appDir || config.baseUrl), config.dir, /\w/, true); + + //Adjust baseUrl if config.appDir is in play, and set up build output paths. + buildPaths = {}; + if (config.appDir) { + //All the paths should be inside the appDir, so just adjust + //the paths to use the dirBaseUrl + for (prop in paths) { + if (paths.hasOwnProperty(prop)) { + buildPaths[prop] = paths[prop].replace(config.baseUrl, config.dirBaseUrl); + } + } + } else { + //If no appDir, then make sure to copy the other paths to this directory. + for (prop in paths) { + if (paths.hasOwnProperty(prop)) { + //Set up build path for each path prefix. + buildPaths[prop] = paths[prop] === 'empty:' ? 'empty:' : prop.replace(/\./g, "/"); + + //Make sure source path is fully formed with baseUrl, + //if it is a relative URL. + srcPath = paths[prop]; + if (srcPath.indexOf('/') !== 0 && srcPath.indexOf(':') === -1) { + srcPath = config.baseUrl + srcPath; + } + + destPath = config.dirBaseUrl + buildPaths[prop]; + + //Skip empty: paths + if (srcPath !== 'empty:') { + //If the srcPath is a directory, copy the whole directory. + if (file.exists(srcPath) && file.isDirectory(srcPath)) { + //Copy files to build area. Copy all files (the /\w/ regexp) + file.copyDir(srcPath, destPath, /\w/, true); + } else { + //Try a .js extension + srcPath += '.js'; + destPath += '.js'; + file.copyFile(srcPath, destPath); + } + } + } + } + } + } + + //Figure out source file location for each module layer. Do this by seeding require + //with source area configuration. This is needed so that later the module layers + //can be manually copied over to the source area, since the build may be + //require multiple times and the above copyDir call only copies newer files. + require({ + baseUrl: config.baseUrl, + paths: paths, + packagePaths: config.packagePaths, + packages: config.packages + }); + buildContext = require.s.contexts._; + modules = config.modules; + + if (modules) { + modules.forEach(function (module) { + if (module.name) { + module._sourcePath = buildContext.nameToUrl(module.name); + //If the module does not exist, and this is not a "new" module layer, + //as indicated by a true "create" property on the module, and + //it is not a plugin-loaded resource, then throw an error. + if (!file.exists(module._sourcePath) && !module.create && + module.name.indexOf('!') === -1) { + throw new Error("ERROR: module path does not exist: " + + module._sourcePath + " for module named: " + module.name + + ". Path is relative to: " + file.absPath('.')); + } + } + }); + } + + if (config.out) { + //Just set up the _buildPath for the module layer. + require(config); + if (!config.cssIn) { + config.modules[0]._buildPath = config.out; + } + } else if (!config.cssIn) { + //Now set up the config for require to use the build area, and calculate the + //build file locations. Pass along any config info too. + baseConfig = { + baseUrl: config.dirBaseUrl, + paths: buildPaths + }; + + lang.mixin(baseConfig, config); + require(baseConfig); + + if (modules) { + modules.forEach(function (module) { + if (module.name) { + module._buildPath = buildContext.nameToUrl(module.name, null); + if (!module.create) { + file.copyFile(module._sourcePath, module._buildPath); + } + } + }); + } + } + + //Run CSS optimizations before doing JS module tracing, to allow + //things like text loader plugins loading CSS to get the optimized + //CSS. + if (config.optimizeCss && config.optimizeCss !== "none" && config.dir) { + optimize.css(config.dir, config); + } + + if (modules) { + //For each module layer, call require to calculate dependencies. + modules.forEach(function (module) { + module.layer = build.traceDependencies(module, config); + }); + + //Now build up shadow layers for anything that should be excluded. + //Do this after tracing dependencies for each module, in case one + //of those modules end up being one of the excluded values. + modules.forEach(function (module) { + if (module.exclude) { + module.excludeLayers = []; + module.exclude.forEach(function (exclude, i) { + //See if it is already in the list of modules. + //If not trace dependencies for it. + module.excludeLayers[i] = build.findBuildModule(exclude, modules) || + {layer: build.traceDependencies({name: exclude}, config)}; + }); + } + }); + + modules.forEach(function (module) { + if (module.exclude) { + //module.exclude is an array of module names. For each one, + //get the nested dependencies for it via a matching entry + //in the module.excludeLayers array. + module.exclude.forEach(function (excludeModule, i) { + var excludeLayer = module.excludeLayers[i].layer, map = excludeLayer.buildPathMap, prop; + for (prop in map) { + if (map.hasOwnProperty(prop)) { + build.removeModulePath(prop, map[prop], module.layer); + } + } + }); + } + if (module.excludeShallow) { + //module.excludeShallow is an array of module names. + //shallow exclusions are just that module itself, and not + //its nested dependencies. + module.excludeShallow.forEach(function (excludeShallowModule) { + var path = module.layer.buildPathMap[excludeShallowModule]; + if (path) { + build.removeModulePath(excludeShallowModule, path, module.layer); + } + }); + } + + //Flatten them and collect the build output for each module. + builtModule = build.flattenModule(module, module.layer, config); + + //Save it to a temp file for now, in case there are other layers that + //contain optimized content that should not be included in later + //layer optimizations. See issue #56. + file.saveUtf8File(module._buildPath + '-temp', builtModule.text); + buildFileContents += builtModule.buildText; + }); + + //Now move the build layers to their final position. + modules.forEach(function (module) { + var finalPath = module._buildPath; + if (file.exists(finalPath)) { + file.deleteFile(finalPath); + } + file.renameFile(finalPath + '-temp', finalPath); + }); + } + + //Do other optimizations. + if (config.out && !config.cssIn) { + //Just need to worry about one JS file. + fileName = config.modules[0]._buildPath; + optimize.jsFile(fileName, fileName, config); + } else if (!config.cssIn) { + //Normal optimizations across modules. + + //JS optimizations. + fileNames = file.getFilteredFileList(config.dir, /\.js$/, true); + for (i = 0; (fileName = fileNames[i]); i++) { + //Generate the module name from the config.dir root. + moduleName = fileName.replace(config.dir, ''); + //Get rid of the extension + moduleName = moduleName.substring(0, moduleName.length - 3); + optimize.jsFile(fileName, fileName, config, moduleName, pluginCollector); + } + + //Normalize all the plugin resources. + context = require.s.contexts._; + + for (moduleName in pluginCollector) { + if (pluginCollector.hasOwnProperty(moduleName)) { + parentModuleMap = context.makeModuleMap(moduleName); + resources = pluginCollector[moduleName]; + for (i = 0; (resource = resources[i]); i++) { + moduleMap = context.makeModuleMap(resource, parentModuleMap); + if (!context.plugins[moduleMap.prefix]) { + //Set the value in context.plugins so it + //will be evaluated as a full plugin. + context.plugins[moduleMap.prefix] = true; + + //Do not bother if the plugin is not available. + if (!file.exists(require.toUrl(moduleMap.prefix + '.js'))) { + continue; + } + + //Rely on the require in the build environment + //to be synchronous + context.require([moduleMap.prefix]); + + //Now that the plugin is loaded, redo the moduleMap + //since the plugin will need to normalize part of the path. + moduleMap = context.makeModuleMap(resource, parentModuleMap); + } + + //Only bother with plugin resources that can be handled + //processed by the plugin, via support of the writeFile + //method. + if (!pluginProcessed[moduleMap.fullName]) { + //Only do the work if the plugin was really loaded. + //Using an internal access because the file may + //not really be loaded. + plugin = context.defined[moduleMap.prefix]; + if (plugin && plugin.writeFile) { + plugin.writeFile( + moduleMap.prefix, + moduleMap.name, + require, + makeWriteFile( + config.anonDefRegExp, + config.namespaceWithDot + ), + context.config + ); + } + + pluginProcessed[moduleMap.fullName] = true; + } + } + + } + } + + //console.log('PLUGIN COLLECTOR: ' + JSON.stringify(pluginCollector, null, " ")); + + + //All module layers are done, write out the build.txt file. + file.saveUtf8File(config.dir + "build.txt", buildFileContents); + } + + //If just have one CSS file to optimize, do that here. + if (config.cssIn) { + optimize.cssFile(config.cssIn, config.out, config); + } + + //Print out what was built into which layers. + if (buildFileContents) { + logger.info(buildFileContents); + return buildFileContents; + } + + return ''; + }; + + /** + * Converts command line args like "paths.foo=../some/path" + * result.paths = { foo: '../some/path' } where prop = paths, + * name = paths.foo and value = ../some/path, so it assumes the + * name=value splitting has already happened. + */ + function stringDotToObj(result, prop, name, value) { + if (!result[prop]) { + result[prop] = {}; + } + name = name.substring((prop + '.').length, name.length); + result[prop][name] = value; + } + + //Used by convertArrayToObject to convert some things from prop.name=value + //to a prop: { name: value} + build.dotProps = [ + 'paths.', + 'wrap.', + 'pragmas.', + 'pragmasOnSave.', + 'has.', + 'hasOnSave.', + 'wrap.', + 'uglify.', + 'closure.' + ]; + + build.hasDotPropMatch = function (prop) { + return build.dotProps.some(function (dotProp) { + return prop.indexOf(dotProp) === 0; + }); + }; + + /** + * Converts an array that has String members of "name=value" + * into an object, where the properties on the object are the names in the array. + * Also converts the strings "true" and "false" to booleans for the values. + * member name/value pairs, and converts some comma-separated lists into + * arrays. + * @param {Array} ary + */ + build.convertArrayToObject = function (ary) { + var result = {}, i, separatorIndex, prop, value, + needArray = { + "include": true, + "exclude": true, + "excludeShallow": true + }; + + for (i = 0; i < ary.length; i++) { + separatorIndex = ary[i].indexOf("="); + if (separatorIndex === -1) { + throw "Malformed name/value pair: [" + ary[i] + "]. Format should be name=value"; + } + + value = ary[i].substring(separatorIndex + 1, ary[i].length); + if (value === "true") { + value = true; + } else if (value === "false") { + value = false; + } + + prop = ary[i].substring(0, separatorIndex); + + //Convert to array if necessary + if (needArray[prop]) { + value = value.split(","); + } + + if (build.hasDotPropMatch(prop)) { + stringDotToObj(result, prop.split('.')[0], prop, value); + } else { + result[prop] = value; + } + } + return result; //Object + }; + + build.makeAbsPath = function (path, absFilePath) { + //Add abspath if necessary. If path starts with a slash or has a colon, + //then already is an abolute path. + if (path.indexOf('/') !== 0 && path.indexOf(':') === -1) { + path = absFilePath + + (absFilePath.charAt(absFilePath.length - 1) === '/' ? '' : '/') + + path; + path = file.normalize(path); + } + return path.replace(lang.backSlashRegExp, '/'); + }; + + build.makeAbsObject = function (props, obj, absFilePath) { + var i, prop; + if (obj) { + for (i = 0; (prop = props[i]); i++) { + if (obj.hasOwnProperty(prop)) { + obj[prop] = build.makeAbsPath(obj[prop], absFilePath); + } + } + } + }; + + /** + * For any path in a possible config, make it absolute relative + * to the absFilePath passed in. + */ + build.makeAbsConfig = function (config, absFilePath) { + var props, prop, i; + + props = ["appDir", "dir", "baseUrl"]; + for (i = 0; (prop = props[i]); i++) { + if (config[prop]) { + //Add abspath if necessary, make sure these paths end in + //slashes + if (prop === "baseUrl") { + config.originalBaseUrl = config.baseUrl; + if (config.appDir) { + //If baseUrl with an appDir, the baseUrl is relative to + //the appDir, *not* the absFilePath. appDir and dir are + //made absolute before baseUrl, so this will work. + config.baseUrl = build.makeAbsPath(config.originalBaseUrl, config.appDir); + } else { + //The dir output baseUrl is same as regular baseUrl, both + //relative to the absFilePath. + config.baseUrl = build.makeAbsPath(config[prop], absFilePath); + } + } else { + config[prop] = build.makeAbsPath(config[prop], absFilePath); + } + + config[prop] = endsWithSlash(config[prop]); + } + } + + //Do not allow URLs for paths resources. + if (config.paths) { + for (prop in config.paths) { + if (config.paths.hasOwnProperty(prop)) { + config.paths[prop] = build.makeAbsPath(config.paths[prop], + (config.baseUrl || absFilePath)); + } + } + } + + build.makeAbsObject(["out", "cssIn"], config, absFilePath); + build.makeAbsObject(["startFile", "endFile"], config.wrap, absFilePath); + }; + + build.nestedMix = { + paths: true, + has: true, + hasOnSave: true, + pragmas: true, + pragmasOnSave: true + }; + + /** + * Mixes additional source config into target config, and merges some + * nested config, like paths, correctly. + */ + function mixConfig(target, source) { + var prop, value; + + for (prop in source) { + if (source.hasOwnProperty(prop)) { + //If the value of the property is a plain object, then + //allow a one-level-deep mixing of it. + value = source[prop]; + if (typeof value === 'object' && value && + !lang.isArray(value) && !lang.isFunction(value) && + !lang.isRegExp(value)) { + target[prop] = lang.mixin({}, target[prop], value, true); + } else { + target[prop] = value; + } + } + } + } + + /** + * Creates a config object for an optimization build. + * It will also read the build profile if it is available, to create + * the configuration. + * + * @param {Object} cfg config options that take priority + * over defaults and ones in the build file. These options could + * be from a command line, for instance. + * + * @param {Object} the created config object. + */ + build.createConfig = function (cfg) { + /*jslint evil: true */ + var config = {}, buildFileContents, buildFileConfig, mainConfig, + mainConfigFile, prop, buildFile, absFilePath; + + //Make sure all paths are relative to current directory. + absFilePath = file.absPath('.'); + build.makeAbsConfig(cfg, absFilePath); + build.makeAbsConfig(buildBaseConfig, absFilePath); + + lang.mixin(config, buildBaseConfig); + lang.mixin(config, cfg, true); + + if (config.buildFile) { + //A build file exists, load it to get more config. + buildFile = file.absPath(config.buildFile); + + //Find the build file, and make sure it exists, if this is a build + //that has a build profile, and not just command line args with an in=path + if (!file.exists(buildFile)) { + throw new Error("ERROR: build file does not exist: " + buildFile); + } + + absFilePath = config.baseUrl = file.absPath(file.parent(buildFile)); + + //Load build file options. + buildFileContents = file.readFile(buildFile); + try { + buildFileConfig = eval("(" + buildFileContents + ")"); + build.makeAbsConfig(buildFileConfig, absFilePath); + + if (!buildFileConfig.out && !buildFileConfig.dir) { + buildFileConfig.dir = (buildFileConfig.baseUrl || config.baseUrl) + "/build/"; + } + + } catch (e) { + throw new Error("Build file " + buildFile + " is malformed: " + e); + } + } + + mainConfigFile = config.mainConfigFile || (buildFileConfig && buildFileConfig.mainConfigFile); + if (mainConfigFile) { + mainConfigFile = build.makeAbsPath(mainConfigFile, absFilePath); + try { + mainConfig = parse.findConfig(mainConfigFile, file.readFile(mainConfigFile)); + } catch (configError) { + throw new Error('The config in mainConfigFile ' + + mainConfigFile + + ' cannot be used because it cannot be evaluated' + + ' correctly while running in the optimizer. Try only' + + ' using a config that is also valid JSON, or do not use' + + ' mainConfigFile and instead copy the config values needed' + + ' into a build file or command line arguments given to the optimizer.'); + } + if (mainConfig) { + //If no baseUrl, then use the directory holding the main config. + if (!mainConfig.baseUrl) { + mainConfig.baseUrl = mainConfigFile.substring(0, mainConfigFile.lastIndexOf('/')); + } + build.makeAbsConfig(mainConfig, mainConfigFile); + mixConfig(config, mainConfig); + } + } + + //Mix in build file config, but only after mainConfig has been mixed in. + if (buildFileConfig) { + mixConfig(config, buildFileConfig); + } + + //Re-apply the override config values. Command line + //args should take precedence over build file values. + mixConfig(config, cfg); + + + //Set final output dir + if (config.hasOwnProperty("baseUrl")) { + if (config.appDir) { + config.dirBaseUrl = build.makeAbsPath(config.originalBaseUrl, config.dir); + } else { + config.dirBaseUrl = config.dir || config.baseUrl; + } + //Make sure dirBaseUrl ends in a slash, since it is + //concatenated with other strings. + config.dirBaseUrl = endsWithSlash(config.dirBaseUrl); + } + + //Check for errors in config + if (config.cssIn && !config.out) { + throw new Error("ERROR: 'out' option missing."); + } + if (!config.cssIn && !config.baseUrl) { + throw new Error("ERROR: 'baseUrl' option missing."); + } + if (!config.out && !config.dir) { + throw new Error('Missing either an "out" or "dir" config value. ' + + 'If using "appDir" for a full project optimization, ' + + 'use "dir". If you want to optimize to one file, ' + + 'use "out".'); + } + if (config.appDir && config.out) { + throw new Error('"appDir" is not compatible with "out". Use "dir" ' + + 'instead. appDir is used to copy whole projects, ' + + 'where "out" is used to just optimize to one file.'); + } + if (config.out && config.dir) { + throw new Error('The "out" and "dir" options are incompatible.' + + ' Use "out" if you are targeting a single file for' + + ' for optimization, and "dir" if you want the appDir' + + ' or baseUrl directories optimized.'); + } + + if ((config.name || config.include) && !config.modules) { + //Just need to build one file, but may be part of a whole appDir/ + //baseUrl copy, but specified on the command line, so cannot do + //the modules array setup. So create a modules section in that + //case. + config.modules = [ + { + name: config.name, + out: config.out, + include: config.include, + exclude: config.exclude, + excludeShallow: config.excludeShallow + } + ]; + } + + if (config.out && !config.cssIn) { + //Just one file to optimize. + + //Does not have a build file, so set up some defaults. + //Optimizing CSS should not be allowed, unless explicitly + //asked for on command line. In that case the only task is + //to optimize a CSS file. + if (!cfg.optimizeCss) { + config.optimizeCss = "none"; + } + } + + //Do not allow URLs for paths resources. + if (config.paths) { + for (prop in config.paths) { + if (config.paths.hasOwnProperty(prop)) { + disallowUrls(config.paths[prop]); + } + } + } + + //Get any wrap text. + try { + if (config.wrap) { + if (config.wrap === true) { + //Use default values. + config.wrap = { + start: '(function () {', + end: '}());' + }; + } else { + config.wrap.start = config.wrap.start || + file.readFile(build.makeAbsPath(config.wrap.startFile, absFilePath)); + config.wrap.end = config.wrap.end || + file.readFile(build.makeAbsPath(config.wrap.endFile, absFilePath)); + } + } + } catch (wrapError) { + throw new Error('Malformed wrap config: need both start/end or ' + + 'startFile/endFile: ' + wrapError.toString()); + } + + + //Set up proper info for namespaces and using namespaces in transport + //wrappings. + config.namespaceWithDot = config.namespace ? config.namespace + '.' : ''; + config.anonDefRegExp = build.makeAnonDefRegExp(config.namespaceWithDot); + + //Do final input verification + if (config.context) { + throw new Error('The build argument "context" is not supported' + + ' in a build. It should only be used in web' + + ' pages.'); + } + + //Set file.fileExclusionRegExp if desired + if ('fileExclusionRegExp' in config) { + if (typeof config.fileExclusionRegExp === "string") { + file.exclusionRegExp = new RegExp(config.fileExclusionRegExp); + } else { + file.exclusionRegExp = config.fileExclusionRegExp; + } + } else if ('dirExclusionRegExp' in config) { + //Set file.dirExclusionRegExp if desired, this is the old + //name for fileExclusionRegExp before 1.0.2. Support for backwards + //compatibility + file.exclusionRegExp = config.dirExclusionRegExp; + } + + return config; + }; + + /** + * finds the module being built/optimized with the given moduleName, + * or returns null. + * @param {String} moduleName + * @param {Array} modules + * @returns {Object} the module object from the build profile, or null. + */ + build.findBuildModule = function (moduleName, modules) { + var i, module; + for (i = 0; (module = modules[i]); i++) { + if (module.name === moduleName) { + return module; + } + } + return null; + }; + + /** + * Removes a module name and path from a layer, if it is supposed to be + * excluded from the layer. + * @param {String} moduleName the name of the module + * @param {String} path the file path for the module + * @param {Object} layer the layer to remove the module/path from + */ + build.removeModulePath = function (module, path, layer) { + var index = layer.buildFilePaths.indexOf(path); + if (index !== -1) { + layer.buildFilePaths.splice(index, 1); + } + + //Take it out of the specified modules. Specified modules are mostly + //used to find require modifiers. + delete layer.specified[module]; + }; + + /** + * Uses the module build config object to trace the dependencies for the + * given module. + * + * @param {Object} module the module object from the build config info. + * @param {Object} the build config object. + * + * @returns {Object} layer information about what paths and modules should + * be in the flattened module. + */ + build.traceDependencies = function (module, config) { + var include, override, layer, context, baseConfig, oldContext; + + //Reset some state set up in requirePatch.js, and clean up require's + //current context. + oldContext = require._buildReset(); + + //Grab the reset layer and context after the reset, but keep the + //old config to reuse in the new context. + baseConfig = oldContext.config; + layer = require._layer; + context = layer.context; + + //Put back basic config, use a fresh object for it. + //WARNING: probably not robust for paths and packages/packagePaths, + //since those property's objects can be modified. But for basic + //config clone it works out. + require(lang.delegate(baseConfig)); + + logger.trace("\nTracing dependencies for: " + (module.name || module.out)); + include = module.name && !module.create ? [module.name] : []; + if (module.include) { + include = include.concat(module.include); + } + + //If there are overrides to basic config, set that up now.; + if (module.override) { + override = lang.delegate(baseConfig); + lang.mixin(override, module.override, true); + require(override); + } + + //Figure out module layer dependencies by calling require to do the work. + require(include); + + //Pull out the layer dependencies. + layer.specified = context.specified; + + //Reset config + if (module.override) { + require(baseConfig); + } + + return layer; + }; + + /** + * Uses the module build config object to create an flattened version + * of the module, with deep dependencies included. + * + * @param {Object} module the module object from the build config info. + * + * @param {Object} layer the layer object returned from build.traceDependencies. + * + * @param {Object} the build config object. + * + * @returns {Object} with two properties: "text", the text of the flattened + * module, and "buildText", a string of text representing which files were + * included in the flattened module text. + */ + build.flattenModule = function (module, layer, config) { + var buildFileContents = "", + namespace = config.namespace ? config.namespace + '.' : '', + context = layer.context, + anonDefRegExp = config.anonDefRegExp, + path, reqIndex, fileContents, currContents, + i, moduleName, + parts, builder, writeApi; + + //Use override settings, particularly for pragmas + if (module.override) { + config = lang.delegate(config); + lang.mixin(config, module.override, true); + } + + //Start build output for the module. + buildFileContents += "\n" + + (config.dir ? module._buildPath.replace(config.dir, "") : module._buildPath) + + "\n----------------\n"; + + //If there was an existing file with require in it, hoist to the top. + if (layer.existingRequireUrl) { + reqIndex = layer.buildFilePaths.indexOf(layer.existingRequireUrl); + if (reqIndex !== -1) { + layer.buildFilePaths.splice(reqIndex, 1); + layer.buildFilePaths.unshift(layer.existingRequireUrl); + } + } + + //Write the built module to disk, and build up the build output. + fileContents = ""; + for (i = 0; (path = layer.buildFilePaths[i]); i++) { + moduleName = layer.buildFileToModule[path]; + + //Figure out if the module is a result of a build plugin, and if so, + //then delegate to that plugin. + parts = context.makeModuleMap(moduleName); + builder = parts.prefix && context.defined[parts.prefix]; + if (builder) { + if (builder.write) { + writeApi = function (input) { + fileContents += "\n" + addSemiColon(input); + if (config.onBuildWrite) { + fileContents = config.onBuildWrite(moduleName, path, fileContents); + } + }; + writeApi.asModule = function (moduleName, input) { + fileContents += "\n" + + addSemiColon( + build.toTransport(anonDefRegExp, namespace, moduleName, path, input, layer)); + if (config.onBuildWrite) { + fileContents = config.onBuildWrite(moduleName, path, fileContents); + } + }; + builder.write(parts.prefix, parts.name, writeApi); + } + } else { + currContents = file.readFile(path); + + if (config.onBuildRead) { + currContents = config.onBuildRead(moduleName, path, currContents); + } + + if (config.namespace) { + currContents = pragma.namespace(currContents, config.namespace); + } + + currContents = build.toTransport(anonDefRegExp, namespace, moduleName, path, currContents, layer); + + if (config.onBuildWrite) { + currContents = config.onBuildWrite(moduleName, path, currContents); + } + + //Semicolon is for files that are not well formed when + //concatenated with other content. + fileContents += "\n" + addSemiColon(currContents); + } + + buildFileContents += path.replace(config.dir, "") + "\n"; + //Some files may not have declared a require module, and if so, + //put in a placeholder call so the require does not try to load them + //after the module is processed. + //If we have a name, but no defined module, then add in the placeholder. + if (moduleName && !layer.modulesWithNames[moduleName] && !config.skipModuleInsertion) { + //If including jquery, register the module correctly, otherwise + //register an empty function. For jquery, make sure jQuery is + //a real object, and perhaps not some other file mapping, like + //to zepto. + if (moduleName === 'jquery') { + fileContents += '\n(function () {\n' + + 'var jq = typeof jQuery !== "undefined" && jQuery;\n' + + namespace + + 'define("jquery", [], function () { return jq; });\n' + + '}());\n'; + } else { + fileContents += '\n' + namespace + 'define("' + moduleName + '", function(){});\n'; + } + } + } + + return { + text: config.wrap ? + config.wrap.start + fileContents + config.wrap.end : + fileContents, + buildText: buildFileContents + }; + }; + + /** + * Creates the regexp to find anonymous defines. + * @param {String} namespace an optional namespace to use. The namespace + * should *include* a trailing dot. So a valid value would be 'foo.' + * @returns {RegExp} + */ + build.makeAnonDefRegExp = function (namespace) { + //This regexp is not bullet-proof, and it has one optional part to + //avoid issues with some Dojo transition modules that use a + //define(\n//begin v1.x content + //for a comment. + return new RegExp('(^|[^\\.])(' + (namespace || '').replace(/\./g, '\\.') + + 'define|define)\\s*\\(\\s*(\\/\\/[^\\n\\r]*[\\r\\n])?(\\[|function|[\\w\\d_\\-\\$]+\\s*\\)|\\{|["\']([^"\']+)["\'])(\\s*,\\s*f)?'); + }; + + build.leadingCommaRegExp = /^\s*,/; + + build.toTransport = function (anonDefRegExp, namespace, moduleName, path, contents, layer) { + + //If anonymous module, insert the module name. + return contents.replace(anonDefRegExp, function (match, start, callName, possibleComment, suffix, namedModule, namedFuncStart) { + //A named module with either listed dependencies or an object + //literal for a value. Skip it. If named module, only want ones + //whose next argument is a function literal to scan for + //require('') dependecies. + if (namedModule && !namedFuncStart) { + return match; + } + + //Only mark this module as having a name if not a named module, + //or if a named module and the name matches expectations. + if (layer && (!namedModule || namedModule === moduleName)) { + layer.modulesWithNames[moduleName] = true; + } + + var deps = null; + + //Look for CommonJS require calls inside the function if this is + //an anonymous define call that just has a function registered. + //Also look if a named define function but has a factory function + //as the second arg that should be scanned for dependencies. + if (suffix.indexOf('f') !== -1 || (namedModule)) { + deps = parse.getAnonDeps(path, contents); + + if (deps.length) { + deps = deps.map(function (dep) { + return "'" + dep + "'"; + }); + } else { + deps = []; + } + } + + return start + namespace + "define('" + (namedModule || moduleName) + "'," + + (deps ? ('[' + deps.toString() + '],') : '') + + (namedModule ? namedFuncStart.replace(build.leadingCommaRegExp, '') : suffix); + }); + + }; + + return build; +}); + + } + + + /** + * Sets the default baseUrl for requirejs to be directory of top level + * script. + */ + function setBaseUrl(fileName) { + //Use the file name's directory as the baseUrl if available. + dir = fileName.replace(/\\/g, '/'); + if (dir.indexOf('/') !== -1) { + dir = dir.split('/'); + dir.pop(); + dir = dir.join('/'); + exec("require({baseUrl: '" + dir + "'});"); + } + } + + //If in Node, and included via a require('requirejs'), just export and + //THROW IT ON THE GROUND! + if (env === 'node' && reqMain !== module) { + setBaseUrl(path.resolve(reqMain ? reqMain.filename : '.')); + + //Create a method that will run the optimzer given an object + //config. + requirejs.optimize = function (config, callback) { + if (!loadedOptimizedLib) { + loadLib(); + loadedOptimizedLib = true; + } + + //Create the function that will be called once build modules + //have been loaded. + var runBuild = function (build, logger) { + //Make sure config has a log level, and if not, + //make it "silent" by default. + config.logLevel = config.hasOwnProperty('logLevel') ? + config.logLevel : logger.SILENT; + + var result = build(config); + + //Reset build internals on each run. + requirejs._buildReset(); + + if (callback) { + callback(result); + } + }; + + //Enable execution of this callback in a build setting. + //Normally, once requirePatch is run, by default it will + //not execute callbacks, unless this property is set on + //the callback. + runBuild.__requireJsBuild = true; + + requirejs({ + context: 'build' + }, ['build', 'logger'], runBuild); + }; + + requirejs.tools = { + useLib: function (contextName, callback) { + if (!callback) { + callback = contextName; + contextName = 'uselib'; + } + + if (!useLibLoaded[contextName]) { + loadLib(); + useLibLoaded[contextName] = true; + } + + var req = requirejs({ + context: contextName + }); + + req(['build'], function () { + callback(req); + }); + } + }; + + requirejs.define = define; + + module.exports = requirejs; + return; + } + + if (commandOption === 'o') { + //Do the optimizer work. + loadLib(); + + /** + * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. + * Available via the MIT or new BSD license. + * see: http://github.com/jrburke/requirejs for details + */ + +/* + * Create a build.js file that has the build options you want and pass that + * build file to this file to do the build. See example.build.js for more information. + */ + +/*jslint strict: false, nomen: false */ +/*global require: false */ + +require({ + baseUrl: require.s.contexts._.config.baseUrl, + //Use a separate context than the default context so that the + //build can use the default context. + context: 'build', + catchError: { + define: true + } +}, ['env!env/args', 'build'], +function (args, build) { + build(args); +}); + + + } else if (commandOption === 'v') { + console.log('r.js: ' + version + ', RequireJS: ' + this.requirejsVars.require.version); + } else if (commandOption === 'convert') { + loadLib(); + + this.requirejsVars.require(['env!env/args', 'commonJs', 'env!env/print'], + function (args, commonJs, print) { + + var srcDir, outDir; + srcDir = args[0]; + outDir = args[1]; + + if (!srcDir || !outDir) { + print('Usage: path/to/commonjs/modules output/dir'); + return; + } + + commonJs.convertDir(args[0], args[1]); + }); + } else { + //Just run an app + + //Load the bundled libraries for use in the app. + if (commandOption === 'lib') { + loadLib(); + } + + setBaseUrl(fileName); + + if (exists(fileName)) { + exec(readFile(fileName), fileName); + } else { + showHelp(); + } + } + +}((typeof console !== 'undefined' ? console : undefined), + (typeof Packages !== 'undefined' ? Array.prototype.slice.call(arguments, 0) : []), + (typeof readFile !== 'undefined' ? readFile : undefined))); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/.npmignore new file mode 100644 index 0000000..21e430d --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/.npmignore @@ -0,0 +1,11 @@ +*.coffee +*.html +.DS_Store +.git* +Cakefile +documentation/ +examples/ +extras/coffee-script.js +raw/ +src/ +test/ diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/LICENSE b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/LICENSE new file mode 100644 index 0000000..8cb3cfd --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2011 Jeremy Ashkenas + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/README b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/README new file mode 100644 index 0000000..69ee6f4 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/README @@ -0,0 +1,51 @@ + + { + } } { + { { } } + } }{ { + { }{ } } _____ __ __ + ( }{ }{ { ) / ____| / _|/ _| + .- { { } { }} -. | | ___ | |_| |_ ___ ___ + ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \ + |`-..________ ..-'| | |___| (_) | | | || __/ __/ + | | \_____\___/|_| |_| \___|\___| + | ;--. + | (__ \ _____ _ _ + | | ) ) / ____| (_) | | + | |/ / | (___ ___ _ __ _ _ __ | |_ + | ( / \___ \ / __| '__| | '_ \| __| + | |/ ____) | (__| | | | |_) | |_ + | | |_____/ \___|_| |_| .__/ \__| + `-.._________..-' | | + |_| + + + CoffeeScript is a little language that compiles into JavaScript. + + Install Node.js, and then the CoffeeScript compiler: + sudo bin/cake install + + Or, if you have the Node Package Manager installed: + npm install -g coffee-script + (Leave off the -g if you don't wish to install globally.) + + Execute a script: + coffee /path/to/script.coffee + + Compile a script: + coffee -c /path/to/script.coffee + + For documentation, usage, and examples, see: + http://coffeescript.org/ + + To suggest a feature, report a bug, or general discussion: + http://github.com/jashkenas/coffee-script/issues/ + + If you'd like to chat, drop by #coffeescript on Freenode IRC, + or on webchat.freenode.net. + + The source repository: + git://github.com/jashkenas/coffee-script.git + + All contributors are listed here: + http://github.com/jashkenas/coffee-script/contributors diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/Rakefile b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/Rakefile new file mode 100644 index 0000000..dfb85da --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/Rakefile @@ -0,0 +1,78 @@ +require 'rubygems' +require 'erb' +require 'fileutils' +require 'rake/testtask' +require 'json' + +desc "Build the documentation page" +task :doc do + source = 'documentation/index.html.erb' + child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" } + at_exit { Process.kill("INT", child) } + Signal.trap("INT") { exit } + loop do + mtime = File.stat(source).mtime + if !@mtime || mtime > @mtime + rendered = ERB.new(File.read(source)).result(binding) + File.open('index.html', 'w+') {|f| f.write(rendered) } + end + @mtime = mtime + sleep 1 + end +end + +desc "Build coffee-script-source gem" +task :gem do + require 'rubygems' + require 'rubygems/package' + + gemspec = Gem::Specification.new do |s| + s.name = 'coffee-script-source' + s.version = JSON.parse(File.read('package.json'))["version"] + s.date = Time.now.strftime("%Y-%m-%d") + + s.homepage = "http://jashkenas.github.com/coffee-script/" + s.summary = "The CoffeeScript Compiler" + s.description = <<-EOS + CoffeeScript is a little language that compiles into JavaScript. + Underneath all of those embarrassing braces and semicolons, + JavaScript has always had a gorgeous object model at its heart. + CoffeeScript is an attempt to expose the good parts of JavaScript + in a simple way. + EOS + + s.files = [ + 'lib/coffee_script/coffee-script.js', + 'lib/coffee_script/source.rb' + ] + + s.authors = ['Jeremy Ashkenas'] + s.email = 'jashkenas@gmail.com' + s.rubyforge_project = 'coffee-script-source' + end + + file = File.open("coffee-script-source.gem", "w") + Gem::Package.open(file, 'w') do |pkg| + pkg.metadata = gemspec.to_yaml + + path = "lib/coffee_script/source.rb" + contents = <<-ERUBY +module CoffeeScript + module Source + def self.bundled_path + File.expand_path("../coffee-script.js", __FILE__) + end + end +end + ERUBY + pkg.add_file_simple(path, 0644, contents.size) do |tar_io| + tar_io.write(contents) + end + + contents = File.read("extras/coffee-script.js") + path = "lib/coffee_script/coffee-script.js" + pkg.add_file_simple(path, 0644, contents.size) do |tar_io| + tar_io.write(contents) + end + end +end diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/bin/cake b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/bin/cake new file mode 100755 index 0000000..5965f4e --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/bin/cake @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); + +require(lib + '/coffee-script/cake').run(); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee new file mode 100755 index 0000000..3d1d71c --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/bin/coffee @@ -0,0 +1,7 @@ +#!/usr/bin/env node + +var path = require('path'); +var fs = require('fs'); +var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); + +require(lib + '/coffee-script/command').run(); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf new file mode 100644 index 0000000..1190da5 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/extras/jsl.conf @@ -0,0 +1,44 @@ +# JavaScriptLint configuration file for CoffeeScript. + ++no_return_value # function {0} does not always return a value ++duplicate_formal # duplicate formal argument {0} +-equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} ++var_hides_arg # variable {0} hides argument ++redeclared_var # redeclaration of {0} {1} +-anon_no_return_value # anonymous function does not always return a value ++missing_semicolon # missing semicolon ++meaningless_block # meaningless block; curly braces have no impact +-comma_separated_stmts # multiple statements separated by commas (use semicolons?) ++unreachable_code # unreachable code ++missing_break # missing break statement +-missing_break_for_last_case # missing break statement for last case in switch +-comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) +-inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement +-useless_void # use of the void type may be unnecessary (void is always undefined) ++multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs ++use_of_label # use of label +-block_without_braces # block statement without curly braces ++leading_decimal_point # leading decimal point may indicate a number or an object member ++trailing_decimal_point # trailing decimal point may indicate a number or an object member ++octal_number # leading zeros make an octal number ++nested_comment # nested comment ++misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma ++ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement ++empty_statement # empty statement or extra semicolon +-missing_option_explicit # the "option explicit" control comment is missing ++partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag ++dup_option_explicit # duplicate "option explicit" control comment ++useless_assign # useless assignment ++ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity ++ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) +-missing_default_case # missing default case in switch statement ++duplicate_case_in_switch # duplicate case in switch statements ++default_not_at_end # the default case is not at the end of the switch statement ++legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax ++jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax ++useless_comparison # useless comparison; comparing identical expressions ++with_statement # with statement hides undeclared variables; use temporary variable instead ++trailing_comma_in_array # extra comma is not recommended in array initializers ++assign_to_function_call # assignment to a function call ++parseint_missing_radix # parseInt missing radix parameter ++lambda_assign_requires_semicolon diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js new file mode 100644 index 0000000..ec2e479 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/browser.js @@ -0,0 +1,74 @@ +(function() { + var CoffeeScript, runScripts; + + CoffeeScript = require('./coffee-script'); + + CoffeeScript.require = require; + + CoffeeScript.eval = function(code, options) { + return eval(CoffeeScript.compile(code, options)); + }; + + CoffeeScript.run = function(code, options) { + if (options == null) options = {}; + options.bare = true; + return Function(CoffeeScript.compile(code, options))(); + }; + + if (typeof window === "undefined" || window === null) return; + + CoffeeScript.load = function(url, callback) { + var xhr; + xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP'); + xhr.open('GET', url, true); + if ('overrideMimeType' in xhr) xhr.overrideMimeType('text/plain'); + xhr.onreadystatechange = function() { + var _ref; + if (xhr.readyState === 4) { + if ((_ref = xhr.status) === 0 || _ref === 200) { + CoffeeScript.run(xhr.responseText); + } else { + throw new Error("Could not load " + url); + } + if (callback) return callback(); + } + }; + return xhr.send(null); + }; + + runScripts = function() { + var coffees, execute, index, length, s, scripts; + scripts = document.getElementsByTagName('script'); + coffees = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = scripts.length; _i < _len; _i++) { + s = scripts[_i]; + if (s.type === 'text/coffeescript') _results.push(s); + } + return _results; + })(); + index = 0; + length = coffees.length; + (execute = function() { + var script; + script = coffees[index++]; + if ((script != null ? script.type : void 0) === 'text/coffeescript') { + if (script.src) { + return CoffeeScript.load(script.src, execute); + } else { + CoffeeScript.run(script.innerHTML); + return execute(); + } + } + })(); + return null; + }; + + if (window.addEventListener) { + addEventListener('DOMContentLoaded', runScripts, false); + } else { + attachEvent('onload', runScripts); + } + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js new file mode 100644 index 0000000..986d5cc --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/cake.js @@ -0,0 +1,99 @@ +(function() { + var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks; + + fs = require('fs'); + + path = require('path'); + + helpers = require('./helpers'); + + optparse = require('./optparse'); + + CoffeeScript = require('./coffee-script'); + + tasks = {}; + + options = {}; + + switches = []; + + oparse = null; + + helpers.extend(global, { + task: function(name, description, action) { + var _ref; + if (!action) { + _ref = [description, action], action = _ref[0], description = _ref[1]; + } + return tasks[name] = { + name: name, + description: description, + action: action + }; + }, + option: function(letter, flag, description) { + return switches.push([letter, flag, description]); + }, + invoke: function(name) { + if (!tasks[name]) missingTask(name); + return tasks[name].action(options); + } + }); + + exports.run = function() { + var arg, args, _i, _len, _ref, _results; + global.__originalDirname = fs.realpathSync('.'); + process.chdir(cakefileDirectory(__originalDirname)); + args = process.argv.slice(2); + CoffeeScript.run(fs.readFileSync('Cakefile').toString(), { + filename: 'Cakefile' + }); + oparse = new optparse.OptionParser(switches); + if (!args.length) return printTasks(); + try { + options = oparse.parse(args); + } catch (e) { + return fatalError("" + e); + } + _ref = options.arguments; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + arg = _ref[_i]; + _results.push(invoke(arg)); + } + return _results; + }; + + printTasks = function() { + var cakefilePath, desc, name, spaces, task; + cakefilePath = path.join(path.relative(__originalDirname, process.cwd()), 'Cakefile'); + console.log("" + cakefilePath + " defines the following tasks:\n"); + for (name in tasks) { + task = tasks[name]; + spaces = 20 - name.length; + spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; + desc = task.description ? "# " + task.description : ''; + console.log("cake " + name + spaces + " " + desc); + } + if (switches.length) return console.log(oparse.help()); + }; + + fatalError = function(message) { + console.error(message + '\n'); + console.log('To see a list of all tasks/options, run "cake"'); + return process.exit(1); + }; + + missingTask = function(task) { + return fatalError("No such task: " + task); + }; + + cakefileDirectory = function(dir) { + var parent; + if (path.existsSync(path.join(dir, 'Cakefile'))) return dir; + parent = path.normalize(path.join(dir, '..')); + if (parent !== dir) return cakefileDirectory(parent); + throw new Error("Cakefile not found in " + (process.cwd())); + }; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js new file mode 100644 index 0000000..fd410ba --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js @@ -0,0 +1,150 @@ +(function() { + var Lexer, RESERVED, compile, fs, lexer, parser, path, vm, _ref, + __hasProp = Object.prototype.hasOwnProperty; + + fs = require('fs'); + + path = require('path'); + + _ref = require('./lexer'), Lexer = _ref.Lexer, RESERVED = _ref.RESERVED; + + parser = require('./parser').parser; + + vm = require('vm'); + + if (require.extensions) { + require.extensions['.coffee'] = function(module, filename) { + var content; + content = compile(fs.readFileSync(filename, 'utf8'), { + filename: filename + }); + return module._compile(content, filename); + }; + } else if (require.registerExtension) { + require.registerExtension('.coffee', function(content) { + return compile(content); + }); + } + + exports.VERSION = '1.2.0'; + + exports.RESERVED = RESERVED; + + exports.helpers = require('./helpers'); + + exports.compile = compile = function(code, options) { + var merge; + if (options == null) options = {}; + merge = exports.helpers.merge; + try { + return (parser.parse(lexer.tokenize(code))).compile(merge({}, options)); + } catch (err) { + if (options.filename) { + err.message = "In " + options.filename + ", " + err.message; + } + throw err; + } + }; + + exports.tokens = function(code, options) { + return lexer.tokenize(code, options); + }; + + exports.nodes = function(source, options) { + if (typeof source === 'string') { + return parser.parse(lexer.tokenize(source, options)); + } else { + return parser.parse(source); + } + }; + + exports.run = function(code, options) { + var mainModule; + mainModule = require.main; + mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.'; + mainModule.moduleCache && (mainModule.moduleCache = {}); + mainModule.paths = require('module')._nodeModulePaths(path.dirname(options.filename)); + if (path.extname(mainModule.filename) !== '.coffee' || require.extensions) { + return mainModule._compile(compile(code, options), mainModule.filename); + } else { + return mainModule._compile(code, mainModule.filename); + } + }; + + exports.eval = function(code, options) { + var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref2, _ref3, _require; + if (options == null) options = {}; + if (!(code = code.trim())) return; + Script = vm.Script; + if (Script) { + if (options.sandbox != null) { + if (options.sandbox instanceof Script.createContext().constructor) { + sandbox = options.sandbox; + } else { + sandbox = Script.createContext(); + _ref2 = options.sandbox; + for (k in _ref2) { + if (!__hasProp.call(_ref2, k)) continue; + v = _ref2[k]; + sandbox[k] = v; + } + } + sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox; + } else { + sandbox = global; + } + sandbox.__filename = options.filename || 'eval'; + sandbox.__dirname = path.dirname(sandbox.__filename); + if (!(sandbox !== global || sandbox.module || sandbox.require)) { + Module = require('module'); + sandbox.module = _module = new Module(options.modulename || 'eval'); + sandbox.require = _require = function(path) { + return Module._load(path, _module, true); + }; + _module.filename = sandbox.__filename; + _ref3 = Object.getOwnPropertyNames(require); + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + r = _ref3[_i]; + if (r !== 'paths') _require[r] = require[r]; + } + _require.paths = _module.paths = Module._nodeModulePaths(process.cwd()); + _require.resolve = function(request) { + return Module._resolveFilename(request, _module); + }; + } + } + o = {}; + for (k in options) { + if (!__hasProp.call(options, k)) continue; + v = options[k]; + o[k] = v; + } + o.bare = true; + js = compile(code, o); + if (sandbox === global) { + return vm.runInThisContext(js); + } else { + return vm.runInContext(js, sandbox); + } + }; + + lexer = new Lexer; + + parser.lexer = { + lex: function() { + var tag, _ref2; + _ref2 = this.tokens[this.pos++] || [''], tag = _ref2[0], this.yytext = _ref2[1], this.yylineno = _ref2[2]; + return tag; + }, + setInput: function(tokens) { + this.tokens = tokens; + return this.pos = 0; + }, + upcomingInput: function() { + return ""; + } + }; + + parser.yy = require('./nodes'); + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js new file mode 100644 index 0000000..da330b3 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/command.js @@ -0,0 +1,442 @@ +(function() { + var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, forkNode, fs, helpers, joinTimeout, lint, loadRequires, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref; + + fs = require('fs'); + + path = require('path'); + + helpers = require('./helpers'); + + optparse = require('./optparse'); + + CoffeeScript = require('./coffee-script'); + + _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec; + + EventEmitter = require('events').EventEmitter; + + helpers.extend(CoffeeScript, new EventEmitter); + + printLine = function(line) { + return process.stdout.write(line + '\n'); + }; + + printWarn = function(line) { + return process.stderr.write(line + '\n'); + }; + + BANNER = 'Usage: coffee [options] path/to/script.coffee\n\nIf called without options, `coffee` will run your script.'; + + SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [FILE*]', 'require a library before executing your script'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']]; + + opts = {}; + + sources = []; + + sourceCode = []; + + notSources = {}; + + watchers = {}; + + optionParser = null; + + exports.run = function() { + var source, _i, _len, _results; + parseOptions(); + if (opts.nodejs) return forkNode(); + if (opts.help) return usage(); + if (opts.version) return version(); + if (opts.require) loadRequires(); + if (opts.interactive) return require('./repl'); + if (opts.watch && !fs.watch) { + printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + "."); + } + if (opts.stdio) return compileStdio(); + if (opts.eval) return compileScript(null, sources[0]); + if (!sources.length) return require('./repl'); + if (opts.run) opts.literals = sources.splice(1).concat(opts.literals); + process.argv = process.argv.slice(0, 2).concat(opts.literals); + process.argv[0] = 'coffee'; + process.execPath = require.main.filename; + _results = []; + for (_i = 0, _len = sources.length; _i < _len; _i++) { + source = sources[_i]; + _results.push(compilePath(source, true, path.normalize(source))); + } + return _results; + }; + + compilePath = function(source, topLevel, base) { + return fs.stat(source, function(err, stats) { + if (err && err.code !== 'ENOENT') throw err; + if ((err != null ? err.code : void 0) === 'ENOENT') { + if (topLevel && source.slice(-7) !== '.coffee') { + source = sources[sources.indexOf(source)] = "" + source + ".coffee"; + return compilePath(source, topLevel, base); + } + if (topLevel) { + console.error("File not found: " + source); + process.exit(1); + } + return; + } + if (stats.isDirectory()) { + if (opts.watch) watchDir(source, base); + return fs.readdir(source, function(err, files) { + var file, index, _i, _len, _ref2, _results; + if (err && err.code !== 'ENOENT') throw err; + if ((err != null ? err.code : void 0) === 'ENOENT') return; + files = files.map(function(file) { + return path.join(source, file); + }); + index = sources.indexOf(source); + [].splice.apply(sources, [index, index - index + 1].concat(files)), files; + [].splice.apply(sourceCode, [index, index - index + 1].concat(_ref2 = files.map(function() { + return null; + }))), _ref2; + _results = []; + for (_i = 0, _len = files.length; _i < _len; _i++) { + file = files[_i]; + _results.push(compilePath(file, false, base)); + } + return _results; + }); + } else if (topLevel || path.extname(source) === '.coffee') { + if (opts.watch) watch(source, base); + return fs.readFile(source, function(err, code) { + if (err && err.code !== 'ENOENT') throw err; + if ((err != null ? err.code : void 0) === 'ENOENT') return; + return compileScript(source, code.toString(), base); + }); + } else { + notSources[source] = true; + return removeSource(source, base); + } + }); + }; + + compileScript = function(file, input, base) { + var o, options, t, task; + o = opts; + options = compileOptions(file); + try { + t = task = { + file: file, + input: input, + options: options + }; + CoffeeScript.emit('compile', task); + if (o.tokens) { + return printTokens(CoffeeScript.tokens(t.input)); + } else if (o.nodes) { + return printLine(CoffeeScript.nodes(t.input).toString().trim()); + } else if (o.run) { + return CoffeeScript.run(t.input, t.options); + } else if (o.join && t.file !== o.join) { + sourceCode[sources.indexOf(t.file)] = t.input; + return compileJoin(); + } else { + t.output = CoffeeScript.compile(t.input, t.options); + CoffeeScript.emit('success', task); + if (o.print) { + return printLine(t.output.trim()); + } else if (o.compile) { + return writeJs(t.file, t.output, base); + } else if (o.lint) { + return lint(t.file, t.output); + } + } + } catch (err) { + CoffeeScript.emit('failure', err, task); + if (CoffeeScript.listeners('failure').length) return; + if (o.watch) return printLine(err.message); + printWarn(err instanceof Error && err.stack || ("ERROR: " + err)); + return process.exit(1); + } + }; + + compileStdio = function() { + var code, stdin; + code = ''; + stdin = process.openStdin(); + stdin.on('data', function(buffer) { + if (buffer) return code += buffer.toString(); + }); + return stdin.on('end', function() { + return compileScript(null, code); + }); + }; + + joinTimeout = null; + + compileJoin = function() { + if (!opts.join) return; + if (!sourceCode.some(function(code) { + return code === null; + })) { + clearTimeout(joinTimeout); + return joinTimeout = wait(100, function() { + return compileScript(opts.join, sourceCode.join('\n'), opts.join); + }); + } + }; + + loadRequires = function() { + var realFilename, req, _i, _len, _ref2; + realFilename = module.filename; + module.filename = '.'; + _ref2 = opts.require; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + req = _ref2[_i]; + require(req); + } + return module.filename = realFilename; + }; + + watch = function(source, base) { + var callback, compile, compileTimeout, prevStats, watchErr, watcher; + prevStats = null; + compileTimeout = null; + watchErr = function(e) { + if (e.code === 'ENOENT') { + if (sources.indexOf(source) === -1) return; + removeSource(source, base, true); + return compileJoin(); + } else { + throw e; + } + }; + compile = function() { + clearTimeout(compileTimeout); + return compileTimeout = wait(25, function() { + return fs.stat(source, function(err, stats) { + if (err) return watchErr(err); + if (prevStats && (stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime())) { + return; + } + prevStats = stats; + return fs.readFile(source, function(err, code) { + if (err) return watchErr(err); + return compileScript(source, code.toString(), base); + }); + }); + }); + }; + watchErr = function(e) { + if (e.code !== 'ENOENT') throw e; + removeSource(source, base, true); + return compileJoin(); + }; + try { + return watcher = fs.watch(source, callback = function(event) { + if (event === 'change') { + return compile(); + } else if (event === 'rename') { + watcher.close(); + return wait(250, function() { + compile(); + try { + return watcher = fs.watch(source, callback); + } catch (e) { + return watchErr(e); + } + }); + } + }); + } catch (e) { + return watchErr(e); + } + }; + + watchDir = function(source, base) { + var readdirTimeout, watcher; + readdirTimeout = null; + try { + return watcher = fs.watch(source, function() { + clearTimeout(readdirTimeout); + return readdirTimeout = wait(25, function() { + return fs.readdir(source, function(err, files) { + var file, _i, _len, _results; + if (err) { + if (err.code !== 'ENOENT') throw err; + watcher.close(); + return unwatchDir(source, base); + } + files = files.map(function(file) { + return path.join(source, file); + }); + _results = []; + for (_i = 0, _len = files.length; _i < _len; _i++) { + file = files[_i]; + if (!(!notSources[file])) continue; + if (sources.some(function(s) { + return s.indexOf(file) >= 0; + })) { + continue; + } + sources.push(file); + sourceCode.push(null); + _results.push(compilePath(file, false, base)); + } + return _results; + }); + }); + }); + } catch (e) { + if (e.code !== 'ENOENT') throw e; + } + }; + + unwatchDir = function(source, base) { + var file, prevSources, toRemove, _i, _len; + prevSources = sources.slice(); + toRemove = (function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = sources.length; _i < _len; _i++) { + file = sources[_i]; + if (file.indexOf(source) >= 0) _results.push(file); + } + return _results; + })(); + for (_i = 0, _len = toRemove.length; _i < _len; _i++) { + file = toRemove[_i]; + removeSource(file, base, true); + } + if (!sources.some(function(s, i) { + return prevSources[i] !== s; + })) { + return; + } + return compileJoin(); + }; + + removeSource = function(source, base, removeJs) { + var index, jsPath; + index = sources.indexOf(source); + sources.splice(index, 1); + sourceCode.splice(index, 1); + if (removeJs && !opts.join) { + jsPath = outputPath(source, base); + return path.exists(jsPath, function(exists) { + if (exists) { + return fs.unlink(jsPath, function(err) { + if (err && err.code !== 'ENOENT') throw err; + return timeLog("removed " + source); + }); + } + }); + } + }; + + outputPath = function(source, base) { + var baseDir, dir, filename, srcDir; + filename = path.basename(source, path.extname(source)) + '.js'; + srcDir = path.dirname(source); + baseDir = base === '.' ? srcDir : srcDir.substring(base.length); + dir = opts.output ? path.join(opts.output, baseDir) : srcDir; + return path.join(dir, filename); + }; + + writeJs = function(source, js, base) { + var compile, jsDir, jsPath; + jsPath = outputPath(source, base); + jsDir = path.dirname(jsPath); + compile = function() { + if (js.length <= 0) js = ' '; + return fs.writeFile(jsPath, js, function(err) { + if (err) { + return printLine(err.message); + } else if (opts.compile && opts.watch) { + return timeLog("compiled " + source); + } + }); + }; + return path.exists(jsDir, function(exists) { + if (exists) { + return compile(); + } else { + return exec("mkdir -p " + jsDir, compile); + } + }); + }; + + wait = function(milliseconds, func) { + return setTimeout(func, milliseconds); + }; + + timeLog = function(message) { + return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message); + }; + + lint = function(file, js) { + var conf, jsl, printIt; + printIt = function(buffer) { + return printLine(file + ':\t' + buffer.toString().trim()); + }; + conf = __dirname + '/../../extras/jsl.conf'; + jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]); + jsl.stdout.on('data', printIt); + jsl.stderr.on('data', printIt); + jsl.stdin.write(js); + return jsl.stdin.end(); + }; + + printTokens = function(tokens) { + var strings, tag, token, value; + strings = (function() { + var _i, _len, _ref2, _results; + _results = []; + for (_i = 0, _len = tokens.length; _i < _len; _i++) { + token = tokens[_i]; + _ref2 = [token[0], token[1].toString().replace(/\n/, '\\n')], tag = _ref2[0], value = _ref2[1]; + _results.push("[" + tag + " " + value + "]"); + } + return _results; + })(); + return printLine(strings.join(' ')); + }; + + parseOptions = function() { + var i, o, source, _len; + optionParser = new optparse.OptionParser(SWITCHES, BANNER); + o = opts = optionParser.parse(process.argv.slice(2)); + o.compile || (o.compile = !!o.output); + o.run = !(o.compile || o.print || o.lint); + o.print = !!(o.print || (o.eval || o.stdio && o.compile)); + sources = o.arguments; + for (i = 0, _len = sources.length; i < _len; i++) { + source = sources[i]; + sourceCode[i] = null; + } + }; + + compileOptions = function(filename) { + return { + filename: filename, + bare: opts.bare + }; + }; + + forkNode = function() { + var args, nodeArgs; + nodeArgs = opts.nodejs.split(/\s+/); + args = process.argv.slice(1); + args.splice(args.indexOf('--nodejs'), 2); + return spawn(process.execPath, nodeArgs.concat(args), { + cwd: process.cwd(), + env: process.env, + customFds: [0, 1, 2] + }); + }; + + usage = function() { + return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help()); + }; + + version = function() { + return printLine("CoffeeScript version " + CoffeeScript.VERSION); + }; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js new file mode 100644 index 0000000..2424fc7 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/grammar.js @@ -0,0 +1,592 @@ +(function() { + var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap; + + Parser = require('jison').Parser; + + unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/; + + o = function(patternString, action, options) { + var match; + patternString = patternString.replace(/\s{2,}/g, ' '); + if (!action) return [patternString, '$$ = $1;', options]; + action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())"; + action = action.replace(/\bnew /g, '$&yy.'); + action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&'); + return [patternString, "$$ = " + action + ";", options]; + }; + + grammar = { + Root: [ + o('', function() { + return new Block; + }), o('Body'), o('Block TERMINATOR') + ], + Body: [ + o('Line', function() { + return Block.wrap([$1]); + }), o('Body TERMINATOR Line', function() { + return $1.push($3); + }), o('Body TERMINATOR') + ], + Line: [o('Expression'), o('Statement')], + Statement: [ + o('Return'), o('Comment'), o('STATEMENT', function() { + return new Literal($1); + }) + ], + Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')], + Block: [ + o('INDENT OUTDENT', function() { + return new Block; + }), o('INDENT Body OUTDENT', function() { + return $2; + }) + ], + Identifier: [ + o('IDENTIFIER', function() { + return new Literal($1); + }) + ], + AlphaNumeric: [ + o('NUMBER', function() { + return new Literal($1); + }), o('STRING', function() { + return new Literal($1); + }) + ], + Literal: [ + o('AlphaNumeric'), o('JS', function() { + return new Literal($1); + }), o('REGEX', function() { + return new Literal($1); + }), o('DEBUGGER', function() { + return new Literal($1); + }), o('BOOL', function() { + var val; + val = new Literal($1); + if ($1 === 'undefined') val.isUndefined = true; + return val; + }) + ], + Assign: [ + o('Assignable = Expression', function() { + return new Assign($1, $3); + }), o('Assignable = TERMINATOR Expression', function() { + return new Assign($1, $4); + }), o('Assignable = INDENT Expression OUTDENT', function() { + return new Assign($1, $4); + }) + ], + AssignObj: [ + o('ObjAssignable', function() { + return new Value($1); + }), o('ObjAssignable : Expression', function() { + return new Assign(new Value($1), $3, 'object'); + }), o('ObjAssignable :\ + INDENT Expression OUTDENT', function() { + return new Assign(new Value($1), $4, 'object'); + }), o('Comment') + ], + ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')], + Return: [ + o('RETURN Expression', function() { + return new Return($2); + }), o('RETURN', function() { + return new Return; + }) + ], + Comment: [ + o('HERECOMMENT', function() { + return new Comment($1); + }) + ], + Code: [ + o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() { + return new Code($2, $5, $4); + }), o('FuncGlyph Block', function() { + return new Code([], $2, $1); + }) + ], + FuncGlyph: [ + o('->', function() { + return 'func'; + }), o('=>', function() { + return 'boundfunc'; + }) + ], + OptComma: [o(''), o(',')], + ParamList: [ + o('', function() { + return []; + }), o('Param', function() { + return [$1]; + }), o('ParamList , Param', function() { + return $1.concat($3); + }) + ], + Param: [ + o('ParamVar', function() { + return new Param($1); + }), o('ParamVar ...', function() { + return new Param($1, null, true); + }), o('ParamVar = Expression', function() { + return new Param($1, $3); + }) + ], + ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')], + Splat: [ + o('Expression ...', function() { + return new Splat($1); + }) + ], + SimpleAssignable: [ + o('Identifier', function() { + return new Value($1); + }), o('Value Accessor', function() { + return $1.add($2); + }), o('Invocation Accessor', function() { + return new Value($1, [].concat($2)); + }), o('ThisProperty') + ], + Assignable: [ + o('SimpleAssignable'), o('Array', function() { + return new Value($1); + }), o('Object', function() { + return new Value($1); + }) + ], + Value: [ + o('Assignable'), o('Literal', function() { + return new Value($1); + }), o('Parenthetical', function() { + return new Value($1); + }), o('Range', function() { + return new Value($1); + }), o('This') + ], + Accessor: [ + o('. Identifier', function() { + return new Access($2); + }), o('?. Identifier', function() { + return new Access($2, 'soak'); + }), o(':: Identifier', function() { + return [new Access(new Literal('prototype')), new Access($2)]; + }), o('::', function() { + return new Access(new Literal('prototype')); + }), o('Index') + ], + Index: [ + o('INDEX_START IndexValue INDEX_END', function() { + return $2; + }), o('INDEX_SOAK Index', function() { + return extend($2, { + soak: true + }); + }) + ], + IndexValue: [ + o('Expression', function() { + return new Index($1); + }), o('Slice', function() { + return new Slice($1); + }) + ], + Object: [ + o('{ AssignList OptComma }', function() { + return new Obj($2, $1.generated); + }) + ], + AssignList: [ + o('', function() { + return []; + }), o('AssignObj', function() { + return [$1]; + }), o('AssignList , AssignObj', function() { + return $1.concat($3); + }), o('AssignList OptComma TERMINATOR AssignObj', function() { + return $1.concat($4); + }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() { + return $1.concat($4); + }) + ], + Class: [ + o('CLASS', function() { + return new Class; + }), o('CLASS Block', function() { + return new Class(null, null, $2); + }), o('CLASS EXTENDS Expression', function() { + return new Class(null, $3); + }), o('CLASS EXTENDS Expression Block', function() { + return new Class(null, $3, $4); + }), o('CLASS SimpleAssignable', function() { + return new Class($2); + }), o('CLASS SimpleAssignable Block', function() { + return new Class($2, null, $3); + }), o('CLASS SimpleAssignable EXTENDS Expression', function() { + return new Class($2, $4); + }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() { + return new Class($2, $4, $5); + }) + ], + Invocation: [ + o('Value OptFuncExist Arguments', function() { + return new Call($1, $3, $2); + }), o('Invocation OptFuncExist Arguments', function() { + return new Call($1, $3, $2); + }), o('SUPER', function() { + return new Call('super', [new Splat(new Literal('arguments'))]); + }), o('SUPER Arguments', function() { + return new Call('super', $2); + }) + ], + OptFuncExist: [ + o('', function() { + return false; + }), o('FUNC_EXIST', function() { + return true; + }) + ], + Arguments: [ + o('CALL_START CALL_END', function() { + return []; + }), o('CALL_START ArgList OptComma CALL_END', function() { + return $2; + }) + ], + This: [ + o('THIS', function() { + return new Value(new Literal('this')); + }), o('@', function() { + return new Value(new Literal('this')); + }) + ], + ThisProperty: [ + o('@ Identifier', function() { + return new Value(new Literal('this'), [new Access($2)], 'this'); + }) + ], + Array: [ + o('[ ]', function() { + return new Arr([]); + }), o('[ ArgList OptComma ]', function() { + return new Arr($2); + }) + ], + RangeDots: [ + o('..', function() { + return 'inclusive'; + }), o('...', function() { + return 'exclusive'; + }) + ], + Range: [ + o('[ Expression RangeDots Expression ]', function() { + return new Range($2, $4, $3); + }) + ], + Slice: [ + o('Expression RangeDots Expression', function() { + return new Range($1, $3, $2); + }), o('Expression RangeDots', function() { + return new Range($1, null, $2); + }), o('RangeDots Expression', function() { + return new Range(null, $2, $1); + }) + ], + ArgList: [ + o('Arg', function() { + return [$1]; + }), o('ArgList , Arg', function() { + return $1.concat($3); + }), o('ArgList OptComma TERMINATOR Arg', function() { + return $1.concat($4); + }), o('INDENT ArgList OptComma OUTDENT', function() { + return $2; + }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() { + return $1.concat($4); + }) + ], + Arg: [o('Expression'), o('Splat')], + SimpleArgs: [ + o('Expression'), o('SimpleArgs , Expression', function() { + return [].concat($1, $3); + }) + ], + Try: [ + o('TRY Block', function() { + return new Try($2); + }), o('TRY Block Catch', function() { + return new Try($2, $3[0], $3[1]); + }), o('TRY Block FINALLY Block', function() { + return new Try($2, null, null, $4); + }), o('TRY Block Catch FINALLY Block', function() { + return new Try($2, $3[0], $3[1], $5); + }) + ], + Catch: [ + o('CATCH Identifier Block', function() { + return [$2, $3]; + }) + ], + Throw: [ + o('THROW Expression', function() { + return new Throw($2); + }) + ], + Parenthetical: [ + o('( Body )', function() { + return new Parens($2); + }), o('( INDENT Body OUTDENT )', function() { + return new Parens($3); + }) + ], + WhileSource: [ + o('WHILE Expression', function() { + return new While($2); + }), o('WHILE Expression WHEN Expression', function() { + return new While($2, { + guard: $4 + }); + }), o('UNTIL Expression', function() { + return new While($2, { + invert: true + }); + }), o('UNTIL Expression WHEN Expression', function() { + return new While($2, { + invert: true, + guard: $4 + }); + }) + ], + While: [ + o('WhileSource Block', function() { + return $1.addBody($2); + }), o('Statement WhileSource', function() { + return $2.addBody(Block.wrap([$1])); + }), o('Expression WhileSource', function() { + return $2.addBody(Block.wrap([$1])); + }), o('Loop', function() { + return $1; + }) + ], + Loop: [ + o('LOOP Block', function() { + return new While(new Literal('true')).addBody($2); + }), o('LOOP Expression', function() { + return new While(new Literal('true')).addBody(Block.wrap([$2])); + }) + ], + For: [ + o('Statement ForBody', function() { + return new For($1, $2); + }), o('Expression ForBody', function() { + return new For($1, $2); + }), o('ForBody Block', function() { + return new For($2, $1); + }) + ], + ForBody: [ + o('FOR Range', function() { + return { + source: new Value($2) + }; + }), o('ForStart ForSource', function() { + $2.own = $1.own; + $2.name = $1[0]; + $2.index = $1[1]; + return $2; + }) + ], + ForStart: [ + o('FOR ForVariables', function() { + return $2; + }), o('FOR OWN ForVariables', function() { + $3.own = true; + return $3; + }) + ], + ForValue: [ + o('Identifier'), o('Array', function() { + return new Value($1); + }), o('Object', function() { + return new Value($1); + }) + ], + ForVariables: [ + o('ForValue', function() { + return [$1]; + }), o('ForValue , ForValue', function() { + return [$1, $3]; + }) + ], + ForSource: [ + o('FORIN Expression', function() { + return { + source: $2 + }; + }), o('FOROF Expression', function() { + return { + source: $2, + object: true + }; + }), o('FORIN Expression WHEN Expression', function() { + return { + source: $2, + guard: $4 + }; + }), o('FOROF Expression WHEN Expression', function() { + return { + source: $2, + guard: $4, + object: true + }; + }), o('FORIN Expression BY Expression', function() { + return { + source: $2, + step: $4 + }; + }), o('FORIN Expression WHEN Expression BY Expression', function() { + return { + source: $2, + guard: $4, + step: $6 + }; + }), o('FORIN Expression BY Expression WHEN Expression', function() { + return { + source: $2, + step: $4, + guard: $6 + }; + }) + ], + Switch: [ + o('SWITCH Expression INDENT Whens OUTDENT', function() { + return new Switch($2, $4); + }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() { + return new Switch($2, $4, $6); + }), o('SWITCH INDENT Whens OUTDENT', function() { + return new Switch(null, $3); + }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() { + return new Switch(null, $3, $5); + }) + ], + Whens: [ + o('When'), o('Whens When', function() { + return $1.concat($2); + }) + ], + When: [ + o('LEADING_WHEN SimpleArgs Block', function() { + return [[$2, $3]]; + }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() { + return [[$2, $3]]; + }) + ], + IfBlock: [ + o('IF Expression Block', function() { + return new If($2, $3, { + type: $1 + }); + }), o('IfBlock ELSE IF Expression Block', function() { + return $1.addElse(new If($4, $5, { + type: $3 + })); + }) + ], + If: [ + o('IfBlock'), o('IfBlock ELSE Block', function() { + return $1.addElse($3); + }), o('Statement POST_IF Expression', function() { + return new If($3, Block.wrap([$1]), { + type: $2, + statement: true + }); + }), o('Expression POST_IF Expression', function() { + return new If($3, Block.wrap([$1]), { + type: $2, + statement: true + }); + }) + ], + Operation: [ + o('UNARY Expression', function() { + return new Op($1, $2); + }), o('- Expression', (function() { + return new Op('-', $2); + }), { + prec: 'UNARY' + }), o('+ Expression', (function() { + return new Op('+', $2); + }), { + prec: 'UNARY' + }), o('-- SimpleAssignable', function() { + return new Op('--', $2); + }), o('++ SimpleAssignable', function() { + return new Op('++', $2); + }), o('SimpleAssignable --', function() { + return new Op('--', $1, null, true); + }), o('SimpleAssignable ++', function() { + return new Op('++', $1, null, true); + }), o('Expression ?', function() { + return new Existence($1); + }), o('Expression + Expression', function() { + return new Op('+', $1, $3); + }), o('Expression - Expression', function() { + return new Op('-', $1, $3); + }), o('Expression MATH Expression', function() { + return new Op($2, $1, $3); + }), o('Expression SHIFT Expression', function() { + return new Op($2, $1, $3); + }), o('Expression COMPARE Expression', function() { + return new Op($2, $1, $3); + }), o('Expression LOGIC Expression', function() { + return new Op($2, $1, $3); + }), o('Expression RELATION Expression', function() { + if ($2.charAt(0) === '!') { + return new Op($2.slice(1), $1, $3).invert(); + } else { + return new Op($2, $1, $3); + } + }), o('SimpleAssignable COMPOUND_ASSIGN\ + Expression', function() { + return new Assign($1, $3, $2); + }), o('SimpleAssignable COMPOUND_ASSIGN\ + INDENT Expression OUTDENT', function() { + return new Assign($1, $4, $2); + }), o('SimpleAssignable EXTENDS Expression', function() { + return new Extends($1, $3); + }) + ] + }; + + operators = [['left', '.', '?.', '::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'DO', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']]; + + tokens = []; + + for (name in grammar) { + alternatives = grammar[name]; + grammar[name] = (function() { + var _i, _j, _len, _len2, _ref, _results; + _results = []; + for (_i = 0, _len = alternatives.length; _i < _len; _i++) { + alt = alternatives[_i]; + _ref = alt[0].split(' '); + for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) { + token = _ref[_j]; + if (!grammar[token]) tokens.push(token); + } + if (name === 'Root') alt[1] = "return " + alt[1]; + _results.push(alt); + } + return _results; + })(); + } + + exports.parser = new Parser({ + tokens: tokens.join(' '), + bnf: grammar, + operators: operators.reverse(), + startSymbol: 'Root' + }); + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js new file mode 100644 index 0000000..038f781 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/helpers.js @@ -0,0 +1,72 @@ +(function() { + var extend, flatten; + + exports.starts = function(string, literal, start) { + return literal === string.substr(start, literal.length); + }; + + exports.ends = function(string, literal, back) { + var len; + len = literal.length; + return literal === string.substr(string.length - len - (back || 0), len); + }; + + exports.compact = function(array) { + var item, _i, _len, _results; + _results = []; + for (_i = 0, _len = array.length; _i < _len; _i++) { + item = array[_i]; + if (item) _results.push(item); + } + return _results; + }; + + exports.count = function(string, substr) { + var num, pos; + num = pos = 0; + if (!substr.length) return 1 / 0; + while (pos = 1 + string.indexOf(substr, pos)) { + num++; + } + return num; + }; + + exports.merge = function(options, overrides) { + return extend(extend({}, options), overrides); + }; + + extend = exports.extend = function(object, properties) { + var key, val; + for (key in properties) { + val = properties[key]; + object[key] = val; + } + return object; + }; + + exports.flatten = flatten = function(array) { + var element, flattened, _i, _len; + flattened = []; + for (_i = 0, _len = array.length; _i < _len; _i++) { + element = array[_i]; + if (element instanceof Array) { + flattened = flattened.concat(flatten(element)); + } else { + flattened.push(element); + } + } + return flattened; + }; + + exports.del = function(obj, key) { + var val; + val = obj[key]; + delete obj[key]; + return val; + }; + + exports.last = function(array, back) { + return array[array.length - (back || 0) - 1]; + }; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js new file mode 100644 index 0000000..5e6eba9 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/index.js @@ -0,0 +1,10 @@ +(function() { + var key, val, _ref; + + _ref = require('./coffee-script'); + for (key in _ref) { + val = _ref[key]; + exports[key] = val; + } + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js new file mode 100644 index 0000000..1dd3b04 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js @@ -0,0 +1,686 @@ +(function() { + var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref2, + __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES; + + _ref2 = require('./helpers'), count = _ref2.count, starts = _ref2.starts, compact = _ref2.compact, last = _ref2.last; + + exports.Lexer = Lexer = (function() { + + function Lexer() {} + + Lexer.prototype.tokenize = function(code, opts) { + var i, tag; + if (opts == null) opts = {}; + if (WHITESPACE.test(code)) code = "\n" + code; + code = code.replace(/\r/g, '').replace(TRAILING_SPACES, ''); + this.code = code; + this.line = opts.line || 0; + this.indent = 0; + this.indebt = 0; + this.outdebt = 0; + this.indents = []; + this.ends = []; + this.tokens = []; + i = 0; + while (this.chunk = code.slice(i)) { + i += this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); + } + this.closeIndentation(); + if (tag = this.ends.pop()) this.error("missing " + tag); + if (opts.rewrite === false) return this.tokens; + return (new Rewriter).rewrite(this.tokens); + }; + + Lexer.prototype.identifierToken = function() { + var colon, forcedIdentifier, id, input, match, prev, tag, _ref3, _ref4; + if (!(match = IDENTIFIER.exec(this.chunk))) return 0; + input = match[0], id = match[1], colon = match[2]; + if (id === 'own' && this.tag() === 'FOR') { + this.token('OWN', id); + return id.length; + } + forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref3 = prev[0]) === '.' || _ref3 === '?.' || _ref3 === '::') || !prev.spaced && prev[0] === '@'); + tag = 'IDENTIFIER'; + if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { + tag = id.toUpperCase(); + if (tag === 'WHEN' && (_ref4 = this.tag(), __indexOf.call(LINE_BREAK, _ref4) >= 0)) { + tag = 'LEADING_WHEN'; + } else if (tag === 'FOR') { + this.seenFor = true; + } else if (tag === 'UNLESS') { + tag = 'IF'; + } else if (__indexOf.call(UNARY, tag) >= 0) { + tag = 'UNARY'; + } else if (__indexOf.call(RELATION, tag) >= 0) { + if (tag !== 'INSTANCEOF' && this.seenFor) { + tag = 'FOR' + tag; + this.seenFor = false; + } else { + tag = 'RELATION'; + if (this.value() === '!') { + this.tokens.pop(); + id = '!' + id; + } + } + } + } + if (__indexOf.call(['eval', 'arguments'].concat(JS_FORBIDDEN), id) >= 0) { + if (forcedIdentifier) { + tag = 'IDENTIFIER'; + id = new String(id); + id.reserved = true; + } else if (__indexOf.call(RESERVED, id) >= 0) { + this.error("reserved word \"" + id + "\""); + } + } + if (!forcedIdentifier) { + if (__indexOf.call(COFFEE_ALIASES, id) >= 0) id = COFFEE_ALIAS_MAP[id]; + tag = (function() { + switch (id) { + case '!': + return 'UNARY'; + case '==': + case '!=': + return 'COMPARE'; + case '&&': + case '||': + return 'LOGIC'; + case 'true': + case 'false': + case 'null': + case 'undefined': + return 'BOOL'; + case 'break': + case 'continue': + return 'STATEMENT'; + default: + return tag; + } + })(); + } + this.token(tag, id); + if (colon) this.token(':', ':'); + return input.length; + }; + + Lexer.prototype.numberToken = function() { + var binaryLiteral, lexedLength, match, number; + if (!(match = NUMBER.exec(this.chunk))) return 0; + number = match[0]; + lexedLength = number.length; + if (binaryLiteral = /0b([01]+)/.exec(number)) { + number = (parseInt(binaryLiteral[1], 2)).toString(); + } + this.token('NUMBER', number); + return lexedLength; + }; + + Lexer.prototype.stringToken = function() { + var match, string; + switch (this.chunk.charAt(0)) { + case "'": + if (!(match = SIMPLESTR.exec(this.chunk))) return 0; + this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n')); + break; + case '"': + if (!(string = this.balancedString(this.chunk, '"'))) return 0; + if (0 < string.indexOf('#{', 1)) { + this.interpolateString(string.slice(1, -1)); + } else { + this.token('STRING', this.escapeLines(string)); + } + break; + default: + return 0; + } + this.line += count(string, '\n'); + return string.length; + }; + + Lexer.prototype.heredocToken = function() { + var doc, heredoc, match, quote; + if (!(match = HEREDOC.exec(this.chunk))) return 0; + heredoc = match[0]; + quote = heredoc.charAt(0); + doc = this.sanitizeHeredoc(match[2], { + quote: quote, + indent: null + }); + if (quote === '"' && 0 <= doc.indexOf('#{')) { + this.interpolateString(doc, { + heredoc: true + }); + } else { + this.token('STRING', this.makeString(doc, quote, true)); + } + this.line += count(heredoc, '\n'); + return heredoc.length; + }; + + Lexer.prototype.commentToken = function() { + var comment, here, match; + if (!(match = this.chunk.match(COMMENT))) return 0; + comment = match[0], here = match[1]; + if (here) { + this.token('HERECOMMENT', this.sanitizeHeredoc(here, { + herecomment: true, + indent: Array(this.indent + 1).join(' ') + })); + this.token('TERMINATOR', '\n'); + } + this.line += count(comment, '\n'); + return comment.length; + }; + + Lexer.prototype.jsToken = function() { + var match, script; + if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { + return 0; + } + this.token('JS', (script = match[0]).slice(1, -1)); + return script.length; + }; + + Lexer.prototype.regexToken = function() { + var flags, length, match, prev, regex, _ref3, _ref4; + if (this.chunk.charAt(0) !== '/') return 0; + if (match = HEREGEX.exec(this.chunk)) { + length = this.heregexToken(match); + this.line += count(match[0], '\n'); + return length; + } + prev = last(this.tokens); + if (prev && (_ref3 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref3) >= 0)) { + return 0; + } + if (!(match = REGEX.exec(this.chunk))) return 0; + _ref4 = match, match = _ref4[0], regex = _ref4[1], flags = _ref4[2]; + if (regex.slice(0, 2) === '/*') { + this.error('regular expressions cannot begin with `*`'); + } + if (regex === '//') regex = '/(?:)/'; + this.token('REGEX', "" + regex + flags); + return match.length; + }; + + Lexer.prototype.heregexToken = function(match) { + var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref3, _ref4, _ref5, _ref6; + heregex = match[0], body = match[1], flags = match[2]; + if (0 > body.indexOf('#{')) { + re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/'); + if (re.match(/^\*/)) { + this.error('regular expressions cannot begin with `*`'); + } + this.token('REGEX', "/" + (re || '(?:)') + "/" + flags); + return heregex.length; + } + this.token('IDENTIFIER', 'RegExp'); + this.tokens.push(['CALL_START', '(']); + tokens = []; + _ref3 = this.interpolateString(body, { + regex: true + }); + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + _ref4 = _ref3[_i], tag = _ref4[0], value = _ref4[1]; + if (tag === 'TOKENS') { + tokens.push.apply(tokens, value); + } else { + if (!(value = value.replace(HEREGEX_OMIT, ''))) continue; + value = value.replace(/\\/g, '\\\\'); + tokens.push(['STRING', this.makeString(value, '"', true)]); + } + tokens.push(['+', '+']); + } + tokens.pop(); + if (((_ref5 = tokens[0]) != null ? _ref5[0] : void 0) !== 'STRING') { + this.tokens.push(['STRING', '""'], ['+', '+']); + } + (_ref6 = this.tokens).push.apply(_ref6, tokens); + if (flags) this.tokens.push([',', ','], ['STRING', '"' + flags + '"']); + this.token(')', ')'); + return heregex.length; + }; + + Lexer.prototype.lineToken = function() { + var diff, indent, match, noNewlines, prev, size; + if (!(match = MULTI_DENT.exec(this.chunk))) return 0; + indent = match[0]; + this.line += count(indent, '\n'); + this.seenFor = false; + prev = last(this.tokens, 1); + size = indent.length - 1 - indent.lastIndexOf('\n'); + noNewlines = this.unfinished(); + if (size - this.indebt === this.indent) { + if (noNewlines) { + this.suppressNewlines(); + } else { + this.newlineToken(); + } + return indent.length; + } + if (size > this.indent) { + if (noNewlines) { + this.indebt = size - this.indent; + this.suppressNewlines(); + return indent.length; + } + diff = size - this.indent + this.outdebt; + this.token('INDENT', diff); + this.indents.push(diff); + this.ends.push('OUTDENT'); + this.outdebt = this.indebt = 0; + } else { + this.indebt = 0; + this.outdentToken(this.indent - size, noNewlines); + } + this.indent = size; + return indent.length; + }; + + Lexer.prototype.outdentToken = function(moveOut, noNewlines) { + var dent, len; + while (moveOut > 0) { + len = this.indents.length - 1; + if (this.indents[len] === void 0) { + moveOut = 0; + } else if (this.indents[len] === this.outdebt) { + moveOut -= this.outdebt; + this.outdebt = 0; + } else if (this.indents[len] < this.outdebt) { + this.outdebt -= this.indents[len]; + moveOut -= this.indents[len]; + } else { + dent = this.indents.pop() - this.outdebt; + moveOut -= dent; + this.outdebt = 0; + this.pair('OUTDENT'); + this.token('OUTDENT', dent); + } + } + if (dent) this.outdebt -= moveOut; + while (this.value() === ';') { + this.tokens.pop(); + } + if (!(this.tag() === 'TERMINATOR' || noNewlines)) { + this.token('TERMINATOR', '\n'); + } + return this; + }; + + Lexer.prototype.whitespaceToken = function() { + var match, nline, prev; + if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { + return 0; + } + prev = last(this.tokens); + if (prev) prev[match ? 'spaced' : 'newLine'] = true; + if (match) { + return match[0].length; + } else { + return 0; + } + }; + + Lexer.prototype.newlineToken = function() { + while (this.value() === ';') { + this.tokens.pop(); + } + if (this.tag() !== 'TERMINATOR') this.token('TERMINATOR', '\n'); + return this; + }; + + Lexer.prototype.suppressNewlines = function() { + if (this.value() === '\\') this.tokens.pop(); + return this; + }; + + Lexer.prototype.literalToken = function() { + var match, prev, tag, value, _ref3, _ref4, _ref5, _ref6; + if (match = OPERATOR.exec(this.chunk)) { + value = match[0]; + if (CODE.test(value)) this.tagParameters(); + } else { + value = this.chunk.charAt(0); + } + tag = value; + prev = last(this.tokens); + if (value === '=' && prev) { + if (!prev[1].reserved && (_ref3 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref3) >= 0)) { + this.error("reserved word \"" + (this.value()) + "\" can't be assigned"); + } + if ((_ref4 = prev[1]) === '||' || _ref4 === '&&') { + prev[0] = 'COMPOUND_ASSIGN'; + prev[1] += '='; + return value.length; + } + } + if (value === ';') { + this.seenFor = false; + tag = 'TERMINATOR'; + } else if (__indexOf.call(MATH, value) >= 0) { + tag = 'MATH'; + } else if (__indexOf.call(COMPARE, value) >= 0) { + tag = 'COMPARE'; + } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) { + tag = 'COMPOUND_ASSIGN'; + } else if (__indexOf.call(UNARY, value) >= 0) { + tag = 'UNARY'; + } else if (__indexOf.call(SHIFT, value) >= 0) { + tag = 'SHIFT'; + } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) { + tag = 'LOGIC'; + } else if (prev && !prev.spaced) { + if (value === '(' && (_ref5 = prev[0], __indexOf.call(CALLABLE, _ref5) >= 0)) { + if (prev[0] === '?') prev[0] = 'FUNC_EXIST'; + tag = 'CALL_START'; + } else if (value === '[' && (_ref6 = prev[0], __indexOf.call(INDEXABLE, _ref6) >= 0)) { + tag = 'INDEX_START'; + switch (prev[0]) { + case '?': + prev[0] = 'INDEX_SOAK'; + } + } + } + switch (value) { + case '(': + case '{': + case '[': + this.ends.push(INVERSES[value]); + break; + case ')': + case '}': + case ']': + this.pair(value); + } + this.token(tag, value); + return value.length; + }; + + Lexer.prototype.sanitizeHeredoc = function(doc, options) { + var attempt, herecomment, indent, match, _ref3; + indent = options.indent, herecomment = options.herecomment; + if (herecomment) { + if (HEREDOC_ILLEGAL.test(doc)) { + this.error("block comment cannot contain \"*/\", starting"); + } + if (doc.indexOf('\n') <= 0) return doc; + } else { + while (match = HEREDOC_INDENT.exec(doc)) { + attempt = match[1]; + if (indent === null || (0 < (_ref3 = attempt.length) && _ref3 < indent.length)) { + indent = attempt; + } + } + } + if (indent) doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); + if (!herecomment) doc = doc.replace(/^\n/, ''); + return doc; + }; + + Lexer.prototype.tagParameters = function() { + var i, stack, tok, tokens; + if (this.tag() !== ')') return this; + stack = []; + tokens = this.tokens; + i = tokens.length; + tokens[--i][0] = 'PARAM_END'; + while (tok = tokens[--i]) { + switch (tok[0]) { + case ')': + stack.push(tok); + break; + case '(': + case 'CALL_START': + if (stack.length) { + stack.pop(); + } else if (tok[0] === '(') { + tok[0] = 'PARAM_START'; + return this; + } else { + return this; + } + } + } + return this; + }; + + Lexer.prototype.closeIndentation = function() { + return this.outdentToken(this.indent); + }; + + Lexer.prototype.balancedString = function(str, end) { + var i, letter, match, prev, stack, _ref3; + stack = [end]; + for (i = 1, _ref3 = str.length; 1 <= _ref3 ? i < _ref3 : i > _ref3; 1 <= _ref3 ? i++ : i--) { + switch (letter = str.charAt(i)) { + case '\\': + i++; + continue; + case end: + stack.pop(); + if (!stack.length) return str.slice(0, i + 1); + end = stack[stack.length - 1]; + continue; + } + if (end === '}' && (letter === '"' || letter === "'")) { + stack.push(end = letter); + } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) { + i += match[0].length - 1; + } else if (end === '}' && letter === '{') { + stack.push(end = '}'); + } else if (end === '"' && prev === '#' && letter === '{') { + stack.push(end = '}'); + } + prev = letter; + } + return this.error("missing " + (stack.pop()) + ", starting"); + }; + + Lexer.prototype.interpolateString = function(str, options) { + var expr, heredoc, i, inner, interpolated, len, letter, nested, pi, regex, tag, tokens, value, _len, _ref3, _ref4, _ref5; + if (options == null) options = {}; + heredoc = options.heredoc, regex = options.regex; + tokens = []; + pi = 0; + i = -1; + while (letter = str.charAt(i += 1)) { + if (letter === '\\') { + i += 1; + continue; + } + if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { + continue; + } + if (pi < i) tokens.push(['NEOSTRING', str.slice(pi, i)]); + inner = expr.slice(1, -1); + if (inner.length) { + nested = new Lexer().tokenize(inner, { + line: this.line, + rewrite: false + }); + nested.pop(); + if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') { + nested.shift(); + } + if (len = nested.length) { + if (len > 1) { + nested.unshift(['(', '(', this.line]); + nested.push([')', ')', this.line]); + } + tokens.push(['TOKENS', nested]); + } + } + i += expr.length; + pi = i + 1; + } + if ((i > pi && pi < str.length)) tokens.push(['NEOSTRING', str.slice(pi)]); + if (regex) return tokens; + if (!tokens.length) return this.token('STRING', '""'); + if (tokens[0][0] !== 'NEOSTRING') tokens.unshift(['', '']); + if (interpolated = tokens.length > 1) this.token('(', '('); + for (i = 0, _len = tokens.length; i < _len; i++) { + _ref4 = tokens[i], tag = _ref4[0], value = _ref4[1]; + if (i) this.token('+', '+'); + if (tag === 'TOKENS') { + (_ref5 = this.tokens).push.apply(_ref5, value); + } else { + this.token('STRING', this.makeString(value, '"', heredoc)); + } + } + if (interpolated) this.token(')', ')'); + return tokens; + }; + + Lexer.prototype.pair = function(tag) { + var size, wanted; + if (tag !== (wanted = last(this.ends))) { + if ('OUTDENT' !== wanted) this.error("unmatched " + tag); + this.indent -= size = last(this.indents); + this.outdentToken(size, true); + return this.pair(tag); + } + return this.ends.pop(); + }; + + Lexer.prototype.token = function(tag, value) { + return this.tokens.push([tag, value, this.line]); + }; + + Lexer.prototype.tag = function(index, tag) { + var tok; + return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]); + }; + + Lexer.prototype.value = function(index, val) { + var tok; + return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]); + }; + + Lexer.prototype.unfinished = function() { + var _ref3; + return LINE_CONTINUER.test(this.chunk) || ((_ref3 = this.tag()) === '\\' || _ref3 === '.' || _ref3 === '?.' || _ref3 === 'UNARY' || _ref3 === 'MATH' || _ref3 === '+' || _ref3 === '-' || _ref3 === 'SHIFT' || _ref3 === 'RELATION' || _ref3 === 'COMPARE' || _ref3 === 'LOGIC' || _ref3 === 'COMPOUND_ASSIGN' || _ref3 === 'THROW' || _ref3 === 'EXTENDS'); + }; + + Lexer.prototype.escapeLines = function(str, heredoc) { + return str.replace(MULTILINER, heredoc ? '\\n' : ''); + }; + + Lexer.prototype.makeString = function(body, quote, heredoc) { + if (!body) return quote + quote; + body = body.replace(/\\([\s\S])/g, function(match, contents) { + if (contents === '\n' || contents === quote) { + return contents; + } else { + return match; + } + }); + body = body.replace(RegExp("" + quote, "g"), '\\$&'); + return quote + this.escapeLines(body, heredoc) + quote; + }; + + Lexer.prototype.error = function(message) { + throw SyntaxError("" + message + " on line " + (this.line + 1)); + }; + + return Lexer; + + })(); + + JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; + + COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when']; + + COFFEE_ALIAS_MAP = { + and: '&&', + or: '||', + is: '==', + isnt: '!=', + not: '!', + yes: 'true', + no: 'false', + on: 'true', + off: 'false' + }; + + COFFEE_ALIASES = (function() { + var _results; + _results = []; + for (key in COFFEE_ALIAS_MAP) { + _results.push(key); + } + return _results; + })(); + + COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); + + RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf']; + + JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED); + + exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS); + + IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/; + + NUMBER = /^0x[\da-f]+|^0b[01]+|^\d*\.?\d+(?:e[+-]?\d+)?/i; + + HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/; + + OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/; + + WHITESPACE = /^[^\n\S]+/; + + COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/; + + CODE = /^[-=]>/; + + MULTI_DENT = /^(?:\n[^\n\S]*)+/; + + SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/; + + JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/; + + REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/; + + HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/; + + HEREGEX_OMIT = /\s+(?:#.*)?/g; + + MULTILINER = /\n/g; + + HEREDOC_INDENT = /\n+([^\n\S]*)/g; + + HEREDOC_ILLEGAL = /\*\//; + + LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/; + + TRAILING_SPACES = /\s+$/; + + COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=']; + + UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO']; + + LOGIC = ['&&', '||', '&', '|', '^']; + + SHIFT = ['<<', '>>', '>>>']; + + COMPARE = ['==', '!=', '<', '>', '<=', '>=']; + + MATH = ['*', '/', '%']; + + RELATION = ['IN', 'OF', 'INSTANCEOF']; + + BOOL = ['TRUE', 'FALSE', 'NULL', 'UNDEFINED']; + + NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']']; + + NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); + + CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; + + INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL'); + + LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js new file mode 100644 index 0000000..1941298 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/nodes.js @@ -0,0 +1,2514 @@ +(function() { + var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, starts, unfoldSoak, utility, _ref, + __hasProp = Object.prototype.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }, + __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + Scope = require('./scope').Scope; + + RESERVED = require('./lexer').RESERVED; + + _ref = require('./helpers'), compact = _ref.compact, flatten = _ref.flatten, extend = _ref.extend, merge = _ref.merge, del = _ref.del, starts = _ref.starts, ends = _ref.ends, last = _ref.last; + + exports.extend = extend; + + YES = function() { + return true; + }; + + NO = function() { + return false; + }; + + THIS = function() { + return this; + }; + + NEGATE = function() { + this.negated = !this.negated; + return this; + }; + + exports.Base = Base = (function() { + + function Base() {} + + Base.prototype.compile = function(o, lvl) { + var node; + o = extend({}, o); + if (lvl) o.level = lvl; + node = this.unfoldSoak(o) || this; + node.tab = o.indent; + if (o.level === LEVEL_TOP || !node.isStatement(o)) { + return node.compileNode(o); + } else { + return node.compileClosure(o); + } + }; + + Base.prototype.compileClosure = function(o) { + if (this.jumps()) { + throw SyntaxError('cannot use a pure statement in an expression.'); + } + o.sharedScope = true; + return Closure.wrap(this).compileNode(o); + }; + + Base.prototype.cache = function(o, level, reused) { + var ref, sub; + if (!this.isComplex()) { + ref = level ? this.compile(o, level) : this; + return [ref, ref]; + } else { + ref = new Literal(reused || o.scope.freeVariable('ref')); + sub = new Assign(ref, this); + if (level) { + return [sub.compile(o, level), ref.value]; + } else { + return [sub, ref]; + } + } + }; + + Base.prototype.compileLoopReference = function(o, name) { + var src, tmp; + src = tmp = this.compile(o, LEVEL_LIST); + if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) { + src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src; + } + return [src, tmp]; + }; + + Base.prototype.makeReturn = function(res) { + var me; + me = this.unwrapAll(); + if (res) { + return new Call(new Literal("" + res + ".push"), [me]); + } else { + return new Return(me); + } + }; + + Base.prototype.contains = function(pred) { + var contains; + contains = false; + this.traverseChildren(false, function(node) { + if (pred(node)) { + contains = true; + return false; + } + }); + return contains; + }; + + Base.prototype.containsType = function(type) { + return this instanceof type || this.contains(function(node) { + return node instanceof type; + }); + }; + + Base.prototype.lastNonComment = function(list) { + var i; + i = list.length; + while (i--) { + if (!(list[i] instanceof Comment)) return list[i]; + } + return null; + }; + + Base.prototype.toString = function(idt, name) { + var tree; + if (idt == null) idt = ''; + if (name == null) name = this.constructor.name; + tree = '\n' + idt + name; + if (this.soak) tree += '?'; + this.eachChild(function(node) { + return tree += node.toString(idt + TAB); + }); + return tree; + }; + + Base.prototype.eachChild = function(func) { + var attr, child, _i, _j, _len, _len2, _ref2, _ref3; + if (!this.children) return this; + _ref2 = this.children; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + attr = _ref2[_i]; + if (this[attr]) { + _ref3 = flatten([this[attr]]); + for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) { + child = _ref3[_j]; + if (func(child) === false) return this; + } + } + } + return this; + }; + + Base.prototype.traverseChildren = function(crossScope, func) { + return this.eachChild(function(child) { + if (func(child) === false) return false; + return child.traverseChildren(crossScope, func); + }); + }; + + Base.prototype.invert = function() { + return new Op('!', this); + }; + + Base.prototype.unwrapAll = function() { + var node; + node = this; + while (node !== (node = node.unwrap())) { + continue; + } + return node; + }; + + Base.prototype.children = []; + + Base.prototype.isStatement = NO; + + Base.prototype.jumps = NO; + + Base.prototype.isComplex = YES; + + Base.prototype.isChainable = NO; + + Base.prototype.isAssignable = NO; + + Base.prototype.unwrap = THIS; + + Base.prototype.unfoldSoak = NO; + + Base.prototype.assigns = NO; + + return Base; + + })(); + + exports.Block = Block = (function(_super) { + + __extends(Block, _super); + + function Block(nodes) { + this.expressions = compact(flatten(nodes || [])); + } + + Block.prototype.children = ['expressions']; + + Block.prototype.push = function(node) { + this.expressions.push(node); + return this; + }; + + Block.prototype.pop = function() { + return this.expressions.pop(); + }; + + Block.prototype.unshift = function(node) { + this.expressions.unshift(node); + return this; + }; + + Block.prototype.unwrap = function() { + if (this.expressions.length === 1) { + return this.expressions[0]; + } else { + return this; + } + }; + + Block.prototype.isEmpty = function() { + return !this.expressions.length; + }; + + Block.prototype.isStatement = function(o) { + var exp, _i, _len, _ref2; + _ref2 = this.expressions; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + exp = _ref2[_i]; + if (exp.isStatement(o)) return true; + } + return false; + }; + + Block.prototype.jumps = function(o) { + var exp, _i, _len, _ref2; + _ref2 = this.expressions; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + exp = _ref2[_i]; + if (exp.jumps(o)) return exp; + } + }; + + Block.prototype.makeReturn = function(res) { + var expr, len; + len = this.expressions.length; + while (len--) { + expr = this.expressions[len]; + if (!(expr instanceof Comment)) { + this.expressions[len] = expr.makeReturn(res); + if (expr instanceof Return && !expr.expression) { + this.expressions.splice(len, 1); + } + break; + } + } + return this; + }; + + Block.prototype.compile = function(o, level) { + if (o == null) o = {}; + if (o.scope) { + return Block.__super__.compile.call(this, o, level); + } else { + return this.compileRoot(o); + } + }; + + Block.prototype.compileNode = function(o) { + var code, codes, node, top, _i, _len, _ref2; + this.tab = o.indent; + top = o.level === LEVEL_TOP; + codes = []; + _ref2 = this.expressions; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + node = _ref2[_i]; + node = node.unwrapAll(); + node = node.unfoldSoak(o) || node; + if (node instanceof Block) { + codes.push(node.compileNode(o)); + } else if (top) { + node.front = true; + code = node.compile(o); + codes.push(node.isStatement(o) ? code : "" + this.tab + code + ";"); + } else { + codes.push(node.compile(o, LEVEL_LIST)); + } + } + if (top) { + if (this.spaced) { + return "\n" + (codes.join('\n\n')) + "\n"; + } else { + return codes.join('\n'); + } + } + code = codes.join(', ') || 'void 0'; + if (codes.length > 1 && o.level >= LEVEL_LIST) { + return "(" + code + ")"; + } else { + return code; + } + }; + + Block.prototype.compileRoot = function(o) { + var code, exp, i, prelude, preludeExps, rest; + o.indent = o.bare ? '' : TAB; + o.scope = new Scope(null, this, null); + o.level = LEVEL_TOP; + this.spaced = true; + prelude = ""; + if (!o.bare) { + preludeExps = (function() { + var _len, _ref2, _results; + _ref2 = this.expressions; + _results = []; + for (i = 0, _len = _ref2.length; i < _len; i++) { + exp = _ref2[i]; + if (!(exp.unwrap() instanceof Comment)) break; + _results.push(exp); + } + return _results; + }).call(this); + rest = this.expressions.slice(preludeExps.length); + this.expressions = preludeExps; + if (preludeExps.length) { + prelude = "" + (this.compileNode(merge(o, { + indent: '' + }))) + "\n"; + } + this.expressions = rest; + } + code = this.compileWithDeclarations(o); + if (o.bare) return code; + return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n"; + }; + + Block.prototype.compileWithDeclarations = function(o) { + var assigns, code, declars, exp, i, post, rest, scope, spaced, _len, _ref2, _ref3, _ref4; + code = post = ''; + _ref2 = this.expressions; + for (i = 0, _len = _ref2.length; i < _len; i++) { + exp = _ref2[i]; + exp = exp.unwrap(); + if (!(exp instanceof Comment || exp instanceof Literal)) break; + } + o = merge(o, { + level: LEVEL_TOP + }); + if (i) { + rest = this.expressions.splice(i, 9e9); + _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; + _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1]; + this.expressions = rest; + } + post = this.compileNode(o); + scope = o.scope; + if (scope.expressions === this) { + declars = o.scope.hasDeclarations(); + assigns = scope.hasAssignments; + if (declars || assigns) { + if (i) code += '\n'; + code += "" + this.tab + "var "; + if (declars) code += scope.declaredVariables().join(', '); + if (assigns) { + if (declars) code += ",\n" + (this.tab + TAB); + code += scope.assignedVariables().join(",\n" + (this.tab + TAB)); + } + code += ';\n'; + } + } + return code + post; + }; + + Block.wrap = function(nodes) { + if (nodes.length === 1 && nodes[0] instanceof Block) return nodes[0]; + return new Block(nodes); + }; + + return Block; + + })(Base); + + exports.Literal = Literal = (function(_super) { + + __extends(Literal, _super); + + function Literal(value) { + this.value = value; + } + + Literal.prototype.makeReturn = function() { + if (this.isStatement()) { + return this; + } else { + return Literal.__super__.makeReturn.apply(this, arguments); + } + }; + + Literal.prototype.isAssignable = function() { + return IDENTIFIER.test(this.value); + }; + + Literal.prototype.isStatement = function() { + var _ref2; + return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger'; + }; + + Literal.prototype.isComplex = NO; + + Literal.prototype.assigns = function(name) { + return name === this.value; + }; + + Literal.prototype.jumps = function(o) { + if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) { + return this; + } + if (this.value === 'continue' && !(o != null ? o.loop : void 0)) return this; + }; + + Literal.prototype.compileNode = function(o) { + var code, _ref2, _ref3; + code = this.isUndefined ? o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0' : this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved && ((_ref3 = "" + this.value) !== 'eval' && _ref3 !== 'arguments') ? "\"" + this.value + "\"" : this.value; + if (this.isStatement()) { + return "" + this.tab + code + ";"; + } else { + return code; + } + }; + + Literal.prototype.toString = function() { + return ' "' + this.value + '"'; + }; + + return Literal; + + })(Base); + + exports.Return = Return = (function(_super) { + + __extends(Return, _super); + + function Return(expr) { + if (expr && !expr.unwrap().isUndefined) this.expression = expr; + } + + Return.prototype.children = ['expression']; + + Return.prototype.isStatement = YES; + + Return.prototype.makeReturn = THIS; + + Return.prototype.jumps = THIS; + + Return.prototype.compile = function(o, level) { + var expr, _ref2; + expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0; + if (expr && !(expr instanceof Return)) { + return expr.compile(o, level); + } else { + return Return.__super__.compile.call(this, o, level); + } + }; + + Return.prototype.compileNode = function(o) { + return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";"); + }; + + return Return; + + })(Base); + + exports.Value = Value = (function(_super) { + + __extends(Value, _super); + + function Value(base, props, tag) { + if (!props && base instanceof Value) return base; + this.base = base; + this.properties = props || []; + if (tag) this[tag] = true; + return this; + } + + Value.prototype.children = ['base', 'properties']; + + Value.prototype.add = function(props) { + this.properties = this.properties.concat(props); + return this; + }; + + Value.prototype.hasProperties = function() { + return !!this.properties.length; + }; + + Value.prototype.isArray = function() { + return !this.properties.length && this.base instanceof Arr; + }; + + Value.prototype.isComplex = function() { + return this.hasProperties() || this.base.isComplex(); + }; + + Value.prototype.isAssignable = function() { + return this.hasProperties() || this.base.isAssignable(); + }; + + Value.prototype.isSimpleNumber = function() { + return this.base instanceof Literal && SIMPLENUM.test(this.base.value); + }; + + Value.prototype.isAtomic = function() { + var node, _i, _len, _ref2; + _ref2 = this.properties.concat(this.base); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + node = _ref2[_i]; + if (node.soak || node instanceof Call) return false; + } + return true; + }; + + Value.prototype.isStatement = function(o) { + return !this.properties.length && this.base.isStatement(o); + }; + + Value.prototype.assigns = function(name) { + return !this.properties.length && this.base.assigns(name); + }; + + Value.prototype.jumps = function(o) { + return !this.properties.length && this.base.jumps(o); + }; + + Value.prototype.isObject = function(onlyGenerated) { + if (this.properties.length) return false; + return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); + }; + + Value.prototype.isSplice = function() { + return last(this.properties) instanceof Slice; + }; + + Value.prototype.unwrap = function() { + if (this.properties.length) { + return this; + } else { + return this.base; + } + }; + + Value.prototype.cacheReference = function(o) { + var base, bref, name, nref; + name = last(this.properties); + if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) { + return [this, this]; + } + base = new Value(this.base, this.properties.slice(0, -1)); + if (base.isComplex()) { + bref = new Literal(o.scope.freeVariable('base')); + base = new Value(new Parens(new Assign(bref, base))); + } + if (!name) return [base, bref]; + if (name.isComplex()) { + nref = new Literal(o.scope.freeVariable('name')); + name = new Index(new Assign(nref, name.index)); + nref = new Index(nref); + } + return [base.add(name), new Value(bref || base.base, [nref || name])]; + }; + + Value.prototype.compileNode = function(o) { + var code, prop, props, _i, _len; + this.base.front = this.front; + props = this.properties; + code = this.base.compile(o, props.length ? LEVEL_ACCESS : null); + if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) { + code = "" + code + "."; + } + for (_i = 0, _len = props.length; _i < _len; _i++) { + prop = props[_i]; + code += prop.compile(o); + } + return code; + }; + + Value.prototype.unfoldSoak = function(o) { + var result, + _this = this; + if (this.unfoldedSoak != null) return this.unfoldedSoak; + result = (function() { + var fst, i, ifn, prop, ref, snd, _len, _ref2; + if (ifn = _this.base.unfoldSoak(o)) { + Array.prototype.push.apply(ifn.body.properties, _this.properties); + return ifn; + } + _ref2 = _this.properties; + for (i = 0, _len = _ref2.length; i < _len; i++) { + prop = _ref2[i]; + if (!prop.soak) continue; + prop.soak = false; + fst = new Value(_this.base, _this.properties.slice(0, i)); + snd = new Value(_this.base, _this.properties.slice(i)); + if (fst.isComplex()) { + ref = new Literal(o.scope.freeVariable('ref')); + fst = new Parens(new Assign(ref, fst)); + snd.base = ref; + } + return new If(new Existence(fst), snd, { + soak: true + }); + } + return null; + })(); + return this.unfoldedSoak = result || false; + }; + + return Value; + + })(Base); + + exports.Comment = Comment = (function(_super) { + + __extends(Comment, _super); + + function Comment(comment) { + this.comment = comment; + } + + Comment.prototype.isStatement = YES; + + Comment.prototype.makeReturn = THIS; + + Comment.prototype.compileNode = function(o, level) { + var code; + code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/"); + if ((level || o.level) === LEVEL_TOP) code = o.indent + code; + return code; + }; + + return Comment; + + })(Base); + + exports.Call = Call = (function(_super) { + + __extends(Call, _super); + + function Call(variable, args, soak) { + this.args = args != null ? args : []; + this.soak = soak; + this.isNew = false; + this.isSuper = variable === 'super'; + this.variable = this.isSuper ? null : variable; + } + + Call.prototype.children = ['variable', 'args']; + + Call.prototype.newInstance = function() { + var base, _ref2; + base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; + if (base instanceof Call && !base.isNew) { + base.newInstance(); + } else { + this.isNew = true; + } + return this; + }; + + Call.prototype.superReference = function(o) { + var accesses, method, name; + method = o.scope.method; + if (!method) throw SyntaxError('cannot call super outside of a function.'); + name = method.name; + if (name == null) { + throw SyntaxError('cannot call super on an anonymous function.'); + } + if (method.klass) { + accesses = [new Access(new Literal('__super__'))]; + if (method.static) accesses.push(new Access(new Literal('constructor'))); + accesses.push(new Access(new Literal(name))); + return (new Value(new Literal(method.klass), accesses)).compile(o); + } else { + return "" + name + ".__super__.constructor"; + } + }; + + Call.prototype.unfoldSoak = function(o) { + var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; + if (this.soak) { + if (this.variable) { + if (ifn = unfoldSoak(o, this, 'variable')) return ifn; + _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1]; + } else { + left = new Literal(this.superReference(o)); + rite = new Value(left); + } + rite = new Call(rite, this.args); + rite.isNew = this.isNew; + left = new Literal("typeof " + (left.compile(o)) + " === \"function\""); + return new If(left, new Value(rite), { + soak: true + }); + } + call = this; + list = []; + while (true) { + if (call.variable instanceof Call) { + list.push(call); + call = call.variable; + continue; + } + if (!(call.variable instanceof Value)) break; + list.push(call); + if (!((call = call.variable.base) instanceof Call)) break; + } + _ref3 = list.reverse(); + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + call = _ref3[_i]; + if (ifn) { + if (call.variable instanceof Call) { + call.variable = ifn; + } else { + call.variable.base = ifn; + } + } + ifn = unfoldSoak(o, call, 'variable'); + } + return ifn; + }; + + Call.prototype.filterImplicitObjects = function(list) { + var node, nodes, obj, prop, properties, _i, _j, _len, _len2, _ref2; + nodes = []; + for (_i = 0, _len = list.length; _i < _len; _i++) { + node = list[_i]; + if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) { + nodes.push(node); + continue; + } + obj = null; + _ref2 = node.base.properties; + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + prop = _ref2[_j]; + if (prop instanceof Assign || prop instanceof Comment) { + if (!obj) nodes.push(obj = new Obj(properties = [], true)); + properties.push(prop); + } else { + nodes.push(prop); + obj = null; + } + } + } + return nodes; + }; + + Call.prototype.compileNode = function(o) { + var arg, args, code, _ref2; + if ((_ref2 = this.variable) != null) _ref2.front = this.front; + if (code = Splat.compileSplattedArray(o, this.args, true)) { + return this.compileSplat(o, code); + } + args = this.filterImplicitObjects(this.args); + args = ((function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = args.length; _i < _len; _i++) { + arg = args[_i]; + _results.push(arg.compile(o, LEVEL_LIST)); + } + return _results; + })()).join(', '); + if (this.isSuper) { + return this.superReference(o) + (".call(this" + (args && ', ' + args) + ")"); + } else { + return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")"); + } + }; + + Call.prototype.compileSuper = function(args, o) { + return "" + (this.superReference(o)) + ".call(this" + (args.length ? ', ' : '') + args + ")"; + }; + + Call.prototype.compileSplat = function(o, splatArgs) { + var base, fun, idt, name, ref; + if (this.isSuper) { + return "" + (this.superReference(o)) + ".apply(this, " + splatArgs + ")"; + } + if (this.isNew) { + idt = this.tab + TAB; + return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return typeof result === \"object\" ? result : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function() {})"; + } + base = new Value(this.variable); + if ((name = base.properties.pop()) && base.isComplex()) { + ref = o.scope.freeVariable('ref'); + fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o)); + } else { + fun = base.compile(o, LEVEL_ACCESS); + if (SIMPLENUM.test(fun)) fun = "(" + fun + ")"; + if (name) { + ref = fun; + fun += name.compile(o); + } else { + ref = 'null'; + } + } + return "" + fun + ".apply(" + ref + ", " + splatArgs + ")"; + }; + + return Call; + + })(Base); + + exports.Extends = Extends = (function(_super) { + + __extends(Extends, _super); + + function Extends(child, parent) { + this.child = child; + this.parent = parent; + } + + Extends.prototype.children = ['child', 'parent']; + + Extends.prototype.compile = function(o) { + return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o); + }; + + return Extends; + + })(Base); + + exports.Access = Access = (function(_super) { + + __extends(Access, _super); + + function Access(name, tag) { + this.name = name; + this.name.asKey = true; + this.soak = tag === 'soak'; + } + + Access.prototype.children = ['name']; + + Access.prototype.compile = function(o) { + var name; + name = this.name.compile(o); + if (IDENTIFIER.test(name)) { + return "." + name; + } else { + return "[" + name + "]"; + } + }; + + Access.prototype.isComplex = NO; + + return Access; + + })(Base); + + exports.Index = Index = (function(_super) { + + __extends(Index, _super); + + function Index(index) { + this.index = index; + } + + Index.prototype.children = ['index']; + + Index.prototype.compile = function(o) { + return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]"; + }; + + Index.prototype.isComplex = function() { + return this.index.isComplex(); + }; + + return Index; + + })(Base); + + exports.Range = Range = (function(_super) { + + __extends(Range, _super); + + Range.prototype.children = ['from', 'to']; + + function Range(from, to, tag) { + this.from = from; + this.to = to; + this.exclusive = tag === 'exclusive'; + this.equals = this.exclusive ? '' : '='; + } + + Range.prototype.compileVariables = function(o) { + var step, _ref2, _ref3, _ref4, _ref5; + o = merge(o, { + top: true + }); + _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1]; + _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1]; + if (step = del(o, 'step')) { + _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1]; + } + _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; + if (this.stepVar) return this.stepNum = this.stepVar.match(SIMPLENUM); + }; + + Range.prototype.compileNode = function(o) { + var cond, condPart, from, gt, idx, known, lt, stepPart, to, varPart, _ref2, _ref3; + if (!this.fromVar) this.compileVariables(o); + if (!o.index) return this.compileArray(o); + known = this.fromNum && this.toNum; + idx = del(o, 'index'); + varPart = "" + idx + " = " + this.fromC; + if (this.toC !== this.toVar) varPart += ", " + this.toC; + if (this.step !== this.stepVar) varPart += ", " + this.step; + _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1]; + condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); + stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? from <= to ? "" + idx + "++" : "" + idx + "--" : "" + cond + " ? " + idx + "++ : " + idx + "--"; + return "" + varPart + "; " + condPart + "; " + stepPart; + }; + + Range.prototype.compileArray = function(o) { + var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results; + if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) { + range = (function() { + _results = []; + for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); } + return _results; + }).apply(this); + if (this.exclusive) range.pop(); + return "[" + (range.join(', ')) + "]"; + } + idt = this.tab + TAB; + i = o.scope.freeVariable('i'); + result = o.scope.freeVariable('results'); + pre = "\n" + idt + result + " = [];"; + if (this.fromNum && this.toNum) { + o.index = i; + body = this.compileNode(o); + } else { + vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); + cond = "" + this.fromVar + " <= " + this.toVar; + body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--"; + } + post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; + hasArgs = function(node) { + return node != null ? node.contains(function(n) { + return n instanceof Literal && n.value === 'arguments' && !n.asKey; + }) : void 0; + }; + if (hasArgs(this.from) || hasArgs(this.to)) args = ', arguments'; + return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")"; + }; + + return Range; + + })(Base); + + exports.Slice = Slice = (function(_super) { + + __extends(Slice, _super); + + Slice.prototype.children = ['range']; + + function Slice(range) { + this.range = range; + Slice.__super__.constructor.call(this); + } + + Slice.prototype.compileNode = function(o) { + var compiled, from, fromStr, to, toStr, _ref2; + _ref2 = this.range, to = _ref2.to, from = _ref2.from; + fromStr = from && from.compile(o, LEVEL_PAREN) || '0'; + compiled = to && to.compile(o, LEVEL_ACCESS); + if (to && !(!this.range.exclusive && +compiled === -1)) { + toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? (+compiled + 1).toString() : "" + compiled + " + 1 || 9e9"); + } + return ".slice(" + fromStr + (toStr || '') + ")"; + }; + + return Slice; + + })(Base); + + exports.Obj = Obj = (function(_super) { + + __extends(Obj, _super); + + function Obj(props, generated) { + this.generated = generated != null ? generated : false; + this.objects = this.properties = props || []; + } + + Obj.prototype.children = ['properties']; + + Obj.prototype.compileNode = function(o) { + var i, idt, indent, join, lastNoncom, node, obj, prop, props, _i, _len; + props = this.properties; + if (!props.length) return (this.front ? '({})' : '{}'); + if (this.generated) { + for (_i = 0, _len = props.length; _i < _len; _i++) { + node = props[_i]; + if (node instanceof Value) { + throw new Error('cannot have an implicit value in an implicit object'); + } + } + } + idt = o.indent += TAB; + lastNoncom = this.lastNonComment(this.properties); + props = (function() { + var _len2, _results; + _results = []; + for (i = 0, _len2 = props.length; i < _len2; i++) { + prop = props[i]; + join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; + indent = prop instanceof Comment ? '' : idt; + if (prop instanceof Value && prop["this"]) { + prop = new Assign(prop.properties[0].name, prop, 'object'); + } + if (!(prop instanceof Comment)) { + if (!(prop instanceof Assign)) prop = new Assign(prop, prop, 'object'); + (prop.variable.base || prop.variable).asKey = true; + } + _results.push(indent + prop.compile(o, LEVEL_TOP) + join); + } + return _results; + })(); + props = props.join(''); + obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}"; + if (this.front) { + return "(" + obj + ")"; + } else { + return obj; + } + }; + + Obj.prototype.assigns = function(name) { + var prop, _i, _len, _ref2; + _ref2 = this.properties; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + prop = _ref2[_i]; + if (prop.assigns(name)) return true; + } + return false; + }; + + return Obj; + + })(Base); + + exports.Arr = Arr = (function(_super) { + + __extends(Arr, _super); + + function Arr(objs) { + this.objects = objs || []; + } + + Arr.prototype.children = ['objects']; + + Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects; + + Arr.prototype.compileNode = function(o) { + var code, obj, objs; + if (!this.objects.length) return '[]'; + o.indent += TAB; + objs = this.filterImplicitObjects(this.objects); + if (code = Splat.compileSplattedArray(o, objs)) return code; + code = ((function() { + var _i, _len, _results; + _results = []; + for (_i = 0, _len = objs.length; _i < _len; _i++) { + obj = objs[_i]; + _results.push(obj.compile(o, LEVEL_LIST)); + } + return _results; + })()).join(', '); + if (code.indexOf('\n') >= 0) { + return "[\n" + o.indent + code + "\n" + this.tab + "]"; + } else { + return "[" + code + "]"; + } + }; + + Arr.prototype.assigns = function(name) { + var obj, _i, _len, _ref2; + _ref2 = this.objects; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + obj = _ref2[_i]; + if (obj.assigns(name)) return true; + } + return false; + }; + + return Arr; + + })(Base); + + exports.Class = Class = (function(_super) { + + __extends(Class, _super); + + function Class(variable, parent, body) { + this.variable = variable; + this.parent = parent; + this.body = body != null ? body : new Block; + this.boundFuncs = []; + this.body.classBody = true; + } + + Class.prototype.children = ['variable', 'parent', 'body']; + + Class.prototype.determineName = function() { + var decl, tail; + if (!this.variable) return null; + decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value; + return decl && (decl = IDENTIFIER.test(decl) && decl); + }; + + Class.prototype.setContext = function(name) { + return this.body.traverseChildren(false, function(node) { + if (node.classBody) return false; + if (node instanceof Literal && node.value === 'this') { + return node.value = name; + } else if (node instanceof Code) { + node.klass = name; + if (node.bound) return node.context = name; + } + }); + }; + + Class.prototype.addBoundFunctions = function(o) { + var bvar, lhs, _i, _len, _ref2, _results; + if (this.boundFuncs.length) { + _ref2 = this.boundFuncs; + _results = []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + bvar = _ref2[_i]; + lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o); + _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"))); + } + return _results; + } + }; + + Class.prototype.addProperties = function(node, name, o) { + var assign, base, exprs, func, props; + props = node.base.properties.slice(0); + exprs = (function() { + var _results; + _results = []; + while (assign = props.shift()) { + if (assign instanceof Assign) { + base = assign.variable.base; + delete assign.context; + func = assign.value; + if (base.value === 'constructor') { + if (this.ctor) { + throw new Error('cannot define more than one constructor in a class'); + } + if (func.bound) { + throw new Error('cannot define a constructor as a bound function'); + } + if (func instanceof Code) { + assign = this.ctor = func; + } else { + this.externalCtor = o.scope.freeVariable('class'); + assign = new Assign(new Literal(this.externalCtor), func); + } + } else { + if (assign.variable["this"]) { + func.static = true; + if (func.bound) func.context = name; + } else { + assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]); + if (func instanceof Code && func.bound) { + this.boundFuncs.push(base); + func.bound = false; + } + } + } + } + _results.push(assign); + } + return _results; + }).call(this); + return compact(exprs); + }; + + Class.prototype.walkBody = function(name, o) { + var _this = this; + return this.traverseChildren(false, function(child) { + var exps, i, node, _len, _ref2; + if (child instanceof Class) return false; + if (child instanceof Block) { + _ref2 = exps = child.expressions; + for (i = 0, _len = _ref2.length; i < _len; i++) { + node = _ref2[i]; + if (node instanceof Value && node.isObject(true)) { + exps[i] = _this.addProperties(node, name, o); + } + } + return child.expressions = exps = flatten(exps); + } + }); + }; + + Class.prototype.ensureConstructor = function(name) { + if (!this.ctor) { + this.ctor = new Code; + if (this.parent) { + this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); + } + if (this.externalCtor) { + this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)")); + } + this.body.expressions.unshift(this.ctor); + } + this.ctor.ctor = this.ctor.name = name; + this.ctor.klass = null; + return this.ctor.noReturn = true; + }; + + Class.prototype.compileNode = function(o) { + var call, decl, klass, lname, name; + decl = this.determineName(); + name = decl || this.name || '_Class'; + if (name.reserved) name = "_" + name; + lname = new Literal(name); + this.setContext(name); + this.walkBody(name, o); + this.ensureConstructor(name); + this.body.spaced = true; + if (!(this.ctor instanceof Code)) this.body.expressions.unshift(this.ctor); + this.body.expressions.push(lname); + this.addBoundFunctions(o); + call = Closure.wrap(this.body); + if (this.parent) { + this.superClass = new Literal(o.scope.freeVariable('super', false)); + this.body.expressions.unshift(new Extends(lname, this.superClass)); + call.args.push(this.parent); + call.variable.params.push(new Param(this.superClass)); + } + klass = new Parens(call, true); + if (this.variable) klass = new Assign(this.variable, klass); + return klass.compile(o); + }; + + return Class; + + })(Base); + + exports.Assign = Assign = (function(_super) { + + __extends(Assign, _super); + + function Assign(variable, value, context, options) { + this.variable = variable; + this.value = value; + this.context = context; + this.param = options && options.param; + this.subpattern = options && options.subpattern; + } + + Assign.prototype.children = ['variable', 'value']; + + Assign.prototype.isStatement = function(o) { + return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0; + }; + + Assign.prototype.assigns = function(name) { + return this[this.context === 'object' ? 'value' : 'variable'].assigns(name); + }; + + Assign.prototype.unfoldSoak = function(o) { + return unfoldSoak(o, this, 'variable'); + }; + + Assign.prototype.compileNode = function(o) { + var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5; + if (isValue = this.variable instanceof Value) { + if (this.variable.isArray() || this.variable.isObject()) { + return this.compilePatternMatch(o); + } + if (this.variable.isSplice()) return this.compileSplice(o); + if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { + return this.compileConditional(o); + } + } + name = this.variable.compile(o, LEVEL_LIST); + if (!this.context) { + if (!(varBase = this.variable.unwrapAll()).isAssignable()) { + throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned."); + } + if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) { + if (this.param) { + o.scope.add(name, 'var'); + } else { + o.scope.find(name); + } + } + } + if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { + if (match[1]) this.value.klass = match[1]; + this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; + } + val = this.value.compile(o, LEVEL_LIST); + if (this.context === 'object') return "" + name + ": " + val; + val = name + (" " + (this.context || '=') + " ") + val; + if (o.level <= LEVEL_LIST) { + return val; + } else { + return "(" + val + ")"; + } + }; + + Assign.prototype.compilePatternMatch = function(o) { + var acc, assigns, code, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; + top = o.level === LEVEL_TOP; + value = this.value; + objects = this.variable.base.objects; + if (!(olen = objects.length)) { + code = value.compile(o); + if (o.level >= LEVEL_OP) { + return "(" + code + ")"; + } else { + return code; + } + } + isObject = this.variable.isObject(); + if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) { + if (obj instanceof Assign) { + _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; + } else { + if (obj.base instanceof Parens) { + _ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1]; + } else { + idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); + } + } + acc = IDENTIFIER.test(idx.unwrap().value || 0); + value = new Value(value); + value.properties.push(new (acc ? Access : Index)(idx)); + if (_ref5 = obj.unwrap().value, __indexOf.call(['arguments', 'eval'].concat(RESERVED), _ref5) >= 0) { + throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o))); + } + return new Assign(obj, value, null, { + param: this.param + }).compile(o, LEVEL_TOP); + } + vvar = value.compile(o, LEVEL_LIST); + assigns = []; + splat = false; + if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) { + assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar); + vvar = ref; + } + for (i = 0, _len = objects.length; i < _len; i++) { + obj = objects[i]; + idx = i; + if (isObject) { + if (obj instanceof Assign) { + _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value; + } else { + if (obj.base instanceof Parens) { + _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1]; + } else { + idx = obj["this"] ? obj.properties[0].name : obj; + } + } + } + if (!splat && obj instanceof Splat) { + name = obj.name.unwrap().value; + obj = obj.unwrap(); + val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i; + if (rest = olen - i - 1) { + ivar = o.scope.freeVariable('i'); + val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; + } else { + val += ") : []"; + } + val = new Literal(val); + splat = "" + ivar + "++"; + } else { + name = obj.unwrap().value; + if (obj instanceof Splat) { + obj = obj.name.compile(o); + throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "..."); + } + if (typeof idx === 'number') { + idx = new Literal(splat || idx); + acc = false; + } else { + acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); + } + val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]); + } + if ((name != null) && __indexOf.call(['arguments', 'eval'].concat(RESERVED), name) >= 0) { + throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o))); + } + assigns.push(new Assign(obj, val, null, { + param: this.param, + subpattern: true + }).compile(o, LEVEL_LIST)); + } + if (!(top || this.subpattern)) assigns.push(vvar); + code = assigns.join(', '); + if (o.level < LEVEL_LIST) { + return code; + } else { + return "(" + code + ")"; + } + }; + + Assign.prototype.compileConditional = function(o) { + var left, rite, _ref2; + _ref2 = this.variable.cacheReference(o), left = _ref2[0], rite = _ref2[1]; + if (__indexOf.call(this.context, "?") >= 0) o.isExistentialEquals = true; + return new Op(this.context.slice(0, -1), left, new Assign(rite, this.value, '=')).compile(o); + }; + + Assign.prototype.compileSplice = function(o) { + var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; + _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive; + name = this.variable.compile(o); + _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1]; + if (to) { + if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) { + to = +to.compile(o) - +fromRef; + if (!exclusive) to += 1; + } else { + to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef; + if (!exclusive) to += ' + 1'; + } + } else { + to = "9e9"; + } + _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; + code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef; + if (o.level > LEVEL_TOP) { + return "(" + code + ")"; + } else { + return code; + } + }; + + return Assign; + + })(Base); + + exports.Code = Code = (function(_super) { + + __extends(Code, _super); + + function Code(params, body, tag) { + this.params = params || []; + this.body = body || new Block; + this.bound = tag === 'boundfunc'; + if (this.bound) this.context = '_this'; + } + + Code.prototype.children = ['params', 'body']; + + Code.prototype.isStatement = function() { + return !!this.ctor; + }; + + Code.prototype.jumps = NO; + + Code.prototype.compileNode = function(o) { + var code, exprs, i, idt, lit, p, param, ref, splats, v, val, vars, wasEmpty, _i, _j, _k, _len, _len2, _len3, _len4, _ref2, _ref3, _ref4, _ref5, _ref6; + o.scope = new Scope(o.scope, this.body, this); + o.scope.shared = del(o, 'sharedScope'); + o.indent += TAB; + delete o.bare; + vars = []; + exprs = []; + _ref2 = this.params; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + param = _ref2[_i]; + if (!param.splat) continue; + _ref3 = this.params; + for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) { + p = _ref3[_j]; + if (p.name.value) o.scope.add(p.name.value, 'var', true); + } + splats = new Assign(new Value(new Arr((function() { + var _k, _len3, _ref4, _results; + _ref4 = this.params; + _results = []; + for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) { + p = _ref4[_k]; + _results.push(p.asReference(o)); + } + return _results; + }).call(this))), new Value(new Literal('arguments'))); + break; + } + _ref4 = this.params; + for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) { + param = _ref4[_k]; + if (param.isComplex()) { + val = ref = param.asReference(o); + if (param.value) val = new Op('?', ref, param.value); + exprs.push(new Assign(new Value(param.name), val, '=', { + param: true + })); + } else { + ref = param; + if (param.value) { + lit = new Literal(ref.name.value + ' == null'); + val = new Assign(new Value(param.name), param.value, '='); + exprs.push(new If(lit, val)); + } + } + if (!splats) vars.push(ref); + } + wasEmpty = this.body.isEmpty(); + if (splats) exprs.unshift(splats); + if (exprs.length) { + (_ref5 = this.body.expressions).unshift.apply(_ref5, exprs); + } + if (!splats) { + for (i = 0, _len4 = vars.length; i < _len4; i++) { + v = vars[i]; + o.scope.parameter(vars[i] = v.compile(o)); + } + } + if (!(wasEmpty || this.noReturn)) this.body.makeReturn(); + if (this.bound) { + if ((_ref6 = o.scope.parent.method) != null ? _ref6.bound : void 0) { + this.bound = this.context = o.scope.parent.method.context; + } else if (!this.static) { + o.scope.parent.assign('_this', 'this'); + } + } + idt = o.indent; + code = 'function'; + if (this.ctor) code += ' ' + this.name; + code += '(' + vars.join(', ') + ') {'; + if (!this.body.isEmpty()) { + code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab; + } + code += '}'; + if (this.ctor) return this.tab + code; + if (this.front || (o.level >= LEVEL_ACCESS)) { + return "(" + code + ")"; + } else { + return code; + } + }; + + Code.prototype.traverseChildren = function(crossScope, func) { + if (crossScope) { + return Code.__super__.traverseChildren.call(this, crossScope, func); + } + }; + + return Code; + + })(Base); + + exports.Param = Param = (function(_super) { + + __extends(Param, _super); + + function Param(name, value, splat) { + this.name = name; + this.value = value; + this.splat = splat; + } + + Param.prototype.children = ['name', 'value']; + + Param.prototype.compile = function(o) { + return this.name.compile(o, LEVEL_LIST); + }; + + Param.prototype.asReference = function(o) { + var node; + if (this.reference) return this.reference; + node = this.name; + if (node["this"]) { + node = node.properties[0].name; + if (node.value.reserved) node = new Literal('_' + node.value); + } else if (node.isComplex()) { + node = new Literal(o.scope.freeVariable('arg')); + } + node = new Value(node); + if (this.splat) node = new Splat(node); + return this.reference = node; + }; + + Param.prototype.isComplex = function() { + return this.name.isComplex(); + }; + + return Param; + + })(Base); + + exports.Splat = Splat = (function(_super) { + + __extends(Splat, _super); + + Splat.prototype.children = ['name']; + + Splat.prototype.isAssignable = YES; + + function Splat(name) { + this.name = name.compile ? name : new Literal(name); + } + + Splat.prototype.assigns = function(name) { + return this.name.assigns(name); + }; + + Splat.prototype.compile = function(o) { + if (this.index != null) { + return this.compileParam(o); + } else { + return this.name.compile(o); + } + }; + + Splat.prototype.unwrap = function() { + return this.name; + }; + + Splat.compileSplattedArray = function(o, list, apply) { + var args, base, code, i, index, node, _len; + index = -1; + while ((node = list[++index]) && !(node instanceof Splat)) { + continue; + } + if (index >= list.length) return ''; + if (list.length === 1) { + code = list[0].compile(o, LEVEL_LIST); + if (apply) return code; + return "" + (utility('slice')) + ".call(" + code + ")"; + } + args = list.slice(index); + for (i = 0, _len = args.length; i < _len; i++) { + node = args[i]; + code = node.compile(o, LEVEL_LIST); + args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]"; + } + if (index === 0) { + return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")"); + } + base = (function() { + var _i, _len2, _ref2, _results; + _ref2 = list.slice(0, index); + _results = []; + for (_i = 0, _len2 = _ref2.length; _i < _len2; _i++) { + node = _ref2[_i]; + _results.push(node.compile(o, LEVEL_LIST)); + } + return _results; + })(); + return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")"; + }; + + return Splat; + + })(Base); + + exports.While = While = (function(_super) { + + __extends(While, _super); + + function While(condition, options) { + this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition; + this.guard = options != null ? options.guard : void 0; + } + + While.prototype.children = ['condition', 'guard', 'body']; + + While.prototype.isStatement = YES; + + While.prototype.makeReturn = function(res) { + if (res) { + return While.__super__.makeReturn.apply(this, arguments); + } else { + this.returns = !this.jumps({ + loop: true + }); + return this; + } + }; + + While.prototype.addBody = function(body) { + this.body = body; + return this; + }; + + While.prototype.jumps = function() { + var expressions, node, _i, _len; + expressions = this.body.expressions; + if (!expressions.length) return false; + for (_i = 0, _len = expressions.length; _i < _len; _i++) { + node = expressions[_i]; + if (node.jumps({ + loop: true + })) return node; + } + return false; + }; + + While.prototype.compileNode = function(o) { + var body, code, rvar, set; + o.indent += TAB; + set = ''; + body = this.body; + if (body.isEmpty()) { + body = ''; + } else { + if (this.returns) { + body.makeReturn(rvar = o.scope.freeVariable('results')); + set = "" + this.tab + rvar + " = [];\n"; + } + if (this.guard) { + if (body.expressions.length > 1) { + body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); + } else { + if (this.guard) body = Block.wrap([new If(this.guard, body)]); + } + } + body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab; + } + code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}"); + if (this.returns) code += "\n" + this.tab + "return " + rvar + ";"; + return code; + }; + + return While; + + })(Base); + + exports.Op = Op = (function(_super) { + var CONVERSIONS, INVERSIONS; + + __extends(Op, _super); + + function Op(op, first, second, flip) { + var call; + if (op === 'in') return new In(first, second); + if (op === 'do') { + call = new Call(first, first.params || []); + call["do"] = true; + return call; + } + if (op === 'new') { + if (first instanceof Call && !first["do"] && !first.isNew) { + return first.newInstance(); + } + if (first instanceof Code && first.bound || first["do"]) { + first = new Parens(first); + } + } + this.operator = CONVERSIONS[op] || op; + this.first = first; + this.second = second; + this.flip = !!flip; + return this; + } + + CONVERSIONS = { + '==': '===', + '!=': '!==', + 'of': 'in' + }; + + INVERSIONS = { + '!==': '===', + '===': '!==' + }; + + Op.prototype.children = ['first', 'second']; + + Op.prototype.isSimpleNumber = NO; + + Op.prototype.isUnary = function() { + return !this.second; + }; + + Op.prototype.isComplex = function() { + var _ref2; + return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex(); + }; + + Op.prototype.isChainable = function() { + var _ref2; + return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!=='; + }; + + Op.prototype.invert = function() { + var allInvertable, curr, fst, op, _ref2; + if (this.isChainable() && this.first.isChainable()) { + allInvertable = true; + curr = this; + while (curr && curr.operator) { + allInvertable && (allInvertable = curr.operator in INVERSIONS); + curr = curr.first; + } + if (!allInvertable) return new Parens(this).invert(); + curr = this; + while (curr && curr.operator) { + curr.invert = !curr.invert; + curr.operator = INVERSIONS[curr.operator]; + curr = curr.first; + } + return this; + } else if (op = INVERSIONS[this.operator]) { + this.operator = op; + if (this.first.unwrap() instanceof Op) this.first.invert(); + return this; + } else if (this.second) { + return new Parens(this).invert(); + } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) { + return fst; + } else { + return new Op('!', this); + } + }; + + Op.prototype.unfoldSoak = function(o) { + var _ref2; + return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first'); + }; + + Op.prototype.compileNode = function(o) { + var code, isChain; + isChain = this.isChainable() && this.first.isChainable(); + if (!isChain) this.first.front = this.front; + if (this.isUnary()) return this.compileUnary(o); + if (isChain) return this.compileChain(o); + if (this.operator === '?') return this.compileExistence(o); + code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP); + if (o.level <= LEVEL_OP) { + return code; + } else { + return "(" + code + ")"; + } + }; + + Op.prototype.compileChain = function(o) { + var code, fst, shared, _ref2; + _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; + fst = this.first.compile(o, LEVEL_OP); + code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP)); + return "(" + code + ")"; + }; + + Op.prototype.compileExistence = function(o) { + var fst, ref; + if (this.first.isComplex() && o.level > LEVEL_TOP) { + ref = new Literal(o.scope.freeVariable('ref')); + fst = new Parens(new Assign(ref, this.first)); + } else { + fst = this.first; + ref = fst; + } + return new If(new Existence(fst), ref, { + type: 'if' + }).addElse(this.second).compile(o); + }; + + Op.prototype.compileUnary = function(o) { + var op, parts, plusMinus; + parts = [op = this.operator]; + plusMinus = op === '+' || op === '-'; + if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) { + parts.push(' '); + } + if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { + this.first = new Parens(this.first); + } + parts.push(this.first.compile(o, LEVEL_OP)); + if (this.flip) parts.reverse(); + return parts.join(''); + }; + + Op.prototype.toString = function(idt) { + return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator); + }; + + return Op; + + })(Base); + + exports.In = In = (function(_super) { + + __extends(In, _super); + + function In(object, array) { + this.object = object; + this.array = array; + } + + In.prototype.children = ['object', 'array']; + + In.prototype.invert = NEGATE; + + In.prototype.compileNode = function(o) { + var hasSplat, obj, _i, _len, _ref2; + if (this.array instanceof Value && this.array.isArray()) { + _ref2 = this.array.base.objects; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + obj = _ref2[_i]; + if (!(obj instanceof Splat)) continue; + hasSplat = true; + break; + } + if (!hasSplat) return this.compileOrTest(o); + } + return this.compileLoopTest(o); + }; + + In.prototype.compileOrTest = function(o) { + var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3; + if (this.array.base.objects.length === 0) return "" + (!!this.negated); + _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1]; + _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1]; + tests = (function() { + var _len, _ref4, _results; + _ref4 = this.array.base.objects; + _results = []; + for (i = 0, _len = _ref4.length; i < _len; i++) { + item = _ref4[i]; + _results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_ACCESS)); + } + return _results; + }).call(this); + tests = tests.join(cnj); + if (o.level < LEVEL_OP) { + return tests; + } else { + return "(" + tests + ")"; + } + }; + + In.prototype.compileLoopTest = function(o) { + var code, ref, sub, _ref2; + _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; + code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0'); + if (sub === ref) return code; + code = sub + ', ' + code; + if (o.level < LEVEL_LIST) { + return code; + } else { + return "(" + code + ")"; + } + }; + + In.prototype.toString = function(idt) { + return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : '')); + }; + + return In; + + })(Base); + + exports.Try = Try = (function(_super) { + + __extends(Try, _super); + + function Try(attempt, error, recovery, ensure) { + this.attempt = attempt; + this.error = error; + this.recovery = recovery; + this.ensure = ensure; + } + + Try.prototype.children = ['attempt', 'recovery', 'ensure']; + + Try.prototype.isStatement = YES; + + Try.prototype.jumps = function(o) { + var _ref2; + return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0); + }; + + Try.prototype.makeReturn = function(res) { + if (this.attempt) this.attempt = this.attempt.makeReturn(res); + if (this.recovery) this.recovery = this.recovery.makeReturn(res); + return this; + }; + + Try.prototype.compileNode = function(o) { + var catchPart, ensurePart, errorPart, tryPart; + o.indent += TAB; + errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' '; + tryPart = this.attempt.compile(o, LEVEL_TOP); + catchPart = this.recovery ? (!o.scope.check(this.error.value) ? o.scope.add(this.error.value, 'param') : void 0, " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}") : !(this.ensure || this.recovery) ? ' catch (_error) {}' : void 0; + ensurePart = this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : ''; + return "" + this.tab + "try {\n" + tryPart + "\n" + this.tab + "}" + (catchPart || '') + ensurePart; + }; + + return Try; + + })(Base); + + exports.Throw = Throw = (function(_super) { + + __extends(Throw, _super); + + function Throw(expression) { + this.expression = expression; + } + + Throw.prototype.children = ['expression']; + + Throw.prototype.isStatement = YES; + + Throw.prototype.jumps = NO; + + Throw.prototype.makeReturn = THIS; + + Throw.prototype.compileNode = function(o) { + return this.tab + ("throw " + (this.expression.compile(o)) + ";"); + }; + + return Throw; + + })(Base); + + exports.Existence = Existence = (function(_super) { + + __extends(Existence, _super); + + function Existence(expression) { + this.expression = expression; + } + + Existence.prototype.children = ['expression']; + + Existence.prototype.invert = NEGATE; + + Existence.prototype.compileNode = function(o) { + var cmp, cnj, code, _ref2; + this.expression.front = this.front; + code = this.expression.compile(o, LEVEL_OP); + if (IDENTIFIER.test(code) && !o.scope.check(code)) { + _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1]; + code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null"; + } else { + code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; + } + if (o.level <= LEVEL_COND) { + return code; + } else { + return "(" + code + ")"; + } + }; + + return Existence; + + })(Base); + + exports.Parens = Parens = (function(_super) { + + __extends(Parens, _super); + + function Parens(body) { + this.body = body; + } + + Parens.prototype.children = ['body']; + + Parens.prototype.unwrap = function() { + return this.body; + }; + + Parens.prototype.isComplex = function() { + return this.body.isComplex(); + }; + + Parens.prototype.compileNode = function(o) { + var bare, code, expr; + expr = this.body.unwrap(); + if (expr instanceof Value && expr.isAtomic()) { + expr.front = this.front; + return expr.compile(o); + } + code = expr.compile(o, LEVEL_PAREN); + bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns)); + if (bare) { + return code; + } else { + return "(" + code + ")"; + } + }; + + return Parens; + + })(Base); + + exports.For = For = (function(_super) { + + __extends(For, _super); + + function For(body, source) { + var _ref2; + this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index; + this.body = Block.wrap([body]); + this.own = !!source.own; + this.object = !!source.object; + if (this.object) { + _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; + } + if (this.index instanceof Value) { + throw SyntaxError('index cannot be a pattern matching expression'); + } + this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length; + this.pattern = this.name instanceof Value; + if (this.range && this.index) { + throw SyntaxError('indexes do not apply to range loops'); + } + if (this.range && this.pattern) { + throw SyntaxError('cannot pattern match over range loops'); + } + this.returns = false; + } + + For.prototype.children = ['body', 'source', 'guard', 'step']; + + For.prototype.compileNode = function(o) { + var body, defPart, forPart, forVarPart, guardPart, idt1, index, ivar, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, stepPart, stepvar, svar, varPart, _ref2; + body = Block.wrap([this.body]); + lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0; + if (lastJumps && lastJumps instanceof Return) this.returns = false; + source = this.range ? this.source.base : this.source; + scope = o.scope; + name = this.name && this.name.compile(o, LEVEL_LIST); + index = this.index && this.index.compile(o, LEVEL_LIST); + if (name && !this.pattern) { + scope.find(name, { + immediate: true + }); + } + if (index) { + scope.find(index, { + immediate: true + }); + } + if (this.returns) rvar = scope.freeVariable('results'); + ivar = (this.range ? name : index) || scope.freeVariable('i'); + if (this.step && !this.range) stepvar = scope.freeVariable("step"); + if (this.pattern) name = ivar; + varPart = ''; + guardPart = ''; + defPart = ''; + idt1 = this.tab + TAB; + if (this.range) { + forPart = source.compile(merge(o, { + index: ivar, + step: this.step + })); + } else { + svar = this.source.compile(o, LEVEL_LIST); + if ((name || this.own) && !IDENTIFIER.test(svar)) { + defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; + svar = ref; + } + if (name && !this.pattern) { + namePart = "" + name + " = " + svar + "[" + ivar + "]"; + } + if (!this.object) { + lvar = scope.freeVariable('len'); + forVarPart = ("" + ivar + " = 0, " + lvar + " = " + svar + ".length") + (this.step ? ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP)) : ''); + stepPart = this.step ? "" + ivar + " += " + stepvar : "" + ivar + "++"; + forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart; + } + } + if (this.returns) { + resultPart = "" + this.tab + rvar + " = [];\n"; + returnResult = "\n" + this.tab + "return " + rvar + ";"; + body.makeReturn(rvar); + } + if (this.guard) { + if (body.expressions.length > 1) { + body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); + } else { + if (this.guard) body = Block.wrap([new If(this.guard, body)]); + } + } + if (this.pattern) { + body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + ivar + "]"))); + } + defPart += this.pluckDirectCall(o, body); + if (namePart) varPart = "\n" + idt1 + namePart + ";"; + if (this.object) { + forPart = "" + ivar + " in " + svar; + if (this.own) { + guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + ivar + ")) continue;"; + } + } + body = body.compile(merge(o, { + indent: idt1 + }), LEVEL_TOP); + if (body) body = '\n' + body + '\n'; + return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || ''); + }; + + For.prototype.pluckDirectCall = function(o, body) { + var base, defs, expr, fn, idx, ref, val, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; + defs = ''; + _ref2 = body.expressions; + for (idx = 0, _len = _ref2.length; idx < _len; idx++) { + expr = _ref2[idx]; + expr = expr.unwrapAll(); + if (!(expr instanceof Call)) continue; + val = expr.variable.unwrapAll(); + if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) { + continue; + } + fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val; + ref = new Literal(o.scope.freeVariable('fn')); + base = new Value(ref); + if (val.base) _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1]; + body.expressions[idx] = new Call(base, expr.args); + defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n'; + } + return defs; + }; + + return For; + + })(While); + + exports.Switch = Switch = (function(_super) { + + __extends(Switch, _super); + + function Switch(subject, cases, otherwise) { + this.subject = subject; + this.cases = cases; + this.otherwise = otherwise; + } + + Switch.prototype.children = ['subject', 'cases', 'otherwise']; + + Switch.prototype.isStatement = YES; + + Switch.prototype.jumps = function(o) { + var block, conds, _i, _len, _ref2, _ref3, _ref4; + if (o == null) { + o = { + block: true + }; + } + _ref2 = this.cases; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; + if (block.jumps(o)) return block; + } + return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; + }; + + Switch.prototype.makeReturn = function(res) { + var pair, _i, _len, _ref2, _ref3; + _ref2 = this.cases; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + pair = _ref2[_i]; + pair[1].makeReturn(res); + } + if (res) { + this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); + } + if ((_ref3 = this.otherwise) != null) _ref3.makeReturn(res); + return this; + }; + + Switch.prototype.compileNode = function(o) { + var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _len, _len2, _ref2, _ref3, _ref4, _ref5; + idt1 = o.indent + TAB; + idt2 = o.indent = idt1 + TAB; + code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n"); + _ref3 = this.cases; + for (i = 0, _len = _ref3.length; i < _len; i++) { + _ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1]; + _ref5 = flatten([conditions]); + for (_i = 0, _len2 = _ref5.length; _i < _len2; _i++) { + cond = _ref5[_i]; + if (!this.subject) cond = cond.invert(); + code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n"); + } + if (body = block.compile(o, LEVEL_TOP)) code += body + '\n'; + if (i === this.cases.length - 1 && !this.otherwise) break; + expr = this.lastNonComment(block.expressions); + if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) { + continue; + } + code += idt2 + 'break;\n'; + } + if (this.otherwise && this.otherwise.expressions.length) { + code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n"); + } + return code + this.tab + '}'; + }; + + return Switch; + + })(Base); + + exports.If = If = (function(_super) { + + __extends(If, _super); + + function If(condition, body, options) { + this.body = body; + if (options == null) options = {}; + this.condition = options.type === 'unless' ? condition.invert() : condition; + this.elseBody = null; + this.isChain = false; + this.soak = options.soak; + } + + If.prototype.children = ['condition', 'body', 'elseBody']; + + If.prototype.bodyNode = function() { + var _ref2; + return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0; + }; + + If.prototype.elseBodyNode = function() { + var _ref2; + return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0; + }; + + If.prototype.addElse = function(elseBody) { + if (this.isChain) { + this.elseBodyNode().addElse(elseBody); + } else { + this.isChain = elseBody instanceof If; + this.elseBody = this.ensureBlock(elseBody); + } + return this; + }; + + If.prototype.isStatement = function(o) { + var _ref2; + return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0); + }; + + If.prototype.jumps = function(o) { + var _ref2; + return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0); + }; + + If.prototype.compileNode = function(o) { + if (this.isStatement(o)) { + return this.compileStatement(o); + } else { + return this.compileExpression(o); + } + }; + + If.prototype.makeReturn = function(res) { + if (res) { + this.elseBody || (this.elseBody = new Block([new Literal('void 0')])); + } + this.body && (this.body = new Block([this.body.makeReturn(res)])); + this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)])); + return this; + }; + + If.prototype.ensureBlock = function(node) { + if (node instanceof Block) { + return node; + } else { + return new Block([node]); + } + }; + + If.prototype.compileStatement = function(o) { + var body, bodyc, child, cond, exeq, ifPart, _ref2; + child = del(o, 'chainChild'); + exeq = del(o, 'isExistentialEquals'); + if (exeq) { + return new If(this.condition.invert(), this.elseBodyNode(), { + type: 'if' + }).compile(o); + } + cond = this.condition.compile(o, LEVEL_PAREN); + o.indent += TAB; + body = this.ensureBlock(this.body); + bodyc = body.compile(o); + if (1 === ((_ref2 = body.expressions) != null ? _ref2.length : void 0) && !this.elseBody && !child && bodyc && cond && -1 === (bodyc.indexOf('\n')) && 80 > cond.length + bodyc.length) { + return "" + this.tab + "if (" + cond + ") " + (bodyc.replace(/^\s+/, '')); + } + if (bodyc) bodyc = "\n" + bodyc + "\n" + this.tab; + ifPart = "if (" + cond + ") {" + bodyc + "}"; + if (!child) ifPart = this.tab + ifPart; + if (!this.elseBody) return ifPart; + return ifPart + ' else ' + (this.isChain ? (o.indent = this.tab, o.chainChild = true, this.elseBody.unwrap().compile(o, LEVEL_TOP)) : "{\n" + (this.elseBody.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}"); + }; + + If.prototype.compileExpression = function(o) { + var alt, body, code, cond; + cond = this.condition.compile(o, LEVEL_COND); + body = this.bodyNode().compile(o, LEVEL_LIST); + alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0'; + code = "" + cond + " ? " + body + " : " + alt; + if (o.level >= LEVEL_COND) { + return "(" + code + ")"; + } else { + return code; + } + }; + + If.prototype.unfoldSoak = function() { + return this.soak && this; + }; + + return If; + + })(Base); + + Closure = { + wrap: function(expressions, statement, noReturn) { + var args, call, func, mentionsArgs, meth; + if (expressions.jumps()) return expressions; + func = new Code([], Block.wrap([expressions])); + args = []; + if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) { + meth = new Literal(mentionsArgs ? 'apply' : 'call'); + args = [new Literal('this')]; + if (mentionsArgs) args.push(new Literal('arguments')); + func = new Value(func, [new Access(meth)]); + } + func.noReturn = noReturn; + call = new Call(func, args); + if (statement) { + return Block.wrap([call]); + } else { + return call; + } + }, + literalArgs: function(node) { + return node instanceof Literal && node.value === 'arguments' && !node.asKey; + }, + literalThis: function(node) { + return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound); + } + }; + + unfoldSoak = function(o, parent, name) { + var ifn; + if (!(ifn = parent[name].unfoldSoak(o))) return; + parent[name] = ifn.body; + ifn.body = new Value(parent); + return ifn; + }; + + UTILITIES = { + "extends": function() { + return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }"; + }, + bind: function() { + return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }'; + }, + indexOf: function() { + return "Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"; + }, + hasProp: function() { + return 'Object.prototype.hasOwnProperty'; + }, + slice: function() { + return 'Array.prototype.slice'; + } + }; + + LEVEL_TOP = 1; + + LEVEL_PAREN = 2; + + LEVEL_LIST = 3; + + LEVEL_COND = 4; + + LEVEL_OP = 5; + + LEVEL_ACCESS = 6; + + TAB = ' '; + + IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; + + IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$"); + + SIMPLENUM = /^[+-]?\d+$/; + + METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$"); + + IS_STRING = /^['"]/; + + utility = function(name) { + var ref; + ref = "__" + name; + Scope.root.assign(ref, UTILITIES[name]()); + return ref; + }; + + multident = function(code, tab) { + code = code.replace(/\n/g, '$&' + tab); + return code.replace(/\s+$/, ''); + }; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js new file mode 100644 index 0000000..5e0114c --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/optparse.js @@ -0,0 +1,122 @@ +(function() { + var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments; + + exports.OptionParser = OptionParser = (function() { + + function OptionParser(rules, banner) { + this.banner = banner; + this.rules = buildRules(rules); + } + + OptionParser.prototype.parse = function(args) { + var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, value, _i, _len, _len2, _ref; + options = { + arguments: [], + literals: [] + }; + originalArgs = args; + args = normalizeArguments(args); + for (i = 0, _len = args.length; i < _len; i++) { + arg = args[i]; + if (arg === '--') { + pos = originalArgs.indexOf('--'); + options.arguments = [originalArgs[1 + pos]]; + options.literals = originalArgs.slice(2 + pos); + break; + } + isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG)); + matchedRule = false; + _ref = this.rules; + for (_i = 0, _len2 = _ref.length; _i < _len2; _i++) { + rule = _ref[_i]; + if (rule.shortFlag === arg || rule.longFlag === arg) { + value = rule.hasArgument ? args[i += 1] : true; + options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value; + matchedRule = true; + break; + } + } + if (isOption && !matchedRule) { + throw new Error("unrecognized option: " + arg); + } + if (!isOption) { + options.arguments = originalArgs.slice(originalArgs.indexOf(arg)); + break; + } + } + return options; + }; + + OptionParser.prototype.help = function() { + var letPart, lines, rule, spaces, _i, _len, _ref; + lines = []; + if (this.banner) lines.unshift("" + this.banner + "\n"); + _ref = this.rules; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + rule = _ref[_i]; + spaces = 15 - rule.longFlag.length; + spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; + letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' '; + lines.push(' ' + letPart + rule.longFlag + spaces + rule.description); + } + return "\n" + (lines.join('\n')) + "\n"; + }; + + return OptionParser; + + })(); + + LONG_FLAG = /^(--\w[\w\-]+)/; + + SHORT_FLAG = /^(-\w)/; + + MULTI_FLAG = /^-(\w{2,})/; + + OPTIONAL = /\[(\w+(\*?))\]/; + + buildRules = function(rules) { + var tuple, _i, _len, _results; + _results = []; + for (_i = 0, _len = rules.length; _i < _len; _i++) { + tuple = rules[_i]; + if (tuple.length < 3) tuple.unshift(null); + _results.push(buildRule.apply(null, tuple)); + } + return _results; + }; + + buildRule = function(shortFlag, longFlag, description, options) { + var match; + if (options == null) options = {}; + match = longFlag.match(OPTIONAL); + longFlag = longFlag.match(LONG_FLAG)[1]; + return { + name: longFlag.substr(2), + shortFlag: shortFlag, + longFlag: longFlag, + description: description, + hasArgument: !!(match && match[1]), + isList: !!(match && match[2]) + }; + }; + + normalizeArguments = function(args) { + var arg, l, match, result, _i, _j, _len, _len2, _ref; + args = args.slice(0); + result = []; + for (_i = 0, _len = args.length; _i < _len; _i++) { + arg = args[_i]; + if (match = arg.match(MULTI_FLAG)) { + _ref = match[1].split(''); + for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) { + l = _ref[_j]; + result.push('-' + l); + } + } else { + result.push(arg); + } + } + return result; + }; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/parser.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/parser.js new file mode 100755 index 0000000..198b563 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/parser.js @@ -0,0 +1,674 @@ +/* Jison generated parser */ +var parser = (function(){ +var parser = {trace: function trace() { }, +yy: {}, +symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"BOOL":36,"Assignable":37,"=":38,"AssignObj":39,"ObjAssignable":40,":":41,"ThisProperty":42,"RETURN":43,"HERECOMMENT":44,"PARAM_START":45,"ParamList":46,"PARAM_END":47,"FuncGlyph":48,"->":49,"=>":50,"OptComma":51,",":52,"Param":53,"ParamVar":54,"...":55,"Array":56,"Object":57,"Splat":58,"SimpleAssignable":59,"Accessor":60,"Parenthetical":61,"Range":62,"This":63,".":64,"?.":65,"::":66,"Index":67,"INDEX_START":68,"IndexValue":69,"INDEX_END":70,"INDEX_SOAK":71,"Slice":72,"{":73,"AssignList":74,"}":75,"CLASS":76,"EXTENDS":77,"OptFuncExist":78,"Arguments":79,"SUPER":80,"FUNC_EXIST":81,"CALL_START":82,"CALL_END":83,"ArgList":84,"THIS":85,"@":86,"[":87,"]":88,"RangeDots":89,"..":90,"Arg":91,"SimpleArgs":92,"TRY":93,"Catch":94,"FINALLY":95,"CATCH":96,"THROW":97,"(":98,")":99,"WhileSource":100,"WHILE":101,"WHEN":102,"UNTIL":103,"Loop":104,"LOOP":105,"ForBody":106,"FOR":107,"ForStart":108,"ForSource":109,"ForVariables":110,"OWN":111,"ForValue":112,"FORIN":113,"FOROF":114,"BY":115,"SWITCH":116,"Whens":117,"ELSE":118,"When":119,"LEADING_WHEN":120,"IfBlock":121,"IF":122,"POST_IF":123,"UNARY":124,"-":125,"+":126,"--":127,"++":128,"?":129,"MATH":130,"SHIFT":131,"COMPARE":132,"LOGIC":133,"RELATION":134,"COMPOUND_ASSIGN":135,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"BOOL",38:"=",41:":",43:"RETURN",44:"HERECOMMENT",45:"PARAM_START",47:"PARAM_END",49:"->",50:"=>",52:",",55:"...",64:".",65:"?.",66:"::",68:"INDEX_START",70:"INDEX_END",71:"INDEX_SOAK",73:"{",75:"}",76:"CLASS",77:"EXTENDS",80:"SUPER",81:"FUNC_EXIST",82:"CALL_START",83:"CALL_END",85:"THIS",86:"@",87:"[",88:"]",90:"..",93:"TRY",95:"FINALLY",96:"CATCH",97:"THROW",98:"(",99:")",101:"WHILE",102:"WHEN",103:"UNTIL",105:"LOOP",107:"FOR",111:"OWN",113:"FORIN",114:"FOROF",115:"BY",116:"SWITCH",118:"ELSE",120:"LEADING_WHEN",122:"IF",123:"POST_IF",124:"UNARY",125:"-",126:"+",127:"--",128:"++",129:"?",130:"MATH",131:"SHIFT",132:"COMPARE",133:"LOGIC",134:"RELATION",135:"COMPOUND_ASSIGN"}, +productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[39,1],[39,3],[39,5],[39,1],[40,1],[40,1],[40,1],[10,2],[10,1],[11,1],[15,5],[15,2],[48,1],[48,1],[51,0],[51,1],[46,0],[46,1],[46,3],[53,1],[53,2],[53,3],[54,1],[54,1],[54,1],[54,1],[58,2],[59,1],[59,2],[59,2],[59,1],[37,1],[37,1],[37,1],[13,1],[13,1],[13,1],[13,1],[13,1],[60,2],[60,2],[60,2],[60,1],[60,1],[67,3],[67,2],[69,1],[69,1],[57,4],[74,0],[74,1],[74,3],[74,4],[74,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[78,0],[78,1],[79,2],[79,4],[63,1],[63,1],[42,2],[56,2],[56,4],[89,1],[89,1],[62,5],[72,3],[72,2],[72,2],[84,1],[84,3],[84,4],[84,4],[84,6],[91,1],[91,1],[92,1],[92,3],[19,2],[19,3],[19,4],[19,5],[94,3],[24,2],[61,3],[61,5],[100,2],[100,4],[100,2],[100,4],[20,2],[20,2],[20,2],[20,1],[104,2],[104,2],[21,2],[21,2],[21,2],[106,2],[106,2],[108,2],[108,3],[112,1],[112,1],[112,1],[110,1],[110,3],[109,2],[109,2],[109,4],[109,4],[109,4],[109,6],[109,6],[22,5],[22,7],[22,4],[22,6],[117,1],[117,2],[119,3],[119,4],[121,3],[121,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]], +performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { + +var $0 = $$.length - 1; +switch (yystate) { +case 1:return this.$ = new yy.Block; +break; +case 2:return this.$ = $$[$0]; +break; +case 3:return this.$ = $$[$0-1]; +break; +case 4:this.$ = yy.Block.wrap([$$[$0]]); +break; +case 5:this.$ = $$[$0-2].push($$[$0]); +break; +case 6:this.$ = $$[$0-1]; +break; +case 7:this.$ = $$[$0]; +break; +case 8:this.$ = $$[$0]; +break; +case 9:this.$ = $$[$0]; +break; +case 10:this.$ = $$[$0]; +break; +case 11:this.$ = new yy.Literal($$[$0]); +break; +case 12:this.$ = $$[$0]; +break; +case 13:this.$ = $$[$0]; +break; +case 14:this.$ = $$[$0]; +break; +case 15:this.$ = $$[$0]; +break; +case 16:this.$ = $$[$0]; +break; +case 17:this.$ = $$[$0]; +break; +case 18:this.$ = $$[$0]; +break; +case 19:this.$ = $$[$0]; +break; +case 20:this.$ = $$[$0]; +break; +case 21:this.$ = $$[$0]; +break; +case 22:this.$ = $$[$0]; +break; +case 23:this.$ = $$[$0]; +break; +case 24:this.$ = new yy.Block; +break; +case 25:this.$ = $$[$0-1]; +break; +case 26:this.$ = new yy.Literal($$[$0]); +break; +case 27:this.$ = new yy.Literal($$[$0]); +break; +case 28:this.$ = new yy.Literal($$[$0]); +break; +case 29:this.$ = $$[$0]; +break; +case 30:this.$ = new yy.Literal($$[$0]); +break; +case 31:this.$ = new yy.Literal($$[$0]); +break; +case 32:this.$ = new yy.Literal($$[$0]); +break; +case 33:this.$ = (function () { + var val; + val = new yy.Literal($$[$0]); + if ($$[$0] === 'undefined') val.isUndefined = true; + return val; + }()); +break; +case 34:this.$ = new yy.Assign($$[$0-2], $$[$0]); +break; +case 35:this.$ = new yy.Assign($$[$0-3], $$[$0]); +break; +case 36:this.$ = new yy.Assign($$[$0-4], $$[$0-1]); +break; +case 37:this.$ = new yy.Value($$[$0]); +break; +case 38:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object'); +break; +case 39:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object'); +break; +case 40:this.$ = $$[$0]; +break; +case 41:this.$ = $$[$0]; +break; +case 42:this.$ = $$[$0]; +break; +case 43:this.$ = $$[$0]; +break; +case 44:this.$ = new yy.Return($$[$0]); +break; +case 45:this.$ = new yy.Return; +break; +case 46:this.$ = new yy.Comment($$[$0]); +break; +case 47:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]); +break; +case 48:this.$ = new yy.Code([], $$[$0], $$[$0-1]); +break; +case 49:this.$ = 'func'; +break; +case 50:this.$ = 'boundfunc'; +break; +case 51:this.$ = $$[$0]; +break; +case 52:this.$ = $$[$0]; +break; +case 53:this.$ = []; +break; +case 54:this.$ = [$$[$0]]; +break; +case 55:this.$ = $$[$0-2].concat($$[$0]); +break; +case 56:this.$ = new yy.Param($$[$0]); +break; +case 57:this.$ = new yy.Param($$[$0-1], null, true); +break; +case 58:this.$ = new yy.Param($$[$0-2], $$[$0]); +break; +case 59:this.$ = $$[$0]; +break; +case 60:this.$ = $$[$0]; +break; +case 61:this.$ = $$[$0]; +break; +case 62:this.$ = $$[$0]; +break; +case 63:this.$ = new yy.Splat($$[$0-1]); +break; +case 64:this.$ = new yy.Value($$[$0]); +break; +case 65:this.$ = $$[$0-1].add($$[$0]); +break; +case 66:this.$ = new yy.Value($$[$0-1], [].concat($$[$0])); +break; +case 67:this.$ = $$[$0]; +break; +case 68:this.$ = $$[$0]; +break; +case 69:this.$ = new yy.Value($$[$0]); +break; +case 70:this.$ = new yy.Value($$[$0]); +break; +case 71:this.$ = $$[$0]; +break; +case 72:this.$ = new yy.Value($$[$0]); +break; +case 73:this.$ = new yy.Value($$[$0]); +break; +case 74:this.$ = new yy.Value($$[$0]); +break; +case 75:this.$ = $$[$0]; +break; +case 76:this.$ = new yy.Access($$[$0]); +break; +case 77:this.$ = new yy.Access($$[$0], 'soak'); +break; +case 78:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])]; +break; +case 79:this.$ = new yy.Access(new yy.Literal('prototype')); +break; +case 80:this.$ = $$[$0]; +break; +case 81:this.$ = $$[$0-1]; +break; +case 82:this.$ = yy.extend($$[$0], { + soak: true + }); +break; +case 83:this.$ = new yy.Index($$[$0]); +break; +case 84:this.$ = new yy.Slice($$[$0]); +break; +case 85:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated); +break; +case 86:this.$ = []; +break; +case 87:this.$ = [$$[$0]]; +break; +case 88:this.$ = $$[$0-2].concat($$[$0]); +break; +case 89:this.$ = $$[$0-3].concat($$[$0]); +break; +case 90:this.$ = $$[$0-5].concat($$[$0-2]); +break; +case 91:this.$ = new yy.Class; +break; +case 92:this.$ = new yy.Class(null, null, $$[$0]); +break; +case 93:this.$ = new yy.Class(null, $$[$0]); +break; +case 94:this.$ = new yy.Class(null, $$[$0-1], $$[$0]); +break; +case 95:this.$ = new yy.Class($$[$0]); +break; +case 96:this.$ = new yy.Class($$[$0-1], null, $$[$0]); +break; +case 97:this.$ = new yy.Class($$[$0-2], $$[$0]); +break; +case 98:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]); +break; +case 99:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]); +break; +case 100:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]); +break; +case 101:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]); +break; +case 102:this.$ = new yy.Call('super', $$[$0]); +break; +case 103:this.$ = false; +break; +case 104:this.$ = true; +break; +case 105:this.$ = []; +break; +case 106:this.$ = $$[$0-2]; +break; +case 107:this.$ = new yy.Value(new yy.Literal('this')); +break; +case 108:this.$ = new yy.Value(new yy.Literal('this')); +break; +case 109:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this'); +break; +case 110:this.$ = new yy.Arr([]); +break; +case 111:this.$ = new yy.Arr($$[$0-2]); +break; +case 112:this.$ = 'inclusive'; +break; +case 113:this.$ = 'exclusive'; +break; +case 114:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]); +break; +case 115:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]); +break; +case 116:this.$ = new yy.Range($$[$0-1], null, $$[$0]); +break; +case 117:this.$ = new yy.Range(null, $$[$0], $$[$0-1]); +break; +case 118:this.$ = [$$[$0]]; +break; +case 119:this.$ = $$[$0-2].concat($$[$0]); +break; +case 120:this.$ = $$[$0-3].concat($$[$0]); +break; +case 121:this.$ = $$[$0-2]; +break; +case 122:this.$ = $$[$0-5].concat($$[$0-2]); +break; +case 123:this.$ = $$[$0]; +break; +case 124:this.$ = $$[$0]; +break; +case 125:this.$ = $$[$0]; +break; +case 126:this.$ = [].concat($$[$0-2], $$[$0]); +break; +case 127:this.$ = new yy.Try($$[$0]); +break; +case 128:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]); +break; +case 129:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]); +break; +case 130:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]); +break; +case 131:this.$ = [$$[$0-1], $$[$0]]; +break; +case 132:this.$ = new yy.Throw($$[$0]); +break; +case 133:this.$ = new yy.Parens($$[$0-1]); +break; +case 134:this.$ = new yy.Parens($$[$0-2]); +break; +case 135:this.$ = new yy.While($$[$0]); +break; +case 136:this.$ = new yy.While($$[$0-2], { + guard: $$[$0] + }); +break; +case 137:this.$ = new yy.While($$[$0], { + invert: true + }); +break; +case 138:this.$ = new yy.While($$[$0-2], { + invert: true, + guard: $$[$0] + }); +break; +case 139:this.$ = $$[$0-1].addBody($$[$0]); +break; +case 140:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); +break; +case 141:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); +break; +case 142:this.$ = $$[$0]; +break; +case 143:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]); +break; +case 144:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]])); +break; +case 145:this.$ = new yy.For($$[$0-1], $$[$0]); +break; +case 146:this.$ = new yy.For($$[$0-1], $$[$0]); +break; +case 147:this.$ = new yy.For($$[$0], $$[$0-1]); +break; +case 148:this.$ = { + source: new yy.Value($$[$0]) + }; +break; +case 149:this.$ = (function () { + $$[$0].own = $$[$0-1].own; + $$[$0].name = $$[$0-1][0]; + $$[$0].index = $$[$0-1][1]; + return $$[$0]; + }()); +break; +case 150:this.$ = $$[$0]; +break; +case 151:this.$ = (function () { + $$[$0].own = true; + return $$[$0]; + }()); +break; +case 152:this.$ = $$[$0]; +break; +case 153:this.$ = new yy.Value($$[$0]); +break; +case 154:this.$ = new yy.Value($$[$0]); +break; +case 155:this.$ = [$$[$0]]; +break; +case 156:this.$ = [$$[$0-2], $$[$0]]; +break; +case 157:this.$ = { + source: $$[$0] + }; +break; +case 158:this.$ = { + source: $$[$0], + object: true + }; +break; +case 159:this.$ = { + source: $$[$0-2], + guard: $$[$0] + }; +break; +case 160:this.$ = { + source: $$[$0-2], + guard: $$[$0], + object: true + }; +break; +case 161:this.$ = { + source: $$[$0-2], + step: $$[$0] + }; +break; +case 162:this.$ = { + source: $$[$0-4], + guard: $$[$0-2], + step: $$[$0] + }; +break; +case 163:this.$ = { + source: $$[$0-4], + step: $$[$0-2], + guard: $$[$0] + }; +break; +case 164:this.$ = new yy.Switch($$[$0-3], $$[$0-1]); +break; +case 165:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]); +break; +case 166:this.$ = new yy.Switch(null, $$[$0-1]); +break; +case 167:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]); +break; +case 168:this.$ = $$[$0]; +break; +case 169:this.$ = $$[$0-1].concat($$[$0]); +break; +case 170:this.$ = [[$$[$0-1], $$[$0]]]; +break; +case 171:this.$ = [[$$[$0-2], $$[$0-1]]]; +break; +case 172:this.$ = new yy.If($$[$0-1], $$[$0], { + type: $$[$0-2] + }); +break; +case 173:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], { + type: $$[$0-2] + })); +break; +case 174:this.$ = $$[$0]; +break; +case 175:this.$ = $$[$0-2].addElse($$[$0]); +break; +case 176:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { + type: $$[$0-1], + statement: true + }); +break; +case 177:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { + type: $$[$0-1], + statement: true + }); +break; +case 178:this.$ = new yy.Op($$[$0-1], $$[$0]); +break; +case 179:this.$ = new yy.Op('-', $$[$0]); +break; +case 180:this.$ = new yy.Op('+', $$[$0]); +break; +case 181:this.$ = new yy.Op('--', $$[$0]); +break; +case 182:this.$ = new yy.Op('++', $$[$0]); +break; +case 183:this.$ = new yy.Op('--', $$[$0-1], null, true); +break; +case 184:this.$ = new yy.Op('++', $$[$0-1], null, true); +break; +case 185:this.$ = new yy.Existence($$[$0-1]); +break; +case 186:this.$ = new yy.Op('+', $$[$0-2], $$[$0]); +break; +case 187:this.$ = new yy.Op('-', $$[$0-2], $$[$0]); +break; +case 188:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); +break; +case 189:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); +break; +case 190:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); +break; +case 191:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); +break; +case 192:this.$ = (function () { + if ($$[$0-1].charAt(0) === '!') { + return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); + } else { + return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); + } + }()); +break; +case 193:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]); +break; +case 194:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]); +break; +case 195:this.$ = new yy.Extends($$[$0-2], $$[$0]); +break; +} +}, +table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[3]},{1:[2,2],6:[1,72]},{6:[1,73]},{1:[2,4],6:[2,4],26:[2,4],99:[2,4]},{4:75,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,74],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,7],6:[2,7],26:[2,7],99:[2,7],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,8],6:[2,8],26:[2,8],99:[2,8],100:88,101:[1,63],103:[1,64],106:89,107:[1,66],108:67,123:[1,87]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],47:[2,12],52:[2,12],55:[2,12],60:91,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],70:[2,12],71:[1,98],75:[2,12],78:90,81:[1,92],82:[2,103],83:[2,12],88:[2,12],90:[2,12],99:[2,12],101:[2,12],102:[2,12],103:[2,12],107:[2,12],115:[2,12],123:[2,12],125:[2,12],126:[2,12],129:[2,12],130:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],47:[2,13],52:[2,13],55:[2,13],60:100,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],70:[2,13],71:[1,98],75:[2,13],78:99,81:[1,92],82:[2,103],83:[2,13],88:[2,13],90:[2,13],99:[2,13],101:[2,13],102:[2,13],103:[2,13],107:[2,13],115:[2,13],123:[2,13],125:[2,13],126:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],47:[2,14],52:[2,14],55:[2,14],70:[2,14],75:[2,14],83:[2,14],88:[2,14],90:[2,14],99:[2,14],101:[2,14],102:[2,14],103:[2,14],107:[2,14],115:[2,14],123:[2,14],125:[2,14],126:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],47:[2,15],52:[2,15],55:[2,15],70:[2,15],75:[2,15],83:[2,15],88:[2,15],90:[2,15],99:[2,15],101:[2,15],102:[2,15],103:[2,15],107:[2,15],115:[2,15],123:[2,15],125:[2,15],126:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],47:[2,16],52:[2,16],55:[2,16],70:[2,16],75:[2,16],83:[2,16],88:[2,16],90:[2,16],99:[2,16],101:[2,16],102:[2,16],103:[2,16],107:[2,16],115:[2,16],123:[2,16],125:[2,16],126:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],47:[2,17],52:[2,17],55:[2,17],70:[2,17],75:[2,17],83:[2,17],88:[2,17],90:[2,17],99:[2,17],101:[2,17],102:[2,17],103:[2,17],107:[2,17],115:[2,17],123:[2,17],125:[2,17],126:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],47:[2,18],52:[2,18],55:[2,18],70:[2,18],75:[2,18],83:[2,18],88:[2,18],90:[2,18],99:[2,18],101:[2,18],102:[2,18],103:[2,18],107:[2,18],115:[2,18],123:[2,18],125:[2,18],126:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],47:[2,19],52:[2,19],55:[2,19],70:[2,19],75:[2,19],83:[2,19],88:[2,19],90:[2,19],99:[2,19],101:[2,19],102:[2,19],103:[2,19],107:[2,19],115:[2,19],123:[2,19],125:[2,19],126:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],47:[2,20],52:[2,20],55:[2,20],70:[2,20],75:[2,20],83:[2,20],88:[2,20],90:[2,20],99:[2,20],101:[2,20],102:[2,20],103:[2,20],107:[2,20],115:[2,20],123:[2,20],125:[2,20],126:[2,20],129:[2,20],130:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],47:[2,21],52:[2,21],55:[2,21],70:[2,21],75:[2,21],83:[2,21],88:[2,21],90:[2,21],99:[2,21],101:[2,21],102:[2,21],103:[2,21],107:[2,21],115:[2,21],123:[2,21],125:[2,21],126:[2,21],129:[2,21],130:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],47:[2,22],52:[2,22],55:[2,22],70:[2,22],75:[2,22],83:[2,22],88:[2,22],90:[2,22],99:[2,22],101:[2,22],102:[2,22],103:[2,22],107:[2,22],115:[2,22],123:[2,22],125:[2,22],126:[2,22],129:[2,22],130:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],47:[2,23],52:[2,23],55:[2,23],70:[2,23],75:[2,23],83:[2,23],88:[2,23],90:[2,23],99:[2,23],101:[2,23],102:[2,23],103:[2,23],107:[2,23],115:[2,23],123:[2,23],125:[2,23],126:[2,23],129:[2,23],130:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23]},{1:[2,9],6:[2,9],26:[2,9],99:[2,9],101:[2,9],103:[2,9],107:[2,9],123:[2,9]},{1:[2,10],6:[2,10],26:[2,10],99:[2,10],101:[2,10],103:[2,10],107:[2,10],123:[2,10]},{1:[2,11],6:[2,11],26:[2,11],99:[2,11],101:[2,11],103:[2,11],107:[2,11],123:[2,11]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],38:[1,101],47:[2,71],52:[2,71],55:[2,71],64:[2,71],65:[2,71],66:[2,71],68:[2,71],70:[2,71],71:[2,71],75:[2,71],81:[2,71],82:[2,71],83:[2,71],88:[2,71],90:[2,71],99:[2,71],101:[2,71],102:[2,71],103:[2,71],107:[2,71],115:[2,71],123:[2,71],125:[2,71],126:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],47:[2,72],52:[2,72],55:[2,72],64:[2,72],65:[2,72],66:[2,72],68:[2,72],70:[2,72],71:[2,72],75:[2,72],81:[2,72],82:[2,72],83:[2,72],88:[2,72],90:[2,72],99:[2,72],101:[2,72],102:[2,72],103:[2,72],107:[2,72],115:[2,72],123:[2,72],125:[2,72],126:[2,72],129:[2,72],130:[2,72],131:[2,72],132:[2,72],133:[2,72],134:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],47:[2,73],52:[2,73],55:[2,73],64:[2,73],65:[2,73],66:[2,73],68:[2,73],70:[2,73],71:[2,73],75:[2,73],81:[2,73],82:[2,73],83:[2,73],88:[2,73],90:[2,73],99:[2,73],101:[2,73],102:[2,73],103:[2,73],107:[2,73],115:[2,73],123:[2,73],125:[2,73],126:[2,73],129:[2,73],130:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],47:[2,74],52:[2,74],55:[2,74],64:[2,74],65:[2,74],66:[2,74],68:[2,74],70:[2,74],71:[2,74],75:[2,74],81:[2,74],82:[2,74],83:[2,74],88:[2,74],90:[2,74],99:[2,74],101:[2,74],102:[2,74],103:[2,74],107:[2,74],115:[2,74],123:[2,74],125:[2,74],126:[2,74],129:[2,74],130:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],47:[2,75],52:[2,75],55:[2,75],64:[2,75],65:[2,75],66:[2,75],68:[2,75],70:[2,75],71:[2,75],75:[2,75],81:[2,75],82:[2,75],83:[2,75],88:[2,75],90:[2,75],99:[2,75],101:[2,75],102:[2,75],103:[2,75],107:[2,75],115:[2,75],123:[2,75],125:[2,75],126:[2,75],129:[2,75],130:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75]},{1:[2,101],6:[2,101],25:[2,101],26:[2,101],47:[2,101],52:[2,101],55:[2,101],64:[2,101],65:[2,101],66:[2,101],68:[2,101],70:[2,101],71:[2,101],75:[2,101],79:102,81:[2,101],82:[1,103],83:[2,101],88:[2,101],90:[2,101],99:[2,101],101:[2,101],102:[2,101],103:[2,101],107:[2,101],115:[2,101],123:[2,101],125:[2,101],126:[2,101],129:[2,101],130:[2,101],131:[2,101],132:[2,101],133:[2,101],134:[2,101]},{27:107,28:[1,71],42:108,46:104,47:[2,53],52:[2,53],53:105,54:106,56:109,57:110,73:[1,68],86:[1,111],87:[1,112]},{5:113,25:[1,5]},{8:114,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:116,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:117,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{13:119,14:120,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:121,42:61,56:47,57:48,59:118,61:25,62:26,63:27,73:[1,68],80:[1,28],85:[1,56],86:[1,57],87:[1,55],98:[1,54]},{13:119,14:120,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:121,42:61,56:47,57:48,59:122,61:25,62:26,63:27,73:[1,68],80:[1,28],85:[1,56],86:[1,57],87:[1,55],98:[1,54]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],38:[2,68],47:[2,68],52:[2,68],55:[2,68],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,68],71:[2,68],75:[2,68],77:[1,126],81:[2,68],82:[2,68],83:[2,68],88:[2,68],90:[2,68],99:[2,68],101:[2,68],102:[2,68],103:[2,68],107:[2,68],115:[2,68],123:[2,68],125:[2,68],126:[2,68],127:[1,123],128:[1,124],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[1,125]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],47:[2,174],52:[2,174],55:[2,174],70:[2,174],75:[2,174],83:[2,174],88:[2,174],90:[2,174],99:[2,174],101:[2,174],102:[2,174],103:[2,174],107:[2,174],115:[2,174],118:[1,127],123:[2,174],125:[2,174],126:[2,174],129:[2,174],130:[2,174],131:[2,174],132:[2,174],133:[2,174],134:[2,174]},{5:128,25:[1,5]},{5:129,25:[1,5]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],47:[2,142],52:[2,142],55:[2,142],70:[2,142],75:[2,142],83:[2,142],88:[2,142],90:[2,142],99:[2,142],101:[2,142],102:[2,142],103:[2,142],107:[2,142],115:[2,142],123:[2,142],125:[2,142],126:[2,142],129:[2,142],130:[2,142],131:[2,142],132:[2,142],133:[2,142],134:[2,142]},{5:130,25:[1,5]},{8:131,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,132],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,91],5:133,6:[2,91],13:119,14:120,25:[1,5],26:[2,91],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:121,42:61,47:[2,91],52:[2,91],55:[2,91],56:47,57:48,59:135,61:25,62:26,63:27,70:[2,91],73:[1,68],75:[2,91],77:[1,134],80:[1,28],83:[2,91],85:[1,56],86:[1,57],87:[1,55],88:[2,91],90:[2,91],98:[1,54],99:[2,91],101:[2,91],102:[2,91],103:[2,91],107:[2,91],115:[2,91],123:[2,91],125:[2,91],126:[2,91],129:[2,91],130:[2,91],131:[2,91],132:[2,91],133:[2,91],134:[2,91]},{8:136,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,45],6:[2,45],8:137,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,45],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],99:[2,45],100:39,101:[2,45],103:[2,45],104:40,105:[1,65],106:41,107:[2,45],108:67,116:[1,42],121:37,122:[1,62],123:[2,45],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,46],6:[2,46],25:[2,46],26:[2,46],52:[2,46],75:[2,46],99:[2,46],101:[2,46],103:[2,46],107:[2,46],123:[2,46]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],38:[2,69],47:[2,69],52:[2,69],55:[2,69],64:[2,69],65:[2,69],66:[2,69],68:[2,69],70:[2,69],71:[2,69],75:[2,69],81:[2,69],82:[2,69],83:[2,69],88:[2,69],90:[2,69],99:[2,69],101:[2,69],102:[2,69],103:[2,69],107:[2,69],115:[2,69],123:[2,69],125:[2,69],126:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],38:[2,70],47:[2,70],52:[2,70],55:[2,70],64:[2,70],65:[2,70],66:[2,70],68:[2,70],70:[2,70],71:[2,70],75:[2,70],81:[2,70],82:[2,70],83:[2,70],88:[2,70],90:[2,70],99:[2,70],101:[2,70],102:[2,70],103:[2,70],107:[2,70],115:[2,70],123:[2,70],125:[2,70],126:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],47:[2,29],52:[2,29],55:[2,29],64:[2,29],65:[2,29],66:[2,29],68:[2,29],70:[2,29],71:[2,29],75:[2,29],81:[2,29],82:[2,29],83:[2,29],88:[2,29],90:[2,29],99:[2,29],101:[2,29],102:[2,29],103:[2,29],107:[2,29],115:[2,29],123:[2,29],125:[2,29],126:[2,29],129:[2,29],130:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],47:[2,30],52:[2,30],55:[2,30],64:[2,30],65:[2,30],66:[2,30],68:[2,30],70:[2,30],71:[2,30],75:[2,30],81:[2,30],82:[2,30],83:[2,30],88:[2,30],90:[2,30],99:[2,30],101:[2,30],102:[2,30],103:[2,30],107:[2,30],115:[2,30],123:[2,30],125:[2,30],126:[2,30],129:[2,30],130:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],47:[2,31],52:[2,31],55:[2,31],64:[2,31],65:[2,31],66:[2,31],68:[2,31],70:[2,31],71:[2,31],75:[2,31],81:[2,31],82:[2,31],83:[2,31],88:[2,31],90:[2,31],99:[2,31],101:[2,31],102:[2,31],103:[2,31],107:[2,31],115:[2,31],123:[2,31],125:[2,31],126:[2,31],129:[2,31],130:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],47:[2,32],52:[2,32],55:[2,32],64:[2,32],65:[2,32],66:[2,32],68:[2,32],70:[2,32],71:[2,32],75:[2,32],81:[2,32],82:[2,32],83:[2,32],88:[2,32],90:[2,32],99:[2,32],101:[2,32],102:[2,32],103:[2,32],107:[2,32],115:[2,32],123:[2,32],125:[2,32],126:[2,32],129:[2,32],130:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],47:[2,33],52:[2,33],55:[2,33],64:[2,33],65:[2,33],66:[2,33],68:[2,33],70:[2,33],71:[2,33],75:[2,33],81:[2,33],82:[2,33],83:[2,33],88:[2,33],90:[2,33],99:[2,33],101:[2,33],102:[2,33],103:[2,33],107:[2,33],115:[2,33],123:[2,33],125:[2,33],126:[2,33],129:[2,33],130:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33]},{4:138,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,139],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:140,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:142,85:[1,56],86:[1,57],87:[1,55],88:[1,141],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],47:[2,107],52:[2,107],55:[2,107],64:[2,107],65:[2,107],66:[2,107],68:[2,107],70:[2,107],71:[2,107],75:[2,107],81:[2,107],82:[2,107],83:[2,107],88:[2,107],90:[2,107],99:[2,107],101:[2,107],102:[2,107],103:[2,107],107:[2,107],115:[2,107],123:[2,107],125:[2,107],126:[2,107],129:[2,107],130:[2,107],131:[2,107],132:[2,107],133:[2,107],134:[2,107]},{1:[2,108],6:[2,108],25:[2,108],26:[2,108],27:146,28:[1,71],47:[2,108],52:[2,108],55:[2,108],64:[2,108],65:[2,108],66:[2,108],68:[2,108],70:[2,108],71:[2,108],75:[2,108],81:[2,108],82:[2,108],83:[2,108],88:[2,108],90:[2,108],99:[2,108],101:[2,108],102:[2,108],103:[2,108],107:[2,108],115:[2,108],123:[2,108],125:[2,108],126:[2,108],129:[2,108],130:[2,108],131:[2,108],132:[2,108],133:[2,108],134:[2,108]},{25:[2,49]},{25:[2,50]},{1:[2,64],6:[2,64],25:[2,64],26:[2,64],38:[2,64],47:[2,64],52:[2,64],55:[2,64],64:[2,64],65:[2,64],66:[2,64],68:[2,64],70:[2,64],71:[2,64],75:[2,64],77:[2,64],81:[2,64],82:[2,64],83:[2,64],88:[2,64],90:[2,64],99:[2,64],101:[2,64],102:[2,64],103:[2,64],107:[2,64],115:[2,64],123:[2,64],125:[2,64],126:[2,64],127:[2,64],128:[2,64],129:[2,64],130:[2,64],131:[2,64],132:[2,64],133:[2,64],134:[2,64],135:[2,64]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],38:[2,67],47:[2,67],52:[2,67],55:[2,67],64:[2,67],65:[2,67],66:[2,67],68:[2,67],70:[2,67],71:[2,67],75:[2,67],77:[2,67],81:[2,67],82:[2,67],83:[2,67],88:[2,67],90:[2,67],99:[2,67],101:[2,67],102:[2,67],103:[2,67],107:[2,67],115:[2,67],123:[2,67],125:[2,67],126:[2,67],127:[2,67],128:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67],134:[2,67],135:[2,67]},{8:147,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:148,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:149,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{5:150,8:151,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{27:156,28:[1,71],56:157,57:158,62:152,73:[1,68],87:[1,55],110:153,111:[1,154],112:155},{109:159,113:[1,160],114:[1,161]},{6:[2,86],11:165,25:[2,86],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:163,40:164,42:168,44:[1,46],52:[2,86],74:162,75:[2,86],86:[1,111]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],41:[2,27],47:[2,27],52:[2,27],55:[2,27],64:[2,27],65:[2,27],66:[2,27],68:[2,27],70:[2,27],71:[2,27],75:[2,27],81:[2,27],82:[2,27],83:[2,27],88:[2,27],90:[2,27],99:[2,27],101:[2,27],102:[2,27],103:[2,27],107:[2,27],115:[2,27],123:[2,27],125:[2,27],126:[2,27],129:[2,27],130:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],41:[2,28],47:[2,28],52:[2,28],55:[2,28],64:[2,28],65:[2,28],66:[2,28],68:[2,28],70:[2,28],71:[2,28],75:[2,28],81:[2,28],82:[2,28],83:[2,28],88:[2,28],90:[2,28],99:[2,28],101:[2,28],102:[2,28],103:[2,28],107:[2,28],115:[2,28],123:[2,28],125:[2,28],126:[2,28],129:[2,28],130:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],38:[2,26],41:[2,26],47:[2,26],52:[2,26],55:[2,26],64:[2,26],65:[2,26],66:[2,26],68:[2,26],70:[2,26],71:[2,26],75:[2,26],77:[2,26],81:[2,26],82:[2,26],83:[2,26],88:[2,26],90:[2,26],99:[2,26],101:[2,26],102:[2,26],103:[2,26],107:[2,26],113:[2,26],114:[2,26],115:[2,26],123:[2,26],125:[2,26],126:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26]},{1:[2,6],6:[2,6],7:169,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],99:[2,6],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],47:[2,24],52:[2,24],55:[2,24],70:[2,24],75:[2,24],83:[2,24],88:[2,24],90:[2,24],95:[2,24],96:[2,24],99:[2,24],101:[2,24],102:[2,24],103:[2,24],107:[2,24],115:[2,24],118:[2,24],120:[2,24],123:[2,24],125:[2,24],126:[2,24],129:[2,24],130:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24]},{6:[1,72],26:[1,170]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],47:[2,185],52:[2,185],55:[2,185],70:[2,185],75:[2,185],83:[2,185],88:[2,185],90:[2,185],99:[2,185],101:[2,185],102:[2,185],103:[2,185],107:[2,185],115:[2,185],123:[2,185],125:[2,185],126:[2,185],129:[2,185],130:[2,185],131:[2,185],132:[2,185],133:[2,185],134:[2,185]},{8:171,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:172,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:173,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:174,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:175,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:176,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:177,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:178,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],47:[2,141],52:[2,141],55:[2,141],70:[2,141],75:[2,141],83:[2,141],88:[2,141],90:[2,141],99:[2,141],101:[2,141],102:[2,141],103:[2,141],107:[2,141],115:[2,141],123:[2,141],125:[2,141],126:[2,141],129:[2,141],130:[2,141],131:[2,141],132:[2,141],133:[2,141],134:[2,141]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],47:[2,146],52:[2,146],55:[2,146],70:[2,146],75:[2,146],83:[2,146],88:[2,146],90:[2,146],99:[2,146],101:[2,146],102:[2,146],103:[2,146],107:[2,146],115:[2,146],123:[2,146],125:[2,146],126:[2,146],129:[2,146],130:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146]},{8:179,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],47:[2,140],52:[2,140],55:[2,140],70:[2,140],75:[2,140],83:[2,140],88:[2,140],90:[2,140],99:[2,140],101:[2,140],102:[2,140],103:[2,140],107:[2,140],115:[2,140],123:[2,140],125:[2,140],126:[2,140],129:[2,140],130:[2,140],131:[2,140],132:[2,140],133:[2,140],134:[2,140]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],47:[2,145],52:[2,145],55:[2,145],70:[2,145],75:[2,145],83:[2,145],88:[2,145],90:[2,145],99:[2,145],101:[2,145],102:[2,145],103:[2,145],107:[2,145],115:[2,145],123:[2,145],125:[2,145],126:[2,145],129:[2,145],130:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145]},{79:180,82:[1,103]},{1:[2,65],6:[2,65],25:[2,65],26:[2,65],38:[2,65],47:[2,65],52:[2,65],55:[2,65],64:[2,65],65:[2,65],66:[2,65],68:[2,65],70:[2,65],71:[2,65],75:[2,65],77:[2,65],81:[2,65],82:[2,65],83:[2,65],88:[2,65],90:[2,65],99:[2,65],101:[2,65],102:[2,65],103:[2,65],107:[2,65],115:[2,65],123:[2,65],125:[2,65],126:[2,65],127:[2,65],128:[2,65],129:[2,65],130:[2,65],131:[2,65],132:[2,65],133:[2,65],134:[2,65],135:[2,65]},{82:[2,104]},{27:181,28:[1,71]},{27:182,28:[1,71]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],27:183,28:[1,71],38:[2,79],47:[2,79],52:[2,79],55:[2,79],64:[2,79],65:[2,79],66:[2,79],68:[2,79],70:[2,79],71:[2,79],75:[2,79],77:[2,79],81:[2,79],82:[2,79],83:[2,79],88:[2,79],90:[2,79],99:[2,79],101:[2,79],102:[2,79],103:[2,79],107:[2,79],115:[2,79],123:[2,79],125:[2,79],126:[2,79],127:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],38:[2,80],47:[2,80],52:[2,80],55:[2,80],64:[2,80],65:[2,80],66:[2,80],68:[2,80],70:[2,80],71:[2,80],75:[2,80],77:[2,80],81:[2,80],82:[2,80],83:[2,80],88:[2,80],90:[2,80],99:[2,80],101:[2,80],102:[2,80],103:[2,80],107:[2,80],115:[2,80],123:[2,80],125:[2,80],126:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80]},{8:185,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],55:[1,189],56:47,57:48,59:36,61:25,62:26,63:27,69:184,72:186,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],89:187,90:[1,188],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{67:190,68:[1,97],71:[1,98]},{79:191,82:[1,103]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],38:[2,66],47:[2,66],52:[2,66],55:[2,66],64:[2,66],65:[2,66],66:[2,66],68:[2,66],70:[2,66],71:[2,66],75:[2,66],77:[2,66],81:[2,66],82:[2,66],83:[2,66],88:[2,66],90:[2,66],99:[2,66],101:[2,66],102:[2,66],103:[2,66],107:[2,66],115:[2,66],123:[2,66],125:[2,66],126:[2,66],127:[2,66],128:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[2,66],135:[2,66]},{6:[1,193],8:192,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,194],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],47:[2,102],52:[2,102],55:[2,102],64:[2,102],65:[2,102],66:[2,102],68:[2,102],70:[2,102],71:[2,102],75:[2,102],81:[2,102],82:[2,102],83:[2,102],88:[2,102],90:[2,102],99:[2,102],101:[2,102],102:[2,102],103:[2,102],107:[2,102],115:[2,102],123:[2,102],125:[2,102],126:[2,102],129:[2,102],130:[2,102],131:[2,102],132:[2,102],133:[2,102],134:[2,102]},{8:197,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],83:[1,195],84:196,85:[1,56],86:[1,57],87:[1,55],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{47:[1,198],52:[1,199]},{47:[2,54],52:[2,54]},{38:[1,201],47:[2,56],52:[2,56],55:[1,200]},{38:[2,59],47:[2,59],52:[2,59],55:[2,59]},{38:[2,60],47:[2,60],52:[2,60],55:[2,60]},{38:[2,61],47:[2,61],52:[2,61],55:[2,61]},{38:[2,62],47:[2,62],52:[2,62],55:[2,62]},{27:146,28:[1,71]},{8:197,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:142,85:[1,56],86:[1,57],87:[1,55],88:[1,141],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],47:[2,48],52:[2,48],55:[2,48],70:[2,48],75:[2,48],83:[2,48],88:[2,48],90:[2,48],99:[2,48],101:[2,48],102:[2,48],103:[2,48],107:[2,48],115:[2,48],123:[2,48],125:[2,48],126:[2,48],129:[2,48],130:[2,48],131:[2,48],132:[2,48],133:[2,48],134:[2,48]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],47:[2,178],52:[2,178],55:[2,178],70:[2,178],75:[2,178],83:[2,178],88:[2,178],90:[2,178],99:[2,178],100:85,101:[2,178],102:[2,178],103:[2,178],106:86,107:[2,178],108:67,115:[2,178],123:[2,178],125:[2,178],126:[2,178],129:[1,76],130:[2,178],131:[2,178],132:[2,178],133:[2,178],134:[2,178]},{100:88,101:[1,63],103:[1,64],106:89,107:[1,66],108:67,123:[1,87]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],47:[2,179],52:[2,179],55:[2,179],70:[2,179],75:[2,179],83:[2,179],88:[2,179],90:[2,179],99:[2,179],100:85,101:[2,179],102:[2,179],103:[2,179],106:86,107:[2,179],108:67,115:[2,179],123:[2,179],125:[2,179],126:[2,179],129:[1,76],130:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],47:[2,180],52:[2,180],55:[2,180],70:[2,180],75:[2,180],83:[2,180],88:[2,180],90:[2,180],99:[2,180],100:85,101:[2,180],102:[2,180],103:[2,180],106:86,107:[2,180],108:67,115:[2,180],123:[2,180],125:[2,180],126:[2,180],129:[1,76],130:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],47:[2,181],52:[2,181],55:[2,181],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,181],71:[2,68],75:[2,181],81:[2,68],82:[2,68],83:[2,181],88:[2,181],90:[2,181],99:[2,181],101:[2,181],102:[2,181],103:[2,181],107:[2,181],115:[2,181],123:[2,181],125:[2,181],126:[2,181],129:[2,181],130:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181]},{60:91,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],71:[1,98],78:90,81:[1,92],82:[2,103]},{60:100,64:[1,93],65:[1,94],66:[1,95],67:96,68:[1,97],71:[1,98],78:99,81:[1,92],82:[2,103]},{64:[2,71],65:[2,71],66:[2,71],68:[2,71],71:[2,71],81:[2,71],82:[2,71]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],47:[2,182],52:[2,182],55:[2,182],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,182],71:[2,68],75:[2,182],81:[2,68],82:[2,68],83:[2,182],88:[2,182],90:[2,182],99:[2,182],101:[2,182],102:[2,182],103:[2,182],107:[2,182],115:[2,182],123:[2,182],125:[2,182],126:[2,182],129:[2,182],130:[2,182],131:[2,182],132:[2,182],133:[2,182],134:[2,182]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],47:[2,183],52:[2,183],55:[2,183],70:[2,183],75:[2,183],83:[2,183],88:[2,183],90:[2,183],99:[2,183],101:[2,183],102:[2,183],103:[2,183],107:[2,183],115:[2,183],123:[2,183],125:[2,183],126:[2,183],129:[2,183],130:[2,183],131:[2,183],132:[2,183],133:[2,183],134:[2,183]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],47:[2,184],52:[2,184],55:[2,184],70:[2,184],75:[2,184],83:[2,184],88:[2,184],90:[2,184],99:[2,184],101:[2,184],102:[2,184],103:[2,184],107:[2,184],115:[2,184],123:[2,184],125:[2,184],126:[2,184],129:[2,184],130:[2,184],131:[2,184],132:[2,184],133:[2,184],134:[2,184]},{8:202,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,203],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:204,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{5:205,25:[1,5],122:[1,206]},{1:[2,127],6:[2,127],25:[2,127],26:[2,127],47:[2,127],52:[2,127],55:[2,127],70:[2,127],75:[2,127],83:[2,127],88:[2,127],90:[2,127],94:207,95:[1,208],96:[1,209],99:[2,127],101:[2,127],102:[2,127],103:[2,127],107:[2,127],115:[2,127],123:[2,127],125:[2,127],126:[2,127],129:[2,127],130:[2,127],131:[2,127],132:[2,127],133:[2,127],134:[2,127]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],47:[2,139],52:[2,139],55:[2,139],70:[2,139],75:[2,139],83:[2,139],88:[2,139],90:[2,139],99:[2,139],101:[2,139],102:[2,139],103:[2,139],107:[2,139],115:[2,139],123:[2,139],125:[2,139],126:[2,139],129:[2,139],130:[2,139],131:[2,139],132:[2,139],133:[2,139],134:[2,139]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],47:[2,147],52:[2,147],55:[2,147],70:[2,147],75:[2,147],83:[2,147],88:[2,147],90:[2,147],99:[2,147],101:[2,147],102:[2,147],103:[2,147],107:[2,147],115:[2,147],123:[2,147],125:[2,147],126:[2,147],129:[2,147],130:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147]},{25:[1,210],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{117:211,119:212,120:[1,213]},{1:[2,92],6:[2,92],25:[2,92],26:[2,92],47:[2,92],52:[2,92],55:[2,92],70:[2,92],75:[2,92],83:[2,92],88:[2,92],90:[2,92],99:[2,92],101:[2,92],102:[2,92],103:[2,92],107:[2,92],115:[2,92],123:[2,92],125:[2,92],126:[2,92],129:[2,92],130:[2,92],131:[2,92],132:[2,92],133:[2,92],134:[2,92]},{8:214,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,95],5:215,6:[2,95],25:[1,5],26:[2,95],47:[2,95],52:[2,95],55:[2,95],64:[2,68],65:[2,68],66:[2,68],68:[2,68],70:[2,95],71:[2,68],75:[2,95],77:[1,216],81:[2,68],82:[2,68],83:[2,95],88:[2,95],90:[2,95],99:[2,95],101:[2,95],102:[2,95],103:[2,95],107:[2,95],115:[2,95],123:[2,95],125:[2,95],126:[2,95],129:[2,95],130:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],47:[2,132],52:[2,132],55:[2,132],70:[2,132],75:[2,132],83:[2,132],88:[2,132],90:[2,132],99:[2,132],100:85,101:[2,132],102:[2,132],103:[2,132],106:86,107:[2,132],108:67,115:[2,132],123:[2,132],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,44],6:[2,44],26:[2,44],99:[2,44],100:85,101:[2,44],103:[2,44],106:86,107:[2,44],108:67,123:[2,44],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,72],99:[1,217]},{4:218,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,123],25:[2,123],52:[2,123],55:[1,220],88:[2,123],89:219,90:[1,188],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],38:[2,110],47:[2,110],52:[2,110],55:[2,110],64:[2,110],65:[2,110],66:[2,110],68:[2,110],70:[2,110],71:[2,110],75:[2,110],81:[2,110],82:[2,110],83:[2,110],88:[2,110],90:[2,110],99:[2,110],101:[2,110],102:[2,110],103:[2,110],107:[2,110],113:[2,110],114:[2,110],115:[2,110],123:[2,110],125:[2,110],126:[2,110],129:[2,110],130:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110]},{6:[2,51],25:[2,51],51:221,52:[1,222],88:[2,51]},{6:[2,118],25:[2,118],26:[2,118],52:[2,118],83:[2,118],88:[2,118]},{8:197,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:223,85:[1,56],86:[1,57],87:[1,55],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,124],25:[2,124],26:[2,124],52:[2,124],83:[2,124],88:[2,124]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],38:[2,109],41:[2,109],47:[2,109],52:[2,109],55:[2,109],64:[2,109],65:[2,109],66:[2,109],68:[2,109],70:[2,109],71:[2,109],75:[2,109],77:[2,109],81:[2,109],82:[2,109],83:[2,109],88:[2,109],90:[2,109],99:[2,109],101:[2,109],102:[2,109],103:[2,109],107:[2,109],115:[2,109],123:[2,109],125:[2,109],126:[2,109],127:[2,109],128:[2,109],129:[2,109],130:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109]},{5:224,25:[1,5],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],47:[2,135],52:[2,135],55:[2,135],70:[2,135],75:[2,135],83:[2,135],88:[2,135],90:[2,135],99:[2,135],100:85,101:[1,63],102:[1,225],103:[1,64],106:86,107:[1,66],108:67,115:[2,135],123:[2,135],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],47:[2,137],52:[2,137],55:[2,137],70:[2,137],75:[2,137],83:[2,137],88:[2,137],90:[2,137],99:[2,137],100:85,101:[1,63],102:[1,226],103:[1,64],106:86,107:[1,66],108:67,115:[2,137],123:[2,137],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],47:[2,143],52:[2,143],55:[2,143],70:[2,143],75:[2,143],83:[2,143],88:[2,143],90:[2,143],99:[2,143],101:[2,143],102:[2,143],103:[2,143],107:[2,143],115:[2,143],123:[2,143],125:[2,143],126:[2,143],129:[2,143],130:[2,143],131:[2,143],132:[2,143],133:[2,143],134:[2,143]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],47:[2,144],52:[2,144],55:[2,144],70:[2,144],75:[2,144],83:[2,144],88:[2,144],90:[2,144],99:[2,144],100:85,101:[1,63],102:[2,144],103:[1,64],106:86,107:[1,66],108:67,115:[2,144],123:[2,144],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],47:[2,148],52:[2,148],55:[2,148],70:[2,148],75:[2,148],83:[2,148],88:[2,148],90:[2,148],99:[2,148],101:[2,148],102:[2,148],103:[2,148],107:[2,148],115:[2,148],123:[2,148],125:[2,148],126:[2,148],129:[2,148],130:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148]},{113:[2,150],114:[2,150]},{27:156,28:[1,71],56:157,57:158,73:[1,68],87:[1,112],110:227,112:155},{52:[1,228],113:[2,155],114:[2,155]},{52:[2,152],113:[2,152],114:[2,152]},{52:[2,153],113:[2,153],114:[2,153]},{52:[2,154],113:[2,154],114:[2,154]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],47:[2,149],52:[2,149],55:[2,149],70:[2,149],75:[2,149],83:[2,149],88:[2,149],90:[2,149],99:[2,149],101:[2,149],102:[2,149],103:[2,149],107:[2,149],115:[2,149],123:[2,149],125:[2,149],126:[2,149],129:[2,149],130:[2,149],131:[2,149],132:[2,149],133:[2,149],134:[2,149]},{8:229,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:230,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,51],25:[2,51],51:231,52:[1,232],75:[2,51]},{6:[2,87],25:[2,87],26:[2,87],52:[2,87],75:[2,87]},{6:[2,37],25:[2,37],26:[2,37],41:[1,233],52:[2,37],75:[2,37]},{6:[2,40],25:[2,40],26:[2,40],52:[2,40],75:[2,40]},{6:[2,41],25:[2,41],26:[2,41],41:[2,41],52:[2,41],75:[2,41]},{6:[2,42],25:[2,42],26:[2,42],41:[2,42],52:[2,42],75:[2,42]},{6:[2,43],25:[2,43],26:[2,43],41:[2,43],52:[2,43],75:[2,43]},{1:[2,5],6:[2,5],26:[2,5],99:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],47:[2,25],52:[2,25],55:[2,25],70:[2,25],75:[2,25],83:[2,25],88:[2,25],90:[2,25],95:[2,25],96:[2,25],99:[2,25],101:[2,25],102:[2,25],103:[2,25],107:[2,25],115:[2,25],118:[2,25],120:[2,25],123:[2,25],125:[2,25],126:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],47:[2,186],52:[2,186],55:[2,186],70:[2,186],75:[2,186],83:[2,186],88:[2,186],90:[2,186],99:[2,186],100:85,101:[2,186],102:[2,186],103:[2,186],106:86,107:[2,186],108:67,115:[2,186],123:[2,186],125:[2,186],126:[2,186],129:[1,76],130:[1,79],131:[2,186],132:[2,186],133:[2,186],134:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],47:[2,187],52:[2,187],55:[2,187],70:[2,187],75:[2,187],83:[2,187],88:[2,187],90:[2,187],99:[2,187],100:85,101:[2,187],102:[2,187],103:[2,187],106:86,107:[2,187],108:67,115:[2,187],123:[2,187],125:[2,187],126:[2,187],129:[1,76],130:[1,79],131:[2,187],132:[2,187],133:[2,187],134:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],47:[2,188],52:[2,188],55:[2,188],70:[2,188],75:[2,188],83:[2,188],88:[2,188],90:[2,188],99:[2,188],100:85,101:[2,188],102:[2,188],103:[2,188],106:86,107:[2,188],108:67,115:[2,188],123:[2,188],125:[2,188],126:[2,188],129:[1,76],130:[2,188],131:[2,188],132:[2,188],133:[2,188],134:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],47:[2,189],52:[2,189],55:[2,189],70:[2,189],75:[2,189],83:[2,189],88:[2,189],90:[2,189],99:[2,189],100:85,101:[2,189],102:[2,189],103:[2,189],106:86,107:[2,189],108:67,115:[2,189],123:[2,189],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[2,189],132:[2,189],133:[2,189],134:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],47:[2,190],52:[2,190],55:[2,190],70:[2,190],75:[2,190],83:[2,190],88:[2,190],90:[2,190],99:[2,190],100:85,101:[2,190],102:[2,190],103:[2,190],106:86,107:[2,190],108:67,115:[2,190],123:[2,190],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[2,190],133:[2,190],134:[1,83]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],47:[2,191],52:[2,191],55:[2,191],70:[2,191],75:[2,191],83:[2,191],88:[2,191],90:[2,191],99:[2,191],100:85,101:[2,191],102:[2,191],103:[2,191],106:86,107:[2,191],108:67,115:[2,191],123:[2,191],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[2,191],134:[1,83]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],47:[2,192],52:[2,192],55:[2,192],70:[2,192],75:[2,192],83:[2,192],88:[2,192],90:[2,192],99:[2,192],100:85,101:[2,192],102:[2,192],103:[2,192],106:86,107:[2,192],108:67,115:[2,192],123:[2,192],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[2,192],133:[2,192],134:[2,192]},{1:[2,177],6:[2,177],25:[2,177],26:[2,177],47:[2,177],52:[2,177],55:[2,177],70:[2,177],75:[2,177],83:[2,177],88:[2,177],90:[2,177],99:[2,177],100:85,101:[1,63],102:[2,177],103:[1,64],106:86,107:[1,66],108:67,115:[2,177],123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],47:[2,176],52:[2,176],55:[2,176],70:[2,176],75:[2,176],83:[2,176],88:[2,176],90:[2,176],99:[2,176],100:85,101:[1,63],102:[2,176],103:[1,64],106:86,107:[1,66],108:67,115:[2,176],123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],47:[2,99],52:[2,99],55:[2,99],64:[2,99],65:[2,99],66:[2,99],68:[2,99],70:[2,99],71:[2,99],75:[2,99],81:[2,99],82:[2,99],83:[2,99],88:[2,99],90:[2,99],99:[2,99],101:[2,99],102:[2,99],103:[2,99],107:[2,99],115:[2,99],123:[2,99],125:[2,99],126:[2,99],129:[2,99],130:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],38:[2,76],47:[2,76],52:[2,76],55:[2,76],64:[2,76],65:[2,76],66:[2,76],68:[2,76],70:[2,76],71:[2,76],75:[2,76],77:[2,76],81:[2,76],82:[2,76],83:[2,76],88:[2,76],90:[2,76],99:[2,76],101:[2,76],102:[2,76],103:[2,76],107:[2,76],115:[2,76],123:[2,76],125:[2,76],126:[2,76],127:[2,76],128:[2,76],129:[2,76],130:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],38:[2,77],47:[2,77],52:[2,77],55:[2,77],64:[2,77],65:[2,77],66:[2,77],68:[2,77],70:[2,77],71:[2,77],75:[2,77],77:[2,77],81:[2,77],82:[2,77],83:[2,77],88:[2,77],90:[2,77],99:[2,77],101:[2,77],102:[2,77],103:[2,77],107:[2,77],115:[2,77],123:[2,77],125:[2,77],126:[2,77],127:[2,77],128:[2,77],129:[2,77],130:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],38:[2,78],47:[2,78],52:[2,78],55:[2,78],64:[2,78],65:[2,78],66:[2,78],68:[2,78],70:[2,78],71:[2,78],75:[2,78],77:[2,78],81:[2,78],82:[2,78],83:[2,78],88:[2,78],90:[2,78],99:[2,78],101:[2,78],102:[2,78],103:[2,78],107:[2,78],115:[2,78],123:[2,78],125:[2,78],126:[2,78],127:[2,78],128:[2,78],129:[2,78],130:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78]},{70:[1,234]},{55:[1,189],70:[2,83],89:235,90:[1,188],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{70:[2,84]},{8:236,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{12:[2,112],28:[2,112],30:[2,112],31:[2,112],33:[2,112],34:[2,112],35:[2,112],36:[2,112],43:[2,112],44:[2,112],45:[2,112],49:[2,112],50:[2,112],70:[2,112],73:[2,112],76:[2,112],80:[2,112],85:[2,112],86:[2,112],87:[2,112],93:[2,112],97:[2,112],98:[2,112],101:[2,112],103:[2,112],105:[2,112],107:[2,112],116:[2,112],122:[2,112],124:[2,112],125:[2,112],126:[2,112],127:[2,112],128:[2,112]},{12:[2,113],28:[2,113],30:[2,113],31:[2,113],33:[2,113],34:[2,113],35:[2,113],36:[2,113],43:[2,113],44:[2,113],45:[2,113],49:[2,113],50:[2,113],70:[2,113],73:[2,113],76:[2,113],80:[2,113],85:[2,113],86:[2,113],87:[2,113],93:[2,113],97:[2,113],98:[2,113],101:[2,113],103:[2,113],105:[2,113],107:[2,113],116:[2,113],122:[2,113],124:[2,113],125:[2,113],126:[2,113],127:[2,113],128:[2,113]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],38:[2,82],47:[2,82],52:[2,82],55:[2,82],64:[2,82],65:[2,82],66:[2,82],68:[2,82],70:[2,82],71:[2,82],75:[2,82],77:[2,82],81:[2,82],82:[2,82],83:[2,82],88:[2,82],90:[2,82],99:[2,82],101:[2,82],102:[2,82],103:[2,82],107:[2,82],115:[2,82],123:[2,82],125:[2,82],126:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],47:[2,100],52:[2,100],55:[2,100],64:[2,100],65:[2,100],66:[2,100],68:[2,100],70:[2,100],71:[2,100],75:[2,100],81:[2,100],82:[2,100],83:[2,100],88:[2,100],90:[2,100],99:[2,100],101:[2,100],102:[2,100],103:[2,100],107:[2,100],115:[2,100],123:[2,100],125:[2,100],126:[2,100],129:[2,100],130:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],47:[2,34],52:[2,34],55:[2,34],70:[2,34],75:[2,34],83:[2,34],88:[2,34],90:[2,34],99:[2,34],100:85,101:[2,34],102:[2,34],103:[2,34],106:86,107:[2,34],108:67,115:[2,34],123:[2,34],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{8:237,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:238,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],47:[2,105],52:[2,105],55:[2,105],64:[2,105],65:[2,105],66:[2,105],68:[2,105],70:[2,105],71:[2,105],75:[2,105],81:[2,105],82:[2,105],83:[2,105],88:[2,105],90:[2,105],99:[2,105],101:[2,105],102:[2,105],103:[2,105],107:[2,105],115:[2,105],123:[2,105],125:[2,105],126:[2,105],129:[2,105],130:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105]},{6:[2,51],25:[2,51],51:239,52:[1,222],83:[2,51]},{6:[2,123],25:[2,123],26:[2,123],52:[2,123],55:[1,240],83:[2,123],88:[2,123],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{48:241,49:[1,58],50:[1,59]},{27:107,28:[1,71],42:108,53:242,54:106,56:109,57:110,73:[1,68],86:[1,111],87:[1,112]},{47:[2,57],52:[2,57]},{8:243,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],47:[2,193],52:[2,193],55:[2,193],70:[2,193],75:[2,193],83:[2,193],88:[2,193],90:[2,193],99:[2,193],100:85,101:[2,193],102:[2,193],103:[2,193],106:86,107:[2,193],108:67,115:[2,193],123:[2,193],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{8:244,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],47:[2,195],52:[2,195],55:[2,195],70:[2,195],75:[2,195],83:[2,195],88:[2,195],90:[2,195],99:[2,195],100:85,101:[2,195],102:[2,195],103:[2,195],106:86,107:[2,195],108:67,115:[2,195],123:[2,195],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],47:[2,175],52:[2,175],55:[2,175],70:[2,175],75:[2,175],83:[2,175],88:[2,175],90:[2,175],99:[2,175],101:[2,175],102:[2,175],103:[2,175],107:[2,175],115:[2,175],123:[2,175],125:[2,175],126:[2,175],129:[2,175],130:[2,175],131:[2,175],132:[2,175],133:[2,175],134:[2,175]},{8:245,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,128],6:[2,128],25:[2,128],26:[2,128],47:[2,128],52:[2,128],55:[2,128],70:[2,128],75:[2,128],83:[2,128],88:[2,128],90:[2,128],95:[1,246],99:[2,128],101:[2,128],102:[2,128],103:[2,128],107:[2,128],115:[2,128],123:[2,128],125:[2,128],126:[2,128],129:[2,128],130:[2,128],131:[2,128],132:[2,128],133:[2,128],134:[2,128]},{5:247,25:[1,5]},{27:248,28:[1,71]},{117:249,119:212,120:[1,213]},{26:[1,250],118:[1,251],119:252,120:[1,213]},{26:[2,168],118:[2,168],120:[2,168]},{8:254,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],92:253,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,93],5:255,6:[2,93],25:[1,5],26:[2,93],47:[2,93],52:[2,93],55:[2,93],70:[2,93],75:[2,93],83:[2,93],88:[2,93],90:[2,93],99:[2,93],100:85,101:[1,63],102:[2,93],103:[1,64],106:86,107:[1,66],108:67,115:[2,93],123:[2,93],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],47:[2,96],52:[2,96],55:[2,96],70:[2,96],75:[2,96],83:[2,96],88:[2,96],90:[2,96],99:[2,96],101:[2,96],102:[2,96],103:[2,96],107:[2,96],115:[2,96],123:[2,96],125:[2,96],126:[2,96],129:[2,96],130:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96]},{8:256,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],47:[2,133],52:[2,133],55:[2,133],64:[2,133],65:[2,133],66:[2,133],68:[2,133],70:[2,133],71:[2,133],75:[2,133],81:[2,133],82:[2,133],83:[2,133],88:[2,133],90:[2,133],99:[2,133],101:[2,133],102:[2,133],103:[2,133],107:[2,133],115:[2,133],123:[2,133],125:[2,133],126:[2,133],129:[2,133],130:[2,133],131:[2,133],132:[2,133],133:[2,133],134:[2,133]},{6:[1,72],26:[1,257]},{8:258,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,63],12:[2,113],25:[2,63],28:[2,113],30:[2,113],31:[2,113],33:[2,113],34:[2,113],35:[2,113],36:[2,113],43:[2,113],44:[2,113],45:[2,113],49:[2,113],50:[2,113],52:[2,63],73:[2,113],76:[2,113],80:[2,113],85:[2,113],86:[2,113],87:[2,113],88:[2,63],93:[2,113],97:[2,113],98:[2,113],101:[2,113],103:[2,113],105:[2,113],107:[2,113],116:[2,113],122:[2,113],124:[2,113],125:[2,113],126:[2,113],127:[2,113],128:[2,113]},{6:[1,260],25:[1,261],88:[1,259]},{6:[2,52],8:197,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,52],26:[2,52],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],83:[2,52],85:[1,56],86:[1,57],87:[1,55],88:[2,52],91:262,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,51],25:[2,51],26:[2,51],51:263,52:[1,222]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],47:[2,172],52:[2,172],55:[2,172],70:[2,172],75:[2,172],83:[2,172],88:[2,172],90:[2,172],99:[2,172],101:[2,172],102:[2,172],103:[2,172],107:[2,172],115:[2,172],118:[2,172],123:[2,172],125:[2,172],126:[2,172],129:[2,172],130:[2,172],131:[2,172],132:[2,172],133:[2,172],134:[2,172]},{8:264,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:265,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{113:[2,151],114:[2,151]},{27:156,28:[1,71],56:157,57:158,73:[1,68],87:[1,112],112:266},{1:[2,157],6:[2,157],25:[2,157],26:[2,157],47:[2,157],52:[2,157],55:[2,157],70:[2,157],75:[2,157],83:[2,157],88:[2,157],90:[2,157],99:[2,157],100:85,101:[2,157],102:[1,267],103:[2,157],106:86,107:[2,157],108:67,115:[1,268],123:[2,157],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,158],6:[2,158],25:[2,158],26:[2,158],47:[2,158],52:[2,158],55:[2,158],70:[2,158],75:[2,158],83:[2,158],88:[2,158],90:[2,158],99:[2,158],100:85,101:[2,158],102:[1,269],103:[2,158],106:86,107:[2,158],108:67,115:[2,158],123:[2,158],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,271],25:[1,272],75:[1,270]},{6:[2,52],11:165,25:[2,52],26:[2,52],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:273,40:164,42:168,44:[1,46],75:[2,52],86:[1,111]},{8:274,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,275],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],38:[2,81],47:[2,81],52:[2,81],55:[2,81],64:[2,81],65:[2,81],66:[2,81],68:[2,81],70:[2,81],71:[2,81],75:[2,81],77:[2,81],81:[2,81],82:[2,81],83:[2,81],88:[2,81],90:[2,81],99:[2,81],101:[2,81],102:[2,81],103:[2,81],107:[2,81],115:[2,81],123:[2,81],125:[2,81],126:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81]},{8:276,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,70:[2,116],73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{70:[2,117],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],47:[2,35],52:[2,35],55:[2,35],70:[2,35],75:[2,35],83:[2,35],88:[2,35],90:[2,35],99:[2,35],100:85,101:[2,35],102:[2,35],103:[2,35],106:86,107:[2,35],108:67,115:[2,35],123:[2,35],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{26:[1,277],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,260],25:[1,261],83:[1,278]},{6:[2,63],25:[2,63],26:[2,63],52:[2,63],83:[2,63],88:[2,63]},{5:279,25:[1,5]},{47:[2,55],52:[2,55]},{47:[2,58],52:[2,58],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{26:[1,280],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{5:281,25:[1,5],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{5:282,25:[1,5]},{1:[2,129],6:[2,129],25:[2,129],26:[2,129],47:[2,129],52:[2,129],55:[2,129],70:[2,129],75:[2,129],83:[2,129],88:[2,129],90:[2,129],99:[2,129],101:[2,129],102:[2,129],103:[2,129],107:[2,129],115:[2,129],123:[2,129],125:[2,129],126:[2,129],129:[2,129],130:[2,129],131:[2,129],132:[2,129],133:[2,129],134:[2,129]},{5:283,25:[1,5]},{26:[1,284],118:[1,285],119:252,120:[1,213]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],47:[2,166],52:[2,166],55:[2,166],70:[2,166],75:[2,166],83:[2,166],88:[2,166],90:[2,166],99:[2,166],101:[2,166],102:[2,166],103:[2,166],107:[2,166],115:[2,166],123:[2,166],125:[2,166],126:[2,166],129:[2,166],130:[2,166],131:[2,166],132:[2,166],133:[2,166],134:[2,166]},{5:286,25:[1,5]},{26:[2,169],118:[2,169],120:[2,169]},{5:287,25:[1,5],52:[1,288]},{25:[2,125],52:[2,125],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,94],6:[2,94],25:[2,94],26:[2,94],47:[2,94],52:[2,94],55:[2,94],70:[2,94],75:[2,94],83:[2,94],88:[2,94],90:[2,94],99:[2,94],101:[2,94],102:[2,94],103:[2,94],107:[2,94],115:[2,94],123:[2,94],125:[2,94],126:[2,94],129:[2,94],130:[2,94],131:[2,94],132:[2,94],133:[2,94],134:[2,94]},{1:[2,97],5:289,6:[2,97],25:[1,5],26:[2,97],47:[2,97],52:[2,97],55:[2,97],70:[2,97],75:[2,97],83:[2,97],88:[2,97],90:[2,97],99:[2,97],100:85,101:[1,63],102:[2,97],103:[1,64],106:86,107:[1,66],108:67,115:[2,97],123:[2,97],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{99:[1,290]},{88:[1,291],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],38:[2,111],47:[2,111],52:[2,111],55:[2,111],64:[2,111],65:[2,111],66:[2,111],68:[2,111],70:[2,111],71:[2,111],75:[2,111],81:[2,111],82:[2,111],83:[2,111],88:[2,111],90:[2,111],99:[2,111],101:[2,111],102:[2,111],103:[2,111],107:[2,111],113:[2,111],114:[2,111],115:[2,111],123:[2,111],125:[2,111],126:[2,111],129:[2,111],130:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111]},{8:197,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],91:292,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:197,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,144],27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,58:145,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],84:293,85:[1,56],86:[1,57],87:[1,55],91:143,93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,119],25:[2,119],26:[2,119],52:[2,119],83:[2,119],88:[2,119]},{6:[1,260],25:[1,261],26:[1,294]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],47:[2,136],52:[2,136],55:[2,136],70:[2,136],75:[2,136],83:[2,136],88:[2,136],90:[2,136],99:[2,136],100:85,101:[1,63],102:[2,136],103:[1,64],106:86,107:[1,66],108:67,115:[2,136],123:[2,136],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],47:[2,138],52:[2,138],55:[2,138],70:[2,138],75:[2,138],83:[2,138],88:[2,138],90:[2,138],99:[2,138],100:85,101:[1,63],102:[2,138],103:[1,64],106:86,107:[1,66],108:67,115:[2,138],123:[2,138],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{113:[2,156],114:[2,156]},{8:295,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:296,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:297,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],38:[2,85],47:[2,85],52:[2,85],55:[2,85],64:[2,85],65:[2,85],66:[2,85],68:[2,85],70:[2,85],71:[2,85],75:[2,85],81:[2,85],82:[2,85],83:[2,85],88:[2,85],90:[2,85],99:[2,85],101:[2,85],102:[2,85],103:[2,85],107:[2,85],113:[2,85],114:[2,85],115:[2,85],123:[2,85],125:[2,85],126:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85]},{11:165,27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:298,40:164,42:168,44:[1,46],86:[1,111]},{6:[2,86],11:165,25:[2,86],26:[2,86],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],39:163,40:164,42:168,44:[1,46],52:[2,86],74:299,86:[1,111]},{6:[2,88],25:[2,88],26:[2,88],52:[2,88],75:[2,88]},{6:[2,38],25:[2,38],26:[2,38],52:[2,38],75:[2,38],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{8:300,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{70:[2,115],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],47:[2,36],52:[2,36],55:[2,36],70:[2,36],75:[2,36],83:[2,36],88:[2,36],90:[2,36],99:[2,36],101:[2,36],102:[2,36],103:[2,36],107:[2,36],115:[2,36],123:[2,36],125:[2,36],126:[2,36],129:[2,36],130:[2,36],131:[2,36],132:[2,36],133:[2,36],134:[2,36]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],47:[2,106],52:[2,106],55:[2,106],64:[2,106],65:[2,106],66:[2,106],68:[2,106],70:[2,106],71:[2,106],75:[2,106],81:[2,106],82:[2,106],83:[2,106],88:[2,106],90:[2,106],99:[2,106],101:[2,106],102:[2,106],103:[2,106],107:[2,106],115:[2,106],123:[2,106],125:[2,106],126:[2,106],129:[2,106],130:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106]},{1:[2,47],6:[2,47],25:[2,47],26:[2,47],47:[2,47],52:[2,47],55:[2,47],70:[2,47],75:[2,47],83:[2,47],88:[2,47],90:[2,47],99:[2,47],101:[2,47],102:[2,47],103:[2,47],107:[2,47],115:[2,47],123:[2,47],125:[2,47],126:[2,47],129:[2,47],130:[2,47],131:[2,47],132:[2,47],133:[2,47],134:[2,47]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],47:[2,194],52:[2,194],55:[2,194],70:[2,194],75:[2,194],83:[2,194],88:[2,194],90:[2,194],99:[2,194],101:[2,194],102:[2,194],103:[2,194],107:[2,194],115:[2,194],123:[2,194],125:[2,194],126:[2,194],129:[2,194],130:[2,194],131:[2,194],132:[2,194],133:[2,194],134:[2,194]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],47:[2,173],52:[2,173],55:[2,173],70:[2,173],75:[2,173],83:[2,173],88:[2,173],90:[2,173],99:[2,173],101:[2,173],102:[2,173],103:[2,173],107:[2,173],115:[2,173],118:[2,173],123:[2,173],125:[2,173],126:[2,173],129:[2,173],130:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173]},{1:[2,130],6:[2,130],25:[2,130],26:[2,130],47:[2,130],52:[2,130],55:[2,130],70:[2,130],75:[2,130],83:[2,130],88:[2,130],90:[2,130],99:[2,130],101:[2,130],102:[2,130],103:[2,130],107:[2,130],115:[2,130],123:[2,130],125:[2,130],126:[2,130],129:[2,130],130:[2,130],131:[2,130],132:[2,130],133:[2,130],134:[2,130]},{1:[2,131],6:[2,131],25:[2,131],26:[2,131],47:[2,131],52:[2,131],55:[2,131],70:[2,131],75:[2,131],83:[2,131],88:[2,131],90:[2,131],95:[2,131],99:[2,131],101:[2,131],102:[2,131],103:[2,131],107:[2,131],115:[2,131],123:[2,131],125:[2,131],126:[2,131],129:[2,131],130:[2,131],131:[2,131],132:[2,131],133:[2,131],134:[2,131]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],47:[2,164],52:[2,164],55:[2,164],70:[2,164],75:[2,164],83:[2,164],88:[2,164],90:[2,164],99:[2,164],101:[2,164],102:[2,164],103:[2,164],107:[2,164],115:[2,164],123:[2,164],125:[2,164],126:[2,164],129:[2,164],130:[2,164],131:[2,164],132:[2,164],133:[2,164],134:[2,164]},{5:301,25:[1,5]},{26:[1,302]},{6:[1,303],26:[2,170],118:[2,170],120:[2,170]},{8:304,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],47:[2,98],52:[2,98],55:[2,98],70:[2,98],75:[2,98],83:[2,98],88:[2,98],90:[2,98],99:[2,98],101:[2,98],102:[2,98],103:[2,98],107:[2,98],115:[2,98],123:[2,98],125:[2,98],126:[2,98],129:[2,98],130:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],47:[2,134],52:[2,134],55:[2,134],64:[2,134],65:[2,134],66:[2,134],68:[2,134],70:[2,134],71:[2,134],75:[2,134],81:[2,134],82:[2,134],83:[2,134],88:[2,134],90:[2,134],99:[2,134],101:[2,134],102:[2,134],103:[2,134],107:[2,134],115:[2,134],123:[2,134],125:[2,134],126:[2,134],129:[2,134],130:[2,134],131:[2,134],132:[2,134],133:[2,134],134:[2,134]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],47:[2,114],52:[2,114],55:[2,114],64:[2,114],65:[2,114],66:[2,114],68:[2,114],70:[2,114],71:[2,114],75:[2,114],81:[2,114],82:[2,114],83:[2,114],88:[2,114],90:[2,114],99:[2,114],101:[2,114],102:[2,114],103:[2,114],107:[2,114],115:[2,114],123:[2,114],125:[2,114],126:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114]},{6:[2,120],25:[2,120],26:[2,120],52:[2,120],83:[2,120],88:[2,120]},{6:[2,51],25:[2,51],26:[2,51],51:305,52:[1,222]},{6:[2,121],25:[2,121],26:[2,121],52:[2,121],83:[2,121],88:[2,121]},{1:[2,159],6:[2,159],25:[2,159],26:[2,159],47:[2,159],52:[2,159],55:[2,159],70:[2,159],75:[2,159],83:[2,159],88:[2,159],90:[2,159],99:[2,159],100:85,101:[2,159],102:[2,159],103:[2,159],106:86,107:[2,159],108:67,115:[1,306],123:[2,159],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,161],6:[2,161],25:[2,161],26:[2,161],47:[2,161],52:[2,161],55:[2,161],70:[2,161],75:[2,161],83:[2,161],88:[2,161],90:[2,161],99:[2,161],100:85,101:[2,161],102:[1,307],103:[2,161],106:86,107:[2,161],108:67,115:[2,161],123:[2,161],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,160],6:[2,160],25:[2,160],26:[2,160],47:[2,160],52:[2,160],55:[2,160],70:[2,160],75:[2,160],83:[2,160],88:[2,160],90:[2,160],99:[2,160],100:85,101:[2,160],102:[2,160],103:[2,160],106:86,107:[2,160],108:67,115:[2,160],123:[2,160],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[2,89],25:[2,89],26:[2,89],52:[2,89],75:[2,89]},{6:[2,51],25:[2,51],26:[2,51],51:308,52:[1,232]},{26:[1,309],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{26:[1,310]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],47:[2,167],52:[2,167],55:[2,167],70:[2,167],75:[2,167],83:[2,167],88:[2,167],90:[2,167],99:[2,167],101:[2,167],102:[2,167],103:[2,167],107:[2,167],115:[2,167],123:[2,167],125:[2,167],126:[2,167],129:[2,167],130:[2,167],131:[2,167],132:[2,167],133:[2,167],134:[2,167]},{26:[2,171],118:[2,171],120:[2,171]},{25:[2,126],52:[2,126],100:85,101:[1,63],103:[1,64],106:86,107:[1,66],108:67,123:[1,84],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[1,260],25:[1,261],26:[1,311]},{8:312,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:313,9:115,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:60,28:[1,71],29:49,30:[1,69],31:[1,70],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:23,42:61,43:[1,45],44:[1,46],45:[1,29],48:30,49:[1,58],50:[1,59],56:47,57:48,59:36,61:25,62:26,63:27,73:[1,68],76:[1,43],80:[1,28],85:[1,56],86:[1,57],87:[1,55],93:[1,38],97:[1,44],98:[1,54],100:39,101:[1,63],103:[1,64],104:40,105:[1,65],106:41,107:[1,66],108:67,116:[1,42],121:37,122:[1,62],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[1,271],25:[1,272],26:[1,314]},{6:[2,39],25:[2,39],26:[2,39],52:[2,39],75:[2,39]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],47:[2,165],52:[2,165],55:[2,165],70:[2,165],75:[2,165],83:[2,165],88:[2,165],90:[2,165],99:[2,165],101:[2,165],102:[2,165],103:[2,165],107:[2,165],115:[2,165],123:[2,165],125:[2,165],126:[2,165],129:[2,165],130:[2,165],131:[2,165],132:[2,165],133:[2,165],134:[2,165]},{6:[2,122],25:[2,122],26:[2,122],52:[2,122],83:[2,122],88:[2,122]},{1:[2,162],6:[2,162],25:[2,162],26:[2,162],47:[2,162],52:[2,162],55:[2,162],70:[2,162],75:[2,162],83:[2,162],88:[2,162],90:[2,162],99:[2,162],100:85,101:[2,162],102:[2,162],103:[2,162],106:86,107:[2,162],108:67,115:[2,162],123:[2,162],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],47:[2,163],52:[2,163],55:[2,163],70:[2,163],75:[2,163],83:[2,163],88:[2,163],90:[2,163],99:[2,163],100:85,101:[2,163],102:[2,163],103:[2,163],106:86,107:[2,163],108:67,115:[2,163],123:[2,163],125:[1,78],126:[1,77],129:[1,76],130:[1,79],131:[1,80],132:[1,81],133:[1,82],134:[1,83]},{6:[2,90],25:[2,90],26:[2,90],52:[2,90],75:[2,90]}], +defaultActions: {58:[2,49],59:[2,50],73:[2,3],92:[2,104],186:[2,84]}, +parseError: function parseError(str, hash) { + throw new Error(str); +}, +parse: function parse(input) { + var self = this, + stack = [0], + vstack = [null], // semantic value stack + lstack = [], // location stack + table = this.table, + yytext = '', + yylineno = 0, + yyleng = 0, + recovering = 0, + TERROR = 2, + EOF = 1; + + //this.reductionCount = this.shiftCount = 0; + + this.lexer.setInput(input); + this.lexer.yy = this.yy; + this.yy.lexer = this.lexer; + if (typeof this.lexer.yylloc == 'undefined') + this.lexer.yylloc = {}; + var yyloc = this.lexer.yylloc; + lstack.push(yyloc); + + if (typeof this.yy.parseError === 'function') + this.parseError = this.yy.parseError; + + function popStack (n) { + stack.length = stack.length - 2*n; + vstack.length = vstack.length - n; + lstack.length = lstack.length - n; + } + + function lex() { + var token; + token = self.lexer.lex() || 1; // $end = 1 + // if token isn't its numeric value, convert + if (typeof token !== 'number') { + token = self.symbols_[token] || token; + } + return token; + }; + + var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected; + while (true) { + // retreive state number from top of stack + state = stack[stack.length-1]; + + // use default actions if available + if (this.defaultActions[state]) { + action = this.defaultActions[state]; + } else { + if (symbol == null) + symbol = lex(); + // read action for current state and first input + action = table[state] && table[state][symbol]; + } + + // handle parse error + if (typeof action === 'undefined' || !action.length || !action[0]) { + + if (!recovering) { + // Report error + expected = []; + for (p in table[state]) if (this.terminals_[p] && p > 2) { + expected.push("'"+this.terminals_[p]+"'"); + } + var errStr = ''; + if (this.lexer.showPosition) { + errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+'\nExpecting '+expected.join(', '); + } else { + errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " + + (symbol == 1 /*EOF*/ ? "end of input" : + ("'"+(this.terminals_[symbol] || symbol)+"'")); + } + this.parseError(errStr, + {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); + } + + // just recovered from another error + if (recovering == 3) { + if (symbol == EOF) { + throw new Error(errStr || 'Parsing halted.'); + } + + // discard current lookahead and grab another + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + symbol = lex(); + } + + // try to recover from error + while (1) { + // check for error recovery rule in this state + if ((TERROR.toString()) in table[state]) { + break; + } + if (state == 0) { + throw new Error(errStr || 'Parsing halted.'); + } + popStack(1); + state = stack[stack.length-1]; + } + + preErrorSymbol = symbol; // save the lookahead token + symbol = TERROR; // insert generic error symbol as new lookahead + state = stack[stack.length-1]; + action = table[state] && table[state][TERROR]; + recovering = 3; // allow 3 real symbols to be shifted before reporting a new error + } + + // this shouldn't happen, unless resolve defaults are off + if (action[0] instanceof Array && action.length > 1) { + throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol); + } + + switch (action[0]) { + + case 1: // shift + //this.shiftCount++; + + stack.push(symbol); + vstack.push(this.lexer.yytext); + lstack.push(this.lexer.yylloc); + stack.push(action[1]); // push state + symbol = null; + if (!preErrorSymbol) { // normal execution/no error + yyleng = this.lexer.yyleng; + yytext = this.lexer.yytext; + yylineno = this.lexer.yylineno; + yyloc = this.lexer.yylloc; + if (recovering > 0) + recovering--; + } else { // error just occurred, resume old lookahead f/ before error + symbol = preErrorSymbol; + preErrorSymbol = null; + } + break; + + case 2: // reduce + //this.reductionCount++; + + len = this.productions_[action[1]][1]; + + // perform semantic action + yyval.$ = vstack[vstack.length-len]; // default to $$ = $1 + // default location, uses first token for firsts, last for lasts + yyval._$ = { + first_line: lstack[lstack.length-(len||1)].first_line, + last_line: lstack[lstack.length-1].last_line, + first_column: lstack[lstack.length-(len||1)].first_column, + last_column: lstack[lstack.length-1].last_column + }; + r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); + + if (typeof r !== 'undefined') { + return r; + } + + // pop off stack + if (len) { + stack = stack.slice(0,-1*len*2); + vstack = vstack.slice(0, -1*len); + lstack = lstack.slice(0, -1*len); + } + + stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce) + vstack.push(yyval.$); + lstack.push(yyval._$); + // goto new state = table[STATE][NONTERMINAL] + newState = table[stack[stack.length-2]][stack[stack.length-1]]; + stack.push(newState); + break; + + case 3: // accept + return true; + } + + } + + return true; +}}; +return parser; +})(); +if (typeof require !== 'undefined' && typeof exports !== 'undefined') { +exports.parser = parser; +exports.parse = function () { return parser.parse.apply(parser, arguments); } +exports.main = function commonjsMain(args) { + if (!args[1]) + throw new Error('Usage: '+args[0]+' FILE'); + if (typeof process !== 'undefined') { + var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8"); + } else { + var cwd = require("file").path(require("file").cwd()); + var source = cwd.join(args[1]).read({charset: "utf-8"}); + } + return exports.parser.parse(source); +} +if (typeof module !== 'undefined' && require.main === module) { + exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args); +} +} \ No newline at end of file diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/repl.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/repl.js new file mode 100644 index 0000000..3368d7c --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/repl.js @@ -0,0 +1,149 @@ +(function() { + var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, readline, repl, run, stdin, stdout; + + CoffeeScript = require('./coffee-script'); + + readline = require('readline'); + + inspect = require('util').inspect; + + Script = require('vm').Script; + + Module = require('module'); + + REPL_PROMPT = 'coffee> '; + + REPL_PROMPT_CONTINUATION = '......> '; + + enableColours = false; + + if (process.platform !== 'win32') { + enableColours = !process.env.NODE_DISABLE_COLORS; + } + + stdin = process.openStdin(); + + stdout = process.stdout; + + error = function(err) { + return stdout.write((err.stack || err.toString()) + '\n'); + }; + + backlog = ''; + + run = function(buffer) { + var code, returnValue, _; + if (!buffer.toString().trim() && !backlog) { + repl.prompt(); + return; + } + code = backlog += buffer; + if (code[code.length - 1] === '\\') { + backlog = "" + backlog.slice(0, -1) + "\n"; + repl.setPrompt(REPL_PROMPT_CONTINUATION); + repl.prompt(); + return; + } + repl.setPrompt(REPL_PROMPT); + backlog = ''; + try { + _ = global._; + returnValue = CoffeeScript.eval("_=(" + code + "\n)", { + filename: 'repl', + modulename: 'repl' + }); + if (returnValue === void 0) global._ = _; + process.stdout.write(inspect(returnValue, false, 2, enableColours) + '\n'); + } catch (err) { + error(err); + } + return repl.prompt(); + }; + + ACCESSOR = /\s*([\w\.]+)(?:\.(\w*))$/; + + SIMPLEVAR = /\s*(\w*)$/i; + + autocomplete = function(text) { + return completeAttribute(text) || completeVariable(text) || [[], text]; + }; + + completeAttribute = function(text) { + var all, completions, match, obj, prefix, val; + if (match = text.match(ACCESSOR)) { + all = match[0], obj = match[1], prefix = match[2]; + try { + val = Script.runInThisContext(obj); + } catch (error) { + return; + } + completions = getCompletions(prefix, Object.getOwnPropertyNames(val)); + return [completions, prefix]; + } + }; + + completeVariable = function(text) { + var completions, free, keywords, possibilities, r, vars, _ref; + free = (_ref = text.match(SIMPLEVAR)) != null ? _ref[1] : void 0; + if (free != null) { + vars = Script.runInThisContext('Object.getOwnPropertyNames(this)'); + keywords = (function() { + var _i, _len, _ref2, _results; + _ref2 = CoffeeScript.RESERVED; + _results = []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + r = _ref2[_i]; + if (r.slice(0, 2) !== '__') _results.push(r); + } + return _results; + })(); + possibilities = vars.concat(keywords); + completions = getCompletions(free, possibilities); + return [completions, free]; + } + }; + + getCompletions = function(prefix, candidates) { + var el, _i, _len, _results; + _results = []; + for (_i = 0, _len = candidates.length; _i < _len; _i++) { + el = candidates[_i]; + if (el.indexOf(prefix) === 0) _results.push(el); + } + return _results; + }; + + process.on('uncaughtException', error); + + if (readline.createInterface.length < 3) { + repl = readline.createInterface(stdin, autocomplete); + stdin.on('data', function(buffer) { + return repl.write(buffer); + }); + } else { + repl = readline.createInterface(stdin, stdout, autocomplete); + } + + repl.on('attemptClose', function() { + if (backlog) { + backlog = ''; + process.stdout.write('\n'); + repl.setPrompt(REPL_PROMPT); + return repl.prompt(); + } else { + return repl.close(); + } + }); + + repl.on('close', function() { + process.stdout.write('\n'); + return stdin.destroy(); + }); + + repl.on('line', run); + + repl.setPrompt(REPL_PROMPT); + + repl.prompt(); + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/rewriter.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/rewriter.js new file mode 100644 index 0000000..b4fdc07 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/rewriter.js @@ -0,0 +1,301 @@ +(function() { + var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref, + __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, + __slice = Array.prototype.slice; + + exports.Rewriter = (function() { + + function Rewriter() {} + + Rewriter.prototype.rewrite = function(tokens) { + this.tokens = tokens; + this.removeLeadingNewlines(); + this.removeMidExpressionNewlines(); + this.closeOpenCalls(); + this.closeOpenIndexes(); + this.addImplicitIndentation(); + this.tagPostfixConditionals(); + this.addImplicitBraces(); + this.addImplicitParentheses(); + return this.tokens; + }; + + Rewriter.prototype.scanTokens = function(block) { + var i, token, tokens; + tokens = this.tokens; + i = 0; + while (token = tokens[i]) { + i += block.call(this, token, i, tokens); + } + return true; + }; + + Rewriter.prototype.detectEnd = function(i, condition, action) { + var levels, token, tokens, _ref, _ref2; + tokens = this.tokens; + levels = 0; + while (token = tokens[i]) { + if (levels === 0 && condition.call(this, token, i)) { + return action.call(this, token, i); + } + if (!token || levels < 0) return action.call(this, token, i - 1); + if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { + levels += 1; + } else if (_ref2 = token[0], __indexOf.call(EXPRESSION_END, _ref2) >= 0) { + levels -= 1; + } + i += 1; + } + return i - 1; + }; + + Rewriter.prototype.removeLeadingNewlines = function() { + var i, tag, _len, _ref; + _ref = this.tokens; + for (i = 0, _len = _ref.length; i < _len; i++) { + tag = _ref[i][0]; + if (tag !== 'TERMINATOR') break; + } + if (i) return this.tokens.splice(0, i); + }; + + Rewriter.prototype.removeMidExpressionNewlines = function() { + return this.scanTokens(function(token, i, tokens) { + var _ref; + if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) { + return 1; + } + tokens.splice(i, 1); + return 0; + }); + }; + + Rewriter.prototype.closeOpenCalls = function() { + var action, condition; + condition = function(token, i) { + var _ref; + return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; + }; + action = function(token, i) { + return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; + }; + return this.scanTokens(function(token, i) { + if (token[0] === 'CALL_START') this.detectEnd(i + 1, condition, action); + return 1; + }); + }; + + Rewriter.prototype.closeOpenIndexes = function() { + var action, condition; + condition = function(token, i) { + var _ref; + return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; + }; + action = function(token, i) { + return token[0] = 'INDEX_END'; + }; + return this.scanTokens(function(token, i) { + if (token[0] === 'INDEX_START') this.detectEnd(i + 1, condition, action); + return 1; + }); + }; + + Rewriter.prototype.addImplicitBraces = function() { + var action, condition, sameLine, stack, start, startIndent, startsLine; + stack = []; + start = null; + startsLine = null; + sameLine = true; + startIndent = 0; + condition = function(token, i) { + var one, tag, three, two, _ref, _ref2; + _ref = this.tokens.slice(i + 1, (i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2]; + if ('HERECOMMENT' === (one != null ? one[0] : void 0)) return false; + tag = token[0]; + if (__indexOf.call(LINEBREAKS, tag) >= 0) sameLine = false; + return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine)) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref2 = one[0]) !== 'IDENTIFIER' && _ref2 !== 'NUMBER' && _ref2 !== 'STRING' && _ref2 !== '@' && _ref2 !== 'TERMINATOR' && _ref2 !== 'OUTDENT')); + }; + action = function(token, i) { + var tok; + tok = ['}', '}', token[2]]; + tok.generated = true; + return this.tokens.splice(i, 0, tok); + }; + return this.scanTokens(function(token, i, tokens) { + var ago, idx, prevTag, tag, tok, value, _ref, _ref2; + if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) { + stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]); + return 1; + } + if (__indexOf.call(EXPRESSION_END, tag) >= 0) { + start = stack.pop(); + return 1; + } + if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref2 = stack[stack.length - 1]) != null ? _ref2[0] : void 0) !== '{'))) { + return 1; + } + sameLine = true; + stack.push(['{']); + idx = ago === '@' ? i - 2 : i - 1; + while (this.tag(idx - 2) === 'HERECOMMENT') { + idx -= 2; + } + prevTag = this.tag(idx - 1); + startsLine = !prevTag || (__indexOf.call(LINEBREAKS, prevTag) >= 0); + value = new String('{'); + value.generated = true; + tok = ['{', value, token[2]]; + tok.generated = true; + tokens.splice(idx, 0, tok); + this.detectEnd(i + 2, condition, action); + return 2; + }); + }; + + Rewriter.prototype.addImplicitParentheses = function() { + var action, condition, noCall, seenControl, seenSingle; + noCall = seenSingle = seenControl = false; + condition = function(token, i) { + var post, tag, _ref, _ref2; + tag = token[0]; + if (!seenSingle && token.fromThen) return true; + if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>' || tag === 'CLASS') { + seenSingle = true; + } + if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY' || tag === '=') { + seenControl = true; + } + if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') { + return true; + } + return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (((_ref = this.tag(i - 2)) !== 'CLASS' && _ref !== 'EXTENDS') && (_ref2 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref2) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{'))); + }; + action = function(token, i) { + return this.tokens.splice(i, 0, ['CALL_END', ')', token[2]]); + }; + return this.scanTokens(function(token, i, tokens) { + var callObject, current, next, prev, tag, _ref, _ref2, _ref3; + tag = token[0]; + if (tag === 'CLASS' || tag === 'IF') noCall = true; + _ref = tokens.slice(i - 1, (i + 1) + 1 || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2]; + callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0); + seenSingle = false; + seenControl = false; + if (__indexOf.call(LINEBREAKS, tag) >= 0) noCall = false; + if (prev && !prev.spaced && tag === '?') token.call = true; + if (token.fromThen) return 1; + if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref3 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref3) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) { + return 1; + } + tokens.splice(i, 0, ['CALL_START', '(', token[2]]); + this.detectEnd(i + 1, condition, action); + if (prev[0] === '?') prev[0] = 'FUNC_EXIST'; + return 2; + }); + }; + + Rewriter.prototype.addImplicitIndentation = function() { + var action, condition, indent, outdent, starter; + starter = indent = outdent = null; + condition = function(token, i) { + var _ref; + return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN')); + }; + action = function(token, i) { + return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); + }; + return this.scanTokens(function(token, i, tokens) { + var tag, _ref, _ref2; + tag = token[0]; + if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') { + tokens.splice(i, 1); + return 0; + } + if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { + tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token)))); + return 2; + } + if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) { + tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token)))); + return 4; + } + if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { + starter = tag; + _ref2 = this.indentation(token), indent = _ref2[0], outdent = _ref2[1]; + if (starter === 'THEN') indent.fromThen = true; + indent.generated = outdent.generated = true; + tokens.splice(i + 1, 0, indent); + this.detectEnd(i + 2, condition, action); + if (tag === 'THEN') tokens.splice(i, 1); + return 1; + } + return 1; + }); + }; + + Rewriter.prototype.tagPostfixConditionals = function() { + var action, condition, original; + original = null; + condition = function(token, i) { + var _ref; + return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT'; + }; + action = function(token, i) { + if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { + return original[0] = 'POST_' + original[0]; + } + }; + return this.scanTokens(function(token, i) { + if (token[0] !== 'IF') return 1; + original = token; + this.detectEnd(i + 1, condition, action); + return 1; + }); + }; + + Rewriter.prototype.indentation = function(token) { + return [['INDENT', 2, token[2]], ['OUTDENT', 2, token[2]]]; + }; + + Rewriter.prototype.tag = function(i) { + var _ref; + return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; + }; + + return Rewriter; + + })(); + + BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; + + exports.INVERSES = INVERSES = {}; + + EXPRESSION_START = []; + + EXPRESSION_END = []; + + for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { + _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; + EXPRESSION_START.push(INVERSES[rite] = left); + EXPRESSION_END.push(INVERSES[left] = rite); + } + + EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); + + IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; + + IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++']; + + IMPLICIT_UNSPACED_CALL = ['+', '-']; + + IMPLICIT_BLOCK = ['->', '=>', '{', '[', ',']; + + IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; + + SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; + + SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; + + LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/scope.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/scope.js new file mode 100644 index 0000000..2162853 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/scope.js @@ -0,0 +1,124 @@ +(function() { + var Scope, extend, last, _ref; + + _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; + + exports.Scope = Scope = (function() { + + Scope.root = null; + + function Scope(parent, expressions, method) { + this.parent = parent; + this.expressions = expressions; + this.method = method; + this.variables = [ + { + name: 'arguments', + type: 'arguments' + } + ]; + this.positions = {}; + if (!this.parent) Scope.root = this; + } + + Scope.prototype.add = function(name, type, immediate) { + if (this.shared && !immediate) return this.parent.add(name, type, immediate); + if (Object.prototype.hasOwnProperty.call(this.positions, name)) { + return this.variables[this.positions[name]].type = type; + } else { + return this.positions[name] = this.variables.push({ + name: name, + type: type + }) - 1; + } + }; + + Scope.prototype.find = function(name, options) { + if (this.check(name, options)) return true; + this.add(name, 'var'); + return false; + }; + + Scope.prototype.parameter = function(name) { + if (this.shared && this.parent.check(name, true)) return; + return this.add(name, 'param'); + }; + + Scope.prototype.check = function(name, immediate) { + var found, _ref2; + found = !!this.type(name); + if (found || immediate) return found; + return !!((_ref2 = this.parent) != null ? _ref2.check(name) : void 0); + }; + + Scope.prototype.temporary = function(name, index) { + if (name.length > 1) { + return '_' + name + (index > 1 ? index : ''); + } else { + return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); + } + }; + + Scope.prototype.type = function(name) { + var v, _i, _len, _ref2; + _ref2 = this.variables; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + v = _ref2[_i]; + if (v.name === name) return v.type; + } + return null; + }; + + Scope.prototype.freeVariable = function(name, reserve) { + var index, temp; + if (reserve == null) reserve = true; + index = 0; + while (this.check((temp = this.temporary(name, index)))) { + index++; + } + if (reserve) this.add(temp, 'var', true); + return temp; + }; + + Scope.prototype.assign = function(name, value) { + this.add(name, { + value: value, + assigned: true + }, true); + return this.hasAssignments = true; + }; + + Scope.prototype.hasDeclarations = function() { + return !!this.declaredVariables().length; + }; + + Scope.prototype.declaredVariables = function() { + var realVars, tempVars, v, _i, _len, _ref2; + realVars = []; + tempVars = []; + _ref2 = this.variables; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + v = _ref2[_i]; + if (v.type === 'var') { + (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); + } + } + return realVars.sort().concat(tempVars.sort()); + }; + + Scope.prototype.assignedVariables = function() { + var v, _i, _len, _ref2, _results; + _ref2 = this.variables; + _results = []; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + v = _ref2[_i]; + if (v.type.assigned) _results.push("" + v.name + " = " + v.type.value); + } + return _results; + }; + + return Scope; + + })(); + +}).call(this); diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/package.json b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/package.json new file mode 100644 index 0000000..2547bdf --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/coffee-script/package.json @@ -0,0 +1,31 @@ +{ + "name": "coffee-script", + "description": "Unfancy JavaScript", + "keywords": ["javascript", "language", "coffeescript", "compiler"], + "author": "Jeremy Ashkenas", + "version": "1.2.0", + "licenses": [{ + "type": "MIT", + "url": "http://github.com/jashkenas/coffee-script/raw/master/LICENSE" + }], + "engines": { + "node": ">=0.4.0" + }, + "directories" : { + "lib" : "./lib/coffee-script" + }, + "main" : "./lib/coffee-script/coffee-script", + "bin": { + "coffee": "./bin/coffee", + "cake": "./bin/cake" + }, + "homepage": "http://coffeescript.org", + "repository": { + "type": "git", + "url": "git://github.com/jashkenas/coffee-script.git" + }, + "devDependencies": { + "uglify-js": ">=1.0.0", + "jison": ">=0.2.0" + } +} diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/.gitmodules b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/.gitmodules new file mode 100644 index 0000000..29fb80b --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ext/phantomjs"] + path = ext/phantomjs + url = git://github.com/ariya/phantomjs.git diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/.npmignore b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/.npmignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/.npmignore @@ -0,0 +1 @@ +*.pyc diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/LICENSE b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/LICENSE new file mode 100644 index 0000000..fcc702f --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010 Larry Myers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/README.markdown b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/README.markdown new file mode 100644 index 0000000..22b9dcd --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/README.markdown @@ -0,0 +1,52 @@ +# Jasmine Reporters + +Jasmine Reporters is a collection of javascript jasmine.Reporter classes that can be used with +the [JasmineBDD testing framework](http://pivotal.github.com/jasmine/). + +Right now the project is focused on two new reporters: + +* ConsoleReporter - Report test results to the browser console. +* JUnitXmlReporter - Report test results to a file (using Rhino or PyPhantomJS) in JUnit XML Report format. + +## Usage + +Examples are included in the test directory that show how to use the reporters, +as well a basic runner scripts for Rhino + envjs, and a basic runner for +[PhantomJS](https://github.com/ariya/phantomjs) (using PyPhantomJS and the +saveToFile plugin). Either of these methods could be used in a Continuous +Integration project for running headless tests and generating JUnit XML output. + +### Rhino + EnvJS + +Everything needed to run the tests in Rhino + EnvJS is included in this +repository inside the `ext` directory, specifically Rhino 1.7r2 and envjs 1.2 +for Rhino. + +### PhantomJS, PyPhantomJS + +PhantomJS is included as a submodule inside the `ext` directory. Our examples +require use of PyPhantomJS with the saveToFile plugin (included) in order to +facilitate saving XML output to the filesystem. + +While PhantomJS and PyPhantomJS both run on MacOS / Linux / Windows, there are +specific dependencies for each platform. Specifics on installing these are not +included here, but is left as an exercise for the reader. The project on Github +contains links to various documentation, including installation notes. + +Here is how I got it working in MacOSX 10.6 (YMMV): + +* ensure you are using Python 2.6+ +* install Xcode (this gives you make, et al) +* install qt (this gives you qmake, et al) + * this may be easiest via [homebrew](https://github.com/mxcl/homebrew) + * `brew install qt` +* install the python sip module + * `pip install sip # this will fail to fully install sip, keep going` + * `cd build/sip` + * `python configure.py` + * `make && sudo make install` +* install the python pyqt module + * `pip install pyqt # this will fail to fully install pyqt, keep going` + * `cd build/pyqt` + * `python configure.py` + * `make && sudo make install` diff --git a/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js new file mode 100644 index 0000000..8da1c07 --- /dev/null +++ b/sencha/sdk/command/vendor/nodejs/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/env.rhino.1.2.js @@ -0,0 +1,13989 @@ +/* + * Envjs core-env.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +var Envjs = function(){ + var i, + name, + override = function(){ + for(i=0;i and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + + +/** + * @author john resig + */ +// Helper method for extending one object with another. +function __extend__(a,b) { + for ( var i in b ) { + var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i); + if ( g || s ) { + if ( g ) { a.__defineGetter__(i, g); } + if ( s ) { a.__defineSetter__(i, s); } + } else { + a[i] = b[i]; + } + } return a; +} + +/** + * Writes message to system out + * @param {String} message + */ +Envjs.log = function(message){}; + +/** + * Constants providing enumerated levels for logging in modules + */ +Envjs.DEBUG = 1; +Envjs.INFO = 2; +Envjs.WARN = 3; +Envjs.ERROR = 3; +Envjs.NONE = 3; + +/** + * Writes error info out to console + * @param {Error} e + */ +Envjs.lineSource = function(e){}; + + +/** + * TODO: used in ./event/eventtarget.js + * @param {Object} event + */ +Envjs.defaultEventBehaviors = {}; + + +/** + * describes which script src values will trigger Envjs to load + * the script like a browser would + */ +Envjs.scriptTypes = { + "text/javascript" :false, + "text/envjs" :true +}; + +/** + * will be called when loading a script throws an error + * @param {Object} script + * @param {Object} e + */ +Envjs.onScriptLoadError = function(script, e){ + console.log('error loading script %s %s', script, e); +}; + + +/** + * load and execute script tag text content + * @param {Object} script + */ +Envjs.loadInlineScript = function(script){ + var tmpFile; + tmpFile = Envjs.writeToTempFile(script.text, 'js') ; + load(tmpFile); +}; + +/** + * Should evaluate script in some context + * @param {Object} context + * @param {Object} source + * @param {Object} name + */ +Envjs.eval = function(context, source, name){}; + + +/** + * Executes a script tag + * @param {Object} script + * @param {Object} parser + */ +Envjs.loadLocalScript = function(script){ + //console.log("loading script %s", script); + var types, + src, + i, + base, + filename, + xhr; + + if(script.type){ + types = script.type.split(";"); + for(i=0;i + * - Via an innerHTML parse of a + * - A modificiation of the 'src' attribute of an Image/HTMLImageElement + * + * NOTE: this is optional API. If this doesn't exist then the default + * 'loaded' event occurs. + * + * @param node {Object} the node + * @param node the src value + * @return 'true' to indicate the 'load' succeed, false otherwise + */ +Envjs.loadImage = function(node, src) { + return true; +}; + + +/** + * A 'link' was requested by the document. Typically this occurs when: + * - During inital parse of a + * - Via an innerHTML parse of a + * - A modificiation of the 'href' attribute on a node in the tree + * + * @param node {Object} is the link node in question + * @param href {String} is the href. + * + * Return 'true' to indicate that the 'load' was successful, or false + * otherwise. The appropriate event is then triggered. + * + * NOTE: this is optional API. If this doesn't exist then the default + * 'loaded' event occurs + */ +Envjs.loadLink = function(node, href) { + return true; +}; + +(function(){ + + +/* + * cookie handling + * Private internal helper class used to save/retreive cookies + */ + +/** + * Specifies the location of the cookie file + */ +Envjs.cookieFile = function(){ + return 'file://'+Envjs.homedir+'/.cookies'; +}; + +/** + * saves cookies to a local file + * @param {Object} htmldoc + */ +Envjs.saveCookies = function(){ + var cookiejson = JSON.stringify(Envjs.cookies.peristent,null,'\t'); + //console.log('persisting cookies %s', cookiejson); + Envjs.writeToFile(cookiejson, Envjs.cookieFile()); +}; + +/** + * loads cookies from a local file + * @param {Object} htmldoc + */ +Envjs.loadCookies = function(){ + var cookiejson, + js; + try{ + cookiejson = Envjs.readFromFile(Envjs.cookieFile()) + js = JSON.parse(cookiejson, null, '\t'); + }catch(e){ + //console.log('failed to load cookies %s', e); + js = {}; + } + return js; +}; + +Envjs.cookies = { + persistent:{ + //domain - key on domain name { + //path - key on path { + //name - key on name { + //value : cookie value + //other cookie properties + //} + //} + //} + //expire - provides a timestamp for expiring the cookie + //cookie - the cookie! + }, + temporary:{//transient is a reserved word :( + //like above + } +}; + +var __cookies__; + +//HTMLDocument cookie +Envjs.setCookie = function(url, cookie){ + var i, + index, + name, + value, + properties = {}, + attr, + attrs; + url = Envjs.urlsplit(url); + if(cookie) + attrs = cookie.split(";"); + else + return; + + //for now the strategy is to simply create a json object + //and post it to a file in the .cookies.js file. I hate parsing + //dates so I decided not to implement support for 'expires' + //(which is deprecated) and instead focus on the easier 'max-age' + //(which succeeds 'expires') + cookie = {};//keyword properties of the cookie + cookie['domain'] = url.hostname; + cookie['path'] = url.path||'/'; + for(i=0;i -1){ + name = __trim__(attrs[i].slice(0,index)); + value = __trim__(attrs[i].slice(index+1)); + if(name=='max-age'){ + //we'll have to when to check these + //and garbage collect expired cookies + cookie[name] = parseInt(value, 10); + } else if( name == 'domain' ){ + if(__domainValid__(url, value)){ + cookie['domain'] = value; + } + } else if( name == 'path' ){ + //not sure of any special logic for path + cookie['path'] = value; + } else { + //its not a cookie keyword so store it in our array of properties + //and we'll serialize individually in a moment + properties[name] = value; + } + }else{ + if( attrs[i] == 'secure' ){ + cookie[attrs[i]] = true; + } + } + } + if(!('max-age' in cookie)){ + //it's a transient cookie so it only lasts as long as + //the window.location remains the same (ie in-memory cookie) + __mergeCookie__(Envjs.cookies.temporary, cookie, properties); + }else{ + //the cookie is persistent + __mergeCookie__(Envjs.cookies.persistent, cookie, properties); + Envjs.saveCookies(); + } +}; + +function __domainValid__(url, value){ + var i, + domainParts = url.hostname.split('.').reverse(), + newDomainParts = value.split('.').reverse(); + if(newDomainParts.length > 1){ + for(i=0;i -1) { + for (name in cookies[domain][path]) { + // console.log('cookie domain path name %s', name); + cookieString += + ((i++ > 0)?'; ':'') + + name + "=" + + cookies[domain][path][name].value; + } + } + } + } + } + return cookieString; +}; + +function __mergeCookie__(target, cookie, properties){ + var name, now; + if(!target[cookie.domain]){ + target[cookie.domain] = {}; + } + if(!target[cookie.domain][cookie.path]){ + target[cookie.domain][cookie.path] = {}; + } + for(name in properties){ + now = new Date().getTime(); + target[cookie.domain][cookie.path][name] = { + "value":properties[name], + "secure":cookie.secure, + "max-age":cookie['max-age'], + "date-created":now, + "expiration":(cookie['max-age']===0) ? + 0 : + now + cookie['max-age'] + }; + //console.log('cookie is %o',target[cookie.domain][cookie.path][name]); + } +}; + +})();//end cookies +/* + http://www.JSON.org/json2.js + 2008-07-15 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. +*/ +try{ JSON; }catch(e){ +JSON = function () { + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + Date.prototype.toJSON = function (key) { + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + String.prototype.toJSON = function (key) { + return String(this); + }; + Number.prototype.toJSON = + Boolean.prototype.toJSON = function (key) { + return this.valueOf(); + }; + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapeable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + + escapeable.lastIndex = 0; + return escapeable.test(string) ? + '"' + string.replace(escapeable, function (a) { + var c = meta[a]; + if (typeof c === 'string') { + return c; + } + return '\\u' + ('0000' + + (+(a.charCodeAt(0))).toString(16)).slice(-4); + }) + '"' : + '"' + string + '"'; + } + + + function str(key, holder) { + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + + return String(value); + + case 'object': + + if (!value) { + return 'null'; + } + gap += indent; + partial = []; + + if (typeof value.length === 'number' && + !(value.propertyIsEnumerable('length'))) { + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + v = partial.length === 0 ? '[]' : + gap ? '[\n' + gap + + partial.join(',\n' + gap) + '\n' + + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + v = partial.length === 0 ? '{}' : + gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + + mind + '}' : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + + return { + stringify: function (value, replacer, space) { + + var i; + gap = ''; + indent = ''; + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + + } else if (typeof space === 'string') { + indent = space; + } + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + return str('', {'': value}); + }, + + + parse: function (text, reviver) { + var j; + function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + ('0000' + + (+(a.charCodeAt(0))).toString(16)).slice(-4); + }); + } + + + if (/^[\],:{}\s]*$/. +test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). +replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). +replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + + j = eval('(' + text + ')'); + + return typeof reviver === 'function' ? + walk({'': j}, '') : j; + } + + throw new SyntaxError('JSON.parse'); + } + }; +}(); + +} + +/** + * synchronizes thread modifications + * @param {Function} fn + */ +Envjs.sync = function(fn){}; + +/** + * sleep thread for specified duration + * @param {Object} millseconds + */ +Envjs.sleep = function(millseconds){}; + +/** + * Interval to wait on event loop when nothing is happening + */ +Envjs.WAIT_INTERVAL = 20;//milliseconds + +/* + * Copyright (c) 2010 Nick Galbreath + * http://code.google.com/p/stringencoders/source/browse/#svn/trunk/javascript + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * url processing in the spirit of python's urlparse module + * see `pydoc urlparse` or + * http://docs.python.org/library/urlparse.html + * + * urlsplit: break apart a URL into components + * urlunsplit: reconsistute a URL from componets + * urljoin: join an absolute and another URL + * urldefrag: remove the fragment from a URL + * + * Take a look at the tests in urlparse-test.html + * + * On URL Normalization: + * + * urlsplit only does minor normalization the components Only scheme + * and hostname are lowercased urljoin does a bit more, normalizing + * paths with "." and "..". + + * urlnormalize adds additional normalization + * + * * removes default port numbers + * http://abc.com:80/ -> http://abc.com/, etc + * * normalizes path + * http://abc.com -> http://abc.com/ + * and other "." and ".." cleanups + * * if file, remove query and fragment + * + * It does not do: + * * normalizes escaped hex values + * http://abc.com/%7efoo -> http://abc.com/%7Efoo + * * normalize '+' <--> '%20' + * + * Differences with Python + * + * The javascript urlsplit returns a normal object with the following + * properties: scheme, netloc, hostname, port, path, query, fragment. + * All properties are read-write. + * + * In python, the resulting object is not a dict, but a specialized, + * read-only, and has alternative tuple interface (e.g. obj[0] == + * obj.scheme). It's not clear why such a simple function requires + * a unique datastructure. + * + * urlunsplit in javascript takes an duck-typed object, + * { scheme: 'http', netloc: 'abc.com', ...} + * while in * python it takes a list-like object. + * ['http', 'abc.com'... ] + * + * For all functions, the javascript version use + * hostname+port if netloc is missing. In python + * hostname+port were always ignored. + * + * Similar functionality in different languages: + * + * http://php.net/manual/en/function.parse-url.php + * returns assocative array but cannot handle relative URL + * + * TODO: test allowfragments more + * TODO: test netloc missing, but hostname present + */ + +var urlparse = {}; + +// Unlike to be useful standalone +// +// NORMALIZE PATH with "../" and "./" +// http://en.wikipedia.org/wiki/URL_normalization +// http://tools.ietf.org/html/rfc3986#section-5.2.3 +// +urlparse.normalizepath = function(path) +{ + if (!path || path === '/') { + return '/'; + } + + var parts = path.split('/'); + + var newparts = []; + // make sure path always starts with '/' + if (parts[0]) { + newparts.push(''); + } + + for (var i = 0; i < parts.length; ++i) { + if (parts[i] === '..') { + if (newparts.length > 1) { + newparts.pop(); + } else { + newparts.push(parts[i]); + } + } else if (parts[i] != '.') { + newparts.push(parts[i]); + } + } + + path = newparts.join('/'); + if (!path) { + path = '/'; + } + return path; +}; + +// +// Does many of the normalizations that the stock +// python urlsplit/urlunsplit/urljoin neglects +// +// Doesn't do hex-escape normalization on path or query +// %7e -> %7E +// Nor, '+' <--> %20 translation +// +urlparse.urlnormalize = function(url) +{ + var parts = urlparse.urlsplit(url); + switch (parts.scheme) { + case 'file': + // files can't have query strings + // and we don't bother with fragments + parts.query = ''; + parts.fragment = ''; + break; + case 'http': + case 'https': + // remove default port + if ((parts.scheme === 'http' && parts.port == 80) || + (parts.scheme === 'https' && parts.port == 443)) { + parts.port = null; + // hostname is already lower case + parts.netloc = parts.hostname; + } + break; + default: + // if we don't have specific normalizations for this + // scheme, return the original url unmolested + return url; + } + + // for [file|http|https]. Not sure about other schemes + parts.path = urlparse.normalizepath(parts.path); + + return urlparse.urlunsplit(parts); +}; + +urlparse.urldefrag = function(url) +{ + var idx = url.indexOf('#'); + if (idx == -1) { + return [ url, '' ]; + } else { + return [ url.substr(0,idx), url.substr(idx+1) ]; + } +}; + +urlparse.urlsplit = function(url, default_scheme, allow_fragments) +{ + var leftover; + + if (typeof allow_fragments === 'undefined') { + allow_fragments = true; + } + + // scheme (optional), host, port + var fullurl = /^([A-Za-z]+)?(:?\/\/)([0-9.\-A-Za-z]*)(?::(\d+))?(.*)$/; + // path, query, fragment + var parse_leftovers = /([^?#]*)?(?:\?([^#]*))?(?:#(.*))?$/; + + var o = {}; + + var parts = url.match(fullurl); + if (parts) { + o.scheme = parts[1] || default_scheme || ''; + o.hostname = parts[3].toLowerCase() || ''; + o.port = parseInt(parts[4],10) || ''; + // Probably should grab the netloc from regexp + // and then parse again for hostname/port + + o.netloc = parts[3]; + if (parts[4]) { + o.netloc += ':' + parts[4]; + } + + leftover = parts[5]; + } else { + o.scheme = default_scheme || ''; + o.netloc = ''; + o.hostname = ''; + leftover = url; + } + o.scheme = o.scheme.toLowerCase(); + + parts = leftover.match(parse_leftovers); + + o.path = parts[1] || ''; + o.query = parts[2] || ''; + + if (allow_fragments) { + o.fragment = parts[3] || ''; + } else { + o.fragment = ''; + } + + return o; +}; + +urlparse.urlunsplit = function(o) { + var s = ''; + if (o.scheme) { + s += o.scheme + '://'; + } + + if (o.netloc) { + if (s == '') { + s += '//'; + } + s += o.netloc; + } else if (o.hostname) { + // extension. Python only uses netloc + if (s == '') { + s += '//'; + } + s += o.hostname; + if (o.port) { + s += ':' + o.port; + } + } + + if (o.path) { + s += o.path; + } + + if (o.query) { + s += '?' + o.query; + } + if (o.fragment) { + s += '#' + o.fragment; + } + return s; +}; + +urlparse.urljoin = function(base, url, allow_fragments) +{ + if (typeof allow_fragments === 'undefined') { + allow_fragments = true; + } + + var url_parts = urlparse.urlsplit(url); + + // if url parts has a scheme (i.e. absolute) + // then nothing to do + if (url_parts.scheme) { + if (! allow_fragments) { + return url; + } else { + return urlparse.urldefrag(url)[0]; + } + } + var base_parts = urlparse.urlsplit(base); + + // copy base, only if not present + if (!base_parts.scheme) { + base_parts.scheme = url_parts.scheme; + } + + // copy netloc, only if not present + if (!base_parts.netloc || !base_parts.hostname) { + base_parts.netloc = url_parts.netloc; + base_parts.hostname = url_parts.hostname; + base_parts.port = url_parts.port; + } + + // paths + if (url_parts.path.length > 0) { + if (url_parts.path.charAt(0) == '/') { + base_parts.path = url_parts.path; + } else { + // relative path.. get rid of "current filename" and + // replace. Same as var parts = + // base_parts.path.split('/'); parts[parts.length-1] = + // url_parts.path; base_parts.path = parts.join('/'); + var idx = base_parts.path.lastIndexOf('/'); + if (idx == -1) { + base_parts.path = url_parts.path; + } else { + base_parts.path = base_parts.path.substr(0,idx) + '/' + + url_parts.path; + } + } + } + + // clean up path + base_parts.path = urlparse.normalizepath(base_parts.path); + + // copy query string + base_parts.query = url_parts.query; + + // copy fragments + if (allow_fragments) { + base_parts.fragment = url_parts.fragment; + } else { + base_parts.fragment = ''; + } + + return urlparse.urlunsplit(base_parts); +}; + +/** + * getcwd - named after posix call of same name (see 'man 2 getcwd') + * + */ +Envjs.getcwd = function() { + return '.'; +}; + +/** + * resolves location relative to doc location + * + * @param {Object} path Relative or absolute URL + * @param {Object} base (semi-optional) The base url used in resolving "path" above + */ +Envjs.uri = function(path, base) { + //console.log('constructing uri from path %s and base %s', path, base); + + // Semi-common trick is to make an iframe with src='javascript:false' + // (or some equivalent). By returning '', the load is skipped + if (path.indexOf('javascript') === 0) { + return ''; + } + + // if path is absolute, then just normalize and return + if (path.match('^[a-zA-Z]+://')) { + return urlparse.urlnormalize(path); + } + + // interesting special case, a few very large websites use + // '//foo/bar/' to mean 'http://foo/bar' + if (path.match('^//')) { + path = 'http:' + path; + } + + // if base not passed in, try to get it from document + // Ideally I would like the caller to pass in document.baseURI to + // make this more self-sufficient and testable + if (!base && document) { + base = document.baseURI; + } + + // about:blank doesn't count + if (base === 'about:blank'){ + base = ''; + } + + // if base is still empty, then we are in QA mode loading local + // files. Get current working directory + if (!base) { + base = 'file://' + Envjs.getcwd() + '/'; + } + // handles all cases if path is abosulte or relative to base + // 3rd arg is "false" --> remove fragments + var newurl = urlparse.urlnormalize(urlparse.urljoin(base, path, false)); + + return newurl; +}; + + + +/** + * Used in the XMLHttpRquest implementation to run a + * request in a seperate thread + * @param {Object} fn + */ +Envjs.runAsync = function(fn){}; + + +/** + * Used to write to a local file + * @param {Object} text + * @param {Object} url + */ +Envjs.writeToFile = function(text, url){}; + + +/** + * Used to write to a local file + * @param {Object} text + * @param {Object} suffix + */ +Envjs.writeToTempFile = function(text, suffix){}; + +/** + * Used to read the contents of a local file + * @param {Object} url + */ +Envjs.readFromFile = function(url){}; + +/** + * Used to delete a local file + * @param {Object} url + */ +Envjs.deleteFile = function(url){}; + +/** + * establishes connection and calls responsehandler + * @param {Object} xhr + * @param {Object} responseHandler + * @param {Object} data + */ +Envjs.connection = function(xhr, responseHandler, data){}; + + +__extend__(Envjs, urlparse); + +/** + * Makes an object window-like by proxying object accessors + * @param {Object} scope + * @param {Object} parent + */ +Envjs.proxy = function(scope, parent, aliasList){}; + +Envjs.javaEnabled = false; + +Envjs.homedir = ''; +Envjs.tmpdir = ''; +Envjs.os_name = ''; +Envjs.os_arch = ''; +Envjs.os_version = ''; +Envjs.lang = ''; +Envjs.platform = ''; + +/** + * + * @param {Object} frameElement + * @param {Object} url + */ +Envjs.loadFrame = function(frame, url){ + try { + if(frame.contentWindow){ + //mark for garbage collection + frame.contentWindow = null; + } + + //create a new scope for the window proxy + //platforms will need to override this function + //to make sure the scope is global-like + frame.contentWindow = (function(){return this;})(); + new Window(frame.contentWindow, window); + + //I dont think frames load asynchronously in firefox + //and I think the tests have verified this but for + //some reason I'm less than confident... Are there cases? + frame.contentDocument = frame.contentWindow.document; + frame.contentDocument.async = false; + if(url){ + //console.log('envjs.loadFrame async %s', frame.contentDocument.async); + frame.contentWindow.location = url; + } + } catch(e) { + console.log("failed to load frame content: from %s %s", url, e); + } +}; + + +// The following are in rhino/window.js +// TODO: Envjs.unloadFrame +// TODO: Envjs.proxy + +/** + * @author john resig & the envjs team + * @uri http://www.envjs.com/ + * @copyright 2008-2010 + * @license MIT + */ +//CLOSURE_END +}()); +/* + * Envjs rhino-env.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +var __context__ = Packages.org.mozilla.javascript.Context.getCurrentContext(); + +Envjs.platform = "Rhino"; +Envjs.revision = "1.7.0.rc2"; + +/* + * Envjs rhino-env.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + + +/** + * @author john resig + */ +// Helper method for extending one object with another. +function __extend__(a,b) { + for ( var i in b ) { + var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i); + if ( g || s ) { + if ( g ) { a.__defineGetter__(i, g); } + if ( s ) { a.__defineSetter__(i, s); } + } else { + a[i] = b[i]; + } + } return a; +} + +/** + * Writes message to system out. + * + * Some sites redefine 'print' as in 'window.print', so instead of + * printing to stdout, you are popping open a new window, which might + * call print, etc, etc,etc This can cause infinite loops and can + * exhausing all memory. + * + * By defining this upfront now, Envjs.log will always call the native 'print' + * function + * + * @param {Object} message + */ +Envjs.log = print; + +Envjs.lineSource = function(e){ + return e&&e.rhinoException?e.rhinoException.lineSource():"(line ?)"; +}; +/** + * load and execute script tag text content + * @param {Object} script + */ +Envjs.loadInlineScript = function(script){ + if(script.ownerDocument.ownerWindow){ + Envjs.eval( + script.ownerDocument.ownerWindow, + script.text, + 'eval('+script.text.substring(0,16)+'...):'+new Date().getTime() + ); + }else{ + Envjs.eval( + __this__, + script.text, + 'eval('+script.text.substring(0,16)+'...):'+new Date().getTime() + ); + } + //console.log('evaluated at scope %s \n%s', + // script.ownerDocument.ownerWindow.guid, script.text); +}; + + +Envjs.eval = function(context, source, name){ + __context__.evaluateString( + context, + source, + name, + 0, + null + ); +}; + +//Temporary patch for parser module +Packages.org.mozilla.javascript.Context. + getCurrentContext().setOptimizationLevel(-1); + +/** + * Rhino provides a very succinct 'sync' + * @param {Function} fn + */ +try{ + Envjs.sync = sync; + Envjs.spawn = spawn; +} catch(e){ + //sync unavailable on AppEngine + Envjs.sync = function(fn){ + //console.log('Threadless platform, sync is safe'); + return fn; + }; + + Envjs.spawn = function(fn){ + //console.log('Threadless platform, spawn shares main thread.'); + return fn(); + }; +} + +/** + * sleep thread for specified duration + * @param {Object} millseconds + */ +Envjs.sleep = function(millseconds){ + try{ + java.lang.Thread.currentThread().sleep(millseconds); + }catch(e){ + console.log('Threadless platform, cannot sleep.'); + } +}; + +/** + * provides callback hook for when the system exits + */ +Envjs.onExit = function(callback){ + var rhino = Packages.org.mozilla.javascript, + contextFactory = __context__.getFactory(), + listener = new rhino.ContextFactory.Listener({ + contextReleased: function(context){ + if(context === __context__) + console.log('context released', context); + contextFactory.removeListener(this); + if(callback) + callback(); + } + }); + contextFactory.addListener(listener); +}; + +/** + * Get 'Current Working Directory' + */ +Envjs.getcwd = function() { + return java.lang.System.getProperty('user.dir'); +} + +/** + * + * @param {Object} fn + * @param {Object} onInterupt + */ +Envjs.runAsync = function(fn, onInterupt){ + ////Envjs.debug("running async"); + var running = true, + run; + + try{ + run = Envjs.sync(function(){ + fn(); + Envjs.wait(); + }); + Envjs.spawn(run); + }catch(e){ + console.log("error while running async operation", e); + try{if(onInterrupt)onInterrupt(e)}catch(ee){}; + } +}; + +/** + * Used to write to a local file + * @param {Object} text + * @param {Object} url + */ +Envjs.writeToFile = function(text, url){ + //Envjs.debug("writing text to url : " + url); + var out = new java.io.FileWriter( + new java.io.File( + new java.net.URI(url.toString()))); + out.write( text, 0, text.length ); + out.flush(); + out.close(); +}; + +/** + * Used to write to a local file + * @param {Object} text + * @param {Object} suffix + */ +Envjs.writeToTempFile = function(text, suffix){ + //Envjs.debug("writing text to temp url : " + suffix); + // Create temp file. + var temp = java.io.File.createTempFile("envjs-tmp", suffix); + + // Delete temp file when program exits. + temp.deleteOnExit(); + + // Write to temp file + var out = new java.io.FileWriter(temp); + out.write(text, 0, text.length); + out.close(); + return temp.getAbsolutePath().toString()+''; +}; + + +/** + * Used to read the contents of a local file + * @param {Object} url + */ +Envjs.readFromFile = function( url ){ + var fileReader = new java.io.FileReader( + new java.io.File( + new java.net.URI( url ))); + + var stringwriter = new java.io.StringWriter(), + buffer = java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, 1024), + length; + + while ((length = fileReader.read(buffer, 0, 1024)) != -1) { + stringwriter.write(buffer, 0, length); + } + + stringwriter.close(); + return stringwriter.toString()+""; +}; + + +/** + * Used to delete a local file + * @param {Object} url + */ +Envjs.deleteFile = function(url){ + var file = new java.io.File( new java.net.URI( url ) ); + file["delete"](); +}; + +/** + * establishes connection and calls responsehandler + * @param {Object} xhr + * @param {Object} responseHandler + * @param {Object} data + */ +Envjs.connection = function(xhr, responseHandler, data){ + var url = java.net.URL(xhr.url), + connection, + header, + outstream, + buffer, + length, + binary = false, + name, value, + contentEncoding, + instream, + responseXML, + i; + if ( /^file\:/.test(url) ) { + try{ + if ( "PUT" == xhr.method || "POST" == xhr.method ) { + data = data || "" ; + Envjs.writeToFile(data, url); + xhr.readyState = 4; + //could be improved, I just cant recall the correct http codes + xhr.status = 200; + xhr.statusText = ""; + } else if ( xhr.method == "DELETE" ) { + Envjs.deleteFile(url); + xhr.readyState = 4; + //could be improved, I just cant recall the correct http codes + xhr.status = 200; + xhr.statusText = ""; + } else { + connection = url.openConnection(); + connection.connect(); + //try to add some canned headers that make sense + + try{ + if(xhr.url.match(/html$/)){ + xhr.responseHeaders["Content-Type"] = 'text/html'; + }else if(xhr.url.match(/.xml$/)){ + xhr.responseHeaders["Content-Type"] = 'text/xml'; + }else if(xhr.url.match(/.js$/)){ + xhr.responseHeaders["Content-Type"] = 'text/javascript'; + }else if(xhr.url.match(/.json$/)){ + xhr.responseHeaders["Content-Type"] = 'application/json'; + }else{ + xhr.responseHeaders["Content-Type"] = 'text/plain'; + } + //xhr.responseHeaders['Last-Modified'] = connection.getLastModified(); + //xhr.responseHeaders['Content-Length'] = headerValue+''; + //xhr.responseHeaders['Date'] = new Date()+'';*/ + }catch(e){ + console.log('failed to load response headers',e); + } + } + }catch(e){ + console.log('failed to open file %s %s', url, e); + connection = null; + xhr.readyState = 4; + xhr.statusText = "Local File Protocol Error"; + xhr.responseText = "

"+ e+ "

"; + } + } else { + connection = url.openConnection(); + connection.setRequestMethod( xhr.method ); + + // Add headers to Java connection + for (header in xhr.headers){ + connection.addRequestProperty(header+'', xhr.headers[header]+''); + } + + //write data to output stream if required + if(data){ + if(data instanceof Document){ + if ( xhr.method == "PUT" || xhr.method == "POST" ) { + connection.setDoOutput(true); + outstream = connection.getOutputStream(), + xml = (new XMLSerializer()).serializeToString(data); + buffer = new java.lang.String(xml).getBytes('UTF-8'); + outstream.write(buffer, 0, buffer.length); + outstream.close(); + } + }else if(data.length&&data.length>0){ + if ( xhr.method == "PUT" || xhr.method == "POST" ) { + connection.setDoOutput(true); + outstream = connection.getOutputStream(); + buffer = new java.lang.String(data).getBytes('UTF-8'); + outstream.write(buffer, 0, buffer.length); + outstream.close(); + } + } + connection.connect(); + }else{ + connection.connect(); + } + } + + if(connection){ + try{ + length = connection.getHeaderFields().size(); + // Stick the response headers into responseHeaders + for (i = 0; i < length; i++) { + name = connection.getHeaderFieldKey(i); + value = connection.getHeaderField(i); + if (name) + xhr.responseHeaders[name+''] = value+''; + } + }catch(e){ + console.log('failed to load response headers \n%s',e); + } + + xhr.readyState = 4; + xhr.status = parseInt(connection.responseCode,10) || undefined; + xhr.statusText = connection.responseMessage || ""; + + contentEncoding = connection.getContentEncoding() || "utf-8"; + instream = null; + responseXML = null; + + try{ + //console.log('contentEncoding %s', contentEncoding); + if( contentEncoding.equalsIgnoreCase("gzip") || + contentEncoding.equalsIgnoreCase("decompress")){ + //zipped content + binary = true; + outstream = new java.io.ByteArrayOutputStream(); + buffer = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024); + instream = new java.util.zip.GZIPInputStream(connection.getInputStream()) + }else{ + //this is a text file + outstream = new java.io.StringWriter(); + buffer = java.lang.reflect.Array.newInstance(java.lang.Character.TYPE, 1024); + instream = new java.io.InputStreamReader(connection.getInputStream()); + } + }catch(e){ + if (connection.getResponseCode() == 404){ + console.log('failed to open connection stream \n %s %s', + e.toString(), e); + }else{ + console.log('failed to open connection stream \n %s %s', + e.toString(), e); + } + instream = connection.getErrorStream(); + } + + while ((length = instream.read(buffer, 0, 1024)) != -1) { + outstream.write(buffer, 0, length); + } + + outstream.close(); + instream.close(); + + if(binary){ + xhr.responseText = new String(outstream.toByteArray(), 'UTF-8') + ''; + }else{ + xhr.responseText = outstream.toString() + ''; + } + + } + if(responseHandler){ + //Envjs.debug('calling ajax response handler'); + responseHandler(); + } +}; + +//Since we're running in rhino I guess we can safely assume +//java is 'enabled'. I'm sure this requires more thought +//than I've given it here +Envjs.javaEnabled = true; + +Envjs.homedir = java.lang.System.getProperty("user.home"); +Envjs.tmpdir = java.lang.System.getProperty("java.io.tmpdir"); +Envjs.os_name = java.lang.System.getProperty("os.name"); +Envjs.os_arch = java.lang.System.getProperty("os.arch"); +Envjs.os_version = java.lang.System.getProperty("os.version"); +Envjs.lang = java.lang.System.getProperty("user.lang"); + + +/** + * + * @param {Object} frameElement + * @param {Object} url + */ +Envjs.loadFrame = function(frame, url){ + try { + if(frame.contentWindow){ + //mark for garbage collection + frame.contentWindow = null; + } + + //create a new scope for the window proxy + frame.contentWindow = Envjs.proxy(); + new Window(frame.contentWindow, window); + + //I dont think frames load asynchronously in firefox + //and I think the tests have verified this but for + //some reason I'm less than confident... Are there cases? + frame.contentDocument = frame.contentWindow.document; + frame.contentDocument.async = false; + if(url){ + //console.log('envjs.loadFrame async %s', frame.contentDocument.async); + frame.contentWindow.location = url; + } + } catch(e) { + console.log("failed to load frame content: from %s %s", url, e); + } +}; + +/** + * unloadFrame + * @param {Object} frame + */ +Envjs.unloadFrame = function(frame){ + var all, length, i; + try{ + //TODO: probably self-referencing structures within a document tree + //preventing it from being entirely garbage collected once orphaned. + //Should have code to walk tree and break all links between contained + //objects. + frame.contentDocument = null; + if(frame.contentWindow){ + frame.contentWindow.close(); + } + gc(); + }catch(e){ + console.log(e); + } +}; + +/** + * Makes an object window-like by proxying object accessors + * @param {Object} scope + * @param {Object} parent + */ +Envjs.proxy = function(scope, parent) { + try{ + if(scope+'' == '[object global]'){ + return scope + }else{ + return __context__.initStandardObjects(); + } + }catch(e){ + console.log('failed to init standard objects %s %s \n%s', scope, parent, e); + } + +}; + +/** + * @author john resig & the envjs team + * @uri http://www.envjs.com/ + * @copyright 2008-2010 + * @license MIT + */ +//CLOSURE_END +}()); + +/** + * @author envjs team + */ +var Console, + console; + +/* + * Envjs console.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + + +/** + * @author envjs team + * borrowed 99%-ish with love from firebug-lite + * + * http://wiki.commonjs.org/wiki/Console + */ +Console = function(module){ + var $level, + $logger, + $null = function(){}; + + + if(Envjs[module] && Envjs[module].loglevel){ + $level = Envjs.module.loglevel; + $logger = { + log: function(level){ + logFormatted(arguments, (module)+" "); + }, + debug: $level>1 ? $null: function() { + logFormatted(arguments, (module)+" debug"); + }, + info: $level>2 ? $null:function(){ + logFormatted(arguments, (module)+" info"); + }, + warn: $level>3 ? $null:function(){ + logFormatted(arguments, (module)+" warning"); + }, + error: $level>4 ? $null:function(){ + logFormatted(arguments, (module)+" error"); + } + }; + } else { + $logger = { + log: function(level){ + logFormatted(arguments, ""); + }, + debug: $null, + info: $null, + warn: $null, + error: $null + }; + } + + return $logger; +}; + +console = new Console("console",1); + +function logFormatted(objects, className) +{ + var html = []; + + var format = objects[0]; + var objIndex = 0; + + if (typeof(format) != "string") + { + format = ""; + objIndex = -1; + } + + var parts = parseFormat(format); + for (var i = 0; i < parts.length; ++i) + { + var part = parts[i]; + if (part && typeof(part) == "object") + { + var object = objects[++objIndex]; + part.appender(object, html); + } + else { + appendText(part, html); + } + } + + for (var i = objIndex+1; i < objects.length; ++i) + { + appendText(" ", html); + + var object = objects[i]; + if (typeof(object) == "string") { + appendText(object, html); + } else { + appendObject(object, html); + } + } + + Envjs.log(html.join(' ')); +} + +function parseFormat(format) +{ + var parts = []; + + var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/; + var appenderMap = {s: appendText, d: appendInteger, i: appendInteger, f: appendFloat}; + + for (var m = reg.exec(format); m; m = reg.exec(format)) + { + var type = m[8] ? m[8] : m[5]; + var appender = type in appenderMap ? appenderMap[type] : appendObject; + var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0); + + parts.push(format.substr(0, m[0][0] == "%" ? m.index : m.index+1)); + parts.push({appender: appender, precision: precision}); + + format = format.substr(m.index+m[0].length); + } + + parts.push(format); + + return parts; +} + +function escapeHTML(value) +{ + return value; +} + +function objectToString(object) +{ + try + { + return object+""; + } + catch (exc) + { + return null; + } +} + +// ******************************************************************************************** + +function appendText(object, html) +{ + html.push(escapeHTML(objectToString(object))); +} + +function appendNull(object, html) +{ + html.push(escapeHTML(objectToString(object))); +} + +function appendString(object, html) +{ + html.push(escapeHTML(objectToString(object))); +} + +function appendInteger(object, html) +{ + html.push(escapeHTML(objectToString(object))); +} + +function appendFloat(object, html) +{ + html.push(escapeHTML(objectToString(object))); +} + +function appendFunction(object, html) +{ + var reName = /function ?(.*?)\(/; + var m = reName.exec(objectToString(object)); + var name = m ? m[1] : "function"; + html.push(escapeHTML(name)); +} + +function appendObject(object, html) +{ + try + { + if (object == undefined) { + appendNull("undefined", html); + } else if (object == null) { + appendNull("null", html); + } else if (typeof object == "string") { + appendString(object, html); + } else if (typeof object == "number") { + appendInteger(object, html); + } else if (typeof object == "function") { + appendFunction(object, html); + } else if (object.nodeType == 1) { + appendSelector(object, html); + } else if (typeof object == "object") { + appendObjectFormatted(object, html); + } else { + appendText(object, html); + } + } + catch (exc) + { + } +} + +function appendObjectFormatted(object, html) +{ + var text = objectToString(object); + var reObject = /\[object (.*?)\]/; + + var m = reObject.exec(text); + html.push( m ? m[1] : text); +} + +function appendSelector(object, html) +{ + + html.push(escapeHTML(object.nodeName.toLowerCase())); + if (object.id) { + html.push(escapeHTML(object.id)); + } + if (object.className) { + html.push(escapeHTML(object.className)); + } +} + +function appendNode(node, html) +{ + if (node.nodeType == 1) + { + html.push( node.nodeName.toLowerCase()); + + for (var i = 0; i < node.attributes.length; ++i) + { + var attr = node.attributes[i]; + if (!attr.specified) { + continue; + } + + html.push( attr.nodeName.toLowerCase(),escapeHTML(attr.nodeValue)); + } + + if (node.firstChild) + { + for (var child = node.firstChild; child; child = child.nextSibling) { + appendNode(child, html); + } + + html.push( node.nodeName.toLowerCase()); + } + } + else if (node.nodeType === 3) + { + html.push(escapeHTML(node.nodeValue)); + } +}; + +/** + * @author john resig & the envjs team + * @uri http://www.envjs.com/ + * @copyright 2008-2010 + * @license MIT + */ +//CLOSURE_END +}()); +/* + * Envjs dom.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + * + * Parts of the implementation were originally written by:\ + * and Jon van Noort (jon@webarcana.com.au) \ + * and David Joham (djoham@yahoo.com)",\ + * and Scott Severtson + * + * This file simply provides the global definitions we need to \ + * be able to correctly implement to core browser DOM interfaces." + */ + +var Attr, + CDATASection, + CharacterData, + Comment, + Document, + DocumentFragment, + DocumentType, + DOMException, + DOMImplementation, + Element, + Entity, + EntityReference, + NamedNodeMap, + Namespace, + Node, + NodeList, + Notation, + ProcessingInstruction, + Text, + Range, + XMLSerializer, + DOMParser; + + + +/* + * Envjs dom.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + + +/** + * @author john resig + */ +// Helper method for extending one object with another. +function __extend__(a,b) { + for ( var i in b ) { + var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i); + if ( g || s ) { + if ( g ) { a.__defineGetter__(i, g); } + if ( s ) { a.__defineSetter__(i, s); } + } else { + a[i] = b[i]; + } + } return a; +} + +/** + * @author john resig + */ +//from jQuery +function __setArray__( target, array ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + target.length = 0; + Array.prototype.push.apply( target, array ); +} + +/** + * @class NodeList - + * provides the abstraction of an ordered collection of nodes + * + * @param ownerDocument : Document - the ownerDocument + * @param parentNode : Node - the node that the NodeList is attached to (or null) + */ +NodeList = function(ownerDocument, parentNode) { + this.length = 0; + this.parentNode = parentNode; + this.ownerDocument = ownerDocument; + this._readonly = false; + __setArray__(this, []); +}; + +__extend__(NodeList.prototype, { + item : function(index) { + var ret = null; + if ((index >= 0) && (index < this.length)) { + // bounds check + ret = this[index]; + } + // if the index is out of bounds, default value null is returned + return ret; + }, + get xml() { + var ret = "", + i; + + // create string containing the concatenation of the string values of each child + for (i=0; i < this.length; i++) { + if(this[i]){ + if(this[i].nodeType == Node.TEXT_NODE && i>0 && + this[i-1].nodeType == Node.TEXT_NODE){ + //add a single space between adjacent text nodes + ret += " "+this[i].xml; + }else{ + ret += this[i].xml; + } + } + } + return ret; + }, + toArray: function () { + var children = [], + i; + for ( i=0; i < this.length; i++) { + children.push (this[i]); + } + return children; + }, + toString: function(){ + return "[object NodeList]"; + } +}); + + +/** + * @method __findItemIndex__ + * find the item index of the node + * @author Jon van Noort (jon@webarcana.com.au) + * @param node : Node + * @return : int + */ +var __findItemIndex__ = function (nodelist, node) { + var ret = -1, i; + for (i=0; i= 0) && (refChildIndex <= nodelist.length)) { + // bounds check + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // node is a DocumentFragment + // append the children of DocumentFragment + Array.prototype.splice.apply(nodelist, + [refChildIndex, 0].concat(newChild.childNodes.toArray())); + } + else { + // append the newChild + Array.prototype.splice.apply(nodelist,[refChildIndex, 0, newChild]); + } + } +}; + +/** + * @method __replaceChild__ + * replace the specified Node in the NodeList at the specified index + * Used by Node.replaceChild(). Note: Node.replaceChild() is responsible + * for Node Pointer surgery __replaceChild__ simply modifies the internal + * data structure (Array). + * + * @param newChild : Node - the Node to be inserted + * @param refChildIndex : int - the array index to hold the Node + */ +var __replaceChild__ = function(nodelist, newChild, refChildIndex) { + var ret = null; + + // bounds check + if ((refChildIndex >= 0) && (refChildIndex < nodelist.length)) { + // preserve old child for return + ret = nodelist[refChildIndex]; + + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // node is a DocumentFragment + // get array containing children prior to refChild + Array.prototype.splice.apply(nodelist, + [refChildIndex, 1].concat(newChild.childNodes.toArray())); + } + else { + // simply replace node in array (links between Nodes are + // made at higher level) + nodelist[refChildIndex] = newChild; + } + } + // return replaced node + return ret; +}; + +/** + * @method __removeChild__ + * remove the specified Node in the NodeList at the specified index + * Used by Node.removeChild(). Note: Node.removeChild() is responsible + * for Node Pointer surgery __removeChild__ simply modifies the internal + * data structure (Array). + * @param refChildIndex : int - the array index holding the Node to be removed + */ +var __removeChild__ = function(nodelist, refChildIndex) { + var ret = null; + + if (refChildIndex > -1) { + // found it! + // return removed node + ret = nodelist[refChildIndex]; + + // rebuild array without removed child + Array.prototype.splice.apply(nodelist,[refChildIndex, 1]); + } + // return removed node + return ret; +}; + +/** + * @method __appendChild__ + * append the specified Node to the NodeList. Used by Node.appendChild(). + * Note: Node.appendChild() is responsible for Node Pointer surgery + * __appendChild__ simply modifies the internal data structure (Array). + * @param newChild : Node - the Node to be inserted + */ +var __appendChild__ = function(nodelist, newChild) { + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // node is a DocumentFragment + // append the children of DocumentFragment + Array.prototype.push.apply(nodelist, newChild.childNodes.toArray() ); + } else { + // simply add node to array (links between Nodes are made at higher level) + Array.prototype.push.apply(nodelist, [newChild]); + } + +}; + +/** + * @method __cloneNodes__ - + * Returns a NodeList containing clones of the Nodes in this NodeList + * @param deep : boolean - + * If true, recursively clone the subtree under each of the nodes; + * if false, clone only the nodes themselves (and their attributes, + * if it is an Element). + * @param parentNode : Node - the new parent of the cloned NodeList + * @return : NodeList - NodeList containing clones of the Nodes in this NodeList + */ +var __cloneNodes__ = function(nodelist, deep, parentNode) { + var cloneNodeList = new NodeList(nodelist.ownerDocument, parentNode); + + // create list containing clones of each child + for (var i=0; i < nodelist.length; i++) { + __appendChild__(cloneNodeList, nodelist[i].cloneNode(deep)); + } + + return cloneNodeList; +}; + + +var __ownerDocument__ = function(node){ + return (node.nodeType == Node.DOCUMENT_NODE)?node:node.ownerDocument; +}; + +/** + * @class Node - + * The Node interface is the primary datatype for the entire + * Document Object Model. It represents a single node in the + * document tree. + * @param ownerDocument : Document - The Document object associated with this node. + */ + +Node = function(ownerDocument) { + this.baseURI = 'about:blank'; + this.namespaceURI = null; + this.nodeName = ""; + this.nodeValue = null; + + // A NodeList that contains all children of this node. If there are no + // children, this is a NodeList containing no nodes. The content of the + // returned NodeList is "live" in the sense that, for instance, changes to + // the children of the node object that it was created from are immediately + // reflected in the nodes returned by the NodeList accessors; it is not a + // static snapshot of the content of the node. This is true for every + // NodeList, including the ones returned by the getElementsByTagName method. + this.childNodes = new NodeList(ownerDocument, this); + + // The first child of this node. If there is no such node, this is null + this.firstChild = null; + // The last child of this node. If there is no such node, this is null. + this.lastChild = null; + // The node immediately preceding this node. If there is no such node, + // this is null. + this.previousSibling = null; + // The node immediately following this node. If there is no such node, + // this is null. + this.nextSibling = null; + + this.attributes = null; + // The namespaces in scope for this node + this._namespaces = new NamespaceNodeMap(ownerDocument, this); + this._readonly = false; + + //IMPORTANT: These must come last so rhino will not iterate parent + // properties before child properties. (qunit.equiv issue) + + // The parent of this node. All nodes, except Document, DocumentFragment, + // and Attr may have a parent. However, if a node has just been created + // and not yet added to the tree, or if it has been removed from the tree, + // this is null + this.parentNode = null; + // The Document object associated with this node + this.ownerDocument = ownerDocument; + +}; + +// nodeType constants +Node.ELEMENT_NODE = 1; +Node.ATTRIBUTE_NODE = 2; +Node.TEXT_NODE = 3; +Node.CDATA_SECTION_NODE = 4; +Node.ENTITY_REFERENCE_NODE = 5; +Node.ENTITY_NODE = 6; +Node.PROCESSING_INSTRUCTION_NODE = 7; +Node.COMMENT_NODE = 8; +Node.DOCUMENT_NODE = 9; +Node.DOCUMENT_TYPE_NODE = 10; +Node.DOCUMENT_FRAGMENT_NODE = 11; +Node.NOTATION_NODE = 12; +Node.NAMESPACE_NODE = 13; + +Node.DOCUMENT_POSITION_EQUAL = 0x00; +Node.DOCUMENT_POSITION_DISCONNECTED = 0x01; +Node.DOCUMENT_POSITION_PRECEDING = 0x02; +Node.DOCUMENT_POSITION_FOLLOWING = 0x04; +Node.DOCUMENT_POSITION_CONTAINS = 0x08; +Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10; +Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; + + +__extend__(Node.prototype, { + get localName(){ + return this.prefix? + this.nodeName.substring(this.prefix.length+1, this.nodeName.length): + this.nodeName; + }, + get prefix(){ + return this.nodeName.split(':').length>1? + this.nodeName.split(':')[0]: + null; + }, + set prefix(value){ + if(value === null){ + this.nodeName = this.localName; + }else{ + this.nodeName = value+':'+this.localName; + } + }, + hasAttributes : function() { + if (this.attributes.length == 0) { + return false; + }else{ + return true; + } + }, + get textContent(){ + return __recursivelyGatherText__(this); + }, + set textContent(newText){ + while(this.firstChild != null){ + this.removeChild( this.firstChild ); + } + var text = this.ownerDocument.createTextNode(newText); + this.appendChild(text); + }, + insertBefore : function(newChild, refChild) { + var prevNode; + + if(newChild==null){ + return newChild; + } + if(refChild==null){ + this.appendChild(newChild); + return this.newChild; + } + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Node is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if newChild was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(newChild)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if the node is an ancestor + if (__isAncestor__(this, newChild)) { + throw(new DOMException(DOMException.HIERARCHY_REQUEST_ERR)); + } + } + + // if refChild is specified, insert before it + if (refChild) { + // find index of refChild + var itemIndex = __findItemIndex__(this.childNodes, refChild); + // throw Exception if there is no child node with this id + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // if the newChild is already in the tree, + var newChildParent = newChild.parentNode; + if (newChildParent) { + // remove it + newChildParent.removeChild(newChild); + } + + // insert newChild into childNodes + __insertBefore__(this.childNodes, newChild, itemIndex); + + // do node pointer surgery + prevNode = refChild.previousSibling; + + // handle DocumentFragment + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + if (newChild.childNodes.length > 0) { + // set the parentNode of DocumentFragment's children + for (var ind = 0; ind < newChild.childNodes.length; ind++) { + newChild.childNodes[ind].parentNode = this; + } + + // link refChild to last child of DocumentFragment + refChild.previousSibling = newChild.childNodes[newChild.childNodes.length-1]; + } + }else { + // set the parentNode of the newChild + newChild.parentNode = this; + // link refChild to newChild + refChild.previousSibling = newChild; + } + + }else { + // otherwise, append to end + prevNode = this.lastChild; + this.appendChild(newChild); + } + + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // do node pointer surgery for DocumentFragment + if (newChild.childNodes.length > 0) { + if (prevNode) { + prevNode.nextSibling = newChild.childNodes[0]; + }else { + // this is the first child in the list + this.firstChild = newChild.childNodes[0]; + } + newChild.childNodes[0].previousSibling = prevNode; + newChild.childNodes[newChild.childNodes.length-1].nextSibling = refChild; + } + }else { + // do node pointer surgery for newChild + if (prevNode) { + prevNode.nextSibling = newChild; + }else { + // this is the first child in the list + this.firstChild = newChild; + } + newChild.previousSibling = prevNode; + newChild.nextSibling = refChild; + } + + return newChild; + }, + replaceChild : function(newChild, oldChild) { + var ret = null; + + if(newChild==null || oldChild==null){ + return oldChild; + } + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Node is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if newChild was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(newChild)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if the node is an ancestor + if (__isAncestor__(this, newChild)) { + throw(new DOMException(DOMException.HIERARCHY_REQUEST_ERR)); + } + } + + // get index of oldChild + var index = __findItemIndex__(this.childNodes, oldChild); + + // throw Exception if there is no child node with this id + if (__ownerDocument__(this).implementation.errorChecking && (index < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // if the newChild is already in the tree, + var newChildParent = newChild.parentNode; + if (newChildParent) { + // remove it + newChildParent.removeChild(newChild); + } + + // add newChild to childNodes + ret = __replaceChild__(this.childNodes,newChild, index); + + + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // do node pointer surgery for Document Fragment + if (newChild.childNodes.length > 0) { + for (var ind = 0; ind < newChild.childNodes.length; ind++) { + newChild.childNodes[ind].parentNode = this; + } + + if (oldChild.previousSibling) { + oldChild.previousSibling.nextSibling = newChild.childNodes[0]; + } else { + this.firstChild = newChild.childNodes[0]; + } + + if (oldChild.nextSibling) { + oldChild.nextSibling.previousSibling = newChild; + } else { + this.lastChild = newChild.childNodes[newChild.childNodes.length-1]; + } + + newChild.childNodes[0].previousSibling = oldChild.previousSibling; + newChild.childNodes[newChild.childNodes.length-1].nextSibling = oldChild.nextSibling; + } + } else { + // do node pointer surgery for newChild + newChild.parentNode = this; + + if (oldChild.previousSibling) { + oldChild.previousSibling.nextSibling = newChild; + }else{ + this.firstChild = newChild; + } + if (oldChild.nextSibling) { + oldChild.nextSibling.previousSibling = newChild; + }else{ + this.lastChild = newChild; + } + newChild.previousSibling = oldChild.previousSibling; + newChild.nextSibling = oldChild.nextSibling; + } + + return ret; + }, + removeChild : function(oldChild) { + if(!oldChild){ + return null; + } + // throw Exception if NamedNodeMap is readonly + if (__ownerDocument__(this).implementation.errorChecking && + (this._readonly || oldChild._readonly)) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get index of oldChild + var itemIndex = __findItemIndex__(this.childNodes, oldChild); + + // throw Exception if there is no child node with this id + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // remove oldChild from childNodes + __removeChild__(this.childNodes, itemIndex); + + // do node pointer surgery + oldChild.parentNode = null; + + if (oldChild.previousSibling) { + oldChild.previousSibling.nextSibling = oldChild.nextSibling; + }else { + this.firstChild = oldChild.nextSibling; + } + if (oldChild.nextSibling) { + oldChild.nextSibling.previousSibling = oldChild.previousSibling; + }else { + this.lastChild = oldChild.previousSibling; + } + + oldChild.previousSibling = null; + oldChild.nextSibling = null; + + return oldChild; + }, + appendChild : function(newChild) { + if(!newChild){ + return null; + } + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Node is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if arg was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(this)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if the node is an ancestor + if (__isAncestor__(this, newChild)) { + throw(new DOMException(DOMException.HIERARCHY_REQUEST_ERR)); + } + } + + // if the newChild is already in the tree, + var newChildParent = newChild.parentNode; + if (newChildParent) { + // remove it + //console.debug('removing node %s', newChild); + newChildParent.removeChild(newChild); + } + + // add newChild to childNodes + __appendChild__(this.childNodes, newChild); + + if (newChild.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // do node pointer surgery for DocumentFragment + if (newChild.childNodes.length > 0) { + for (var ind = 0; ind < newChild.childNodes.length; ind++) { + newChild.childNodes[ind].parentNode = this; + } + + if (this.lastChild) { + this.lastChild.nextSibling = newChild.childNodes[0]; + newChild.childNodes[0].previousSibling = this.lastChild; + this.lastChild = newChild.childNodes[newChild.childNodes.length-1]; + } else { + this.lastChild = newChild.childNodes[newChild.childNodes.length-1]; + this.firstChild = newChild.childNodes[0]; + } + } + } else { + // do node pointer surgery for newChild + newChild.parentNode = this; + if (this.lastChild) { + this.lastChild.nextSibling = newChild; + newChild.previousSibling = this.lastChild; + this.lastChild = newChild; + } else { + this.lastChild = newChild; + this.firstChild = newChild; + } + } + return newChild; + }, + hasChildNodes : function() { + return (this.childNodes.length > 0); + }, + cloneNode: function(deep) { + // use importNode to clone this Node + //do not throw any exceptions + try { + return __ownerDocument__(this).importNode(this, deep); + } catch (e) { + //there shouldn't be any exceptions, but if there are, return null + // may want to warn: $debug("could not clone node: "+e.code); + return null; + } + }, + normalize : function() { + var i; + var inode; + var nodesToRemove = new NodeList(); + + if (this.nodeType == Node.ELEMENT_NODE || this.nodeType == Node.DOCUMENT_NODE) { + var adjacentTextNode = null; + + // loop through all childNodes + for(i = 0; i < this.childNodes.length; i++) { + inode = this.childNodes.item(i); + + if (inode.nodeType == Node.TEXT_NODE) { + // this node is a text node + if (inode.length < 1) { + // this text node is empty + // add this node to the list of nodes to be remove + __appendChild__(nodesToRemove, inode); + }else { + if (adjacentTextNode) { + // previous node was also text + adjacentTextNode.appendData(inode.data); + // merge the data in adjacent text nodes + // add this node to the list of nodes to be removed + __appendChild__(nodesToRemove, inode); + } else { + // remember this node for next cycle + adjacentTextNode = inode; + } + } + } else { + // (soon to be) previous node is not a text node + adjacentTextNode = null; + // normalize non Text childNodes + inode.normalize(); + } + } + + // remove redundant Text Nodes + for(i = 0; i < nodesToRemove.length; i++) { + inode = nodesToRemove.item(i); + inode.parentNode.removeChild(inode); + } + } + }, + isSupported : function(feature, version) { + // use Implementation.hasFeature to determine if this feature is supported + return __ownerDocument__(this).implementation.hasFeature(feature, version); + }, + getElementsByTagName : function(tagname) { + // delegate to _getElementsByTagNameRecursive + // recurse childNodes + var nodelist = new NodeList(__ownerDocument__(this)); + for (var i = 0; i < this.childNodes.length; i++) { + __getElementsByTagNameRecursive__(this.childNodes.item(i), + tagname, + nodelist); + } + return nodelist; + }, + getElementsByTagNameNS : function(namespaceURI, localName) { + // delegate to _getElementsByTagNameNSRecursive + return __getElementsByTagNameNSRecursive__(this, namespaceURI, localName, + new NodeList(__ownerDocument__(this))); + }, + importNode : function(importedNode, deep) { + var i; + var importNode; + + //there is no need to perform namespace checks since everything has already gone through them + //in order to have gotten into the DOM in the first place. The following line + //turns namespace checking off in ._isValidNamespace + __ownerDocument__(this).importing = true; + + if (importedNode.nodeType == Node.ELEMENT_NODE) { + if (!__ownerDocument__(this).implementation.namespaceAware) { + // create a local Element (with the name of the importedNode) + importNode = __ownerDocument__(this).createElement(importedNode.tagName); + + // create attributes matching those of the importedNode + for(i = 0; i < importedNode.attributes.length; i++) { + importNode.setAttribute(importedNode.attributes.item(i).name, importedNode.attributes.item(i).value); + } + } else { + // create a local Element (with the name & namespaceURI of the importedNode) + importNode = __ownerDocument__(this).createElementNS(importedNode.namespaceURI, importedNode.nodeName); + + // create attributes matching those of the importedNode + for(i = 0; i < importedNode.attributes.length; i++) { + importNode.setAttributeNS(importedNode.attributes.item(i).namespaceURI, + importedNode.attributes.item(i).name, importedNode.attributes.item(i).value); + } + + // create namespace definitions matching those of the importedNode + for(i = 0; i < importedNode._namespaces.length; i++) { + importNode._namespaces[i] = __ownerDocument__(this).createNamespace(importedNode._namespaces.item(i).localName); + importNode._namespaces[i].value = importedNode._namespaces.item(i).value; + } + } + } else if (importedNode.nodeType == Node.ATTRIBUTE_NODE) { + if (!__ownerDocument__(this).implementation.namespaceAware) { + // create a local Attribute (with the name of the importedAttribute) + importNode = __ownerDocument__(this).createAttribute(importedNode.name); + } else { + // create a local Attribute (with the name & namespaceURI of the importedAttribute) + importNode = __ownerDocument__(this).createAttributeNS(importedNode.namespaceURI, importedNode.nodeName); + + // create namespace definitions matching those of the importedAttribute + for(i = 0; i < importedNode._namespaces.length; i++) { + importNode._namespaces[i] = __ownerDocument__(this).createNamespace(importedNode._namespaces.item(i).localName); + importNode._namespaces[i].value = importedNode._namespaces.item(i).value; + } + } + + // set the value of the local Attribute to match that of the importedAttribute + importNode.value = importedNode.value; + + } else if (importedNode.nodeType == Node.DOCUMENT_FRAGMENT_NODE) { + // create a local DocumentFragment + importNode = __ownerDocument__(this).createDocumentFragment(); + } else if (importedNode.nodeType == Node.NAMESPACE_NODE) { + // create a local NamespaceNode (with the same name & value as the importedNode) + importNode = __ownerDocument__(this).createNamespace(importedNode.nodeName); + importNode.value = importedNode.value; + } else if (importedNode.nodeType == Node.TEXT_NODE) { + // create a local TextNode (with the same data as the importedNode) + importNode = __ownerDocument__(this).createTextNode(importedNode.data); + } else if (importedNode.nodeType == Node.CDATA_SECTION_NODE) { + // create a local CDATANode (with the same data as the importedNode) + importNode = __ownerDocument__(this).createCDATASection(importedNode.data); + } else if (importedNode.nodeType == Node.PROCESSING_INSTRUCTION_NODE) { + // create a local ProcessingInstruction (with the same target & data as the importedNode) + importNode = __ownerDocument__(this).createProcessingInstruction(importedNode.target, importedNode.data); + } else if (importedNode.nodeType == Node.COMMENT_NODE) { + // create a local Comment (with the same data as the importedNode) + importNode = __ownerDocument__(this).createComment(importedNode.data); + } else { // throw Exception if nodeType is not supported + throw(new DOMException(DOMException.NOT_SUPPORTED_ERR)); + } + + if (deep) { + // recurse childNodes + for(i = 0; i < importedNode.childNodes.length; i++) { + importNode.appendChild(__ownerDocument__(this).importNode(importedNode.childNodes.item(i), true)); + } + } + + //reset importing + __ownerDocument__(this).importing = false; + return importNode; + + }, + contains : function(node){ + while(node && node != this ){ + node = node.parentNode; + } + return !!node; + }, + compareDocumentPosition : function(b){ + //console.log("comparing document position %s %s", this, b); + var i, + length, + a = this, + parent, + aparents, + bparents; + //handle a couple simpler case first + if(a === b) { + return Node.DOCUMENT_POSITION_EQUAL; + } + if(a.ownerDocument !== b.ownerDocument) { + return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC| + Node.DOCUMENT_POSITION_FOLLOWING| + Node.DOCUMENT_POSITION_DISCONNECTED; + } + if(a.parentNode === b.parentNode){ + length = a.parentNode.childNodes.length; + for(i=0;i aparents.length){ + return Node.DOCUMENT_POSITION_FOLLOWING; + }else if(bparents.length < aparents.length){ + return Node.DOCUMENT_POSITION_PRECEDING; + }else{ + //common ancestor diverge point + if (i === 0) { + return Node.DOCUMENT_POSITION_FOLLOWING; + } else { + parent = aparents[i-1]; + } + return parent.compareDocumentPosition(bparents.pop()); + } + } + } + + return Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC| + Node.DOCUMENT_POSITION_DISCONNECTED; + + }, + toString : function() { + return '[object Node]'; + } + +}); + + + +/** + * @method __getElementsByTagNameRecursive__ - implements getElementsByTagName() + * @param elem : Element - The element which are checking and then recursing into + * @param tagname : string - The name of the tag to match on. The special value "*" matches all tags + * @param nodeList : NodeList - The accumulating list of matching nodes + * + * @return : NodeList + */ +var __getElementsByTagNameRecursive__ = function (elem, tagname, nodeList) { + + if (elem.nodeType == Node.ELEMENT_NODE || elem.nodeType == Node.DOCUMENT_NODE) { + + if(elem.nodeType !== Node.DOCUMENT_NODE && + ((elem.nodeName.toUpperCase() == tagname.toUpperCase()) || + (tagname == "*")) ){ + // add matching node to nodeList + __appendChild__(nodeList, elem); + } + + // recurse childNodes + for(var i = 0; i < elem.childNodes.length; i++) { + nodeList = __getElementsByTagNameRecursive__(elem.childNodes.item(i), tagname, nodeList); + } + } + + return nodeList; +}; + +/** + * @method __getElementsByTagNameNSRecursive__ + * implements getElementsByTagName() + * + * @param elem : Element - The element which are checking and then recursing into + * @param namespaceURI : string - the namespace URI of the required node + * @param localName : string - the local name of the required node + * @param nodeList : NodeList - The accumulating list of matching nodes + * + * @return : NodeList + */ +var __getElementsByTagNameNSRecursive__ = function(elem, namespaceURI, localName, nodeList) { + if (elem.nodeType == Node.ELEMENT_NODE || elem.nodeType == Node.DOCUMENT_NODE) { + + if (((elem.namespaceURI == namespaceURI) || (namespaceURI == "*")) && + ((elem.localName == localName) || (localName == "*"))) { + // add matching node to nodeList + __appendChild__(nodeList, elem); + } + + // recurse childNodes + for(var i = 0; i < elem.childNodes.length; i++) { + nodeList = __getElementsByTagNameNSRecursive__( + elem.childNodes.item(i), namespaceURI, localName, nodeList); + } + } + + return nodeList; +}; + +/** + * @method __isAncestor__ - returns true if node is ancestor of target + * @param target : Node - The node we are using as context + * @param node : Node - The candidate ancestor node + * @return : boolean + */ +var __isAncestor__ = function(target, node) { + // if this node matches, return true, + // otherwise recurse up (if there is a parentNode) + return ((target == node) || ((target.parentNode) && (__isAncestor__(target.parentNode, node)))); +}; + + + +var __recursivelyGatherText__ = function(aNode) { + var accumulateText = "", + idx, + node; + for (idx=0;idx < aNode.childNodes.length;idx++){ + node = aNode.childNodes.item(idx); + if(node.nodeType == Node.TEXT_NODE) + accumulateText += node.data; + else + accumulateText += __recursivelyGatherText__(node); + } + return accumulateText; +}; + +/** + * function __escapeXML__ + * @param str : string - The string to be escaped + * @return : string - The escaped string + */ +var escAmpRegEx = /&(?!(amp;|lt;|gt;|quot|apos;))/g; +var escLtRegEx = //g; +var quotRegEx = /"/g; +var aposRegEx = /'/g; + +function __escapeXML__(str) { + str = str.replace(escAmpRegEx, "&"). + replace(escLtRegEx, "<"). + replace(escGtRegEx, ">"). + replace(quotRegEx, """). + replace(aposRegEx, "'"); + + return str; +}; + +/* +function __escapeHTML5__(str) { + str = str.replace(escAmpRegEx, "&"). + replace(escLtRegEx, "<"). + replace(escGtRegEx, ">"); + + return str; +}; +function __escapeHTML5Atribute__(str) { + str = str.replace(escAmpRegEx, "&"). + replace(escLtRegEx, "<"). + replace(escGtRegEx, ">"). + replace(quotRegEx, """). + replace(aposRegEx, "'"); + + return str; +}; +*/ + +/** + * function __unescapeXML__ + * @param str : string - The string to be unescaped + * @return : string - The unescaped string + */ +var unescAmpRegEx = /&/g; +var unescLtRegEx = /</g; +var unescGtRegEx = />/g; +var unquotRegEx = /"/g; +var unaposRegEx = /'/g; +function __unescapeXML__(str) { + str = str.replace(unescAmpRegEx, "&"). + replace(unescLtRegEx, "<"). + replace(unescGtRegEx, ">"). + replace(unquotRegEx, "\""). + replace(unaposRegEx, "'"); + + return str; +}; + +/** + * @class NamedNodeMap - + * used to represent collections of nodes that can be accessed by name + * typically a set of Element attributes + * + * @extends NodeList - + * note W3C spec says that this is not the case, but we need an item() + * method identical to NodeList's, so why not? + * @param ownerDocument : Document - the ownerDocument + * @param parentNode : Node - the node that the NamedNodeMap is attached to (or null) + */ +NamedNodeMap = function(ownerDocument, parentNode) { + NodeList.apply(this, arguments); + __setArray__(this, []); +}; +NamedNodeMap.prototype = new NodeList(); +__extend__(NamedNodeMap.prototype, { + add: function(name){ + this[this.length] = name; + }, + getNamedItem : function(name) { + var ret = null; + //console.log('NamedNodeMap getNamedItem %s', name); + // test that Named Node exists + var itemIndex = __findNamedItemIndex__(this, name); + + if (itemIndex > -1) { + // found it! + ret = this[itemIndex]; + } + // if node is not found, default value null is returned + return ret; + }, + setNamedItem : function(arg) { + //console.log('setNamedItem %s', arg); + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if arg was not created by this Document + if (this.ownerDocument != arg.ownerDocument) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if DOMNamedNodeMap is readonly + if (this._readonly || (this.parentNode && this.parentNode._readonly)) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if arg is already an attribute of another Element object + if (arg.ownerElement && (arg.ownerElement != this.parentNode)) { + throw(new DOMException(DOMException.INUSE_ATTRIBUTE_ERR)); + } + } + + //console.log('setNamedItem __findNamedItemIndex__ '); + // get item index + var itemIndex = __findNamedItemIndex__(this, arg.name); + var ret = null; + + //console.log('setNamedItem __findNamedItemIndex__ %s', itemIndex); + if (itemIndex > -1) { // found it! + ret = this[itemIndex]; // use existing Attribute + + // throw Exception if DOMAttr is readonly + if (__ownerDocument__(this).implementation.errorChecking && ret._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } else { + this[itemIndex] = arg; // over-write existing NamedNode + this[arg.name.toLowerCase()] = arg; + } + } else { + // add new NamedNode + //console.log('setNamedItem add new named node map (by index)'); + Array.prototype.push.apply(this, [arg]); + //console.log('setNamedItem add new named node map (by name) %s %s', arg, arg.name); + this[arg.name] = arg; + //console.log('finsished setNamedItem add new named node map (by name) %s', arg.name); + + } + + //console.log('setNamedItem parentNode'); + arg.ownerElement = this.parentNode; // update ownerElement + // return old node or new node + //console.log('setNamedItem exit'); + return ret; + }, + removeNamedItem : function(name) { + var ret = null; + // test for exceptions + // throw Exception if NamedNodeMap is readonly + if (__ownerDocument__(this).implementation.errorChecking && + (this._readonly || (this.parentNode && this.parentNode._readonly))) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get item index + var itemIndex = __findNamedItemIndex__(this, name); + + // throw Exception if there is no node named name in this map + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // get Node + var oldNode = this[itemIndex]; + //this[oldNode.name] = undefined; + + // throw Exception if Node is readonly + if (__ownerDocument__(this).implementation.errorChecking && oldNode._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // return removed node + return __removeChild__(this, itemIndex); + }, + getNamedItemNS : function(namespaceURI, localName) { + var ret = null; + + // test that Named Node exists + var itemIndex = __findNamedItemNSIndex__(this, namespaceURI, localName); + + if (itemIndex > -1) { + // found it! return NamedNode + ret = this[itemIndex]; + } + // if node is not found, default value null is returned + return ret; + }, + setNamedItemNS : function(arg) { + //console.log('setNamedItemNS %s', arg); + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if NamedNodeMap is readonly + if (this._readonly || (this.parentNode && this.parentNode._readonly)) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if arg was not created by this Document + if (__ownerDocument__(this) != __ownerDocument__(arg)) { + throw(new DOMException(DOMException.WRONG_DOCUMENT_ERR)); + } + + // throw Exception if arg is already an attribute of another Element object + if (arg.ownerElement && (arg.ownerElement != this.parentNode)) { + throw(new DOMException(DOMException.INUSE_ATTRIBUTE_ERR)); + } + } + + // get item index + var itemIndex = __findNamedItemNSIndex__(this, arg.namespaceURI, arg.localName); + var ret = null; + + if (itemIndex > -1) { + // found it! + // use existing Attribute + ret = this[itemIndex]; + // throw Exception if Attr is readonly + if (__ownerDocument__(this).implementation.errorChecking && ret._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } else { + // over-write existing NamedNode + this[itemIndex] = arg; + } + }else { + // add new NamedNode + Array.prototype.push.apply(this, [arg]); + } + arg.ownerElement = this.parentNode; + + // return old node or null + return ret; + //console.log('finished setNamedItemNS %s', arg); + }, + removeNamedItemNS : function(namespaceURI, localName) { + var ret = null; + + // test for exceptions + // throw Exception if NamedNodeMap is readonly + if (__ownerDocument__(this).implementation.errorChecking && (this._readonly || (this.parentNode && this.parentNode._readonly))) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get item index + var itemIndex = __findNamedItemNSIndex__(this, namespaceURI, localName); + + // throw Exception if there is no matching node in this map + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + // get Node + var oldNode = this[itemIndex]; + + // throw Exception if Node is readonly + if (__ownerDocument__(this).implementation.errorChecking && oldNode._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + return __removeChild__(this, itemIndex); // return removed node + }, + get xml() { + var ret = ""; + + // create string containing concatenation of all (but last) Attribute string values (separated by spaces) + for (var i=0; i < this.length -1; i++) { + ret += this[i].xml +" "; + } + + // add last Attribute to string (without trailing space) + if (this.length > 0) { + ret += this[this.length -1].xml; + } + + return ret; + }, + toString : function(){ + return "[object NamedNodeMap]"; + } + +}); + +/** + * @method __findNamedItemIndex__ + * find the item index of the node with the specified name + * + * @param name : string - the name of the required node + * @param isnsmap : if its a NamespaceNodeMap + * @return : int + */ +var __findNamedItemIndex__ = function(namednodemap, name, isnsmap) { + var ret = -1; + // loop through all nodes + for (var i=0; i -1) { + // found it! + ret = true; + } + // if node is not found, default value false is returned + return ret; +} + +/** + * @method __hasAttributeNS__ + * Returns true if specified node exists + * + * @param namespaceURI : string - the namespace URI of the required node + * @param localName : string - the local name of the required node + * @return : boolean + */ +var __hasAttributeNS__ = function(namednodemap, namespaceURI, localName) { + var ret = false; + // test that Named Node exists + var itemIndex = __findNamedItemNSIndex__(namednodemap, namespaceURI, localName); + if (itemIndex > -1) { + // found it! + ret = true; + } + // if node is not found, default value false is returned + return ret; +} + +/** + * @method __cloneNamedNodes__ + * Returns a NamedNodeMap containing clones of the Nodes in this NamedNodeMap + * + * @param parentNode : Node - the new parent of the cloned NodeList + * @param isnsmap : bool - is this a NamespaceNodeMap + * @return NamedNodeMap containing clones of the Nodes in this NamedNodeMap + */ +var __cloneNamedNodes__ = function(namednodemap, parentNode, isnsmap) { + var cloneNamedNodeMap = isnsmap? + new NamespaceNodeMap(namednodemap.ownerDocument, parentNode): + new NamedNodeMap(namednodemap.ownerDocument, parentNode); + + // create list containing clones of all children + for (var i=0; i < namednodemap.length; i++) { + __appendChild__(cloneNamedNodeMap, namednodemap[i].cloneNode(false)); + } + + return cloneNamedNodeMap; +}; + + +/** + * @class NamespaceNodeMap - + * used to represent collections of namespace nodes that can be + * accessed by name typically a set of Element attributes + * + * @extends NamedNodeMap + * + * @param ownerDocument : Document - the ownerDocument + * @param parentNode : Node - the node that the NamespaceNodeMap is attached to (or null) + */ +var NamespaceNodeMap = function(ownerDocument, parentNode) { + this.NamedNodeMap = NamedNodeMap; + this.NamedNodeMap(ownerDocument, parentNode); + __setArray__(this, []); +}; +NamespaceNodeMap.prototype = new NamedNodeMap(); +__extend__(NamespaceNodeMap.prototype, { + get xml() { + var ret = "", + ns, + ind; + // identify namespaces declared local to this Element (ie, not inherited) + for (ind = 0; ind < this.length; ind++) { + // if namespace declaration does not exist in the containing node's, parentNode's namespaces + ns = null; + try { + var ns = this.parentNode.parentNode._namespaces. + getNamedItem(this[ind].localName); + }catch (e) { + //breaking to prevent default namespace being inserted into return value + break; + } + if (!(ns && (""+ ns.nodeValue == ""+ this[ind].nodeValue))) { + // display the namespace declaration + ret += this[ind].xml +" "; + } + } + return ret; + } +}); + +/** + * @class Namespace - + * The Namespace interface represents an namespace in an Element object + * + * @param ownerDocument : The Document object associated with this node. + */ +Namespace = function(ownerDocument) { + Node.apply(this, arguments); + // the name of this attribute + this.name = ""; + + // If this attribute was explicitly given a value in the original document, + // this is true; otherwise, it is false. + // Note that the implementation is in charge of this attribute, not the user. + // If the user changes the value of the attribute (even if it ends up having + // the same value as the default value) then the specified flag is + // automatically flipped to true + this.specified = false; +}; +Namespace.prototype = new Node(); +__extend__(Namespace.prototype, { + get value(){ + // the value of the attribute is returned as a string + return this.nodeValue; + }, + set value(value){ + this.nodeValue = value+''; + }, + get nodeType(){ + return Node.NAMESPACE_NODE; + }, + get xml(){ + var ret = ""; + + // serialize Namespace Declaration + if (this.nodeName != "") { + ret += this.nodeName +"=\""+ __escapeXML__(this.nodeValue) +"\""; + } + else { // handle default namespace + ret += "xmlns=\""+ __escapeXML__(this.nodeValue) +"\""; + } + + return ret; + }, + toString: function(){ + return '[object Namespace]'; + } +}); + + +/** + * @class CharacterData - parent abstract class for Text and Comment + * @extends Node + * @param ownerDocument : The Document object associated with this node. + */ +CharacterData = function(ownerDocument) { + Node.apply(this, arguments); +}; +CharacterData.prototype = new Node(); +__extend__(CharacterData.prototype,{ + get data(){ + return this.nodeValue; + }, + set data(data){ + this.nodeValue = data; + }, + get textContent(){ + return this.nodeValue; + }, + set textContent(newText){ + this.nodeValue = newText; + }, + get length(){return this.nodeValue.length;}, + appendData: function(arg){ + // throw Exception if CharacterData is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + // append data + this.data = "" + this.data + arg; + }, + deleteData: function(offset, count){ + // throw Exception if CharacterData is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + if (this.data) { + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length) || (count < 0))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // delete data + if(!count || (offset + count) > this.data.length) { + this.data = this.data.substring(0, offset); + }else { + this.data = this.data.substring(0, offset). + concat(this.data.substring(offset + count)); + } + } + }, + insertData: function(offset, arg){ + // throw Exception if CharacterData is readonly + if(__ownerDocument__(this).implementation.errorChecking && this._readonly){ + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + if(this.data){ + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // insert data + this.data = this.data.substring(0, offset).concat(arg, this.data.substring(offset)); + }else { + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && (offset !== 0)) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // set data + this.data = arg; + } + }, + replaceData: function(offset, count, arg){ + // throw Exception if CharacterData is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + if (this.data) { + // throw Exception if offset is negative or greater than the data length, + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length) || (count < 0))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + + // replace data + this.data = this.data.substring(0, offset). + concat(arg, this.data.substring(offset + count)); + }else { + // set data + this.data = arg; + } + }, + substringData: function(offset, count){ + var ret = null; + if (this.data) { + // throw Exception if offset is negative or greater than the data length, + // or the count is negative + if (__ownerDocument__(this).implementation.errorChecking && + ((offset < 0) || (offset > this.data.length) || (count < 0))) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + // if count is not specified + if (!count) { + ret = this.data.substring(offset); // default to 'end of string' + }else{ + ret = this.data.substring(offset, offset + count); + } + } + return ret; + }, + toString : function(){ + return "[object CharacterData]"; + } +}); + +/** + * @class Text + * The Text interface represents the textual content (termed + * character data in XML) of an Element or Attr. + * If there is no markup inside an element's content, the text is + * contained in a single object implementing the Text interface that + * is the only child of the element. If there is markup, it is + * parsed into a list of elements and Text nodes that form the + * list of children of the element. + * @extends CharacterData + * @param ownerDocument The Document object associated with this node. + */ +Text = function(ownerDocument) { + CharacterData.apply(this, arguments); + this.nodeName = "#text"; +}; +Text.prototype = new CharacterData(); +__extend__(Text.prototype,{ + get localName(){ + return null; + }, + // Breaks this Text node into two Text nodes at the specified offset, + // keeping both in the tree as siblings. This node then only contains + // all the content up to the offset point. And a new Text node, which + // is inserted as the next sibling of this node, contains all the + // content at and after the offset point. + splitText : function(offset) { + var data, + inode; + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Node is readonly + if (this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + // throw Exception if offset is negative or greater than the data length, + if ((offset < 0) || (offset > this.data.length)) { + throw(new DOMException(DOMException.INDEX_SIZE_ERR)); + } + } + if (this.parentNode) { + // get remaining string (after offset) + data = this.substringData(offset); + // create new TextNode with remaining string + inode = __ownerDocument__(this).createTextNode(data); + // attach new TextNode + if (this.nextSibling) { + this.parentNode.insertBefore(inode, this.nextSibling); + } else { + this.parentNode.appendChild(inode); + } + // remove remaining string from original TextNode + this.deleteData(offset); + } + return inode; + }, + get nodeType(){ + return Node.TEXT_NODE; + }, + get xml(){ + return __escapeXML__(""+ this.nodeValue); + }, + toString: function(){ + return "[object Text]"; + } +}); + +/** + * @class CDATASection + * CDATA sections are used to escape blocks of text containing + * characters that would otherwise be regarded as markup. + * The only delimiter that is recognized in a CDATA section is + * the "\]\]\>" string that ends the CDATA section + * @extends Text + * @param ownerDocument : The Document object associated with this node. + */ +CDATASection = function(ownerDocument) { + Text.apply(this, arguments); + this.nodeName = '#cdata-section'; +}; +CDATASection.prototype = new Text(); +__extend__(CDATASection.prototype,{ + get nodeType(){ + return Node.CDATA_SECTION_NODE; + }, + get xml(){ + return ""; + }, + toString : function(){ + return "[object CDATASection]"; + } +}); +/** + * @class Comment + * This represents the content of a comment, i.e., all the + * characters between the starting '' + * @extends CharacterData + * @param ownerDocument : The Document object associated with this node. + */ +Comment = function(ownerDocument) { + CharacterData.apply(this, arguments); + this.nodeName = "#comment"; +}; +Comment.prototype = new CharacterData(); +__extend__(Comment.prototype, { + get localName(){ + return null; + }, + get nodeType(){ + return Node.COMMENT_NODE; + }, + get xml(){ + return ""; + }, + toString : function(){ + return "[object Comment]"; + } +}); + + +/** + * @author envjs team + * @param {Document} onwnerDocument + */ +DocumentType = function(ownerDocument) { + Node.apply(this, arguments); + this.systemId = null; + this.publicId = null; +}; +DocumentType.prototype = new Node(); +__extend__({ + get name(){ + return this.nodeName; + }, + get entities(){ + return null; + }, + get internalSubsets(){ + return null; + }, + get notations(){ + return null; + }, + toString : function(){ + return "[object DocumentType]"; + } +}); + +/** + * @class Attr + * The Attr interface represents an attribute in an Element object + * @extends Node + * @param ownerDocument : The Document object associated with this node. + */ +Attr = function(ownerDocument) { + Node.apply(this, arguments); + // set when Attr is added to NamedNodeMap + this.ownerElement = null; + //TODO: our implementation of Attr is incorrect because we don't + // treat the value of the attribute as a child text node. +}; +Attr.prototype = new Node(); +__extend__(Attr.prototype, { + // the name of this attribute + get name(){ + return this.nodeName; + }, + // the value of the attribute is returned as a string + get value(){ + return this.nodeValue||''; + }, + set value(value){ + // throw Exception if Attribute is readonly + if (__ownerDocument__(this).implementation.errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + // delegate to node + this.nodeValue = value; + }, + get textContent(){ + return this.nodeValue; + }, + set textContent(newText){ + this.nodeValue = newText; + }, + get specified(){ + return (this !== null && this !== undefined); + }, + get nodeType(){ + return Node.ATTRIBUTE_NODE; + }, + get xml() { + if (this.nodeValue) { + return __escapeXML__(this.nodeValue+""); + } else { + return ''; + } + }, + toString : function() { + return '[object Attr]'; + } +}); + + +/** + * @class Element - + * By far the vast majority of objects (apart from text) + * that authors encounter when traversing a document are + * Element nodes. + * @extends Node + * @param ownerDocument : The Document object associated with this node. + */ +Element = function(ownerDocument) { + Node.apply(this, arguments); + this.attributes = new NamedNodeMap(this.ownerDocument, this); +}; +Element.prototype = new Node(); +__extend__(Element.prototype, { + // The name of the element. + get tagName(){ + return this.nodeName; + }, + + getAttribute: function(name) { + var ret = null; + // if attribute exists, use it + var attr = this.attributes.getNamedItem(name); + if (attr) { + ret = attr.value; + } + // if Attribute exists, return its value, otherwise, return null + return ret; + }, + setAttribute : function (name, value) { + // if attribute exists, use it + var attr = this.attributes.getNamedItem(name); + //console.log('attr %s', attr); + //I had to add this check because as the script initializes + //the id may be set in the constructor, and the html element + //overrides the id property with a getter/setter. + if(__ownerDocument__(this)){ + if (attr===null||attr===undefined) { + // otherwise create it + attr = __ownerDocument__(this).createAttribute(name); + //console.log('attr %s', attr); + } + + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Attribute is readonly + if (attr._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if the value string contains an illegal character + if (!__isValidString__(value+'')) { + throw(new DOMException(DOMException.INVALID_CHARACTER_ERR)); + } + } + + // assign values to properties (and aliases) + attr.value = value + ''; + + // add/replace Attribute in NamedNodeMap + this.attributes.setNamedItem(attr); + //console.log('element setNamedItem %s', attr); + }else{ + console.warn('Element has no owner document '+this.tagName+ + '\n\t cant set attribute ' + name + ' = '+value ); + } + }, + removeAttribute : function removeAttribute(name) { + // delegate to NamedNodeMap.removeNamedItem + return this.attributes.removeNamedItem(name); + }, + getAttributeNode : function getAttributeNode(name) { + // delegate to NamedNodeMap.getNamedItem + return this.attributes.getNamedItem(name); + }, + setAttributeNode: function(newAttr) { + // if this Attribute is an ID + if (__isIdDeclaration__(newAttr.name)) { + this.id = newAttr.value; // cache ID for getElementById() + } + // delegate to NamedNodeMap.setNamedItem + return this.attributes.setNamedItem(newAttr); + }, + removeAttributeNode: function(oldAttr) { + // throw Exception if Attribute is readonly + if (__ownerDocument__(this).implementation.errorChecking && oldAttr._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // get item index + var itemIndex = this.attributes._findItemIndex(oldAttr._id); + + // throw Exception if node does not exist in this map + if (__ownerDocument__(this).implementation.errorChecking && (itemIndex < 0)) { + throw(new DOMException(DOMException.NOT_FOUND_ERR)); + } + + return this.attributes._removeChild(itemIndex); + }, + getAttributeNS : function(namespaceURI, localName) { + var ret = ""; + // delegate to NAmedNodeMap.getNamedItemNS + var attr = this.attributes.getNamedItemNS(namespaceURI, localName); + if (attr) { + ret = attr.value; + } + return ret; // if Attribute exists, return its value, otherwise return "" + }, + setAttributeNS : function(namespaceURI, qualifiedName, value) { + // call NamedNodeMap.getNamedItem + //console.log('setAttributeNS %s %s %s', namespaceURI, qualifiedName, value); + var attr = this.attributes.getNamedItem(namespaceURI, qualifiedName); + + if (!attr) { // if Attribute exists, use it + // otherwise create it + attr = __ownerDocument__(this).createAttributeNS(namespaceURI, qualifiedName); + } + + value = '' + value; + + // test for exceptions + if (__ownerDocument__(this).implementation.errorChecking) { + // throw Exception if Attribute is readonly + if (attr._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + + // throw Exception if the Namespace is invalid + if (!__isValidNamespace__(this.ownerDocument, namespaceURI, qualifiedName, true)) { + throw(new DOMException(DOMException.NAMESPACE_ERR)); + } + + // throw Exception if the value string contains an illegal character + if (!__isValidString__(value)) { + throw(new DOMException(DOMException.INVALID_CHARACTER_ERR)); + } + } + + // if this Attribute is an ID + //if (__isIdDeclaration__(name)) { + // this.id = value; + //} + + // assign values to properties (and aliases) + attr.value = value; + attr.nodeValue = value; + + // delegate to NamedNodeMap.setNamedItem + this.attributes.setNamedItemNS(attr); + }, + removeAttributeNS : function(namespaceURI, localName) { + // delegate to NamedNodeMap.removeNamedItemNS + return this.attributes.removeNamedItemNS(namespaceURI, localName); + }, + getAttributeNodeNS : function(namespaceURI, localName) { + // delegate to NamedNodeMap.getNamedItemNS + return this.attributes.getNamedItemNS(namespaceURI, localName); + }, + setAttributeNodeNS : function(newAttr) { + // if this Attribute is an ID + if ((newAttr.prefix == "") && __isIdDeclaration__(newAttr.name)) { + this.id = newAttr.value+''; // cache ID for getElementById() + } + + // delegate to NamedNodeMap.setNamedItemNS + return this.attributes.setNamedItemNS(newAttr); + }, + hasAttribute : function(name) { + // delegate to NamedNodeMap._hasAttribute + return __hasAttribute__(this.attributes,name); + }, + hasAttributeNS : function(namespaceURI, localName) { + // delegate to NamedNodeMap._hasAttributeNS + return __hasAttributeNS__(this.attributes, namespaceURI, localName); + }, + get nodeType(){ + return Node.ELEMENT_NODE; + }, + get xml() { + var ret = "", + ns = "", + attrs, + attrstring, + i; + + // serialize namespace declarations + if (this.namespaceURI ){ + if((this === this.ownerDocument.documentElement) || + (!this.parentNode)|| + (this.parentNode && (this.parentNode.namespaceURI !== this.namespaceURI))) { + ns = ' xmlns' + (this.prefix?(':'+this.prefix):'') + + '="' + this.namespaceURI + '"'; + } + } + + // serialize Attribute declarations + attrs = this.attributes; + attrstring = ""; + for(i=0;i< attrs.length;i++){ + if(attrs[i].name.match('xmlns:')) { + attrstring += " "+attrs[i].name+'="'+attrs[i].xml+'"'; + } + } + for(i=0;i< attrs.length;i++){ + if(!attrs[i].name.match('xmlns:')) { + attrstring += " "+attrs[i].name+'="'+attrs[i].xml+'"'; + } + } + + if(this.hasChildNodes()){ + // serialize this Element + ret += "<" + this.tagName + ns + attrstring +">"; + ret += this.childNodes.xml; + ret += ""; + }else{ + ret += "<" + this.tagName + ns + attrstring +"/>"; + } + + return ret; + }, + toString : function(){ + return '[object Element]'; + } +}); +/** + * @class DOMException - raised when an operation is impossible to perform + * @author Jon van Noort (jon@webarcana.com.au) + * @param code : int - the exception code (one of the DOMException constants) + */ +DOMException = function(code) { + this.code = code; +}; + +// DOMException constants +// Introduced in DOM Level 1: +DOMException.INDEX_SIZE_ERR = 1; +DOMException.DOMSTRING_SIZE_ERR = 2; +DOMException.HIERARCHY_REQUEST_ERR = 3; +DOMException.WRONG_DOCUMENT_ERR = 4; +DOMException.INVALID_CHARACTER_ERR = 5; +DOMException.NO_DATA_ALLOWED_ERR = 6; +DOMException.NO_MODIFICATION_ALLOWED_ERR = 7; +DOMException.NOT_FOUND_ERR = 8; +DOMException.NOT_SUPPORTED_ERR = 9; +DOMException.INUSE_ATTRIBUTE_ERR = 10; + +// Introduced in DOM Level 2: +DOMException.INVALID_STATE_ERR = 11; +DOMException.SYNTAX_ERR = 12; +DOMException.INVALID_MODIFICATION_ERR = 13; +DOMException.NAMESPACE_ERR = 14; +DOMException.INVALID_ACCESS_ERR = 15; + +/** + * @class DocumentFragment - + * DocumentFragment is a "lightweight" or "minimal" Document object. + * @extends Node + * @param ownerDocument : The Document object associated with this node. + */ +DocumentFragment = function(ownerDocument) { + Node.apply(this, arguments); + this.nodeName = "#document-fragment"; +}; +DocumentFragment.prototype = new Node(); +__extend__(DocumentFragment.prototype,{ + get nodeType(){ + return Node.DOCUMENT_FRAGMENT_NODE; + }, + get xml(){ + var xml = "", + count = this.childNodes.length; + + // create string concatenating the serialized ChildNodes + for (var i = 0; i < count; i++) { + xml += this.childNodes.item(i).xml; + } + + return xml; + }, + toString : function(){ + return "[object DocumentFragment]"; + }, + get localName(){ + return null; + } +}); + + +/** + * @class ProcessingInstruction - + * The ProcessingInstruction interface represents a + * "processing instruction", used in XML as a way to + * keep processor-specific information in the text of + * the document + * @extends Node + * @author Jon van Noort (jon@webarcana.com.au) + * @param ownerDocument : The Document object associated with this node. + */ +ProcessingInstruction = function(ownerDocument) { + Node.apply(this, arguments); +}; +ProcessingInstruction.prototype = new Node(); +__extend__(ProcessingInstruction.prototype, { + get data(){ + return this.nodeValue; + }, + set data(data){ + // throw Exception if Node is readonly + if (__ownerDocument__(this).errorChecking && this._readonly) { + throw(new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR)); + } + this.nodeValue = data; + }, + get textContent(){ + return this.data; + }, + get localName(){ + return null; + }, + get target(){ + // The target of this processing instruction. + // XML defines this as being the first token following the markup that begins the processing instruction. + // The content of this processing instruction. + return this.nodeName; + }, + set target(value){ + // The target of this processing instruction. + // XML defines this as being the first token following the markup that begins the processing instruction. + // The content of this processing instruction. + this.nodeName = value; + }, + get nodeType(){ + return Node.PROCESSING_INSTRUCTION_NODE; + }, + get xml(){ + return ""; + }, + toString : function(){ + return "[object ProcessingInstruction]"; + } +}); + + +/** + * @author envjs team + */ + +Entity = function() { + throw new Error("Entity Not Implemented" ); +}; + +Entity.constants = { + // content taken from W3C "HTML 4.01 Specification" + // "W3C Recommendation 24 December 1999" + + nbsp: "\u00A0", + iexcl: "\u00A1", + cent: "\u00A2", + pound: "\u00A3", + curren: "\u00A4", + yen: "\u00A5", + brvbar: "\u00A6", + sect: "\u00A7", + uml: "\u00A8", + copy: "\u00A9", + ordf: "\u00AA", + laquo: "\u00AB", + not: "\u00AC", + shy: "\u00AD", + reg: "\u00AE", + macr: "\u00AF", + deg: "\u00B0", + plusmn: "\u00B1", + sup2: "\u00B2", + sup3: "\u00B3", + acute: "\u00B4", + micro: "\u00B5", + para: "\u00B6", + middot: "\u00B7", + cedil: "\u00B8", + sup1: "\u00B9", + ordm: "\u00BA", + raquo: "\u00BB", + frac14: "\u00BC", + frac12: "\u00BD", + frac34: "\u00BE", + iquest: "\u00BF", + Agrave: "\u00C0", + Aacute: "\u00C1", + Acirc: "\u00C2", + Atilde: "\u00C3", + Auml: "\u00C4", + Aring: "\u00C5", + AElig: "\u00C6", + Ccedil: "\u00C7", + Egrave: "\u00C8", + Eacute: "\u00C9", + Ecirc: "\u00CA", + Euml: "\u00CB", + Igrave: "\u00CC", + Iacute: "\u00CD", + Icirc: "\u00CE", + Iuml: "\u00CF", + ETH: "\u00D0", + Ntilde: "\u00D1", + Ograve: "\u00D2", + Oacute: "\u00D3", + Ocirc: "\u00D4", + Otilde: "\u00D5", + Ouml: "\u00D6", + times: "\u00D7", + Oslash: "\u00D8", + Ugrave: "\u00D9", + Uacute: "\u00DA", + Ucirc: "\u00DB", + Uuml: "\u00DC", + Yacute: "\u00DD", + THORN: "\u00DE", + szlig: "\u00DF", + agrave: "\u00E0", + aacute: "\u00E1", + acirc: "\u00E2", + atilde: "\u00E3", + auml: "\u00E4", + aring: "\u00E5", + aelig: "\u00E6", + ccedil: "\u00E7", + egrave: "\u00E8", + eacute: "\u00E9", + ecirc: "\u00EA", + euml: "\u00EB", + igrave: "\u00EC", + iacute: "\u00ED", + icirc: "\u00EE", + iuml: "\u00EF", + eth: "\u00F0", + ntilde: "\u00F1", + ograve: "\u00F2", + oacute: "\u00F3", + ocirc: "\u00F4", + otilde: "\u00F5", + ouml: "\u00F6", + divide: "\u00F7", + oslash: "\u00F8", + ugrave: "\u00F9", + uacute: "\u00FA", + ucirc: "\u00FB", + uuml: "\u00FC", + yacute: "\u00FD", + thorn: "\u00FE", + yuml: "\u00FF", + fnof: "\u0192", + Alpha: "\u0391", + Beta: "\u0392", + Gamma: "\u0393", + Delta: "\u0394", + Epsilon: "\u0395", + Zeta: "\u0396", + Eta: "\u0397", + Theta: "\u0398", + Iota: "\u0399", + Kappa: "\u039A", + Lambda: "\u039B", + Mu: "\u039C", + Nu: "\u039D", + Xi: "\u039E", + Omicron: "\u039F", + Pi: "\u03A0", + Rho: "\u03A1", + Sigma: "\u03A3", + Tau: "\u03A4", + Upsilon: "\u03A5", + Phi: "\u03A6", + Chi: "\u03A7", + Psi: "\u03A8", + Omega: "\u03A9", + alpha: "\u03B1", + beta: "\u03B2", + gamma: "\u03B3", + delta: "\u03B4", + epsilon: "\u03B5", + zeta: "\u03B6", + eta: "\u03B7", + theta: "\u03B8", + iota: "\u03B9", + kappa: "\u03BA", + lambda: "\u03BB", + mu: "\u03BC", + nu: "\u03BD", + xi: "\u03BE", + omicron: "\u03BF", + pi: "\u03C0", + rho: "\u03C1", + sigmaf: "\u03C2", + sigma: "\u03C3", + tau: "\u03C4", + upsilon: "\u03C5", + phi: "\u03C6", + chi: "\u03C7", + psi: "\u03C8", + omega: "\u03C9", + thetasym: "\u03D1", + upsih: "\u03D2", + piv: "\u03D6", + bull: "\u2022", + hellip: "\u2026", + prime: "\u2032", + Prime: "\u2033", + oline: "\u203E", + frasl: "\u2044", + weierp: "\u2118", + image: "\u2111", + real: "\u211C", + trade: "\u2122", + alefsym: "\u2135", + larr: "\u2190", + uarr: "\u2191", + rarr: "\u2192", + darr: "\u2193", + harr: "\u2194", + crarr: "\u21B5", + lArr: "\u21D0", + uArr: "\u21D1", + rArr: "\u21D2", + dArr: "\u21D3", + hArr: "\u21D4", + forall: "\u2200", + part: "\u2202", + exist: "\u2203", + empty: "\u2205", + nabla: "\u2207", + isin: "\u2208", + notin: "\u2209", + ni: "\u220B", + prod: "\u220F", + sum: "\u2211", + minus: "\u2212", + lowast: "\u2217", + radic: "\u221A", + prop: "\u221D", + infin: "\u221E", + ang: "\u2220", + and: "\u2227", + or: "\u2228", + cap: "\u2229", + cup: "\u222A", + intXX: "\u222B", + there4: "\u2234", + sim: "\u223C", + cong: "\u2245", + asymp: "\u2248", + ne: "\u2260", + equiv: "\u2261", + le: "\u2264", + ge: "\u2265", + sub: "\u2282", + sup: "\u2283", + nsub: "\u2284", + sube: "\u2286", + supe: "\u2287", + oplus: "\u2295", + otimes: "\u2297", + perp: "\u22A5", + sdot: "\u22C5", + lceil: "\u2308", + rceil: "\u2309", + lfloor: "\u230A", + rfloor: "\u230B", + lang: "\u2329", + rang: "\u232A", + loz: "\u25CA", + spades: "\u2660", + clubs: "\u2663", + hearts: "\u2665", + diams: "\u2666", + quot: "\u0022", + amp: "\u0026", + lt: "\u003C", + gt: "\u003E", + OElig: "\u0152", + oelig: "\u0153", + Scaron: "\u0160", + scaron: "\u0161", + Yuml: "\u0178", + circ: "\u02C6", + tilde: "\u02DC", + ensp: "\u2002", + emsp: "\u2003", + thinsp: "\u2009", + zwnj: "\u200C", + zwj: "\u200D", + lrm: "\u200E", + rlm: "\u200F", + ndash: "\u2013", + mdash: "\u2014", + lsquo: "\u2018", + rsquo: "\u2019", + sbquo: "\u201A", + ldquo: "\u201C", + rdquo: "\u201D", + bdquo: "\u201E", + dagger: "\u2020", + Dagger: "\u2021", + permil: "\u2030", + lsaquo: "\u2039", + rsaquo: "\u203A", + euro: "\u20AC", + + // non-standard entities + apos: "'" +}; + +/** + * @author envjs team + */ + +EntityReference = function() { + throw new Error("EntityReference Not Implemented" ); +}; + +/** + * @class DOMImplementation - + * provides a number of methods for performing operations + * that are independent of any particular instance of the + * document object model. + * + * @author Jon van Noort (jon@webarcana.com.au) + */ +DOMImplementation = function() { + this.preserveWhiteSpace = false; // by default, ignore whitespace + this.namespaceAware = true; // by default, handle namespaces + this.errorChecking = true; // by default, test for exceptions +}; + +__extend__(DOMImplementation.prototype,{ + // @param feature : string - The package name of the feature to test. + // the legal only values are "XML" and "CORE" (case-insensitive). + // @param version : string - This is the version number of the package + // name to test. In Level 1, this is the string "1.0".* + // @return : boolean + hasFeature : function(feature, version) { + var ret = false; + if (feature.toLowerCase() == "xml") { + ret = (!version || (version == "1.0") || (version == "2.0")); + } + else if (feature.toLowerCase() == "core") { + ret = (!version || (version == "2.0")); + } + else if (feature == "http://www.w3.org/TR/SVG11/feature#BasicStructure") { + ret = (version == "1.1"); + } + return ret; + }, + createDocumentType : function(qname, publicId, systemId){ + var doctype = new DocumentType(); + doctype.nodeName = qname?qname.toUpperCase():null; + doctype.publicId = publicId?publicId:null; + doctype.systemId = systemId?systemId:null; + return doctype; + }, + createDocument : function(nsuri, qname, doctype){ + + var doc = null, documentElement; + + doc = new Document(this, null); + if(doctype){ + doc.doctype = doctype; + } + + if(nsuri && qname){ + documentElement = doc.createElementNS(nsuri, qname); + }else if(qname){ + documentElement = doc.createElement(qname); + } + if(documentElement){ + doc.appendChild(documentElement); + } + return doc; + }, + createHTMLDocument : function(title){ + var doc = new HTMLDocument($implementation, null, ""); + var html = doc.createElement("html"); doc.appendChild(html); + var head = doc.createElement("head"); html.appendChild(head); + var body = doc.createElement("body"); html.appendChild(body); + var t = doc.createElement("title"); head.appendChild(t); + if( title) { + t.appendChild(doc.createTextNode(title)); + } + return doc; + }, + translateErrCode : function(code) { + //convert DOMException Code to human readable error message; + var msg = ""; + + switch (code) { + case DOMException.INDEX_SIZE_ERR : // 1 + msg = "INDEX_SIZE_ERR: Index out of bounds"; + break; + + case DOMException.DOMSTRING_SIZE_ERR : // 2 + msg = "DOMSTRING_SIZE_ERR: The resulting string is too long to fit in a DOMString"; + break; + + case DOMException.HIERARCHY_REQUEST_ERR : // 3 + msg = "HIERARCHY_REQUEST_ERR: The Node can not be inserted at this location"; + break; + + case DOMException.WRONG_DOCUMENT_ERR : // 4 + msg = "WRONG_DOCUMENT_ERR: The source and the destination Documents are not the same"; + break; + + case DOMException.INVALID_CHARACTER_ERR : // 5 + msg = "INVALID_CHARACTER_ERR: The string contains an invalid character"; + break; + + case DOMException.NO_DATA_ALLOWED_ERR : // 6 + msg = "NO_DATA_ALLOWED_ERR: This Node / NodeList does not support data"; + break; + + case DOMException.NO_MODIFICATION_ALLOWED_ERR : // 7 + msg = "NO_MODIFICATION_ALLOWED_ERR: This object cannot be modified"; + break; + + case DOMException.NOT_FOUND_ERR : // 8 + msg = "NOT_FOUND_ERR: The item cannot be found"; + break; + + case DOMException.NOT_SUPPORTED_ERR : // 9 + msg = "NOT_SUPPORTED_ERR: This implementation does not support function"; + break; + + case DOMException.INUSE_ATTRIBUTE_ERR : // 10 + msg = "INUSE_ATTRIBUTE_ERR: The Attribute has already been assigned to another Element"; + break; + + // Introduced in DOM Level 2: + case DOMException.INVALID_STATE_ERR : // 11 + msg = "INVALID_STATE_ERR: The object is no longer usable"; + break; + + case DOMException.SYNTAX_ERR : // 12 + msg = "SYNTAX_ERR: Syntax error"; + break; + + case DOMException.INVALID_MODIFICATION_ERR : // 13 + msg = "INVALID_MODIFICATION_ERR: Cannot change the type of the object"; + break; + + case DOMException.NAMESPACE_ERR : // 14 + msg = "NAMESPACE_ERR: The namespace declaration is incorrect"; + break; + + case DOMException.INVALID_ACCESS_ERR : // 15 + msg = "INVALID_ACCESS_ERR: The object does not support this function"; + break; + + default : + msg = "UNKNOWN: Unknown Exception Code ("+ code +")"; + } + + return msg; + }, + toString : function(){ + return "[object DOMImplementation]"; + } +}); + + + +/** + * @method DOMImplementation._isNamespaceDeclaration - Return true, if attributeName is a namespace declaration + * @author Jon van Noort (jon@webarcana.com.au) + * @param attributeName : string - the attribute name + * @return : boolean + */ +function __isNamespaceDeclaration__(attributeName) { + // test if attributeName is 'xmlns' + return (attributeName.indexOf('xmlns') > -1); +} + +/** + * @method DOMImplementation._isIdDeclaration - Return true, if attributeName is an id declaration + * @author Jon van Noort (jon@webarcana.com.au) + * @param attributeName : string - the attribute name + * @return : boolean + */ +function __isIdDeclaration__(attributeName) { + // test if attributeName is 'id' (case insensitive) + return attributeName?(attributeName.toLowerCase() == 'id'):false; +} + +/** + * @method DOMImplementation._isValidName - Return true, + * if name contains no invalid characters + * @author Jon van Noort (jon@webarcana.com.au) + * @param name : string - the candidate name + * @return : boolean + */ +function __isValidName__(name) { + // test if name contains only valid characters + return name.match(re_validName); +} +var re_validName = /^[a-zA-Z_:][a-zA-Z0-9\.\-_:]*$/; + +/** + * @method DOMImplementation._isValidString - Return true, if string does not contain any illegal chars + * All of the characters 0 through 31 and character 127 are nonprinting control characters. + * With the exception of characters 09, 10, and 13, (Ox09, Ox0A, and Ox0D) + * Note: different from _isValidName in that ValidStrings may contain spaces + * @author Jon van Noort (jon@webarcana.com.au) + * @param name : string - the candidate string + * @return : boolean + */ +function __isValidString__(name) { + // test that string does not contains invalid characters + return (name.search(re_invalidStringChars) < 0); +} +var re_invalidStringChars = /\x01|\x02|\x03|\x04|\x05|\x06|\x07|\x08|\x0B|\x0C|\x0E|\x0F|\x10|\x11|\x12|\x13|\x14|\x15|\x16|\x17|\x18|\x19|\x1A|\x1B|\x1C|\x1D|\x1E|\x1F|\x7F/; + +/** + * @method DOMImplementation._parseNSName - parse the namespace name. + * if there is no colon, the + * @author Jon van Noort (jon@webarcana.com.au) + * @param qualifiedName : string - The qualified name + * @return : NSName - [ + .prefix : string - The prefix part of the qname + .namespaceName : string - The namespaceURI part of the qname + ] + */ +function __parseNSName__(qualifiedName) { + var resultNSName = {}; + // unless the qname has a namespaceName, the prefix is the entire String + resultNSName.prefix = qualifiedName; + resultNSName.namespaceName = ""; + // split on ':' + var delimPos = qualifiedName.indexOf(':'); + if (delimPos > -1) { + // get prefix + resultNSName.prefix = qualifiedName.substring(0, delimPos); + // get namespaceName + resultNSName.namespaceName = qualifiedName.substring(delimPos +1, qualifiedName.length); + } + return resultNSName; +} + +/** + * @method DOMImplementation._parseQName - parse the qualified name + * @author Jon van Noort (jon@webarcana.com.au) + * @param qualifiedName : string - The qualified name + * @return : QName + */ +function __parseQName__(qualifiedName) { + var resultQName = {}; + // unless the qname has a prefix, the local name is the entire String + resultQName.localName = qualifiedName; + resultQName.prefix = ""; + // split on ':' + var delimPos = qualifiedName.indexOf(':'); + if (delimPos > -1) { + // get prefix + resultQName.prefix = qualifiedName.substring(0, delimPos); + // get localName + resultQName.localName = qualifiedName.substring(delimPos +1, qualifiedName.length); + } + return resultQName; +} +/** + * @author envjs team + */ +Notation = function() { + throw new Error("Notation Not Implemented" ); +};/** + * @author thatcher + */ +Range = function(){ + +}; + +__extend__(Range.prototype, { + get startContainer(){ + + }, + get endContainer(){ + + }, + get startOffset(){ + + }, + get endOffset(){ + + }, + get collapsed(){ + + }, + get commonAncestorContainer(){ + + }, + setStart: function(refNode, offset){//throws RangeException + + }, + setEnd: function(refNode, offset){//throws RangeException + + }, + setStartBefore: function(refNode){//throws RangeException + + }, + setStartAfter: function(refNode){//throws RangeException + + }, + setEndBefore: function(refNode){//throws RangeException + + }, + setEndAfter: function(refNode){//throws RangeException + + }, + collapse: function(toStart){//throws RangeException + + }, + selectNode: function(refNode){//throws RangeException + + }, + selectNodeContents: function(refNode){//throws RangeException + + }, + compareBoundaryPoints: function(how, sourceRange){ + + }, + deleteContents: function(){ + + }, + extractContents: function(){ + + }, + cloneContents: function(){ + + }, + insertNode: function(newNode){ + + }, + surroundContents: function(newParent){ + + }, + cloneRange: function(){ + + }, + toString: function(){ + return '[object Range]'; + }, + detach: function(){ + + } +}); + + + // CompareHow +Range.START_TO_START = 0; +Range.START_TO_END = 1; +Range.END_TO_END = 2; +Range.END_TO_START = 3; + +/* + * Forward declarations + */ +var __isValidNamespace__; + +/** + * @class Document - The Document interface represents the entire HTML + * or XML document. Conceptually, it is the root of the document tree, + * and provides the primary access to the document's data. + * + * @extends Node + * @param implementation : DOMImplementation - the creator Implementation + */ +Document = function(implementation, docParentWindow) { + Node.apply(this, arguments); + + //TODO: Temporary!!! Cnage back to true!!! + this.async = true; + // The Document Type Declaration (see DocumentType) associated with this document + this.doctype = null; + // The DOMImplementation object that handles this document. + this.implementation = implementation; + + this.nodeName = "#document"; + // initially false, set to true by parser + this.parsing = false; + this.baseURI = 'about:blank'; + + this.ownerDocument = null; + + this.importing = false; +}; + +Document.prototype = new Node(); +__extend__(Document.prototype,{ + get localName(){ + return null; + }, + get textContent(){ + return null; + }, + get all(){ + return this.getElementsByTagName("*"); + }, + get documentElement(){ + var i, length = this.childNodes?this.childNodes.length:0; + for(i=0;i -1 ){ + valid = false; + } + + if ((valid) && (!isAttribute)) { + // if the namespaceURI is not null + if (!namespaceURI) { + valid = false; + } + } + + // if the qualifiedName has a prefix + if ((valid) && (qName.prefix === "")) { + valid = false; + } + } + + // if the qualifiedName has a prefix that is "xml" and the namespaceURI is + // different from "http://www.w3.org/XML/1998/namespace" [Namespaces]. + if ((valid) && (qName.prefix === "xml") && (namespaceURI !== "http://www.w3.org/XML/1998/namespace")) { + valid = false; + } + + return valid; +}; +/** + * + * This file only handles XML parser. + * It is extended by parser/domparser.js (and parser/htmlparser.js) + * + * This depends on e4x, which some engines may not have. + * + * @author thatcher + */ +DOMParser = function(principle, documentURI, baseURI) { + // TODO: why/what should these 3 args do? +}; +__extend__(DOMParser.prototype,{ + parseFromString: function(xmlstring, mimetype){ + var doc = new Document(new DOMImplementation()), + e4; + + // The following are e4x directives. + // Full spec is here: + // http://www.ecma-international.org/publications/standards/Ecma-357.htm + // + // that is pretty gross, so checkout this summary + // http://rephrase.net/days/07/06/e4x + // + // also see the Mozilla Developer Center: + // https://developer.mozilla.org/en/E4X + // + XML.ignoreComments = false; + XML.ignoreProcessingInstructions = false; + XML.ignoreWhitespace = false; + + // for some reason e4x can't handle initial xml declarations + // https://bugzilla.mozilla.org/show_bug.cgi?id=336551 + // The official workaround is the big regexp below + // but simpler one seems to be ok + // xmlstring = xmlstring.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); + // + xmlstring = xmlstring.replace(/<\?xml.*\?>/); + + e4 = new XMLList(xmlstring); + + __toDomNode__(e4, doc, doc); + + //console.log('xml \n %s', doc.documentElement.xml); + return doc; + } +}); + +var __toDomNode__ = function(e4, parent, doc){ + var xnode, + domnode, + children, + target, + value, + length, + element, + kind, + item; + //console.log('converting e4x node list \n %s', e4) + + // not using the for each(item in e4) since some engines can't + // handle the syntax (i.e. says syntax error) + // + // for each(xnode in e4) { + for (item in e4) { + // NO do not do this if (e4.hasOwnProperty(item)) { + // breaks spidermonkey + xnode = e4[item]; + + kind = xnode.nodeKind(); + //console.log('treating node kind %s', kind); + switch(kind){ + case 'element': + // add node + //console.log('creating element %s %s', xnode.localName(), xnode.namespace()); + if(xnode.namespace() && (xnode.namespace()+'') !== ''){ + //console.log('createElementNS %s %s',xnode.namespace()+'', xnode.localName() ); + domnode = doc.createElementNS(xnode.namespace()+'', xnode.localName()); + }else{ + domnode = doc.createElement(xnode.name()+''); + } + parent.appendChild(domnode); + + // add attributes + __toDomNode__(xnode.attributes(), domnode, doc); + + // add children + children = xnode.children(); + length = children.length(); + //console.log('recursing? %s', length ? 'yes' : 'no'); + if (length > 0) { + __toDomNode__(children, domnode, doc); + } + break; + case 'attribute': + // console.log('setting attribute %s %s %s', + // xnode.localName(), xnode.namespace(), xnode.valueOf()); + + // + // cross-platform alert. The original code used + // xnode.text() to get the attribute value + // This worked in Rhino, but did not in Spidermonkey + // valueOf seemed to work in both + // + if(xnode.namespace() && xnode.namespace().prefix){ + //console.log("%s", xnode.namespace().prefix); + parent.setAttributeNS(xnode.namespace()+'', + xnode.namespace().prefix+':'+xnode.localName(), + xnode.valueOf()); + }else if((xnode.name()+'').match('http://www.w3.org/2000/xmlns/::')){ + if(xnode.localName()!=='xmlns'){ + parent.setAttributeNS('http://www.w3.org/2000/xmlns/', + 'xmlns:'+xnode.localName(), + xnode.valueOf()); + } + }else{ + parent.setAttribute(xnode.localName()+'', xnode.valueOf()); + } + break; + case 'text': + //console.log('creating text node : %s', xnode); + domnode = doc.createTextNode(xnode+''); + parent.appendChild(domnode); + break; + case 'comment': + //console.log('creating comment node : %s', xnode); + value = xnode+''; + domnode = doc.createComment(value.substring(4,value.length-3)); + parent.appendChild(domnode); + break; + case 'processing-instruction': + //console.log('creating processing-instruction node : %s', xnode); + value = xnode+''; + target = value.split(' ')[0].substring(2); + value = value.split(' ').splice(1).join(' ').replace('?>',''); + //console.log('creating processing-instruction data : %s', value); + domnode = doc.createProcessingInstruction(target, value); + parent.appendChild(domnode); + break; + default: + console.log('e4x DOM ERROR'); + throw new Error("Assertion failed in xml parser"); + } + } +}; +/** + * @author envjs team + * @class XMLSerializer + */ + +XMLSerializer = function() {}; + +__extend__(XMLSerializer.prototype, { + serializeToString: function(node){ + return node.xml; + }, + toString : function(){ + return "[object XMLSerializer]"; + } +}); + +/** + * @author john resig & the envjs team + * @uri http://www.envjs.com/ + * @copyright 2008-2010 + * @license MIT + */ +//CLOSURE_END +}()); +/* + * Envjs event.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + * + * This file simply provides the global definitions we need to + * be able to correctly implement to core browser DOM Event interfaces. + */ +var Event, + MouseEvent, + UIEvent, + KeyboardEvent, + MutationEvent, + DocumentEvent, + EventTarget, + EventException, + //nonstandard but very useful for implementing mutation events + //among other things like general profiling + Aspect; +/* + * Envjs event.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + + +/** + * @author john resig + */ +// Helper method for extending one object with another. +function __extend__(a,b) { + for ( var i in b ) { + var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i); + if ( g || s ) { + if ( g ) { a.__defineGetter__(i, g); } + if ( s ) { a.__defineSetter__(i, s); } + } else { + a[i] = b[i]; + } + } return a; +} + +/** + * @author john resig + */ +//from jQuery +function __setArray__( target, array ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + target.length = 0; + Array.prototype.push.apply( target, array ); +} +/** + * Borrowed with love from: + * + * jQuery AOP - jQuery plugin to add features of aspect-oriented programming (AOP) to jQuery. + * http://jquery-aop.googlecode.com/ + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * + * Version: 1.1 + */ +(function() { + + var _after = 1; + var _before = 2; + var _around = 3; + var _intro = 4; + var _regexEnabled = true; + + /** + * Private weaving function. + */ + var weaveOne = function(source, method, advice) { + + var old = source[method]; + + var aspect; + if (advice.type == _after) + aspect = function() { + var returnValue = old.apply(this, arguments); + return advice.value.apply(this, [returnValue, method]); + }; + else if (advice.type == _before) + aspect = function() { + advice.value.apply(this, [arguments, method]); + return old.apply(this, arguments); + }; + else if (advice.type == _intro) + aspect = function() { + return advice.value.apply(this, arguments); + }; + else if (advice.type == _around) { + aspect = function() { + var invocation = { object: this, args: arguments }; + return advice.value.apply(invocation.object, [{ arguments: invocation.args, method: method, proceed : + function() { + return old.apply(invocation.object, invocation.args); + } + }] ); + }; + } + + aspect.unweave = function() { + source[method] = old; + pointcut = source = aspect = old = null; + }; + + source[method] = aspect; + + return aspect; + + }; + + + /** + * Private weaver and pointcut parser. + */ + var weave = function(pointcut, advice) + { + + var source = (typeof(pointcut.target.prototype) != 'undefined') ? pointcut.target.prototype : pointcut.target; + var advices = []; + + // If it's not an introduction and no method was found, try with regex... + if (advice.type != _intro && typeof(source[pointcut.method]) == 'undefined') + { + + for (var method in source) + { + if (source[method] != null && source[method] instanceof Function && method.match(pointcut.method)) + { + advices[advices.length] = weaveOne(source, method, advice); + } + } + + if (advices.length == 0) + throw 'No method: ' + pointcut.method; + + } + else + { + // Return as an array of one element + advices[0] = weaveOne(source, pointcut.method, advice); + } + + return _regexEnabled ? advices : advices[0]; + + }; + + Aspect = + { + /** + * Creates an advice after the defined point-cut. The advice will be executed after the point-cut method + * has completed execution successfully, and will receive one parameter with the result of the execution. + * This function returns an array of weaved aspects (Function). + * + * @example jQuery.aop.after( {target: window, method: 'MyGlobalMethod'}, function(result) { alert('Returned: ' + result); } ); + * @result Array + * + * @example jQuery.aop.after( {target: String, method: 'indexOf'}, function(index) { alert('Result found at: ' + index + ' on:' + this); } ); + * @result Array + * + * @name after + * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved. + * @option Object target Target object to be weaved. + * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects. + * @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter + * with the result of the point-cut's execution. + * + * @type Array + * @cat Plugins/General + */ + after : function(pointcut, advice) + { + return weave( pointcut, { type: _after, value: advice } ); + }, + + /** + * Creates an advice before the defined point-cut. The advice will be executed before the point-cut method + * but cannot modify the behavior of the method, or prevent its execution. + * This function returns an array of weaved aspects (Function). + * + * @example jQuery.aop.before( {target: window, method: 'MyGlobalMethod'}, function() { alert('About to execute MyGlobalMethod'); } ); + * @result Array + * + * @example jQuery.aop.before( {target: String, method: 'indexOf'}, function(index) { alert('About to execute String.indexOf on: ' + this); } ); + * @result Array + * + * @name before + * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved. + * @option Object target Target object to be weaved. + * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects. + * @param Function advice Function containing the code that will get called before the execution of the point-cut. + * + * @type Array + * @cat Plugins/General + */ + before : function(pointcut, advice) + { + return weave( pointcut, { type: _before, value: advice } ); + }, + + + /** + * Creates an advice 'around' the defined point-cut. This type of advice can control the point-cut method execution by calling + * the functions '.proceed()' on the 'invocation' object, and also, can modify the arguments collection before sending them to the function call. + * This function returns an array of weaved aspects (Function). + * + * @example jQuery.aop.around( {target: window, method: 'MyGlobalMethod'}, function(invocation) { + * alert('# of Arguments: ' + invocation.arguments.length); + * return invocation.proceed(); + * } ); + * @result Array + * + * @example jQuery.aop.around( {target: String, method: 'indexOf'}, function(invocation) { + * alert('Searching: ' + invocation.arguments[0] + ' on: ' + this); + * return invocation.proceed(); + * } ); + * @result Array + * + * @example jQuery.aop.around( {target: window, method: /Get(\d+)/}, function(invocation) { + * alert('Executing ' + invocation.method); + * return invocation.proceed(); + * } ); + * @desc Matches all global methods starting with 'Get' and followed by a number. + * @result Array + * + * + * @name around + * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved. + * @option Object target Target object to be weaved. + * @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects. + * @param Function advice Function containing the code that will get called around the execution of the point-cut. This advice will be called with one + * argument containing one function '.proceed()', the collection of arguments '.arguments', and the matched method name '.method'. + * + * @type Array + * @cat Plugins/General + */ + around : function(pointcut, advice) + { + return weave( pointcut, { type: _around, value: advice } ); + }, + + /** + * Creates an introduction on the defined point-cut. This type of advice replaces any existing methods with the same + * name. To restore them, just unweave it. + * This function returns an array with only one weaved aspect (Function). + * + * @example jQuery.aop.introduction( {target: window, method: 'MyGlobalMethod'}, function(result) { alert('Returned: ' + result); } ); + * @result Array + * + * @example jQuery.aop.introduction( {target: String, method: 'log'}, function() { alert('Console: ' + this); } ); + * @result Array + * + * @name introduction + * @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved. + * @option Object target Target object to be weaved. + * @option String method Name of the function to be weaved. + * @param Function advice Function containing the code that will be executed on the point-cut. + * + * @type Array + * @cat Plugins/General + */ + introduction : function(pointcut, advice) + { + return weave( pointcut, { type: _intro, value: advice } ); + }, + + /** + * Configures global options. + * + * @name setup + * @param Map settings Configuration options. + * @option Boolean regexMatch Enables/disables regex matching of method names. + * + * @example jQuery.aop.setup( { regexMatch: false } ); + * @desc Disable regex matching. + * + * @type Void + * @cat Plugins/General + */ + setup: function(settings) + { + _regexEnabled = settings.regexMatch; + } + }; + +})(); + + + + +/** + * @name EventTarget + * @w3c:domlevel 2 + * @uri -//TODO: paste dom event level 2 w3c spc uri here + */ +EventTarget = function(){}; +EventTarget.prototype.addEventListener = function(type, fn, phase){ + __addEventListener__(this, type, fn, phase); +}; +EventTarget.prototype.removeEventListener = function(type, fn){ + __removeEventListener__(this, type, fn); +}; +EventTarget.prototype.dispatchEvent = function(event, bubbles){ + __dispatchEvent__(this, event, bubbles); +}; + +__extend__(Node.prototype, EventTarget.prototype); + + +var $events = [{}]; + +function __addEventListener__(target, type, fn, phase){ + phase = !!phase?"CAPTURING":"BUBBLING"; + if ( !target.uuid ) { + //console.log('event uuid %s %s', target, target.uuid); + target.uuid = $events.length+''; + } + if ( !$events[target.uuid] ) { + //console.log('creating listener for target: %s %s', target, target.uuid); + $events[target.uuid] = {}; + } + if ( !$events[target.uuid][type] ){ + //console.log('creating listener for type: %s %s %s', target, target.uuid, type); + $events[target.uuid][type] = { + CAPTURING:[], + BUBBLING:[] + }; + } + if ( $events[target.uuid][type][phase].indexOf( fn ) < 0 ){ + //console.log('adding event listener %s %s %s %s %s %s', target, target.uuid, type, phase, + // $events[target.uuid][type][phase].length, $events[target.uuid][type][phase].indexOf( fn )); + //console.log('creating listener for function: %s %s %s', target, target.uuid, phase); + $events[target.uuid][type][phase].push( fn ); + //console.log('adding event listener %s %s %s %s %s %s', target, target.uuid, type, phase, + // $events[target.uuid][type][phase].length, $events[target.uuid][type][phase].indexOf( fn )); + } + //console.log('registered event listeners %s', $events.length); +} + +function __removeEventListener__(target, type, fn, phase){ + + phase = !!phase?"CAPTURING":"BUBBLING"; + if ( !target.uuid ) { + return; + } + if ( !$events[target.uuid] ) { + return; + } + if(type == '*'){ + //used to clean all event listeners for a given node + //console.log('cleaning all event listeners for node %s %s',target, target.uuid); + delete $events[target.uuid]; + return; + }else if ( !$events[target.uuid][type] ){ + return; + } + $events[target.uuid][type][phase] = + $events[target.uuid][type][phase].filter(function(f){ + //console.log('removing event listener %s %s %s %s', target, type, phase, fn); + return f != fn; + }); +} + +var __eventuuid__ = 0; +function __dispatchEvent__(target, event, bubbles){ + + if (!event.uuid) { + event.uuid = __eventuuid__++; + } + //the window scope defines the $event object, for IE(^^^) compatibility; + //$event = event; + //console.log('dispatching event %s', event.uuid); + if (bubbles === undefined || bubbles === null) { + bubbles = true; + } + + if (!event.target) { + event.target = target; + } + + //console.log('dispatching? %s %s %s', target, event.type, bubbles); + if ( event.type && (target.nodeType || target === window )) { + + //console.log('dispatching event %s %s %s', target, event.type, bubbles); + __captureEvent__(target, event); + + event.eventPhase = Event.AT_TARGET; + if ( target.uuid && $events[target.uuid] && $events[target.uuid][event.type] ) { + event.currentTarget = target; + //console.log('dispatching %s %s %s %s', target, event.type, + // $events[target.uuid][event.type]['CAPTURING'].length); + $events[target.uuid][event.type].CAPTURING.forEach(function(fn){ + //console.log('AT_TARGET (CAPTURING) event %s', fn); + var returnValue = fn( event ); + //console.log('AT_TARGET (CAPTURING) return value %s', returnValue); + if(returnValue === false){ + event.stopPropagation(); + } + }); + //console.log('dispatching %s %s %s %s', target, event.type, + // $events[target.uuid][event.type]['BUBBLING'].length); + $events[target.uuid][event.type].BUBBLING.forEach(function(fn){ + //console.log('AT_TARGET (BUBBLING) event %s', fn); + var returnValue = fn( event ); + //console.log('AT_TARGET (BUBBLING) return value %s', returnValue); + if(returnValue === false){ + event.stopPropagation(); + } + }); + } + if (target["on" + event.type]) { + target["on" + event.type](event); + } + if (bubbles && !event.cancelled){ + __bubbleEvent__(target, event); + } + if(!event._preventDefault){ + //At this point I'm guessing that just HTMLEvents are concerned + //with default behavior being executed in a browser but I could be + //wrong as usual. The goal is much more to filter at this point + //what events have no need to be handled + //console.log('triggering default behavior for %s', event.type); + if(event.type in Envjs.defaultEventBehaviors){ + Envjs.defaultEventBehaviors[event.type](event); + } + } + //console.log('deleting event %s', event.uuid); + event.target = null; + event = null; + }else{ + throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR); + } +} + +function __captureEvent__(target, event){ + var ancestorStack = [], + parent = target.parentNode; + + event.eventPhase = Event.CAPTURING_PHASE; + while(parent){ + if(parent.uuid && $events[parent.uuid] && $events[parent.uuid][event.type]){ + ancestorStack.push(parent); + } + parent = parent.parentNode; + } + while(ancestorStack.length && !event.cancelled){ + event.currentTarget = ancestorStack.pop(); + if($events[event.currentTarget.uuid] && $events[event.currentTarget.uuid][event.type]){ + $events[event.currentTarget.uuid][event.type].CAPTURING.forEach(function(fn){ + var returnValue = fn( event ); + if(returnValue === false){ + event.stopPropagation(); + } + }); + } + } +} + +function __bubbleEvent__(target, event){ + var parent = target.parentNode; + event.eventPhase = Event.BUBBLING_PHASE; + while(parent){ + if(parent.uuid && $events[parent.uuid] && $events[parent.uuid][event.type] ){ + event.currentTarget = parent; + $events[event.currentTarget.uuid][event.type].BUBBLING.forEach(function(fn){ + var returnValue = fn( event ); + if(returnValue === false){ + event.stopPropagation(); + } + }); + } + parent = parent.parentNode; + } +} + +/** + * @class Event + */ +Event = function(options){ + // event state is kept read-only by forcing + // a new object for each event. This may not + // be appropriate in the long run and we'll + // have to decide if we simply dont adhere to + // the read-only restriction of the specification + this._bubbles = true; + this._cancelable = true; + this._cancelled = false; + this._currentTarget = null; + this._target = null; + this._eventPhase = Event.AT_TARGET; + this._timeStamp = new Date().getTime(); + this._preventDefault = false; + this._stopPropogation = false; +}; + +__extend__(Event.prototype,{ + get bubbles(){return this._bubbles;}, + get cancelable(){return this._cancelable;}, + get currentTarget(){return this._currentTarget;}, + set currentTarget(currentTarget){ this._currentTarget = currentTarget; }, + get eventPhase(){return this._eventPhase;}, + set eventPhase(eventPhase){this._eventPhase = eventPhase;}, + get target(){return this._target;}, + set target(target){ this._target = target;}, + get timeStamp(){return this._timeStamp;}, + get type(){return this._type;}, + initEvent: function(type, bubbles, cancelable){ + this._type=type?type:''; + this._bubbles=!!bubbles; + this._cancelable=!!cancelable; + }, + preventDefault: function(){ + this._preventDefault = true; + }, + stopPropagation: function(){ + if(this._cancelable){ + this._cancelled = true; + this._bubbles = false; + } + }, + get cancelled(){ + return this._cancelled; + }, + toString: function(){ + return '[object Event]'; + } +}); + +__extend__(Event,{ + CAPTURING_PHASE : 1, + AT_TARGET : 2, + BUBBLING_PHASE : 3 +}); + + + +/** + * @name UIEvent + * @param {Object} options + */ +UIEvent = function(options) { + this._view = null; + this._detail = 0; +}; + +UIEvent.prototype = new Event(); +__extend__(UIEvent.prototype,{ + get view(){ + return this._view; + }, + get detail(){ + return this._detail; + }, + initUIEvent: function(type, bubbles, cancelable, windowObject, detail){ + this.initEvent(type, bubbles, cancelable); + this._detail = 0; + this._view = windowObject; + } +}); + +var $onblur, + $onfocus, + $onresize; + + +/** + * @name MouseEvent + * @w3c:domlevel 2 + * @uri http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html + */ +MouseEvent = function(options) { + this._screenX= 0; + this._screenY= 0; + this._clientX= 0; + this._clientY= 0; + this._ctrlKey= false; + this._metaKey= false; + this._altKey= false; + this._button= null; + this._relatedTarget= null; +}; +MouseEvent.prototype = new UIEvent(); +__extend__(MouseEvent.prototype,{ + get screenX(){ + return this._screenX; + }, + get screenY(){ + return this._screenY; + }, + get clientX(){ + return this._clientX; + }, + get clientY(){ + return this._clientY; + }, + get ctrlKey(){ + return this._ctrlKey; + }, + get altKey(){ + return this._altKey; + }, + get shiftKey(){ + return this._shiftKey; + }, + get metaKey(){ + return this._metaKey; + }, + get button(){ + return this._button; + }, + get relatedTarget(){ + return this._relatedTarget; + }, + initMouseEvent: function(type, bubbles, cancelable, windowObject, detail, + screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, + metaKey, button, relatedTarget){ + this.initUIEvent(type, bubbles, cancelable, windowObject, detail); + this._screenX = screenX; + this._screenY = screenY; + this._clientX = clientX; + this._clientY = clientY; + this._ctrlKey = ctrlKey; + this._altKey = altKey; + this._shiftKey = shiftKey; + this._metaKey = metaKey; + this._button = button; + this._relatedTarget = relatedTarget; + } +}); + +/** + * Interface KeyboardEvent (introduced in DOM Level 3) + */ +KeyboardEvent = function(options) { + this._keyIdentifier = 0; + this._keyLocation = 0; + this._ctrlKey = false; + this._metaKey = false; + this._altKey = false; + this._metaKey = false; +}; +KeyboardEvent.prototype = new UIEvent(); + +__extend__(KeyboardEvent.prototype,{ + + get ctrlKey(){ + return this._ctrlKey; + }, + get altKey(){ + return this._altKey; + }, + get shiftKey(){ + return this._shiftKey; + }, + get metaKey(){ + return this._metaKey; + }, + get button(){ + return this._button; + }, + get relatedTarget(){ + return this._relatedTarget; + }, + getModifiersState: function(keyIdentifier){ + + }, + initMouseEvent: function(type, bubbles, cancelable, windowObject, + keyIdentifier, keyLocation, modifiersList, repeat){ + this.initUIEvent(type, bubbles, cancelable, windowObject, 0); + this._keyIdentifier = keyIdentifier; + this._keyLocation = keyLocation; + this._modifiersList = modifiersList; + this._repeat = repeat; + } +}); + +KeyboardEvent.DOM_KEY_LOCATION_STANDARD = 0; +KeyboardEvent.DOM_KEY_LOCATION_LEFT = 1; +KeyboardEvent.DOM_KEY_LOCATION_RIGHT = 2; +KeyboardEvent.DOM_KEY_LOCATION_NUMPAD = 3; +KeyboardEvent.DOM_KEY_LOCATION_MOBILE = 4; +KeyboardEvent.DOM_KEY_LOCATION_JOYSTICK = 5; + + + +//We dont fire mutation events until someone has registered for them +var __supportedMutations__ = /DOMSubtreeModified|DOMNodeInserted|DOMNodeRemoved|DOMAttrModified|DOMCharacterDataModified/; + +var __fireMutationEvents__ = Aspect.before({ + target: EventTarget, + method: 'addEventListener' +}, function(target, type){ + if(type && type.match(__supportedMutations__)){ + //unweaving removes the __addEventListener__ aspect + __fireMutationEvents__.unweave(); + // These two methods are enough to cover all dom 2 manipulations + Aspect.around({ + target: Node, + method:"removeChild" + }, function(invocation){ + var event, + node = invocation.arguments[0]; + event = node.ownerDocument.createEvent('MutationEvents'); + event.initEvent('DOMNodeRemoved', true, false, node.parentNode, null, null, null, null); + node.dispatchEvent(event, false); + return invocation.proceed(); + + }); + Aspect.around({ + target: Node, + method:"appendChild" + }, function(invocation) { + var event, + node = invocation.proceed(); + event = node.ownerDocument.createEvent('MutationEvents'); + event.initEvent('DOMNodeInserted', true, false, node.parentNode, null, null, null, null); + node.dispatchEvent(event, false); + return node; + }); + } +}); + +/** + * @name MutationEvent + * @param {Object} options + */ +MutationEvent = function(options) { + this._cancelable = false; + this._timeStamp = 0; +}; + +MutationEvent.prototype = new Event(); +__extend__(MutationEvent.prototype,{ + get relatedNode(){ + return this._relatedNode; + }, + get prevValue(){ + return this._prevValue; + }, + get newValue(){ + return this._newValue; + }, + get attrName(){ + return this._attrName; + }, + get attrChange(){ + return this._attrChange; + }, + initMutationEvent: function( type, bubbles, cancelable, + relatedNode, prevValue, newValue, attrName, attrChange ){ + this._relatedNode = relatedNode; + this._prevValue = prevValue; + this._newValue = newValue; + this._attrName = attrName; + this._attrChange = attrChange; + switch(type){ + case "DOMSubtreeModified": + this.initEvent(type, true, false); + break; + case "DOMNodeInserted": + this.initEvent(type, true, false); + break; + case "DOMNodeRemoved": + this.initEvent(type, true, false); + break; + case "DOMNodeRemovedFromDocument": + this.initEvent(type, false, false); + break; + case "DOMNodeInsertedIntoDocument": + this.initEvent(type, false, false); + break; + case "DOMAttrModified": + this.initEvent(type, true, false); + break; + case "DOMCharacterDataModified": + this.initEvent(type, true, false); + break; + default: + this.initEvent(type, bubbles, cancelable); + } + } +}); + +// constants +MutationEvent.ADDITION = 0; +MutationEvent.MODIFICATION = 1; +MutationEvent.REMOVAL = 2; + + +/** + * @name EventException + */ +EventException = function(code) { + this.code = code; +}; +EventException.UNSPECIFIED_EVENT_TYPE_ERR = 0; +/** + * + * DOM Level 2: http://www.w3.org/TR/DOM-Level-2-Events/events.html + * DOM Level 3: http://www.w3.org/TR/DOM-Level-3-Events/ + * + * interface DocumentEvent { + * Event createEvent (in DOMString eventType) + * raises (DOMException); + * }; + * + * Firefox (3.6) exposes DocumentEvent + * Safari (4) does NOT. + */ + +/** + * TODO: Not sure we need a full prototype. We not just an regular object? + */ +DocumentEvent = function(){}; +DocumentEvent.prototype.__EventMap__ = { + // Safari4: singular and plural forms accepted + // Firefox3.6: singular and plural forms accepted + 'Event' : Event, + 'Events' : Event, + 'UIEvent' : UIEvent, + 'UIEvents' : UIEvent, + 'MouseEvent' : MouseEvent, + 'MouseEvents' : MouseEvent, + 'MutationEvent' : MutationEvent, + 'MutationEvents' : MutationEvent, + + // Safari4: accepts HTMLEvents, but not HTMLEvent + // Firefox3.6: accepts HTMLEvents, but not HTMLEvent + 'HTMLEvent' : Event, + 'HTMLEvents' : Event, + + // Safari4: both not accepted + // Firefox3.6, only KeyEvents is accepted + 'KeyEvent' : KeyboardEvent, + 'KeyEvents' : KeyboardEvent, + + // Safari4: both accepted + // Firefox3.6: none accepted + 'KeyboardEvent' : KeyboardEvent, + 'KeyboardEvents' : KeyboardEvent +}; + +DocumentEvent.prototype.createEvent = function(eventType) { + var Clazz = this.__EventMap__[eventType]; + if (Clazz) { + return new Clazz(); + } + throw(new DOMException(DOMException.NOT_SUPPORTED_ERR)); +}; + +__extend__(Document.prototype, DocumentEvent.prototype); + +/** + * @author john resig & the envjs team + * @uri http://www.envjs.com/ + * @copyright 2008-2010 + * @license MIT + */ +//CLOSURE_END +}()); + +/* + * Envjs timer.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + * + * Parts of the implementation were originally written by:\ + * Steven Parkes + * + * requires Envjs.wait, Envjs.sleep, Envjs.WAIT_INTERVAL + */ +var setTimeout, + clearTimeout, + setInterval, + clearInterval; + +/* + * Envjs timer.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + +/* +* timer.js +* implementation provided by Steven Parkes +*/ + +//private +var $timers = [], + EVENT_LOOP_RUNNING = false; + +$timers.lock = function(fn){ + Envjs.sync(fn)(); +}; + +//private internal class +var Timer = function(fn, interval){ + this.fn = fn; + this.interval = interval; + this.at = Date.now() + interval; + // allows for calling wait() from callbacks + this.running = false; +}; + +Timer.prototype.start = function(){}; +Timer.prototype.stop = function(){}; + +//static +Timer.normalize = function(time) { + time = time*1; + if ( isNaN(time) || time < 0 ) { + time = 0; + } + + if ( EVENT_LOOP_RUNNING && time < Timer.MIN_TIME ) { + time = Timer.MIN_TIME; + } + return time; +}; +// html5 says this should be at least 4, but the parser is using +// a setTimeout for the SAX stuff which messes up the world +Timer.MIN_TIME = /* 4 */ 0; + +/** + * @function setTimeout + * @param {Object} fn + * @param {Object} time + */ +setTimeout = function(fn, time){ + var num; + time = Timer.normalize(time); + $timers.lock(function(){ + num = $timers.length+1; + var tfn; + if (typeof fn == 'string') { + tfn = function() { + try { + // eval in global scope + eval(fn, null); + } catch (e) { + console.log('timer error %s %s', fn, e); + } finally { + clearInterval(num); + } + }; + } else { + tfn = function() { + try { + fn(); + } catch (e) { + console.log('timer error %s %s', fn, e); + } finally { + clearInterval(num); + } + }; + } + //console.log("Creating timer number %s", num); + $timers[num] = new Timer(tfn, time); + $timers[num].start(); + }); + return num; +}; + +/** + * @function setInterval + * @param {Object} fn + * @param {Object} time + */ +setInterval = function(fn, time){ + //console.log('setting interval %s %s', time, fn.toString().substring(0,64)); + time = Timer.normalize(time); + if ( time < 10 ) { + time = 10; + } + if (typeof fn == 'string') { + var fnstr = fn; + fn = function() { + eval(fnstr); + }; + } + var num; + $timers.lock(function(){ + num = $timers.length+1; + //Envjs.debug("Creating timer number "+num); + $timers[num] = new Timer(fn, time); + $timers[num].start(); + }); + return num; +}; + +/** + * clearInterval + * @param {Object} num + */ +clearInterval = clearTimeout = function(num){ + //console.log("clearing interval "+num); + $timers.lock(function(){ + if ( $timers[num] ) { + $timers[num].stop(); + delete $timers[num]; + } + }); +}; + +// wait === null/undefined: execute any timers as they fire, +// waiting until there are none left +// wait(n) (n > 0): execute any timers as they fire until there +// are none left waiting at least n ms but no more, even if there +// are future events/current threads +// wait(0): execute any immediately runnable timers and return +// wait(-n): keep sleeping until the next event is more than n ms +// in the future +// +// TODO: make a priority queue ... + +Envjs.wait = function(wait) { + //console.log('wait %s', wait); + var delta_wait, + start = Date.now(), + was_running = EVENT_LOOP_RUNNING; + + if (wait < 0) { + delta_wait = -wait; + wait = 0; + } + EVENT_LOOP_RUNNING = true; + if (wait !== 0 && wait !== null && wait !== undefined){ + wait += Date.now(); + } + + var earliest, + timer, + sleep, + index, + goal, + now, + nextfn; + + for (;;) { + //console.log('timer loop'); + earliest = sleep = goal = now = nextfn = null; + $timers.lock(function(){ + for(index in $timers){ + if( isNaN(index*0) ) { + continue; + } + timer = $timers[index]; + // determine timer with smallest run-at time that is + // not already running + if( !timer.running && ( !earliest || timer.at < earliest.at) ) { + earliest = timer; + } + } + }); + //next sleep time + sleep = earliest && earliest.at - Date.now(); + if ( earliest && sleep <= 0 ) { + nextfn = earliest.fn; + try { + //console.log('running stack %s', nextfn.toString().substring(0,64)); + earliest.running = true; + nextfn(); + } catch (e) { + console.log('timer error %s %s', nextfn, e); + } finally { + earliest.running = false; + } + goal = earliest.at + earliest.interval; + now = Date.now(); + if ( goal < now ) { + earliest.at = now; + } else { + earliest.at = goal; + } + continue; + } + + // bunch of subtle cases here ... + if ( !earliest ) { + // no events in the queue (but maybe XHR will bring in events, so ... + if ( !wait || wait < Date.now() ) { + // Loop ends if there are no events and a wait hasn't been + // requested or has expired + break; + } + // no events, but a wait requested: fall through to sleep + } else { + // there are events in the queue, but they aren't firable now + /*if ( delta_wait && sleep <= delta_wait ) { + //TODO: why waste a check on a tight + // loop if it just falls through? + // if they will happen within the next delta, fall through to sleep + } else */if ( wait === 0 || ( wait > 0 && wait < Date.now () ) ) { + // loop ends even if there are events but the user + // specifcally asked not to wait too long + break; + } + // there are events and the user wants to wait: fall through to sleep + } + + // Related to ajax threads ... hopefully can go away .. + var interval = Envjs.WAIT_INTERVAL || 100; + if ( !sleep || sleep > interval ) { + sleep = interval; + } + //console.log('sleeping %s', sleep); + Envjs.sleep(sleep); + + } + EVENT_LOOP_RUNNING = was_running; +}; + + +/** + * @author john resig & the envjs team + * @uri http://www.envjs.com/ + * @copyright 2008-2010 + * @license MIT + */ +//CLOSURE_END +}()); +/* + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + * + * This file simply provides the global definitions we need to + * be able to correctly implement to core browser DOM HTML interfaces. + */ +var HTMLDocument, + HTMLElement, + HTMLCollection, + HTMLAnchorElement, + HTMLAreaElement, + HTMLBaseElement, + HTMLQuoteElement, + HTMLBodyElement, + HTMLBRElement, + HTMLButtonElement, + HTMLCanvasElement, + HTMLTableColElement, + HTMLModElement, + HTMLDivElement, + HTMLDListElement, + HTMLFieldSetElement, + HTMLFormElement, + HTMLFrameElement, + HTMLFrameSetElement, + HTMLHeadElement, + HTMLHeadingElement, + HTMLHRElement, + HTMLHtmlElement, + HTMLIFrameElement, + HTMLImageElement, + HTMLInputElement, + HTMLLabelElement, + HTMLLegendElement, + HTMLLIElement, + HTMLLinkElement, + HTMLMapElement, + HTMLMetaElement, + HTMLObjectElement, + HTMLOListElement, + HTMLOptGroupElement, + HTMLOptionElement, + HTMLParagraphElement, + HTMLParamElement, + HTMLPreElement, + HTMLScriptElement, + HTMLSelectElement, + HTMLSpanElement, + HTMLStyleElement, + HTMLTableElement, + HTMLTableSectionElement, + HTMLTableCellElement, + HTMLTableDataCellElement, + HTMLTableHeaderCellElement, + HTMLTableRowElement, + HTMLTextAreaElement, + HTMLTitleElement, + HTMLUListElement, + HTMLUnknownElement, + Image, + Option, + __loadImage__, + __loadLink__; + +/* + * Envjs html.1.2.13 + * Pure JavaScript Browser Environment + * By John Resig and the Envjs Team + * Copyright 2008-2010 John Resig, under the MIT License + */ + +//CLOSURE_START +(function(){ + + + + + +/** + * @author ariel flesler + * http://flesler.blogspot.com/2008/11/fast-trim-function-for-javascript.html + * @param {Object} str + */ +function __trim__( str ){ + return (str || "").replace( /^\s+|\s+$/g, "" ); +} + + +/** + * @author john resig + */ +// Helper method for extending one object with another. +function __extend__(a,b) { + for ( var i in b ) { + var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i); + if ( g || s ) { + if ( g ) { a.__defineGetter__(i, g); } + if ( s ) { a.__defineSetter__(i, s); } + } else { + a[i] = b[i]; + } + } return a; +} + +/** + * @author john resig + */ +//from jQuery +function __setArray__( target, array ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + target.length = 0; + Array.prototype.push.apply( target, array ); +} + +/** + * @class HTMLDocument + * The Document interface represents the entire HTML or XML document. + * Conceptually, it is the root of the document tree, and provides + * the primary access to the document's data. + * + * @extends Document + */ +HTMLDocument = function(implementation, ownerWindow, referrer) { + Document.apply(this, arguments); + this.referrer = referrer || ''; + this.baseURI = "about:blank"; + this.ownerWindow = ownerWindow; +}; + +HTMLDocument.prototype = new Document(); + +__extend__(HTMLDocument.prototype, { + createElement: function(tagName){ + var node; + tagName = tagName.toUpperCase(); + // create Element specifying 'this' as ownerDocument + // This is an html document so we need to use explicit interfaces per the + //TODO: would be much faster as a big switch + switch(tagName){ + case "A": + node = new HTMLAnchorElement(this);break; + case "AREA": + node = new HTMLAreaElement(this);break; + case "BASE": + node = new HTMLBaseElement(this);break; + case "BLOCKQUOTE": + node = new HTMLQuoteElement(this);break; + case "CANVAS": + node = new HTMLCanvasElement(this);break; + case "Q": + node = new HTMLQuoteElement(this);break; + case "BODY": + node = new HTMLBodyElement(this);break; + case "BR": + node = new HTMLBRElement(this);break; + case "BUTTON": + node = new HTMLButtonElement(this);break; + case "CAPTION": + node = new HTMLElement(this);break; + case "COL": + node = new HTMLTableColElement(this);break; + case "COLGROUP": + node = new HTMLTableColElement(this);break; + case "DEL": + node = new HTMLModElement(this);break; + case "INS": + node = new HTMLModElement(this);break; + case "DIV": + node = new HTMLDivElement(this);break; + case "DL": + node = new HTMLDListElement(this);break; + case "DT": + node = new HTMLElement(this); break; + case "FIELDSET": + node = new HTMLFieldSetElement(this);break; + case "FORM": + node = new HTMLFormElement(this);break; + case "FRAME": + node = new HTMLFrameElement(this);break; + case "H1": + node = new HTMLHeadingElement(this);break; + case "H2": + node = new HTMLHeadingElement(this);break; + case "H3": + node = new HTMLHeadingElement(this);break; + case "H4": + node = new HTMLHeadingElement(this);break; + case "H5": + node = new HTMLHeadingElement(this);break; + case "H6": + node = new HTMLHeadingElement(this);break; + case "HEAD": + node = new HTMLHeadElement(this);break; + case "HR": + node = new HTMLHRElement(this);break; + case "HTML": + node = new HTMLHtmlElement(this);break; + case "IFRAME": + node = new HTMLIFrameElement(this);break; + case "IMG": + node = new HTMLImageElement(this);break; + case "INPUT": + node = new HTMLInputElement(this);break; + case "LABEL": + node = new HTMLLabelElement(this);break; + case "LEGEND": + node = new HTMLLegendElement(this);break; + case "LI": + node = new HTMLLIElement(this);break; + case "LINK": + node = new HTMLLinkElement(this);break; + case "MAP": + node = new HTMLMapElement(this);break; + case "META": + node = new HTMLMetaElement(this);break; + case "NOSCRIPT": + node = new HTMLElement(this);break; + case "OBJECT": + node = new HTMLObjectElement(this);break; + case "OPTGROUP": + node = new HTMLOptGroupElement(this);break; + case "OL": + node = new HTMLOListElement(this); break; + case "OPTION": + node = new HTMLOptionElement(this);break; + case "P": + node = new HTMLParagraphElement(this);break; + case "PARAM": + node = new HTMLParamElement(this);break; + case "PRE": + node = new HTMLPreElement(this);break; + case "SCRIPT": + node = new HTMLScriptElement(this);break; + case "SELECT": + node = new HTMLSelectElement(this);break; + case "SMALL": + node = new HTMLElement(this);break; + case "SPAN": + node = new HTMLSpanElement(this);break; + case "STRONG": + node = new HTMLElement(this);break; + case "STYLE": + node = new HTMLStyleElement(this);break; + case "TABLE": + node = new HTMLTableElement(this);break; + case "TBODY": + node = new HTMLTableSectionElement(this);break; + case "TFOOT": + node = new HTMLTableSectionElement(this);break; + case "THEAD": + node = new HTMLTableSectionElement(this);break; + case "TD": + node = new HTMLTableDataCellElement(this);break; + case "TH": + node = new HTMLTableHeaderCellElement(this);break; + case "TEXTAREA": + node = new HTMLTextAreaElement(this);break; + case "TITLE": + node = new HTMLTitleElement(this);break; + case "TR": + node = new HTMLTableRowElement(this);break; + case "UL": + node = new HTMLUListElement(this);break; + default: + node = new HTMLUnknownElement(this); + } + // assign values to properties (and aliases) + node.nodeName = tagName; + return node; + }, + createElementNS : function (uri, local) { + //print('createElementNS :'+uri+" "+local); + if(!uri){ + return this.createElement(local); + }else if ("http://www.w3.org/1999/xhtml" == uri) { + return this.createElement(local); + } else if ("http://www.w3.org/1998/Math/MathML" == uri) { + return this.createElement(local); + } else { + return Document.prototype.createElementNS.apply(this,[uri, local]); + } + }, + get anchors(){ + return new HTMLCollection(this.getElementsByTagName('a')); + }, + get applets(){ + return new HTMLCollection(this.getElementsByTagName('applet')); + }, + get documentElement(){ + var html = Document.prototype.__lookupGetter__('documentElement').apply(this,[]); + if( html === null){ + html = this.createElement('html'); + this.appendChild(html); + html.appendChild(this.createElement('head')); + html.appendChild(this.createElement('body')); + } + return html; + }, + //document.head is non-standard + get head(){ + //console.log('get head'); + if (!this.documentElement) { + this.appendChild(this.createElement('html')); + } + var element = this.documentElement, + length = element.childNodes.length, + i; + //check for the presence of the head element in this html doc + for(i=0;i1?matches[1]:""; + }, + set domain(value){ + var i, + domainParts = this.domain.split('.').reverse(), + newDomainParts = value.split('.').reverse(); + if(newDomainParts.length > 1){ + for(i=0;i 0){ + event = doc.createEvent('HTMLEvents'); + event.initEvent( okay ? "load" : "error", false, false ); + node.dispatchEvent( event, false ); + } + }catch(e){ + console.log('error loading html element %s %e', node, e.toString()); + } + } + break; + case 'frame': + case 'iframe': + node.contentWindow = { }; + node.contentDocument = new HTMLDocument(new DOMImplementation(), node.contentWindow); + node.contentWindow.document = node.contentDocument; + try{ + Window; + }catch(e){ + node.contentDocument.addEventListener('DOMContentLoaded', function(){ + event = node.contentDocument.createEvent('HTMLEvents'); + event.initEvent("load", false, false); + node.dispatchEvent( event, false ); + }); + } + try{ + if (node.src && node.src.length > 0){ + //console.log("getting content document for (i)frame from %s", node.src); + Envjs.loadFrame(node, Envjs.uri(node.src)); + event = node.contentDocument.createEvent('HTMLEvents'); + event.initEvent("load", false, false); + node.dispatchEvent( event, false ); + }else{ + //I dont like this being here: + //TODO: better mix-in strategy so the try/catch isnt required + try{ + if(Window){ + Envjs.loadFrame(node); + //console.log('src/html/document.js: triggering frame load'); + event = node.contentDocument.createEvent('HTMLEvents'); + event.initEvent("load", false, false); + node.dispatchEvent( event, false ); + } + }catch(e){} + } + }catch(e){ + console.log('error loading html element %s %e', node, e.toString()); + } + break; + + case 'link': + if (node.href && node.href.length > 0) { + __loadLink__(node, node.href); + } + break; + /* + case 'img': + if (node.src && node.src.length > 0){ + // don't actually load anything, so we're "done" immediately: + event = doc.createEvent('HTMLEvents'); + event.initEvent("load", false, false); + node.dispatchEvent( event, false ); + } + break; + */ + case 'option': + node._updateoptions(); + break; + default: + if(node.getAttribute('onload')){ + console.log('calling attribute onload %s | %s', node.onload, node.tagName); + node.onload(); + } + break; + }//switch on name + default: + break; + }//switch on ns + break; + default: + // console.log('element appended: %s %s', node+'', node.namespaceURI); + }//switch on doc.parsing + return node; + +}); + +Aspect.around({ + target: Node, + method:"removeChild" +}, function(invocation) { + var event, + okay, + node = invocation.proceed(), + doc = node.ownerDocument; + if((node.nodeType !== Node.ELEMENT_NODE)){ + //for now we are only handling element insertions. probably we will need + //to handle text node changes to script tags and changes to src + //attributes + if(node.nodeType !== Node.DOCUMENT_NODE && node.uuid){ + //console.log('removing event listeners, %s', node, node.uuid); + node.removeEventListener('*', null, null); + } + return node; + } + //console.log('appended html element %s %s %s', node.namespaceURI, node.nodeName, node); + + switch(doc.parsing){ + case true: + //handled by parser if included + break; + case false: + switch(node.namespaceURI){ + case null: + //fall through + case "": + //fall through + case "http://www.w3.org/1999/xhtml": + //this is interesting dillema since our event engine is + //storing the registered events in an array accessed + //by the uuid property of the node. unforunately this + //means listeners hang out way after(forever ;)) the node + //has been removed and gone out of scope. + //console.log('removing event listeners, %s', node, node.uuid); + node.removeEventListener('*', null, null); + switch(node.tagName.toLowerCase()){ + case 'frame': + case 'iframe': + try{ + //console.log('removing iframe document'); + try{ + Envjs.unloadFrame(node); + }catch(e){ + console.log('error freeing resources from frame %s', e); + } + node.contentWindow = null; + node.contentDocument = null; + }catch(e){ + console.log('error unloading html element %s %e', node, e.toString()); + } + break; + default: + break; + }//switch on name + default: + break; + }//switch on ns + break; + default: + console.log('element appended: %s %s', node+'', node.namespaceURI); + }//switch on doc.parsing + return node; + +}); + + + +/** + * Named Element Support + * + * + */ + +/* + * + * @returns 'name' if the node has a appropriate name + * null if node does not have a name + */ + +var __isNamedElement__ = function(node) { + if (node.nodeType !== Node.ELEMENT_NODE) { + return null; + } + var tagName = node.tagName.toLowerCase(); + var nodename = null; + + switch (tagName) { + case 'embed': + case 'form': + case 'iframe': + nodename = node.getAttribute('name'); + break; + case 'applet': + nodename = node.id; + break; + case 'object': + // TODO: object needs to be 'fallback free' + nodename = node.id; + break; + case 'img': + nodename = node.id; + if (!nodename || ! node.getAttribute('name')) { + nodename = null; + } + break; + } + return (nodename) ? nodename : null; +}; + + +var __addNamedMap__ = function(target, node) { + var nodename = __isNamedElement__(node); + if (nodename) { + target.__defineGetter__(nodename, function() { + return node; + }); + } +}; + +var __removeNamedMap__ = function(target, node) { + if (!node) { + return; + } + var nodename = __isNamedElement__(node); + if (nodename) { + delete target[nodename]; + } +}; + +/** + * @name HTMLEvents + * @w3c:domlevel 2 + * @uri http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html + */ + +var __eval__ = function(script, node){ + if (!script == ""){ + // don't assemble environment if no script... + try{ + eval(script); + }catch(e){ + console.log('error evaluating %s', e); + } + } +}; + +var HTMLEvents= function(){}; +HTMLEvents.prototype = { + onload: function(event){ + __eval__(this.getAttribute('onload')||'', this); + }, + onunload: function(event){ + __eval__(this.getAttribute('onunload')||'', this); + }, + onabort: function(event){ + __eval__(this.getAttribute('onabort')||'', this); + }, + onerror: function(event){ + __eval__(this.getAttribute('onerror')||'', this); + }, + onselect: function(event){ + __eval__(this.getAttribute('onselect')||'', this); + }, + onchange: function(event){ + __eval__(this.getAttribute('onchange')||'', this); + }, + onsubmit: function(event){ + if (__eval__(this.getAttribute('onsubmit')||'', this)) { + this.submit(); + } + }, + onreset: function(event){ + __eval__(this.getAttribute('onreset')||'', this); + }, + onfocus: function(event){ + __eval__(this.getAttribute('onfocus')||'', this); + }, + onblur: function(event){ + __eval__(this.getAttribute('onblur')||'', this); + }, + onresize: function(event){ + __eval__(this.getAttribute('onresize')||'', this); + }, + onscroll: function(event){ + __eval__(this.getAttribute('onscroll')||'', this); + } +}; + +//HTMLDocument, HTMLFramesetElement, HTMLObjectElement +var __load__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("load", false, false); + element.dispatchEvent(event); + return event; +}; + +//HTMLFramesetElement, HTMLBodyElement +var __unload__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("unload", false, false); + element.dispatchEvent(event); + return event; +}; + +//HTMLObjectElement +var __abort__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("abort", true, false); + element.dispatchEvent(event); + return event; +}; + +//HTMLFramesetElement, HTMLObjectElement, HTMLBodyElement +var __error__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("error", true, false); + element.dispatchEvent(event); + return event; +}; + +//HTMLInputElement, HTMLTextAreaElement +var __select__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("select", true, false); + element.dispatchEvent(event); + return event; +}; + +//HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement +var __change__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("change", true, false); + element.dispatchEvent(event); + return event; +}; + +//HtmlFormElement +var __submit__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("submit", true, true); + element.dispatchEvent(event); + return event; +}; + +//HtmlFormElement +var __reset__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("reset", false, false); + element.dispatchEvent(event); + return event; +}; + +//LABEL, INPUT, SELECT, TEXTAREA, and BUTTON +var __focus__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("focus", false, false); + element.dispatchEvent(event); + return event; +}; + +//LABEL, INPUT, SELECT, TEXTAREA, and BUTTON +var __blur__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("blur", false, false); + element.dispatchEvent(event); + return event; +}; + +//Window +var __resize__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("resize", true, false); + element.dispatchEvent(event); + return event; +}; + +//Window +var __scroll__ = function(element){ + var event = new Event('HTMLEvents'); + event.initEvent("scroll", true, false); + element.dispatchEvent(event); + return event; +}; + +/** + * @name KeyboardEvents + * @w3c:domlevel 2 + * @uri http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html + */ +var KeyboardEvents= function(){}; +KeyboardEvents.prototype = { + onkeydown: function(event){ + __eval__(this.getAttribute('onkeydown')||'', this); + }, + onkeypress: function(event){ + __eval__(this.getAttribute('onkeypress')||'', this); + }, + onkeyup: function(event){ + __eval__(this.getAttribute('onkeyup')||'', this); + } +}; + + +var __registerKeyboardEventAttrs__ = function(elm){ + if(elm.hasAttribute('onkeydown')){ + elm.addEventListener('keydown', elm.onkeydown, false); + } + if(elm.hasAttribute('onkeypress')){ + elm.addEventListener('keypress', elm.onkeypress, false); + } + if(elm.hasAttribute('onkeyup')){ + elm.addEventListener('keyup', elm.onkeyup, false); + } + return elm; +}; + +//HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement +var __keydown__ = function(element){ + var event = new Event('KeyboardEvents'); + event.initEvent("keydown", false, false); + element.dispatchEvent(event); +}; + +//HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement +var __keypress__ = function(element){ + var event = new Event('KeyboardEvents'); + event.initEvent("keypress", false, false); + element.dispatchEvent(event); +}; + +//HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement +var __keyup__ = function(element){ + var event = new Event('KeyboardEvents'); + event.initEvent("keyup", false, false); + element.dispatchEvent(event); +}; + +/** + * @name MaouseEvents + * @w3c:domlevel 2 + * @uri http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html + */ +var MouseEvents= function(){}; +MouseEvents.prototype = { + onclick: function(event){ + __eval__(this.getAttribute('onclick')||'', this); + }, + ondblclick: function(event){ + __eval__(this.getAttribute('ondblclick')||'', this); + }, + onmousedown: function(event){ + __eval__(this.getAttribute('onmousedown')||'', this); + }, + onmousemove: function(event){ + __eval__(this.getAttribute('onmousemove')||'', this); + }, + onmouseout: function(event){ + __eval__(this.getAttribute('onmouseout')||'', this); + }, + onmouseover: function(event){ + __eval__(this.getAttribute('onmouseover')||'', this); + }, + onmouseup: function(event){ + __eval__(this.getAttribute('onmouseup')||'', this); + } +}; + +var __registerMouseEventAttrs__ = function(elm){ + if(elm.hasAttribute('onclick')){ + elm.addEventListener('click', elm.onclick, false); + } + if(elm.hasAttribute('ondblclick')){ + elm.addEventListener('dblclick', elm.ondblclick, false); + } + if(elm.hasAttribute('onmousedown')){ + elm.addEventListener('mousedown', elm.onmousedown, false); + } + if(elm.hasAttribute('onmousemove')){ + elm.addEventListener('mousemove', elm.onmousemove, false); + } + if(elm.hasAttribute('onmouseout')){ + elm.addEventListener('mouseout', elm.onmouseout, false); + } + if(elm.hasAttribute('onmouseover')){ + elm.addEventListener('mouseover', elm.onmouseover, false); + } + if(elm.hasAttribute('onmouseup')){ + elm.addEventListener('mouseup', elm.onmouseup, false); + } + return elm; +}; + + +var __click__ = function(element){ + var event = new Event('MouseEvents'); + event.initEvent("click", true, true, null, 0, + 0, 0, 0, 0, false, false, false, + false, null, null); + element.dispatchEvent(event); +}; +var __mousedown__ = function(element){ + var event = new Event('MouseEvents'); + event.initEvent("mousedown", true, true, null, 0, + 0, 0, 0, 0, false, false, false, + false, null, null); + element.dispatchEvent(event); +}; +var __mouseup__ = function(element){ + var event = new Event('MouseEvents'); + event.initEvent("mouseup", true, true, null, 0, + 0, 0, 0, 0, false, false, false, + false, null, null); + element.dispatchEvent(event); +}; +var __mouseover__ = function(element){ + var event = new Event('MouseEvents'); + event.initEvent("mouseover", true, true, null, 0, + 0, 0, 0, 0, false, false, false, + false, null, null); + element.dispatchEvent(event); +}; +var __mousemove__ = function(element){ + var event = new Event('MouseEvents'); + event.initEvent("mousemove", true, true, null, 0, + 0, 0, 0, 0, false, false, false, + false, null, null); + element.dispatchEvent(event); +}; +var __mouseout__ = function(element){ + var event = new Event('MouseEvents'); + event.initEvent("mouseout", true, true, null, 0, + 0, 0, 0, 0, false, false, false, + false, null, null); + element.dispatchEvent(event); +}; + +/** + * HTMLElement - DOM Level 2 + */ + + +/* Hack for http://www.prototypejs.org/ + * + * Prototype 1.6 (the library) creates a new global Element, which causes + * envjs to use the wrong Element. + * + * http://envjs.lighthouseapp.com/projects/21590/tickets/108-prototypejs-wont-load-due-it-clobbering-element + * + * Options: + * (1) Rename the dom/element to something else + * rejected: been done before. people want Element. + * (2) merge dom+html and not export Element to global namespace + * (meaning we would use a local var Element in a closure, so prototype + * can do what ever it wants) + * rejected: want dom and html separate + * (3) use global namespace (put everything under Envjs = {}) + * rejected: massive change + * (4) use commonjs modules (similar to (3) in spirit) + * rejected: massive change + * + * or + * + * (5) take a reference to Element during initial loading ("compile + * time"), and use the reference instead of "Element". That's + * what the next line does. We use __DOMElement__ if we need to + * reference the parent class. Only this file explcity uses + * Element so this should work, and is the most minimal change I + * could think of with no external API changes. + * + */ +var __DOMElement__ = Element; + +HTMLElement = function(ownerDocument) { + __DOMElement__.apply(this, arguments); +}; + +HTMLElement.prototype = new Element(); +__extend__(HTMLElement.prototype, HTMLEvents.prototype); +__extend__(HTMLElement.prototype, { + get className() { + return this.getAttribute("class")||''; + }, + set className(value) { + return this.setAttribute("class",__trim__(value)); + }, + get dir() { + return this.getAttribute("dir")||"ltr"; + }, + set dir(val) { + return this.setAttribute("dir",val); + }, + get id(){ + return this.getAttribute('id'); + }, + set id(id){ + this.setAttribute('id', id); + }, + get innerHTML(){ + var ret = "", + i; + + // create string containing the concatenation of the string + // values of each child + for (i=0; i < this.childNodes.length; i++) { + if(this.childNodes[i]){ + if(this.childNodes[i].nodeType === Node.ELEMENT_NODE){ + ret += this.childNodes[i].xhtml; + } else if (this.childNodes[i].nodeType === Node.TEXT_NODE && i>0 && + this.childNodes[i-1].nodeType === Node.TEXT_NODE){ + //add a single space between adjacent text nodes + ret += " "+this.childNodes[i].xml; + }else{ + ret += this.childNodes[i].xml; + } + } + } + return ret; + }, + get lang() { + return this.getAttribute("lang"); + }, + set lang(val) { + return this.setAttribute("lang",val); + }, + get offsetHeight(){ + return Number((this.style.height || '').replace("px","")); + }, + get offsetWidth(){ + return Number((this.style.width || '').replace("px","")); + }, + offsetLeft: 0, + offsetRight: 0, + get offsetParent(){ + /* TODO */ + return; + }, + set offsetParent(element){ + /* TODO */ + return; + }, + scrollHeight: 0, + scrollWidth: 0, + scrollLeft: 0, + scrollRight: 0, + get style(){ + return this.getAttribute('style')||''; + }, + get title() { + return this.getAttribute("title"); + }, + set title(value) { + return this.setAttribute("title", value); + }, + get tabIndex(){ + var tabindex = this.getAttribute('tabindex'); + if(tabindex!==null){ + return Number(tabindex); + } else { + return 0; + } + }, + set tabIndex(value){ + if (value === undefined || value === null) { + value = 0; + } + this.setAttribute('tabindex',Number(value)); + }, + get outerHTML(){ + //Not in the specs but I'll leave it here for now. + return this.xhtml; + }, + scrollIntoView: function(){ + /*TODO*/ + return; + }, + toString: function(){ + return '[object HTMLElement]'; + }, + get xhtml() { + // HTMLDocument.xhtml is non-standard + // This is exactly like Document.xml except the tagName has to be + // lower cased. I dont like to duplicate this but its really not + // a simple work around between xml and html serialization via + // XMLSerializer (which uppercases html tags) and innerHTML (which + // lowercases tags) + + var ret = "", + ns = "", + name = (this.tagName+"").toLowerCase(), + attrs, + attrstring = "", + i; + + // serialize namespace declarations + if (this.namespaceURI){ + if((this === this.ownerDocument.documentElement) || + (!this.parentNode) || + (this.parentNode && + (this.parentNode.namespaceURI !== this.namespaceURI))) { + ns = ' xmlns' + (this.prefix ? (':' + this.prefix) : '') + + '="' + this.namespaceURI + '"'; + } + } + + // serialize Attribute declarations + attrs = this.attributes; + for(i=0;i< attrs.length;i++){ + attrstring += " "+attrs[i].name+'="'+attrs[i].xml+'"'; + } + + if(this.hasChildNodes()){ + // serialize this Element + ret += "<" + name + ns + attrstring +">"; + for(i=0;i< this.childNodes.length;i++){ + ret += this.childNodes[i].xhtml ? + this.childNodes[i].xhtml : + this.childNodes[i].xml; + } + ret += ""; + }else{ + switch(name){ + case 'script': + ret += "<" + name + ns + attrstring +">"; + break; + default: + ret += "<" + name + ns + attrstring +"/>"; + } + } + + return ret; + }, + + /** + * setAttribute use a dispatch table that other tags can set to + * "listen" to various values being set. The dispatch table + * and registration functions are at the end of the file. + * + */ + + setAttribute: function(name, value) { + var result = __DOMElement__.prototype.setAttribute.apply(this, arguments); + __addNamedMap__(this.ownerDocument, this); + var tagname = this.tagName; + var callback = HTMLElement.getAttributeCallback('set', tagname, name); + if (callback) { + callback(this, value); + } + }, + setAttributeNS: function(namespaceURI, name, value) { + var result = __DOMElement__.prototype.setAttributeNS.apply(this, arguments); + __addNamedMap__(this.ownerDocument, this); + var tagname = this.tagName; + var callback = HTMLElement.getAttributeCallback('set', tagname, name); + if (callback) { + callback(this, value); + } + + return result; + }, + setAttributeNode: function(newnode) { + var result = __DOMElement__.prototype.setAttributeNode.apply(this, arguments); + __addNamedMap__(this.ownerDocument, this); + var tagname = this.tagName; + var callback = HTMLElement.getAttributeCallback('set', tagname, newnode.name); + if (callback) { + callback(this, node.value); + } + return result; + }, + setAttributeNodeNS: function(newnode) { + var result = __DOMElement__.prototype.setAttributeNodeNS.apply(this, arguments); + __addNamedMap__(this.ownerDocument, this); + var tagname = this.tagName; + var callback = HTMLElement.getAttributeCallback('set', tagname, newnode.name); + if (callback) { + callback(this, node.value); + } + return result; + }, + removeAttribute: function(name) { + __removeNamedMap__(this.ownerDocument, this); + return __DOMElement__.prototype.removeAttribute.apply(this, arguments); + }, + removeAttributeNS: function(namespace, localname) { + __removeNamedMap__(this.ownerDocument, this); + return __DOMElement__.prototype.removeAttributeNS.apply(this, arguments); + }, + removeAttributeNode: function(name) { + __removeNamedMap__(this.ownerDocument, this); + return __DOMElement__.prototype.removeAttribute.apply(this, arguments); + }, + removeChild: function(oldChild) { + __removeNamedMap__(this.ownerDocument, oldChild); + return __DOMElement__.prototype.removeChild.apply(this, arguments); + }, + importNode: function(othernode, deep) { + var newnode = __DOMElement__.prototype.importNode.apply(this, arguments); + __addNamedMap__(this.ownerDocument, newnode); + return newnode; + }, + + // not actually sure if this is needed or not + replaceNode: function(newchild, oldchild) { + var newnode = __DOMElement__.prototype.replaceNode.apply(this, arguments); + __removeNamedMap__(this.ownerDocument, oldchild); + __addNamedMap__(this.ownerDocument, newnode); + return newnode; + } +}); + + +HTMLElement.attributeCallbacks = {}; +HTMLElement.registerSetAttribute = function(tag, attrib, callbackfn) { + HTMLElement.attributeCallbacks[tag + ':set:' + attrib] = callbackfn; +}; +HTMLElement.registerRemoveAttribute = function(tag, attrib, callbackfn) { + HTMLElement.attributeCallbacks[tag + ':remove:' + attrib] = callbackfn; +}; + +/** + * This is really only useful internally + * + */ +HTMLElement.getAttributeCallback = function(type, tag, attrib) { + return HTMLElement.attributeCallbacks[tag + ':' + type + ':' + attrib] || null; +}; +/* + * HTMLCollection + * + * HTML5 -- 2.7.2.1 HTMLCollection + * http://dev.w3.org/html5/spec/Overview.html#htmlcollection + * http://dev.w3.org/html5/spec/Overview.html#collections + */ +HTMLCollection = function(nodelist, type) { + + __setArray__(this, []); + var n; + for (var i=0; i= 0) && (idx < this.length)) ? this[idx] : null; + }, + + namedItem: function (name) { + return this[name] || null; + }, + + toString: function() { + return '[object HTMLCollection]'; + } +}; +/* + * a set of convenience classes to centralize implementation of + * properties and methods across multiple in-form elements + * + * the hierarchy of related HTML elements and their members is as follows: + * + * Condensed Version + * + * HTMLInputCommon + * * legent (no value attr) + * * fieldset (no value attr) + * * label (no value attr) + * * option (custom value) + * HTMLTypeValueInputs (extends InputCommon) + * * select (custom value) + * * button (just sets value) + * HTMLInputAreaCommon (extends TypeValueIput) + * * input (custom) + * * textarea (just sets value) + * + * ----------------------- + * HTMLInputCommon: common to all elements + * .form + * + * + * [common plus:] + * .align + * + *
+ * [identical to "legend" plus:] + * .margin + * + * + * **** + * + *