/*! * jQuery JavaScript Library v1.7.2 * http://jquery.com/ * * Copyright 2011, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * * Date: Wed Mar 21 12:46:34 2012 -0700 */ /*! * Sizzle CSS Selector Engine * Copyright 2011, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ // Underscore.js 1.3.3 // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. // Underscore is freely distributable under the MIT license. // Portions of Underscore are inspired or borrowed from Prototype, // Oliver Steele's Functional, and John Resig's Micro-Templating. // For all details and documentation: // http://documentcloud.github.com/underscore // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. // Backbone may be freely distributed under the MIT license. // For all details and documentation: // http://backbonejs.org /** * @license RequireJS text 2.0.3 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 */ /*! * jQuery blockUI plugin * Version 2.39 (23-MAY-2011) * @requires jQuery v1.2.3 or later * * Examples at: http://malsup.com/jquery/block/ * Copyright (c) 2007-2010 M. Alsup * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Thanks to Amir-Hossein Sobhi for some excellent contributions! */ /*! * jQuery Cookie Plugin * https://github.com/carhartl/jquery-cookie * * Copyright 2011, Klaus Hartl * Dual licensed under the MIT or GPL Version 2 licenses. * http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/GPL-2.0 */ /* ============================================================= * bootstrap-collapse.js v2.0.4 * 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-tab.js v2.0.4 * 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-dropdown.js v2.0.4 * 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.0.4 * 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.0.4 * 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.0.4 * 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. * =========================================================== */ /* * Date Format 1.2.3 * (c) 2007-2009 Steven Levithan * MIT license * * Includes enhancements by Scott Trenda * and Kris Kowal * * Accepts a date, a mask, or a date and a mask. * Returns a formatted version of the given date. * The date defaults to the current date/time. * The mask defaults to dateFormat.masks.default. */ /* * DDL Builder * Copyright Jake Feasel, 2012 * Released under MIT license * For questions email admin at sqlfiddle dot com * http://github.com/jakefeasel/DDLBuilder */ function ControlVersion(){var e,t,n;try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),e="WIN 6,0,21,0",t.AllowScriptAccess="always",e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e=t.GetVariable("$version")}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"),e="WIN 3,0,18,0"}catch(n){}if(!e)try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),e="WIN 2,0,0,11"}catch(n){e=-1}return e}function GetSwfVer(){var e=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var t=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"",n=navigator.plugins["Shockwave Flash"+t].description,r=n.split(" "),i=r[2].split("."),s=i[0],o=i[1];r[3]!=""?tempArrayMinor=r[3].split("r"):tempArrayMinor=r[4].split("r");var u=tempArrayMinor[1]>0?tempArrayMinor[1]:0,e=s+"."+o+"."+u}}else navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1?e=4:navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1?e=3:navigator.userAgent.toLowerCase().indexOf("webtv")!=-1?e=2:isIE&&isWin&&!isOpera&&(e=ControlVersion());return e}function DetectFlashVer(e,t,n){versionStr=GetSwfVer();if(versionStr==-1)return!1;if(versionStr!=0){isIE&&isWin&&!isOpera?(tempArray=versionStr.split(" "),tempString=tempArray[1],versionArray=tempString.split(",")):versionArray=versionStr.split(".");var r=versionArray[0],i=versionArray[1],s=versionArray[2];if(r>parseFloat(e))return!0;if(r==parseFloat(e)){if(i>parseFloat(t))return!0;if(i==parseFloat(t)&&s>=parseFloat(n))return!0}return!1}}function AC_AddExtension(e,t){return e.indexOf("?")!=-1?e.replace(/\?/,t+"?"):e+t}function AC_Generateobj(e,t,n){var r="";if(isIE&&isWin&&!isOpera){r+=" ';r+=">"}else{r+="1&&(t=new String(e.location.search),t=t.substring(1,t.length)),t}function parseVersion(e){if(typeof e!="string")return[0,0,0,0,0];var t=e.split("."),n=t[0]=="X"?999:parseInt(t[0])||0,r=t[1]=="X"?999:parseInt(t[1])||0,i=t[2]=="X"?999:parseInt(t[2])||0,s=t[3]=="X"?999:parseInt(t[3])||0,o=t[4]=="X"?999:parseInt(t[4])||0;return new Array(n,r,i,s,o)}function compareVersions(e,t){var n=parseVersion(e),r=parseVersion(t);for(var i=0;i<5;i++){if(n[i]r[i])return-1}return 0}function findViewerFile(e,t){var n=viewerMap[e];if(n==null)return!1;var r=n.length;for(var i=0;i=0===n})}function V(e){var t=$.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function at(e,t){return s.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e,t){if(t.nodeType!==1||!s.hasData(e))return;var n,r,i,o=s._data(e),u=s._data(t,o),a=o.events;if(a){delete u.handle,u.events={};for(n in a)for(r=0,i=a[n].length;r0){if(n!=="border")for(;i").appendTo(t),i=r.css("display");r.remove();if(i==="none"||i===""){cn||(cn=n.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),t.appendChild(cn);if(!hn||!cn.createElement)hn=(cn.contentWindow||cn.contentDocument).document,hn.write((s.support.boxModel?"":"")+""),hn.close();r=hn.createElement(e),hn.body.appendChild(r),i=s.css(r,"display"),t.removeChild(cn)}ln[e]=i}return ln[e]}function Nn(e){return s.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=e.document,r=e.navigator,i=e.location,s=function(){function H(){if(i.isReady)return;try{n.documentElement.doScroll("left")}catch(e){setTimeout(H,1);return}i.ready()}var i=function(e,t){return new i.fn.init(e,t,u)},s=e.jQuery,o=e.$,u,a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,f=/\S/,l=/^\s+/,c=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,d=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,v=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/(webkit)[ \/]([\w.]+)/,y=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,E=/-([a-z]|[0-9])/ig,S=/^-ms-/,x=function(e,t){return(t+"").toUpperCase()},T=r.userAgent,N,C,k,L=Object.prototype.toString,A=Object.prototype.hasOwnProperty,O=Array.prototype.push,M=Array.prototype.slice,_=String.prototype.trim,D=Array.prototype.indexOf,P={};return i.fn=i.prototype={constructor:i,init:function(e,r,s){var o,u,f,l;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(e==="body"&&!r&&n.body)return this.context=n,this[0]=n.body,this.selector=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?o=[null,e,null]:o=a.exec(e);if(o&&(o[1]||!r)){if(o[1])return r=r instanceof i?r[0]:r,l=r?r.ownerDocument||r:n,f=h.exec(e),f?i.isPlainObject(r)?(e=[n.createElement(f[1])],i.fn.attr.call(e,r,!0)):e=[l.createElement(f[1])]:(f=i.buildFragment([o[1]],[l]),e=(f.cacheable?i.clone(f.fragment):f.fragment).childNodes),i.merge(this,e);u=n.getElementById(o[2]);if(u&&u.parentNode){if(u.id!==o[2])return s.find(e);this.length=1,this[0]=u}return this.context=n,this.selector=e,this}return!r||r.jquery?(r||s).find(e):this.constructor(r).find(e)}return i.isFunction(e)?s.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),i.makeArray(e,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return M.call(this,0)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=this.constructor();return i.isArray(e)?O.apply(r,e):i.merge(r,e),r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return i.each(this,e,t)},ready:function(e){return i.bindReady(),C.add(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(M.apply(this,arguments),"slice",M.call(arguments).join(","))},map:function(e){return this.pushStack(i.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:O,sort:[].sort,splice:[].splice},i.fn.init.prototype=i.fn,i.extend=i.fn.extend=function(){var e,n,r,s,o,u,a=arguments[0]||{},f=1,l=arguments.length,c=!1;typeof a=="boolean"&&(c=a,a=arguments[1]||{},f=2),typeof a!="object"&&!i.isFunction(a)&&(a={}),l===f&&(a=this,--f);for(;f0)return;C.fireWith(n,[i]),i.fn.trigger&&i(n).trigger("ready").off("ready")}},bindReady:function(){if(C)return;C=i.Callbacks("once memory");if(n.readyState==="complete")return setTimeout(i.ready,1);if(n.addEventListener)n.addEventListener("DOMContentLoaded",k,!1),e.addEventListener("load",i.ready,!1);else if(n.attachEvent){n.attachEvent("onreadystatechange",k),e.attachEvent("onload",i.ready);var t=!1;try{t=e.frameElement==null}catch(r){}n.documentElement.doScroll&&t&&H()}},isFunction:function(e){return i.type(e)==="function"},isArray:Array.isArray||function(e){return i.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):P[L.call(e)]||"object"},isPlainObject:function(e){if(!e||i.type(e)!=="object"||e.nodeType||i.isWindow(e))return!1;try{if(e.constructor&&!A.call(e,"constructor")&&!A.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||A.call(e,r)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){if(typeof t!="string"||!t)return null;t=i.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(p.test(t.replace(d,"@").replace(v,"]").replace(m,"")))return(new Function("return "+t))();i.error("Invalid JSON: "+t)},parseXML:function(n){if(typeof n!="string"||!n)return null;var r,s;try{e.DOMParser?(s=new DOMParser,r=s.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&f.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(S,"ms-").replace(E,x)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var s,o=0,u=e.length,a=u===t||i.isFunction(e);if(r){if(a){for(s in e)if(n.apply(e[s],r)===!1)break}else for(;o0&&e[0]&&e[f-1]||f===0||i.isArray(e));if(l)for(;a1?a.call(arguments,0):n,--o||f.resolveWith(f,t)}}function h(e){return function(t){i[e]=arguments.length>1?a.call(arguments,0):t,f.notifyWith(l,i)}}var t=a.call(arguments,0),n=0,r=t.length,i=new Array(r),o=r,u=r,f=r<=1&&e&&s.isFunction(e.promise)?e:s.Deferred(),l=f.promise();if(r>1){for(;n
a",r=v.getElementsByTagName("*"),i=v.getElementsByTagName("a")[0];if(!r||!r.length||!i)return{};o=n.createElement("select"),u=o.appendChild(n.createElement("option")),a=v.getElementsByTagName("input")[0],t={leadingWhitespace:v.firstChild.nodeType===3,tbody:!v.getElementsByTagName("tbody").length,htmlSerialize:!!v.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:i.getAttribute("href")==="/a",opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:a.value==="on",optSelected:u.selected,getSetAttribute:v.className!=="t",enctype:!!n.createElement("form").enctype,html5Clone:n.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},s.boxModel=t.boxModel=n.compatMode==="CSS1Compat",a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!u.disabled;try{delete v.test}catch(g){t.deleteExpando=!1}!v.addEventListener&&v.attachEvent&&v.fireEvent&&(v.attachEvent("onclick",function(){t.noCloneEvent=!1}),v.cloneNode(!0).fireEvent("onclick")),a=n.createElement("input"),a.value="t",a.setAttribute("type","radio"),t.radioValue=a.value==="t",a.setAttribute("checked","checked"),a.setAttribute("name","t"),v.appendChild(a),f=n.createDocumentFragment(),f.appendChild(v.lastChild),t.checkClone=f.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,f.removeChild(a),f.appendChild(v);if(v.attachEvent)for(p in{submit:1,change:1,focusin:1})h="on"+p,d=h in v,d||(v.setAttribute(h,"return;"),d=typeof v[h]=="function"),t[p+"Bubbles"]=d;return f.removeChild(v),f=o=u=v=a=null,s(function(){var r,i,o,u,a,f,c,h,p,m,g,y,b,w=n.getElementsByTagName("body")[0];if(!w)return;h=1,b="padding:0;margin:0;border:",g="position:absolute;top:0;left:0;width:1px;height:1px;",y=b+"0;visibility:hidden;",p="style='"+g+b+"5px solid #000;",m="
"+""+"
",r=n.createElement("div"),r.style.cssText=y+"width:0;height:0;position:static;top:0;margin-top:"+h+"px",w.insertBefore(r,w.firstChild),v=n.createElement("div"),r.appendChild(v),v.innerHTML="
t
",l=v.getElementsByTagName("td"),d=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",t.reliableHiddenOffsets=d&&l[0].offsetHeight===0,e.getComputedStyle&&(v.innerHTML="",c=n.createElement("div"),c.style.width="0",c.style.marginRight="0",v.style.width="2px",v.appendChild(c),t.reliableMarginRight=(parseInt((e.getComputedStyle(c,null)||{marginRight:0}).marginRight,10)||0)===0),typeof v.style.zoom!="undefined"&&(v.innerHTML="",v.style.width=v.style.padding="1px",v.style.border=0,v.style.overflow="hidden",v.style.display="inline",v.style.zoom=1,t.inlineBlockNeedsLayout=v.offsetWidth===3,v.style.display="block",v.style.overflow="visible",v.innerHTML="
",t.shrinkWrapBlocks=v.offsetWidth!==3),v.style.cssText=g+y,v.innerHTML=m,i=v.firstChild,o=i.firstChild,a=i.nextSibling.firstChild.firstChild,f={doesNotAddBorder:o.offsetTop!==5,doesAddBorderForTableAndCells:a.offsetTop===5},o.style.position="fixed",o.style.top="20px",f.fixedPosition=o.offsetTop===20||o.offsetTop===15,o.style.position=o.style.top="",i.style.overflow="hidden",i.style.position="relative",f.subtractsBorderForOverflowNotVisible=o.offsetTop===-5,f.doesNotIncludeMarginInBodyOffset=w.offsetTop!==h,e.getComputedStyle&&(v.style.marginTop="1%",t.pixelMargin=(e.getComputedStyle(v,null)||{marginTop:0}).marginTop!=="1%"),typeof r.style.zoom!="undefined"&&(r.style.zoom=1),w.removeChild(r),c=v=r=null,s.extend(t,f)}),t}();var f=/^(?:\{.*\}|\[.*\])$/,l=/([A-Z])/g;s.extend({cache:{},uuid:0,expando:"jQuery"+(s.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?s.cache[e[s.expando]]:e[s.expando],!!e&&!h(e)},data:function(e,n,r,i){if(!s.acceptData(e))return;var o,u,a,f=s.expando,l=typeof n=="string",c=e.nodeType,h=c?s.cache:e,p=c?e[f]:e[f]&&f,d=n==="events";if((!p||!h[p]||!d&&!i&&!h[p].data)&&l&&r===t)return;p||(c?e[f]=p=++s.uuid:p=f),h[p]||(h[p]={},c||(h[p].toJSON=s.noop));if(typeof n=="object"||typeof n=="function")i?h[p]=s.extend(h[p],n):h[p].data=s.extend(h[p].data,n);return o=u=h[p],i||(u.data||(u.data={}),u=u.data),r!==t&&(u[s.camelCase(n)]=r),d&&!u[n]?o.events:(l?(a=u[n],a==null&&(a=u[s.camelCase(n)])):a=u,a)},removeData:function(e,t,n){if(!s.acceptData(e))return;var r,i,o,u=s.expando,a=e.nodeType,f=a?s.cache:e,l=a?e[u]:u;if(!f[l])return;if(t){r=n?f[l]:f[l].data;if(r){s.isArray(t)||(t in r?t=[t]:(t=s.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,o=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){s.removeData(this,e)})}}),s.extend({_mark:function(e,t){e&&(t=(t||"fx")+"mark",s._data(e,t,(s._data(e,t)||0)+1))},_unmark:function(e,t,n){e!==!0&&(n=t,t=e,e=!1);if(t){n=n||"fx";var r=n+"mark",i=e?0:(s._data(t,r)||1)-1;i?s._data(t,r,i):(s.removeData(t,r,!0),p(t,n,"mark"))}},queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=s._data(e,t),n&&(!r||s.isArray(n)?r=s._data(e,t,s.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=s.queue(e,t),r=n.shift(),i={};r==="inprogress"&&(r=n.shift()),r&&(t==="fx"&&n.unshift("inprogress"),s._data(e,t+".run",i),r.call(e,function(){s.dequeue(e,t)},i)),n.length||(s.removeData(e,t+"queue "+t+".run",!0),p(e,t,"queue"))}}),s.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(){s.removeAttr(this,e)})},prop:function(e,t){return s.access(this,s.prop,e,t,arguments.length>1)},removeProp:function(e){return e=s.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,u,a;if(s.isFunction(e))return this.each(function(t){s(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(v);for(n=0,r=this.length;n-1)return!0;return!1},val:function(e){var n,r,i,o=this[0];if(!arguments.length){if(o)return n=s.valHooks[o.type]||s.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,typeof r=="string"?r.replace(m,""):r==null?"":r);return}return i=s.isFunction(e),this.each(function(r){var o=s(this),u;if(this.nodeType!==1)return;i?u=e.call(this,r,o.val()):u=e,u==null?u="":typeof u=="number"?u+="":s.isArray(u)&&(u=s.map(u,function(e){return e==null?"":e+""})),n=s.valHooks[this.type]||s.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,u,"value")===t)this.value=u})}}),s.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,i,o=e.selectedIndex,u=[],a=e.options,f=e.type==="select-one";if(o<0)return null;n=f?o:0,r=f?o+1:a.length;for(;n=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,r,i){var o,u,a,f=e.nodeType;if(!e||f===3||f===8||f===2)return;if(i&&n in s.attrFn)return s(e)[n](r);if(typeof e.getAttribute=="undefined")return s.prop(e,n,r);a=f!==1||!s.isXMLDoc(e),a&&(n=n.toLowerCase(),u=s.attrHooks[n]||(w.test(n)?x:S));if(r!==t){if(r===null){s.removeAttr(e,n);return}return u&&"set"in u&&a&&(o=u.set(e,r,n))!==t?o:(e.setAttribute(n,""+r),r)}return u&&"get"in u&&a&&(o=u.get(e,n))!==null?o:(o=e.getAttribute(n),o===null?t:o)},removeAttr:function(e,t){var n,r,i,o,u,a=0;if(t&&e.nodeType===1){r=t.toLowerCase().split(v),o=r.length;for(;a=0}})});var N=/^(?:textarea|input|select)$/i,C=/^([^\.]*)?(?:\.(.+))?$/,k=/(?:^|\s)hover(\.\S+)?\b/,L=/^key/,A=/^(?:mouse|contextmenu)|click/,O=/^(?:focusinfocus|focusoutblur)$/,M=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,_=function(e){var t=M.exec(e);return t&&(t[1]=(t[1]||"").toLowerCase(),t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")),t},D=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()===t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},P=function(e){return s.event.special.hover?e:e.replace(k,"mouseenter$1 mouseleave$1")};s.event={add:function(e,n,r,i,o){var u,a,f,l,c,h,p,d,v,m,g,y;if(e.nodeType===3||e.nodeType===8||!n||!r||!(u=s._data(e)))return;r.handler&&(v=r,r=v.handler,o=v.selector),r.guid||(r.guid=s.guid++),f=u.events,f||(u.events=f={}),a=u.handle,a||(u.handle=a=function(e){return typeof s=="undefined"||!!e&&s.event.triggered===e.type?t:s.event.dispatch.apply(a.elem,arguments)},a.elem=e),n=s.trim(P(n)).split(" ");for(l=0;l=0&&(u=u.slice(0,-1),l=!0),u.indexOf(".")>=0&&(a=u.split("."),u=a.shift(),a.sort());if((!i||s.event.customEvent[u])&&!s.event.global[u])return;n=typeof n=="object"?n[s.expando]?n:new s.Event(u,n):new s.Event(u),n.type=u,n.isTrigger=!0,n.exclusive=l,n.namespace=a.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+a.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=u.indexOf(":")<0?"on"+u:"";if(!i){f=s.cache;for(c in f)f[c].events&&f[c].events[u]&&s.event.trigger(n,r,f[c].handle.elem,!0);return}n.result=t,n.target||(n.target=i),r=r!=null?s.makeArray(r):[],r.unshift(n),v=s.event.special[u]||{};if(v.trigger&&v.trigger.apply(i,r)===!1)return;g=[[i,v.bindType||u]];if(!o&&!v.noBubble&&!s.isWindow(i)){y=v.delegateType||u,h=O.test(y+u)?i:i.parentNode,p=null;for(;h;h=h.parentNode)g.push([h,y]),p=h;p&&p===i.ownerDocument&&g.push([p.defaultView||p.parentWindow||e,y])}for(c=0;ci&&f.push({elem:this,matches:r.slice(i)});for(l=0;l0?this.on(t,null,e,n):this.trigger(t)},s.attrFn&&(s.attrFn[t]=!0),L.test(t)&&(s.event.fixHooks[t]=s.event.keyHooks),A.test(t)&&(s.event.fixHooks[t]=s.event.mouseHooks)}),function(){function S(e,t,n,i,s,o){for(var u=0,a=i.length;u0){l=f;break}}f=f[e]}i[u]=l}}}var e=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),i=0,o=Object.prototype.toString,u=!1,a=!0,f=/\\/g,l=/\r\n/g,c=/\W/;[0,0].sort(function(){return a=!1,0});var h=function(t,r,i,s){i=i||[],r=r||n;var u=r;if(r.nodeType!==1&&r.nodeType!==9)return[];if(!t||typeof t!="string")return i;var a,f,l,c,p,m,g,b,w=!0,E=h.isXML(r),S=[],x=t;do{e.exec(""),a=e.exec(x);if(a){x=a[3],S.push(a[1]);if(a[2]){c=a[3];break}}}while(a);if(S.length>1&&v.exec(t))if(S.length===2&&d.relative[S[0]])f=T(S[0]+S[1],r,s);else{f=d.relative[S[0]]?[r]:h(S.shift(),r);while(S.length)t=S.shift(),d.relative[t]&&(t+=S.shift()),f=T(t,f,s)}else{!s&&S.length>1&&r.nodeType===9&&!E&&d.match.ID.test(S[0])&&!d.match.ID.test(S[S.length-1])&&(p=h.find(S.shift(),r,E),r=p.expr?h.filter(p.expr,p.set)[0]:p.set[0]);if(r){p=s?{expr:S.pop(),set:y(s)}:h.find(S.pop(),S.length!==1||S[0]!=="~"&&S[0]!=="+"||!r.parentNode?r:r.parentNode,E),f=p.expr?h.filter(p.expr,p.set):p.set,S.length>0?l=y(f):w=!1;while(S.length)m=S.pop(),g=m,d.relative[m]?g=S.pop():m="",g==null&&(g=r),d.relative[m](l,g,E)}else l=S=[]}l||(l=f),l||h.error(m||t);if(o.call(l)==="[object Array]")if(!w)i.push.apply(i,l);else if(r&&r.nodeType===1)for(b=0;l[b]!=null;b++)l[b]&&(l[b]===!0||l[b].nodeType===1&&h.contains(r,l[b]))&&i.push(f[b]);else for(b=0;l[b]!=null;b++)l[b]&&l[b].nodeType===1&&i.push(f[b]);else y(l,i);return c&&(h(c,u,i,s),h.uniqueSort(i)),i};h.uniqueSort=function(e){if(w){u=a,e.sort(w);if(u)for(var t=1;t0},h.find=function(e,t,n){var r,i,s,o,u,a;if(!e)return[];for(i=0,s=d.order.length;i":function(e,t){var n,r=typeof t=="string",i=0,s=e.length;if(r&&!c.test(t)){t=t.toLowerCase();for(;i=0)?n||r.push(u):n&&(t[o]=!1));return!1},ID:function(e){return e[1].replace(f,"")},TAG:function(e,t){return e[1].replace(f,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){e[2]||h.error(e[0]),e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0,e[3]=t[3]-0}else e[2]&&h.error(e[0]);return e[0]=i++,e},ATTR:function(e,t,n,r,i,s){var o=e[1]=e[1].replace(f,"");return!s&&d.attrMap[o]&&(e[1]=d.attrMap[o]),e[4]=(e[4]||e[5]||"").replace(f,""),e[2]==="~="&&(e[4]=" "+e[4]+" "),e},PSEUDO:function(t,n,r,i,s){if(t[1]==="not"){if(!((e.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var o=h.filter(t[3],n,r,!0^s);return r||i.push.apply(i,o),!1}t[3]=h(t[3],null,null,n)}else if(d.match.POS.test(t[0])||d.match.CHILD.test(t[0]))return!0;return t},POS:function(e){return e.unshift(!0),e}},filters:{enabled:function(e){return e.disabled===!1&&e.type!=="hidden"},disabled:function(e){return e.disabled===!0},checked:function(e){return e.checked===!0},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!h(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return e.nodeName.toLowerCase()==="input"&&"text"===n&&(t===n||t===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"submit"===e.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return(t==="input"||t==="button")&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&"button"===e.type||t==="button"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return t===0},last:function(e,t,n,r){return t===r.length-1},even:function(e,t){return t%2===0},odd:function(e,t){return t%2===1},lt:function(e,t,n){return tn[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,r){var i=t[1],s=d.filters[i];if(s)return s(e,n,t,r);if(i==="contains")return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if(i==="not"){var o=t[3];for(var u=0,a=o.length;u=0}},ID:function(e,t){return e.nodeType===1&&e.getAttribute("id")===t},TAG:function(e,t){return t==="*"&&e.nodeType===1||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],r=h.attr?h.attr(e,n):d.attrHandle[n]?d.attrHandle[n](e):e[n]!=null?e[n]:e.getAttribute(n),i=r+"",s=t[2],o=t[4];return r==null?s==="!=":!s&&h.attr?r!=null:s==="="?i===o:s==="*="?i.indexOf(o)>=0:s==="~="?(" "+i+" ").indexOf(o)>=0:o?s==="!="?i!==o:s==="^="?i.indexOf(o)===0:s==="$="?i.substr(i.length-o.length)===o:s==="|="?i===o||i.substr(0,o.length+1)===o+"-":!1:i&&r!==!1},POS:function(e,t,n,r){var i=t[2],s=d.setFilters[i];if(s)return s(e,n,t,r)}}},v=d.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var g in d.match)d.match[g]=new RegExp(d.match[g].source+/(?![^\[]*\])(?![^\(]*\))/.source),d.leftMatch[g]=new RegExp(/(^(?:.|\r|\n)*?)/.source+d.match[g].source.replace(/\\(\d+)/g,m));d.match.globalPOS=v;var y=function(e,t){return e=Array.prototype.slice.call(e,0),t?(t.push.apply(t,e),t):e};try{Array.prototype.slice.call(n.documentElement.childNodes,0)[0].nodeType}catch(b){y=function(e,t){var n=0,r=t||[];if(o.call(e)==="[object Array]")Array.prototype.push.apply(r,e);else if(typeof e.length=="number")for(var i=e.length;n",i.insertBefore(e,i.firstChild),n.getElementById(r)&&(d.find.ID=function(e,n,r){if(typeof n.getElementById!="undefined"&&!r){var i=n.getElementById(e[1]);return i?i.id===e[1]||typeof i.getAttributeNode!="undefined"&&i.getAttributeNode("id").nodeValue===e[1]?[i]:t:[]}},d.filter.ID=function(e,t){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return e.nodeType===1&&n&&n.nodeValue===t}),i.removeChild(e),i=e=null}(),function(){var e=n.createElement("div");e.appendChild(n.createComment("")),e.getElementsByTagName("*").length>0&&(d.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if(e[1]==="*"){var r=[];for(var i=0;n[i];i++)n[i].nodeType===1&&r.push(n[i]);n=r}return n}),e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!="undefined"&&e.firstChild.getAttribute("href")!=="#"&&(d.attrHandle.href=function(e){return e.getAttribute("href",2)}),e=null}(),n.querySelectorAll&&function(){var e=h,t=n.createElement("div"),r="__sizzle__";t.innerHTML="

";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0)return;h=function(t,i,s,o){i=i||n;if(!o&&!h.isXML(i)){var u=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(u&&(i.nodeType===1||i.nodeType===9)){if(u[1])return y(i.getElementsByTagName(t),s);if(u[2]&&d.find.CLASS&&i.getElementsByClassName)return y(i.getElementsByClassName(u[2]),s)}if(i.nodeType===9){if(t==="body"&&i.body)return y([i.body],s);if(u&&u[3]){var a=i.getElementById(u[3]);if(!a||!a.parentNode)return y([],s);if(a.id===u[3])return y([a],s)}try{return y(i.querySelectorAll(t),s)}catch(f){}}else if(i.nodeType===1&&i.nodeName.toLowerCase()!=="object"){var l=i,c=i.getAttribute("id"),p=c||r,v=i.parentNode,m=/^\s*[+~]/.test(t);c?p=p.replace(/'/g,"\\$&"):i.setAttribute("id",p),m&&v&&(i=i.parentNode);try{if(!m||v)return y(i.querySelectorAll("[id='"+p+"'] "+t),s)}catch(g){}finally{c||l.removeAttribute("id")}}}return e(t,i,s,o)};for(var i in e)h[i]=e[i];t=null}(),function(){var e=n.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var r=!t.call(n.createElement("div"),"div"),i=!1;try{t.call(n.documentElement,"[test!='']:sizzle")}catch(s){i=!0}h.matchesSelector=function(e,n){n=n.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!h.isXML(e))try{if(i||!d.match.PSEUDO.test(n)&&!/!=/.test(n)){var s=t.call(e,n);if(s||!r||e.document&&e.document.nodeType!==11)return s}}catch(o){}return h(n,null,null,[e]).length>0}}}(),function(){var e=n.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0)return;e.lastChild.className="e";if(e.getElementsByClassName("e").length===1)return;d.order.splice(1,0,"CLASS"),d.find.CLASS=function(e,t,n){if(typeof t.getElementsByClassName!="undefined"&&!n)return t.getElementsByClassName(e[1])},e=null}(),n.documentElement.contains?h.contains=function(e,t){return e!==t&&(e.contains?e.contains(t):!0)}:n.documentElement.compareDocumentPosition?h.contains=function(e,t){return!!(e.compareDocumentPosition(t)&16)}:h.contains=function(){return!1},h.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return t?t.nodeName!=="HTML":!1};var T=function(e,t,n){var r,i=[],s="",o=t.nodeType?[t]:t;while(r=d.match.PSEUDO.exec(e))s+=r[0],e=e.replace(d.match.PSEUDO,"");e=d.relative[e]?e+"*":e;for(var u=0,a=o.length;u0)for(u=o;u=0:s.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n=[],r,i,o=this[0];if(s.isArray(e)){var u=1;while(o&&o.ownerDocument&&o!==t){for(r=0;r-1:s.find.matchesSelector(o,e)){n.push(o);break}o=o.parentNode;if(!o||!o.ownerDocument||o===t||o.nodeType===11)break}}return n=n.length>1?s.unique(n):n,this.pushStack(n,"closest",e)},index:function(e){return e?typeof e=="string"?s.inArray(this[0],s(e)):s.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?s(e,t):s.makeArray(e&&e.nodeType?[e]:e),r=s.merge(this.get(),n);return this.pushStack(W(n[0])||W(r[0])?r:s.unique(r))},andSelf:function(){return this.add(this.prevObject)}}),s.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return s.dir(e,"parentNode")},parentsUntil:function(e,t,n){return s.dir(e,"parentNode",n)},next:function(e){return s.nth(e,2,"nextSibling")},prev:function(e){return s.nth(e,2,"previousSibling")},nextAll:function(e){return s.dir(e,"nextSibling")},prevAll:function(e){return s.dir(e,"previousSibling")},nextUntil:function(e,t,n){return s.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return s.dir(e,"previousSibling",n)},siblings:function(e){return s.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return s.sibling(e.firstChild)},contents:function(e){return s.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:s.makeArray(e.childNodes)}},function(e,t){s.fn[e]=function(n,r){var i=s.map(this,t,n);return j.test(e)||(r=n),r&&typeof r=="string"&&(i=s.filter(r,i)),i=this.length>1&&!z[e]?s.unique(i):i,(this.length>1||I.test(r))&&F.test(e)&&(i=i.reverse()),this.pushStack(i,e,R.call(arguments).join(","))}}),s.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?s.find.matchesSelector(t[0],e)?[t[0]]:[]:s.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&o.nodeType!==9&&(r===t||o.nodeType!==1||!s(o).is(r)))o.nodeType===1&&i.push(o),o=o[n];return i},nth:function(e,t,n,r){t=t||1;var i=0;for(;e;e=e[n])if(e.nodeType===1&&++i===t)break;return e},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var $="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",J=/ jQuery\d+="(?:\d+|null)"/g,K=/^\s+/,Q=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,G=/<([\w:]+)/,Y=/]","i"),rt=/checked\s*(?:[^=]|=\s*.checked.)/i,it=/\/(java|ecma)script/i,st=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},ut=V(n);ot.optgroup=ot.option,ot.tbody=ot.tfoot=ot.colgroup=ot.caption=ot.thead,ot.th=ot.td,s.support.htmlSerialize||(ot._default=[1,"div
","
"]),s.fn.extend({text:function(e){return s.access(this,function(e){return e===t?s.text(this):this.empty().append((this[0]&&this[0].ownerDocument||n).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(s.isFunction(e))return this.each(function(t){s(this).wrapAll(e.call(this,t))});if(this[0]){var t=s(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 s.isFunction(e)?this.each(function(t){s(this).wrapInner(e.call(this,t))}):this.each(function(){var t=s(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=s.isFunction(e);return this.each(function(n){s(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){s.nodeName(this,"body")||s(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){this.nodeType===1&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=s.clean(arguments);return e.push.apply(e,this.toArray()),this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);return e.push.apply(e,s.clean(arguments)),e}},remove:function(e,t){for(var n=0,r;(r=this[n])!=null;n++)if(!e||s.filter(e,[r]).length)!t&&r.nodeType===1&&(s.cleanData(r.getElementsByTagName("*")),s.cleanData([r])),r.parentNode&&r.parentNode.removeChild(r);return this},empty:function(){for(var e=0,t;(t=this[e])!=null;e++){t.nodeType===1&&s.cleanData(t.getElementsByTagName("*"));while(t.firstChild)t.removeChild(t.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return s.clone(this,e,t)})},html:function(e){return s.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(J,""):null;if(typeof e=="string"&&!et.test(e)&&(s.support.leadingWhitespace||!K.test(e))&&!ot[(G.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Q,"<$1>");try{for(;r1&&c0?this.clone(!0):this).get();s(i[u])[t](f),r=r.concat(f)}return this.pushStack(r,e,i.selector)}}),s.extend({clone:function(e,t,n){var r,i,o,u=s.support.html5Clone||s.isXMLDoc(e)||!nt.test("<"+e.nodeName+">")?e.cloneNode(!0):dt(e);if((!s.support.noCloneEvent||!s.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!s.isXMLDoc(e)){lt(e,u),r=ct(e),i=ct(u);for(o=0;r[o];++o)i[o]&<(r[o],i[o])}if(t){ft(e,u);if(n){r=ct(e),i=ct(u);for(o=0;r[o];++o)ft(r[o],i[o])}}return r=i=null,u},clean:function(e,t,r,i){var o,u,a,f=[];t=t||n,typeof t.createElement=="undefined"&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||n);for(var l=0,c;(c=e[l])!=null;l++){typeof c=="number"&&(c+="");if(!c)continue;if(typeof c=="string")if(!Z.test(c))c=t.createTextNode(c);else{c=c.replace(Q,"<$1>");var h=(G.exec(c)||["",""])[1].toLowerCase(),p=ot[h]||ot._default,d=p[0],v=t.createElement("div"),m=ut.childNodes,g;t===n?ut.appendChild(v):V(t).appendChild(v),v.innerHTML=p[1]+c+p[2];while(d--)v=v.lastChild;if(!s.support.tbody){var y=Y.test(c),b=h==="table"&&!y?v.firstChild&&v.firstChild.childNodes:p[1]===""&&!y?v.childNodes:[];for(a=b.length-1;a>=0;--a)s.nodeName(b[a],"tbody")&&!b[a].childNodes.length&&b[a].parentNode.removeChild(b[a])}!s.support.leadingWhitespace&&K.test(c)&&v.insertBefore(t.createTextNode(K.exec(c)[0]),v.firstChild),c=v.childNodes,v&&(v.parentNode.removeChild(v),m.length>0&&(g=m[m.length-1],g&&g.parentNode&&g.parentNode.removeChild(g)))}var w;if(!s.support.appendChecked)if(c[0]&&typeof (w=c.length)=="number")for(a=0;a1)},s.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Tt(e,"opacity");return n===""?"1":n}return e.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":s.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var o,u,a=s.camelCase(n),f=e.style,l=s.cssHooks[a];n=s.cssProps[a]||a;if(r===t)return l&&"get"in l&&(o=l.get(e,!1,i))!==t?o:f[n];u=typeof r,u==="string"&&(o=wt.exec(r))&&(r=+(o[1]+1)*+o[2]+parseFloat(s.css(e,n)),u="number");if(r==null||u==="number"&&isNaN(r))return;u==="number"&&!s.cssNumber[a]&&(r+="px");if(!l||!("set"in l)||(r=l.set(e,r))!==t)try{f[n]=r}catch(c){}},css:function(e,n,r){var i,o;n=s.camelCase(n),o=s.cssHooks[n],n=s.cssProps[n]||n,n==="cssFloat"&&(n="float");if(o&&"get"in o&&(i=o.get(e,!0,r))!==t)return i;if(Tt)return Tt(e,n)},swap:function(e,t,n){var r={},i,s;for(s in t)r[s]=e.style[s],e.style[s]=t[s];i=n.call(e);for(s in t)e.style[s]=r[s];return i}}),s.curCSS=s.css,n.defaultView&&n.defaultView.getComputedStyle&&(Nt=function(e,t){var n,r,i,o,u=e.style;return t=t.replace(gt,"-$1").toLowerCase(),(r=e.ownerDocument.defaultView)&&(i=r.getComputedStyle(e,null))&&(n=i.getPropertyValue(t),n===""&&!s.contains(e.ownerDocument.documentElement,e)&&(n=s.style(e,t))),!s.support.pixelMargin&&i&&Et.test(t)&&bt.test(n)&&(o=u.width,u.width=n,n=i.width,u.width=o),n}),n.documentElement.currentStyle&&(Ct=function(e,t){var n,r,i,s=e.currentStyle&&e.currentStyle[t],o=e.style;return s==null&&o&&(i=o[t])&&(s=i),bt.test(s)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left=t==="fontSize"?"1em":s,s=o.pixelLeft+"px",o.left=n,r&&(e.runtimeStyle.left=r)),s===""?"auto":s}),Tt=Nt||Ct,s.each(["height","width"],function(e,t){s.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth!==0?kt(e,t,r):s.swap(e,St,function(){return kt(e,t,r)})},set:function(e,t){return yt.test(t)?t+"px":t}}}),s.support.opacity||(s.cssHooks.opacity={get:function(e,t){return mt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=s.isNumeric(t)?"alpha(opacity="+t*100+")":"",o=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&s.trim(o.replace(vt,""))===""){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=vt.test(o)?o.replace(vt,i):o+" "+i}}),s(function(){s.support.reliableMarginRight||(s.cssHooks.marginRight={get:function(e,t){return s.swap(e,{display:"inline-block"},function(){return t?Tt(e,"margin-right"):e.style.marginRight})}})}),s.expr&&s.expr.filters&&(s.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return t===0&&n===0||!s.support.reliableHiddenOffsets&&(e.style&&e.style.display||s.css(e,"display"))==="none"},s.expr.filters.visible=function(e){return!s.expr.filters.hidden(e)}),s.each({margin:"",padding:"",border:"Width"},function(e,t){s.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+xt[r]+t]=i[r]||i[r-2]||i[0];return s}}});var Lt=/%20/g,At=/\[\]$/,Ot=/\r?\n/g,Mt=/#.*$/,_t=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Dt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Pt=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Ht=/^(?:GET|HEAD)$/,Bt=/^\/\//,jt=/\?/,Ft=/)<[^<]*)*<\/script>/gi,It=/^(?:select|textarea)/i,qt=/\s+/,Rt=/([?&])_=[^&]*/,Ut=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,zt=s.fn.load,Wt={},Xt={},Vt,$t,Jt=["*/"]+["*"];try{Vt=i.href}catch(Kt){Vt=n.createElement("a"),Vt.href="",Vt=Vt.href}$t=Ut.exec(Vt.toLowerCase())||[],s.fn.extend({load:function(e,n,r){if(typeof e!="string"&&zt)return zt.apply(this,arguments);if(!this.length)return this;var i=e.indexOf(" ");if(i>=0){var o=e.slice(i,e.length);e=e.slice(0,i)}var u="GET";n&&(s.isFunction(n)?(r=n,n=t):typeof n=="object"&&(n=s.param(n,s.ajaxSettings.traditional),u="POST"));var a=this;return s.ajax({url:e,type:u,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText,e.isResolved()&&(e.done(function(e){n=e}),a.html(o?s("
").append(n.replace(Ft,"")).find(o):n)),r&&a.each(r,[n,t,e])}}),this},serialize:function(){return s.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?s.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||It.test(this.nodeName)||Dt.test(this.type))}).map(function(e,t){var n=s(this).val();return n==null?null:s.isArray(n)?s.map(n,function(e,n){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}}),s.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){s.fn[t]=function(e){return this.on(t,e)}}),s.each(["get","post"],function(e,n){s[n]=function(e,r,i,o){return s.isFunction(r)&&(o=o||i,i=r,r=t),s.ajax({type:n,url:e,data:r,success:i,dataType:o})}}),s.extend({getScript:function(e,n){return s.get(e,t,n,"script")},getJSON:function(e,t,n){return s.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Yt(e,s.ajaxSettings):(t=e,e=s.ajaxSettings),Yt(e,t),e},ajaxSettings:{url:Vt,isLocal:Pt.test($t[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Jt},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":s.parseJSON,"text xml":s.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Qt(Wt),ajaxTransport:Qt(Xt),ajax:function(e,n){function S(e,n,c,h){if(y===2)return;y=2,m&&clearTimeout(m),v=t,p=h||"",E.readyState=e>0?4:0;var d,g,w,S=n,x=c?en(r,E,c):t,T,N;if(e>=200&&e<300||e===304){if(r.ifModified){if(T=E.getResponseHeader("Last-Modified"))s.lastModified[l]=T;if(N=E.getResponseHeader("Etag"))s.etag[l]=N}if(e===304)S="notmodified",d=!0;else try{g=tn(r,x),S="success",d=!0}catch(C){S="parsererror",w=C}}else{w=S;if(!S||e)S="error",e<0&&(e=0)}E.status=e,E.statusText=""+(n||S),d?u.resolveWith(i,[g,S,E]):u.rejectWith(i,[E,S,w]),E.statusCode(f),f=t,b&&o.trigger("ajax"+(d?"Success":"Error"),[E,r,d?g:w]),a.fireWith(i,[E,S]),b&&(o.trigger("ajaxComplete",[E,r]),--s.active||s.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r=s.ajaxSetup({},n),i=r.context||r,o=i!==r&&(i.nodeType||i instanceof s)?s(i):s.event,u=s.Deferred(),a=s.Callbacks("once memory"),f=r.statusCode||{},l,c={},h={},p,d,v,m,g,y=0,b,w,E={readyState:0,setRequestHeader:function(e,t){if(!y){var n=e.toLowerCase();e=h[n]=h[n]||e,c[e]=t}return this},getAllResponseHeaders:function(){return y===2?p:null},getResponseHeader:function(e){var n;if(y===2){if(!d){d={};while(n=_t.exec(p))d[n[1].toLowerCase()]=n[2]}n=d[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return y||(r.mimeType=e),this},abort:function(e){return e=e||"abort",v&&v.abort(e),S(0,e),this}};u.promise(E),E.success=E.done,E.error=E.fail,E.complete=a.add,E.statusCode=function(e){if(e){var t;if(y<2)for(t in e)f[t]=[f[t],e[t]];else t=e[E.status],E.then(t,t)}return this},r.url=((e||r.url)+"").replace(Mt,"").replace(Bt,$t[1]+"//"),r.dataTypes=s.trim(r.dataType||"*").toLowerCase().split(qt),r.crossDomain==null&&(g=Ut.exec(r.url.toLowerCase()),r.crossDomain=!(!g||g[1]==$t[1]&&g[2]==$t[2]&&(g[3]||(g[1]==="http:"?80:443))==($t[3]||($t[1]==="http:"?80:443)))),r.data&&r.processData&&typeof r.data!="string"&&(r.data=s.param(r.data,r.traditional)),Gt(Wt,r,n,E);if(y===2)return!1;b=r.global,r.type=r.type.toUpperCase(),r.hasContent=!Ht.test(r.type),b&&s.active++===0&&s.event.trigger("ajaxStart");if(!r.hasContent){r.data&&(r.url+=(jt.test(r.url)?"&":"?")+r.data,delete r.data),l=r.url;if(r.cache===!1){var x=s.now(),T=r.url.replace(Rt,"$1_="+x);r.url=T+(T===r.url?(jt.test(r.url)?"&":"?")+"_="+x:"")}}(r.data&&r.hasContent&&r.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",r.contentType),r.ifModified&&(l=l||r.url,s.lastModified[l]&&E.setRequestHeader("If-Modified-Since",s.lastModified[l]),s.etag[l]&&E.setRequestHeader("If-None-Match",s.etag[l])),E.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+Jt+"; q=0.01":""):r.accepts["*"]);for(w in r.headers)E.setRequestHeader(w,r.headers[w]);if(!r.beforeSend||r.beforeSend.call(i,E,r)!==!1&&y!==2){for(w in{success:1,error:1,complete:1})E[w](r[w]);v=Gt(Xt,r,n,E);if(!v)S(-1,"No Transport");else{E.readyState=1,b&&o.trigger("ajaxSend",[E,r]),r.async&&r.timeout>0&&(m=setTimeout(function(){E.abort("timeout")},r.timeout));try{y=1,v.send(c,S)}catch(N){if(!(y<2))throw N;S(-1,N)}}return E}return E.abort(),!1},param:function(e,n){var r=[],i=function(e,t){t=s.isFunction(t)?t():t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=s.ajaxSettings.traditional);if(s.isArray(e)||e.jquery&&!s.isPlainObject(e))s.each(e,function(){i(this.name,this.value)});else for(var o in e)Zt(o,e[o],n,i);return r.join("&").replace(Lt,"+")}}),s.extend({active:0,lastModified:{},etag:{}});var nn=s.now(),rn=/(\=)\?(&|$)|\?\?/i;s.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return s.expando+"_"+nn++}}),s.ajaxPrefilter("json jsonp",function(t,n,r){var i=typeof t.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(t.contentType);if(t.dataTypes[0]==="jsonp"||t.jsonp!==!1&&(rn.test(t.url)||i&&rn.test(t.data))){var o,u=t.jsonpCallback=s.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=e[u],f=t.url,l=t.data,c="$1"+u+"$2";return t.jsonp!==!1&&(f=f.replace(rn,c),t.url===f&&(i&&(l=l.replace(rn,c)),t.data===l&&(f+=(/\?/.test(f)?"&":"?")+t.jsonp+"="+u))),t.url=f,t.data=l,e[u]=function(e){o=[e]},r.always(function(){e[u]=a,o&&s.isFunction(a)&&e[u](o[0])}),t.converters["script json"]=function(){return o||s.error(u+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),s.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return s.globalEval(e),e}}}),s.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),s.ajaxTransport("script",function(e){if(e.crossDomain){var r,i=n.head||n.getElementsByTagName("head")[0]||n.documentElement;return{send:function(s,o){r=n.createElement("script"),r.async="async",e.scriptCharset&&(r.charset=e.scriptCharset),r.src=e.url,r.onload=r.onreadystatechange=function(e,n){if(n||!r.readyState||/loaded|complete/.test(r.readyState))r.onload=r.onreadystatechange=null,i&&r.parentNode&&i.removeChild(r),r=t,n||o(200,"success")},i.insertBefore(r,i.firstChild)},abort:function(){r&&r.onload(0,1)}}}});var sn=e.ActiveXObject?function(){for(var e in un)un[e](0,1)}:!1,on=0,un;s.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&an()||fn()}:an,function(e){s.extend(s.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(s.ajaxSettings.xhr()),s.support.ajax&&s.ajaxTransport(function(n){if(!n.crossDomain||s.support.cors){var r;return{send:function(i,o){var u=n.xhr(),a,f;n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async);if(n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(f in i)u.setRequestHeader(f,i[f])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var f,l,c,h,p;try{if(r&&(i||u.readyState===4)){r=t,a&&(u.onreadystatechange=s.noop,sn&&delete un[a]);if(i)u.readyState!==4&&u.abort();else{f=u.status,c=u.getAllResponseHeaders(),h={},p=u.responseXML,p&&p.documentElement&&(h.xml=p);try{h.text=u.responseText}catch(e){}try{l=u.statusText}catch(d){l=""}!f&&n.isLocal&&!n.crossDomain?f=h.text?200:404:f===1223&&(f=204)}}}catch(v){i||o(-1,v)}h&&o(f,l,h,c)},!n.async||u.readyState===4?r():(a=++on,sn&&(un||(un={},s(e).unload(sn)),un[a]=r),u.onreadystatechange=r)},abort:function(){r&&r(0,1)}}}});var ln={},cn,hn,pn=/^(?:toggle|show|hide)$/,dn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,vn,mn=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],gn;s.fn.extend({show:function(e,t,n){var r,i;if(e||e===0)return this.animate(wn("show",3),e,t,n);for(var o=0,u=this.length;o=a.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),a.animatedProperties[this.prop]=!0;for(t in a.animatedProperties)a.animatedProperties[t]!==!0&&(o=!1);if(o){a.overflow!=null&&!s.support.shrinkWrapBlocks&&s.each(["","X","Y"],function(e,t){u.style["overflow"+t]=a.overflow[e]}),a.hide&&s(u).hide();if(a.hide||a.show)for(t in a.animatedProperties)s.style(u,t,a.orig[t]),s.removeData(u,"fxshow"+t,!0),s.removeData(u,"toggle"+t,!0);r=a.complete,r&&(a.complete=!1,r.call(u))}return!1}return a.duration==Infinity?this.now=i:(n=i-this.startTime,this.state=n/a.duration,this.pos=s.easing[a.animatedProperties[this.prop]](this.state,n,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},s.extend(s.fx,{tick:function(){var e,t=s.timers,n=0;for(;n-1,l={},c={},h,p;f?(c=i.position(),h=c.top,p=c.left):(h=parseFloat(u)||0,p=parseFloat(a)||0),s.isFunction(t)&&(t=t.call(e,n,o)),t.top!=null&&(l.top=t.top-o.top+h),t.left!=null&&(l.left=t.left-o.left+p),"using"in t?t.using.call(e,l):i.css(l)}},s.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),r=Tn.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(s.css(e,"marginTop"))||0,n.left-=parseFloat(s.css(e,"marginLeft"))||0,r.top+=parseFloat(s.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(s.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||n.body;while(e&&!Tn.test(e.nodeName)&&s.css(e,"position")==="static")e=e.offsetParent;return e})}}),s.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);s.fn[e]=function(i){return s.access(this,function(e,i,o){var u=Nn(e);if(o===t)return u?n in u?u[n]:s.support.boxModel&&u.document.documentElement[i]||u.document.body[i]:e[i];u?u.scrollTo(r?s(u).scrollLeft():o,r?o:s(u).scrollTop()):e[i]=o},e,i,arguments.length,null)}}),s.each({Height:"height",Width:"width"},function(e,n){var r="client"+e,i="scroll"+e,o="offset"+e;s.fn["inner"+e]=function(){var e=this[0];return e?e.style?parseFloat(s.css(e,n,"padding")):this[n]():null},s.fn["outer"+e]=function(e){var t=this[0];return t?t.style?parseFloat(s.css(t,n,e?"margin":"border")):this[n]():null},s.fn[n]=function(e){return s.access(this,function(e,n,u){var a,f,l,c;if(s.isWindow(e))return a=e.document,f=a.documentElement[r],s.support.boxModel&&f||a.body&&a.body[r]||f;if(e.nodeType===9)return a=e.documentElement,a[r]>=a[i]?a[r]:Math.max(e.body[i],a[i],e.body[o],a[o]);if(u===t)return l=s.css(e,n),c=parseFloat(l),s.isNumeric(c)?c:l;s(e).css(n,u)},n,e,arguments.length,null)}}),e.jQuery=e.$=s,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return s})})(window),define("jQuery",function(e){return function(){return e.$}}(this)),function(){function L(e,t,n){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e._chain&&(e=e._wrapped),t._chain&&(t=t._wrapped);if(e.isEqual&&x.isFunction(e.isEqual))return e.isEqual(t);if(t.isEqual&&x.isFunction(t.isEqual))return t.isEqual(e);var r=f.call(e);if(r!=f.call(t))return!1;switch(r){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 i=n.length;while(i--)if(n[i]==e)return!0;n.push(e);var s=0,o=!0;if(r=="[object Array]"){s=e.length,o=s==t.length;if(o)while(s--)if(!(o=s in e==s in t&&L(e[s],t[s],n)))break}else{if("constructor"in e!="constructor"in t||e.constructor!=t.constructor)return!1;for(var u in e)if(x.has(e,u)){s++;if(!(o=x.has(t,u)&&L(e[u],t[u],n)))break}if(o){for(u in t)if(x.has(t,u)&&!(s--))break;o=!s}}return n.pop(),o}var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.unshift,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){return new F(e)};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.3.3";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("Reduce of empty array with no initial value");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=x.toArray(e).reverse();return r&&!i&&(t=x.bind(t,r)),i?x.reduce(s,t,n,r):x.reduce(s,t)},x.find=x.detect=function(e,t,n){var r;return N(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){var r=[];return e==null?r:(T(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r)},x.every=x.all=function(e,t,r){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 N=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.include=x.contains=function(e,t){var n=!1;return e==null?n:y&&e.indexOf===y?e.indexOf(t)!=-1:(n=N(e,function(e){return e===t}),n)},x.invoke=function(e,t){var n=u.call(arguments,2);return x.map(e,function(e){return(x.isFunction(t)?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},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};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};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or?1:0}),"value")},x.groupBy=function(e,t){var n={},r=x.isFunction(t)?t:function(e){return e[t]};return T(e,function(e,t){var i=r(e,t);(n[i]||(n[i]=[])).push(e)}),n},x.sortedIndex=function(e,t,n){n||(n=x.identity);var r=n(t),i=0,s=e.length;while(i>1;n(e[o])=0})})},x.difference=function(e){var t=C(u.call(arguments,1),!0,[]);return x.filter(e,function(e){return!x.include(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){return x.map(e,x.identity)},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){for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={};return T(C(u.call(arguments,1),!0,[]),function(n){n in e&&(t[n]=e[n])}),t},x.defaults=function(e){return T(u.call(arguments,1),function(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},x.isEqual=function(e,t){return L(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")}),x.isFinite=function(e){return x.isNumber(e)&&isFinite(e)},x.isNaN=function(e){return 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){for(var r=0;r":">",'"':""","'":"'","/":"/"},O=/[&<>"'\/]/g;x.escape=function(e){return(""+e).replace(O,function(e){return A[e]})},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){q(t,x[t]=e[t])})};var M=0;x.uniqueId=function(e){var t=M++;return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var _=/.^/,D={"\\":"\\","'":"'",r:"\r",n:"\n",t:" ",u2028:"\u2028",u2029:"\u2029"};for(var P in D)D[D[P]]=P;var H=/\\|'|\r|\n|\t|\u2028|\u2029/g,B=/\\(\\|'|r|n|t|u2028|u2029)/g,j=function(e){return e.replace(B,function(e,t){return D[t]})};x.template=function(e,t,n){n=x.defaults(n||{},x.templateSettings);var r="__p+='"+e.replace(H,function(e){return"\\"+D[e]}).replace(n.escape||_,function(e,t){return"'+\n((__t=("+j(t)+"))==null?'':_.escape(__t))+\n'"}).replace(n.interpolate||_,function(e,t){return"'+\n((__t=("+j(t)+"))==null?'':__t)+\n'"}).replace(n.evaluate||_,function(e,t){return"';\n"+j(t)+"\n__p+='"})+"';\n";n.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'')};\n"+r+"return __p;\n";var i=new Function(n.variable||"obj","_",r);if(t)return i(t,x);var s=function(e){return i.call(this,e,x)};return s.source="function("+(n.variable||"obj")+"){\n"+r+"}",s},x.chain=function(e){return x(e).chain()};var F=function(e){this._wrapped=e};x.prototype=F.prototype;var I=function(e,t){return t?x(e).chain():e},q=function(e,t){F.prototype[e]=function(){var e=u.call(arguments);return a.call(e,this._wrapped),I(t.apply(x,e),this._chain)}};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];F.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],I(n,this._chain)}}),T(["concat","join","slice"],function(e){var t=r[e];F.prototype[e]=function(){return I(t.apply(this._wrapped,arguments),this._chain)}}),F.prototype.chain=function(){return this._chain=!0,this},F.prototype.value=function(){return this._wrapped}}.call(this),define("Underscore",function(e){return function(){return e._}}(this)),define("dbTypes_cached",[],function(){return[{id:2,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"2/a2581/1",simple_name:"MySQL",notes:"Separate multiple statements in MySQL by terminating each one with a semicolon.",full_name:"MySQL 5.5.32"},{id:9,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"9/a2581/1",simple_name:"MySQL",notes:"",full_name:"MySQL 5.6.6 m9"},{id:8,className:"org.gjt.mm.mysql.Driver",context:"host",sample_fragment:"8/a2581/1",simple_name:"MySQL",notes:"",full_name:"MySQL 5.1.61"},{id:4,className:"oracle.jdbc.OracleDriver",context:"host",sample_fragment:"4/9bbe9/2",simple_name:"Oracle",notes:"Oracle does not support multiple statements in batch. Separate each statement with a line consisting of a single /, and do not terminate statements with semicolons.",full_name:"Oracle 11g R2"},{id:15,className:"org.postgresql.Driver",context:"host",sample_fragment:"15/c2f73/12",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 9.3.1"},{id:12,className:"org.postgresql.Driver",context:"host",sample_fragment:"12/6d80e/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 9.2.4"},{id:1,className:"org.postgresql.Driver",context:"host",sample_fragment:"1/6ccc5/2",simple_name:"PostgreSQL",notes:"Separate multiple statements in PostgreSQL by terminating each one with a semicolon.",full_name:"PostgreSQL 9.1.9"},{id:11,className:"org.postgresql.Driver",context:"host",sample_fragment:"11/6d80e/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 8.4.17"},{id:10,className:"org.postgresql.Driver",context:"host",sample_fragment:"10/f9585/1",simple_name:"PostgreSQL",notes:"",full_name:"PostgreSQL 8.3.20"},{id:7,className:"websql",context:"browser",sample_fragment:"7/04eca/1",simple_name:"SQLite",notes:"",full_name:"SQLite (WebSQL)"},{id:5,className:"sqljs",context:"browser",sample_fragment:"5/781d4/2",simple_name:"SQLite",notes:"",full_name:"SQLite (SQL.js)"},{id:6,className:"net.sourceforge.jtds.jdbc.Driver",context:"host",sample_fragment:"6/189a3/1",simple_name:"SQL Server",notes:"",full_name:"MS SQL Server 2012"},{id:3,className:"net.sourceforge.jtds.jdbc.Driver",context:"host",sample_fragment:"3/1fa93/1",simple_name:"SQL Server",notes:"SQL Server supports multiple statements in a batch separated by semicolons. Separate statement batches with a line consisting of a single GO command, as needed.",full_name:"MS SQL Server 2008"}]}),define("BrowserEngines/sqlite_driver",[],function(){var e=function(){return this};return e.prototype.getSchemaStructure=function(e){var t="select * from sqlite_master where type IN ('table', 'view') and name != '__WebKitDatabaseInfoTable__' order by type,name",n=function(t){var n={},r=[];for(var i in t[0].RESULTS.COLUMNS)n[t[0].RESULTS.COLUMNS[i]]=i;for(var s in t[0].RESULTS.DATA){var o=t[0].RESULTS.DATA[s][n.sql],u=t[0].RESULTS.DATA[s][n.name],a=t[0].RESULTS.DATA[s][n.type],f={table_name:u,table_type:a,columns:[]};if(a=="table"){var l=/^[\s\S]*?\(([\s\S]*)\)$/.exec(o)[1].split(/,\s*/);for(var c in l){var h=l[c].replace(/(^\s*)|(\s*$)/,"").split(/\s+/);f.columns.push({name:h.shift(),type:h.join(" ")})}}r.push(f)}e.callback(r)};this.executeQuery({sql:t,success:n})},e.prototype.splitStatement=function(e,t){t||(t=";");var n=t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),r=e?e.split(new RegExp(n+"s*\r?(\n|$)")):[];return r},e}),define("BrowserEngines/sqljs_driver",["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(n){var r=this;try{var i=function(){r.db=SQL.open(),e.each(t.prototype.splitStatement.call(this,n.ddl,n.statement_separator),function(e,t){r.db.exec(t)}),n.success()};window.SQL===undefined?e.getScript("javascripts_static/sql.js",function(e,t,n){i()}).fail(function(e,t,r){n.error("Your browser does not work with SQL.js. Try using a different browser (Chrome, Safari, Firefox, IE 10, etc...), or a newer version of your current one.")}):(r.db&&r.db.close(),i())}catch(s){n.error(s)}},n.prototype.executeQuery=function(n){var r=this;try{if(!r.db)throw"Database Schema not available!";var i=[];r.db.exec("BEGIN TRANSACTION"),e.each(t.prototype.splitStatement.call(this,n.sql,n.statement_separator),function(t,n){if(e.trim(n).length){var s=new Date,o=[];try{o=r.db.exec(n);var u={SUCCEEDED:!0,STATEMENT:n,EXECUTIONTIME:new Date-s,RESULTS:{COLUMNS:[],DATA:[]},EXECUTIONPLAN:{COLUMNS:[],DATA:[]}};o.length&&e.each(o,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.RESULTS.COLUMNS.push(n.column),r.push(n.value)}),u.RESULTS.DATA.push(r)});try{exectionPlanArray=r.db.exec("EXPLAIN QUERY PLAN "+n),exectionPlanArray.length&&e.each(exectionPlanArray,function(t,n){var r=[];e.each(n,function(e,n){t==0&&u.EXECUTIONPLAN.COLUMNS.push(n.column),r.push(n.value)}),u.EXECUTIONPLAN.DATA.push(r)})}catch(a){}i.push(u)}catch(a){var u={SUCCEEDED:!1,EXECUTIONTIME:new Date-s,ERRORMESSAGE:a};return i.push(u),!1}}}),r.db.exec("ROLLBACK TRANSACTION"),n.success(i)}catch(s){n.error(s)}},n}),define("BrowserEngines/websql_driver",["jQuery","BrowserEngines/sqlite_driver"],function(e,t){var n=function(){return this.db=null,this.ddl=[],this.nativeSQLite=window.openDatabase!==undefined,this};return e.extend(n.prototype,t.prototype),n.prototype.buildSchema=function(e){var t=this;try{t.nativeSQLite?(t.db=openDatabase(e.short_code,"1.0",e.short_code,e.ddl.length*1024),t.db.transaction(function(n){var r=t.splitStatement(e.ddl,e.statement_separator);t.ddl=r;var i=0,s=r[i],o=function(t,a){if(in.ddl.length-1&&r.push(a);if(cn.ddl.length-1&&r.push(a);if(c=0;a-=2)t&&u[a]!==t||n&&u[a+1]!==n||u.splice(a,2)}return this},trigger:function(e){var t,n,r,i,o,u,a,f;if(!(n=this._callbacks))return this;f=[],e=e.split(s);for(i=1,o=arguments.length;i').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?r.$(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?r.$(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t;var o=this.location,u=o.pathname==this.options.root&&!o.search;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!u)return this.fragment=this.getFragment(null,!0),this.location.replace(this.options.root+this.location.search+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&u&&o.hash&&(this.fragment=this.getHash().replace(v,""),this.history.replaceState({},document.title,o.protocol+"//"+o.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){r.$(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),d.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t==this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t==this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(e){var t=this.fragment=this.getFragment(e),n=i.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0});return n},navigate:function(e,t){if(!d.started)return!1;if(!t||t===!0)t={trigger:t};var n=(e||"").replace(v,"");if(this.fragment==n)return;this.fragment=n;var r=(n.indexOf(this.options.root)!=0?this.options.root:"")+n;if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,r);else{if(!this._wantsHashChange)return this.location.assign(r);this._updateHash(this.location,n,t.replace),this.iframe&&n!=this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,n,t.replace))}t.trigger&&this.loadUrl(e)},_updateHash:function(e,t,n){n?e.replace(e.href.replace(/(javascript:|#).*$/,"")+"#"+t):e.hash=t}});var y=r.View=function(e){this.cid=i.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},b=/^(\S+)\s*(.*)$/,w=["model","collection","el","id","attributes","className","tagName"];i.extend(y.prototype,o,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(e,t,n){var i=document.createElement(e);return t&&r.$(i).attr(t),n!=null&&r.$(i).html(n),i},setElement:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=e instanceof r.$?e:r.$(e),this.el=this.$el[0],t!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=N(this,"events")))return;this.undelegateEvents();for(var t in e){var n=e[t];i.isFunction(n)||(n=this[e[t]]);if(!n)throw new Error('Method "'+e[t]+'" does not exist');var r=t.match(b),s=r[1],o=r[2];n=i.bind(n,this),s+=".delegateEvents"+this.cid,o===""?this.$el.bind(s,n):this.$el.delegate(o,s,n)}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(e){this.options&&(e=i.extend({},this.options,e));for(var t=0,n=w.length;tt.get("last_used")?-1:1},insert:function(e){if(!$("#user_choices",this).length){var t=this.find(function(t){return t.get("fragment")==e.get("fragment")});t?(t.set("last_used",e.get("last_used")),this.sort()):this.add(e),this.trigger("change")}},initialize:function(){try{if(localStorage){var e=localStorage.getItem("fiddleHistory");e&&e.length&&this.add($.parseJSON(e))}}catch(t){}}});return n}),define("fiddle_backbone/models/DBType",["Backbone"],function(e){var t=e.Model.extend({defaults:{sample_fragment:"",notes:"",simple_name:"",full_name:"",selected:!1,context:"host",className:""}});return t}),define("fiddle_backbone/models/DBTypesList",["Backbone","fiddle_backbone/models/DBType"],function(e,t){var n=e.Collection.extend({model:t,getSelectedType:function(){var e=this.filter(function(e){return e.get("selected")});return e.length?e[0]:!1},setSelectedType:function(e,t){this.each(function(t){t.set({selected:t.id==e},{silent:!0})}),t||this.trigger("change")}});return n}),define("fiddle_backbone/models/SchemaDef",["Backbone"],function(e){var t=e.Model.extend({defaults:{ddl:"",short_code:"",simple_name:"",full_name:"",valid:!0,errorMessage:"",loading:!1,ready:!1,schema_structure:[],statement_separator:";",browserEngines:{}},reset:function(){this.set(this.defaults),this.trigger("reloaded")},build:function(){var e=this.get("dbType"),t=this;$.ajax({type:"POST",url:"index.cfm/fiddles/createSchema",data:{statement_separator:this.get("statement_separator"),db_type_id:this.get("dbType").id,schema_ddl:this.get("ddl")},dataType:"json",success:function(n,r,i){n.short_code?e.get("context")=="browser"?t.get("browserEngines")[e.get("className")].buildSchema({short_code:$.trim(n.short_code),statement_separator:t.get("statement_separator"),ddl:t.get("ddl"),success:function(){t.set({short_code:$.trim(n.short_code),ready:!0,valid:!0,errorMessage:""}),t.get("browserEngines")[e.get("className")].getSchemaStructure({callback:function(e){t.set({schema_structure:e}),t.trigger("built")}})},error:function(e){t.set({short_code:$.trim(n.short_code),ready:!1,valid:!1,errorMessage:e,schema_structure:[]}),t.trigger("failed")}}):(t.set({short_code:$.trim(n.short_code),ready:!0,valid:!0,errorMessage:"",schema_structure:n.schema_structure}),t.trigger("built")):(t.set({short_code:"",ready:!1,valid:!1,errorMessage:n.error,schema_structure:[]}),t.trigger("failed"))},error:function(e,n,r){t.set({short_code:"",ready:!1,valid:!1,errorMessage:r,schema_structure:[]}),t.trigger("failed")}})}});return t}),define("fiddle_backbone/models/Query",["jQuery","Backbone"],function(e,t){var n=t.Model.extend({defaults:{id:0,sql:"",sets:[],pendingChanges:!1,statement_separator:";"},reset:function(){this.set(this.defaults),this.trigger("reloaded")},execute:function(){var t=this;if(!this.has("schemaDef")||!this.get("schemaDef").has("dbType")||!this.get("schemaDef").get("ready"))return!1;e.ajax({type:"POST",url:"index.cfm/fiddles/runQuery",data:{db_type_id:this.get("schemaDef").get("dbType").id,schema_short_code:this.get("schemaDef").get("short_code"),statement_separator:this.get("statement_separator"),sql:this.get("sql")},dataType:"json",success:function(e,n,r){t.get("schemaDef").get("dbType").get("context")=="browser"?t.get("schemaDef").get("browserEngines")[t.get("schemaDef").get("dbType").get("className")].executeQuery({sql:t.get("sql"),statement_separator:t.get("statement_separator"),success:function(n){t.set({id:e.ID,sets:n}),t.trigger("executed")},error:function(e){t.set({sets:[{SUCCEEDED:!1,ERRORMESSAGE:e}]}),t.trigger("executed")}}):t.set({id:e.ID,sets:e.sets})},error:function(e,n,r){t.set({sets:[]})},complete:function(e,n){t.trigger("executed")}})}});return n});var Handlebars={};Handlebars.VERSION="1.0.beta.6",Handlebars.helpers={},Handlebars.partials={},Handlebars.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},Handlebars.registerPartial=function(e,t){this.partials[e]=t},Handlebars.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var toString=Object.prototype.toString,functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse||function(){},r=t.fn,i="",s=toString.call(e);s===functionType&&(e=e.call(this));if(e===!0)return r(this);if(e===!1||e==null)return n(this);if(s==="[object Array]"){if(e.length>0)for(var o=0,u=e.length;o0)for(var s=0,o=e.length;s2&&C.push("'"+this.terminals_[x]+"'");var k="";this.lexer.showPosition?k="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+this.terminals_[m]+"'":k="Parse error on line "+(a+1)+": Unexpected "+(m==1?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:p,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+m);switch(b[0]){case 1:r.push(m),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(b[1]),m=null,g?(m=g,g=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:T=this.productions_[b[1]][1],S.$=i[i.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},E=this.performAction.call(S,u,f,a,this.yy,b[1],i,s);if(typeof E!="undefined")return E;T&&(r=r.slice(0,-1*T*2),i=i.slice(0,-1*T),s=s.slice(0,-1*T)),r.push(this.productions_[b[1]][0]),i.push(S.$),s.push(S._$),N=o[r[r.length-2]][r[r.length-1]],r.push(N);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parseError)throw new Error(t);this.yy.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext="",this.match="");var i=this._currentRules();for(var s=0;s/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/],e.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:!1},emu:{rules:[2],inclusive:!1},INITIAL:{rules:[0,1,26],inclusive:!0}},e}();return e.lexer=t,e}();typeof require!="undefined"&&typeof exports!="undefined"&&(exports.parser=handlebars,exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)},exports.main=function(t){if(!t[1])throw new Error("Usage: "+t[0]+" FILE");if(typeof process!="undefined")var n=require("fs").readFileSync(require("path").join(process.cwd(),t[1]),"utf8");else var r=require("file").path(require("file").cwd()),n=r.join(t[1]).read({charset:"utf-8"});return exports.parser.parse(n)},typeof module!="undefined"&&require.main===module&&exports.main(typeof process!="undefined"?process.argv.slice(1):require("system").args)),Handlebars.Parser=handlebars,Handlebars.parse=function(e){return Handlebars.Parser.yy=Handlebars.AST,Handlebars.Parser.parse(e)},Handlebars.print=function(e){return(new Handlebars.PrintVisitor).accept(e)},Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){}},Handlebars.log=function(e,t){Handlebars.logger.log(e,t)},function(){Handlebars.AST={},Handlebars.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new Handlebars.AST.ProgramNode(t))},Handlebars.AST.MustacheNode=function(e,t,n){this.type="mustache",this.id=e[0],this.params=e.slice(1),this.hash=t,this.escaped=!n},Handlebars.AST.PartialNode=function(e,t){this.type="partial",this.id=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new Handlebars.Exception(e.original+" doesn't match "+t.original)};Handlebars.AST.BlockNode=function(t,n,r){e(t.id,r),this.type="block",this.mustache=t,this.program=n},Handlebars.AST.InverseNode=function(t,n,r){e(t.id,r),this.type="inverse",this.mustache=t,this.program=n},Handlebars.AST.ContentNode=function(e){this.type="content",this.string=e},Handlebars.AST.HashNode=function(e){this.type="hash",this.pairs=e},Handlebars.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r":">",'"':""","'":"'","`":"`"},t=/&(?!\w+;)|[<>"'`]/g,n=/[&<>"'`]/,r=function(t){return e[t]||"&"};Handlebars.Utils={escapeExpression:function(e){return e instanceof Handlebars.SafeString?e.toString():e==null||e===!1?"":n.test(e)?e.replace(t,r):e},isEmpty:function(e){return typeof e=="undefined"?!0:e===null?!0:e===!1?!0:Object.prototype.toString.call(e)==="[object Array]"&&e.length===0?!0:!1}}}(),Handlebars.Compiler=function(){},Handlebars.JavaScriptCompiler=function(){},function(e,t){e.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,assignToHash:15,pushStringParam:16},e.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:2,lookup:1,invokeMustache:3,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:3,invokePartial:1,push:1,assignToHash:1,pushStringParam:1},e.DISASSEMBLE_MAP={};for(var n in e.OPCODE_MAP){var r=e.OPCODE_MAP[n];e.DISASSEMBLE_MAP[r]=n}e.multiParamSize=function(t){return e.MULTI_PARAM_OPCODES[e.DISASSEMBLE_MAP[t]]},e.prototype={compiler:e,disassemble:function(){var t=this.opcodes,n,r,i=[],s,o,u;for(var a=0,f=t.length;athis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){return"stack"+this.stackSlot--},topStack:function(){return"stack"+this.stackSlot},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'}};var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=t.RESERVED_WORDS={};for(var o=0,u=i.length;o/im,s=/]*>\s*([\s\S]+)\s*<\/body>/im,o=typeof location!="undefined"&&location.href,u=o&&location.protocol&&location.protocol.replace(/\:/,""),a=o&&location.hostname,f=o&&(location.port||undefined),l=[],c=e.config&&e.config()||{};t={version:"2.0.3",strip:function(e){if(e){e=e.replace(i,"");var t=e.match(s);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:c.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=r[t];try{e=new ActiveXObject(n)}catch(i){}if(e){r=[n];break}}return e},parseName:function(e){var t=!1,n=e.indexOf("."),r=e.substring(0,n),i=e.substring(n+1,e.length);return n=i.indexOf("!"),n!==-1&&(t=i.substring(n+1,i.length),t=t==="strip",i=i.substring(0,n)),{moduleName:r,ext:i,strip:t}},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,c.isBuild&&(l[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}c.isBuild=i.isBuild;var s=t.parseName(e),l=s.moduleName+"."+s.ext,h=n.toUrl(l),p=c.useXhr||t.useXhr;!o||p(h,u,a,f)?t.get(h,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([l],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(l.hasOwnProperty(n)){var s=t.jsEscape(l[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.moduleName+"."+o.ext,a=r.toUrl(o.moduleName+"."+o.ext)+".js";t.load(u,r,function(n){var r=function(e){return i(a,e)};r.asModule=function(e,t){return i.asModule(e,a,t)},t.write(e,u,r,s)},s)}};if(c.env==="node"||!c.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(c.env==="xhr"||!c.env&&t.createXhr())t.get=function(e,n,r){var i=t.createXhr();i.open("GET",e,!0),c.onXhr&&c.onXhr(i,e),i.onreadystatechange=function(t){var s,o;i.readyState===4&&(s=i.status,s>399&&s<600?(o=new Error(e+" HTTP status: "+s),o.xhr=i,r(o)):n(i.responseText))},i.send(null)};else if(c.env==="rhino"||!c.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)};return t}),define("text!fiddle_backbone/templates/dbTypes.html",[],function(){return' \n {{selectedFullName}} \n \n '}),define("fiddle_backbone/views/DBTypesList",["jQuery","Backbone","Handlebars","text!fiddle_backbone/templates/dbTypes.html"],function(e,t,n,r){var i=t.View.extend({initialize:function(){this.compiledTemplate=n.compile(r)},events:{"click ul.dropdown-menu li":"clickDBType"},clickDBType:function(t){t.preventDefault(),this.collection.setSelectedType(e(t.currentTarget).attr("db_type_id"))},render:function(){var t=this.collection.getSelectedType();return e(this.el).html(this.compiledTemplate({dbTypes:this.collection.map(function(e){var t=e.toJSON();return t.className=t.selected?"active":"",t}),selectedFullName:t.get("full_name")})),e("#db_type_label_collapsed .navbar-text").text(t.get("full_name")),this}});return i}),window.CodeMirror=function(){function e(r,i){function cn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Y(e)}function dn(e){return e>=0&&e=n.to||t.liner-400&&vt(It.pos,n))i="triple",Q(e),setTimeout(tr,20),Tr(n.line);else if(Ft&&Ft.time>r-400&&vt(Ft.pos,n)){i="double",It={time:r,pos:n},Q(e);var o=xr(n);pr(o.from,o.to)}else Ft={time:r,pos:n};var a=n,f;if(s.dragDrop&&st&&!s.readOnly&&!vt(Bt.from,Bt.to)&&!mt(n,Bt.from)&&!mt(Bt.to,n)&&i=="single"){b&&(Et.draggable=!0);var l=nt(document,"mouseup",di(u),!0),c=nt(Et,"drop",di(u),!0);Rt=!0,Et.dragDrop&&Et.dragDrop();return}Q(e),i=="single"&&mr(n.line,n.ch,!0);var h=Bt.from,p=Bt.to,w=nt(document,"mousemove",di(function(e){clearTimeout(f),Q(e),!v&&!et(e)?y(e):g(e)}),!0),l=nt(document,"mouseup",di(y),!0)}function Tn(e){for(var t=Z(e);t!=Lt;t=t.parentNode)if(t.parentNode==ot)return Q(e);Q(e)}function Nn(e){if(s.onDragEvent&&s.onDragEvent(vn,K(e)))return;Q(e);var t=ti(e,!0),n=e.dataTransfer.files;if(!t||s.readOnly)return;if(n&&n.length&&window.FileReader&&window.File){var r=n.length,i=Array(r),o=0,u=function(e,n){var s=new FileReader;s.onload=function(){i[n]=s.result,++o==r&&(t=yr(t),di(function(){var e=Xn(i.join(""),t,t);pr(t,e)})())},s.readAsText(e)};for(var a=0;a-1&&setTimeout(di(function(){Cr(Bt.to.line,"smart")}),75);if(On(e,r))return;Gn()}function Pn(e){if(s.onKeyEvent&&s.onKeyEvent(vn,K(e)))return;tt(e,"keyCode")==16&&(jt=null)}function Hn(){if(s.readOnly=="nocursor")return;Ht||(s.onFocus&&s.onFocus(vn),Ht=!0,Et.className.search(/\bCodeMirror-focused\b/)==-1&&(Et.className+=" CodeMirror-focused")),Qn(),ii()}function Bn(){Ht&&(s.onBlur&&s.onBlur(vn),Ht=!1,nn&&di(function(){nn&&(nn(),nn=null)})(),Et.className=Et.className.replace(" CodeMirror-focused","")),clearInterval(Mt),setTimeout(function(){Ht||(jt=null)},150)}function jn(e,t,n,r,i){if(zt)return;var o=[];Dt.iter(e.line,t.line+1,function(e){o.push(B(e.text,e.markedSpans))});if(fn){fn.addChange(e.line,n.length,o);while(fn.done.length>s.undoDepth)fn.done.shift()}var u=D(H(o[0]),H(pt(o)),e.ch,t.ch,n);Rn(e,t,u,r,i)}function Fn(e,t){if(!e.length)return;var n=e.pop(),r=[];for(var i=n.length-1;i>=0;i-=1){var s=n[i],o=[],u=s.start+s.added;Dt.iter(s.start,u,function(e){o.push(B(e.text,e.markedSpans))}),r.push({start:s.start,added:s.old.length,old:o});var a={line:s.start+s.old.length-1,ch:St(P(pt(o)),P(pt(s.old)))};Rn({line:s.start,ch:0},{line:u-1,ch:mn(u-1).text.length},s.old,a,a)}Xt=!0,t.push(r)}function In(){Fn(fn.done,fn.undone)}function qn(){Fn(fn.undone,fn.done)}function Rn(e,t,n,r,i){function w(e){return e<=Math.min(t.line,t.line+g)?e:e+g}if(zt)return;var o=!1,u=rn.text.length;s.lineWrapping||Dt.iter(e.line,t.line+1,function(e){if(!e.hidden&&e.text.length==u)return o=!0,!0});if(e.line!=t.line||n.length>1)Qt=!0;var a=t.line-e.line,f=mn(e.line),l=mn(t.line),c=pt(n);if(e.ch==0&&t.ch==0&&P(c)==""){var h=[],p=null;for(var d=0,v=n.length-1;d1&&Dt.remove(e.line+1,a-1,Gt),Dt.insert(e.line+1,h)}if(s.lineWrapping){var m=Math.max(5,Et.clientWidth/Yr()-3);Dt.iter(e.line,e.line+n.length,function(e){if(e.hidden)return;var t=Math.ceil(e.text.length/m)||1;t!=e.height&&gn(e,t)})}else Dt.iter(e.line,e.line+n.length,function(e){var t=e.text;!e.hidden&&t.length>u&&(rn=e,u=t.length,on=!0,o=!1)}),o&&(sn=!0);Pt=Math.min(Pt,e.line),li(400);var g=n.length-a-1;$t.push({from:e.line,to:t.line+1,diff:g});if(s.onChange){for(var d=0;dEt.offsetHeight?e:!1}function zn(e){var t=Un();M.style.display=t?"block":"none",t?(L.style.height=ct.style.minHeight=t+"px",M.style.height=Et.clientHeight+"px",e!=null&&(M.scrollTop=Et.scrollTop=e,b&&setTimeout(function(){if(M.scrollTop!=e)return;M.scrollTop=e+(e?-1:1),M.scrollTop=e},0))):ct.style.minHeight="",at.style.top=Yt*Kr()+"px"}function Wn(){rn=mn(0),on=!0;var e=rn.text.length;Dt.iter(1,Dt.size,function(t){var n=t.text;!t.hidden&&n.length>e&&(e=n.length,rn=t)}),sn=!1}function Xn(e,t,n){function r(r){if(mt(r,t))return r;if(!mt(n,r))return i;var s=r.line+e.length-(n.line-t.line)-1,o=r.ch;return r.line==n.line&&(o+=pt(e).length-(n.ch-(n.line==t.line?t.ch:0))),{line:s,ch:o}}t=yr(t),n?n=yr(n):n=t,e=Nt(e);var i;return $n(e,t,n,function(e){return i=e,{from:r(Bt.from),to:r(Bt.to)}}),i}function Vn(e,t){$n(Nt(e),Bt.from,Bt.to,function(e){return t=="end"?{from:e,to:e}:t=="start"?{from:Bt.from,to:Bt.from}:{from:Bt.from,to:e}})}function $n(e,t,n,r){var i=e.length==1?e[0].length+t.ch:pt(e).length,s=r({line:t.line+e.length-1,ch:i});jn(t,n,e,s.from,s.to)}function Jn(e,t,n){var r=e.line,i=t.line;if(r==i)return mn(r).text.slice(e.ch,t.ch);var s=[mn(r).text.slice(e.ch)];return Dt.iter(r+1,i,function(e){s.push(e.text)}),s.push(mn(i).text.slice(0,t.ch)),s.join(n||"\n")}function Kn(e){return Jn(Bt.from,Bt.to,e)}function Qn(){if(un)return;At.set(s.pollInterval,function(){Zn(),Ht&&Qn()})}function Gn(){function t(){var n=Zn();!n&&!e?(e=!0,At.set(60,t)):(un=!1,Qn())}var e=!1;un=!0,At.set(20,t)}function Zn(){if(!Ht||Ct(S)||s.readOnly)return!1;var e=S.value;if(e==Yn)return!1;pi||ci(),jt=null;var t=0,n=Math.min(Yn.length,e.length);while(t1e3?S.value=Yn="":Yn=e,pi||hi(),Wt=!1,!0}function er(e){vt(Bt.from,Bt.to)?e&&(Yn=S.value=""):(Yn="",S.value=Kn(),Ht&&dt(S))}function tr(){s.readOnly!="nocursor"&&S.focus()}function nr(){var e=rr();ir(e.x,e.y,e.x,e.yBot);if(!Ht)return;var t=ct.getBoundingClientRect(),n=null;e.y+t.top<0?n=!0:e.y+t.top+Kr()>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1);if(n!=null){var r=F.style.display=="none";r&&(F.style.display="",F.style.left=e.x+"px",F.style.top=e.y-Yt+"px"),F.scrollIntoView(n),r&&(F.style.display="none")}}function rr(){var e=zr(Bt.inverted?Bt.from:Bt.to),t=s.lineWrapping?Math.min(e.x,G.offsetWidth):e.x;return{x:t,y:e.y,yBot:e.yBot}}function ir(e,t,n,r){var i=sr(e,t,n,r);i.scrollLeft!=null&&(Et.scrollLeft=i.scrollLeft),i.scrollTop!=null&&(M.scrollTop=Et.scrollTop=i.scrollTop)}function sr(e,t,n,r){var i=ei(),o=Zr();t+=o,r+=o,e+=i,n+=i;var u=Et.clientHeight,a=M.scrollTop,f={},l=Un()||Infinity,c=tl-10;ta+u&&(f.scrollTop=(h?l:r)-u);var p=Et.clientWidth,d=Et.scrollLeft,v=s.fixedGutter?ut.clientWidth:0,m=ep+d-3&&(f.scrollLeft=n+10-p),f}function or(e){var t=Kr(),n=(e!=null?e:M.scrollTop)-Zr(),r=Math.max(0,Math.floor(n/t)),i=Math.ceil((n+Et.clientHeight)/t);return{from:X(Dt,r),to:X(Dt,i)}}function ur(e,t,n){function d(){var e=_.firstChild,t=!1;return Dt.iter(Zt,en,function(n){if(!e)return;if(!n.hidden){var r=Math.round(e.offsetHeight/c)||1;n.height!=r&&(gn(n,r),Qt=t=!0)}e=e.nextSibling}),t}if(!Et.clientWidth){Zt=en=Yt=0;return}var r=or(n);if(e!==!0&&e.length==0&&r.from>Zt&&r.too&&en-o<20&&(o=Math.min(Dt.size,en));var u=e===!0?[]:ar([{from:Zt,to:en,domStart:0}],e),a=0;for(var f=0;fo&&(l.to=o),l.from>=l.to?u.splice(f--,1):a+=l.to-l.from}if(a==o-i&&i==Zt&&o==en){zn(n);return}u.sort(function(e,t){return e.domStart-t.domStart});var c=Kr(),h=ut.style.display;_.style.display="none",fr(i,o,u),_.style.display=ut.style.display="";var p=i!=Zt||o!=en||tn!=Et.clientHeight+c;p&&(tn=Et.clientHeight+c),(i!=Zt||o!=en&&s.onViewportChange)&&setTimeout(function(){s.onViewportChange&&s.onViewportChange(vn,i,o)}),Zt=i,en=o,Yt=V(Dt,i),li(100);if(_.childNodes.length!=en-Zt)throw new Error("BAD PATCH! "+JSON.stringify(u)+" size="+(en-Zt)+" nodes="+_.childNodes.length);return s.lineWrapping&&d(),ut.style.display=h,(p||Qt)&&lr()&&s.lineWrapping&&d()&&lr(),zn(n),cr(),!t&&s.onUpdate&&s.onUpdate(vn),!0}function ar(e,t){for(var n=0,r=t.length||0;n=f.to?s.push(f):(i.from>f.from&&s.push({from:f.from,to:i.from,domStart:f.domStart}),i.toi)s=r(s),i++;for(var f=0,l=a.to-a.from;ff){if(e.hidden)var t=yt("pre");else{var t=yn(e);e.className&&(t.className=e.className);if(e.bgClassName){var r=yt("pre"," ",e.bgClassName,"position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2");t=yt("div",[r,t],null,"position: relative")}}_.insertBefore(t,s)}else s=s.nextSibling;++f})}function lr(){if(!s.gutter&&!s.lineNumbers)return;var e=at.offsetHeight,t=Et.clientHeight;ut.style.height=(e-t<2?t:e)+"px";var n=document.createDocumentFragment(),r=Zt,i;Dt.iter(Zt,Math.max(en,Zt+1),function(e){if(e.hidden)n.appendChild(yt("pre"));else{var t=e.gutterMarker,o=s.lineNumbers?s.lineNumberFormatter(r+s.firstLineNumber):null;t&&t.text?o=t.text.replace("%N%",o!=null?o:""):o==null&&(o=" ");var u=n.appendChild(yt("pre",null,t&&t.style));u.innerHTML=o;for(var a=1;a2;return G.style.marginLeft=ut.offsetWidth+"px",Qt=!1,l}function cr(){var e=vt(Bt.from,Bt.to),t=zr(Bt.from,!0),n=e?t:zr(Bt.to,!0),r=Bt.inverted?t:n,i=Kr(),o=ft(Lt),u=ft(_);k.style.top=Math.max(0,Math.min(Et.offsetHeight,r.y+u.top-o.top))+"px",k.style.left=Math.max(0,Math.min(Et.offsetWidth,r.x+u.left-o.left))+"px";if(e)F.style.top=r.y+"px",F.style.left=(s.lineWrapping?Math.min(r.x,G.offsetWidth):r.x)+"px",F.style.display="",j.style.display="none";else{var a=t.y==n.y,f=document.createDocumentFragment(),l=G.clientWidth||G.offsetWidth,c=G.clientHeight||G.offsetHeight,h=function(e,t,n,r){var i=y?"width: "+(n?l-n-e:l)+"px":"right: "+n+"px";f.appendChild(yt("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; "+i+"; height: "+r+"px"))};if(Bt.from.ch&&t.y>=0){var p=a?l-n.x:0;h(t.x,t.y,p,i)}var d=Math.max(0,t.y+(Bt.from.ch?i:0)),v=Math.min(n.y,c)-d;v>.2*i&&h(0,d,0,v),(!a||!Bt.from.ch)&&n.yn||u>o.text.length)u=o.text.length;return{line:r,ch:u}}r+=t}}var i=mn(e.line),s=e.ch==i.text.length&&e.ch!=n;return i.hidden?e.line>=t?r(1)||r(-1):r(-1)||r(1):e}function mr(e,t,n){var r=yr({line:e,ch:t||0});(n?pr:dr)(r,r)}function gr(e){return Math.max(0,Math.min(e,Dt.size-1))}function yr(e){if(e.line<0)return{line:0,ch:0};if(e.line>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var t=e.ch,n=mn(e.line).text.length;return t==null||t>n?{line:e.line,ch:n}:t<0?{line:e.line,ch:0}:e}function br(e,t){function o(){for(var t=r+e,n=e<0?-1:Dt.size;t!=n;t+=e){var i=mn(t);if(!i.hidden)return r=t,s=i,!0}}function u(t){if(i==(e<0?0:s.text.length)){if(!!t||!o())return!1;i=e<0?s.text.length:0}else i+=e;return!0}var n=Bt.inverted?Bt.from:Bt.to,r=n.line,i=n.ch,s=mn(r);if(t=="char")u();else if(t=="column")u(!0);else if(t=="word"){var a=!1;for(;;){if(e<0&&!u())break;if(Tt(s.text.charAt(i)))a=!0;else if(a){e<0&&(e=1,u());break}if(e>0&&!u())break}}return{line:r,ch:i}}function wr(e,t){var n=e<0?Bt.from:Bt.to;if(jt||vt(Bt.from,Bt.to))n=br(e,t);mr(n.line,n.ch,!0)}function Er(e,t){vt(Bt.from,Bt.to)?e<0?Xn("",br(e,t),Bt.to):Xn("",Bt.from,br(e,t)):Xn("",Bt.from,Bt.to),Vt=!0}function Sr(e,t){var n=0,r=zr(Bt.inverted?Bt.from:Bt.to,!0);an!=null&&(r.x=an);if(t=="page")var i=Math.min(Et.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Wr(r.x,r.y+i*e);else if(t=="line")var o=Kr(),s=Wr(r.x,r.y+.5*o+e*o);t=="page"&&(M.scrollTop+=zr(s,!0).y-r.y),mr(s.line,s.ch,!0),an=r.x}function xr(e){var t=mn(e.line).text,n=e.ch,r=e.ch;if(t){e.after===!1||r==t.length?--n:++r;var i=t.charAt(n),s=Tt(i)?Tt:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&Tt(e)};while(n>0&&s(t.charAt(n-1)))--n;while(r=e.ch)&&t.push(i.marker)}return t}function Br(e,t,n){return typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker={text:t,style:n},Qt=!0,e}function jr(e){typeof e=="number"&&(e=mn(gr(e))),e.gutterMarker=null,Qt=!0}function Fr(e,t){var n=e,r=e;return typeof e=="number"?r=mn(gr(e)):n=W(e),n==null?null:t(r,n)?($t.push({from:n,to:n+1}),r):null}function Ir(e,t,n){return Fr(e,function(e){if(e.className!=t||e.bgClassName!=n)return e.className=t,e.bgClassName=n,!0})}function qr(e,t){return Fr(e,function(e,n){if(e.hidden!=t){e.hidden=t,s.lineWrapping||(t&&e.text.length==rn.text.length?sn=!0:!t&&e.text.length>rn.text.length&&(rn=e,sn=!1)),gn(e,t?0:1);var r=Bt.from.line,i=Bt.to.line;if(t&&(r==n||i==n)){var o=r==n?vr({line:r,ch:0},r,0):Bt.from,u=i==n?vr({line:i,ch:0},i,0):Bt.to;if(!u)return;dr(o,u)}return Qt=!0}})}function Rr(e){if(typeof e=="number"){if(!dn(e))return null;var t=e;e=mn(e);if(!e)return null}else{var t=W(e);if(t==null)return null}var n=e.gutterMarker;return{line:t,handle:e,text:e.text,markerText:n&&n.text,markerClass:n&&n.style,lineClass:e.className,bgClass:e.bgClassName}}function Ur(e,t){if(t==0)return{top:0,left:0};var n=yn(e,t);wt(J,n);var r=n.anchor,i=r.offsetTop,s=r.offsetLeft;if(v&&i==0&&s==0){var o=yt("span","x");r.parentNode.insertBefore(o,r.nextSibling),i=o.offsetTop}return{top:i,left:s}}function zr(e,t){var n,r=Kr(),i=r*(V(Dt,e.line)-(t?Yt:0));if(e.ch==0)n=0;else{var o=Ur(mn(e.line),e.ch);n=o.left,s.lineWrapping&&(i+=Math.max(0,o.top))}return{x:n,y:i,yBot:i+r}}function Wr(e,t){function h(e){var t=Ur(u,e);if(f){var r=Math.round(t.top/n);return c=r!=l,Math.max(0,t.left+(r-l)*Et.clientWidth)}return t.left}var n=Kr(),r=Yr(),i=Yt+Math.floor(t/n);if(i<0)return{line:0,ch:0};var o=X(Dt,i);if(o>=Dt.size)return{line:Dt.size-1,ch:mn(Dt.size-1).text.length};var u=mn(o),a=u.text,f=s.lineWrapping,l=f?i-V(Dt,o):0;if(e<=0&&l==0)return{line:o,ch:0};var c=!1,p=0,d=0,v=a.length,m,g=Math.min(v,Math.ceil((e+l*Et.clientWidth*.9)/r));for(;;){var y=h(g);if(!(y<=e&&gm)return{line:o,ch:v};g=Math.floor(v*.8),y=h(g),ye?(v=w,m=E,c&&(m+=1e3)):(p=w,d=E)}}function Xr(e){var t=zr(e,!0),n=ft(G);return{x:n.left+t.x,y:n.top+t.y,yBot:n.top+t.yBot}}function Kr(){if(Jr==null){Jr=yt("pre");for(var e=0;e<49;++e)Jr.appendChild(document.createTextNode("x")),Jr.appendChild(yt("br"));Jr.appendChild(document.createTextNode("x"))}var t=_.clientHeight;return t==$r?Vr:($r=t,wt(J,Jr.cloneNode(!0)),Vr=J.firstChild.offsetHeight/50||1,bt(J),Vr)}function Yr(){if(Et.clientWidth==Gr)return Qr;Gr=Et.clientWidth;var e=yt("span","x"),t=yt("pre",[e]);return wt(J,t),Qr=e.offsetWidth||10}function Zr(){return G.offsetTop}function ei(){return G.offsetLeft}function ti(e,t){var n=ft(Et,!0),r,i;try{r=e.clientX,i=e.clientY}catch(e){return null}if(!t&&(r-n.left>Et.clientWidth||i-n.top>Et.clientHeight))return null;var s=ft(G,!0);return Wr(r-s.left,i-s.top)}function ri(e){function i(){k.style.position="relative",S.style.cssText=r,g&&(M.scrollTop=n),Qn();if(S.selectionStart!=null){clearTimeout(ni);var e=S.value=" "+(vt(Bt.from,Bt.to)?"":S.value),t=0;Yn=" ",S.selectionStart=1,S.selectionEnd=e.length,ni=setTimeout(function i(){Yn==" "&&S.selectionStart==0?di(f.selectAll)(vn):t++<10?ni=setTimeout(i,500):er()},200)}}var t=ti(e),n=M.scrollTop;if(!t||E)return;(vt(Bt.from,Bt.to)||mt(t,Bt.from)||!mt(t,Bt.to))&&di(mr)(t.line,t.ch);var r=S.style.cssText;k.style.position="absolute",S.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",tr(),er(!0),vt(Bt.from,Bt.to)&&(S.value=Yn=" ");if(d){Y(e);var s=nt(window,"mouseup",function(){s(),setTimeout(i,20)},!0)}else setTimeout(i,50)}function ii(){clearInterval(Mt);var e=!0;F.style.visibility="",Mt=setInterval(function(){F.style.visibility=(e=!e)?"":"hidden"},s.cursorBlinkRate)}function oi(e){function v(e,t,n){if(!e.text)return;var r=e.styles,i=o?0:e.text.length-1,s;for(var a=o?0:r.length-2,f=o?r.length:-2;a!=f;a+=2*u){var l=r[a];if(r[a+1]!=h){i+=u*l.length;continue}for(var c=o?0:l.length-1,v=o?l.length:-1;c!=v;c+=u,i+=u)if(i>=t&&i"==o)p.push(s);else{if(p.pop()!=m.charAt(0))return{pos:i,match:!1};if(!p.length)return{pos:i,match:!0}}}}}var t=Bt.inverted?Bt.from:Bt.to,n=mn(t.line),r=t.ch-1,i=r>=0&&si[n.text.charAt(r)]||si[n.text.charAt(++r)];if(!i)return;var s=i.charAt(0),o=i.charAt(1)==">",u=o?1:-1,a=n.styles;for(var f=r+1,l=0,c=a.length;li;--r){if(r==0)return 0;var o=mn(r-1);if(o.stateAfter)return r;var u=o.indentation(s.tabSize);if(n==null||t>u)n=r-1,t=u}return n}function ai(e){var t=ui(e),n=t&&mn(t-1).stateAfter;return n?n=N(_t,n):n=C(_t),Dt.iter(t,e,function(r){r.process(_t,n,s.tabSize),r.stateAfter=t==e-1||t%5==0?N(_t,n):null}),n}function fi(){if(Pt>=en)return;var e=+(new Date)+s.workTime,t=N(_t,ai(Pt)),n=Pt;Dt.iter(Pt,en,function(n){Pt>=Zt?(n.highlight(_t,t,s.tabSize),n.stateAfter=N(_t,t)):(n.process(_t,t,s.tabSize),n.stateAfter=Pt%5==0?N(_t,t):null),++Pt;if(+(new Date)>e)return li(s.workDelay),!0}),en>n&&Pt>=Zt&&di(function(){$t.push({from:n,to:Pt})})()}function li(e){Ptu&&e.y>t.offsetHeight&&(s=e.y-t.offsetHeight),o+t.offsetWidth>a&&(o=a-t.offsetWidth)}t.style.top=s+Zr()+"px",t.style.left=t.style.right="",i=="right"?(o=ct.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?o=0:i=="middle"&&(o=(ct.clientWidth-t.offsetWidth)/2),t.style.left=o+ei()+"px"),n&&ir(o,s,o+t.offsetWidth,s+t.offsetHeight)},lineCount:function(){return Dt.size},clipPos:yr,getCursor:function(e){return e==null&&(e=Bt.inverted),gt(e?Bt.from:Bt.to)},somethingSelected:function(){return!vt(Bt.from,Bt.to)},setCursor:di(function(e,t,n){t==null&&typeof e.line=="number"?mr(e.line,e.ch,n):mr(e,t,n)}),setSelection:di(function(e,t,n){(n?pr:dr)(yr(e),yr(t||e))}),getLine:function(e){if(dn(e))return mn(e).text},getLineHandle:function(e){if(dn(e))return mn(e)},setLine:di(function(e,t){dn(e)&&Xn(t,{line:e,ch:0},{line:e,ch:mn(e).text.length})}),removeLine:di(function(e){dn(e)&&Xn("",{line:e,ch:0},yr({line:e+1,ch:0}))}),replaceRange:di(Xn),getRange:function(e,t,n){return Jn(yr(e),yr(t),n)},triggerOnKeyDown:di(_n),execCommand:function(e){return f[e](vn)},moveH:di(wr),deleteH:di(Er),moveV:di(Sr),toggleOverwrite:function(){Ut?(Ut=!1,F.className=F.className.replace(" CodeMirror-overwrite","")):(Ut=!0,F.className+=" CodeMirror-overwrite")},posFromIndex:function(e){var t=0,n;return Dt.iter(0,Dt.size,function(r){var i=r.text.length+1;if(i>e)return n=e,!0;e-=i,++t}),yr({line:t,ch:n})},indexFromPos:function(e){if(e.line<0||e.ch<0)return 0;var t=e.ch;return Dt.iter(0,e.line,function(e){t+=e.text.length+1}),t},scrollTo:function(e,t){e!=null&&(Et.scrollLeft=e),t!=null&&(M.scrollTop=Et.scrollTop=t),ur([])},getScrollInfo:function(){return{x:Et.scrollLeft,y:M.scrollTop,height:M.scrollHeight,width:Et.scrollWidth}},setSize:function(e,t){function n(e){return e=String(e),/^\d+$/.test(e)?e+"px":e}e!=null&&(Lt.style.width=n(e)),t!=null&&(Et.style.height=n(t)),vn.refresh()},operation:function(e){return di(e)()},compoundChange:function(e){return vi(e)},refresh:function(){ur(!0,null,qt),M.scrollHeight>qt&&(M.scrollTop=qt)},getInputField:function(){return S},getWrapperElement:function(){return Lt},getScrollerElement:function(){return Et},getGutterElement:function(){return ut}},Ln,Mn=null,Yn="";_r.prototype.clear=di(function(){var e,t;for(var n=0;n",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},pi=0;for(var mi in o)o.propertyIsEnumerable(mi)&&!vn.propertyIsEnumerable(mi)&&(vn[mi]=o[mi]);for(var gi=0;gi=t:s.to>t);(i||(i=[])).push({from:s.from,to:a?null:s.to,marker:o})}}return i}function _(e,t){if(e)for(var n=0,r;n=t:i.to>t);if(o||s.type=="bookmark"&&i.from==t){var u=i.from==null||(s.inclusiveLeft?i.from<=t:i.from0&&s)for(var f=0;f=0&&r>=0;--n,--r)if(e.charAt(n)!=t.charAt(r))break;return r+1}function xt(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n2){n.dependencies=[];for(var r=2;r0&&t.ch=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.post},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return at(this.string,this.start,this.tabSize)},indentation:function(){return at(this.string,null,this.tabSize)},match:function(e,t,n){if(typeof e!="string"){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string).indexOf(r(e),this.pos)==this.pos)return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=k;var I=" ";d||v&&!m?I="​":E&&(I=""),q.prototype={update:function(e,t){this.text=e,this.stateAfter=this.styles=null,j(this),F(this,t)},highlight:function(e,t,n){var r=new k(this.text,n),i=this.styles||(this.styles=[]),s=i.length=0;this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()){var o=e.token(r,t),u=r.current();r.start=r.pos,s&&i[s-1]==o?i[s-2]+=u:u&&(i[s++]=u,i[s++]=o);if(r.pos>5e3){i[s++]=this.text.slice(r.pos),i[s++]=null;break}}},process:function(e,t,n){var r=new k(this.text,n);this.text==""&&e.blankLine&&e.blankLine(t);while(!r.eol()&&r.pos<=5e3)e.token(r,t),r.start=r.pos},getTokenAt:function(e,t,n,r){var i=this.text,s=new k(i,n);while(s.pos=f&&tt+10&&/\s/.test(r)&&(a=function(){})}}var c=this.styles,h=this.text,p=this.markedSpans,d=h.length;if(!h&&t==null)a(o," ");else if(!p||!p.length)for(var y=0,b=0;bd&&(w=w.slice(0,d-b)),b+=x,a(o,w,g(S))}else{p.sort(function(e,t){return e.from-t.from});var T=0,y=0,N="",S,C=0,k=p[0].from||0,L=[],A=0,O=function(){var e;while(A_?N.slice(0,_-T):N,P);if(D>=_){N=N.slice(_-T),T=_;break}T=D}N=c[y++],S=g(c[y++])}}}return o},cleanUp:function(){this.parent=null,j(this)}},R.prototype={chunkSize:function(){return this.lines.length},remove:function(e,t,n){for(var r=e,i=e+t;r50){while(s.lines.length>50){var u=s.lines.splice(s.lines.length-25,25),a=new R(u);s.height-=a.height,this.children.splice(r+1,0,a),a.parent=this}this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new U(t);if(!e.parent){var r=new U(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=xt(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iter:function(e,t,n){this.iterN(e,t-e,n)},iterN:function(e,t,n){for(var r=0,i=this.children.length;r400||!s||this.closed||s.start>e+n.length||s.start+s.added0;--f)s.old.unshift(n[f-1]);for(var f=a;f>0;--f)s.old.push(n[n.length-f]);u&&(s.start=e),s.added+=t-(n.length-u-a)}this.time=r},startCompound:function(){this.compound++||(this.closed=!0)},endCompound:function(){--this.compound||(this.closed=!0)}},e.e_stop=Y,e.e_preventDefault=Q,e.e_stopPropagation=G,e.connect=nt,rt.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}};var it=e.Pass={toString:function(){return"CodeMirror.Pass"}},st=function(){if(g)return!1;var e=yt("div");return"draggable"in e||"dragDrop"in e}(),ot=function(){var e=yt("textarea");return e.value="foo\nbar",e.value.indexOf("\r")>-1?"\r\n":"\n"}(),ut=/^$/;d?ut=/$'/:S?ut=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:w&&(ut=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var ct=[""],Nt="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=Nt;var Ct=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0};e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var kt={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return e.keyNames=kt,function(){for(var e=0;e<10;e++)kt[e+48]=String(e);for(var e=65;e<=90;e++)kt[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)kt[e+111]=kt[e+63235]="F"+e}(),e.version="2.35",e}(),define("CodeMirror",function(e){return function(){return e.CodeMirror}}(this)),CodeMirror.defineMode("mysql",function(e){function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function u(e,t){var r=e.next();n=null;if(r=="$"||r=="?")return e.match(/^[\w\d]*/),"variable-2";if(r=="<"&&!e.match(/^[\s\u00a0=]/,!1))return e.match(/^[^\s\u00a0>]*>?/),"atom";if(r=='"'||r=="'")return t.tokenize=a(r),t.tokenize(e,t);if(r=="`")return t.tokenize=f(r),t.tokenize(e,t);if(/[{}\(\),\.;\[\]]/.test(r))return n=r,null;if(r!="-"){if(o.test(r))return e.eatWhile(o),null;if(r==":")return e.eatWhile(/[\w\d\._\-]/),"atom";e.eatWhile(/[_\w\d]/);if(e.eat(":"))return e.eatWhile(/[\w\d_\-]/),"atom";var l=e.current(),c;return i.test(l)?null:s.test(l)?"keyword":"variable"}var u=e.next();if(u=="-")return e.skipToEnd(),"comment"}function a(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"string"}}function f(e){return function(t,n){var r=!1,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=u;break}r=!r&&i=="\\"}return"variable-2"}}function l(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function c(e){e.indent=e.context.indent,e.context=e.context.prev}var t=e.indentUnit,n,i=r(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","isblank","isliteral","union","a"]),s=r(["ACCESSIBLE","ALTER","AS","BEFORE","BINARY","BY","CASE","CHARACTER","COLUMN","CONTINUE","CROSS","CURRENT_TIMESTAMP","DATABASE","DAY_MICROSECOND","DEC","DEFAULT","DESC","DISTINCT","DOUBLE","EACH","ENCLOSED","EXIT","FETCH","FLOAT8","FOREIGN","GRANT","HIGH_PRIORITY","HOUR_SECOND","IN","INNER","INSERT","INT2","INT8","INTO","JOIN","KILL","LEFT","LINEAR","LOCALTIME","LONG","LOOP","MATCH","MEDIUMTEXT","MINUTE_SECOND","NATURAL","NULL","OPTIMIZE","OR","OUTER","PRIMARY","RANGE","READ_WRITE","REGEXP","REPEAT","RESTRICT","RIGHT","SCHEMAS","SENSITIVE","SHOW","SPECIFIC","SQLSTATE","SQL_CALC_FOUND_ROWS","STARTING","TERMINATED","TINYINT","TRAILING","UNDO","UNLOCK","USAGE","UTC_DATE","VALUES","VARCHARACTER","WHERE","WRITE","ZEROFILL","ALL","AND","ASENSITIVE","BIGINT","BOTH","CASCADE","CHAR","COLLATE","CONSTRAINT","CREATE","CURRENT_TIME","CURSOR","DAY_HOUR","DAY_SECOND","DECLARE","DELETE","DETERMINISTIC","DIV","DUAL","ELSEIF","EXISTS","FALSE","FLOAT4","FORCE","FULLTEXT","HAVING","HOUR_MINUTE","IGNORE","INFILE","INSENSITIVE","INT1","INT4","INTERVAL","ITERATE","KEYS","LEAVE","LIMIT","LOAD","LOCK","LONGTEXT","MASTER_SSL_VERIFY_SERVER_CERT","MEDIUMINT","MINUTE_MICROSECOND","MODIFIES","NO_WRITE_TO_BINLOG","ON","OPTIONALLY","OUT","PRECISION","PURGE","READS","REFERENCES","RENAME","REQUIRE","REVOKE","SCHEMA","SELECT","SET","SPATIAL","SQLEXCEPTION","SQL_BIG_RESULT","SSL","TABLE","TINYBLOB","TO","TRUE","UNIQUE","UPDATE","USING","UTC_TIMESTAMP","VARCHAR","WHEN","WITH","YEAR_MONTH","ADD","ANALYZE","ASC","BETWEEN","BLOB","CALL","CHANGE","CHECK","CONDITION","CONVERT","CURRENT_DATE","CURRENT_USER","DATABASES","DAY_MINUTE","DECIMAL","DELAYED","DESCRIBE","DISTINCTROW","DROP","ELSE","ESCAPED","EXPLAIN","FLOAT","FOR","FROM","GROUP","HOUR_MICROSECOND","IF","INDEX","INOUT","INT","INT3","INTEGER","IS","KEY","LEADING","LIKE","LINES","LOCALTIMESTAMP","LONGBLOB","LOW_PRIORITY","MEDIUMBLOB","MIDDLEINT","MOD","NOT","NUMERIC","OPTION","ORDER","OUTFILE","PROCEDURE","READ","REAL","RELEASE","REPLACE","RETURN","RLIKE","SECOND_MICROSECOND","SEPARATOR","SMALLINT","SQL","SQLWARNING","SQL_SMALL_RESULT","STRAIGHT_JOIN","THEN","TINYTEXT","TRIGGER","UNION","UNSIGNED","USE","UTC_TIME","VARBINARY","VARYING","WHILE","XOR","FULL","COLUMNS","MIN","MAX","STDEV","COUNT"]),o=/[*+\-<>=&|]/;return{startState:function(e){return{tokenize:u,context:null,indent:0,col:0}},token:function(e,t){e.sol()&&(t.context&&t.context.align==null&&(t.context.align=!1),t.indent=e.indentation());if(e.eatSpace())return null;var r=t.tokenize(e,t);r!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"&&(t.context.align=!0);if(n=="(")l(t,")",e.column());else if(n=="[")l(t,"]",e.column());else if(n=="{")l(t,"}",e.column());else if(/[\]\}\)]/.test(n)){while(t.context&&t.context.type=="pattern")c(t);t.context&&n==t.context.type&&c(t)}else n=="."&&t.context&&t.context.type=="pattern"?c(t):/atom|string|variable/.test(r)&&t.context&&(/[\}\]]/.test(t.context.type)?l(t,"pattern",e.column()):t.context.type=="pattern"&&!t.context.align&&(t.context.align=!0,t.context.col=e.column()));return r},indent:function(e,n){var r=n&&n.charAt(0),i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var s=i&&r==i.type;return i?i.type=="pattern"?i.col:i.align?i.col+(s?0:1):i.indent+(s?0:t):0}}}),CodeMirror.defineMIME("text/x-mysql","mysql"),define("MySQLCodeMirror",function(){}),define("FiddleEditor",["CodeMirror","MySQLCodeMirror","jQuery"],function(e,t,n){var r=function(t,r,i,s){return this.codeMirrorSupported=!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),this.codeMirrorSupported?(this.codeMirror=e.fromTextArea(document.getElementById(t),{mode:"mysql",matchBrackets:!0,extraKeys:{Tab:"indentMore"},lineNumbers:!0,onChange:function(){r.call(i)}}),n(this.codeMirror.getWrapperElement()).on("keypress",function(e){e.keyCode==13&&e.ctrlKey&&s&&(e.preventDefault(),s())})):(this.textArea=document.getElementById(t),n(this.textArea).on("change",function(){r.call(i)}),n(this.textArea).on("keyup",function(){r.call(i)}),n(this.textArea).on("keypress",function(e){e.keyCode==13&&e.ctrlKey&&s&&(e.preventDefault(),s())}),n(this.textArea).attr("fullscreen",!1)),this};return r.prototype.getValue=function(){return this.codeMirrorSupported?this.codeMirror.getValue():this.textArea.value},r.prototype.setValue=function(e){this.codeMirrorSupported?this.codeMirror.setValue(e):(this.textArea.value=e,n(this.textArea).trigger("change"))},r.prototype.refresh=function(){this.codeMirrorSupported&&this.codeMirror.refresh()},r.prototype.somethingSelected=function(){return this.codeMirrorSupported?this.codeMirror.somethingSelected():!1},r.prototype.getSelection=function(){return this.codeMirrorSupported?this.codeMirror.getSelection():this.textArea.value},r.prototype.getScrollerElement=function(){return this.codeMirrorSupported?this.codeMirror.getScrollerElement():null},r.prototype.getGutterElement=function(){return this.codeMirrorSupported?this.codeMirror.getGutterElement():null},r.prototype.isFullscreen=function(){return this.codeMirrorSupported?n(this.codeMirror.getScrollerElement()).hasClass("CodeMirror-fullscreen"):n(this.textArea).attr("fullscreen")==1},r.prototype.setFullscreen=function(e){if(e){var t=n(window).height()-40;this.codeMirrorSupported?(n(this.codeMirror.getScrollerElement()).addClass("CodeMirror-fullscreen").height(t),n(this.codeMirror.getGutterElement()).height(t)):(n(this.textArea).addClass("fullscreen"),n(this.textArea).height(t),n(this.textArea).attr("fullscreen",e))}else this.codeMirrorSupported?(n(this.codeMirror.getScrollerElement()).removeClass("CodeMirror-fullscreen"),n(this.codeMirror.getGutterElement()).css("height","auto"),n(this.codeMirror.getScrollerElement()).css("height","200px")):(n(this.textArea).removeClass("fullscreen"),n(this.textArea).height(100),n(this.textArea).attr("fullscreen",e))},r}),define("libs/renderTerminator",[],function(){var e=function(e,t){var n=e.find(".terminator a.btn");n.html(n.html().replace(/\[ .+ \]/,"[ "+t+" ]")),e.find(".terminator").data("statement_separator",t)};return e}),define("text!fiddle_backbone/templates/schemaOutput.html",[],function(){return' {{#if errorMessage}}\n
{{errorMessage}}
\n {{else}}\n
Schema Ready
\n {{/if}}'}),define("text!fiddle_backbone/templates/schemaBrowser.html",[],function(){return'

Schema Browser

\n
    \n {{#each objects}}\n
  • \n {{this.table_name}} ({{this.table_type}})\n
      \n {{#each this.columns}}\n
    • {{name}} {{type}}
    • \n {{/each}}\n
    \n
  • \n {{/each}}\n
'}),define("fiddle_backbone/views/SchemaDef",["jQuery","Backbone","Handlebars","FiddleEditor","libs/renderTerminator","text!fiddle_backbone/templates/schemaOutput.html","text!fiddle_backbone/templates/schemaBrowser.html"],function(e,t,n,r,i,s,o){var u=t.View.extend({initialize:function(){this.editor=new r(this.id,this.handleSchemaChange,this,_.bind(function(){this.model.build()},this)),this.compiledOutputTemplate=n.compile(s),this.compiledSchemaBrowserTemplate=n.compile(o)},handleSchemaChange:function(){if(this.model.get("ddl")!=this.editor.getValue()||this.model.get("statement_separator")!=e(".panel.schema .terminator").data("statement_separator"))this.model.set({ddl:this.editor.getValue(),statement_separator:e(".panel.schema .terminator").data("statement_separator"),ready:!1}),e(".schema .helpTip").css("display",this.model.get("ddl").length?"none":"block"),e(".sql .helpTip").css("display",!this.model.get("ready")||this.model.get("loading")?"none":"block")},render:function(){this.editor.setValue(this.model.get("ddl")),this.updateDependents(),i(e(".panel.schema"),this.model.get("statement_separator"))},renderOutput:function(){this.options.output_el.html(this.compiledOutputTemplate(this.model.toJSON()))},renderSchemaBrowser:function(){this.options.browser_el.html(this.compiledSchemaBrowserTemplate({objects:this.model.get("schema_structure")}))},refresh:function(){this.editor.refresh()},updateDependents:function(){this.model.get("ready")?(e(".needsReadySchema").unblock(),e("#schemaBrowser").attr("disabled",!1),e(".schema .helpTip").css("display","none")):(e(".needsReadySchema").block({message:"Please build schema."}),e("#schemaBrowser").attr("disabled",!0),e(".schema .helpTip").css("display",this.model.get("loading")||this.model.get("ddl").length?"none":"block"))}});return u});var isIE=navigator.appVersion.indexOf("MSIE")!=-1?!0:!1,isWin=navigator.appVersion.toLowerCase().indexOf("win")!=-1?!0:!1,isOpera=navigator.userAgent.indexOf("Opera")!=-1?!0:!1;define("XPlans/oracle/flashver",function(){});var viewerMap={sqlmonitor:["11"],sqlpa:["11"],xplan:["11"],sql_detail:["11","11.2.0.2.0"],EmergencyADDM:["11"],ComparePeriodReport:["11"],AshViewer:["11"]},requiredMajorVersion=10,requiredMinorVersion=0,requiredRevision=0,hasProductInstall=DetectFlashVer(6,0,65),hasRequestedVersion=DetectFlashVer(requiredMajorVersion,requiredMinorVersion,requiredRevision);Vars=function(e){this.numVars=0;if(e!=null){var t,n,r=e.split("&"),i=r.length;for(var s=0;s3){var t=o.split("="),n=t[0],u=t[1];this[n]==null&&n.length>0&&u.length>0&&(this[n]=u,this.numVars++)}}}},Vars.prototype.toString=function(e){var t="";e==null&&(e="");for(var n in this)this[n]!=null&&typeof this[n]!="object"&&typeof this[n]!="function"&&n!="numVars"&&(t+=e+n+"="+this[n]+"&");return t.length>0&&(t=t.substr(0,t.length-1)),t},define("XPlans/oracle/loadswf",["XPlans/oracle/flashver"],function(e){return function(){return e.loadswf}}(this));if(typeof QP=="undefined"||!QP)var QP={};(function(){function e(e){var r=t(e),i=r[0];i.getContext!==null&&i.getContext!==undefined&&window.setTimeout(function(){var t=i.getContext("2d"),s=$(".qp-tr",e);i.width=s.outerWidth(!0),i.height=s.outerHeight(!0);var o=r.offset();$(".qp-tr",e).each(function(){var e=$("> * > .qp-node",$(this));$("> * > .qp-tr > * > .qp-node",$(this)).each(function(){n(t,o,e,$(this))})}),t.stroke()},1)}function t(e){var t=$("canvas",e);return t.length==0&&(e.prepend($("").css("position","absolute").css("top",0).css("left",0)),t=$("canvas",e)),t}function n(e,t,n,r){var i=n.offset();i.top+=n.outerHeight()/2,i.left+=n.outerWidth();var s=r.offset();s.top+=r.outerHeight()/2;var o=i.left/2+s.left/2;e.moveTo(i.left-t.left,i.top-t.top),e.lineTo(o-t.left,i.top-t.top),e.lineTo(o-t.left,s.top-t.top),e.lineTo(s.left-t.left,s.top-t.top)}QP.drawLines=function(t){t===null||t===undefined?t=$(".qp-root").parent():t=$(t),e(t)}})(),define("XPlans/mssql",function(e){return function(){return e.QP}}(this)),define("text!fiddle_backbone/templates/queryTabularOutput.html",[],function(){return'{{#each_with_index sets}}\n
\n {{#if this.RESULTS.DATA.length}}\n
\n \n {{#each this.RESULTS.COLUMNS}}\n \n {{/each}}\n \n {{#each this.RESULTS.DATA}}\n \n {{#each this}}\n \n {{/each}}\n \n {{/each}}\n
{{this}}
{{result_display this this}}
\n {{/if}}\n {{#if this.SUCCEEDED}}\n
\n \n Record Count: {{this.RESULTS.DATA.length}}; Execution Time: {{this.EXECUTIONTIME}}ms\n {{#if this.EXECUTIONPLAN.DATA.length}}\n View Execution Plan \n {{/if}}\n link\n
\n \n {{#if this.EXECUTIONPLAN.DATA.length}}\n \n \n {{#each this.EXECUTIONPLAN.COLUMNS}}\n \n {{/each}}\n \n {{#each this.EXECUTIONPLAN.DATA}}\n \n {{#each this}}\n \n {{/each}}\n \n {{/each}}\n\n {{#if ../../../schemaDef/dbType/isSQLServer}}\n \n \n \n {{/if}}\n\n {{#if ../../../schemaDef/dbType/isPostgreSQL}}\n \n \n \n {{/if}}\n\n
{{this}}
{{{this}}}
Download .sqlplan | Download SQL Sentry Plan Explorer (free)
\n {{/if}}\n \n {{else}}\n
{{this.ERRORMESSAGE}}
\n {{/if}}\n\n{{/each_with_index}}\n\nDid this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!'}),define("text!fiddle_backbone/templates/queryPlaintextOutput.html",[],function(){return'{{#each_with_index sets}}\n
\n {{#if this.RESULTS.DATA.length}}\n
\n|{{#each_simple_value_with_index this.RESULTS.COLUMNS}} {{result_display_padded ../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}\n|{{#each_simple_value_with_index this.RESULTS.COLUMNS}}{{divider_display ../this/RESULTS/COLUMNWIDTHS}}{{/each_simple_value_with_index}}{{#each this.RESULTS.DATA}}\n|{{#each_simple_value_with_index this}} {{result_display_padded ../../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}{{/each}}\n		
\n {{/if}}\n {{#if this.SUCCEEDED}}\n
\n \n Record Count: {{this.RESULTS.DATA.length}}; Execution Time: {{this.EXECUTIONTIME}}ms\n {{#if this.EXECUTIONPLAN.DATA.length}}\n View Execution Plan\n {{/if}}\n link\n
\n \n {{#if this.EXECUTIONPLAN.DATA.length}}\n \n \n {{#each this.EXECUTIONPLAN.COLUMNS}}\n \n {{/each}}\n \n {{#each this.EXECUTIONPLAN.DATA}}\n \n {{#each this}}\n \n {{/each}}\n \n {{/each}}\n\n {{#if ../../../schemaDef/dbType/isSQLServer}}\n \n \n \n {{/if}}\n\n {{#if ../../../schemaDef/dbType/isPostgreSQL}}\n \n \n \n {{/if}}\n\n
{{this}}
{{{this}}}
Download .sqlplan
\n {{/if}}\n \n {{else}}\n
{{this.ERRORMESSAGE}}
\n {{/if}}\n
\n{{/each_with_index}}\n\nDid this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!'}),define("text!fiddle_backbone/templates/queryMarkdownOutput.html",[],function(){return'Markdown is useful for posting on sites like StackOverflow and dba.se. Also, those sites are great resources for getting help with database questions! \n
[SQL Fiddle][1]\n\n**{{schemaDef.dbType.full_name}} Schema Setup**:\n\n{{code_format schemaDef.ddl}}\n{{#each_with_index sets}}\n**Query {{add index 1}}**:\n\n{{code_format STATEMENT}}\n\n**[Results][{{add index 2}}]**:\n    {{#if this.RESULTS.DATA.length}}\n    |{{#each_simple_value_with_index this.RESULTS.COLUMNS}} {{result_display_padded ../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}\n    |{{#each_simple_value_with_index this.RESULTS.COLUMNS}}{{divider_display ../this/RESULTS/COLUMNWIDTHS}}{{/each_simple_value_with_index}}{{#each this.RESULTS.DATA}}\n    |{{#each_simple_value_with_index this}} {{result_display_padded ../../this/RESULTS/COLUMNWIDTHS}} |{{/each_simple_value_with_index}}{{/each}}\n{{/if}}\n{{/each_with_index}}\n\n  [1]: http://sqlfiddle.com/#!{{schemaDef/dbType/id}}/{{schemaDef/short_code}}/{{id}}\n{{#each_with_index sets}}\n  [{{add index 2}}]: http://sqlfiddle.com/#!{{../schemaDef/dbType/id}}/{{../schemaDef/short_code}}/{{../id}}/{{index}}\n{{/each_with_index}}\n
\n\nDid this query solve the problem? If so, consider donating $5 to help make sure SQL Fiddle will be here next time you need help with a database problem. Thanks!'}),define("HandlebarsHelpers/divider_display",["Handlebars"],function(e){e.registerHelper("divider_display",function(e){var t=[];return t.length=e[this.index]+3,t.join("-")+"|"})}),define("HandlebarsHelpers/each_simple_value_with_index",["Handlebars"],function(e){e.registerHelper("each_simple_value_with_index",function(e,t){var n="";k=0;for(var r=0,i=e.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?������]))/ig;return e.isPlainObject(n)?JSON.stringify(n,null,4):n==null?"(null)":n===!1?"false":typeof n=="string"&&n.match(r)&&t.Utils.escapeExpression(n)==n?new t.SafeString(n.replace(r,"$1")):n})}),define("HandlebarsHelpers/code_format",["Handlebars"],function(e){e.registerHelper("code_format",function(e){var t=[],n=e.split("\n");for(var r=0;r