/*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ /* =================================================== * bootstrap-transition.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#transitions * =================================================== * Copyright 2012 Twitter, Inc. * * 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. * ========================================================== */ /* ========================================================== * bootstrap-alert.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== * Copyright 2012 Twitter, Inc. * * 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. * ========================================================== */ /* ============================================================ * bootstrap-button.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#buttons * ============================================================ * Copyright 2012 Twitter, Inc. * * 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. * ============================================================ */ /* ========================================================== * bootstrap-carousel.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#carousel * ========================================================== * Copyright 2012 Twitter, Inc. * * 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. * ========================================================== */ /* ============================================================= * bootstrap-collapse.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#collapse * ============================================================= * Copyright 2012 Twitter, Inc. * * 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. * ============================================================ */ /* ============================================================ * bootstrap-dropdown.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ * Copyright 2012 Twitter, Inc. * * 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. * ============================================================ */ /* ========================================================= * bootstrap-modal.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= * Copyright 2012 Twitter, Inc. * * 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. * ========================================================= */ /* =========================================================== * bootstrap-tooltip.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#tooltips * Inspired by the original jQuery.tipsy by Jason Frame * =========================================================== * Copyright 2012 Twitter, Inc. * * 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. * ========================================================== */ /* =========================================================== * bootstrap-popover.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#popovers * =========================================================== * Copyright 2012 Twitter, Inc. * * 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. * =========================================================== */ /* ============================================================= * bootstrap-scrollspy.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#scrollspy * ============================================================= * Copyright 2012 Twitter, Inc. * * 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. * ============================================================== */ /* ======================================================== * bootstrap-tab.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#tabs * ======================================================== * Copyright 2012 Twitter, Inc. * * 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. * ======================================================== */ /* ============================================================= * bootstrap-typeahead.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#typeahead * ============================================================= * Copyright 2012 Twitter, Inc. * * 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. * ============================================================ */ /* ========================================================== * bootstrap-affix.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#affix * ========================================================== * Copyright 2012 Twitter, Inc. * * 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. * ========================================================== */ /** * jGrowl 1.2.11 * * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Written by Stan Lemon * Last updated: 2013.02.14 * * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These * notifications function similarly to the Growl Framework available for * Mac OS X (http://growl.info). * * To Do: * - Move library settings to containers and allow them to be changed per container * * Changes in 1.2.11 * - Fix artifacts left behind by the shutdown method and text-cleanup * * Changes in 1.2.10 * - Fix beforeClose to be called in click event * * Changes in 1.2.9 * - Fixed BC break in jQuery 2.0 beta * * Changes in 1.2.8 * - Fixes for jQuery 1.9 and the MSIE6 check, note that with jQuery 2.0 support * jGrowl intends to drop support for IE6 altogether * * Changes in 1.2.6 * - Fixed js error when a notification is opening and closing at the same time * * Changes in 1.2.5 * - Changed wrapper jGrowl's options usage to "o" instead of $.jGrowl.defaults * - Added themeState option to control 'highlight' or 'error' for jQuery UI * - Ammended some CSS to provide default positioning for nested usage. * - Changed some CSS to be prefixed with jGrowl- to prevent namespacing issues * - Added two new options - openDuration and closeDuration to allow * better control of notification open and close speeds, respectively * Patch contributed by Jesse Vincet. * - Added afterOpen callback. Patch contributed by Russel Branca. * * Changes in 1.2.4 * - Fixed IE bug with the close-all button * - Fixed IE bug with the filter CSS attribute (special thanks to gotwic) * - Update IE opacity CSS * - Changed font sizes to use "em", and only set the base style * * Changes in 1.2.3 * - The callbacks no longer use the container as context, instead they use the actual notification * - The callbacks now receive the container as a parameter after the options parameter * - beforeOpen and beforeClose now check the return value, if it's false - the notification does * not continue. The open callback will also halt execution if it returns false. * - Fixed bug where containers would get confused * - Expanded the pause functionality to pause an entire container. * * Changes in 1.2.2 * - Notification can now be theme rolled for jQuery UI, special thanks to Jeff Chan! * * Changes in 1.2.1 * - Fixed instance where the interval would fire the close method multiple times. * - Added CSS to hide from print media * - Fixed issue with closer button when div { position: relative } is set * - Fixed leaking issue with multiple containers. Special thanks to Matthew Hanlon! * * Changes in 1.2.0 * - Added message pooling to limit the number of messages appearing at a given time. * - Closing a notification is now bound to the notification object and triggered by the close button. * * Changes in 1.1.2 * - Added iPhone styled example * - Fixed possible IE7 bug when determining if the ie6 class shoudl be applied. * - Added template for the close button, so that it's content could be customized. * * Changes in 1.1.1 * - Fixed CSS styling bug for ie6 caused by a mispelling * - Changes height restriction on default notifications to min-height * - Added skinned examples using a variety of images * - Added the ability to customize the content of the [close all] box * - Added jTweet, an example of using jGrowl + Twitter * * Changes in 1.1.0 * - Multiple container and instances. * - Standard $.jGrowl() now wraps $.fn.jGrowl() by first establishing a generic jGrowl container. * - Instance methods of a jGrowl container can be called by $.fn.jGrowl(methodName) * - Added glue preferenced, which allows notifications to be inserted before or after nodes in the container * - Added new log callback which is called before anything is done for the notification * - Corner's attribute are now applied on an individual notification basis. * * Changes in 1.0.4 * - Various CSS fixes so that jGrowl renders correctly in IE6. * * Changes in 1.0.3 * - Fixed bug with options persisting across notifications * - Fixed theme application bug * - Simplified some selectors and manipulations. * - Added beforeOpen and beforeClose callbacks * - Reorganized some lines of code to be more readable * - Removed unnecessary this.defaults context * - If corners plugin is present, it's now customizable. * - Customizable open animation. * - Customizable close animation. * - Customizable animation easing. * - Added customizable positioning (top-left, top-right, bottom-left, bottom-right, center) * * Changes in 1.0.2 * - All CSS styling is now external. * - Added a theme parameter which specifies a secondary class for styling, such * that notifications can be customized in appearance on a per message basis. * - Notification life span is now customizable on a per message basis. * - Added the ability to disable the global closer, enabled by default. * - Added callbacks for when a notification is opened or closed. * - Added callback for the global closer. * - Customizable animation speed. * - jGrowl now set itself up and tears itself down. * * Changes in 1.0.1: * - Removed dependency on metadata plugin in favor of .data() * - Namespaced all events */ /*! jQuery UI - v1.9.2 - 2013-03-26 * http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.effect.js, jquery.ui.effect-slide.js * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ /*! * jQuery Color Animations v2.0.0 * http://jquery.com/ * * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * Date: Mon Aug 13 13:41:02 2012 -0500 */ /** * @preserve * jquery.layout 1.3.0 - Release Candidate 30.79 * $Date: 2013-01-12 08:00:00 (Sat, 12 Jan 2013) $ * $Rev: 303007 $ * * Copyright (c) 2013 Kevin Dalman (http://allpro.net) * Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * SEE: http://layout.jquery-dev.net/LICENSE.txt * * Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.79 * * Docs: http://layout.jquery-dev.net/documentation.html * Tips: http://layout.jquery-dev.net/tips.html * Help: http://groups.google.com/group/jquery-ui-layout */ /** * jquery.layout.state 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @requires: UI Layout 1.3.0.rc30.1 or higher * @requires: $.ui.cookie (above) * * @see: http://groups.google.com/group/jquery-ui-layout */ /** * jquery.layout.buttons 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @requires: UI Layout 1.3.0.rc30.1 or higher * * @see: http://groups.google.com/group/jquery-ui-layout * * Docs: [ to come ] * Tips: [ to come ] */ /** * jquery.layout.browserZoom 1.0 * $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @requires: UI Layout 1.3.0.rc30.1 or higher * * @see: http://groups.google.com/group/jquery-ui-layout * * TODO: Extend logic to handle other problematic zooming in browsers * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event */ // Copyright (C) 2006 Google Inc. // http://www.apache.org/licenses/LICENSE-2.0 // > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. // > Underscore may be freely distributed under the MIT license. /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ /* CSS Browser Selector 0.6.1 Originally written by Rafael Lima (http://rafael.adm.br) http://rafael.adm.br/css_browser_selector License: http://creativecommons.org/licenses/by/2.5/ Co-maintained by: https://github.com/verbatim/css_browser_selector */ /** * @license RequireJS text 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/requirejs/text for details */ function runDelayedFunction(){delayedFunction!==undefined&&delayedFunction()}function log(e){window.console&&showLog&&console.log(e)}function css_browser_selector(e){function w(){var e=window.outerWidth||y.clientWidth,i=window.outerHeight||y.clientHeight;t.orientation=e=0;s--)if(e>=n[s]){t.maxw=n[s];break}widthClasses="";for(var o in t)widthClasses+=" "+o+"_"+t[o];return y.className=y.className+widthClasses,widthClasses}var t={},n=[320,480,640,768,1024,1152,1280,1440,1680,1920,2560],r=n.length,i=e.toLowerCase(),s=function(e){return RegExp(e,"i").test(i)},o=function(e,t){t=t.replace(".","_");var n=t.indexOf("_"),r="";while(n>0)r+=" "+e+t.substring(0,n),n=t.indexOf("_",n+1);return r+=" "+e+t,r},u="gecko",a="webkit",f="chrome",l="firefox",c="safari",h="opera",p="mobile",d="android",v="blackberry",m="lang_",g="device_",y=document.documentElement,b=[!/opera|webtv/i.test(i)&&/msie\s(\d+)/.test(i)?"ie ie"+(/trident\/4\.0/.test(i)?"8":RegExp.$1):s("firefox/")?u+" "+l+(/firefox\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+l+RegExp.$2+" "+l+RegExp.$2+"_"+RegExp.$4:""):s("gecko/")?u:s("opera")?h+(/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+h+RegExp.$2+" "+h+RegExp.$2+"_"+RegExp.$4:/opera(\s|\/)(\d+)\.(\d+)/.test(i)?" "+h+RegExp.$2+" "+h+RegExp.$2+"_"+RegExp.$3:""):s("konqueror")?"konqueror":s("blackberry")?v+(/Version\/(\d+)(\.(\d+)+)/i.test(i)?" "+v+RegExp.$1+" "+v+RegExp.$1+RegExp.$2.replace(".","_"):/Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(i)?" "+v+RegExp.$2+(RegExp.$3?" "+v+RegExp.$2+RegExp.$3:""):""):s("android")?d+(/Version\/(\d+)(\.(\d+))+/i.test(i)?" "+d+RegExp.$1+" "+d+RegExp.$1+RegExp.$2.replace(".","_"):"")+(/Android (.+); (.+) Build/i.test(i)?" "+g+RegExp.$2.replace(/ /g,"_").replace(/-/g,"_"):""):s("chrome")?a+" "+f+(/chrome\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+f+RegExp.$2+(RegExp.$4>0?" "+f+RegExp.$2+"_"+RegExp.$4:""):""):s("iron")?a+" iron":s("applewebkit/")?a+" "+c+(/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+c+RegExp.$2+" "+c+RegExp.$2+RegExp.$3.replace(".","_"):/ Safari\/(\d+)/i.test(i)?RegExp.$1=="419"||RegExp.$1=="417"||RegExp.$1=="416"||RegExp.$1=="412"?" "+c+"2_0":RegExp.$1=="312"?" "+c+"1_3":RegExp.$1=="125"?" "+c+"1_2":RegExp.$1=="85"?" "+c+"1_0":"":""):s("mozilla/")?u:"",s("android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk")?p:"",s("j2me")?"j2me":s("ipad|ipod|iphone")?(/CPU( iPhone)? OS (\d+[_|\.]\d+([_|\.]\d+)*)/i.test(i)?"ios"+o("ios",RegExp.$2):"")+" "+(/(ip(ad|od|hone))/gi.test(i)?RegExp.$1:""):s("playbook")?"playbook":s("kindle|silk")?"kindle":s("playbook")?"playbook":s("mac")?"mac"+(/mac os x ((\d+)[.|_](\d+))/.test(i)?" mac"+RegExp.$2+" mac"+RegExp.$1.replace(".","_"):""):s("win")?"win"+(s("windows nt 6.2")?" win8":s("windows nt 6.1")?" win7":s("windows nt 6.0")?" vista":s("windows nt 5.2")||s("windows nt 5.1")?" win_xp":s("windows nt 5.0")?" win_2k":s("windows nt 4.0")||s("WinNT4.0")?" win_nt":""):s("freebsd")?"freebsd":s("x11|linux")?"linux":"",/[; |\[](([a-z]{2})(\-[a-z]{2})?)[)|;|\]]/i.test(i)?(m+RegExp.$2).replace("-","_")+(RegExp.$3!=""?(" "+m+RegExp.$1).replace("-","_"):""):"",s("ipad|iphone|ipod")&&!s("safari")?"ipad_app":""];window.onresize=w,w();var E=b.join(" ")+" js ";return y.className=(E+y.className.replace(/\b(no[-|_]?)?js\b/g,"")).replace(/^ /,"").replace(/ +/g," "),E}(function(e,t){function P(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||n!=="function"&&(t===0||typeof t=="number"&&t>0&&t-1 in e)}function B(e){var t=H[e]={};return b.each(e.match(E)||[],function(e,n){t[n]=!0}),t}function I(e,n,r,i){if(!b.acceptData(e))return;var s,o,u=b.expando,a=typeof n=="string",f=e.nodeType,c=f?b.cache:e,h=f?e[u]:e[u]&&u;if((!h||!c[h]||!i&&!c[h].data)&&a&&r===t)return;h||(f?e[u]=h=l.pop()||b.guid++:h=u),c[h]||(c[h]={},f||(c[h].toJSON=b.noop));if(typeof n=="object"||typeof n=="function")i?c[h]=b.extend(c[h],n):c[h].data=b.extend(c[h].data,n);return s=c[h],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[b.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[b.camelCase(n)])):o=s,o}function q(e,t,n){if(!b.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?b.cache:e,a=o?e[b.expando]:b.expando;if(!u[a])return;if(t){s=n?u[a]:u[a].data;if(s){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in s?t=[t]:(t=b.camelCase(t),t in s?t=[t]:t=t.split(" "));for(r=0,i=t.length;r=0===n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Mt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function _t(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function Dt(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function Ht(e,t){if(t.nodeType!==1||!b.hasData(e))return;var n,r,i,s=b._data(e),o=b._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").css("cssText","display:block !important")).appendTo(t.documentElement),t=(It[0].contentWindow||It[0].contentDocument).document,t.write(""),t.close(),n=fn(e,t),It.detach();Qt[e]=n}return n}function fn(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function vn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||cn.test(e)?r(e,i):vn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&b.type(t)==="object")for(i in t)vn(e+"["+i+"]",t[i],n,r);else r(e,t)}function _n(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(E)||[];if(b.isFunction(n))while(r=s[i++])r[0]==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Dn(e,t,n,r){function o(u){var a;return i[u]=!0,b.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((s[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(u in l)u in r&&(n[l[u]]=r[u]);while(f[0]==="*")f.shift(),s===t&&(s=e.mimeType||n.getResponseHeader("Content-Type"));if(s)for(u in a)if(a[u]&&a[u].test(s)){f.unshift(u);break}if(f[0]in r)o=f[0];else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}i||(i=u)}o=o||i}if(o)return o!==f[0]&&f.unshift(o),r[o]}function Bn(e,t){var n,r,i,s,o={},u=0,a=e.dataTypes.slice(),f=a[0];e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(a[1])for(i in e.converters)o[i.toLowerCase()]=e.converters[i];for(;r=a[++u];)if(r!=="*"){if(f!=="*"&&f!==r){i=o[f+" "+r]||o["* "+r];if(!i)for(n in o){s=n.split(" ");if(s[1]===r){i=o[f+" "+s[0]]||o["* "+s[0]];if(i){i===!0?i=o[n]:o[n]!==!0&&(r=s[0],a.splice(u--,0,r));break}}}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(l){return{state:"parsererror",error:i?l:"No conversion from "+f+" to "+r}}}f=r}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Gn[t]||[]).concat(Gn["*"]),i=0,s=r.length;for(;i)[^>]*|#([\w-]*))$/,T=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,N=/^[\],:{}\s]*$/,C=/(?:^|:|,)(?:\s*\[)+/g,k=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,L=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,A=/^-ms-/,O=/-([\da-z])/gi,M=function(e,t){return t.toUpperCase()},_=function(e){if(s.addEventListener||e.type==="load"||s.readyState==="complete")D(),b.ready()},D=function(){s.addEventListener?(s.removeEventListener("DOMContentLoaded",_,!1),e.removeEventListener("load",_,!1)):(s.detachEvent("onreadystatechange",_),e.detachEvent("onload",_))};b.fn=b.prototype={jquery:c,constructor:b,init:function(e,n,r){var i,o;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=x.exec(e);if(i&&(i[1]||!n)){if(i[1]){n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:s,!0));if(T.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}o=s.getElementById(i[2]);if(o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=s,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return d.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0)return;n.resolveWith(s,[b]),b.fn.trigger&&b(s).trigger("ready").off("ready")},isFunction:function(e){return b.type(e)==="function"},isArray:Array.isArray||function(e){return b.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):typeof e=="object"||typeof e=="function"?f[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||b.type(e)!=="object"||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!g.call(e,"constructor")&&!g.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||g.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||s;var r=T.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(t===null)return t;if(typeof t=="string"){t=b.trim(t);if(t&&N.test(t.replace(k,"@").replace(L,"]").replace(C,"")))return(new Function("return "+t))()}b.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(A,"ms-").replace(O,M)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=P(e);if(n)if(o)for(;i-1)a.splice(r,1),n&&(r<=s&&s--,r<=o&&o--)}),this},has:function(e){return e?b.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],this},disable:function(){return a=f=r=t,this},disabled:function(){return!a},lock:function(){return f=t,r||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!i||f)&&(n?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,s){var o=s[0],u=b.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=r!==1||e&&b.isFunction(e.promise)?r:0,s=i===1?e:b.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};u=s.createElement("select"),f=u.appendChild(s.createElement("option")),o=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:p.className!=="t",leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!o.value,optSelected:f.selected,enctype:!!s.createElement("form").enctype,html5Clone:s.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:s.compatMode==="CSS1Compat",deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,u.disabled=!0,t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}o=s.createElement("input"),o.setAttribute("value",""),t.input=o.getAttribute("value")==="",o.value="t",o.setAttribute("type","radio"),t.radioValue=o.value==="t",o.setAttribute("checked","t"),o.setAttribute("name","t"),a=s.createDocumentFragment(),a.appendChild(o),t.appendChecked=o.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){t.noCloneEvent=!1}),p.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+h,"t"),t[h+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle=p.style.backgroundClip==="content-box",b(function(){var n,r,o,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=s.getElementsByTagName("body")[0];if(!a)return;n=s.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(p),p.innerHTML="
t
",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=o[0].offsetHeight===0,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=c&&o[0].offsetHeight===0,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=p.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px",r=p.appendChild(s.createElement("div")),r.style.cssText=p.style.cssText=u,r.style.marginRight=r.style.width="0",p.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof p.style.zoom!==i&&(p.innerHTML="",p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.innerHTML="
",p.firstChild.style.width="5px",t.shrinkWrapBlocks=p.offsetWidth!==3,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(n),n=p=o=r=null}),n=u=a=f=r=o=null,t}();var j=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,F=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(c+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!U(e)},data:function(e,t,n){return I(e,t,n)},removeData:function(e,t){return q(e,t)},_data:function(e,t,n){return I(e,t,n,!0)},_removeData:function(e,t){return q(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,s=this[0],o=0,u=null;if(e===t){if(this.length){u=b.data(s);if(s.nodeType===1&&!b._data(s,"parsedAttrs")){r=s.attributes;for(;o1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=b._data(e,t),n&&(!r||b.isArray(n)?r=b._data(e,t,b.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),s=b._queueHooks(e,t),o=function(){b.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),s.cur=i,i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e=="string"&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(a){t=(e||"").match(E)||[];for(;o=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var s,o=0,u=b(this),a=t,f=e.match(E)||[];while(s=f[o++])a=r?a:!u.hasClass(s),u[a?"addClass":"removeClass"](s)}else if(n===i||n==="boolean")this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return r=b.valHooks[s.type]||b.valHooks[s.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(s,"value"))!==t?n:(n=s.value,typeof n=="string"?n.replace(V,""):n==null?"":n);return}return i=b.isFunction(e),this.each(function(n){var s,o=b(this);if(this.nodeType!==1)return;i?s=e.call(this,n,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":b.isArray(s)&&(s=b.map(s,function(e){return e==null?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t)this.value=s})}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(typeof e.getAttribute===i)return b.prop(e,n,r);o=a!==1||!b.isXMLDoc(e),o&&(n=n.toLowerCase(),s=b.attrHooks[n]||(K.test(n)?W:z));if(r===t)return s&&o&&"get"in s&&(u=s.get(e,n))!==null?u:(typeof e.getAttribute!==i&&(u=e.getAttribute(n)),u==null?t:u);if(r!==null)return s&&o&&"set"in s&&(u=s.set(e,r,n))!==t?u:(e.setAttribute(n,r+""),r);b.removeAttr(e,n)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(E);if(s&&e.nodeType===1)while(n=s[i++])r=b.propFix[n]||n,K.test(n)?!G&&Q.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(G?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&t==="radio"&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!b.isXMLDoc(e),o&&(n=b.propFix[n]||n,s=b.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):$.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:t}}}}),W={get:function(e,n){var r=b.prop(e,n),i=typeof r=="boolean"&&e.getAttribute(n),s=typeof r=="boolean"?Y&&G?i!=null:Q.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return s&&s.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):Y&&G||!Q.test(n)?e.setAttribute(!G&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}};if(!Y||!G)b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,t,n){if(!b.nodeName(e,"input"))return z&&z.set(e,t,n);e.defaultValue=t}};G||(z=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&(n==="id"||n==="name"||n==="coords"?r.value!=="":r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="",r==="value"||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:z.get,set:function(e,t,n){z.set(e,t===""?!1:t,n)}},b.each(["width","height"],function(e,t){b.attrHooks[t]=b.extend(b.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r==null?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,t){if(b.isArray(t))return e.checked=b.inArray(b(e).val(),t)>=0}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=b._data(e);if(!y)return;r.handler&&(l=r,r=l.handler,o=l.selector),r.guid||(r.guid=b.guid++),(a=y.events)||(a=y.events={}),(h=y.handle)||(h=y.handle=function(e){return typeof b===i||!!e&&b.event.triggered===e.type?t:b.event.dispatch.apply(h.elem,arguments)},h.elem=e),n=(n||"").match(E)||[""],f=n.length;while(f--){u=rt.exec(n[f])||[],v=g=u[1],m=(u[2]||"").split(".").sort(),c=b.event.special[v]||{},v=(o?c.delegateType:c.bindType)||v,c=b.event.special[v]||{},p=b.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&b.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[],d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===!1)e.addEventListener?e.addEventListener(v,h,!1):e.attachEvent&&e.attachEvent("on"+v,h)}c.add&&(c.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,p):d.push(p),b.event.global[v]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=b.hasData(e)&&b._data(e);if(!m||!(l=m.events))return;t=(t||"").match(E)||[""],f=t.length;while(f--){u=rt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in l)b.event.remove(e,p+t[f],n,r,!0);continue}c=b.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=l[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;while(s--)o=h[s],(i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(h.splice(s,1),o.selector&&h.delegateCount--,c.remove&&c.remove.call(e,o));a&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&b.removeEvent(e,p,m.handle),delete l[p])}b.isEmptyObject(l)&&(delete m.handle,b._removeData(e,"events"))},trigger:function(n,r,i,o){var u,a,f,l,c,h,p,d=[i||s],v=g.call(n,"type")?n.type:n,m=g.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||s;if(i.nodeType===3||i.nodeType===8)return;if(nt.test(v+b.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),a=v.indexOf(":")<0&&"on"+v,n=n[b.expando]?n:new b.Event(v,typeof n=="object"&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=r==null?[n]:b.makeArray(r,[n]),c=b.event.special[v]||{};if(!o&&c.trigger&&c.trigger.apply(i,r)===!1)return;if(!o&&!c.noBubble&&!b.isWindow(i)){l=c.delegateType||v,nt.test(l+v)||(f=f.parentNode);for(;f;f=f.parentNode)d.push(f),h=f;h===(i.ownerDocument||s)&&d.push(h.defaultView||h.parentWindow||e)}p=0;while((f=d[p++])&&!n.isPropagationStopped())n.type=p>1?l:c.bindType||v,u=(b._data(f,"events")||{})[n.type]&&b._data(f,"handle"),u&&u.apply(f,r),u=a&&f[a],u&&b.acceptData(f)&&u.apply&&u.apply(f,r)===!1&&n.preventDefault();n.type=v;if(!o&&!n.isDefaultPrevented()&&(!c._default||c._default.apply(i.ownerDocument,r)===!1)&&(v!=="click"||!b.nodeName(i,"a"))&&b.acceptData(i)&&a&&i[v]&&!b.isWindow(i)){h=i[a],h&&(i[a]=null),b.event.triggered=v;try{i[v]()}catch(y){}b.event.triggered=t,h&&(i[a]=h)}return n.result},dispatch:function(e){e=b.event.fix(e);var n,r,i,s,o,u=[],a=d.call(arguments),f=(b._data(this,"events")||{})[e.type]||[],l=b.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=b.event.handlers.call(this,e,f),n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click"))for(;f!=this;f=f.parentNode||this)if(f.nodeType===1&&(f.disabled!==!0||e.type!=="click")){s=[];for(o=0;o=0:b.find(r,this,null,[f]).length),s[r]&&s.push(i);s.length&&u.push({elem:f,handlers:s})}return ai.cacheLength&&delete e[t.shift()],e[n]=r}}function st(e){return e[w]=!0,e}function ot(e){var t=c.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function ut(e,t,n,r){var i,s,o,u,a,f,h,v,m,y;(t?t.ownerDocument||t:E)!==c&&l(t),t=t||c,n=n||[];if(!e||typeof e!="string")return n;if((u=t.nodeType)!==1&&u!==9)return[];if(!p&&!r){if(i=K.exec(e))if(o=i[1]){if(u===9){s=t.getElementById(o);if(!s||!s.parentNode)return n;if(s.id===o)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(o))&&g(t,s)&&s.id===o)return n.push(s),n}else{if(i[2])return _.apply(n,D.call(t.getElementsByTagName(e),0)),n;if((o=i[3])&&S.getByClassName&&t.getElementsByClassName)return _.apply(n,D.call(t.getElementsByClassName(o),0)),n}if(S.qsa&&!d.test(e)){h=!0,v=w,m=t,y=u===9&&e;if(u===1&&t.nodeName.toLowerCase()!=="object"){f=ht(e),(h=t.getAttribute("id"))?v=h.replace(Y,"\\$&"):t.setAttribute("id",v),v="[id='"+v+"'] ",a=f.length;while(a--)f[a]=v+pt(f[a]);m=$.test(e)&&t.parentNode||t,y=f.join(",")}if(y)try{return _.apply(n,D.call(m.querySelectorAll(y),0)),n}catch(b){}finally{h||t.removeAttribute("id")}}}return Et(e.replace(R,"$1"),t,n,r)}function at(e,t){var n=t&&e,r=n&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function ct(e){return st(function(t){return t=+t,st(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ht(e,t){var n,r,s,o,u,a,f,l=C[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=U.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=z.exec(u))n=r.shift(),s.push({value:n,type:r[0].replace(R," ")}),u=u.slice(n.length);for(o in i.filter)(r=V[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(n=r.shift(),s.push({value:n,type:o,matches:r}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ut.error(e):C(e,a).slice(0)}function pt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=mt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):_.apply(o,g)})}function yt(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,l=dt(function(e){return e===t},u,!0),c=dt(function(e){return P.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a1&&vt(h),a>1&&pt(e.slice(0,a-1)).replace(R,"$1"),n,a0,o=e.length>0,u=function(u,a,l,h,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,S=f,T=u||o&&i.find.TAG("*",p&&a.parentNode||a),N=x+=S==null?1:Math.random()||.1;E&&(f=a!==c&&a,r=n);for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++])if(m(d,a,l)){h.push(d);break}E&&(x=N,r=++n)}s&&((d=!m&&d)&&y--,u&&w.push(d))}y+=b;if(s&&b!==y){v=0;while(m=t[v++])m(w,g,a,l);if(u){if(y>0)while(b--)!w[b]&&!g[b]&&(g[b]=M.call(h));g=mt(g)}_.apply(h,g),E&&!u&&g.length>0&&y+t.length>1&&ut.uniqueSort(h)}return E&&(x=N,f=S),w};return s?st(u):u}function wt(e,t,n){var r=0,i=t.length;for(;r2&&(a=o[0]).type==="ID"&&t.nodeType===9&&!p&&i.relative[o[1].type]){t=i.find.ID(a.matches[0].replace(et,tt),t)[0];if(!t)return n;e=e.slice(o.shift().value.length)}s=V.needsContext.test(e)?0:o.length;while(s--){a=o[s];if(i.relative[f=a.type])break;if(l=i.find[f])if(r=l(a.matches[0].replace(et,tt),$.test(o[0].type)&&t.parentNode||t)){o.splice(s,1),e=r.length&&pt(o);if(!e)return _.apply(n,D.call(r,0)),n;break}}}return u(e,c)(r,t,p,n,$.test(e)),n}function St(){}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,w="sizzle"+ -(new Date),E=e.document,S={},x=0,T=0,N=it(),C=it(),k=it(),L=typeof t,A=1<<31,O=[],M=O.pop,_=O.push,D=O.slice,P=O.indexOf||function(e){var t=0,n=this.length;for(;t+~])"+H+"*"),W=new RegExp(q),X=new RegExp("^"+j+"$"),V={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),NAME:new RegExp("^\\[name=['\"]?("+B+")['\"]?\\]"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},$=/[\x20\t\r\n\f]*[+~]/,J=/^[^{]+\{\s*\[native code/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)};try{D.call(E.documentElement.childNodes,0)[0].nodeType}catch(nt){D=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},l=ut.setDocument=function(e){var n=e?e.ownerDocument||e:E;if(n===c||n.nodeType!==9||!n.documentElement)return c;c=n,h=n.documentElement,p=o(n),S.tagNameNoComments=ot(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),S.attributes=ot(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),S.getByClassName=ot(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),S.getByName=ot(function(e){e.id=w+0,e.innerHTML="
",h.insertBefore(e,h.firstChild);var t=n.getElementsByName&&n.getElementsByName(w).length===2+n.getElementsByName(w+0).length;return S.getIdNotName=!n.getElementById(w),h.removeChild(e),t}),i.attrHandle=ot(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==L&&e.firstChild.getAttribute("href")==="#"})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},S.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==L&&!p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==L&&!p){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==L&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==L&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=S.tagNameNoComments?function(e,t){if(typeof t.getElementsByTagName!==L)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},i.find.NAME=S.getByName&&function(e,t){if(typeof t.getElementsByName!==L)return t.getElementsByName(name)},i.find.CLASS=S.getByClassName&&function(e,t){if(typeof t.getElementsByClassName!==L&&!p)return t.getElementsByClassName(e)},v=[],d=[":focus"];if(S.qsa=rt(n.querySelectorAll))ot(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+H+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||d.push(":checked")}),ot(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&d.push("[*^$]="+H+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")});return(S.matchesSelector=rt(m=h.matchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ot(function(e){S.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),v.push("!=",q)}),d=new RegExp(d.join("|")),v=new RegExp(v.join("|")),g=rt(h.contains)||h.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},y=h.compareDocumentPosition?function(e,t){var r;if(e===t)return a=!0,0;if(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))return r&1||e.parentNode&&e.parentNode.nodeType===11?e===n||g(E,e)?-1:t===n||g(E,t)?1:0:r&4?-1:1;return e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,s=e.parentNode,o=t.parentNode,u=[e],f=[t];if(e===t)return a=!0,0;if(!s||!o)return e===n?-1:t===n?1:s?-1:o?1:0;if(s===o)return at(e,t);r=e;while(r=r.parentNode)u.unshift(r);r=t;while(r=r.parentNode)f.unshift(r);while(u[i]===f[i])i++;return i?at(u[i],f[i]):u[i]===E?-1:f[i]===E?1:0},a=!1,[0,0].sort(y),S.detectDuplicates=a,c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){(e.ownerDocument||e)!==c&&l(e),t=t.replace(Z,"='$1']");if(S.matchesSelector&&!p&&(!v||!v.test(t))&&!d.test(t))try{var n=m.call(e,t);if(n||S.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),g(e,t)},ut.attr=function(e,t){var n;return(e.ownerDocument||e)!==c&&l(e),p||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):p||S.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},ut.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=1,i=0;a=!S.detectDuplicates,e.sort(y);if(a){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},s=ut.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r];r++)n+=s(t);else if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue;return n},i=ut.selectors={cacheLength:50,createPseudo:st,match:V,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ut.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return V.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&W.test(n)&&(t=ht(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&N(e,function(e){return t.test(e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===x&&f[1],h=f[0]===x&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[x,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===x)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[w]||(c[w]={}))[e]=[x,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return r[w]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=P.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:st(function(e){var t=[],n=[],r=u(e.replace(R,"$1"));return r[w]?st(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),lang:st(function(e){return X.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=p?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:ct(function(){return[0]}),last:ct(function(e,t){return[t-1]}),eq:ct(function(e,t,n){return[n<0?n+t:n]}),even:ct(function(e,t){var n=0;for(;n=0;)e.push(r);return e}),gt:ct(function(e,t,n){var r=n<0?n+t:n;for(;++r1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;t=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=ft.test(e)||typeof e!="string"?b(e,t||this.context):0;for(;r-1:b.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return this.pushStack(s.length>1?b.unique(s):s)},index:function(e){return e?typeof e=="string"?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return ot.test(e)||(r=n),r&&typeof r=="string"&&(i=b.filter(r,i)),i=this.length>1&&!lt[e]?b.unique(i):i,this.length>1&&ut.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!b(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/\s*$/g,Lt={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},At=pt(s),Ot=At.appendChild(s.createElement("div"));Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||b.filter(e,[n]).length>0)!t&&n.nodeType===1&&b.cleanData(jt(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Pt(jt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&b.cleanData(jt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(vt,""):t;if(typeof e=="string"&&!St.test(e)&&(b.support.htmlSerialize||!mt.test(e))&&(b.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1>");try{for(;r")?s=e.cloneNode(!0):(Ot.innerHTML=e.outerHTML,Ot.removeChild(s=Ot.firstChild));if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!b.isXMLDoc(e)){r=jt(s),u=jt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&Bt(i,r[o])}if(t)if(n){u=u||jt(e),r=r||jt(s);for(o=0;(i=u[o])!=null;o++)Ht(i,r[o])}else Ht(e,s);return r=jt(s,"script"),r.length>0&&Pt(r,!a&&jt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d")+l[2],i=l[0];while(i--)u=u.lastChild;!b.support.leadingWhitespace&>.test(s)&&p.push(t.createTextNode(gt.exec(s)[0]));if(!b.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]===""&&!wt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)b.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}b.merge(p,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=h.lastChild}}u&&h.removeChild(u),b.support.appendChecked||b.grep(jt(p,"input"),Ft),d=0;while(s=p[d++]){if(r&&b.inArray(s,r)!==-1)continue;o=b.contains(s.ownerDocument,s),u=jt(h.appendChild(s),"script"),o&&Pt(u);if(n){i=0;while(s=u[i++])Nt.test(s.type||"")&&n.push(s)}}return u=null,h},cleanData:function(e,t){var n,r,s,o,u=0,a=b.expando,f=b.cache,c=b.support.deleteExpando,h=b.event.special;for(;(n=e[u])!=null;u++)if(t||b.acceptData(n)){s=n[a],o=s&&f[s];if(o){if(o.events)for(r in o.events)h[r]?b.event.remove(n,r):b.removeEvent(n,r,o.handle);f[s]&&(delete f[s],c?delete n[a]:typeof n.removeAttribute!==i?n.removeAttribute(a):n[a]=null,l.push(s))}}}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+w+")(.*)$","i"),Jt=new RegExp("^("+w+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+w+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,s,o={},u=0;if(b.isArray(n)){s=qt(e),i=n.length;for(;u1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t=typeof e=="boolean";return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=b.camelCase(n),f=e.style;n=b.cssProps[a]||(b.cssProps[a]=tn(f,a)),u=b.cssHooks[n]||b.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=Kt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(b.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!b.cssNumber[a]&&(r+="px"),!b.support.clearCloneStyle&&r===""&&n.indexOf("background")===0&&(f[n]="inherit");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=b.camelCase(n);return n=b.cssProps[a]||(b.cssProps[a]=tn(e.style,a)),u=b.cssHooks[n]||b.cssHooks[a],u&&"get"in u&&(o=u.get(e,!0,r)),o===t&&(o=Rt(e,n,i)),o==="normal"&&n in Yt&&(o=Yt[n]),r===""||r?(s=parseFloat(o),r===!0||b.isNumeric(s)?s||0:o):o},swap:function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i}}),e.getComputedStyle?(qt=function(t){return e.getComputedStyle(t,null)},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;return u&&(a===""&&!b.contains(e.ownerDocument,e)&&(a=b.style(e,n)),Jt.test(a)&&Vt.test(n)&&(i=f.width,s=f.minWidth,o=f.maxWidth,f.minWidth=f.maxWidth=f.width=a,a=u.width,f.width=i,f.minWidth=s,f.maxWidth=o)),a}):s.documentElement.currentStyle&&(qt=function(e){return e.currentStyle},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;return a==null&&f&&f[n]&&(a=f[n]),Jt.test(a)&&!Wt.test(n)&&(i=f.left,s=e.runtimeStyle,o=s&&s.left,o&&(s.left=e.currentStyle.left),f.left=n==="fontSize"?"1em":a,a=f.pixelLeft+"px",f.left=i,o&&(s.left=o)),a===""?"auto":a}),b.each(["height","width"],function(e,t){b.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&Xt.test(b.css(e,"display"))?b.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,b.support.boxSizing&&b.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&b.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,t){if(t)return b.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,t){b.cssHooks[t]={get:function(e,n){if(n)return n=Rt(e,t),Jt.test(n)?b(e).position()[t]+"px":n}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!b.support.reliableHiddenOffsets&&(e.style&&e.style.display||b.css(e,"display"))==="none"},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+Zt[r]+t]=s[r]||s[r-2]||s[0];return i}},Vt.test(e)||(b.cssHooks[e+t].set=sn)});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=b(this).val();return n==null?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],s=function(e,t){t=b.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional);if(b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){s(this.name,this.value)});else for(r in e)vn(r,e[r],n,s);return i.join("&").replace(ln,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,gn,yn=b.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=b.fn.load,Ln={},An={},On="*/".concat("*");try{gn=o.href}catch(Mn){gn=s.createElement("a"),gn.href="",gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[],b.fn.load=function(e,n,r){if(typeof e!="string"&&kn)return kn.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),b.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(o="POST"),u.length>0&&b.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,u.html(i?b("
").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,s){return b.isFunction(r)&&(s=s||i,i=r,r=t),b.ajax({url:e,type:n,dataType:s,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Pn(Pn(e,b.ajaxSettings),t):Pn(b.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(w===2)return;w=2,u&&clearTimeout(u),f=t,o=i||"",x.readyState=e>0?4:0,r&&(E=Hn(c,x,r));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(b.lastModified[s]=S),S=x.getResponseHeader("etag"),S&&(b.etag[s]=S)),e===204?(l=!0,T="nocontent"):e===304?(l=!0,T="notmodified"):(l=Bn(c,E),T=l.state,g=l.data,y=l.error,l=!y);else{y=T;if(e||!T)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[g,T,x]):d.rejectWith(h,[x,T,y]),x.statusCode(m),m=t,a&&p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y]),v.fireWith(h,[x,T]),a&&(p.trigger("ajaxComplete",[x,c]),--b.active||b.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=b.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?b(h):b.event,d=b.Deferred(),v=b.Callbacks("once memory"),m=c.statusCode||{},g={},y={},w=0,S="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(w===2){if(!l){l={};while(t=Sn.exec(o))l[t[1].toLowerCase()]=t[2]}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return w===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return w||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return w||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(w<2)for(t in e)m[t]=[m[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||S;return f&&f.abort(t),N(0,t),this}};d.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//"),c.type=n.method||n.type||c.method||c.type,c.dataTypes=b.trim(c.dataType||"*").toLowerCase().match(E)||[""],c.crossDomain==null&&(r=Cn.exec(c.url.toLowerCase()),c.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||(r[1]==="http:"?80:443))==(mn[3]||(mn[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=b.param(c.data,c.traditional)),Dn(Ln,c,n,x);if(w===2)return x;a=c.global,a&&b.active++===0&&b.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Tn.test(c.type),s=c.url,c.hasContent||(c.data&&(s=c.url+=(bn.test(s)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++)),c.ifModified&&(b.lastModified[s]&&x.setRequestHeader("If-Modified-Since",b.lastModified[s]),b.etag[s]&&x.setRequestHeader("If-None-Match",b.etag[s])),(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers)x.setRequestHeader(i,c.headers[i]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&w!==2){S="abort";for(i in{success:1,error:1,complete:1})x[i](c[i]);f=Dn(An,c,n,x);if(!f)N(-1,"No Transport");else{x.readyState=1,a&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{w=1,f.send(g,N)}catch(T){if(!(w<2))throw T;N(-1,T)}}return x}return x.abort()},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=s.head||b("head")[0]||s.documentElement;return{send:function(t,i){n=s.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||b.expando+"_"+yn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==!1&&(Fn.test(n.url)?"url":typeof n.data=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp")return s=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a?n[a]=n[a].replace(Fn,"$1"+s):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||b.error(s+" was not called"),u[0]},n.dataTypes[0]="json",o=e[s],e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,jn.push(s)),u&&b.isFunction(o)&&o(u[0]),u=o=t}),"script"});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In)In[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn,qn=b.ajaxSettings.xhr(),b.support.cors=!!qn&&"withCredentials"in qn,qn=b.support.ajax=!!qn,qn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=b.noop,Un&&delete In[o]);if(i)a.readyState!==4&&a.abort();else{c={},u=a.status,f=a.getAllResponseHeaders(),typeof a.responseText=="string"&&(c.text=a.responseText);try{l=a.statusText}catch(h){l=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(p){i||s(-1,p)}c&&s(u,l,c,f)},n.async?a.readyState===4?setTimeout(r):(o=++Rn,Un&&(In||(In={},b(e).unload(Un)),In[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=Jn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(b.cssNumber[e]?"":"px");if(r!=="px"&&u){u=b.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,b.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),b.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},b.fn.extend({position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return b.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s.documentElement;while(e&&!b.nodeName(e,"html")&&b.css(e,"position")==="static")e=e.offsetParent;return e||s.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,s){var o=sr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?b(o).scrollLeft():s,r?s:b(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return b.access(this,function(n,r,i){var s;return b.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?b.css(n,r,u):b.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=b,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window),define("mathjax-editing",["MathJax"],function(){function h(e,t){var n=i.slice(e,t+1).join("").replace(/&/g,"&").replace(//g,">");l.Browser.isMSIE&&(n=n.replace(/(%[^\n]*)\n/g,"$1
\n"));while(t>e)i[t]="",t--;i[e]="@@"+f.length+"@@",f.push(n),s=o=u=null}function p(e){s=o=u=null,f=[],i=e.replace(/\r\n?/g,"\n").split(c);for(var t=1,n=i.length;tthis.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
  • ',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery),define("bootstrap",function(){}),function(e){var t=function(){return!1===e.support.boxModel&&e.support.objectAll&&e.support.leadingWhitespace}();e.jGrowl=function(t,n){e("#jGrowl").size()==0&&e('
    ').addClass(n&&n.position?n.position:e.jGrowl.defaults.position).appendTo("body"),e("#jGrowl").jGrowl(t,n)},e.fn.jGrowl=function(t,n){if(e.isFunction(this.each)){var r=arguments;return this.each(function(){var i=this;e(this).data("jGrowl.instance")==undefined&&(e(this).data("jGrowl.instance",e.extend(new e.fn.jGrowl,{notifications:[],element:null,interval:null})),e(this).data("jGrowl.instance").startup(this)),e.isFunction(e(this).data("jGrowl.instance")[t])?e(this).data("jGrowl.instance")[t].apply(e(this).data("jGrowl.instance"),e.makeArray(r).slice(1)):e(this).data("jGrowl.instance").create(t,n)})}},e.extend(e.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"
    [ close all ]
    ",log:function(e,t,n){},beforeOpen:function(e,t,n){},afterOpen:function(e,t,n){},open:function(e,t,n){},beforeClose:function(e,t,n){},close:function(e,t,n){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(t,n){var n=e.extend({},this.defaults,n);typeof n.speed!="undefined"&&(n.openDuration=n.speed,n.closeDuration=n.speed),this.notifications.push({message:t,options:n}),n.log.apply(this.element,[this.element,t,n])},render:function(t){var n=this,r=t.message,i=t.options;i.themeState=i.themeState==""?"":"ui-state-"+i.themeState;var t=e("
    ").addClass("jGrowl-notification "+i.themeState+" ui-corner-all"+(i.group!=undefined&&i.group!=""?" "+i.group:"")).append(e("
    ").addClass("jGrowl-close").html(i.closeTemplate)).append(e("
    ").addClass("jGrowl-header").html(i.header)).append(e("
    ").addClass("jGrowl-message").html(r)).data("jGrowl",i).addClass(i.theme).children("div.jGrowl-close").bind("click.jGrowl",function(){e(this).parent().trigger("jGrowl.beforeClose")}).parent();e(t).bind("mouseover.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){i.beforeOpen.apply(t,[t,r,i,n.element])!=0&&e(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){i.open.apply(t,[t,r,i,n.element])!=0&&(i.glue=="after"?e("div.jGrowl-notification:last",n.element).after(t):e("div.jGrowl-notification:first",n.element).before(t),e(this).animate(i.animateOpen,i.openDuration,i.easing,function(){e.support.opacity===!1&&this.style.removeAttribute("filter"),e(this).data("jGrowl")!=null&&(e(this).data("jGrowl").created=new Date),e(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){i.afterOpen.apply(t,[t,r,i,n.element])}).bind("jGrowl.beforeClose",function(){i.beforeClose.apply(t,[t,r,i,n.element])!=0&&e(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){e(this).data("jGrowl.pause",!0),e(this).animate(i.animateClose,i.closeDuration,i.easing,function(){e.isFunction(i.close)?i.close.apply(t,[t,r,i,n.element])!==!1&&e(this).remove():e(this).remove()})}).trigger("jGrowl.beforeOpen"),i.corners!=""&&e.fn.corner!=undefined&&e(t).corner(i.corners),e("div.jGrowl-notification:parent",n.element).size()>1&&e("div.jGrowl-closer",n.element).size()==0&&this.defaults.closer!=0&&e(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){e(this).siblings().trigger("jGrowl.beforeClose"),e.isFunction(n.defaults.closer)&&n.defaults.closer.apply(e(this).parent()[0],[e(this).parent()[0]])})},update:function(){e(this.element).find("div.jGrowl-notification:parent").each(function(){e(this).data("jGrowl")!=undefined&&e(this).data("jGrowl").created!=undefined&&e(this).data("jGrowl").created.getTime()+parseInt(e(this).data("jGrowl").life)<(new Date).getTime()&&e(this).data("jGrowl").sticky!=1&&(e(this).data("jGrowl.pause")==undefined||e(this).data("jGrowl.pause")!=1)&&e(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(this.defaults.pool==0||e(this.element).find("div.jGrowl-notification:parent").size()
    '),this.interval=setInterval(function(){e(n).data("jGrowl.instance").update()},parseInt(this.defaults.check)),t&&e(this.element).addClass("ie6")},shutdown:function(){e(this.element).removeClass("jGrowl").find("div.jGrowl-notification").trigger("jGrowl.close").parent().empty()},close:function(){e(this.element).find("div.jGrowl-notification").each(function(){e(this).trigger("jGrowl.beforeClose")})}}),e.jGrowl.defaults=e.fn.jGrowl.prototype.defaults}(jQuery),define("jgrowl",function(){}),function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("
    "),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};lr(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)a&&(v<0||v0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.leftu[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.topu[3]?f-this.offset.click.topu[2]?l-this.offset.click.left=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-se?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n
    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery),function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),define("jquery-ui",function(){}),function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(e){return $.type(e)==="string"},runPluginCallbacks=function(Instance,a_fn){function g(e){return e}if($.isArray(a_fn))for(var i=0,c=a_fn.length;i
    ').appendTo("body"),n={width:t.css("width")-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),window.scrollbarWidth=n.width,window.scrollbarHeight=n.height,e.match(/^(width|height)$/)?n[e]:n},showInvisibly:function(e,t){if(e&&e.length&&(t||e.css("display")==="none")){var n=e[0].style,r={display:n.display||"",visibility:n.visibility||""};return e.css({display:"block",visibility:"hidden"}),r}return{}},getElementDimensions:function(e,t){var n={css:{},inset:{}},r=n.css,i={bottom:0},s=$.layout.cssNum,o=e.offset(),u,a,f;return n.offsetLeft=o.left,n.offsetTop=o.top,t||(t={}),$.each("Left,Right,Top,Bottom".split(","),function(s,o){u=r["border"+o]=$.layout.borderWidth(e,o),a=r["padding"+o]=$.layout.cssNum(e,"padding"+o),f=o.toLowerCase(),n.inset[f]=t[f]>=0?t[f]:a,i[f]=n.inset[f]+u}),r.width=e.width(),r.height=e.height(),r.top=s(e,"top",!0),r.bottom=s(e,"bottom",!0),r.left=s(e,"left",!0),r.right=s(e,"right",!0),n.outerWidth=e.outerWidth(),n.outerHeight=e.outerHeight(),n.innerWidth=max(0,n.outerWidth-i.left-i.right),n.innerHeight=max(0,n.outerHeight-i.top-i.bottom),n.layoutWidth=e.innerWidth(),n.layoutHeight=e.innerHeight(),n},getElementStyles:function(e,t){var n={},r=e[0].style,i=t.split(","),s="Top,Bottom,Left,Right".split(","),o="Color,Style,Width".split(","),u,a,f,l,c,h;for(l=0;l=s&&a<=o&&f>=i&&f<=u},msg:function(e,t,n,r){function a(){var e=$.support.fixedPosition?"fixed":"absolute",t=$('
    '+'
    '+'XLayout console.log
    '+'
      '+"
      ").appendTo("body");return t.css("left",$(window).width()-t.outerWidth()-5),$.ui.draggable&&t.draggable({handle:":first-child"}),t}if($.isPlainObject(e)&&window.debugData){typeof t=="string"?(r=n,n=t):typeof n=="object"&&(r=n,n=null);var i=n||"log( )",s=$.extend({sort:!1,returnHTML:!1,display:!1},r);t===!0||s.display?debugData(e,i,s):window.console&&console.log(debugData(e,i,s))}else if(t)alert(e);else if(window.console)console.log(e);else{var o="#layoutLogger",u=$(o);u.length||(u=a()),u.children("ul").append('
    • '+e.replace(/\/g,">")+"
    • ")}}};var u=navigator.userAgent.toLowerCase(),m=/(chrome)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||u.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u)||[],b=m[1]||"",v=m[2]||0,ie=b==="msie";$.layout.browser={version:v,safari:b==="webkit",webkit:b==="chrome",msie:ie,isIE6:ie&&v==6,boxModel:!ie||$.support.boxModel!==!1},b&&($.layout.browser[b]=!0),ie&&$(function(){$.layout.browser.boxModel=$.support.boxModel}),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(e,t){var n=t?{panes:{},center:{}}:{},r,i,s,o,u,a,f;if(typeof e!="object")return n;for(i in e){r=n,u=e[i],s=i.split("__"),f=s.length-1;for(a=0;a<=f;a++)o=s[a],a===f?$.isPlainObject(u)?r[o]=$.layout.transformData(u):r[o]=u:(r[o]||(r[o]={}),r=r[o])}return n},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(e){function o(t,n){var r=t.split("."),i=r.length-1,s={branch:e,key:r[i]},o=0,u,a;for(;o=37&&t<=40,u,a,f,l;return o&&options[n[t]].enableCursorHotkey?l=n[t]:(s||i)&&$.each(_c.borderPanes,function(e,n){u=options[n],a=u.customHotkey,f=u.customHotkeyModifier;if(i&&f=="SHIFT"||s&&f=="CTRL"||s&&i)if(a&&t===(isNaN(a)||a<=9?a.toUpperCase().charCodeAt(0):a))return l=n,!1}),!l||!$Ps[l]||!options[l].closable||state[l].isHidden?!0:(toggle(l),e.stopPropagation(),e.returnValue=!1,!1)}function allowOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n];r.cssSaved&&resetOverflow(n);if(r.isSliding||r.isResizing||r.isClosed){r.cssSaved=!1;return}var i={zIndex:options.zIndexes.resizer_normal+1},s={},o=t.css("overflow"),u=t.css("overflowX"),a=t.css("overflowY");o!="visible"&&(s.overflow=o,i.overflow="visible"),u&&!u.match(/(visible|auto)/)&&(s.overflowX=u,i.overflowX="visible"),a&&!a.match(/(visible|auto)/)&&(s.overflowY=u,i.overflowY="visible"),r.cssSaved=s,t.css(i),$.each(_c.allPanes,function(e,t){t!=n&&resetOverflow(t)})}function resetOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n],i=r.cssSaved||{};!r.isSliding&&!r.isResizing&&t.css("zIndex",options.zIndexes.pane_normal),t.css(i),r.cssSaved=!1}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(e,t,n){timer.clear(e),timer.data[e]=setTimeout(t,n)},clear:function(e){var t=timer.data;t[e]&&(clearTimeout(t[e]),delete t[e])}},_log=function(e,t,n){var r=options;return(r.showErrorMessages&&!n||n&&r.showDebugMessages)&&$.layout.msg(r.name+" / "+e,t!==!1),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(e){return e}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P;!hasPane&&$.type(pane)==="boolean"&&(skipBoundEvents=pane,pane="");if(fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(args.length?retVal=g(fn)(args[1]):hasPane?retVal=g(fn)(pane,$Ps[pane],s,o,lName):retVal=g(fn)(Instance,s,o,lName))}catch(ex){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),$.type(ex)==="string"&&string.length&&_log("Exception: "+ex,!1)}return!skipBoundEvents&&retVal!==!1&&(hasPane?($P=$Ps[pane],o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&evtName==="onresize_end"&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(e){if(browser.mozilla)return;var t=$Ps[e];state[e].tagName==="IFRAME"?t.css(_c.hidden).css(_c.visible):t.find("IFRAME").css(_c.hidden).css(_c.visible)},cssSize=function(e,t){var n=_c[e].dir=="horz"?cssH:cssW;return n($Ps[e],t)},cssMinDims=function(e){var t=$Ps[e],n=_c[e].dir,r={minWidth:1001-cssW(t,1e3),minHeight:1001-cssH(t,1e3)};return n==="horz"&&(r.minSize=r.minHeight),n==="vert"&&(r.minSize=r.minWidth),r},setOuterWidth=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssW(r,t),r.css({width:i}),i>0?n&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssH(r,t),r.css({height:i,visibility:"visible"}),i>0&&r.innerWidth()>0?n&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(e,t,n){n||(n=_c[e].dir),isStr(t)&&t.match(/%/)&&(t=t==="100%"?-1:parseInt(t,10)/100);if(t===0)return 0;if(t>=1)return parseInt(t,10);var r=options,i=0;n=="horz"?i=sC.innerHeight-($Ps.north?r.north.spacing_open:0)-($Ps.south?r.south.spacing_open:0):n=="vert"&&(i=sC.innerWidth-($Ps.west?r.west.spacing_open:0)-($Ps.east?r.east.spacing_open:0));if(t===-1)return i;if(t>0)return round(i*t);if(e=="center")return 0;var s=n==="horz"?"height":"width",o=$Ps[e],u=s==="height"?$Cs[e]:!1,a=$.layout.showInvisibly(o),f=o.css(s),l=u?u.css(s):0;return o.css(s,"auto"),u&&u.css(s,"auto"),t=s==="height"?o.outerHeight():o.outerWidth(),o.css(s,f).css(a),u&&u.css(s,l),t},getPaneSize=function(e,t){var n=$Ps[e],r=options[e],i=state[e],s=t?r.spacing_open:0,o=t?r.spacing_closed:0;return!n||i.isHidden?0:i.isClosed||i.isSliding&&t?o:_c[e].dir==="horz"?n.outerHeight()+s:n.outerWidth()+s},setSizeLimits=function(e,t){if(!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=i.sizeType.toLowerCase(),u=t!=undefined?t:r.isSliding,a=$Ps[e],f=n.spacing_open,l=_c.oppositeEdge[e],c=state[l],h=$Ps[l],p=!h||c.isVisible===!1||c.isSliding?0:s=="horz"?h.outerHeight():h.outerWidth(),d=(!h||c.isHidden?0:options[l][c.isClosed!==!1?"spacing_closed":"spacing_open"])||0,v=s=="horz"?sC.innerHeight:sC.innerWidth,m=cssMinDims("center"),g=s=="horz"?max(options.center.minHeight,m.minHeight):max(options.center.minWidth,m.minWidth),y=v-f-(u?0:_parseSize("center",g,s)+p+d),b=r.minSize=max(_parseSize(e,n.minSize),cssMinDims(e).minSize),w=r.maxSize=min(n.maxSize?_parseSize(e,n.maxSize):1e5,y),E=r.resizerPosition={},S=sC.inset.top,x=sC.inset.left,T=sC.innerWidth,N=sC.innerHeight,C=n.spacing_open;switch(e){case"north":E.min=S+b,E.max=S+w;break;case"west":E.min=x+b,E.max=x+w;break;case"south":E.min=S+N-w-C,E.max=S+N-b-C;break;case"east":E.min=x+T-w-C,E.max=x+T-b-C}},calcNewCenterPaneDims=function(){var e={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return e.width=sC.innerWidth-e.left-e.right,e.height=sC.innerHeight-e.bottom-e.top,e.top+=sC.inset.top,e.bottom+=sC.inset.bottom,e.left+=sC.inset.left,e.right+=sC.inset.right,e},getHoverClasses=function(e,t){var n=$(e),r=n.data("layoutRole"),i=n.data("layoutEdge"),s=options[i],o=s[r+"Class"],u="-"+i,a="-open",f="-closed",l="-sliding",c="-hover ",h=n.hasClass(o+f)?f:a,p=h===f?a:f,d=o+c+(o+u+c)+(o+h+c)+(o+u+h+c);return t&&(d+=o+p+c+(o+u+p+c)),r=="resizer"&&n.hasClass(o+l)&&(d+=o+l+c+(o+u+l+c)),$.trim(d)},addHover=function(e,t){var n=$(t||this);e&&n.data("layoutRole")==="toggler"&&e.stopPropagation(),n.addClass(getHoverClasses(n))},removeHover=function(e,t){var n=$(t||this);n.removeClass(getHoverClasses(n,!0))},onResizerEnter=function(e){var t=$(this).data("layoutEdge"),n=state[t];if(n.isClosed||n.isResizing||state.paneResizing)return;$.fn.disableSelection&&$("body").disableSelection(),options.maskPanesEarly&&showMasks(t,{resizing:!0})},onResizerLeave=function(e,t){var n=t||this,r=$(n).data("layoutEdge"),i=r+"ResizerLeave";timer.clear(r+"_openSlider"),timer.clear(i),t?state.paneResizing||($.fn.enableSelection&&$("body").enableSelection(),options.maskPanesEarly&&hideMasks()):timer.set(i,function(){onResizerLeave(e,n)},200)},_create=function(){initOptions();var e=options,t=state;return t.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),e.initPanes&&_initLayoutElements(),delete t.creatingLayout,state.initialized)},isInitialized=function(){return state.initialized||state.creatingLayout?!0:_initLayoutElements()},_initLayoutElements=function(e){var t=options;if(!$N.is(":visible"))return!e&&browser.webkit&&$N[0].tagName==="BODY"&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(t.errors.centerPaneMissing);state.creatingLayout=!0,$.extend(sC,elDims($N,t.inset)),initPanes();if(t.scrollToBookmarkOnLoad){var n=self.location;n.hash&&n.replace(n.hash)}return Instance.hasParentLayout?t.resizeWithWindow=!1:t.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(e,t){var n=evtPane.call(this,e),r=$Ps[n];if(!r)return;var i=$Cs[n],s=state[n],o=options[n],u=options.stateManagement||{},a=t?o.children=t:o.children;if($.isPlainObject(a))a=[a];else if(!a||!$.isArray(a))return;$.each(a,function(e,t){if(!$.isPlainObject(t))return;var o=t.containerSelector?r.find(t.containerSelector):i||r;o.each(function(){var e=$(this),r=e.data("layout");if(!r){setInstanceKey({container:e,options:t},s);if(u.includeChildren&&state.stateData[n]){var i=state.stateData[n].children||{},o=i[t.instanceKey],a=t.stateManagement||(t.stateManagement={autoLoad:!0});a.autoLoad===!0&&o&&(a.autoSave=!1,a.includeChildren=!0,a.autoLoad=$.extend(!0,{},o))}r=e.layout(t),r&&refreshChildren(n,r)}})})},setInstanceKey=function(e,t){var n=e.container,r=e.options,i=r.stateManagement,s=r.instanceKey||n.data("layoutInstanceKey");return s||(s=(i&&i.cookie?i.cookie.name:"")||r.name),s?s=s.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):s="layout"+ ++t.childIdx,r.instanceKey=s,n.data("layoutInstanceKey",s),s},refreshChildren=function(e,t){var n=$Ps[e],r=children[e],i=state[e],s;$.isPlainObject(r)&&($.each(r,function(e,t){t.destroyed&&delete r[e]}),$.isEmptyObject(r)&&(r=children[e]=null)),!t&&!r&&(t=n.data("layout")),t&&(t.hasParentLayout=!0,s=t.options,setInstanceKey(t,i),r||(r=children[e]={}),r[s.instanceKey]=t.container.data("layout")),Instance[e].children=children[e],t||createChildren(e)},windowResize=function(){var e=options,t=Number(e.resizeWithWindowDelay);t<10&&(t=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var t=elDims($N,e.inset);(t.innerWidth!==sC.innerWidth||t.innerHeight!==sC.innerHeight)&&resizeAll()},t),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var e=Number(options.resizeWithWindowMaxDelay);e>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},e)},unload=function(){var e=options;_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var e=$N[0],t=$("html"),n=sC.tagName=e.tagName,r=sC.id=e.id,i=sC.className=e.className,s=options,o=s.name,u="position,margin,padding,border",a="layoutCSS",f={},l="hidden",c=$N.data("parentLayout"),h=$N.data("layoutEdge"),p=c&&h,d=$.layout.cssNum,v,m;sC.selector=$N.selector.split(".slice")[0],sC.ref=(s.name?s.name+" layout / ":"")+n+(r?"#"+r:i?".["+i+"]":""),sC.isBody=n==="BODY",!p&&!sC.isBody&&(v=$N.closest("."+$.layout.defaults.panes.paneClass),c=v.data("parentLayout"),h=v.data("layoutEdge"),p=c&&h),$N.data({layout:Instance,layoutContainer:sID}).addClass(s.containerClass);var g={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(o in g)$N.bind("layout"+o.toLowerCase()+"."+sID,Instance[g[o]||o]);p&&(Instance.hasParentLayout=!0,c.refreshChildren(h,Instance)),$N.data(a)||(sC.isBody?($N.data(a,$.extend(styles($N,u),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),t.data(a,$.extend(styles(t,"padding"),{height:"auto",overflow:t.css("overflow"),overflowX:t.css("overflowX"),overflowY:t.css("overflowY")}))):$N.data(a,styles($N,u+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{f={overflow:l,overflowX:l,overflowY:l},$N.css(f),s.inset&&!$.isPlainObject(s.inset)&&(m=parseInt(s.inset,10)||0,s.inset={top:m,bottom:m,left:m,right:m});if(sC.isBody)s.outset?$.isPlainObject(s.outset)||(m=parseInt(s.outset,10)||0,s.outset={top:m,bottom:m,left:m,right:m}):s.outset={top:d(t,"paddingTop"),bottom:d(t,"paddingBottom"),left:d(t,"paddingLeft"),right:d(t,"paddingRight")},t.css(f).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),s.inset||(s.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(s.outset)),$.extend(sC,elDims($N,s.inset));else{var y=$N.css("position");(!y||!y.match(/(fixed|absolute|relative)/))&&$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,s.inset)),sC.innerHeight<1&&_log(s.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}d($N,"minWidth")&&$N.parent().css("overflowX","auto"),d($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(b){}},initHotkeys=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=options[t];if(n.enableCursorHotkey||n.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function c(e){var t=options[e],n=options.panes;t.fxSettings||(t.fxSettings={}),n.fxSettings||(n.fxSettings={}),$.each(["_open","_close","_size"],function(r,i){var s="fxName"+i,o="fxSpeed"+i,u="fxSettings"+i,a=t[s]=t[s]||n[s]||t.fxName||n.fxName||"none",f=$.effects&&($.effects[a]||$.effects.effect&&$.effects.effect[a]);if(a==="none"||!options.effects[a]||!f)a=t[s]="none";var l=options.effects[a]||{},c=l.all||null,h=l[e]||null;t[o]=t[o]||n[o]||t.fxSpeed||n.fxSpeed||null,t[u]=$.extend(!0,{},c,h,n.fxSettings,t.fxSettings,n[u],t[u])}),delete t.fxName,delete t.fxSpeed,delete t.fxSettings}var e,t,n,r,i,s,o,u;opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts);if(!$.isEmptyObject(opts.panes)){e=$.layout.optionsMap.noDefault;for(s=0,o=e.length;s0&&(l.pane_normal=f,l.content_mask=max(f+1,l.content_mask),l.resizer_normal=max(f+2,l.resizer_normal)),delete options.panes},getPane=function(e){var t=options[e].paneSelector;if(t.substr(0,1)==="#")return $N.find(t).eq(0);var n=$N.children(t).eq(0);return n.length?n:$N.children("form:first").children(t).eq(0)},initPanes=function(e){evtPane(e),$.each(_c.allPanes,function(e,t){addPane(t,!0)}),initHandles(),$.each(_c.borderPanes,function(e,t){$Ps[t]&&state[t].isVisible&&(setSizeLimits(t),makePaneFit(t))}),sizeMidPanes("center"),$.each(_c.allPanes,function(e,t){afterInitPane(t)})},addPane=function(e,t){if(!t&&!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=r.fx,u=n.spacing_open||0,a=e==="center",f={},l=$Ps[e],c,h,p,d;l?removePane(e,!1,!0,!1):$Cs[e]=!1,l=$Ps[e]=getPane(e);if(!l.length){$Ps[e]=!1;return}if(!l.data("layoutCSS")){var v="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";l.data("layoutCSS",styles(l,v))}Instance[e]={name:e,pane:$Ps[e],content:$Cs[e],options:options[e],state:state[e],children:children[e]},l.data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"pane"}).css(i.cssReq).css("zIndex",options.zIndexes.pane_normal).css(n.applyDemoStyles?i.cssDemo:{}).addClass(n.paneClass+" "+n.paneClass+"-"+e).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var m={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"},g;for(g in m)l.bind("layoutpane"+g.toLowerCase()+"."+sID,Instance[m[g]||g]);initContent(e,!1),a||(c=r.size=_parseSize(e,n.size),h=_parseSize(e,n.minSize)||1,p=_parseSize(e,n.maxSize)||1e5,c>0&&(c=max(min(c,p),h)),r.autoResize=n.autoResize,r.isClosed=!1,r.isSliding=!1,r.isResizing=!1,r.isHidden=!1,r.pins||(r.pins=[])),r.tagName=l[0].tagName,r.edge=e,r.noRoom=!1,r.isVisible=!0,setPanePosition(e),s==="horz"?f.height=cssH(l,c):s==="vert"&&(f.width=cssW(l,c)),l.css(f),s!="horz"&&sizeMidPanes(e,!0),state.initialized&&(initHandles(e),initHotkeys(e)),n.initClosed&&n.closable&&!n.initHidden?close(e,!0,!0):n.initHidden||n.initClosed?hide(e):r.noRoom||l.css("display","block"),l.css("visibility","visible"),n.showOverflowOnHover&&l.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(e)},afterInitPane=function(e){var t=$Ps[e],n=state[e],r=options[e];if(!t)return;t.data("layout")&&refreshChildren(e,t.data("layout")),n.isVisible&&(state.initialized?resizeAll():sizeContent(e),r.triggerEventsOnLoad?_runCallbacks("onresize_end",e):resizeChildren(e,!0)),r.initChildren&&r.children&&createChildren(e)},setPanePosition=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t],r=$Rs[t],i=options[t],s=state[t],o=_c[t].side,u={};if(!n)return;switch(t){case"north":u.top=sC.inset.top,u.left=sC.inset.left,u.right=sC.inset.right;break;case"south":u.bottom=sC.inset.bottom,u.left=sC.inset.left,u.right=sC.inset.right;break;case"west":u.left=sC.inset.left;break;case"east":u.right=sC.inset.right;break;case"center":}n.css(u),r&&s.isClosed?r.css(o,sC.inset[o]):r&&!s.isHidden&&r.css(o,sC.inset[o]+getPaneSize(t))})},initHandles=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t];$Rs[t]=!1,$Ts[t]=!1;if(!n)return;var r=options[t],i=state[t],s=_c[t],o=r.paneSelector.substr(0,1)==="#"?r.paneSelector.substr(1):"",u=r.resizerClass,a=r.togglerClass,f=i.isVisible?r.spacing_open:r.spacing_closed,l="-"+t,c=i.isVisible?"-open":"-closed",h=Instance[t],p=h.resizer=$Rs[t]=$("
      "),d=h.toggler=r.closable?$Ts[t]=$("
      "):!1;!i.isVisible&&r.slidable&&p.attr("title",r.tips.Slide).css("cursor",r.sliderCursor),p.attr("id",o?o+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(r.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(u+" "+u+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).appendTo($N),r.resizerDblClickToggle&&p.bind("dblclick."+sID,toggle),d&&(d.attr("id",o?o+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(r.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(a+" "+a+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(p),r.togglerContent_open&&$(""+r.togglerContent_open+"").data({layoutEdge:t,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",t).addClass("content content-open").css("display","none").appendTo(d),r.togglerContent_closed&&$(""+r.togglerContent_closed+"").data({layoutEdge:t,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(d),enableClosable(t)),initResizable(t),i.isVisible?setAsOpen(t):(setAsClosed(t),bindStartSlidingEvents(t,!0))}),sizeHandles()},initContent=function(e,t){if(!isInitialized())return;var n=options[e],r=n.contentSelector,i=Instance[e],s=$Ps[e],o;r&&(o=i.content=$Cs[e]=n.findNestedContent?s.find(r).eq(0):s.children(r).eq(0)),o&&o.length?(o.data("layoutRole","content"),o.data("layoutCSS")||o.data("layoutCSS",styles(o,"height")),o.css(_c.content.cssReq),n.applyDemoStyles&&(o.css(_c.content.cssDemo),s.css(_c.content.cssDemoPane)),s.css("overflowX").match(/(scroll|auto)/)&&s.css("overflow","hidden"),state[e].content={},t!==!1&&sizeContent(e)):i.content=$Cs[e]=!1},initResizable=function(e){var t=$.layout.plugins.draggable,n;e=e?e.split(","):_c.borderPanes,$.each(e,function(e,n){var i=options[n];if(!t||!$Ps[n]||!i.resizable)return i.resizable=!1,!0;var s=state[n],o=options.zIndexes,u=_c[n],a=u.dir=="horz"?"top":"left",f=$Ps[n],l=$Rs[n],c=i.resizerClass,h=0,p,d,v=c+"-drag",m=c+"-"+n+"-drag",g=c+"-dragging",y=c+"-"+n+"-dragging",b=c+"-dragging-limit",w=c+"-"+n+"-dragging-limit",E=!1;s.isClosed||l.attr("title",i.tips.Resize).css("cursor",i.resizerCursor),l.draggable({containment:$N[0],axis:u.dir=="horz"?"y":"x",delay:0,distance:1,grid:i.resizingGrid,helper:"clone",opacity:i.resizerDragOpacity,addClasses:!1,zIndex:o.resizer_drag,start:function(e,t){i=options[n],s=state[n],d=i.livePaneResizing;if(!1===_runCallbacks("ondrag_start",n))return!1;s.isResizing=!0,state.paneResizing=n,timer.clear(n+"_closeSlider"),setSizeLimits(n),p=s.resizerPosition,h=t.position[a],l.addClass(v+" "+m),E=!1,$("body").disableSelection(),showMasks(n,{resizing:!0})},drag:function(e,t){E||(t.helper.addClass(g+" "+y).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),E=!0,s.isSliding&&$Ps[n].css("zIndex",o.pane_sliding));var u=0;t.position[a]p.max&&(t.position[a]=p.max,u=1),u?(t.helper.addClass(b+" "+w),window.defaultStatus=u>0&&n.match(/(north|west)/)||u<0&&n.match(/(south|east)/)?i.tips.maxSizeWarning:i.tips.minSizeWarning):(t.helper.removeClass(b+" "+w),window.defaultStatus=""),d&&Math.abs(t.position[a]-h)>=i.liveResizingTolerance&&(h=t.position[a],r(e,t,n))},stop:function(e,t){$("body").enableSelection(),window.defaultStatus="",l.removeClass(v+" "+m),s.isResizing=!1,state.paneResizing=!1,r(e,t,n,!0)}})});var r=function(e,t,n,r){var i=t.position,s=_c[n],o=options[n],u=state[n],a;switch(n){case"north":a=i.top;break;case"west":a=i.left;break;case"south":a=sC.layoutHeight-i.top-o.spacing_open;break;case"east":a=sC.layoutWidth-i.left-o.spacing_open}var f=a-sC.inset[s.side];if(!r){if(Math.abs(f-u.size)=0;t--)r=$Ms.eq(t),n=r.data("layoutMask"),options[n].maskObjects||r.hide()}},getMasks=function(e){var t=$([]),n,r=0,i=$Ms.length;for(;rf.maxSize)return syncPinBtns(i,!1),!r&&a.tips.noRoomToOpen&&alert(a.tips.noRoomToOpen),e();t?bindStopSlidingEvents(i,!0):f.isSliding?bindStopSlidingEvents(i,!1):a.slidable&&bindStartSlidingEvents(i,!1),f.noRoom=!1,makePaneFit(i),h=f.isShowing,delete f.isShowing,c=!n&&f.isClosed&&a.fxName_open!="none",f.isMoving=!0,f.isVisible=!0,f.isClosed=!1,h&&(f.isHidden=!1),c?(lockPaneForFX(i,!0),s.show(a.fxName_open,a.fxSettings_open,a.fxSpeed_open,function(){lockPaneForFX(i,!1),f.isVisible&&p(),e()})):(_showPane(i),p(),e())})},setAsOpen=function(e,t){var n=$Ps[e],r=$Rs[e],i=$Ts[e],s=options[e],o=state[e],u=_c[e].side,a=s.resizerClass,f=s.togglerClass,l="-"+e,c="-open",h="-closed",p="-sliding";r.css(u,sC.inset[u]+getPaneSize(e)).removeClass(a+h+" "+a+l+h).addClass(a+c+" "+a+l+c),o.isSliding?r.addClass(a+p+" "+a+l+p):r.removeClass(a+p+" "+a+l+p),removeHover(0,r),s.resizable&&$.layout.plugins.draggable?r.draggable("enable").css("cursor",s.resizerCursor).attr("title",s.tips.Resize):o.isSliding||r.css("cursor","default"),i&&(i.removeClass(f+h+" "+f+l+h).addClass(f+c+" "+f+l+c).attr("title",s.tips.Close),removeHover(0,i),i.children(".content-closed").hide(),i.children(".content-open").css("display","block")),syncPinBtns(e,!o.isSliding),$.extend(o,elDims(n)),state.initialized&&(sizeHandles(),sizeContent(e,!0)),!t&&(state.initialized||s.triggerEventsOnLoad)&&n.is(":visible")&&(_runCallbacks("onopen_end",e),o.isShowing&&_runCallbacks("onshow_end",e),state.initialized&&_runCallbacks("onresize_end",e))},slideOpen=function(e){function s(){r.isClosed?r.isMoving||open(n,!0):bindStopSlidingEvents(n,!0)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=state[n],i=options[n].slideDelay_open;t&&t.stopImmediatePropagation(),r.isClosed&&t&&t.type==="mouseenter"&&i>0?timer.set(n+"_openSlider",s,i):s()},slideClose=function(e){function o(){i.isClosed?bindStopSlidingEvents(n,!1):i.isMoving||close(n)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=options[n],i=state[n],s=i.isMoving?1e3:300;if(i.isClosed||i.isResizing)return;if(r.slideTrigger_close==="click")o();else{if(r.preventQuickSlideClose&&i.isMoving)return;if(r.preventPrematureSlideClose&&t&&$.layout.isMouseOverElem(t,$Ps[n]))return;t?timer.set(n+"_closeSlider",o,max(r.slideDelay_close,s)):o()}},slideToggle=function(e){var t=evtPane.call(this,e);toggle(t,!0)},lockPaneForFX=function(e,t){var n=$Ps[e],r=state[e],i=options[e],s=options.zIndexes;t?(showMasks(e,{animation:!0,objectsOnly:!0}),n.css({zIndex:s.pane_animate}),e=="south"?n.css({top:sC.inset.top+sC.innerHeight-n.outerHeight()}):e=="east"&&n.css({left:sC.inset.left+sC.innerWidth-n.outerWidth()})):(hideMasks(),n.css({zIndex:r.isSliding?s.pane_sliding:s.pane_normal}),e=="south"?n.css({top:"auto"}):e=="east"&&!n.css("left").match(/\-99999/)&&n.css({left:"auto"}),browser.msie&&i.fxOpacityFix&&i.fxName_open!="slide"&&n.css("filter")&&n.css("opacity")==1&&n[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(e,t){var n=options[e],r=$Ps[e],i=$Rs[e],s=n.slideTrigger_open.toLowerCase();if(!i||t&&!n.slidable)return;s.match(/mouseover/)?s=n.slideTrigger_open="mouseenter":s.match(/(click|dblclick|mouseenter)/)||(s=n.slideTrigger_open="click"),n.resizerDblClickToggle&&s.match(/click/)&&i[t?"unbind":"bind"]("dblclick."+sID,toggle),i[t?"bind":"unbind"](s+"."+sID,slideOpen).css("cursor",t?n.sliderCursor:"default").attr("title",t?n.tips.Slide:"")},bindStopSlidingEvents=function(e,t){function l(t){timer.clear(e+"_closeSlider"),t.stopPropagation()}var n=options[e],r=state[e],i=_c[e],s=options.zIndexes,o=n.slideTrigger_close.toLowerCase(),u=t?"bind":"unbind",a=$Ps[e],f=$Rs[e];timer.clear(e+"_closeSlider"),t?(r.isSliding=!0,state.panesSliding[e]=!0,bindStartSlidingEvents(e,!1)):(r.isSliding=!1,delete state.panesSliding[e]),a.css("zIndex",t?s.pane_sliding:s.pane_normal),f.css("zIndex",t?s.pane_sliding+2:s.resizer_normal),o.match(/(click|mouseleave)/)||(o=n.slideTrigger_close="mouseleave"),f[u](o,slideClose),o==="mouseleave"&&(a[u]("mouseleave."+sID,slideClose),f[u]("mouseenter."+sID,l),a[u]("mouseenter."+sID,l)),t?o==="click"&&!n.resizable&&(f.css("cursor",t?n.sliderCursor:"default"),f.attr("title",t?n.tips.Close:"")):timer.clear(e+"_closeSlider")},makePaneFit=function(e,t,n,r){var i=options[e],s=state[e],o=_c[e],u=$Ps[e],a=$Rs[e],f=o.dir==="vert",l=!1;if(e==="center"||f&&s.noVerticalRoom)l=s.maxHeight>=0,l&&s.noRoom?(_showPane(e),a&&a.show(),s.isVisible=!0,s.noRoom=!1,f&&(s.noVerticalRoom=!1),_fixIframe(e)):!l&&!s.noRoom&&(_hidePane(e),a&&a.hide(),s.isVisible=!1,s.noRoom=!0);if(e!=="center")if(s.minSize<=s.maxSize){l=!0;if(s.size>s.maxSize)sizePane(e,s.maxSize,n,!0,r);else if(s.sizet?p.attempt=max(0,o.attempt-(o.actual-t)):p.attempt=max(0,o.attempt+(t-o.actual)),p.cssSize=cssSize(s,p.attempt),a.css(c,p.cssSize),p.actual=c=="width"?a.outerWidth():a.outerHeight(),p.correct=t===p.actual,r.length===1&&(_log(m,!1,!0),_log(o,!1,!0)),_log(p,!1,!0);if(r.length>3)break;r.push(p),o=r[r.length-1]}u.size=t,$.extend(u,elDims(a)),u.isVisible&&a.is(":visible")&&(f&&f.css(l,t+sC.inset[l]),sizeContent(s)),!n&&!h&&state.initialized&&u.isVisible&&_runCallbacks("onresize_end",s),n||(u.isSliding||sizeMidPanes(_c[s].dir=="horz"?"":"center",h,i),sizeHandles());var g=_c.oppositeEdge[s];t1&&_log(m+"\nSee the Error Console for details.",!0,!0)}if(!isInitialized())return;var s=evtPane.call(this,e),o=options[s],u=state[s],a=$Ps[s],f=$Rs[s],l=_c[s].side,c=_c[s].sizeType.toLowerCase(),h=u.isResizing&&!o.triggerEventsDuringLiveResize,p=r!==!0&&o.animatePaneSizing,d,v;$N.queue(function(e){setSizeLimits(s),d=u.size,t=_parseSize(s,t),t=max(t,_parseSize(s,o.minSize)),t=min(t,u.maxSize);if(t=0&&l.height>=0;if(!state.initialized&&i.minWidth>h.width){var p=i.minWidth-s.outerWidth,d=options.east.minSize||0,v=options.west.minSize||0,m=state.east.size,g=state.west.size,y=m,b=g;p>0&&state.east.isVisible&&m>d&&(y=max(m-d,m-p),p-=m-y),p>0&&state.west.isVisible&&g>v&&(b=max(g-v,g-p),p-=g-b);if(p===0){m&&m!=d&&sizePane("east",y,!0,!0,n),g&&g!=v&&sizePane("west",b,!0,!0,n),sizeMidPanes("center",t,n),o.css(c);return}}}else{s.isVisible&&!s.noVerticalRoom&&$.extend(s,elDims(o),cssMinDims(r));if(!n&&!s.noVerticalRoom&&h.height===s.outerHeight)return o.css(c),!0;l.top=h.top,l.bottom=h.bottom,s.newSize=h.height,l.height=cssH(o,h.height),s.maxHeight=l.height,f=s.maxHeight>=0,f||(s.noVerticalRoom=!0)}f?(!t&&state.initialized&&_runCallbacks("onresize_start",r),o.css(l),r!=="center"&&sizeHandles(r),s.noRoom&&!s.isClosed&&!s.isHidden&&makePaneFit(r),s.isVisible&&($.extend(s,elDims(o)),state.initialized&&sizeContent(r))):!s.noRoom&&s.isVisible&&makePaneFit(r),o.css(c),delete s.newSize,delete s.newWidth,delete s.newHeight;if(!s.isVisible)return!0;if(r==="center"){var w=browser.isIE6||!browser.boxModel;$Ps.north&&(w||state.north.tagName=="IFRAME")&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(w||state.south.tagName=="IFRAME")&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!t&&state.initialized&&_runCallbacks("onresize_end",r)})},resizeAll=function(e){var t=sC.innerWidth,n=sC.innerHeight;evtPane(e);if(!$N.is(":visible"))return;if(!state.initialized){_initLayoutElements();return}e===!0&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset));if(!sC.outerHeight)return;e===!0&&setPanePosition();if(!1===_runCallbacks("onresizeall_start"))return!1;var r=sC.innerHeight0&&r.css("overflow")==="hidden"&&(r.css("overflow","visible"),l(),r.css("overflow","hidden"));var a=o.innerHeight-(u.spaceAbove-o.css.paddingTop)-(u.spaceBelow-o.css.paddingBottom);if(!i.is(":visible")||u.height!=a)setOuterHeight(i,a,!0),u.height=a;state.initialized&&_runCallbacks("onsizecontent_end",n)})},sizeHandles=function(e){var t=evtPane.call(this,e);t=t?t.split(","):_c.borderPanes,$.each(t,function(e,t){var n=options[t],r=state[t],i=$Ps[t],s=$Rs[t],o=$Ts[t],u;if(!i||!s)return;var a=_c[t].dir,f=r.isClosed?"_closed":"_open",l=n["spacing"+f],c=n["togglerAlign"+f],h=n["togglerLength"+f],p,d,v,m={};if(l===0){s.hide();return}!r.noRoom&&!r.isHidden&&s.show(),a==="horz"?(p=sC.innerWidth,r.resizerLength=p,d=$.layout.cssNum(i,"left"),s.css({width:cssW(s,p),height:cssH(s,l),left:d>-9999?d:sC.inset.left})):(p=i.outerHeight(),r.resizerLength=p,s.css({height:cssH(s,p),width:cssW(s,l),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(n,s);if(o){if(h===0||r.isSliding&&n.hideTogglerOnSlide){o.hide();return}o.show();if(!(h>0)||h==="100%"||h>p)h=p,v=0;else if(isStr(c))switch(c){case"top":case"left":v=0;break;case"bottom":case"right":v=p-h;break;case"middle":case"center":default:v=round((p-h)/2)}else{var g=parseInt(c,10);c>=0?v=g:v=p-h+g}if(a==="horz"){var y=cssW(o,h);o.css({width:y,height:cssH(o,l),left:v,top:0}),o.children(".content").each(function(){u=$(this),u.css("marginLeft",round((y-u.outerWidth())/2))})}else{var b=cssH(o,h);o.css({height:b,width:cssW(o,l),top:v,left:0}),o.children(".content").each(function(){u=$(this),u.css("marginTop",round((b-u.outerHeight())/2))})}removeHover(0,o)}!state.initialized&&(n.initHidden||r.isHidden)&&(s.hide(),o&&o.hide())})},enableClosable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Ts[t],r=options[t];if(!n)return;r.closable=!0,n.bind("click."+sID,function(e){e.stopPropagation(),toggle(t)}).css("visibility","visible").css("cursor","pointer").attr("title",state[t].isClosed?r.tips.Open:r.tips.Close).show()},disableClosable=function(e,t){if(!isInitialized())return;var n=evtPane.call(this,e),r=$Ts[n];if(!r)return;options[n].closable=!1,state[n].isClosed&&open(n,!1,!0),r.unbind("."+sID).css("visibility",t?"hidden":"visible").css("cursor","default").attr("title","")},enableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].slidable=!0,state[t].isClosed&&bindStartSlidingEvents(t,!0)},disableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n)return;options[t].slidable=!1,state[t].isSliding?close(t,!1,!0):(bindStartSlidingEvents(t,!1),n.css("cursor","default").attr("title",""),removeHover(null,n[0]))},enableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t],r=options[t];if(!n||!n.data("draggable"))return;r.resizable=!0,n.draggable("enable"),state[t].isClosed||n.css("cursor",r.resizerCursor).attr("title",r.tips.Resize)},disableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].resizable=!1,n.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,n[0])},swapPanes=function(e,t){function o(e){var t=$Ps[e],n=$Cs[e];return t?{pane:e,P:t?t[0]:!1,C:n?n[0]:!1,state:$.extend(!0,{},state[e]),options:$.extend(!0,{},options[e])}:!1}function u(e,t){if(!e)return;var n=e.P,r=e.C,i=e.pane,o=_c[t],u=$.extend(!0,{},state[t]),a=options[t],f={resizerCursor:a.resizerCursor},l,c,h;$.each("fxName,fxSpeed,fxSettings".split(","),function(e,t){f[t+"_open"]=a[t+"_open"],f[t+"_close"]=a[t+"_close"],f[t+"_size"]=a[t+"_size"]}),$Ps[t]=$(n).data({layoutPane:Instance[t],layoutEdge:t}).css(_c.hidden).css(o.cssReq),$Cs[t]=r?$(r):!1,options[t]=$.extend(!0,{},e.options,f),state[t]=$.extend(!0,{},e.state),l=new RegExp(a.paneClass+"-"+i,"g"),n.className=n.className.replace(l,a.paneClass+"-"+t),initHandles(t),o.dir!=_c[i].dir?(c=s[t]||0,setSizeLimits(t),c=max(c,state[t].minSize),manualSizePane(t,c,!0,!0)):$Rs[t].css(o.side,sC.inset[o.side]+(state[t].isVisible?getPaneSize(t):0)),e.state.isVisible&&!u.isVisible?setAsOpen(t,!0):(setAsClosed(t),bindStartSlidingEvents(t,!0)),e=null}if(!isInitialized())return;var n=evtPane.call(this,e);state[n].edge=t,state[t].edge=n;if(!1===_runCallbacks("onswap_start",n)||!1===_runCallbacks("onswap_start",t)){state[n].edge=n,state[t].edge=t;return}var r=o(n),i=o(t),s={};s[n]=r?r.state.size:0,s[t]=i?i.state.size:0,$Ps[n]=!1,$Ps[t]=!1,state[n]={},state[t]={},$Ts[n]&&$Ts[n].remove(),$Ts[t]&&$Ts[t].remove(),$Rs[n]&&$Rs[n].remove(),$Rs[t]&&$Rs[t].remove(),$Rs[n]=$Rs[t]=$Ts[n]=$Ts[t]=!1,u(r,t),u(i,n),r=i=s=null,$Ps[n]&&$Ps[n].css(_c.visible),$Ps[t]&&$Ps[t].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",n),_runCallbacks("onswap_end",t);return},syncPinBtns=function(e,t){$.layout.plugins.buttons&&$.each(state[e].pins,function(n,r){$.layout.buttons.setPinState(Instance,$(r),e,t)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return _create()==="cancel"?null:Instance}}(jQuery),function(e){e.ui||(e.ui={}),e.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(t){var n=document.cookie,r=n?n.split(";"):[],i;for(var s=0,o=r.length;s0&&(a=parseInt(a,10),f="number"),f==="number"&&(s=new Date,a>0?s.setDate(s.getDate()+a):(s.setFullYear(1970),o=!0)),s&&(i+=";expires="+s.toUTCString()),u.path&&(i+=";path="+u.path),u.domain&&(i+=";domain="+u.domain),u.secure&&(i+=";secure"),document.cookie=t+"="+(o?"":encodeURIComponent(n))+i},clear:function(t){e.ui.cookie.write(t,"",{expires:-1})}},e.cookie||(e.cookie=function(t,n,r){var i=e.ui.cookie;if(n===null)i.clear(t);else{if(n===undefined)return i.read(t);i.write(t,n,r)}}),e.layout.plugins.stateManagement=!0,e.layout.config.optionRootKeys.push("stateManagement"),e.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},e.layout.optionsMap.layout.push("stateManagement"),e.layout.state={saveCookie:function(t,n,r){var i=t.options,s=i.stateManagement,o=e.extend(!0,{},s.cookie,r||null),u=t.state.stateData=t.readState(n||s.stateKeys);return e.ui.cookie.write(o.name||i.name||"Layout",e.layout.state.encodeJSON(u),o),e.extend(!0,{},u)},deleteCookie:function(t){var n=t.options;e.ui.cookie.clear(n.stateManagement.cookie.name||n.name||"Layout")},readCookie:function(t){var n=t.options,r=e.ui.cookie.read(n.stateManagement.cookie.name||n.name||"Layout");return r?e.layout.state.decodeJSON(r):{}},loadCookie:function(t){var n=e.layout.state.readCookie(t);return n&&(t.state.stateData=e.extend(!0,{},n),t.loadState(n)),n},loadState:function(t,n,r){if(!e.isPlainObject(n)||e.isEmptyObject(n))return;n=t.state.stateData=e.layout.transformData(n);var i=t.options.stateManagement;r=e.extend({animateLoad:!1,includeChildren:i.includeChildren},r);if(!t.state.initialized){var o=e.extend(!0,{},n);e.each(e.layout.config.allPanes,function(e,t){o[t]&&delete o[t].children}),e.extend(!0,t.options,o)}else{var u=!r.animateLoad,o,a,f,l,c;e.each(e.layout.config.borderPanes,function(r,i){o=n[i];if(!e.isPlainObject(o))return;s=o.size,a=o.initClosed,f=o.initHidden,ar=o.autoResize,l=t.state[i],c=l.isVisible,ar&&(l.autoResize=ar),c||t._sizePane(i,s,!1,!1,!1),f===!0?t.hide(i,u):a===!0?t.close(i,!1,u):a===!1?t.open(i,!1,u):f===!1&&t.show(i,!1,u),c&&t._sizePane(i,s,!1,!1,u)});if(r.includeChildren){var h,p;e.each(t.children,function(t,r){h=n[t]?n[t].children:0,h&&r&&e.each(r,function(e,t){p=h[e],t&&p&&t.loadState(p)})})}}},readState:function(t,n){e.type(n)==="string"&&(n={keys:n}),n||(n={});var r=t.options.stateManagement,i=n.includeChildren,s=i!==undefined?i:r.includeChildren,o=n.stateKeys||r.stateKeys,u={isClosed:"initClosed",isHidden:"initHidden"},a=t.state,f=e.layout.config.allPanes,l={},c,h,p,d,v,m,g,y,b,w;e.isArray(o)&&(o=o.join(",")),o=o.replace(/__/g,".").split(",");for(var E=0,S=o.length;E8||!s.msie?!1:n.deviceXDPI&&n.systemXDPI?l(n.deviceXDPI,n.systemXDPI):s.webkit&&(u=r.body.getBoundingClientRect)?l(u.left-u.right,r.body.offsetWidth):s.webkit&&(a=t.outerWidth)?l(a,t.innerWidth):(a=n.width)&&(f=i.clientWidth)?l(a,f):!1}},e.layout.onReady.push(e.layout.browserZoom._init)}(jQuery),define("layout",function(){});var Markdown;typeof exports=="object"&&typeof require=="function"?Markdown=exports:Markdown={},function(){function e(e){return e}function t(e){return!1}function n(){}function r(){}n.prototype={chain:function(t,n){var r=this[t];if(!r)throw new Error("unknown hook "+t);r===e?this[t]=n:this[t]=function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=r.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},Markdown.HookCollection=n,r.prototype={set:function(e,t){this["s_"+e]=t},get:function(e){return this["s_"+e]}},Markdown.Converter=function(){function u(e){return e=e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(e,n,r,s,o,u){return n=n.toLowerCase(),t.set(n,O(r)),o?s:(u&&i.set(n,u.replace(/"/g,""")),"")}),e}function a(e){var t="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del",n="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";return e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,f),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,f),e=e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,f),e=e.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,f),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,f),e}function f(e,t){var n=t;return n=n.replace(/^\n+/,""),n=n.replace(/\n+$/g,""),n="\n\n~K"+(s.push(n)-1)+"K\n\n",n}function c(t,n){t=e.preBlockGamut(t,l),t=b(t);var r="
      \n";return t=t.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,r),t=w(t),t=x(t),t=L(t),t=e.postBlockGamut(t,l),t=a(t),t=A(t,n),t}function h(t){return t=e.preSpanGamut(t),t=N(t),t=p(t),t=M(t),t=m(t),t=d(t),t=D(t),t=t.replace(/~P/g,"://"),t=O(t),t=k(t),t=t.replace(/ +\n/g,"
      \n"),t=e.postSpanGamut(t),t}function p(e){var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return e=e.replace(t,function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=I(t,e.charAt(1)=="!"?"\\`*_/":"\\`*_"),t}),e}function d(e){return e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,v),e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,v),e=e.replace(/(\[([^\[\]]+)\])()()()()()/g,v),e}function v(e,n,r,s,o,u,a,f){f==undefined&&(f="");var l=n,c=r.replace(/:\/\//g,"~P"),h=s.toLowerCase(),p=o,d=f;if(p==""){h==""&&(h=c.toLowerCase().replace(/ ?\n/g," ")),p="#"+h;if(t.get(h)!=undefined)p=t.get(h),i.get(h)!=undefined&&(d=i.get(h));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;p=""}}p=F(p),p=I(p,"*_");var v='",v}function m(e){return e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,y),e=e.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,y),e}function g(e){return e.replace(/>/g,">").replace(/"+h(t)+"\n\n"}),e=e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(e,t){return"

      "+h(t)+"

      \n\n"}),e=e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(e,t,n){var r=t.length;return""+h(n)+"\n\n"}),e}function w(e,t){e+="~0";var n=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return o?e=e.replace(n,function(e,n,r){var i=n,s=r.search(/[*+-]/g)>-1?"ul":"ol",o=S(i,s,t);return o=o.replace(/\s+$/,""),o="<"+s+">"+o+"\n",o}):(n=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,e=e.replace(n,function(e,t,n,r){var i=t,s=n,o=r.search(/[*+-]/g)>-1?"ul":"ol",u=S(s,o);return u=i+"<"+o+">\n"+u+"\n",u})),e=e.replace(/~0/,""),e}function S(e,t,n){o++,e=e.replace(/\n{2,}$/,"\n"),e+="~0";var r=E[t],i=new RegExp("(^[ \\t]*)("+r+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+r+")[ \\t]+))","gm"),s=!1;return e=e.replace(i,function(e,t,r,i){var o=i,u=t,a=/\n\n$/.test(o),f=a||o.search(/\n{2,}/)>-1;return f||s?o=c(H(o),!0):(o=w(H(o),!0),o=o.replace(/\n$/,""),n||(o=h(o))),s=a,"
    • "+o+"
    • \n"}),e=e.replace(/~0/g,""),o--,e}function x(e){return e+="~0",e=e.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(e,t,n){var r=t,i=n;return r=C(H(r)),r=B(r),r=r.replace(/^\n+/g,""),r=r.replace(/\n+$/g,""),r="
      "+r+"\n
      ","\n\n"+r+"\n\n"+i}),e=e.replace(/~0/,""),e}function T(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(s.push(e)-1)+"K\n\n"}function N(e){return e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,t,n,r,i){var s=r;return s=s.replace(/^([ \t]*)/g,""),s=s.replace(/[ \t]*$/g,""),s=C(s),s=s.replace(/:\/\//g,"~P"),t+""+s+""}),e}function C(e){return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=I(e,"*_{}[]\\",!1),e}function k(e){return e=e.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,"$1$3$4"),e=e.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,"$1$3$4"),e}function L(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,t){var n=t;return n=n.replace(/^[ \t]*>[ \t]?/gm,"~0"),n=n.replace(/~0/g,""),n=n.replace(/^[ \t]+$/gm,""),n=c(n),n=n.replace(/(^|\n)/g,"$1 "),n=n.replace(/(\s*
      [^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=n.replace(/^  /mg,"~0"),n=n.replace(/~0/g,""),n}),T("
      \n"+n+"\n
      ")}),e}function A(e,t){e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,"");var n=e.split(/\n{2,}/g),r=[],i=/~K(\d+)K/,o=n.length;for(var u=0;u"),a+="

      ",r.push(a))}if(!t){o=r.length;for(var u=0;u#+-.!])/g,q),e}function _(e,t,n,r){if(t)return e;if(r.charAt(r.length-1)!==")")return"<"+n+r+">";var i=r.match(/[()]/g),s=0;for(var o=0;o"+u}function D(t){t=t.replace(/(="|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi,_);var n=function(t,n){return'
      '+e.plainLinkText(n)+""};return t=t.replace(/<((https?|ftp):[^'">\s]+)>/gi,n),t}function P(e){return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),e}function H(e){return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,""),e}function B(e){if(!/\t/.test(e))return e;var t=[" "," "," "," "],n=0,r;return e.replace(/[\n\t]/g,function(e,i){return e==="\n"?(n=i+1,e):(r=(i-n)%4,n=i+1,t[r])})}function F(e){if(!e)return"";var t=e.length;return e.replace(j,function(n,r){if(n=="~D")return"%24";if(n==":")if(r==t-1||/[0-9\/]/.test(e.charAt(r+1)))return":";return"%"+n.charCodeAt(0).toString(16)})}function I(e,t,n){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=new RegExp(r,"g");return e=e.replace(i,q),e}function q(e,t){var n=t.charCodeAt(0);return"~E"+n+"E"}var e=this.hooks=new n;e.addNoop("plainLinkText"),e.addNoop("preConversion"),e.addNoop("postNormalization"),e.addNoop("preBlockGamut"),e.addNoop("postBlockGamut"),e.addNoop("preSpanGamut"),e.addNoop("postSpanGamut"),e.addNoop("postConversion");var t,i,s,o;this.makeHtml=function(n){if(t)throw new Error("Recursive call to converter.makeHtml");return t=new r,i=new r,s=[],o=0,n=e.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=B(n),n=n.replace(/^[ \t]+$/mg,""),n=e.postNormalization(n),n=a(n),n=u(n),n=c(n),n=P(n),n=e.postConversion(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),s=i=t=null,n};var l=function(e){return c(e)},E={ol:"\\d+[.]",ul:"[*+-]"},j=/(?:["'*()[\]:]|~D)/g}}(),define("Markdown.Converter",function(){});var IN_GLOBAL_SCOPE=!0;window.PR_SHOULD_USE_CONTINUATION=!0;var prettyPrintOne,prettyPrint;(function(){function O(e){function a(e){var t=e.charCodeAt(0);if(t!==92)return t;var n=e.charAt(1);return t=u[n],t?t:"0"<=n&&n<="7"?parseInt(e.substring(1),8):n==="u"||n==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return t==="\\"||t==="-"||t==="]"||t==="^"?"\\"+t:t}function l(e){var t=e.substring(1,e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),n=[],r=t[0]==="^",i=["["];r&&i.push("^");for(var s=r?1:0,o=t.length;s122||(c<65||l>90||n.push([Math.max(65,l)|32,Math.min(c,90)|32]),c<97||l>122||n.push([Math.max(97,l)&-33,Math.min(c,122)&-33]))}}n.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]});var h=[],p=[];for(var s=0;sd[0]&&(d[1]+1>d[0]&&i.push("-"),i.push(f(d[1])))}return i.push("]"),i.join("")}function c(e){var r=e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),i=r.length,s=[];for(var o=0,u=0;o=2&&h==="["?r[o]=l(a):h!=="\\"&&(r[o]=a.replace(/[a-zA-Z]/g,function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(t&-33,t|32)+"]"}))}return r.join("")}var t=0,n=!1,r=!1;for(var i=0,s=e.length;i=0;)n[l.charAt(c)]=f;var h=f[1],p=""+h;o.hasOwnProperty(p)||(s.push(h),o[p]=null)}s.push(/[\0-\uffff]/),r=O(s)})();var i=t.length,s=function(e){var o=e.sourceCode,u=e.basePos,a=[u,S],f=0,l=o.match(r)||[],c={};for(var h=0,p=l.length;h=5&&"lang-"===v.substring(0,5),g&&(!m||typeof m[1]!="string")&&(g=!1,v=N),g||(c[d]=v)}var w=f;f+=d.length;if(!g)a.push(u+w,v);else{var E=m[1],x=d.indexOf(E),T=x+E.length;m[2]&&(T=d.length-m[2].length,x=T-E.length);var C=v.substring(5);_(u+w,d.substring(0,x),s,a),_(u+w+x,E,U(C,E),a),_(u+w+T,d.substring(T),s,a)}}e.decorations=a};return s}function B(e){var t=[],n=[];e.tripleQuotedStrings?t.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&n.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=e.hashComments;r&&(e.cStyleComments?(r>1?t.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push([y,/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push([y,/^\/\/[^\r\n]*/,null]),n.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=e.regexLiterals;if(i){var s=i>1?"":"\n\r",o=s?".":"[\\S\\s]",u="/(?=[^/*"+s+"])"+"(?:[^/\\x5B\\x5C"+s+"]"+"|\\x5C"+o+"|\\x5B(?:[^\\x5C\\x5D"+s+"]"+"|\\x5C"+o+")*(?:\\x5D|$))+"+"/";n.push(["lang-regex",RegExp("^"+A+"("+u+")")])}var a=e.types;a&&n.push([b,a]);var f=(""+e.keywords).replace(/^ | $/g,"");f.length&&n.push([g,new RegExp("^(?:"+f.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push([S,/^\s+/,null," \r\n  "]);var l="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(l+="(?!s*/)"),n.push([w,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[S,/^[a-z_$][a-z_$@0-9]*/i,null],[w,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[S,/^\\[\s\S]?/,null],[E,new RegExp(l),null]),H(t,n)}function F(e,t,n){function a(e){var t=e.nodeType;if(t==1&&!r.test(e.className))if("br"===e.nodeName)f(e),e.parentNode&&e.parentNode.removeChild(e);else for(var o=e.firstChild;o;o=o.nextSibling)a(o);else if((t==3||t==4)&&n){var u=e.nodeValue,l=u.match(i);if(l){var c=u.substring(0,l.index);e.nodeValue=c;var h=u.substring(l.index+l[0].length);if(h){var p=e.parentNode;p.insertBefore(s.createTextNode(h),e.nextSibling)}f(e),c||e.parentNode.removeChild(e)}}}function f(e){function t(e,n){var r=n?e.cloneNode(!1):e,i=e.parentNode;if(i){var s=t(i,1),o=e.nextSibling;s.appendChild(r);for(var u=o;u;u=o)o=u.nextSibling,s.appendChild(u)}return r}while(!e.nextSibling){e=e.parentNode;if(!e)return}var n=t(e.nextSibling,0);for(var r;(r=n.parentNode)&&r.nodeType===1;)n=r;u.push(n)}var r=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,s=e.ownerDocument,o=s.createElement("li");while(e.firstChild)o.appendChild(e.firstChild);var u=[o];for(var l=0;l=E&&(a+=2),s>=S&&(c+=2)}}finally{g&&(g.style.display=y)}}function R(t,n){for(var r=n.length;--r>=0;){var i=n[r];q.hasOwnProperty(i)?e.console&&console.warn("cannot override language handler %s",i):q[i]=t}}function U(e,t){if(!e||!q.hasOwnProperty(e))e=/^\s*"+e+"
      ",r=r.firstChild,n&&F(r,n,!0);var i={langExtension:t,numberLines:n,sourceNode:r,pre:1};return z(i),r.innerHTML}function X(t,n){function s(e){return r.getElementsByTagName(e)}function E(){var n=e.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;for(;h|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",D=/\S/,j=B({keywords:d,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),q={};R(j,["default-code"]),R(H([],[[S,/^[^]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),R(H([[S,/^[\s]+/,null," \r\n"],[k,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[C,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),R(H([],[[k,/^[\s\S]+/]]),["uq.val"]),R(B({keywords:i,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),R(B({keywords:"null,true,false"}),["json"]),R(B({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),R(B({keywords:s,cStyleComments:!0}),["java"]),R(B({keywords:p,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),R(B({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),R(B({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),R(B({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),R(B({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]),R(B({keywords:u,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),R(B({keywords:h,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]),R(H([],[[m,/^[\s\S]+/]]),["regex"]);var V=e.PR={createSimpleLexer:H,registerLangHandler:R,sourceDecorator:B,PR_ATTRIB_NAME:C,PR_ATTRIB_VALUE:k,PR_COMMENT:y,PR_DECLARATION:T,PR_KEYWORD:g,PR_LITERAL:w,PR_NOCODE:L,PR_PLAIN:S,PR_PUNCTUATION:E,PR_SOURCE:N,PR_STRING:m,PR_TAG:x,PR_TYPE:b,prettyPrintOne:IN_GLOBAL_SCOPE?e.prettyPrintOne=W:prettyPrintOne=W,prettyPrint:prettyPrint=IN_GLOBAL_SCOPE?e.prettyPrint=X:prettyPrint=X};typeof define=="function"&&define.amd&&define("google-code-prettify",[],function(){return V})})(),define("prettify",function(){}),function(){function t(e){return e.replace(/^\s+|\s+$/g,"")}function n(e){return e.replace(/\s+$/g,"")}function r(e){return e.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function i(e,t){return e.indexOf(t)!=-1}function s(e,t){return e.replace(/<[^>]*>?/gi,function(e){return e.match(t)?e:""})}function o(e,t){var n={};for(var r=0;r")===""}var e=new RegExp(["^(<\\/?(a|abbr|acronym|applet|area|b|basefont|","bdo|big|button|cite|code|del|dfn|em|figcaption|","font|i|iframe|img|input|ins|kbd|label|map|","mark|meter|object|param|progress|q|ruby|rp|rt|s|","samp|script|select|small|span|strike|strong|","sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|","<(br)\\s?\\/?>)$"].join(""),"i");Array.indexOf||(Array.prototype.indexOf=function(e){for(var t=0;t~X"+(this.hashBlocks.push(e)-1)+"X

      \n"},Markdown.Extra.prototype.unHashExtraBlocks=function(e){var t=this;return e=e.replace(/

      ~X(\d+)X<\/p>/g,function(e,n){var r=parseInt(n,10);return t.hashBlocks[r]}),e},Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(e){function s(e,t,n){return"

      ~XX"+(i.hashBlocks.push(n)-1)+"XX

      \n"+t+"\n"}var t="\\{\\s*[.|#][^}]+\\}",n=new RegExp("^(#{1,6}.*#{0,6})\\s+("+t+")[ \\t]*(\\n|0x03)","gm"),r=new RegExp("^(.*)\\s+("+t+")[ \\t]*\\n"+"(?=[\\-|=]+\\s*(\\n|0x03))","gm"),i=this;return e=e.replace(n,s),e=e.replace(r,s),e},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(e){function i(e,t,n){return"

      ~XX"+(r.hashBlocks.push(n)-1)+"XX

      \n"+t+"\n"}var t="\\{\\s*[.|#][^}]+\\}",n=new RegExp("^(```[^{]*)\\s+("+t+")[ \\t]*\\n"+"(?=([\\s\\S]*?)\\n```\\s*(\\n|0x03))","gm"),r=this;return e.replace(n,i)},Markdown.Extra.prototype.applyAttributeBlocks=function(e){var t=this,n=new RegExp('

      ~XX(\\d+)XX

      [\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?))',"gm");return e=e.replace(n,function(e,n,r,i,s){if(!r)return"";var u=parseInt(n,10),a=t.hashBlocks[u],f=a.match(/#[^\s{}]+/g)||[],l=f[0]?' id="'+f[0].substr(1,f[0].length-1)+'"':"",c=a.match(/\.[^\s{}]+/g)||[];for(var h=0;h0&&(p=' class="'+c.join(" ")+'"'),"<"+r+l+p+s}),e},Markdown.Extra.prototype.tables=function(e){function s(e,r,i,s,o,u){r=r.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),s=s.replace(/^ *[|]/gm,""),r=r.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),s=s.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var a=0;a\n","
      \n","\n"].join("");for(a=0;a",v,"\n"].join("")}d+="\n\n";var m=s.split("\n");for(a=0;a\n";for(b=0;b",w,"\n"].join("")}d+="\n"}return d+="
      \n",n.hashExtraBlock(d)}var n=this,r=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),i=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return e=e.replace(r,s),e=e.replace(i,s),e},Markdown.Extra.prototype.fencedCodeBlocks=function(e){function t(e){return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e}var n=this;return e=e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(e,r,i){var s=r,o=i,u=n.googleCodePrettify?' class="prettyprint"':"",a="";s&&(n.googleCodePrettify||n.highlightJs?a=' class="language-'+s+'"':a=' class="'+s+'"');var f=["",t(o),""].join("");return n.hashExtraBlock(f)}),e},Markdown.Extra.prototype.definitionLists=function(e){var n=new RegExp(["(\\x02\\n?|\\n\\n)","(?:","(","(","[ ]{0,3}","((?:[ \\t]*\\S.*\\n)+)","\\n?","[ ]{0,3}:[ ]+",")","([\\s\\S]+?)","(","(?=\\0x03)","|","(?=","\\n{2,}","(?=\\S)","(?!","[ ]{0,3}","(?:\\S.*\\n)+?","\\n?","[ ]{0,3}:[ ]+",")","(?!","[ ]{0,3}:[ ]+",")",")",")",")",")"].join(""),"gm"),r=this;return e=u(e),e=e.replace(n,function(e,n,i){var s=t(r.processDefListItems(i));return s="
      \n"+s+"\n
      ",n+r.hashExtraBlock(s)+"\n\n"}),a(e)},Markdown.Extra.prototype.processDefListItems=function(e){var i=this,s=new RegExp(["(\\x02\\n?|\\n\\n+)","(","[ ]{0,3}","(?![:][ ]|[ ])","(?:\\S.*\\n)+?",")","(?=\\n?[ ]{0,3}:[ ])"].join(""),"gm"),o=new RegExp(["\\n(\\n+)?","(","[ ]{0,3}","[:][ ]+",")","([\\s\\S]+?)","(?=\\n*","(?:","\\n[ ]{0,3}[:][ ]|","
      |\\x03",")",")"].join(""),"gm");return e=u(e),e=e.replace(/\n{2,}(?=\\x03)/,"\n"),e=e.replace(s,function(e,n,r){var s=t(r).split("\n"),o="";for(var u=0;u"+a+"
      "}return o+"\n"}),e=e.replace(o,function(e,t,s,o){return t||o.match(/\n{2,}/)?(o=Array(s.length+1).join(" ")+o,o=r(o)+"\n\n",o="\n"+l(o,i.converter)+"\n"):(o=n(o),o=f(r(o),i.converter)),"\n
      "+o+"
      \n"}),a(e)}}(),define("Markdown.Extra",function(){}),function(){function c(){}function h(e){this.buttonBar=r.getElementById("wmd-button-bar"+e),this.preview=r.getElementById("wmd-preview"+e),this.input=r.getElementById("wmd-input"+e)}function p(t,n){var r=this,i=[],s=0,o="none",a,f,l,c=function(e,t){o!=e&&(o=e,t||p()),!u.isIE||o!="moving"?f=setTimeout(h,1):l=null},h=function(e){l=new d(n,e),f=undefined};this.setCommandMode=function(){o="command",p(),f=setTimeout(h,0)},this.canUndo=function(){return s>1},this.canRedo=function(){return i[s+1]?!0:!1},this.undo=function(){r.canUndo()&&(a?(a.restore(),a=null):(i[s]=new d(n),i[--s].restore(),t&&t())),o="none",n.input.focus(),h()},this.redo=function(){r.canRedo()&&(i[++s].restore(),t&&t()),o="none",n.input.focus(),h()};var p=function(){var e=l||new d(n);if(!e)return!1;if(o=="moving"){a||(a=e);return}a&&(i[s-1].text!=a.text&&(i[s++]=a),a=null),i[s++]=e,i[s+1]=null,t&&t()},v=function(e){var t=!1;if((e.ctrlKey||e.metaKey)&&!e.altKey){var n=e.charCode||e.keyCode,i=String.fromCharCode(n);switch(i.toLowerCase()){case"y":r.redo(),t=!0;break;case"z":e.shiftKey?r.redo():r.undo(),t=!0}}if(t){e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1);return}},m=function(e){if(!e.ctrlKey&&!e.metaKey){var t=e.keyCode;t>=33&&t<=40||t>=63232&&t<=63235?c("moving"):t==8||t==46||t==127?c("deleting"):t==13?c("newlines"):t==27?c("escape"):(t<16||t>20)&&t!=91&&c("typing")}},g=function(){e.addEvent(n.input,"keypress",function(e){(e.ctrlKey||e.metaKey)&&!e.altKey&&(e.keyCode==89||e.keyCode==90)&&e.preventDefault()});var t=function(){(u.isIE||l&&l.text!=n.input.value)&&f==undefined&&(o="paste",p(),h())};e.addEvent(n.input,"keydown",v),e.addEvent(n.input,"keydown",m),e.addEvent(n.input,"mousedown",function(){c("moving")}),n.input.onpaste=t,n.input.ondrop=t},y=function(){g(),h(!0),p()};y()}function d(t,n){var i=this,s=t.input;this.init=function(){if(!e.isVisible(s))return;if(!n&&r.activeElement&&r.activeElement!==s)return;this.setInputAreaSelectionStartEnd(),this.scrollTop=s.scrollTop;if(!this.text&&s.selectionStart||s.selectionStart===0)this.text=s.value},this.setInputAreaSelection=function(){if(!e.isVisible(s))return;if(s.selectionStart!==undefined&&!u.isOpera)s.focus(),s.selectionStart=i.start,s.selectionEnd=i.end,s.scrollTop=i.scrollTop;else if(r.selection){if(r.activeElement&&r.activeElement!==s)return;s.focus();var t=s.createTextRange();t.moveStart("character",-s.value.length),t.moveEnd("character",-s.value.length),t.moveEnd("character",i.end),t.moveStart("character",i.start),t.select()}},this.setInputAreaSelectionStartEnd=function(){if(!t.ieCachedRange&&(s.selectionStart||s.selectionStart===0))i.start=s.selectionStart,i.end=s.selectionEnd;else if(r.selection){i.text=e.fixEolChars(s.value);var n=t.ieCachedRange||r.selection.createRange(),o=e.fixEolChars(n.text),u="",a=u+o+u;n.text=a;var f=e.fixEolChars(s.value);n.moveStart("character",-a.length),n.text=o,i.start=f.indexOf(u),i.end=f.lastIndexOf(u)-u.length;var l=i.text.length-e.fixEolChars(s.value).length;if(l){n.moveStart("character",-o.length);while(l--)o+="\n",i.end+=1;n.text=o}t.ieCachedRange&&(i.scrollTop=t.ieCachedScrollTop),t.ieCachedRange=null,this.setInputAreaSelection()}},this.restore=function(){i.text!=undefined&&i.text!=s.value&&(s.value=i.text),this.setInputAreaSelection(),s.scrollTop=i.scrollTop},this.getChunks=function(){var t=new c;return t.before=e.fixEolChars(i.text.substring(0,i.start)),t.startTag="",t.selection=e.fixEolChars(i.text.substring(i.start,i.end)),t.endTag="",t.after=e.fixEolChars(i.text.substring(i.end)),t.scrollTop=i.scrollTop,t},this.setChunks=function(e){e.before=e.before+e.startTag,e.after=e.endTag+e.after,this.start=e.before.length,this.end=e.before.length+e.selection.length,this.text=e.before+e.selection+e.after,this.scrollTop=e.scrollTop},this.init()}function v(n,i,s,o){var a=this,f,l,c,h=3e3,p="delayed",d=function(t,n){e.addEvent(t,"input",n),t.onpaste=n,t.ondrop=n,e.addEvent(t,"keypress",n),e.addEvent(t,"keydown",n)},v=function(){var e=0;return window.innerHeight?e=window.pageYOffset:r.documentElement&&r.documentElement.scrollTop?e=r.documentElement.scrollTop:r.body&&(e=r.body.scrollTop),e},m=function(){if(!i.preview)return;var e=i.input.value;if(e!==undefined&&e==c)return;c=e;var t=(new Date).getTime();e=n.makeHtml(e);var r=(new Date).getTime();l=r-t,N(e)};o!==undefined&&(m=o(m));var g=function(){f&&(clearTimeout(f),f=undefined);if(p!=="manual"){var e=0;p==="delayed"&&(e=l),e>h&&(e=h),f=setTimeout(m,e)}},y=function(e){return e.scrollHeight<=e.clientHeight?1:e.scrollTop/(e.scrollHeight-e.clientHeight)},b=function(){i.preview&&(i.preview.scrollTop=(i.preview.scrollHeight-i.preview.clientHeight)*y(i.preview))};this.refresh=function(e){e?(c="",m()):g()},this.processingTime=function(){return l};var w=!0,E=function(e){var t=i.preview,n=t.parentNode,r=t.nextSibling;n.removeChild(t),t.innerHTML=e,r?n.insertBefore(t,r):n.appendChild(t)},S=function(e){i.preview.innerHTML=e},x,T=function(e){if(x)return x(e);try{S(e),x=S}catch(t){x=E,x(e)}},N=function(e){var n=t.getTop(i.input)-v();i.preview&&(T(e),s()),b();if(w){w=!1;return}var r=t.getTop(i.input)-v();u.isIE?setTimeout(function(){window.scrollBy(0,r-n)},0):window.scrollBy(0,r-n)},C=function(){d(i.input,g),m(),i.preview&&(i.preview.scrollTop=0)};C()}function m(t,n,i,o,a,f,l){function v(e){c.focus();if(e.textOp){i&&i.setCommandMode();var t=new d(n);if(!t)return;var r=t.getChunks(),s=function(){c.focus(),r&&t.setChunks(r),t.restore(),o.refresh()},u=e.textOp(r,s);u||s()}e.execute&&e.execute(i)}function m(e,t){var i="0px",s="-20px",o="-40px",a=e.getElementsByTagName("span")[0];t?(a.style.backgroundPosition=e.XShift+" "+i,e.onmouseover=function(){a.style.backgroundPosition=this.XShift+" "+o},e.onmouseout=function(){a.style.backgroundPosition=this.XShift+" "+i},u.isIE&&(e.onmousedown=function(){if(r.activeElement&&r.activeElement!==n.input)return;n.ieCachedRange=document.selection.createRange(),n.ieCachedScrollTop=n.input.scrollTop}),e.isHelp||(e.onclick=function(){return this.onmouseout&&this.onmouseout(),v(this),!1}),e.className=e.className.replace(/ disabled/g,"")):(a.style.backgroundPosition=e.XShift+" "+s,e.onmouseover=e.onmouseout=e.onclick=function(){},e.className+=" disabled")}function g(e){return typeof e=="string"&&(e=a[e]),function(){e.apply(a,arguments)}}function y(){var e=n.buttonBar,r="0px",i="-20px",o="-40px",u=document.createElement("ul");u.id="wmd-button-row"+t,u.className="wmd-button-row",u=e.appendChild(u);var a=0,c=function(e,n,r,i){var s=document.createElement("li");s.className="wmd-button",s.style.left=a+"px",a+=25;var o=document.createElement("span");return s.id=e+t,s.appendChild(o),s.title=n,s.XShift=r,i&&(s.textOp=i),m(s,!0),u.appendChild(s),s},p=function(e){var n=document.createElement("li");n.className="wmd-spacer wmd-spacer"+e,n.id="wmd-spacer"+e+t,u.appendChild(n),a+=25};h.bold=c("wmd-bold-button",l("bold"),"0px",g("doBold")),h.italic=c("wmd-italic-button",l("italic"),"-20px",g("doItalic")),p(1),h.link=c("wmd-link-button",l("link"),"-40px",g(function(e,t){return this.doLinkOrImage(e,t,!1)})),h.quote=c("wmd-quote-button",l("quote"),"-60px",g("doBlockquote")),h.code=c("wmd-code-button",l("code"),"-80px",g("doCode")),h.image=c("wmd-image-button",l("image"),"-100px",g(function(e,t){return this.doLinkOrImage(e,t,!0)})),p(2),h.olist=c("wmd-olist-button",l("olist"),"-120px",g(function(e,t){this.doList(e,t,!0)})),h.ulist=c("wmd-ulist-button",l("ulist"),"-140px",g(function(e,t){this.doList(e,t,!1)})),h.heading=c("wmd-heading-button",l("heading"),"-160px",g("doHeading")),h.hr=c("wmd-hr-button",l("hr"),"-180px",g("doHorizontalRule")),p(3),h.undo=c("wmd-undo-button",l("undo"),"-200px",null),h.undo.execute=function(e){e&&e.undo()};var d=/win/.test(s.platform.toLowerCase())?l("redo"):l("redomac");h.redo=c("wmd-redo-button",d,"-220px",null),h.redo.execute=function(e){e&&e.redo()};if(f){var v=document.createElement("li"),y=document.createElement("span");v.appendChild(y),v.className="wmd-button wmd-help-button",v.id="wmd-help-button"+t,v.XShift="-240px",v.isHelp=!0,v.style.right="0px",v.title=l("help"),v.onclick=f.handler,m(v,!0),u.appendChild(v),h.help=v}b()}function b(){i&&(m(h.undo,i.canUndo()),m(h.redo,i.canRedo()))}var c=n.input,h={};y();var p="keydown";u.isOpera&&(p="keypress"),e.addEvent(c,p,function(e){if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){var t=e.charCode||e.keyCode,n=String.fromCharCode(t).toLowerCase();switch(n){case"b":v(h.bold);break;case"i":v(h.italic);break;case"l":v(h.link);break;case"q":v(h.quote);break;case"k":v(h.code);break;case"g":v(h.image);break;case"o":v(h.olist);break;case"u":v(h.ulist);break;case"h":v(h.heading);break;case"r":v(h.hr);break;case"y":v(h.redo);break;case"z":e.shiftKey?v(h.redo):v(h.undo);break;default:return}e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1)}}),e.addEvent(c,"keyup",function(e){if(e.shiftKey&&!e.ctrlKey&&!e.metaKey){var t=e.charCode||e.keyCode;if(t===13){var n={};n.textOp=g("doAutoindent"),v(n)}}}),u.isIE&&e.addEvent(c,"keydown",function(e){var t=e.keyCode;if(t===27)return!1}),this.setUndoRedoButtonStates=b}function g(e,t){this.hooks=e,this.getString=t}function b(e){return e.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(e,t,n){return t=t.replace(/\?.*$/,function(e){return e.replace(/\+/g," ")}),t=decodeURIComponent(t),t=encodeURI(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"),t=t.replace(/\?.*$/,function(e){return e.replace(/\+/g,"%2b")}),n&&(n=n.trim?n.trim():n.replace(/^\s*/,"").replace(/\s*$/,""),n=n.replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),n?t+' "'+n+'"':t})}var e={},t={},n={},r=window.document,i=window.RegExp,s=window.navigator,o={lineLength:72},u={isIE:/msie/.test(s.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(s.userAgent.toLowerCase())||/msie 5/.test(s.userAgent.toLowerCase()),isOpera:/opera/.test(s.userAgent.toLowerCase())},a={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:'

      Insert Hyperlink

      http://example.com/ "optional title"

      ',quote:"Blockquote
      Ctrl+Q",quoteexample:"Blockquote",code:"Code Sample
       Ctrl+K",codeexample:"enter code here",image:"Image  Ctrl+G",imagedescription:"enter image description here",imagedialog:"

      Insert Image

      http://example.com/images/diagram.jpg \"optional title\"

      Need
      free image hosting?

      ",olist:"Numbered List
        Ctrl+O",ulist:"Bulleted List
          Ctrl+U",litem:"List item",heading:"Heading

          /

          Ctrl+H",headingexample:"Heading",hr:"Horizontal Rule
          Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",help:"Markdown Editing Help"},f="http://",l="http://";Markdown.Editor=function(e,t,n){n=n||{},typeof n.handler=="function"&&(n={helpButton:n}),n.strings=n.strings||{},n.helpButton&&(n.strings.help=n.strings.help||n.helpButton.title);var i=function(e){return n.strings[e]||a[e]};t=t||"";var s=this.hooks=new Markdown.HookCollection;s.addNoop("onPreviewRefresh"),s.addNoop("postBlockquoteCreation"),s.addFalse("insertImageDialog"),s.addFalse("insertLinkDialog"),this.getConverter=function(){return e};var o=this,u;this.run=function(a){if(u)return;u=new h(t);var f=new g(s,i),l=new v(e,u,function(){s.onPreviewRefresh()},a),c,d;/\?noundo/.test(r.location.href)||(c=new p(function(){l.refresh(),d&&d.setUndoRedoButtonStates()},u),this.textOperation=function(e){c.setCommandMode(),e(),o.refreshPreview()}),d=new m(t,u,c,l,f,n.helpButton,i),d.setUndoRedoButtonStates();var y=o.refreshPreview=function(){l.refresh(!0)};y()}},c.prototype.findTags=function(t,n){var r=this,i;t&&(i=e.extendRegExp(t,"","$"),this.before=this.before.replace(i,function(e){return r.startTag=r.startTag+e,""}),i=e.extendRegExp(t,"^",""),this.selection=this.selection.replace(i,function(e){return r.startTag=r.startTag+e,""})),n&&(i=e.extendRegExp(n,"","$"),this.selection=this.selection.replace(i,function(e){return r.endTag=e+r.endTag,""}),i=e.extendRegExp(n,"^",""),this.after=this.after.replace(i,function(e){return r.endTag=e+r.endTag,""}))},c.prototype.trimWhitespace=function(e){var t,n,r=this;e?t=n="":(t=function(e){return r.before+=e,""},n=function(e){return r.after=e+r.after,""}),this.selection=this.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)},c.prototype.skipLines=function(e,t,n){e===undefined&&(e=1),t===undefined&&(t=1),e++,t++;var r,s;navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+i.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+i.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+i.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+i.$1;if(this.before){r=s="";while(e--)r+="\\n?",s+="\n";n&&(r="\\n*"),this.before=this.before.replace(new i(r+"$",""),s)}if(this.after){r=s="";while(t--)r+="\\n?",s+="\n";n&&(r="\\n*"),this.after=this.after.replace(new i(r,""),s)}},e.isVisible=function(e){if(window.getComputedStyle)return window.getComputedStyle(e,null).getPropertyValue("display")!=="none";if(e.currentStyle)return e.currentStyle.display!=="none"},e.addEvent=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},e.removeEvent=function(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n,!1)},e.fixEolChars=function(e){return e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n"),e},e.extendRegExp=function(e,t,n){if(t===null||t===undefined)t="";if(n===null||n===undefined)n="";var r=e.toString(),s;return r=r.replace(/\/([gim]*)$/,function(e,t){return s=t,""}),r=r.replace(/(^\/|\/$)/g,""),r=t+r+n,new i(r,s)},t.getTop=function(e,t){var n=e.offsetTop;if(!t)while(e=e.offsetParent)n+=e.offsetTop;return n},t.getHeight=function(e){return e.offsetHeight||e.scrollHeight},t.getWidth=function(e){return e.offsetWidth||e.scrollWidth},t.getPageSize=function(){var e,t,n,i;self.innerHeight&&self.scrollMaxY?(e=r.body.scrollWidth,t=self.innerHeight+self.scrollMaxY):r.body.scrollHeight>r.body.offsetHeight?(e=r.body.scrollWidth,t=r.body.scrollHeight):(e=r.body.offsetWidth,t=r.body.offsetHeight),self.innerHeight?(n=self.innerWidth,i=self.innerHeight):r.documentElement&&r.documentElement.clientHeight?(n=r.documentElement.clientWidth,i=r.documentElement.clientHeight):r.body&&(n=r.body.clientWidth,i=r.body.clientHeight);var s=Math.max(e,n),o=Math.max(t,i);return[s,o,n,i]},n.createBackground=function(){var e=r.createElement("div"),n=e.style;e.className="wmd-prompt-background",n.position="absolute",n.top="0",n.zIndex="1000",u.isIE?n.filter="alpha(opacity=50)":n.opacity="0.5";var i=t.getPageSize();return n.height=i[1]+"px",u.isIE?(n.left=r.documentElement.scrollLeft,n.width=r.documentElement.clientWidth):(n.left="0",n.width="100%"),r.body.appendChild(e),e},n.prompt=function(n,i,s){var o,a;i===undefined&&(i="");var f=function(e){var t=e.charCode||e.keyCode;t===27&&l(!0)},l=function(t){e.removeEvent(r.body,"keydown",f);var n=a.value;return t?n=null:(n=n.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(n)||(n="http://"+n)),o.parentNode.removeChild(o),s(n),!1},c=function(){o=r.createElement("div"),o.className="wmd-prompt-dialog",o.style.padding="10px;",o.style.position="fixed",o.style.width="400px",o.style.zIndex="1001";var s=r.createElement("div");s.innerHTML=n,s.style.padding="5px",o.appendChild(s);var c=r.createElement("form"),h=c.style;c.onsubmit=function(){return l(!1)},h.padding="0",h.margin="0",h.cssFloat="left",h.width="100%",h.textAlign="center",h.position="relative",o.appendChild(c),a=r.createElement("input"),a.type="text",a.value=i,h=a.style,h.display="block",h.width="80%",h.marginLeft=h.marginRight="auto",c.appendChild(a);var p=r.createElement("input");p.type="button",p.onclick=function(){return l(!1)},p.value="OK",h=p.style,h.margin="10px",h.display="inline",h.width="7em";var d=r.createElement("input");d.type="button",d.onclick=function(){return l(!0)},d.value="Cancel",h=d.style,h.margin="10px",h.display="inline",h.width="7em",c.appendChild(p),c.appendChild(d),e.addEvent(r.body,"keydown",f),o.style.top="50%",o.style.left="50%",o.style.display="block",u.isIE_5or6&&(o.style.position="absolute",o.style.top=r.documentElement.scrollTop+200+"px",o.style.left="50%"),r.body.appendChild(o),o.style.marginTop=-(t.getHeight(o)/2)+"px",o.style.marginLeft=-(t.getWidth(o)/2)+"px"};setTimeout(function(){c();var e=i.length;if(a.selectionStart!==undefined)a.selectionStart=0,a.selectionEnd=e;else if(a.createTextRange){var t=a.createTextRange();t.collapse(!1),t.moveStart("character",-e),t.moveEnd("character",e),t.select()}a.focus()},0)};var y=g.prototype;y.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",y.unwrap=function(e){var t=new i("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(t,"$1 $2")},y.wrap=function(e,t){this.unwrap(e);var n=new i("(.{1,"+t+"})( +|$\\n?)","gm"),r=this;e.selection=e.selection.replace(n,function(e,t){return(new i("^"+r.prefixes,"")).test(e)?e:t+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},y.doBold=function(e,t){return this.doBorI(e,t,2,this.getString("boldexample"))},y.doItalic=function(e,t){return this.doBorI(e,t,1,this.getString("italicexample"))},y.doBorI=function(e,t,n,r){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var s=/(\**$)/.exec(e.before)[0],o=/(^\**)/.exec(e.after)[0],u=Math.min(s.length,o.length);if(u>=n&&(u!=2||n!=1))e.before=e.before.replace(i("[*]{"+n+"}$",""),""),e.after=e.after.replace(i("^[*]{"+n+"}",""),"");else if(!e.selection&&o){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var a=i.$1;e.before=e.before+o+a}else{!e.selection&&!o&&(e.selection=r);var f=n<=1?"*":"**";e.before=e.before+f,e.after=f+e.after}return},y.stripLinkDefs=function(e,t){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(e,n,r,i,s){return t[n]=e.replace(/\s*$/,""),i?(t[n]=e.replace(/["(](.+?)[")]$/,""),i+s):""}),e},y.addLinkDef=function(e,t){var n=0,r={};e.before=this.stripLinkDefs(e.before,r),e.selection=this.stripLinkDefs(e.selection,r),e.after=this.stripLinkDefs(e.after,r);var i="",s=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,o=function(e){n++,e=e.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+n+"]:"),i+="\n"+e},u=function(e,t,i,a,f,l){return i=i.replace(s,u),r[f]?(o(r[f]),t+i+a+n+l):e};e.before=e.before.replace(s,u),t?o(t):e.selection=e.selection.replace(s,u);var a=n;return e.after=e.after.replace(s,u),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+i,a},y.doLinkOrImage=function(e,t,r){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="";if(/\n\n/.test(e.selection)){this.addLinkDef(e,null);return}var s=this,o=function(n){i.parentNode.removeChild(i);if(n!==null){e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var o=" [999]: "+b(n),u=s.addLinkDef(e,o);e.startTag=r?"![":"[",e.endTag="]["+u+"]",e.selection||(r?e.selection=s.getString("imagedescription"):e.selection=s.getString("linkdescription"))}t()};return i=n.createBackground(),r?this.hooks.insertImageDialog(o)||n.prompt(this.getString("imagedialog"),f,o):this.hooks.insertLinkDialog(o)||n.prompt(this.getString("linkdialog"),l,o),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},y.doAutoindent=function(e,t){var n=this,r=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),!e.selection&&!/^[ \t]*(?:\n|$)/.test(e.after)&&(e.after=e.after.replace(/^[^\n]*/,function(t){return e.selection=t,""}),r=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),r&&(e.after=e.selection+e.after,e.selection="")},y.doBlockquote=function(e,t){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(t,n,r,i){return e.before+=n,e.after=i+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(t,n){return e.selection=n+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n="",r="",i;if(e.before){var s=e.before.replace(/\n$/,"").split("\n"),u=!1;for(var a=0;a0,/^>/.test(i)?(f=!0,!u&&i.length>1&&(u=!0)):/^[ \t]*$/.test(i)?f=!0:f=u,f?n+=i+"\n":(r+=n+i,n="\n")}/(^|\n)>/.test(n)||(r+=n,n="")}e.startTag=n,e.before=r,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(t){return e.endTag=t,""});var l=function(t){var n=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,o.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(t,n){return e.startTag+=n,""}))},y.doCode=function(e,t){var n=/\S[ ]*$/.test(e.before),r=/^[ ]*\S/.test(e.after);if(!r&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(t){return e.selection=t+e.selection,""});var i=1,s=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(i=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(s=0),e.skipLines(i,s),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),!e.startTag&&!e.endTag?(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample"))):e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag=""},y.doList=function(e,t,n){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,s=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,u="-",a=1,f=function(){var e;return n?(e=" "+a+". ",a++):e=" "+u+" ",e},l=function(e){return n===undefined&&(n=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(e){return f()}),e};e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),e.before&&!/\n$/.test(e.before)&&!/^\n/.test(e.startTag)&&(e.before+=e.startTag,e.startTag="");if(e.startTag){var c=/\d+[.]/.test(e.startTag);e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),c&&(e.after=e.after.replace(s,l));if(n==c)return}var h=1;e.before=e.before.replace(r,function(e){return/^\s*([*+-])/.test(e)&&(u=i.$1),h=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.selection||(e.selection=this.getString("litem"));var p=f(),d=1;e.after=e.after.replace(s,function(e){return d=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.trimWhitespace(!0),e.skipLines(h,d,!0),e.startTag=p;var v=p.replace(/./g," ");this.wrap(e,o.lineLength-v.length),e.selection=e.selection.replace(/\n/g,"\n"+v)},y.doHeading=function(e,t){e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,"");if(!e.selection){e.startTag="## ",e.selection=this.getString("headingexample"),e.endTag=" ##";return}var n=0;e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(n=i.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(n=1),/-+/.test(e.endTag)&&(n=2),e.startTag=e.endTag="",e.skipLines(1,1);var r=n==0?2:n-1;if(r>0){var s=r>=2?"-":"=",u=e.selection.length;u>o.lineLength&&(u=o.lineLength),e.endTag="\n";while(u--)e.endTag+=s}},y.doHorizontalRule=function(e,t){e.startTag="----------\n",e.selection="",e.skipLines(2,1,!0)}}(),define("Markdown.Editor",function(){}),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?null:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&(t[t.length]=n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]==null&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var O=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=O(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&O(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return O(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i":">",'"':""","'":"'","/":"/"}};M.unescape=x.invert(M.escape);var _={escape:new RegExp("["+x.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(M.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(_[e],function(t){return M[e][t]})}}),x.result=function(e,t){if(e==null)return null;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),j.call(this,n.apply(x,e))}})};var D=0;x.uniqueId=function(e){var t=++D+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||P).source,(n.interpolate||P).source,(n.evaluate||P).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(B,function(e){return"\\"+H[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var j=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],j.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return j.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(){}),define("storage",["underscore"],function(){localStorage["file.list"]===undefined&&(localStorage["file.list"]=";");var e=_.compact(localStorage["file.list"].split(";")),t=localStorage.version;t===undefined&&(localStorage.removeItem("sync.queue"),localStorage.removeItem("sync.current"),localStorage.removeItem("file.counter"),_.each(e,function(e){localStorage[e+".publish"]=";";var t=_.compact(localStorage[e+".sync"].split(";"));_.each(t,function(e){localStorage[e+".contentCRC"]="0",localStorage[e+".etag"]!==undefined&&(localStorage[e+".titleCRC"]="0")})}),t="v1");if(t=="v1"){var n=localStorage["sync.gdrive.lastChangeId"];n&&(localStorage["gdrive.lastChangeId"]=n,localStorage.removeItem("sync.gdrive.lastChangeId"));var r=localStorage["sync.dropbox.lastChangeId"];r&&(localStorage["dropbox.lastChangeId"]=r,localStorage.removeItem("sync.dropbox.lastChangeId"));var i="gdrive",s="dropbox",o="sync."+i+".",u="sync."+s+".";_.each(e,function(e){var t=_.compact(localStorage[e+".sync"].split(";"));_.each(t,function(e){var t={};e.indexOf(o)===0?(t.provider=i,t.id=e.substring(o.length),t.etag=localStorage[e+".etag"],t.contentCRC=localStorage[e+".contentCRC"],t.titleCRC=localStorage[e+".titleCRC"]):e.indexOf(u)===0&&(t.provider=s,t.path=decodeURIComponent(e.substring(u.length)),t.version=localStorage[e+".version"],t.contentCRC=localStorage[e+".contentCRC"]),localStorage[e]=JSON.stringify(t),localStorage.removeItem(e+".etag"),localStorage.removeItem(e+".version"),localStorage.removeItem(e+".contentCRC"),localStorage.removeItem(e+".titleCRC")})}),t="v2"}t=="v2"&&(_.each(e,function(e){_.has(localStorage,e+".sync")||(localStorage.removeItem(e+".title"),localStorage.removeItem(e+".publish"),localStorage.removeItem(e+".content"),localStorage["file.list"]=localStorage["file.list"].replace(";"+e+";",";"))}),t="v3");if(t=="v3"){var a=localStorage["file.current"];a!==undefined&&localStorage["file.list"].indexOf(";"+a+";")===-1&&localStorage.removeItem("file.current"),t="v4"}t=="v4"&&(localStorage.removeItem("githubToken"),t="v5"),t=="v5"&&(_.each(e,function(e){var t=_.compact(localStorage[e+".publish"].split(";"));_.each(t,function(e){var t=JSON.parse(localStorage[e]);t.provider=="gdrive"&&(t.id=t.fileId,t.fileId=undefined,localStorage[e]=JSON.stringify(t))})}),localStorage.missingSharingLink=!0,t="v6"),localStorage.version=t});var MAIN_URL="http://benweet.github.io/stackedit/",GOOGLE_API_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",GOOGLE_SCOPES=["https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/drive","https://www.googleapis.com/auth/blogger"],GOOGLE_DRIVE_APP_ID="241271498917",DROPBOX_APP_KEY="lq6mwopab8wskas",DROPBOX_APP_SECRET="851fgnucpezy84t",BITLY_ACCESS_TOKEN="317e033bfd48cf31155a68a536b1860013b09c4c",DEFAULT_FILE_TITLE="Title",GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",CHECK_ONLINE_PERIOD=12e4,AJAX_TIMEOUT=3e4,ASYNC_TASK_DEFAULT_TIMEOUT=6e4,ASYNC_TASK_LONG_TIMEOUT=12e4,SYNC_PERIOD=18e4,USER_IDLE_THRESHOLD=3e5,WELCOME_DOCUMENT_TITLE="Welcome document",DOWNLOAD_PROXY_URL="http://stackedit-download-proxy.herokuapp.com/",delayedFunction=undefined,BASE_URL="http://localhost/",GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",GITHUB_CLIENT_ID="e47fef6055344579799d",GATEKEEPER_URL="http://stackedit-gatekeeper-localhost.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy-local.herokuapp.com/";location.hostname.indexOf("benweet.github.io")===0&&(BASE_URL=MAIN_URL,GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",GITHUB_CLIENT_ID="fa0d09514da8377ee32e",GATEKEEPER_URL="http://stackedit-gatekeeper.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy.herokuapp.com/"),define("config",function(){});var saveAs=saveAs||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(e){try{var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=e.URL||e.webkitURL||e,i=t.createElementNS("http://www.w3.org/1999/xhtml","a"),s="download"in i,o=function(n){var r=t.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},u=e.webkitRequestFileSystem,a=e.requestFileSystem||u||e.mozRequestFileSystem,f=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},l="application/octet-stream",c=0,h=[],p=function(){var e=h.length;while(e--){var t=h[e];typeof t=="string"?r.revokeObjectURL(t):t.remove()}h.length=0},d=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var i=e["on"+t[r]];if(typeof i=="function")try{i.call(e,n||e)}catch(s){f(s)}}},v=function(t,r){var f=this,p=t.type,v=!1,m,g,y=function(){var e=n().createObjectURL(t);return h.push(e),e},b=function(){d(f,"writestart progress write writeend".split(" "))},w=function(){if(v||!m)m=y(t);g&&(g.location.href=m),f.readyState=f.DONE,b()},E=function(e){return function(){if(f.readyState!==f.DONE)return e.apply(this,arguments)}},S={create:!0,exclusive:!1},x;f.readyState=f.INIT,r||(r="download");if(s){m=y(t),i.href=m,i.download=r,o(i),f.readyState=f.DONE,b();return}e.chrome&&p&&p!==l&&(x=t.slice||t.webkitSlice,t=x.call(t,0,t.size,l),v=!0),u&&r!=="download"&&(r+=".download"),p===l||u?g=e:g=e.open();if(!a){w();return}c+=t.size,a(e.TEMPORARY,c,E(function(e){e.root.getDirectory("saved",S,E(function(e){var n=function(){e.getFile(r,S,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){g.location.href=e.toURL(),h.push(e),f.readyState=f.DONE,d(f,"writeend",t)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&w()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=f["on"+e]}),n.write(t),f.abort=function(){n.abort(),f.readyState=f.DONE},f.readyState=f.WRITING}),w)}),w)};e.getFile(r,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():w()}))}),w)}),w)},m=v.prototype,g=function(e,t){return new v(e,t)};return m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,e.addEventListener("unload",p,!1),g}catch(y){return undefined}}(self);define("FileSaver",function(){}),showLog=!0,css_browser_selector(navigator.userAgent),define("css_browser_selector",function(){}),define("core",["jquery","mathjax-editing","bootstrap","jgrowl","layout","Markdown.Editor","storage","config","underscore","FileSaver","css_browser_selector"],function(e,t){function r(){n.currentTime=(new Date).getTime()}function l(){o=!0,u=!0,f=n.currentTime}function c(){return u===!0&&n.currentTime-f>USER_IDLE_THRESHOLD&&(u=!1),u&&a}function p(e,t){e.stop(!0,!0).addClass("error").delay(800).switchClass("error"),t!==undefined&&t.stopPropagation()}function m(){n.isOffline===!0&&navigator.onLine===!0&&d+CHECK_ONLINE_PERIODi?(p(e,t),undefined):s)},n.resetModalInputs=function(){e(".modal input[type=text]:not([disabled])").val("")},n.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},n.checkUrl=function(e){return e.indexOf("http")!==0?"http://"+e:e},n.saveFile=function(e,t){if(saveAs!==undefined){var r=new Blob([e],{type:"text/plain;charset=utf-8"});saveAs(r,t)}else{var i="data:application/octet-stream;base64,"+n.encodeBase64(e);window.open(i,"file")}},n.showWorkingIndicator=function(t){t===!1?(e(".working-indicator").removeClass("show"),e("body").removeClass("working")):(e(".working-indicator").addClass("show"),e("body").addClass("working"))},n.showMessage=function(t,n,r){if(!t)return;var i=t.indexOf("|");if(i!==-1){t=t.substring(0,i);if(!t)return}r=r||{},n=n||"icon-info-sign",e.jGrowl(" "+_.escape(t),r)},n.showError=function(e){n.showMessage(e,"icon-warning-sign")},n.isOffline=!1;var d=n.currentTime,v=[];n.addOfflineListener=function(e){v.push(e)},n.setOffline=function(){d=n.currentTime;if(n.isOffline===!1){n.isOffline=!0,n.showMessage("You are offline.","icon-exclamation-sign msg-offline",{sticky:!0,close:function(){n.showMessage("You are back online!","icon-signal")}});for(var e=0;e Written with [StackEdit](http://benweet.github.io/stackedit/).",commitMsg:"Published by http://benweet.github.io/stackedit",template:["\n","\n","\n","<%= documentTitle %>\n","\n","<%= documentHTML %>\n",""].join("")},n.loadSettings=function(){localStorage.settings&&e.extend(n.settings,JSON.parse(localStorage.settings)),e("input:radio[name=radio-layout-orientation][value="+n.settings.layoutOrientation+"]").prop("checked",!0),e("#input-settings-scroll-link").prop("checked",n.settings.scrollLink),e("#input-settings-converter-type").val(n.settings.converterType),e("#input-settings-enable-mathjax").prop("checked",n.settings.enableMathJax),e("#input-settings-lazy-rendering").prop("checked",n.settings.lazyRendering),e("#input-settings-editor-font-size").val(n.settings.editorFontSize),e("#textarea-settings-default-content").val(n.settings.defaultContent),e("#input-settings-publish-commit-msg").val(n.settings.commitMsg),e("#textarea-settings-publish-template").val(n.settings.template)},n.saveSettings=function(t){var r={};r.layoutOrientation=e("input:radio[name=radio-layout-orientation]:checked").prop("value"),r.converterType=e("#input-settings-converter-type").val(),r.enableMathJax=e("#input-settings-enable-mathjax").prop("checked"),r.scrollLink=e("#input-settings-scroll-link").prop("checked"),r.lazyRendering=e("#input-settings-lazy-rendering").prop("checked"),r.editorFontSize=n.getInputIntValue(e("#input-settings-editor-font-size"),t,1,99),r.defaultContent=e("#textarea-settings-default-content").val(),r.commitMsg=n.getInputValue(e("#input-settings-publish-commit-msg"),t),r.template=n.getInputValue(e("#textarea-settings-publish-template"),t),t.isPropagationStopped()||(n.settings=r,localStorage.settings=JSON.stringify(r))};var g=[],y=[],w=_.debounce(function(){function o(e){var t=r;e!==undefined&&(n.val(e),t+=n.prop("scrollHeight"));var i=s+t;g.push({startOffset:s,endOffset:i,height:t}),s=i,r=0}var t=e("#wmd-input");g=[];var n=e("#md-section-helper");n.width(t.width());var r=b(t.css("padding-top")),i=0,s=0,u=t.val()+"\n\n";u.replace(/^```.*\n[\s\S]*?\n```|(^.+[ \t]*\n=+[ \t]*\n+|^.+[ \t]*\n-+[ \t]*\n+|^\#{1,6}[ \t]*.+?[ \t]*\#*\n+)/gm,function(e,t,n){if(t){var r=undefined;n>i&&(r=u.substring(i,n-1)),o(r),i=n}return""}),r+=b(t.css("padding-bottom")),o(u.substring(i,u.length-2));var a=e("#wmd-preview");y=[];var f=0,l=a.scrollTop();a.children("h1,h2,h3,h4,h5,h6").each(function(){var t=e(this).position().top+l+b(e(this).css("margin-top"));y.push({startOffset:f,endOffset:t,height:t-f}),f=t});var c=a.prop("scrollHeight");y.push({startOffset:f,endOffset:c,height:c-f}),E=-9,x=!1,T()},500),E=-9,S=-9,x=!1,T=_.debounce(function(){function s(e,t,n,r,i,s){var o=undefined,u=_.find(t,function(t,n){return o=n,e5?(E=n,s(n,g,r,y,S,function(e){S=e})):Math.abs(i-S)>5&&(S=i,s(i,y,t,g,E,function(e){E=e}))},600),N=undefined;n.createLayout=function(){if(viewerMode===!0)return;var t={closable:!0,resizable:!1,slidable:!1,livePaneResizing:!0,enableCursorHotkey:!1,spacing_open:15,spacing_closed:15,togglerLength_open:90,togglerLength_closed:90,stateManagement__enabled:!1,center__minWidth:200,center__minHeight:200};n.settings.scrollLink===!0&&(t.onresize=w),n.settings.layoutOrientation=="horizontal"?(e(".ui-layout-south").remove(),e(".ui-layout-east").addClass("well").prop("id","wmd-preview"),N=e("body").layout(e.extend(t,{east__resizable:!0,east__size:.5,east__minSize:200}))):n.settings.layoutOrientation=="vertical"&&(e(".ui-layout-east").remove(),e(".ui-layout-south").addClass("well").prop("id","wmd-preview"),N=e("body").layout(e.extend(t,{south__resizable:!0,south__size:.5,south__minSize:200}))),e(".ui-layout-toggler-north").addClass("btn").append(e("").addClass("caret")),e(".ui-layout-toggler-south").addClass("btn").append(e("").addClass("caret")),e(".ui-layout-toggler-east").addClass("btn").append(e("").addClass("caret")),e("#navbar").click(function(){N.allowOverflow("north")}),n.settings.scrollLink===!0&&e("#wmd-input, #wmd-preview").scroll(T)},n.layoutRefresh=function(){N!==undefined&&_.defer(N.resizeAll)};var C=undefined;n.createEditor=function(r){x=!0,S=-9,e("#wmd-input, #wmd-preview").scrollTop(0),e("#wmd-button-bar").empty();var i=new Markdown.Converter;if(n.settings.converterType.indexOf("markdown-extra")===0){var s={};n.settings.converterType=="markdown-extra-prettify"&&(s.highlighter="prettify"),Markdown.Extra.init(i,s)}var o=!0;i.hooks.chain("preConversion",function(e){return o||r(),e}),i.hooks.chain("postConversion",function(e){return e.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g,function(e,t,n){return''+n+""})});var u=new Markdown.Editor(i);n.settings.converterType=="markdown-extra-prettify"&&u.hooks.chain("onPreviewRefresh",prettyPrint);var a=function(){if(viewerMode===!1&&n.settings.scrollLink===!0){function t(){E=-9,w(),e("#wmd-preview img").load(function(){E=-9,w()})}e("#wmd-preview").scrollTop(S),_.defer(t)}};n.settings.enableMathJax===!0?t.prepareWmdForMathJax(u,[["$","$"],["\\\\(","\\\\)"]],function(){x=!0},a):u.hooks.chain("onPreviewRefresh",a),u.hooks.set("insertLinkDialog",function(t){return C=t,n.resetModalInputs(),e("#modal-insert-link").modal(),_.defer(function(){e("#input-insert-link").focus()}),!0}),u.hooks.set("insertImageDialog",function(t){return C=t,n.resetModalInputs(),e("#modal-insert-image").modal(),_.defer(function(){e("#input-insert-image").focus()}),!0});var f=function(e){return e};n.settings.lazyRendering===!0&&(f=function(e){var t=_.debounce(e,500);return function(){o===!0?e():t()}}),u.run(f),o=!1,e(".wmd-button-row").addClass("btn-group").find("li:not(.wmd-spacer)").addClass("btn").css("left",0).find("span").hide(),e("#wmd-bold-button").append(e("").addClass("icon-bold")),e("#wmd-italic-button").append(e("").addClass("icon-italic")),e("#wmd-link-button").append(e("").addClass("icon-globe")),e("#wmd-quote-button").append(e("").addClass("icon-indent-left")),e("#wmd-code-button").append(e("").addClass("icon-code")),e("#wmd-image-button").append(e("").addClass("icon-picture")),e("#wmd-olist-button").append(e("").addClass("icon-numbered-list")),e("#wmd-ulist-button").append(e("").addClass("icon-list")),e("#wmd-heading-button").append(e("").addClass("icon-text-height")),e("#wmd-hr-button").append(e("").addClass("icon-hr")),e("#wmd-undo-button").append(e("").addClass("icon-undo")),e("#wmd-redo-button").append(e("").addClass("icon-share-alt"))},n.encodeBase64=function(e){if(e.length===0)return"";var t=[],n=0,r,i;e=encodeURI(e),r=e.length;while(n>18)),f.push(o.charAt(a>>12&63)),f.push(o.charAt(a>>6&63)),f.push(o.charAt(a&63));switch(t.length-l){case 1:a=t[u]<<16,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+s+s);break;case 2:a=t[u]<<16|t[u+1]<<8,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+o.charAt(a>>6&63)+s)}return f.join("")};var k=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];n.crc32=function(e){var t=0,n=-1;for(var r=0;r>>8^k[t];return n^=-1,n<0&&(n=4294967295+n+1),n.toString(16)},n.randomString=function(){return _.random(4294967296).toString(36)},n.getURLParameter=function(e){var t=new RegExp(e+"=(.+?)(&|$)");try{return decodeURIComponent(t.exec(location.search)[1])}catch(n){return undefined}},n.popupWindow=function(e,t,n,r){var i=screen.width/2-n/2,s=screen.height/2-r/2;return window.open(e,t,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+n+", height="+r+", top="+s+", left="+i)},n.setFileManager=function(e){n.fileManager=e,O()};var L=[];n.onReady=function(e){L.push(e),O()};var A=!1;return e(function(){A=!0,O()}),n.onReady(function(){e.jGrowl.defaults.life=5e3,e.jGrowl.defaults.closer=!1,e.jGrowl.defaults.closeTemplate="",e.jGrowl.defaults.position="bottom-right",e(window).on("offline",n.setOffline),e(window).on("online",n.setOnline),navigator.onLine===!1&&n.setOffline(),e(document).mousemove(l).keypress(l),e(".dropdown-submenu > a").click(function(e){e.stopPropagation()}),e(".action-insert-link").click(function(t){var r=n.getInputValue(e("#input-insert-link"),t);r!==undefined&&C(r)}),e(".action-insert-image").click(function(t){var r=n.getInputValue(e("#input-insert-image"),t);r!==undefined&&C(r)}),e(".action-close-insert-link").click(function(e){C(null)}),n.loadSettings(),e(".action-load-settings").click(function(){n.loadSettings()}),e(".action-apply-settings").click(function(e){n.saveSettings(e),e.isPropagationStopped()||window.location.reload()}),e(".action-default-settings").click(function(){localStorage.removeItem("settings"),window.location.reload()}),e(".action-app-reset").click(function(){localStorage.clear(),window.location.reload()}),e("#menu-bar, .ui-layout-center, .ui-layout-east, .ui-layout-south").removeClass("hide"),n.createLayout(),e("#wmd-input, #md-section-helper").css({"font-size":n.settings.editorFontSize+"px","line-height":Math.round(n.settings.editorFontSize*(20/14))+"px"}),e("#wmd-input").keydown(function(t){if(t.keyCode===9){var n=e(this).val(),r=this.selectionStart,i=this.selectionEnd;if(r===undefined||i===undefined)return;e(this).val(n.substring(0,r)+" "+n.substring(i)),this.selectionStart=this.selectionEnd=r+1,t.preventDefault()}}),e(".tooltip-scroll-link").tooltip({html:!0,container:"#modal-settings",placement:"right",title:["Scroll Link is a feature that binds together editor and preview scrollbars. ","It allows you to keep an eye on the preview while scrolling the editor and vice versa. ","

          ","The mapping between Markdown and HTML is based on the position of the title elements (h1, h2, ...) in the page. ","Therefore, if your document does not contain any title, the mapping will be linear and consequently less efficient."].join("")}),e(".tooltip-lazy-rendering").tooltip({container:"#modal-settings",placement:"right",title:"Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity."}),e(".tooltip-default-content").tooltip({html:!0,container:"#modal-settings",placement:"right",title:"Thanks for supporting StackEdit by adding a backlink in your documents!"}),e(".tooltip-template").tooltip({html:!0,container:"#modal-settings",placement:"right",trigger:"manual",title:["Available variables:
          ","
          • documentTitle: document title
          • ","
          • documentMarkdown: document in Markdown format
          • ","
          • documentHTML: document in HTML format
          • ",'
          • publishAttributes: attributes of the publish location (undefined when using "Save")
          ',"Examples:
          ",_.escape("<%= documentTitle %>"),"
          ",_.escape("
          <%- documentHTML %>
          "),"
          ",_.escape('<% if(publishAttributes.provider == "github") print(documentMarkdown); %>'),'

          More info'].join("")}).click(function(t){e(this).tooltip("show"),t.stopPropagation()}),e(document).click(function(t){e(".tooltip-template").tooltip("hide")}),e(".action-reset-input").click(function(){n.resetModalInputs()}),i=window.setInterval(function(){r(),n.checkWindowUnique();if(c()===!0||viewerMode===!0)_.each(s,function(e){e()}),m()},1e3)}),n}),define("async-runner",["core","underscore"],function(e){function o(){if(i===!0){s+r.timeout=o){n.error(r);return}var u=Math.pow(2,n.retryCounter++)*1e3;s=e.currentTime+u,i=!1,t.runTask()},n},t.runTask=function(){_.defer(o)},e.addPeriodicCallback(t.runTask),t.addTask=function(e){n.push(e),t.runTask()},t.setCurrentTaskTimeout=function(e){r!==undefined&&(r.timeout=e)},t}),define("dropbox-helper",["jquery","core","async-runner"],function(e,t,n){function o(n){n.onRun(function(){if(t.isOffline===!0){r=undefined,n.error(new Error("Operation not available in offline mode."));return}if(r!==undefined){n.chain();return}e.ajax({url:"lib/dropbox.min.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){r=new Dropbox.Client({key:DROPBOX_APP_KEY,secret:DROPBOX_APP_SECRET}),r.authDriver(new Dropbox.Drivers.Popup({receiverUrl:BASE_URL+"dropbox-oauth-receiver.html",rememberUser:!0})),n.chain()}).fail(function(e){var t={status:e.status,responseText:e.statusText};a(t,n)})})}function u(e){e.onRun(function(){function s(){n===!1&&(t.showMessage("Please make sure the Dropbox authorization popup is not blocked by your browser."),e.timeout=ASYNC_TASK_LONG_TIMEOUT),r.reset(),r.authenticate({interactive:!n},function(t,r){if(r.authState===Dropbox.Client.DONE){i=!0,e.chain();return}if(n===!0){n=!1,e.chain(s);return}e.error(new Error("Access to Dropbox account is not authorized."))})}if(i===!0){e.chain();return}var n=!0;e.chain(s)})}function a(e,n){var s=!0;if(e){console.error(e);if(typeof e=="string")s=e;else{s="Dropbox error ("+e.status+": "+e.responseText+").";if(e.status===Dropbox.ApiError.INVALID_TOKEN||e.status===Dropbox.ApiError.OAUTH_ERROR){i=!1,s="Access to Dropbox account is not authorized.",n.retry(new Error(s),1);return}if(e.status===Dropbox.ApiError.INVALID_PARAM&&e.responseText.indexOf("oauth_nonce")!==-1){_.each(_.keys(localStorage),function(e){e.indexOf("dropbox-auth")===0&&localStorage.removeItem(e)}),i=!1,n.retry(new Error(s),1);return}if(e.status===Dropbox.ApiError.NETWORK_ERROR||e.status<0)r=undefined,i=!1,t.setOffline(),s="|stopPublish"}}n.error(new Error(s))}function l(t){t.onRun(function(){if(f===!0){t.chain();return}e.ajax({url:"https://www.dropbox.com/static/api/1/dropbox.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){f=!0,t.chain()}).fail(function(e){var n={status:e.status,responseText:e.statusText};a(n,t)})})}var r=undefined,i=!1,s={};s.upload=function(e,i,s){s=s||t.doNothing;var f=undefined,l=n.createTask();o(l),u(l),l.onRun(function(){r.writeFile(e,i,function(t,n){if(!t){f=n,l.chain();return}t.status===Dropbox.ApiError.INVALID_PARAM&&(t='Could not upload document into path "'+e+'".'),a(t,l)})}),l.onSuccess(function(){s(undefined,f)}),l.onError(function(e){s(e)}),n.addTask(l)},s.checkChanges=function(e,i){i=i||t.doNothing;var s=[],f=e||0,l=n.createTask();o(l),u(l),l.onRun(function(){function e(){r.pullChanges(f,function(t,n){if(t){a(t,l);return}f=n.cursor(),n.changes!==undefined&&(s=s.concat(n.changes)),n.shouldPullAgain?l.chain(e):l.chain()})}l.chain(e)}),l.onSuccess(function(){i(undefined,s,f)}),l.onError(function(e){i(e)}),n.addTask(l)},s.downloadMetadata=function(e,i){i=i||t.doNothing;var s=[],f=n.createTask();o(f),u(f),f.onRun(function(){function t(){if(e.length===0){f.chain();return}var n=e[0];r.stat(n,function(n,r){if(r){s.push(r),e.shift(),f.chain(t);return}a(n,f)})}f.chain(t)}),f.onSuccess(function(){i(undefined,s)}),f.onError(function(e){i(e)}),n.addTask(f)},s.downloadContent=function(e,i){i=i||t.doNothing;var s=[],f=n.createTask();o(f),u(f),f.onRun(function(){function t(){if(e.length===0){f.chain();return}var n=e[0];s.push(n);var i=undefined;n.isFile===!0?i=n:n.wasRemoved!==undefined&&(i=n.stat);if(!i){e.shift(),f.chain(t);return}r.readFile(i.path,function(n,r){if(r){i.content=r,e.shift(),f.chain(t);return}a(n,f)})}f.chain(t)}),f.onSuccess(function(){i(undefined,s)}),f.onError(function(e){i(e)}),n.addTask(f)};var f=!1;return s.picker=function(e){e=e||t.doNothing;var r=[],i=n.createTask();i.timeout=ASYNC_TASK_LONG_TIMEOUT,o(i),l(i),i.onRun(function(){var e={};e.multiselect=!0,e.linkType="direct",e.success=function(e){for(var t=0;t:"\|?\*]+$/)?e.indexOf("/")!==0?"/"+e:e:(t.showError('"'+e+'" contains invalid characters.'),undefined)}function o(e,n,i){var s={};return s.provider=r,s.path=e,s.version=n,s.contentCRC=t.crc32(i),s}function u(e){return"sync."+r+"."+encodeURIComponent(e.toLowerCase())}function a(e){n.downloadMetadata(e,function(e,r){if(e)return;n.downloadContent(r,function(e,n){if(e)return;var r=[];_.each(n,function(e){var n=o(e.path,e.versionTag,e.content),i=u(n.path);localStorage[i]=JSON.stringify(n);var s=t.fileManager.createFile(e.name,e.content,[i]);t.fileManager.selectFile(s),r.push('"'+e.name+'"')}),t.showMessage(r.join(", ")+" imported successfully from Dropbox.")})})}function f(e,r,i,a){e=s(e);if(e===undefined){a(!0);return}var f=u(e),l=t.fileManager.getFileIndexFromSync(f);if(l!==undefined){var c=localStorage[l+".title"];t.showError('File path is already synchronized with "'+c+'"'),a(!0);return}n.upload(e,i,function(e,t){if(e){a(e);return}var n=o(t.path,t.versionTag,i),r=u(n.path);localStorage[r]=JSON.stringify(n),a(undefined,r)})}var r="dropbox",i={providerId:r,providerName:"Dropbox",defaultPublishFormat:"template",useSync:!1};return i.importFiles=function(){n.picker(function(e,n){if(e||n.length===0)return;var r=[];_.each(n,function(e){var n=u(e),i=t.fileManager.getFileIndexFromSync(n);if(i!==undefined){var s=localStorage[i+".title"];t.showError('"'+s+'" was already imported');return}r.push(e)}),a(r)})},i.exportFile=function(n,r,i,s){var o=t.getInputValue(e("#input-sync-export-dropbox-path"),n);f(o,r,i,s)},i.exportManual=function(n,r,i,s){var o=t.getInputValue(e("#input-sync-manual-dropbox-path"),n);f(o,r,i,s)},i.syncUp=function(e,t,r,i,s,o){var u=s.contentCRC;if(t==u){o(undefined,!1);return}n.upload(s.path,e,function(e,n){if(e){o(e,!0);return}s.version=n.versionTag,s.contentCRC=t,o(undefined,!0)})},i.syncDown=function(e){if(i.useSync===!1){e();return}var s=localStorage[r+".lastChangeId"];n.checkChanges(s,function(i,s,o){if(i){e(i);return}var a=[];_.each(s,function(e){var t=u(e.path),n=localStorage[t];if(n===undefined)return;e.syncIndex=t;if(e.wasRemoved===!0){a.push(e);return}var r=JSON.parse(n);r.version!=e.stat.versionTag&&(a.push(e),e.syncAttributes=r)}),n.downloadContent(a,function(n,i){if(n){e(n);return}var s=!1;_.each(i,function(e){var n=e.syncIndex,r=t.fileManager.getFileIndexFromSync(n);if(r===undefined){t.fileManager.removeSync(n);return}var i=localStorage[r+".title"];if(e.wasRemoved===!0){t.fileManager.removeSync(n),s=!0,t.showMessage('"'+i+'" has been removed from Dropbox.');return}var o=e.syncAttributes,u=localStorage[r+".content"],a=o.contentCRC!=t.crc32(u),f=e.stat,l=t.crc32(f.content),c=o.contentCRC!=l,h=u!=f.content;h===!0&&a===!0&&c===!0&&(t.fileManager.createFile(i+" (backup)",u),s=!0,t.showMessage('Conflict detected on "'+i+'". A backup has been created locally.')),h&&c===!0&&(localStorage[r+".content"]=f.content,t.showMessage('"'+i+'" has been updated from Dropbox.'),t.fileManager.isCurrentFileIndex(r)&&(s=!1,t.fileManager.selectFile())),o.version=f.versionTag,o.contentCRC=l,localStorage[n]=JSON.stringify(o)}),s&&t.fileManager.updateFileTitles(),localStorage[r+".lastChangeId"]=o,e()})})},i.publish=function(e,t,r,i){var o=s(e.path);if(o===undefined){i(!0);return}n.upload(o,r,i)},i.newPublishAttributes=function(n){var r={};return r.path=t.getInputValue(e("#input-publish-dropbox-path"),n),n.isPropagationStopped()?undefined:r},i}),define("google-helper",["jquery","core","async-runner"],function(e,t,n){function o(n){n.onRun(function(){if(t.isOffline===!0){r=!1,n.error(new Error("Operation not available in offline mode."));return}if(r===!0){n.chain();return}delayedFunction=function(){r=!0,n.chain()},e.ajax({url:"https://apis.google.com/js/client.js?onload=runDelayedFunction",dataType:"script",timeout:AJAX_TIMEOUT}).fail(function(e){var t={code:e.status,message:e.statusText};a(t,n)})})}function u(e){e.onRun(function(){function s(){n===!1&&(t.showMessage("Please make sure the Google authorization popup is not blocked by your browser."),e.timeout=ASYNC_TASK_LONG_TIMEOUT),gapi.auth.authorize({client_id:GOOGLE_CLIENT_ID,scope:GOOGLE_SCOPES,immediate:n},function(t){gapi.client.load("drive","v2",function(){if(!t||t.error){if(r===!0&&n===!0){n=!1,e.chain(s);return}e.error(new Error("Access to Google account is not authorized."));return}i=!0,e.chain()})})}if(i===!0){e.chain();return}var n=!0;e.chain(s)})}function a(e,n){var s=undefined;if(e){console.error(e);if(typeof e=="string")s=e;else{s="Google error ("+e.code+": "+e.message+").";if(e.code>=500&&e.code<600){n.retry(new Error(s));return}if(e.code===401||e.code===403){i=!1,s="Access to Google account is not authorized.",n.retry(new Error(s),1);return}e.code<=0&&(r=!1,i=!1,t.setOffline(),s="|stopPublish")}}n.error(new Error(s))}function l(t){t.onRun(function(){if(f===!0){t.chain();return}e.ajax({url:"//www.google.com/jsapi",data:{key:GOOGLE_API_KEY},dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){google.load("picker","1",{callback:t.chain}),f=!0}).fail(function(e){var n={code:e.status,message:e.statusText};a(n,t)})})}var r=!1,i=!1,s={};s.upload=function(e,r,i,s,f,l){l=l||t.doNothing;var c=undefined,h=n.createTask();o(h),u(h),h.onRun(function(){var n="-------314159265358979323846",o="\r\n--"+n+"\r\n",u="\r\n--"+n+"--",l="text/x-markdown",p={title:i,mimeType:l};r!==undefined&&(p.parents=[{kind:"drive#fileLink",id:r}]);var d="/upload/drive/v2/files",v="POST";e!==undefined&&(d+="/"+e,v="PUT");var m={"Content-Type":'multipart/mixed; boundary="'+n+'"'};f!==undefined;var g=t.encodeBase64(s),y=o+"Content-Type: application/json\r\n\r\n"+JSON.stringify(p)+o+"Content-Type: "+l+"\r\n"+"Content-Transfer-Encoding: base64\r\n"+"\r\n"+g+u,b=gapi.client.request({path:d,method:v,params:{uploadType:"multipart"},headers:m,body:y});b.execute(function(t){if(t&&t.id){c=t,h.chain();return}var n=t.error;n!==undefined&&e!==undefined&&(n.code===404?n='File ID "'+e+'" not found on Google Drive.|removePublish':n.code===412&&(localStorage.removeItem("gdrive.lastChangeId"),n='Conflict on file ID "'+e+'". Please restart the synchronization.')),a(n,h)})}),h.onSuccess(function(){l(undefined,c)}),h.onError(function(e){l(e)}),n.addTask(h)},s.checkChanges=function(e,r){r=r||t.doNothing;var i=[],s=e||0,f=n.createTask();o(f),u(f),f.onRun(function(){function t(){var n=undefined;e===undefined?n=gapi.client.drive.changes.list({startChangeId:s+1}):n=gapi.client.drive.changes.list({pageToken:e}),n.execute(function(n){if(!n||!n.largestChangeId){a(n.error,f);return}s=n.largestChangeId,e=n.nextPageToken,n.items!==undefined&&(i=i.concat(n.items)),e!==undefined?f.chain(t):f.chain()})}var e=undefined;f.chain(t)}),f.onSuccess(function(){r(undefined,i,s)}),f.onError(function(e){r(e)}),n.addTask(f)},s.downloadMetadata=function(r,i,s){i=i||t.doNothing;var f=[],l=n.createTask();o(l),s||u(l),l.onRun(function(){function t(){if(r.length===0){l.chain();return}var n=r[0],i={},s=gapi.auth.getToken();s&&(i.Authorization="Bearer "+s.access_token),e.ajax({url:"https://www.googleapis.com/drive/v2/files/"+n,headers:i,data:{key:GOOGLE_API_KEY},dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,n,i){f.push(e),r.shift(),l.chain(t)}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&(t='File ID "'+n+'" not found on Google Drive.'),a(t,l)})}l.chain(t)}),l.onSuccess(function(){i(undefined,f)}),l.onError(function(e){i(e)}),n.addTask(l)},s.downloadContent=function(r,i,s){i=i||t.doNothing;var f=[],l=n.createTask();l.timeout=ASYNC_TASK_LONG_TIMEOUT,o(l),s||u(l),l.onRun(function(){function t(){if(r.length===0){l.chain();return}var n=r[0];f.push(n);var i=undefined;n.kind=="drive#file"?i=n:n.kind=="drive#change"&&(i=n.file);if(!i){r.shift(),l.chain(t);return}var s={},o=gapi.auth.getToken();o&&(s.Authorization="Bearer "+o.access_token),e.ajax({url:i.downloadUrl,headers:s,data:{key:GOOGLE_API_KEY},dataType:"text",timeout:AJAX_TIMEOUT}).done(function(e,n,s){i.content=e,r.shift(),l.chain(t)}).fail(function(e){var t={code:e.status,message:e.statusText};a(t,l)})}l.chain(t)}),l.onSuccess(function(){i(undefined,f)}),l.onError(function(e){i(e)}),n.addTask(l)};var f=!1;return s.picker=function(r){function u(){s!==undefined&&(s.setVisible(!1),e(".modal-backdrop, .picker").remove())}r=r||t.doNothing;var i=[],s=undefined,a=n.createTask();o(a),l(a),a.onRun(function(){var t=new google.picker.View(google.picker.ViewId.DOCS);t.setMimeTypes("text/x-markdown,text/plain,application/octet-stream");var n=new google.picker.PickerBuilder;n.enableFeature(google.picker.Feature.NAV_HIDDEN),n.enableFeature(google.picker.Feature.MULTISELECT_ENABLED),n.setAppId(GOOGLE_DRIVE_APP_ID);var r=gapi.auth.getToken();r&&n.setOAuthToken(r.access_token),n.addView(t),n.addView(new google.picker.DocsUploadView),n.setCallback(function(e){if(e.action==google.picker.Action.PICKED||e.action==google.picker.Action.CANCEL){if(e.action==google.picker.Action.PICKED)for(var t=0;t").addClass("modal-backdrop").click(function(){u(),a.chain()})),s.setVisible(!0)}),a.onSuccess(function(){r(undefined,i)}),a.onError(function(e){u(),r(e)}),n.addTask(a)},s.uploadBlogger=function(t,r,i,s,f,l,c){var h=n.createTask();o(h),u(h),h.onRun(function(){function u(){var t="https://www.googleapis.com/blogger/v3/blogs/"+r+"/posts/",o={kind:"blogger#post",blog:{id:r},labels:s,title:f,content:l},u="POST";i!==undefined&&(t+=i,o.id=i,u="PUT"),e.ajax({url:t,data:JSON.stringify(o),headers:n,type:u,contentType:"application/json",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){i=e.id,h.chain()}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&i!==undefined&&(t="Post "+i+" not found on Blogger.|removePublish"),a(t,h)})}function c(){if(r!==undefined){h.chain(u);return}e.ajax({url:"https://www.googleapis.com/blogger/v3/blogs/byurl",data:{url:t},headers:n,dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){r=e.id,h.chain(u)}).fail(function(e){var n={code:e.status,message:e.statusText};n.code===404&&(n='Blog "'+t+'" not found on Blogger.|removePublish'),a(n,h)})}var n={},o=gapi.auth.getToken();o&&(n.Authorization="Bearer "+o.access_token),h.chain(c)}),h.onSuccess(function(){c(undefined,r,i)}),h.onError(function(e){c(e)}),n.addTask(h)},s}),define("gdrive-provider",["jquery","core","google-helper","underscore"],function(e,t,n){function s(e,n,i,s){var o={};return o.provider=r,o.id=e,o.etag=n,o.contentCRC=t.crc32(i),o.titleCRC=t.crc32(s),o}function o(e){return"sync."+r+"."+e}function u(e){n.downloadMetadata(e,function(e,r){if(e)return;n.downloadContent(r,function(e,n){if(e)return;var r=[];_.each(n,function(e){var n=s(e.id,e.etag,e.content,e.title),i=o(n.id);localStorage[i]=JSON.stringify(n);var u=t.fileManager.createFile(e.title,e.content,[i]);t.fileManager.selectFile(u),r.push('"'+e.title+'"')});if(r.length===0)return;t.showMessage(r.join(", ")+" imported successfully from Google Drive.")})})}var r="gdrive",i={providerId:r,providerName:"Google Drive",defaultPublishFormat:"template",useSync:!1};return i.importFiles=function(){n.picker(function(e,n){if(e||n.length===0)return;var r=[];_.each(n,function(e){var n=o(e),i=t.fileManager.getFileIndexFromSync(n);if(i!==undefined){var s=localStorage[i+".title"];t.showError('"'+s+'" was already imported');return}r.push(e)}),u(r)})},i.exportFile=function(e,t,r,i){n.upload(undefined,undefined,t,r,undefined,function(e,n){if(e){i(e);return}var u=s(n.id,n.etag,r,t),a=o(u.id);localStorage[a]=JSON.stringify(u),i(undefined,a)})},i.exportManual=function(r,i,u,a){var f=t.getInputValue(e("#input-sync-manual-gdrive-id"),r);if(!f)return;var l=o(f),c=t.fileManager.getFileIndexFromSync(l);if(c!==undefined){var h=localStorage[c+".title"];t.showError('File ID is already synchronized with "'+h+'"'),a(!0);return}n.upload(f,undefined,i,u,undefined,function(e,t){if(e){a(e);return}var n=s(t.id,t.etag,u,i),r=o(n.id);localStorage[r]=JSON.stringify(n),a(undefined,r)})},i.syncUp=function(e,t,r,i,s,o){var u=s.contentCRC,a=s.titleCRC;if(t==u&&i==a){o(undefined,!1);return}n.upload(s.id,undefined,r,e,s.etag,function(e,n){if(e){o(e,!0);return}s.etag=n.etag,s.contentCRC=t,s.titleCRC=i,o(undefined,!0)})},i.syncDown=function(e){if(i.useSync===!1){e();return}var s=parseInt(localStorage[r+".lastChangeId"]);n.checkChanges(s,function(i,s,u){if(i){e(i);return}var a=[];_.each(s,function(e){var t=o(e.fileId),n=localStorage[t];if(n===undefined)return;e.syncIndex=t;if(e.deleted===!0){a.push(e);return}var r=JSON.parse(n);r.etag!=e.file.etag&&(a.push(e),e.syncAttributes=r)}),n.downloadContent(a,function(n,i){if(n){e(n);return}var s=!1;_.each(i,function(e){var n=e.syncIndex,r=t.fileManager.getFileIndexFromSync(n);if(r===undefined){t.fileManager.removeSync(n);return}var i=localStorage[r+".title"];if(e.deleted===!0){t.fileManager.removeSync(n),s=!0,t.showMessage('"'+i+'" has been removed from Google Drive.');return}var o=e.syncAttributes,u=o.titleCRC!=t.crc32(i),a=localStorage[r+".content"],f=o.contentCRC!=t.crc32(a),l=e.file,c=t.crc32(l.title),h=o.titleCRC!=c,p=i!=l.title,d=t.crc32(l.content),v=o.contentCRC!=d,m=a!=l.content;if(p===!0&&u===!0&&h===!0||m===!0&&f===!0&&v===!0)t.fileManager.createFile(i+" (backup)",a),s=!0,t.showMessage('Conflict detected on "'+i+'". A backup has been created locally.');p&&h===!0&&(localStorage[r+".title"]=l.title,s=!0,t.showMessage('"'+i+'" has been renamed to "'+l.title+'" on Google Drive.')),m&&v===!0&&(localStorage[r+".content"]=l.content,t.showMessage('"'+l.title+'" has been updated from Google Drive.'),t.fileManager.isCurrentFileIndex(r)&&(s=!1,t.fileManager.selectFile())),o.etag=l.etag,o.contentCRC=d,o.titleCRC=c,localStorage[n]=JSON.stringify(o)}),s&&t.fileManager.updateFileTitles(),localStorage[r+".lastChangeId"]=u,e()})})},i.publish=function(e,t,r,i){n.upload(e.id,undefined,e.fileName||t,r,undefined,function(t,n){if(t){i(t);return}e.id=n.id,i()})},i.newPublishAttributes=function(t){var n={};return n.id=e("#input-publish-gdrive-fileid").val()||undefined,n.fileName=e("#input-publish-gdrive-filename").val()||undefined,t.isPropagationStopped()?undefined:n},t.onReady(function(){var e=localStorage[r+".state"];if(e===undefined)return;localStorage.removeItem(r+".state"),e=JSON.parse(e);if(e.action=="create")n.upload(undefined,e.folderId,GDRIVE_DEFAULT_FILE_TITLE,"",undefined,function(e,n){if(e)return;var r=s(n.id,n.etag,n.content,n.title),i=t.fileManager.createFile(n.title,n.content,[r]);t.fileManager.selectFile(i),t.showMessage('"'+n.title+'" created successfully on Google Drive.')});else if(e.action=="open"){var i=[];_.each(e.ids,function(e){var n=o(e),r=t.fileManager.getFileIndexFromSync(n);r!==undefined?t.fileManager.selectFile(r):i.push(e)}),u(i)}}),i}),define("synchronizer",["jquery","core","dropbox-provider","gdrive-provider","underscore"],function(e,t){function l(e){if(s.length===0){h(e);return}var t=s.pop(),n=JSON.parse(localStorage[t]);r[n.provider].syncUp(o,u,a,f,n,function(r,s){s===!0&&(p=!0,i=!0);if(r){e(r);return}s&&(localStorage[t]=JSON.stringify(n)),l(e)})}function h(e){if(c.length===0){d(e);return}var n=c.pop(),r=localStorage[n+".sync"];if(r.length===1){h(e);return}o=localStorage[n+".content"],u=t.crc32(o),a=localStorage[n+".title"],f=t.crc32(a),s=_.compact(r.split(";")),l(e)}function d(e){p===!0?(p=!1,c=_.compact(localStorage["file.list"].split(";")),h(e)):e()}function m(e){if(v.length===0){e();return}var t=v.pop();t.syncDown(function(t){if(t){e(t);return}m(e)})}function g(e){v=_.values(r),m(e)}var n={},r=_.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),i=!1;n.notifyChange=function(e){localStorage[e+".sync"].length!==1&&(i=!0,n.updateSyncButton())},n.updateSyncButton=function(){y===!0||i===!1||t.isOffline?e(".action-force-sync").addClass("disabled"):e(".action-force-sync").removeClass("disabled")},t.addOfflineListener(n.updateSyncButton),n.forceSync=function(){b=0,n.sync()};var s=[],o=undefined,u=undefined,a=undefined,f=undefined,c=[],p=!1,v=[],y=!1,b=0;n.sync=function(){function e(e){return e!==undefined?(console.error(e),y=!1,n.updateSyncButton(),!0):!1}if(y||b+SYNC_PERIOD>t.currentTime||t.isOffline)return;y=!0,p=!0,b=t.currentTime,n.updateSyncButton(),g(function(t){if(e(t))return;d(function(t){if(e(t))return;y=!1,i=!1})})},viewerMode===!1&&t.addPeriodicCallback(n.sync);var w=['
          ','','','',"
          "].join(""),E='';return n.refreshManageSync=function(){var n=t.fileManager.getCurrentFileIndex(),i=_.compact(localStorage[n+".sync"].split(";"));e(".msg-no-sync, .msg-sync-list").addClass("hide");var s=e("#manage-sync-list").empty();i.length>0?e(".msg-sync-list").removeClass("hide"):e(".msg-no-sync").removeClass("hide"),_.each(i,function(n){var i=JSON.parse(localStorage[n]),o=i.id||i.path,u=e(_.template(w,{provider:r[i.provider],syncDesc:o}));u.append(e(E).click(function(){t.fileManager.removeSync(n),t.fileManager.updateFileTitles()})),s.append(u)})},n.resetSyncFlags=function(){_.each(r,function(e){e.useSync=!1})},n.getSyncAttributesFromFile=function(e){var t=_.compact(localStorage[e+".sync"].split(";")),n=[];return _.each(t,function(e){var t=JSON.parse(localStorage[e]);n.push(t),r[t.provider].useSync=!0}),n},t.onReady(function(){_.each(r,function(r){e(".action-sync-import-"+r.providerId).click(function(e){r.importFiles(e)}),e(".action-sync-export-"+r.providerId).click(function(e){var i=t.fileManager.getCurrentFileIndex(),s=localStorage[i+".title"],o=localStorage[i+".content"];r.exportFile(e,s,o,function(e,o){if(e)return;localStorage[i+".sync"]+=o+";",n.refreshManageSync(),t.fileManager.updateFileTitles(),t.showMessage('"'+s+'" will now be synchronized on '+r.providerName+".")})}),e(".action-sync-manual-"+r.providerId).click(function(e){var i=t.fileManager.getCurrentFileIndex(),s=localStorage[i+".title"],o=localStorage[i+".content"];r.exportManual(e,s,o,function(e,o){if(e)return;localStorage[i+".sync"]+=o+";",n.refreshManageSync(),t.fileManager.updateFileTitles(),t.showMessage('"'+s+'" will now be synchronized on '+r.providerName+".")})})}),n.updateSyncButton(),e(".action-force-sync").click(function(){e(this).hasClass("disabled")||n.forceSync()})}),n}),define("download-provider",["jquery","core","async-runner"],function(e,t,n){var r="download",i={providerId:r,sharingAttributes:["url"]};return i.importPublic=function(t,r){var i=n.createTask(),s=undefined,o=undefined;i.onRun(function(){var n=t.url,r=n.lastIndexOf("/");if(r===-1){i.error(new Error("Invalid URL parameter."));return}s=n.substring(r+1),e.ajax({url:DOWNLOAD_PROXY_URL+"download?url="+n,type:"GET",dataType:"text",timeout:AJAX_TIMEOUT}).done(function(e,t,n){o=e,i.chain()}).fail(function(e){i.error(new Error("Unable to access URL "+n))})}),i.onSuccess(function(){r(undefined,s,o)}),i.onError(function(e){r(e)}),n.addTask(i)},i}),define("github-helper",["jquery","core","async-runner"],function(e,t,n){function o(n){n.onRun(function(){if(t.isOffline===!0){r=!1,n.error(new Error("Operation not available in offline mode."));return}if(r===!0){n.chain();return}e.ajax({url:"lib/github.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){r=!0,n.chain()}).fail(function(e){var t={error:e.status,message:e.statusText};a(t,n)})})}function u(n){var r=undefined,s=undefined;n.onRun(function(){function f(){localStorage.removeItem("githubCode"),r=t.popupWindow("github-oauth-client.html?client_id="+GITHUB_CLIENT_ID,"stackedit-github-oauth",960,600),r.focus(),s=setInterval(function(){if(r.closed===!0){clearInterval(s),r=undefined,s=undefined,a=localStorage.githubCode;if(a===undefined){n.error(new Error(u));return}localStorage.removeItem("githubCode"),n.chain(l)}},500)}function l(){e.getJSON(GATEKEEPER_URL+"authenticate/"+a,function(e){e.token!==undefined?(o=e.token,localStorage.githubToken=o,i=new Github({token:o,auth:"oauth"}),n.chain()):n.error(new Error(u))})}if(i!==undefined){n.chain();return}var o=localStorage.githubToken;if(o!==undefined){i=new Github({token:o,auth:"oauth"}),n.chain();return}t.showMessage("Please make sure the Github authorization popup is not blocked by your browser.");var u="Failed to retrieve a token from GitHub.";n.timeout=ASYNC_TASK_LONG_TIMEOUT;var a=undefined;n.chain(f)}),n.onError(function(){s!==undefined&&clearInterval(s),r!==undefined&&r.close()})}function a(e,n){var s=undefined;if(e){console.error(e);if(typeof e=="string")s=e;else{s="Could not publish on GitHub.";if(e.error===401||e.error===403){i=undefined,localStorage.removeItem("githubToken"),s="Access to GitHub account is not authorized.",n.retry(new Error(s),1);return}e.error<=0&&(r=!1,i=undefined,t.setOffline(),s="|stopPublish")}}n.error(new Error(s))}var r=undefined,i=undefined,s={};return s.upload=function(e,r,s,f,l,c){c=c||t.doNothing;var h=n.createTask();o(h),u(h),h.onRun(function(){function n(){var e=i.getUser();e.show(undefined,function(e,n){if(e){a(e,h);return}t=n.login,h.chain(o)})}function o(){var n=i.getRepo(t,e);n.write(r,s,f,l,function(e){if(e){a(e,h);return}h.chain()})}var t=undefined;h.chain(n)}),h.onSuccess(function(){c()}),h.onError(function(e){c(e)}),n.addTask(h)},s.uploadGist=function(e,r,s,f,l,c){c=c||t.doNothing;var h=n.createTask();o(h),u(h),h.onRun(function(){var t=i.getGist(e),n={};n[r]={content:l},githubFunction=t.update,e===undefined&&(githubFunction=t.create),githubFunction({description:f,"public":s,files:n},function(t,n){if(t){t.error===404&&e!==undefined&&(t="Gist "+e+" not found on GitHub.|removePublish"),a(t,h);return}e=n.id,h.chain()})}),h.onSuccess(function(){c(undefined,e)}),h.onError(function(e){c(e)}),n.addTask(h)},s.downloadGist=function(e,r,i){i=i||t.doNothing;var s=n.createTask();o(s);var u=undefined,a=undefined;s.onRun(function(){var t=new Github({}),n=t.getGist(e);n.read(function(t,n){if(t){s.error(new Error("Error trying to access Gist "+e+"."));return}u=n.description;var i=n.files[r];if(i===undefined){s.error(new Error("Gist "+e+' does not contain "'+r+'".'));return}a=i.content,s.chain()})}),s.onSuccess(function(){i(undefined,u,a)}),s.onError(function(e){i(e)}),n.addTask(s)},s}),define("gist-provider",["jquery","core","github-helper"],function(e,t,n){var r="gist",i={providerId:r,providerName:"Gist",sharingAttributes:["gistId","filename"]};return i.publish=function(e,t,r,i){n.uploadGist(e.gistId,e.filename,e.isPublic,t,r,function(t,n){if(t){i(t);return}e.gistId=n,i()})},i.newPublishAttributes=function(n){var r={};return r.gistId=e("#input-publish-gist-id").val()||undefined,r.filename=t.getInputValue(e("#input-publish-filename"),n),r.isPublic=e("#input-publish-gist-public").is(":checked"),n.isPropagationStopped()?undefined:r},i.importPublic=function(e,t){n.downloadGist(e.gistId,e.filename,t)},i}),define("sharing",["jquery","core","async-runner","download-provider","gist-provider","underscore"],function(e,t,n){function o(){if(t.isOffline===!0)return;if(!_.has(localStorage,"missingSharingLink"))return;localStorage.removeItem("missingSharingLink");var e=_.compact(localStorage["file.list"].split(";"));_.each(e,function(e){var t=localStorage[e+".sync"].split(";"),n=localStorage[e+".publish"].split(";"),i=_.compact(t.concat(n));_.each(i,function(e){var t=JSON.parse(localStorage[e]);r.createLink(t,function(n){n!==undefined&&(localStorage[e]=JSON.stringify(t))})})})}var r={},i=_.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),s=['
          ','','',"
          "].join("");return r.refreshDocumentSharing=function(t){var n=e("#link-container .link-list").empty();e("#link-container .no-link").show(),_.each(t,function(t){if(t.sharingLink){var r=e(_.template(s,{link:t.sharingLink}));r.click(function(e){e.stopPropagation()}),n.append(r),e("#link-container .no-link").hide()}})},r.createLink=function(r,s){function f(){a===undefined&&(localStorage.missingSharingLink=!0),s(a)}var o=i[r.provider];if(r.sharingLink!==undefined||o===undefined||r.format!="markdown"){s();return}var u=n.createTask(),a=undefined;u.onRun(function(){if(t.isOffline===!0){u.chain();return}var n=[MAIN_URL,"viewer.html?provider=",r.provider];_.each(o.sharingAttributes,function(e){n.push("&"),n.push(e),n.push("="),n.push(encodeURIComponent(r[e]))}),e.getJSON("https://api-ssl.bitly.com/v3/shorten",{access_token:BITLY_ACCESS_TOKEN,longUrl:n.join("")},function(e){e.data&&(a=e.data.url,r.sharingLink=a),u.chain()})}),u.onSuccess(f),u.onError(f),n.addTask(u)},viewerMode===!1&&t.addPeriodicCallback(o),t.onReady(function(){if(viewerMode===!1)return;var n=t.getURLParameter("provider");n===undefined&&(n="download");var r=i[n];if(r===undefined)return;var s={};_.each(r.sharingAttributes,function(e){var n=t.getURLParameter(e);if(!n){s=undefined;return}s[e]=n});if(s===undefined)return;e("#wmd-preview, #file-title").hide(),r.importPublic(s,function(n,r,i){e("#wmd-preview, #file-title").show();if(n)return;var s=t.fileManager.createFile(r,i,undefined,!0);t.fileManager.selectFile(s)})}),r}),define("blogger-provider",["jquery","core","google-helper"],function(e,t,n){var r="blogger",i={providerId:r,providerName:"Blogger",defaultPublishFormat:"html"};return i.publish=function(e,t,r,i){n.uploadBlogger(e.blogUrl,e.blogId,e.postId,e.labelList,t,r,function(t,n,r){if(t){i(t);return}e.blogId=n,e.postId=r,i()})},i.newPublishAttributes=function(n){var r={},i=t.getInputValue(e("#input-publish-blogger-url"),n);i!==undefined&&(r.blogUrl=t.checkUrl(i)),r.postId=e("#input-publish-postid").val()||undefined,r.labelList=[];var s=e("#input-publish-labels").val()||undefined;return s!==undefined&&(r.labelList=_.chain(s.split(",")).map(function(e){return t.trim(e)}).compact().value()),n.isPropagationStopped()?undefined:r},i}),define("github-provider",["jquery","core","github-helper"],function(e,t,n){var r="github",i={providerId:r,providerName:"GitHub"};return i.publish=function(e,r,i,s){var o=t.settings.commitMsg;n.upload(e.repository,e.branch,e.path,i,o,s)},i.newPublishAttributes=function(n){var r={};return r.repository=t.getInputValue(e("#input-publish-github-reponame"),n),r.branch=t.getInputValue(e("#input-publish-github-branch"),n),r.path=t.getInputValue(e("#input-publish-github-path"),n),n.isPropagationStopped()?undefined:r},i}),define("tumblr-helper",["jquery","core","async-runner"],function(e,t,n){function s(e){e.onRun(function(){if(t.isOffline===!0){e.error(new Error("Operation not available in offline mode."));return}e.chain()})}function o(n){var i=undefined,s=undefined;n.onRun(function(){function f(){e.getJSON(TUMBLR_PROXY_URL+"request_token",function(e){e.oauth_token!==undefined?(a=e,n.chain(l)):n.error(new Error(u))})}function l(){localStorage.removeItem("tumblrVerifier"),i=t.popupWindow("tumblr-oauth-client.html?oauth_token="+a.oauth_token,"stackedit-tumblr-oauth",800,600),i.focus(),s=setInterval(function(){if(i.closed===!0){clearInterval(s),i=undefined,s=undefined,a.oauth_verifier=localStorage.tumblrVerifier;if(a.oauth_verifier===undefined){n.error(new Error(u));return}localStorage.removeItem("tumblrVerifier"),n.chain(c)}},500)}function c(){e.getJSON(TUMBLR_PROXY_URL+"access_token",a,function(e){e.access_token!==undefined&&e.access_token_secret!==undefined?(localStorage.tumblrOauthParams=JSON.stringify(e),r=e,n.chain()):n.error(new Error(u))})}if(r!==undefined){n.chain();return}var o=localStorage.tumblrOauthParams;if(o!==undefined){r=JSON.parse(o),n.chain();return}t.showMessage("Please make sure the Tumblr authorization popup is not blocked by your browser.");var u="Failed to retrieve a token from Tumblr.";n.timeout=ASYNC_TASK_LONG_TIMEOUT;var a=undefined;n.chain(f)}),n.onError(function(){s!==undefined&&clearInterval(s),i!==undefined&&i.close()})}function u(e,n){var i=undefined;if(e){console.error(e);if(typeof e=="string")i=e;else{i="Could not publish on Tumblr.";if(e.code===401||e.code===403){r=undefined,localStorage.removeItem("tumblrOauthParams"),i="Access to Tumblr account is not authorized.",n.retry(new Error(i),1);return}e.code<=0&&(t.setOffline(),i="|stopPublish")}}n.error(new Error(i))}var r=undefined,i={};return i.upload=function(i,a,f,l,c,h,p){p=p||t.doNothing;var d=n.createTask();s(d),o(d),d.onRun(function(){var t=e.extend({blog_hostname:i,post_id:a,tags:f,format:l,title:c,content:h},r);e.ajax({url:TUMBLR_PROXY_URL+"post",data:t,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){a=e.id,d.chain()}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&a!==undefined&&(t="Post "+a+" not found on Tumblr.|removePublish"),u(t,d)})}),d.onSuccess(function(){p(undefined,a)}),d.onError(function(e){p(e)}),n.addTask(d)},i}),define("tumblr-provider",["jquery","core","tumblr-helper"],function(e,t,n){var r="tumblr",i={providerId:r,providerName:"Tumblr"};return i.publish=function(e,t,r,i){n.upload(e.blogHostname,e.postId,e.tags,e.format=="markdown"?"markdown":"html",t,r,function(t,n){if(t){i(t);return}e.postId=n,i()})},i.newPublishAttributes=function(n){var r={};return r.blogHostname=t.getInputValue(e("#input-publish-tumblr-hostname"),n,/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),r.postId=e("#input-publish-postid").val()||undefined,r.tags=e("#input-publish-tags").val()||undefined,n.isPropagationStopped()?undefined:r},i}),define("publisher",["jquery","core","sharing","blogger-provider","dropbox-provider","gist-provider","github-provider","gdrive-provider","tumblr-provider","underscore"],function(e,t,n){function o(t){return t.format===undefined&&(t.format=e("input:radio[name=radio-publish-format]:checked").prop("value")),t.format=="markdown"?e("#wmd-input").val():t.format=="html"?e("#wmd-preview").html():r.applyTemplate(t)}function f(e,n){if(u.length===0){e(n);return}var r=u.pop(),s=JSON.parse(localStorage[r]),l=o(s),c=i[s.provider];c.publish(s,a,l,function(i){if(i!==undefined){var s=i.toString();s.indexOf("|removePublish")!==-1&&(t.fileManager.removePublish(r),t.fileManager.updateFileTitles(),t.showMessage(c.providerName+" publish location has been removed."));if(s.indexOf("|stopPublish")!==-1){e(i);return}}f(e,n||i)})}function c(e,n){var r=undefined;do r="publish."+t.randomString();while(_.has(localStorage,r));localStorage[r]=JSON.stringify(n),localStorage[e+".publish"]+=r+";"}function p(n){var r=n.defaultPublishFormat||"markdown";h=n,e(".publish-provider-name").text(n.providerName),e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-"+n.providerId).show(),t.resetModalInputs(),e("input:radio[name=radio-publish-format][value="+r+"]").prop("checked",!0),e("#modal-publish").modal()}function d(e){var i=h,s=i.newPublishAttributes(e);if(s===undefined)return;var u=t.fileManager.getCurrentFileIndex(),a=localStorage[u+".title"],f=o(s);i.publish(s,a,f,function(e){e===undefined&&(s.provider=i.providerId,n.createLink(s,function(){c(u,s),r.notifyPublish(),t.fileManager.updateFileTitles(),t.showMessage('"'+a+'" is now published on '+i.providerName+".")}))})}var r={},i=_.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),s=!1;r.notifyPublish=function(){var e=t.fileManager.getCurrentFileIndex();localStorage[e+".publish"].length===1?s=!1:s=!0,r.updatePublishButton(),r.refreshManagePublish()},r.updatePublishButton=function(){l===!0||s===!1||t.isOffline?e(".action-force-publish").addClass("disabled"):e(".action-force-publish").removeClass("disabled")},t.addOfflineListener(r.updatePublishButton),r.applyTemplate=function(n){var r=t.fileManager.getCurrentFileIndex();try{return _.template(t.settings.template,{documentTitle:localStorage[r+".title"],documentMarkdown:e("#wmd-input").val(),documentHTML:e("#wmd-preview").html(),publishAttributes:n})}catch(i){throw t.showError(i),i}};var u=[],a=undefined,l=!1;r.publish=function(){if(l===!0||t.isOffline)return;l=!0,r.updatePublishButton();var e=t.fileManager.getCurrentFileIndex();a=localStorage[e+".title"],u=_.compact(localStorage[e+".publish"].split(";")),f(function(e){l=!1,r.updatePublishButton(),e===undefined&&t.showMessage('"'+a+'" successfully published.')})};var h=undefined,v=['
          ','','','',"
          "].join(""),m='';return r.refreshManagePublish=function(){var n=t.fileManager.getCurrentFileIndex(),r=_.compact(localStorage[n+".publish"].split(";"));e(".msg-no-publish, .msg-publish-list").addClass("hide");var s=e("#manage-publish-list").empty();r.length>0?e(".msg-publish-list").removeClass("hide"):e(".msg-no-publish").removeClass("hide"),_.each(r,function(n){var r=JSON.parse(localStorage[n]),o=JSON.stringify(r).replace(/{|}|"/g,""),u=e(_.template(v,{provider:i[r.provider],publishDesc:o}));u.append(e(m).click(function(){t.fileManager.removePublish(n),t.fileManager.updateFileTitles()})),s.append(u)})},r.getPublishAttributesFromFile=function(e){var t=_.compact(localStorage[e+".publish"].split(";")),n=[];return _.each(t,function(e){var t=JSON.parse(localStorage[e]);n.push(t)}),n},t.onReady(function(){var t=e("#publish-menu");_.each(i,function(n){t.append(e("
        • ").append(e(' '+n.providerName+"").click(function(){p(n)}))),e(".action-publish-"+n.providerId).click(function(){p(n)})}),e(".action-process-publish").click(d),e(".action-force-publish").click(function(){e(this).hasClass("disabled")||r.publish()})}),r}),define("text",["module"],function(e){var t,n,r,i,s=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],o=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,u=/]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!="undefined"&&location.href,f=a&&location.protocol&&location.protocol.replace(/\:/,""),l=a&&location.hostname,c=a&&(location.port||undefined),h=[],p=e.config&&e.config()||{};t={version:"2.0.6",strip:function(e){if(e){e=e.replace(o,"");var t=e.match(u);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=s[t];try{e=new ActiveXObject(n)}catch(r){}if(e){s=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,p.isBuild&&(h[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}p.isBuild=i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),h=p.useXhr||t.useXhr;!a||h(u,f,l,c)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(h.hasOwnProperty(n)){var s=t.jsEscape(h[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(p.env==="node"||!p.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node)n=require.nodeRequire("fs"),t.get=function(e,t){var r=n.readFileSync(e,"utf8");r.indexOf("")===0&&(r=r.substring(1)),t(r)};else if(p.env==="xhr"||!p.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);p.onXhr&&p.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r(o)):n(s.responseText),p.onXhrComplete&&p.onXhrComplete(s,e))},s.send(null)};else if(p.env==="rhino"||!p.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(p.env==="xpconnect"||!p.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),t.get=function(e,t){var n,s,o={},u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),s=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),s.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),s.readString(n.available(),o),s.close(),n.close(),t(o.value)}catch(a){throw new Error((u&&u.path||"")+": "+a)}};return t}),define("text!../WELCOME.md",[],function(){return'\r\nWelcome to StackEdit! {#welcome}\r\n=====================\r\n\r\n\r\nHello, I am your first Markdown document within **StackEdit**. Don\'t delete me, I can be helpful. I can be recovered anyway in the `Utils` tab of the `Settings` dialog.\r\n\r\n----------\r\n\r\n\r\nDocuments\r\n---------\r\n\r\n**StackEdit** stores your documents in the browser local storage, which means all your documents are automatically saved locally and are accessible offline.\r\n\r\n#### Create a document\r\n\r\nYou can create a new document by clicking the button in the navigation bar. This will switch from the current document to the new one.\r\n\r\n#### Switch to another document\r\n\r\nYou can list all your local documents and switch from one to an other by clicking the button in the navigation bar.\r\n\r\n#### Rename a document\r\n\r\nYou can rename the current document by clicking the document title in the navigation bar.\r\n\r\n#### Delete a document\r\n\r\nYou can delete the current document by clicking the button in the navigation bar.\r\n\r\n----------\r\n\r\n\r\nSynchronization\r\n---------------\r\n\r\n**StackEdit** can be combined with **Google Drive** or **Dropbox** to have your documents centralized in the *Cloud*. The synchronization mechanism will take care of uploading your modifications or downloading the latest version of your documents.\r\n\r\n#### Import a document\r\n\r\nYou can import a document from the *Cloud* by going to the `Google Drive` or the `Dropbox` sub-menu and by clicking `Import from...`. Once imported, your document will be automatically synchronized with the **Google Drive** / **Dropbox** file.\r\n\r\n#### Export a document\r\n\r\nYou can export any document by going to the `Google Drive` or the `Dropbox` sub-menu and by clicking `Export to...`. Even if your document is already synchronized with **Google Drive** or **Dropbox**, you can export it to a another location. **StackEdit** can synchronize one document with multiple locations.\r\n\r\n#### Synchronize a document\r\n\r\nOnce your document is linked to a **Google Drive** or a **Dropbox** file, **StackEdit** will periodically (every 3 minutes) synchronize it by downloading/uploading any modification. Any conflict will be detected, and a local copy of your document will be created as a backup if necessary. If you just have modified your document and you want to force the synchronization, click the button in the navigation bar.\r\n\r\n> **NOTE:** The button is disabled when:\r\n> \r\n> - you are offline,\r\n> - or the document is not synchronized with any location,\r\n> - or the document has not been modified since the last synchronization.\r\n\r\n#### Manage document synchronization\r\n\r\nSince one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking `Manage synchronization` in the menu. This will open a dialog box where you will be able to add or remove synchronization links that are associated to your document.\r\n\r\n> **NOTE:** If you delete the file on **Google Drive** or on **Dropbox**, the document will no longer be synchronized with that location.\r\n\r\n----------\r\n\r\n\r\nPublication\r\n-----------\r\n\r\nOnce you are happy with your document, you can publish it on different websites directly from **StackEdit**.\r\n\r\n#### Publish a document\r\n\r\nYou can publish your document by going to the `Publish on` sub-menu and by choosing a website. In the dialog box, you can choose the publication format:\r\n\r\n- Markdown, to publish the Markdown text on a website that can interpret it (**GitHub** for instance),\r\n- HTML, to publish the document converted into HTML (on a blog for instance),\r\n- Template, to have a full control of the output.\r\n\r\n> **NOTE:** The default template is a simple webpage which wraps your document in HTML format. You can customize it in the `Publish` tab of the `Settings` dialog.\r\n\r\n#### Update a publication\r\n\r\nAfter publishing, **StackEdit** will keep your document linked to that publish location so that you can update it easily. Once you have modified your document and you want to update your publication, click on the button in the navigation bar.\r\n\r\n> **NOTE:** The button is disabled when:\r\n> \r\n> - you are offline,\r\n> - or the document has not been published anywhere.\r\n\r\n#### Manage document publishing\r\n\r\nSince one document can be published on multiple locations, you can list and manage publish locations by clicking `Manage publishing` in the menu. This will open a dialog box where you will be able to add or remove publication links that are associated to your document.\r\n\r\n> **NOTE:** In some cases, if you remove the file from the website or the post from the blog, the document will no longer be published on that location.\r\n\r\n----------\r\n\r\n\r\nMarkdown Extra\r\n--------------\r\n\r\n**StackEdit** supports **Markdown Extra**, which extends **Markdown** syntax with some nice features.\r\n\r\n\r\n### Tables\r\n\r\n**Markdown Extra** has a special syntax for tables:\r\n\r\nItem | Value\r\n--------- | -----\r\nComputer | \\$1600\r\nPhone | \\$12\r\nPipe | \\$1\r\n\r\nYou can specify column alignment with one or two colons:\r\n\r\n| Item | Value | Qty |\r\n| :-------- | ------:| :--: |\r\n| Computer | \\$1600 | 5 |\r\n| Phone | \\$12 | 12 |\r\n| Pipe | \\$1 | 234 |\r\n\r\n\r\n### Definition Lists\r\n\r\n**Markdown Extra** has a special syntax for definition lists too:\r\n\r\nTerm 1\r\nTerm 2\r\n: Definition A\r\n: Definition B\r\n\r\nTerm 3\r\n\r\n: Definition C\r\n\r\n: Definition D\r\n\r\n > part of definition D\r\n\r\n\r\n### Fenced code blocks\r\n\r\n**GitHub**\'s fenced code blocks are also supported with **Prettify** syntax highlighting:\r\n\r\n```\r\n// Foo\r\nvar bar = 0;\r\n```\r\n\r\n\r\n### Special Attributes\r\n\r\nWith **Markdown Extra**, you can specify `class` and `id` attributes on headers and fenced code blocks just like this:\r\n\r\n##### Header example {#my-header}\r\n\r\n``` {#my-id .my-class}\r\nvar foo = bar;\r\n```\r\n\r\nThen you can create cross-references like this: [beginning of the document](#welcome).\r\n\r\n\r\n### MathJax\r\n \r\nYou can include **Latex** expressions to render mathematical formulas using **MathJax**, as on [math.stackexchange.com][1]:\r\n\r\nThe *Gamma function* satisfying $\\Gamma(n) = (n-1)!\\quad\\forall\r\nn\\in\\mathbb N$ is via through the Euler integral\r\n\r\n$$\r\n\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.\r\n$$\r\n\r\n\r\n> **NOTE:** You can find more information:\r\n>\r\n> - about **Markdown** syntax [here][2],\r\n> - about **Markdown Extra** extension [here][3],\r\n> - about **Prettify** syntax highlighting [here][4],\r\n> - about **Latex** mathematical expressions [here][5].\r\n\r\n----------\r\n\r\n\r\n [1]: http://math.stackexchange.com/\r\n [2]: http://daringfireball.net/projects/markdown/syntax "Markdown"\r\n [3]: http://michelf.ca/projects/php-markdown/extra/ "Markdown Extra"\r\n [4]: https://code.google.com/p/google-code-prettify/\r\n [5]: http://en.wikibooks.org/wiki/LaTeX/Mathematics'}),define("file-manager",["jquery","core","synchronizer","publisher","sharing","text!../WELCOME.md","underscore"],function(e,t,n,r,i,s){var o="file.tempIndex",u={},a=localStorage["file.current"];u.getCurrentFileIndex=function(){return a},u.isCurrentFileIndex=function(e){return e==a},u.setCurrentFileIndex=function(e){a=e,e===undefined?localStorage.removeItem("file.current"):e!=o&&(localStorage["file.current"]=e)};var f=[];return u.selectFile=function(i){localStorage["file.list"].length===1&&(i=u.createFile(WELCOME_DOCUMENT_TITLE,s)),i!==undefined&&u.setCurrentFileIndex(i),u.updateFileTitles(),n.refreshManageSync(),r.notifyPublish(),i==o?e(".action-edit-document").removeClass("hide"):e(".action-edit-document").addClass("hide"),i=u.getCurrentFileIndex(),e("#wmd-input").val(localStorage[i+".content"]),t.createEditor(function(){u.saveFile()})},u.createFile=function(e,n,r,i){n=n!==undefined?n:t.settings.defaultContent,r=r||[];if(!e){e=DEFAULT_FILE_TITLE;var s=2;while(_.some(f,function(t){return t.title==e}))e=DEFAULT_FILE_TITLE+s++}var u=o;if(!i)do u="file."+t.randomString();while(_.has(localStorage,u+".title"));localStorage[u+".content"]=n,localStorage[u+".title"]=e;var a=_.reduce(r,function(e,t){return e+t+";"},";");return localStorage[u+".sync"]=a,localStorage[u+".publish"]=";",i||(localStorage["file.list"]+=u+";"),u},u.deleteFile=function(e){e=e||u.getCurrentFileIndex(),u.isCurrentFileIndex(e)&&u.setCurrentFileIndex();var t=_.compact(localStorage[e+".sync"].split(";"));_.each(t,function(e){u.removeSync(e)}),localStorage.removeItem(e+".sync");var n=_.compact(localStorage[e+".publish"].split(";"));_.each(n,function(e){u.removePublish(e)}),localStorage.removeItem(e+".publish"),localStorage["file.list"]=localStorage["file.list"].replace(";"+e+";",";"),localStorage.removeItem(e+".title"),localStorage.removeItem(e+".content")},u.saveFile=function(){var t=e("#wmd-input").val(),r=u.getCurrentFileIndex();localStorage[r+".content"]=t,n.notifyChange(r)},u.updateFileTitles=function(){function o(e,t){var s=[],o=n.getSyncAttributesFromFile(e),u=r.getPublishAttributesFromFile(e),a=o.concat(u);return t===!0&&i.refreshDocumentSharing(a),_.chain(a).sortBy(function(e){return e.provider}).each(function(e){s.push('')}),s.push(" "),s.push(localStorage[e+".title"]),s.join("")}e("#file-selector").empty(),f=_.chain(localStorage["file.list"].split(";")).compact().reduce(function(e,t){var n=localStorage[t+".title"];return e.push({index:t,title:n}),e},[]).sortBy(function(e){return e.title.toLowerCase()}).value();var s=u.getCurrentFileIndex();s===undefined&&(s=f[0].index,u.setCurrentFileIndex(s)),n.resetSyncFlags();var a=localStorage[s+".title"];document.title="StackEdit - "+a,e("#file-title").html(o(s,!0)),e(".file-title").text(a),e("#file-title-input").val(a),e("#file-selector").empty(),_.each(f,function(t){var n=e("").html(o(t.index)),r=e("
        • ").append(n);t.index==s?r.addClass("disabled"):n.prop("href","#").click(function(e){return function(){u.selectFile(e)}}(t.index)),e("#file-selector").append(r)}),t.layoutRefresh()},u.removeSync=function(e){var t=u.getFileIndexFromSync(e);t!==undefined&&(localStorage[t+".sync"]=localStorage[t+".sync"].replace(";"+e+";",";"),u.isCurrentFileIndex(t)&&n.refreshManageSync()),localStorage.removeItem(e)},u.getFileIndexFromSync=function(e){return _.chain(localStorage["file.list"].split(";")).compact().find(function(t){var n=localStorage[t+".sync"];return n.indexOf(";"+e+";")!==-1}).value()},u.removePublish=function(e){var t=u.getFileIndexFromPublish(e);t!==undefined&&(localStorage[t+".publish"]=localStorage[t+".publish"].replace(";"+e+";",";"),u.isCurrentFileIndex(t)&&r.notifyPublish()),localStorage.removeItem(e)},u.getFileIndexFromPublish=function(e){return _.chain(localStorage["file.list"].split(";")).compact().find(function(t){var n=localStorage[t+".publish"];return n.indexOf(";"+e+";")!==-1}).value()},t.onReady(function(){function n(n){var r=e.trim(n.val()),i=u.getCurrentFileIndex()+".title";r&&r!=localStorage[i]&&(localStorage[i]=r,u.updateFileTitles(),u.saveFile()),n.hide().val(localStorage[i]),e("#file-title").show(),t.layoutRefresh()}u.selectFile(),e(".action-create-file").click(function(){var t=u.createFile();u.selectFile(t),e("#file-title").click()}),e(".action-remove-file").click(function(){u.deleteFile(),u.selectFile()}),e("#file-title").click(function(){if(viewerMode===!0)return;e(this).hide(),e("#file-title-input").show().focus().get(0).select()}),e("#file-title-input").blur(function(){n(e(this))}).keyup(function(t){t.keyCode==13&&n(e(this)),t.keyCode==27&&(e(this).val(""),n(e(this)))}),e(".action-open-stackedit").click(function(){window.location.href="."}),e(".action-edit-document").click(function(){var t=e("#wmd-input").val(),n=localStorage[u.getCurrentFileIndex()+".title"],r=u.createFile(n,t);u.selectFile(r),window.location.href="."}),e(".action-download-md").click(function(){var n=e("#wmd-input").val(),r=localStorage[u.getCurrentFileIndex()+".title"];t.saveFile(n,r+".md")}),e(".action-download-html").click(function(){var n=e("#wmd-preview").html(),r=localStorage[u.getCurrentFileIndex()+".title"];t.saveFile(n,r+".html")}),e(".action-download-template").click(function(){var e=r.applyTemplate(),n=localStorage[u.getCurrentFileIndex()+".title"];t.saveFile(e,n+".txt")}),e(".action-welcome-file").click(function(){var e=u.createFile(WELCOME_DOCUMENT_TITLE,s);u.selectFile(e)})}),t.setFileManager(u),u}),requirejs.config({waitSeconds:0,paths:{MathJax:"../lib/MathJax/MathJax.js?config=TeX-AMS_HTML"},shim:{"jquery-ui":["jquery"],bootstrap:["jquery"],jgrowl:["jquery"],layout:["jquery-ui"],"Markdown.Extra":["Markdown.Converter","prettify"],"Markdown.Editor":["Markdown.Extra"]}}),require(["jquery","file-manager","synchronizer","publisher"],function(e){e(function(){window.applicationCache&&window.applicationCache.addEventListener("updateready",function(e){window.applicationCache.status===window.applicationCache.UPDATEREADY&&(window.applicationCache.swapCache(),window.location.reload())},!1)})}),define("main",function(){});