text
stringlengths
2
1.05M
/* @flow */ 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /*:: import type {Config} from './config';*/ var _getState = require('./get-state'); var getStateKey = require('./get-state-key'); var mergeStyles = require('./merge-styles'); var Plugins = require('./plugins/'); var ExecutionEnvironment = require('exenv'); var React = require('react'); var DEFAULT_CONFIG = { plugins: [Plugins.mergeStyleArray, Plugins.checkProps, Plugins.resolveMediaQueries, Plugins.resolveInteractionStyles, Plugins.prefix, Plugins.checkProps] }; // Gross var globalState = {}; // Declare early for recursive helpers. var resolveStyles = ((null /*: any*/) /*: ( component: any, // ReactComponent, flow+eslint complaining renderedElement: any, config: Config, existingKeyMap?: {[key: string]: bool} ) => any*/); var _resolveChildren = function _resolveChildren(_ref) { var children = _ref.children; var component = _ref.component; var config = _ref.config; var existingKeyMap = _ref.existingKeyMap; if (!children) { return children; } var childrenType = typeof children; if (childrenType === 'string' || childrenType === 'number') { // Don't do anything with a single primitive child return children; } if (childrenType === 'function') { // Wrap the function, resolving styles on the result return function () { var result = children.apply(this, arguments); if (React.isValidElement(result)) { return resolveStyles(component, result, config, existingKeyMap); } return result; }; } if (React.Children.count(children) === 1 && children.type) { // If a React Element is an only child, don't wrap it in an array for // React.Children.map() for React.Children.only() compatibility. var onlyChild = React.Children.only(children); return resolveStyles(component, onlyChild, config, existingKeyMap); } return React.Children.map(children, function (child) { if (React.isValidElement(child)) { return resolveStyles(component, child, config, existingKeyMap); } return child; }); }; // Recurse over props, just like children var _resolveProps = function _resolveProps(_ref2) { var component = _ref2.component; var config = _ref2.config; var existingKeyMap = _ref2.existingKeyMap; var props = _ref2.props; var newProps = props; Object.keys(props).forEach(function (prop) { // We already recurse over children above if (prop === 'children') { return; } var propValue = props[prop]; if (React.isValidElement(propValue)) { newProps = _extends({}, newProps); newProps[prop] = resolveStyles(component, propValue, config, existingKeyMap); } }); return newProps; }; var _buildGetKey = function _buildGetKey(renderedElement, existingKeyMap) { // We need a unique key to correlate state changes due to user interaction // with the rendered element, so we know to apply the proper interactive // styles. var originalKey = renderedElement.ref || renderedElement.key; var key = getStateKey(originalKey); var alreadyGotKey = false; var getKey = function getKey() { if (alreadyGotKey) { return key; } alreadyGotKey = true; if (existingKeyMap[key]) { throw new Error('Radium requires each element with interactive styles to have a unique ' + 'key, set using either the ref or key prop. ' + (originalKey ? 'Key "' + originalKey + '" is a duplicate.' : 'Multiple elements have no key specified.')); } existingKeyMap[key] = true; return key; }; return getKey; }; var _setStyleState = function _setStyleState(component, key, stateKey, value) { var existing = component._lastRadiumState || component.state && component.state._radiumStyleState || {}; var state = { _radiumStyleState: _extends({}, existing) }; state._radiumStyleState[key] = _extends({}, state._radiumStyleState[key]); state._radiumStyleState[key][stateKey] = value; component._lastRadiumState = state._radiumStyleState; component.setState(state); }; var _runPlugins = function _runPlugins(_ref3) { var component = _ref3.component; var config = _ref3.config; var existingKeyMap = _ref3.existingKeyMap; var props = _ref3.props; var renderedElement = _ref3.renderedElement; // Don't run plugins if renderedElement is not a simple ReactDOMElement or has // no style. if (!React.isValidElement(renderedElement) || typeof renderedElement.type !== 'string' || !props.style) { return props; } var newProps = props; var plugins = config.plugins || DEFAULT_CONFIG.plugins; var getKey = _buildGetKey(renderedElement, existingKeyMap); var newStyle = props.style; plugins.forEach(function (plugin) { var result = plugin({ ExecutionEnvironment: ExecutionEnvironment, componentName: component.constructor.displayName || component.constructor.name, getComponentField: function getComponentField(key) { return component[key]; }, getGlobalState: function getGlobalState(key) { return globalState[key]; }, config: config, getState: function getState(stateKey, elementKey) { return _getState(component.state, elementKey || getKey(), stateKey); }, mergeStyles: mergeStyles, props: newProps, setState: function setState(stateKey, value, elementKey) { return _setStyleState(component, elementKey || getKey(), stateKey, value); }, style: newStyle }) || {}; newStyle = result.style || newStyle; newProps = result.props && Object.keys(result.props).length ? _extends({}, newProps, result.props) : newProps; var newComponentFields = result.componentFields || {}; Object.keys(newComponentFields).forEach(function (fieldName) { component[fieldName] = newComponentFields[fieldName]; }); var newGlobalState = result.globalState || {}; Object.keys(newGlobalState).forEach(function (key) { globalState[key] = newGlobalState[key]; }); }); if (newStyle !== props.style) { newProps = _extends({}, newProps, { style: newStyle }); } return newProps; }; // Wrapper around React.cloneElement. To avoid processing the same element // twice, whenever we clone an element add a special prop to make sure we don't // process this element again. var _cloneElement = function _cloneElement(renderedElement, newProps, newChildren) { // Only add flag if this is a normal DOM element if (typeof renderedElement.type === 'string') { newProps = _extends({}, newProps, { _radiumDidResolveStyles: true }); } return React.cloneElement(renderedElement, newProps, newChildren); }; // // The nucleus of Radium. resolveStyles is called on the rendered elements // before they are returned in render. It iterates over the elements and // children, rewriting props to add event handlers required to capture user // interactions (e.g. mouse over). It also replaces the style prop because it // adds in the various interaction styles (e.g. :hover). // resolveStyles = function (component /*: any*/, // ReactComponent, flow+eslint complaining renderedElement /*: any*/, // ReactElement config /*: Config*/, existingKeyMap /*:: ?: {[key: string]: boolean}*/) /*: any*/ { if (config === undefined) config = DEFAULT_CONFIG; // ReactElement existingKeyMap = existingKeyMap || {}; if (!renderedElement || // Bail if we've already processed this element. This ensures that only the // owner of an element processes that element, since the owner's render // function will be called first (which will always be the case, since you // can't know what else to render until you render the parent component). renderedElement.props && renderedElement.props._radiumDidResolveStyles) { return renderedElement; } var newChildren = _resolveChildren({ children: renderedElement.props.children, component: component, config: config, existingKeyMap: existingKeyMap }); var newProps = _resolveProps({ component: component, config: config, existingKeyMap: existingKeyMap, props: renderedElement.props }); newProps = _runPlugins({ component: component, config: config, existingKeyMap: existingKeyMap, props: newProps, renderedElement: renderedElement }); // If nothing changed, don't bother cloning the element. Might be a bit // wasteful, as we add the sentinal to stop double-processing when we clone. // Assume benign double-processing is better than unneeded cloning. if (newChildren === renderedElement.props.children && newProps === renderedElement.props) { return renderedElement; } return _cloneElement(renderedElement, newProps !== renderedElement.props ? newProps : {}, newChildren); }; // Only for use by tests resolveStyles.__clearStateForTests = function () { globalState = {}; }; module.exports = resolveStyles; // ReactComponent, flow+eslint complaining
(function() { 'use strict'; var test = require('colored-tape'), runOptionsTest = require('./common.js').runOptionsTest; test('beforeEach', function(t) { runOptionsTest(t, { beforeEach: 'Removing ' }); }); }());
//<![CDATA[ /*! Lazy Loading jQuery Plugin - Lazy Scroll * https://github.com/pikitemplates/scripts * * Copyright (c) 2018-2021 Piki Templates * https://pikitemplates.com */ $((function(e){e.fn.lazyimg=function(){return this.each((function(){function t(){var t=e(window).height();if(e(window).scrollTop()+t>a.offset().top){var o=new Image;o.onload=function(){a.addClass("lazy-img")},o.src=n}}var a=e(this),o=a.attr("src"),i=Math.round(a.height()),n="";n=o.match("s72-c")?o.replace("/s72-c",i):o,e(window).on("load scroll",t),t()}))}})), /*! On Scroll Plugin Slider Effect * * Copyright (c) 2018-2021 Piki Templates * https://pikitemplates.com */ jQuery((function(e){var t=function(){var a=e(window).scrollTop()+e(window).height(),o=e(".animatable");0==o.length&&e(window).off("scroll",t),o.each((function(t){var o=e(this);o.offset().top+o.height()-200<a&&o.removeClass("animatable").addClass("animated")}))};e(window).on("scroll",t),e(window).trigger("scroll")})), /*! Get Button */ function(){var e={facebook:"109672584880905",whatsapp:"+8801313599091",call_to_action:"",button_color:"#d12053",position:"right",order:"whatsapp,facebook"},t=document.location.protocol,a="getbutton.io",o=t+"//static."+a,i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=o+"/widget-send-button/js/init.js",i.onload=function(){WhWidgetSendButton.init(a,t,e)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(i,n)}(),$((function(){function t(e,t){return $content=$("<div>").html(e),$t=$content.find("img:first").attr("src"),join=$t.lastIndexOf("/")||0,turn=$t.lastIndexOf("/",join-1)||0,rotate=$t.substring(0,turn),enter=$t.substring(turn,join),out=$t.substring(join),(enter.match(/\/s[0-9]+/g)||enter.match(/\/w[0-9]+/g)||"/d"==enter)&&(enter="/w680"),rotate+enter+out}function a(e,t){return e.match("i.ytimg.com")?"video-nos":"image-nos"}function o(o,i,n,s){var r="",l=Math.floor(Math.random()*i+1);void 0!==n&&(n.match("recent")?r="/feeds/posts/default?alt=json-in-script&max-results="+i:n.match("random")?r="/feeds/posts/default?alt=json-in-script&orderby=updated&start-index="+l+"&max-results="+i:n.match("random")&&n.match("recent")||(r="/feeds/posts/default/-/"+n+"?alt=json-in-script&max-results="+i)),r.length>0&&$.ajax({type:"GET",url:r,cache:!1,dataType:"jsonp",beforeSend:function(e){switch(s){case"megamenu":o.addClass("sub-tab mega-menu"),o.find("a:first").attr("href",(function(e,t){if("recent"===n)t=t.replace(t,"/search");else t=t.replace(t,"/search/label/"+n);return t}));break;case"trending":o.html('<div class="loading-icon"/>').parent().find(".widget-content").addClass("open-iki");break;case"col-left":case"col-right":case"box-color":case"footer":case"related":o.html('<div class="loading-icon"/>').parent().addClass("type-"+s+" open-iki")}},complete:function(t){"col-left"!=s&&"col-right"!=s||(n.match("recent","random")?(e=showMoreText,e=""!=e?e:pikiMessages.showMore,o.closest(".HTML").find(".widget-title").append('<a class="simple-viewmore" href="/search">'+e+"</a>")):(e=showMoreText,e=""!=e?e:pikiMessages.showMore,o.closest(".HTML").find(".widget-title").append('<a class="simple-viewmore" href="/search/label/'+n+'">'+e+"</a>")))},success:function(e){var i="";switch(s){case"megamenu":i+='<div class="job-zad"><div class="job-zajs">';break;case"col-left":case"col-right":i+='<div class="jobiki-main-wrapper">';break;case"related":i+='<div class="job-wmr-creative">';break;case"footer":i+='<div class="footer-hero">';break;default:i+="<ul>"}var n=e.feed.entry;if(null!=n){for(var r=0;r<n.length;r++){for(var l=0;l<n[r].link.length;l++)if("alternate"==n[r].link[l].rel){link=n[r].link[l].href;break}var c=n[r].title.$t?n[r].title.$t:pikiMessages.noTitle,d=(n[r].author[0].name.$t,n[r].content.$t),h=$("<div>").html(d);h.text().substr(0,110),h.text().substr(0,210);if("category"in n[r]){if(void 0!==n[r].category[0].term)var p=n[r].category[0].term}else p="Uncategorized";var u=n[r].published.$t,f=u.substring(0,4),m=u.substring(5,7),b=u.substring(8,10),g=monthsName[parseInt(m,10)-1]+" "+b+", "+f,v="";if(n[r].media$thumbnail)var w=n[r].media$thumbnail.url;else w=noThumb;d.indexOf(d.match(/<iframe(?:.+)?src=(?:.+)?(?:www.youtube.com)/g))>-1?d.indexOf("<img")>-1?d.indexOf(d.match(/<iframe(?:.+)?src=(?:.+)?(?:www.youtube.com)/g))<d.indexOf("<img")?$src=w.replace("img.youtube.com","i.ytimg.com").replace("/default.","/maxresdefault."):$src=t(d):$src=w.replace("img.youtube.com","i.ytimg.com").replace("/default.","/maxresdefault."):d.indexOf("<img")>-1?$src=t(d):$src=noThumb;var k=a($src);switch(s){case"megamenu":i+='<div class="job-zaj"><div class="job-mposts-mthumb"><div class="post-filter-link '+k+'"><a class="snip-thumbnail lazy-img background-layer" href="'+link+'"><img class="snip-thumbnail lazy-img" alt="'+c+'" src="'+$src+'"/></a></div></div><span class="post-tag">'+p+'</span><div class="featured-meta"><h2 class="entry-title"><a href="'+link+'">'+c+"</a></h2></div></div>";break;case"col-left":case"col-right":case"related":i+='<div class="job-zaf item'+r+'"><div class="job-zah"><a class="post-filter-link '+k+'" href="'+link+'"><img class="snip-thumbnail" alt="'+c+'" src="'+$src+'"/></a></div><div class="piki-hero-box"><h2 class="entry-title"><a href="'+link+'">'+c+'</a></h2><div class="post-snip"><span class="post-date">'+g+"</span></div></div></div>";break;default:o.html('<div class="loading-icon"/>').parent().addClass("open-iki"),i+='<span class="error-status"><b>Error 400:</b> Wrong Shortcut code Please Use Correct Format like <b>6/featured/label</b> to Show Posts ASAP !</span>',o.parent().html(i)}}i+=v+="</ul>"}else if("megamenu"===s)i='<div class="job-zad"><span class="error-status"><b>Error 404:</b> Results Not Found Use Correct <b>/Label</b> or <b>/recent</b> or <b>/random</b> code to Show Posts</span></div>';else i='<span class="error-status"><b>Error 404:</b> Results Not Found Use Correct <b>/Label</b> or <b>/recent</b> or <b>/random</b> code to Show Posts</span>';switch(s){case"megamenu":i+="</div></div>",o.append(i);break;case"trending || col-left || col-right || footer || related":o.html(i),i+="</div></div>";break;default:i+="</div>",o.html(i)}o.find("img.snip-thumbnail").lazyimg(),$(".job-zas").lazyticker()},error:function(){if("megamenu"===s)o.append('<div class="job-zad"><span class="error-status"><b>Error 505:</b> The Server is unavailable to connect ! {Refresh Try Again}</span></div>');else o.html('<span class="error-status"><b>Error 505:</b> The Server is unavailable to connect ! {Refresh Try Again}</span>')}}),$("#job-zaq li a").each((function(){var e=$(this);e.attr("href").trim().match("megamenu")&&(n.match("recent","random")?pt="/search":pt="/search/label/"+n,e.attr("href",pt))}))}$(".widget-content,.job-zaa .HTML .widget-content,.sidebar .HTML .widget-content,.footer-post .HTML .widget-content").each((function(){var e=$(this),t=e.text().split("/");if(!isNaN(t[0])){var a=t[0],i=t[1];o(e,a,t[2],i)}})),$(".job-zao").each((function(e,t,a){var i=$(this);t=i.find(".related-tag").attr("label");o(i,relatedPostsNum,t,"related")})),$(".job-zau li").each((function(e,t){var a=$(this);if((i=a.find("a").attr("href")).match("megamenu")){var i;if(2===(i=i.split("/")).length)t=i[0],e=i[1];o(a,4,e,t)}}))})),$((function(){$(".job-zai").click((function(){localStorage.setItem("mode","darkmode"===localStorage.getItem("mode")?"light":"darkmode"),"darkmode"===localStorage.getItem("mode")?document.querySelector("#mainContent").classList.add("dark"):document.querySelector("#mainContent").classList.remove("dark")})),$(document).ready((function(){"https://www.potentialit.xyz/"!=$("#kutta").attr("href")&&(window.location.href="https://www.potentialit.xyz/")})),$(".PopularPosts .post-filter-link .snip-thumbnail,.FeaturedPost .post-filter-link .snip-thumbnail,.post-filter .post-filter-link .snip-thumbnail,.avatar-container .snip-thumbnail, .author-image .snip-thumbnail").lazyimg(),$("#job-zau .widget").addClass("show-menu"),$("#job-zau").each((function(){for(a=$(this),d=a.find(".LinkList ul > li").children("a"),g=d.length,n=0;n<g;n++){var e=d.eq(n),t=e.text();if("_"!==t.charAt(0)&&"_"===d.eq(n+1).text().charAt(0)){var o=e.parent();o.append('<ul class="sub-menu m-sub"/>')}"_"===t.charAt(0)&&(e.text(t.replace("_","")),e.parent().appendTo(o.children(".sub-menu")))}for(n=0;n<g;n++){if("_"!==(t=(e=d.eq(n)).text()).charAt(0)&&"_"===d.eq(n+1).text().charAt(0)){var i=e.parent();i.append('<ul class="sub-menu2 m-sub"/>')}"_"===t.charAt(0)&&(e.text(t.replace("_","")),e.parent().appendTo(i.children(".sub-menu2")))}$("#job-zau").find(".LinkList ul li ul").parent("li").addClass("sub-tab")})),$(".job-zau li").each((function(){0<$(this).find("ul").length&&$(this).addClass("drop-down")})),$("#job-zaq").each((function(){var e=$(this);$("#jobikis-list").clone().appendTo(e),$(".show-job-zaq-p, .hide-job-zaq, .overlay").on("click",(function(){$("body").toggleClass("jobikis-open")}))})),$(".job-zaq ul .mega-menu").removeClass("sub-tab"),$(".job-zaq ul li a").on("click",(function(){$(this).parent().removeClass("show").find("> .m-sub").slideToggle(170)})),$(".job-zaw").each((function(){var e=$(this);$("#social-sec ul.social").clone().appendTo(e)})),$(".job-zzu").each((function(){var e=$(this);$("#menu-top ul.nav1").clone().appendTo(e)})),$(".job-zay, .job-zay-closer").on("click",(function(){$(".job-zay-shadow").toggleClass("job-zay-shadow-show"),$("body").toggleClass("active-search")})),$("#job-zat .job-hero").each((function(){var e=$(this);if(1==fixedMenu&&0<e.length){var t=$(document).scrollTop(),a=e.offset().top,o=e.height(),i=a+o;$(window).scroll((function(){var a=$(document).scrollTop();a<$("#footer-wrapper").offset().top-o&&(a>i?e.addClass("fixed-nos"):0>=a&&e.removeClass("fixed-nos"),a>t?e.removeClass("show"):e.addClass("show"),t=$(document).scrollTop())}))}})),$("#load-more-link").each((function(){var e=$(this).data("load");e&&$("#load-more-link").show(),$("#load-more-link").on("click",(function(t){$("#load-more-link").hide(),$.ajax({url:e,success:function(t){var a=$(t).find(".grid-posts");a.find(".post-filter").addClass("loading-frame load-time"),$(".grid-posts").append(a.html()),(e=$(t).find("#load-more-link").data("load"))?$("#load-more-link").show():($("#load-more-link").hide(),$("#blog-pager .no-more").addClass("show")),$("img.snip-thumbnail").addClass("lazy-img")},beforeSend:function(){$("#blog-pager .loading").show()},complete:function(){$("#blog-pager .loading").hide()}}),t.preventDefault()}))})),$(".post-body iframe").each((function(){var e=$(this);e.attr("src").match("www.youtube.com")&&e.wrap('<div class="video-frame"/>')})),$(".post-body strike").each((function(){var e=$(this),t=e.text().trim();"(ads1)"==t&&e.replaceWith('<div id="new-bottom-ad-placeholder"/>'),"(ads2)"==t&&e.replaceWith('<div id="new-top-ad-placeholder"/>')})),$(".post-body blockquote").each((function(){var e=$(this),t=e.text().toLowerCase().trim(),a=e.html();if(t.match("(code-box)")){const t=a.replace("(code-box)","");e.replaceWith('<pre class="code-box">'+t+"</pre>")}})),$(".post-body strike").each((function(){var e=$(this),t=e.text().toLowerCase().trim(),a=e.html();if(t.match("(contact-form)")&&(e.replaceWith('<div class="contact-form"/>'),$(".contact-form").append($("#ContactForm1"))),t.match("(toc)")){const t=a.replace("(toc)","");e.replaceWith('<div class="tociki-pro"><div class="tociki-inner"><a href="javascript:;" class="tociki-title" role="button" title="Table of Contents"><span class="tociki-title-text">'+t+'</span></a><ol id="tociki"></ol></div></div>')}if(t.match("(caps)")){const t=a.replace("(caps)","");e.replaceWith('<span class="firstword">'+t+"</span>")}if(t.match("(left-sidebar)")){a.replace("(left-sidebar)","");e.replaceWith("<style>.item-view #feed-view{float:right}.item-view #sidebar-container{float:left}</style>")}if(t.match("(right-sidebar)")){a.replace("(right-sidebar)","");e.replaceWith("<style>.item-view #feed-view{float:left}.item-view #sidebar-container{float:right}</style>")}if(t.match("(full-width)")){a.replace("(full-width)","");e.replaceWith("<style>.item-view #feed-view{width:100%}.item-view #sidebar-container{display:none}</style>")}})),$(".job-zar .window-piki").on("click",(function(){var e=$(this),t=e.data("url"),a=e.data("width");e=e.data("height"),window.open(t,"_blank","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width="+a+",height="+e+",left="+Math.round(window.screen.width/2-a/2)+",top="+Math.round(window.screen.height/2-e/2)).focus()})),$(".job-zar").each((function(){var e=$(this);e.find(".show-hid a").on("click",(function(){e.toggleClass("show-hidden")}))})),$("#new-bottom-ad-placeholder").each((function(){var e=$(this);e.length&&$("#bottom-ad-placeholder").appendTo(e)})),$("#new-top-ad-placeholder").each((function(){var e=$(this);e.length&&$("#top-ad-placeholder").appendTo(e)})),$("#upper-ad .widget").each((function(){var e=$(this);e.length&&e.appendTo($("#bottom-ad-placeholder"))})),$("#lower-ad .widget").each((function(){var e=$(this);e.length&&e.appendTo($("#top-ad-placeholder"))})),$("#main-ads-post .widget").each((function(){var e=$(this);e.length&&e.appendTo($("#post-placeholder"))})),$(".author-description a").each((function(){$(this).attr("target","_blank")})),$(".about-author .author-description span a").each((function(){var e=$(this),t=e.text().trim(),a=e.attr("href");e.replaceWith('<li class="'+t+'"><a href="'+a+'" title="'+t+'" target="_blank"/></li>'),$(".description-links").append($(".author-description span li")),$(".description-links").addClass("show")})),$(".block-inner").each((function(){var e=$("a.prev-post-link").attr("href"),t=$("a.next-post-link").attr("href");$.ajax({url:e,type:"get",success:function(e){e=$(e).find(".blog-post h1.entry-title").text(),$(".post-prev a .block-inner-inner p").text(e)}}),$.ajax({url:t,type:"get",success:function(e){e=$(e).find(".blog-post h1.entry-title").text(),$(".post-next a .block-inner-inner p").text(e)}})})),$(".before-text").each((function(){var e=$(this),t=followByEmailText;""!=t&&e.text(t)})),$(".job-zao-title .widget-title h3").each((function(){var e=$(this),t=relatedPostsText;""!=t&&e.text(t)})),$("#feed-view, #sidebar-container").each((function(){1==fixedSidebar&&$(this).theiaStickySidebar({additionalMarginTop:30,additionalMarginBottom:30})})),$(".backTop").each((function(){var e=$(this);$(window).on("scroll",(function(){100<=$(this).scrollTop()?e.fadeIn(250):e.fadeOut(250)})),e.click((function(){$("html, body").animate({scrollTop:0},500)}))}))})); //]]>
import '../opbeat-e2e' import React from 'react' import ReactDOM from 'react-dom' class CompositeComponent extends React.Component { render () { return ( <span>Composite component</span> ) } } class ES6Component extends React.Component { render() { return ( <span id="ES6Component" onClick={() => render()}>es6 component</span> ) } } var FuncComponent = () => <span>func Component</span> function render () { ReactDOM.render( ( <div> <CompositeComponent /> <ES6Component /> <FuncComponent /> </div> ), document.getElementById('reactMount') ) } render()
/* @flow */ var createMarkupForStyles = function (style: Object, spaces: string): string { spaces = spaces || ''; return Object.keys(style).map(function (property) { return spaces + property + ': ' + style[property] + ';'; }).join('\n'); }; module.exports = createMarkupForStyles;
export default { name: 'XAxis', props: [ { name: 'hide', type: 'Boolean', defaultVal: 'false', isOptional: false, desc: { 'en-US': 'If set true, the axis do not display in the chart.', 'zh-CN': '是否隐藏 x 轴。', }, }, { name: 'dataKey', type: 'String | Number', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'The key of data displayed in the axis.', 'zh-CN': '指定展示的数据维度。', }, }, { name: 'xAxisId', type: 'String | Number', defaultVal: '0', isOptional: false, desc: { 'en-US': 'The unique id of x-axis.', 'zh-CN': 'x 轴的唯一 id。', }, }, { name: 'width', type: 'Number', defaultVal: '0', isOptional: false, desc: { 'en-US': 'The width of axis which is usually calculated internally.', 'zh-CN': 'x 轴的宽度,一般在图表内部计算。', }, }, { name: 'height', type: 'Number', defaultVal: '30', isOptional: false, desc: { 'en-US': 'The height of axis, which can be setted by user.', 'zh-CN': 'x 轴的高度,这个可以根据需要进行配置。', }, }, { name: 'orientation', type: '\'bottom\' , \'top\'', defaultVal: '\'bottom\'', isOptional: false, desc: { 'en-US': 'The orientation of axis', 'zh-CN': 'x 轴的位置。', }, }, { name: 'type', type: '\'number\' | \'category\'', defaultVal: '\'category\'', isOptional: false, desc: { 'en-US': 'The type of axis.', 'zh-CN': 'x 轴的类型:数值轴、类目轴。', }, }, { name: 'allowDecimals', type: 'Boolean', defaultVal: 'true', isOptional: false, desc: { 'en-US': 'Allow the ticks of XAxis to be decimals or not.', 'zh-CN': '是否允许小数类型的刻度。', }, }, { name: 'allowDataOverflow', type: 'Boolean', defaultVal: 'false', isOptional: false, desc: { 'en-US': 'When domain of the axis is specified and the type of the axis is \'number\', if allowDataOverflow is set to be false, the domain will be adjusted when the minimum value of data is smaller than domain[0] or the maximum value of data is greater than domain[1] so that the axis displays all data values. If set to true, graphic elements (line, area, bars) will be clipped to conform to the specified domain.', 'zh-CN': '当轴是数值轴时,指定轴的定义域(domain)的时候,如果 allowDataOverflow 的值为 false,我们会根据数据的最大值和最小值来调整 domain,确保所有的数据能够展示。如果 allowDataOverflow 的值为 true,不会调整 domain ,而是将相应的图形元素会直接裁剪掉。', }, }, { name: 'allowDuplicatedCategory', type: 'Boolean', defaultVal: 'true', isOptional: false, desc: { 'en-US': 'Allow the axis has duplicated categorys or not when the type of axis is "category".', 'zh-CN': '是否允许类目轴有重复的类目。', }, }, { name: 'tickCount', type: 'Number', defaultVal: '5', isOptional: false, desc: { 'en-US': 'The count of axis ticks. Not used if \'type\' is \'category\'.', 'zh-CN': '刻度数。如果\'type\'是\'category\',则不使用。', }, }, { name: 'domain', type: 'Array', defaultVal: '[0, \'auto\']', isOptional: true, desc: { 'en-US': 'Specify the domain of axis when the axis is a number axis. The length of domain should be 2, and we will validate the values in domain. And each element in the array can be a number, \'auto\', \'dataMin\', \'dataMax\', a string like \'dataMin - 20\', \'dataMax + 100\', or a function that accepts a single argument and returns a number. If any element of domain is set to be \'auto\', comprehensible scale ticks will be calculated, and the final domain of axis is generated by the ticks.', 'zh-CN': '当 x 轴是数值轴时,通过这个配置可以指定 x 轴刻度函数的定义域。这个配置是一个二元数组,数组中的元素可以是一个数值,"auto", "dataMin", "dataMax" 或者类似于"dataMin - 100", "dataMax + 200"这样的字符串。如果任意元素的取值为"auto",我们会生成可读性高的刻度,并且保证设置的刻度数。', }, format: [ '<XAxis type="number" domain={[\'dataMin\', \'dataMax\']} />', '<XAxis type="number" domain={[0, \'dataMax\']} />', '<XAxis type="number" domain={[\'auto\', \'auto\']} />', '<XAxis type="number" domain={[0, \'dataMax + 1000\']} />', '<XAxis type="number" domain={[\'dataMin - 100\', \'dataMax + 100\']} />', '<XAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />', ], examples: [{ name: 'Numeric XAxis with specified domain', url: '/examples/VerticalLineChartWithSpecifiedDomain', }], }, { name: 'interval', type: '"preserveStart" | "preserveEnd" | "preserveStartEnd" | Number', defaultVal: '\'preserveEnd\'', isOptional: false, desc: { 'en-US': 'If set 0, all the ticks will be shown. If set preserveStart", "preserveEnd" or "preserveStartEnd", the ticks which is to be shown or hidden will be calculated automatically.', 'zh-CN': '当值为0时,所有的刻度都会展示。如果值为1,则会间隔1个刻度来展示相应的刻度。当值为 "preserveStart" 时,根据刻度的宽度自动计算间隔,在有足够的空间的情况下,会从头部的刻度开始计算。当值为 "preserveEnd" 时,会从尾部的刻度开始计算是否展示。当值为"preserveStartEnd",会从头部、尾部的刻度开始计算向中间计算是否展示。', }, }, { name: 'padding', type: 'Object', defaultVal: '{ left: 0, right: 0 }', isOptional: false, desc: { 'en-US': 'Specify the padding of x-axis.', 'zh-CN': '指定内边距。', }, format: [ '<XAxis padding={{ left: 10 }} />', '<XAxis padding={{ right: 20 }} />', '<XAxis padding={{ left: 20, right: 20 }} />', ], examples: [{ name: 'XAxis with non-zero padding', url: '/examples/LineChartWithXAxisPading', }], }, { name: 'minTickGap', type: 'Number', defaultVal: '5', isOptional: false, desc: { 'en-US': 'The minimum gap between two adjacent labels.', 'zh-CN': '两个刻度之前最小间隔宽度。', }, }, { name: 'axisLine', type: 'Boolean | Object', defaultVal: 'true', isOptional: false, desc: { 'en-US': 'If set false, no axis line will be drawn. If set a object, the option is the configuration of axis line.', 'zh-CN': '轴线配置。当值为 false 时,不绘制轴线。当值为对象类型时,会把这个对象解析成轴线的属性配置。', }, }, { name: 'tickLine', type: 'Boolean | Object', defaultVal: 'true', isOptional: false, desc: { 'en-US': 'If set false, no axis tick lines will be drawn. If set a object, the option is the configuration of tick lines.', 'zh-CN': '刻度线配置。当值为 false 时,不绘制刻度线。当值为对象类型时,会把这个对象解析成刻度线的属性配置。', }, }, { name: 'tickSize', type: 'Number', defaultVal: '6', isOptional: false, desc: { 'en-US': 'The length of tick line.', 'zh-CN': '刻度线的长度。', }, }, { name: 'tickFormatter', type: 'Function', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'The formatter function of tick.', 'zh-CN': '刻度的格式化函数。', }, }, { name: 'ticks', type: 'Array', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'Set the values of axis ticks manually.', 'zh-CN': '指定需要展示的刻度。', }, }, { name: 'tick', type: 'Boolean | Object | ReactElement', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'If set false, no ticks will be drawn. If set a object, the option is the configuration of ticks. If set a React element, the option is the custom react element of drawing ticks.', 'zh-CN': '刻度配置。当值为 false 时,不绘制刻度。当值为对象类型时,会把这个对象解析成刻度的属性配置。当值为 React element,会克隆这个元素来渲染刻度。', }, format: [ '<XAxis tick={false} />', '<XAxis tick={{stroke: \'red\', strokeWidth: 2}} />', '<XAxis tick={<CustomizedTick />} />', ], examples: [{ name: 'A line chart with customized x-axis tick', url: '/examples/CustomizedLabelLineChart', }], }, { name: 'mirror', type: 'Boolean', defaultVal: 'false', isOptional: false, desc: { 'en-US': 'If set true, flips ticks around the axis line, displaying the labels inside the chart instead of outside.', 'zh-CN': '如果值为 true , 将刻度展示在轴的内侧,而不是外侧。', }, }, { name: 'reversed', type: 'Boolean', defaultVal: 'false', isOptional: false, desc: { 'en-US': 'Reverse the ticks or not.', 'zh-CN': '是否反转刻度的顺序', }, }, { name: 'label', type: 'String | Number | ReactElement | Object', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'If set a string or a number, default label will be drawn, and the option is content. If set a React element, the option is the custom react element of drawing label. If an object, the option is the props of a new Label instance.', 'zh-CN': '当值为简单类型的数值或者字符串时,这个值会被渲染成文字标签。当值为 React element,会克隆这个元素来渲染文字标签。如果一个对象,该选项是一个新的Label实例的道具。', }, format: [ '<XAxis label="Height" />', '<XAxis label={<CustomizedLabel />} />', '<XAxis label={{ value: "XAxis Label" }} />', ], examples: [ { name: 'A composed chart with axis labels', url: '/examples/ComposedChartWithAxisLabels', }, ], }, { name: 'scale', type: `'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold' | Function`, defaultVal: 'auto', isOptional: false, desc: { 'en-US': `If set to 'auto', the scale function is decided by the type of chart, and the props type. When set to 'time', make sure to also set type to 'number' and to include a domain.`, 'zh-CN': '当值为 "auto" 时,会根据图表类型来生成 scale 函数,也可以传入自定义的函数作为 scale 函数。', }, format: [ '<XAxis scale="log" />', ` import { scaleLog } from 'd3-scale'; const scale = scaleLog().base(Math.E); ... <XAxis scale={scale} /> ... `, ], }, { name: 'unit', type: 'String | Number', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'The unit of data displayed in the axis. This option will be used to represent an index unit in a scatter chart.', 'zh-CN': 'x 轴展示数据的单位。这个单位会展示在 Tooltip 的数值后面。', }, }, { name: 'name', type: 'String | Number', defaultVal: 'null', isOptional: true, desc: { 'en-US': 'The name of data displayed in the axis. This option will be used to represent an index in a scatter chart.', 'zh-CN': 'x 轴展示数据的名称。这个单位会展示在 Tooltip 内容中。', }, }, { name: 'onClick', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of click on the ticks of this axis', 'zh-CN': '刻度 click 事件的回调函数。', }, }, { name: 'onMouseDown', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of mousedown on the the ticks of this axis', 'zh-CN': '刻度 mousedown 事件的回调函数。', }, }, { name: 'onMouseUp', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of mouseup on the ticks of this axis', 'zh-CN': '刻度 mouseup 事件的回调函数。', }, }, { name: 'onMouseMove', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of mousemove on the ticks of this axis', 'zh-CN': '刻度 mousemove 事件的回调函数。', }, }, { name: 'onMouseOver', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of mouseover on the ticks of this axis', 'zh-CN': '刻度 mouseover 事件的回调函数。', }, }, { name: 'onMouseOut', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of mouseout on the ticks of this axis', 'zh-CN': '刻度 mouseout 事件的回调函数。', }, }, { name: 'onMouseEnter', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of moustenter on the ticks of this axis', 'zh-CN': '刻度 moustenter 事件的回调函数。', }, }, { name: 'onMouseLeave', type: 'Function', isOptional: true, desc: { 'en-US': 'The customized event handler of mouseleave on the ticks of this axis', 'zh-CN': '刻度 mouseleave 事件的回调函数。', }, }, { name: 'tickMargin', type: 'Number', isOptional: true, desc: { 'en-US': 'The margin between tick line and tick.', 'zh-CN': '刻度线和刻度之间的间隔。', }, }, ], parentComponents: [ 'AreaChart', 'BarChart', 'LineChart', 'ComposedChart', 'ScatterChart', ], childrenComponents: [ 'Label', ], };
/// Mock for external Bitcoincash API /// See: /// curl "http://{bch rpc}/v2/xpub/xpub6Bq3UUphocwroXkhA9sn8ACnZpJNuwaBehgo7WbDi2DULYnvT72Uzgsv9cE5EiP8ThDYdMyZREfbpkUY4KZ88ZaUQxXciBcZ1soSi1d8xtX?details=txs" /// curl "http://localhost:3000/bitcoincash-api/v2/xpub/xpub6Bq3UUphocwroXkhA9sn8ACnZpJNuwaBehgo7WbDi2DULYnvT72Uzgsv9cE5EiP8ThDYdMyZREfbpkUY4KZ88ZaUQxXciBcZ1soSi1d8xtX?details=txs" /// curl "http://localhost:8420/v1/bitcoincash/xpub/xpub6Bq3UUphocwroXkhA9sn8ACnZpJNuwaBehgo7WbDi2DULYnvT72Uzgsv9cE5EiP8ThDYdMyZREfbpkUY4KZ88ZaUQxXciBcZ1soSi1d8xtX" module.exports = { path: '/bitcoincash-api/v2/xpub/:xpubkey?', template: function(params, query, body) { //console.log(params) //console.log(query) switch (params.xpubkey) { case 'xpub6Bq3UUphocwroXkhA9sn8ACnZpJNuwaBehgo7WbDi2DULYnvT72Uzgsv9cE5EiP8ThDYdMyZREfbpkUY4KZ88ZaUQxXciBcZ1soSi1d8xtX': return JSON.parse(` { "page": 1, "totalPages": 1, "itemsOnPage": 1000, "address": "xpub6Bq3UUphocwroXkhA9sn8ACnZpJNuwaBehgo7WbDi2DULYnvT72Uzgsv9cE5EiP8ThDYdMyZREfbpkUY4KZ88ZaUQxXciBcZ1soSi1d8xtX", "balance": "177672", "totalReceived": "13221795", "totalSent": "13044123", "unconfirmedBalance": "0", "unconfirmedTxs": 0, "txs": 72, "transactions": [ { "txid": "269d428f01fbe49cd6d2c2ca5e6e2f0ff68aece905313932156078d4341d347a", "version": 1, "vin": [ { "txid": "5536327a38fddb32a92a98582aca4e85b4e50f40b9d3c03db360eaca7b512f97", "n": 0, "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true, "value": "188124", "hex": "473044022057e811d95dfce16c7f1d1da574ab4ca1bf883359da34a1e7a380f5045fcffc960220149c357343f0172301f06b914a2844d3755a3e990a236ae33f71afed52f0849d41210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5" } ], "vout": [ { "value": "10000", "n": 0, "hex": "76a9147222fa3e0a256cc45823a641aa4060e66718276288ac", "addresses": [ "bitcoincash:qpez9737pgjke3zcywnyr2jqvrnxwxp8vgu3nnxf6x" ], "isAddress": true }, { "value": "177672", "n": 1, "hex": "76a9149800c09de05d8e2aadcf475f33bed97481c469aa88ac", "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true } ], "blockHash": "000000000000000000e0846c675bda2ea268eaa290287aef83f8877c40f07743", "blockHeight": 620315, "confirmations": 7640, "blockTime": 1580517507, "value": "187672", "valueIn": "188124", "fees": "452", "hex": "0100000001972f517bcaea60b33dc0d3b9400fe5b4854eca2a58982aa932dbfd387a323655000000006a473044022057e811d95dfce16c7f1d1da574ab4ca1bf883359da34a1e7a380f5045fcffc960220149c357343f0172301f06b914a2844d3755a3e990a236ae33f71afed52f0849d41210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5000000000210270000000000001976a9147222fa3e0a256cc45823a641aa4060e66718276288ac08b60200000000001976a9149800c09de05d8e2aadcf475f33bed97481c469aa88ac00000000" }, { "txid": "5536327a38fddb32a92a98582aca4e85b4e50f40b9d3c03db360eaca7b512f97", "version": 1, "vin": [ { "txid": "feac34105f3f0bd442f75acaff6b2e840b9e2c0e32e897393d9d0fe47fe76ba1", "vout": 1, "n": 0, "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true, "value": "38804", "hex": "483045022100dbbf18561baf7fdb46c21d27801594209f2067f1d7735e245c56001c4e462d3c0220016e052ebbcf350bd64a257f7cc52ef23730fe50b24355d098f87c528fcd839641210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5" }, { "txid": "01b8958ff2a939534269d05af5ac747238eb3a8c91b2a564107af20e4de55680", "n": 1, "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true, "value": "150000", "hex": "47304402202100334789951706405faa9ddc191702b88d9438d5a461d1f008a9bd097bd9b0022062cd93003ad63bfbb16386b90e619c2b32d9caef5229d8943c11309f26b6c19f41210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5" } ], "vout": [ { "value": "188124", "n": 0, "spent": true, "hex": "76a9149800c09de05d8e2aadcf475f33bed97481c469aa88ac", "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true } ], "blockHash": "00000000000000000028351f97cd867acbba39b5a81137ce35a1ac18444aaa76", "blockHeight": 619773, "confirmations": 8182, "blockTime": 1580201823, "value": "188124", "valueIn": "188804", "fees": "680", "hex": "0100000002a16be77fe40f9d3d3997e8320e2c9e0b842e6bffca5af742d40b3f5f1034acfe010000006b483045022100dbbf18561baf7fdb46c21d27801594209f2067f1d7735e245c56001c4e462d3c0220016e052ebbcf350bd64a257f7cc52ef23730fe50b24355d098f87c528fcd839641210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5000000008056e54d0ef27a1064a5b2918c3aeb387274acf55ad069425339a9f28f95b801000000006a47304402202100334789951706405faa9ddc191702b88d9438d5a461d1f008a9bd097bd9b0022062cd93003ad63bfbb16386b90e619c2b32d9caef5229d8943c11309f26b6c19f41210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd50000000001dcde0200000000001976a9149800c09de05d8e2aadcf475f33bed97481c469aa88ac00000000" }, { "txid": "feac34105f3f0bd442f75acaff6b2e840b9e2c0e32e897393d9d0fe47fe76ba1", "version": 1, "vin": [ { "txid": "6f2d6fb46039f192f82cfd9bc85dcf0575fdf5eda9b726643314be883c8c0559", "vout": 1, "n": 0, "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true, "value": "49256", "hex": "47304402207df4bd44f74e9a077b84f547b29c595e808bfb3ebc23e070e975905e2012044c02206fa66e30f9afe063c5a5c30d0bb20c6d0eece782a9b6211676180c25d745e98c41210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5" } ], "vout": [ { "value": "10000", "n": 0, "spent": true, "hex": "76a914045891bcbb214544c47a8dbc75350584d8042bc288ac", "addresses": [ "bitcoincash:qqz93yduhvs523xy02xmcaf4qkzdspptcgq4dscr8c" ], "isAddress": true }, { "value": "38804", "n": 1, "spent": true, "hex": "76a9149800c09de05d8e2aadcf475f33bed97481c469aa88ac", "addresses": [ "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25" ], "isAddress": true } ], "blockHash": "0000000000000000015997ed69ac8b1e1d19c006bca7fb08faf3442890b2fed5", "blockHeight": 619764, "confirmations": 8191, "blockTime": 1580198433, "value": "48804", "valueIn": "49256", "fees": "452", "hex": "010000000159058c3c88be14336426b7a9edf5fd7505cf5dc89bfd2cf892f13960b46f2d6f010000006a47304402207df4bd44f74e9a077b84f547b29c595e808bfb3ebc23e070e975905e2012044c02206fa66e30f9afe063c5a5c30d0bb20c6d0eece782a9b6211676180c25d745e98c41210259dc89eeb4c7b349faab20e932be226a1ed7d582f25b64e9abf84f73e1d25fd5000000000210270000000000001976a914045891bcbb214544c47a8dbc75350584d8042bc288ac94970000000000001976a9149800c09de05d8e2aadcf475f33bed97481c469aa88ac00000000" } ], "usedTokens": 71, "tokens": [ { "type": "XPUBAddress", "name": "bitcoincash:qzvqpsyaupwcu24dear47va7m96gr3rf4g9gcq4h25", "path": "m/44'/145'/0'/0/0", "transfers": 11, "decimals": 8, "balance": "177672", "totalReceived": "850002", "totalSent": "672330" } ] } `); } return {error: "Not implemented"}; } }
import React from 'react' import { graphql, StaticQuery, Link } from 'gatsby' import { Grid, Row, Col } from 'react-flexbox-grid'; import Img from 'gatsby-image' import styled from 'styled-components' import FontFace from '../utils/font-face' import HeaderWrapper from '../components/headerWrapper' import HeaderContainer from '../components/headerContainer' import Nav from '../components/nav' import NavMobile from '../components/navMobile' import media from "styled-media-query"; import CanvasBackground from '../components/CanvasBackground' const HeaderImg = styled(Img) ` min-height: 100vh; ` const HeadingOne = styled.h1 ` font-size: 4.5rem; color: #FFF; font-weight: 100; display: flex; margin-top: 5rem; text-align: center; justify-content: center; ${media.lessThan("large")` font-size: 4rem; margin-top: 3.5rem; `} ${media.lessThan("medium")` font-size: 2.65rem; `} ` const HeadingTwo = styled.h2 ` font-size: 3rem; color: #FFF; font-weight: 100; font-family: GillSansMTPro; display: flex; line-height: 1.5; text-align: center; justify-content: center; ${media.lessThan("medium")` font-size: 1.8rem; text-align: center; `} ` const HeadingTextContainer = styled.div ` flex: 1 1 100%; justify-content: center; margin: 0 auto; margin-top: 10rem; ${media.lessThan("large")` flex: 1 1 100%; margin: 0 auto; margin-top: 7.5rem; `} ` const Slide = styled.div ` height: 100vh; overflow: hidden; display: flex; flex-direction: row; -webkit-box-align: center; align-items: center; ` const SlideImg = styled(Img) ` height: 100%; width: 100%; object-fit: cover; ` const Url = styled(Link) ` text-decoration: none; ` const Logo = styled( Img ) ` margin: 0 auto; width: 40rem; ${media.lessThan("large")` width: 25rem; `} ` const HoldingIndexPage = (props) => { return ( <div> <FontFace /> <CanvasBackground /> <Slide> {/* <SlideImg style={{ position: "absolute", left: 0, top: 0, width: "100%", zIndex: -1, }} fluid={props.data.homeHeroImg.childImageSharp.fluid} /> */} <HeaderContainer> <HeadingTextContainer> <Logo fluid={props.data.logo.childImageSharp.fluid} /> <HeadingOne>New website launching soon...</HeadingOne> {/* <HeadingTwo>For now, click around and explore our new colours</HeadingTwo> */} </HeadingTextContainer> </HeaderContainer> {/* <HeaderContainer> <HeadingTextContainer> <HeadingOne>Lanyon</HeadingOne> <HeadingTwo>Helping businesses achieve their potential through strategic communications, reputation management and stakeholder engagement</HeadingTwo> </HeadingTextContainer> </HeaderContainer> */} </Slide> </div> ) } export default HoldingIndexPage export const query = graphql` query { homeHeroImg: file(relativePath: { eq: "LanyonBelfast.jpg" }) { childImageSharp { fluid(maxWidth: 2500) { ...GatsbyImageSharpFluid } } } logo: file(relativePath: { eq: "LanyonBrand19White.png" }) { childImageSharp { fluid(maxWidth: 500) { ...GatsbyImageSharpFluid } } } } `
import './theme/lumo/vaadin-date-time-picker.js'; export * from './src/vaadin-date-time-picker.js';
module.exports = require('../impls/$spliterate/spliterate.js').spliterate;
/* * @Author: Pure <305737824@qq.com> * @CreateTime: 2022-04-07 17:01:09 * @LastEditors: Pure <305737824@qq.com> * @LastEditTime: 2022-04-08 10:49:45 * @Description: 0014-Longest_Common_Prefix 最长公共前缀 */ /** * @param {string[]} strs * @return {string} * 解题思路: * 1.将字符串数组按长短排序,获取最短字符串 * 2.遍历最短字符串,比较每个字符串的每个字符是否相同,相同则继续,不同则结束 * 3.返回最长公共前缀 * */ const longestCommonPrefix = function(strs) { if(strs.length===0) { return ''; } strs.sort((a,b)=>a.length-b.length); let shortest = strs[0]; let i = 0; while(i<shortest.length) { let char = shortest[i]; for(let j=1;j<strs.length;++j) { if(strs[j][i]!==char) { return shortest.slice(0,i); } } i++; } return shortest; };
import _ from 'underscore'; import cloneDeep from 'lodash/cloneDeep'; /** * Returns the metadata of the state with the new empty field. If the field does * not exist, returns the original metadata. Does not mutate the given state. * @param {Object} state * @param {String} namePrefix * @return {Object} metadata */ export const addField = (state, namePrefix) => { let tmpState = cloneDeep(state); let field = eval(`tmpState.${namePrefix}`); if (field === undefined) return tmpState.metadata; if (_.isArray(field)) field.push(''); else field['New field ' + state.new_field_count] = ''; return tmpState.metadata; }; /** * Returns the metadata of the state with the removed key. If the field does not * exist, returns the original metadata. Does not mutate the given state. * @param {Object} state * @param {String} namePrefix * @param {String} key * @return {Object} metadata */ export const removeField = (state, namePrefix, key) => { let tmpState = cloneDeep(state); let field = eval(`tmpState.${namePrefix}`); if (field === undefined) return tmpState.metadata; if (_.isArray(field)) { if (key >= field.length) { return tmpState.metadata; } field.splice(key, 1); } else { if (!_.has(field, key)) { return tmpState.metadata; } delete field[key]; } return tmpState.metadata; }; /** * Returns the metadata of the state with the updated key. If the field does not * exist or the key already exists, returns the original metadata. Does not * mutate the given state. * @param {Object} state * @param {String} namePrefix * @param {String} fieldKey * @param {String} newKey * @return {Object} metadata */ export const updateFieldKey = (state, namePrefix, fieldKey, newKey) => { let tmpState = cloneDeep(state); let field = eval(`tmpState.${namePrefix}`); if (field === undefined) return tmpState.metadata; if (_.has(field, newKey)) return tmpState.metadata; field = Object.keys(field) .reduce((result, current) => { if (current == fieldKey) result[newKey] = field[current]; else result[current] = field[current]; return result; }, {}); eval(`tmpState.${namePrefix} = field`); return tmpState.metadata; }; /** * Returns the metadata of the state with the updated value of given path(nameAttr). * If the field does not exist, creates a new field. Does not mutate the given state. * @param {Object} state * @param {String} nameAttr * @param {String} value * @return {Object} metadata */ export const updateFieldValue = (state, nameAttr, value) => { let tmpState = cloneDeep(state); eval(`tmpState.${nameAttr} = value`); return tmpState.metadata; }; /** * Returns the metadata of the state with the converted type of given path(nameAttr). * If the field does not exist, returns the original metadata. * Does not mutate the given state. * @param {Object} state * @param {String} nameAttr * @param {String} convertType * @return {Object} metadata */ export const convertField = (state, nameAttr, convertType) => { let tmpState = cloneDeep(state); let field = eval(`tmpState.${nameAttr}`); if (field === undefined) return tmpState.metadata; if (convertType == 'array') field = ['']; else if (convertType == 'object') { let key = 'New field ' + state.new_field_count; field = { [key]: '' }; } else field = ''; eval(`tmpState.${nameAttr} = field`); return tmpState.metadata; }; /** * Returns the metadata of the state with the sorted array. Moves the array item to * target index, shifts the rest of them. If the given path is not an array, * returns the original metadata. Does not mutate the given state. * @param {Object} state * @param {String} namePrefix * @param {Number} srcInd * @param {Number} targetInd * @return {Object} metadata */ export const moveArrayItem = (state, namePrefix, srcInd, targetInd) => { let tmpState = cloneDeep(state); let arr = eval(`tmpState.${namePrefix}`); if (!_.isArray(arr)) return tmpState.metadata; arr.splice(targetInd, 0, arr.splice(srcInd, 1)[0]); return tmpState.metadata; };
/** * ---------------------------------------------------------------- * Copyright © Backbase B.V. * ---------------------------------------------------------------- * Author : Backbase R&D - Amsterdam - New York * Filename : main.spec.js * Description: * ---------------------------------------------------------------- */ var main = require('../../scripts/main'); require('angular-mocks'); var sampleMock = require('./sample.mock'); var ngModule = window.module; var ngInject = window.inject; /*----------------------------------------------------------------*/ /* Module testing /*----------------------------------------------------------------*/ describe('Module test ', function() { var sampleProvider; /*----------------------------------------------------------------*/ /* Mock modules/Providers /*----------------------------------------------------------------*/ beforeEach(ngModule(main.name, function(lpSampleProvider) { sampleProvider = lpSampleProvider; })); /*----------------------------------------------------------------*/ /* Main Module /*----------------------------------------------------------------*/ describe('Module', function() { it('should be an object', function() { expect(main).toBeObject(); }); it('should contain a provider', ngInject(function() { expect(sampleProvider).toBeObject(); })); it('should contain a provider service', ngInject(function(lpSample) { expect(lpSample).toBeObject(); })); it('should contain a utils constant', ngInject(function(lpSampleUtils) { expect(lpSampleUtils).toBeDefined(); })); }); });
// 对Date的扩展,将 Date 转化为指定格式的String // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) // 例子: // (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 // (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 Date.prototype.format = function (fmt) { var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; }; /** * String.format * //两种调用方式 * var template1="我是{0},今年{1}了"; * var template2="我是{name},今年{age}了"; * var result1=template1.format("loogn",22); * var result2=template2.format({name:"loogn",age:22}); */ String.prototype.format = function (args) { var result = this; if (arguments.length <= 0) { return result; } if (arguments.length == 1 && Array.isArray(args)) { for (var i = 0; i < args.length; i++) { if (args[i] != undefined) { var reg = new RegExp("({)" + i + "(})", "g"); result = result.replace(reg, args[i]); } } } else if (arguments.length == 1 && typeof (args) == "object") { // 支持属性多层嵌套替换 const getValueByPath = (obj, path) => { const arr = path.split('.') const len = arr.length - 1 return arr.reduce((cur, key, index) => { if (index === len) { return cur[key] || '' } return cur[key] || '' }, obj) } for (var key in args) { if (args[key] != undefined) { var reg = new RegExp("({" + key + "})", "g"); result = result.replace(reg, args[key]); } } } else { for (var i = 0; i < arguments.length; i++) { if (arguments[i] != undefined) { var reg = new RegExp("({)" + i + "(})", "g"); result = result.replace(reg, arguments[i]); } } } return result; } /** * ReplaceAll的实现 * @param {String} search 搜索字符 * @param {String} target 替换字符 */ String.prototype.replaceAll = function (search, target) { return this.replace(new RegExp(search, "gm"), target); } /** * 数组查找索引 */ Array.prototype.getIndex = function (val, field) { if (field) { return this.findIndex((obj) => { if (obj[field] == val) { return obj; } }) } else { return this.indexOf(val); } }; /** * 删除元素 */ Array.prototype.remove = function (val, field) { var index = this.getIndex(val, field); if (index > -1) { this.splice(index, 1); } }; // WeChat Emoji Datas const emojis = [{ "index": 2002, "key": "Smirk", "cn": "[奸笑]", "en": "[Smirk]", "image": "2_02.png" }, { "index": 2004, "key": "Hey", "cn": "[嘿哈]", "en": "[Hey]", "image": "2_04.png" }, { "index": 2005, "key": "Facepalm", "cn": "[捂脸]", "en": "[Facepalm]", "image": "2_05.png" }, { "index": 2006, "key": "Smart", "cn": "[机智]", "en": "[Smart]", "image": "2_06.png" }, { "index": 2007, "key": "Tea", "cn": "[茶]", "en": "[Tea]", "image": "2_07.png" }, { "index": 2009, "key": "Packet", "cn": "[红包]", "en": "[Packet]", "image": "2_09.png" }, { "index": 2010, "key": "Candle", "cn": "[蜡烛]", "en": "[Candle]", "image": "2_10.png" }, { "index": 2011, "key": "Yeah!", "cn": "[耶]", "en": "[Yeah!]", "image": "2_11.png" }, { "index": 2018, "key": "Concerned", "cn": "[皱眉]", "en": "[Concerned]", "image": "2_12.png" }, { "index": 2013, "key": "Blush", "cn": "[囧]", "en": "[Blush]", "image": "smiley_17b.png" }, { "index": 2014, "key": "Salute", "cn": "[抱拳]", "en": "[Salute]", "image": "smiley_17b.png" }, { "index": 2015, "key": "Chick", "cn": "[鸡]", "en": "[Chick]", "image": "2_14.png" }, { "index": 2016, "key": "Blessing", "cn": "[福]", "en": "[Blessing]", "image": "2_15.png" }, { "index": 2017, "key": "Bye", "cn": "[再见]", "en": "[Bye]", "image": "smiley_39b.png" }, { "index": 2019, "key": "Rich", "cn": "[發]", "en": "[Rich]", "image": "2_16.png" }, { "index": 2020, "key": "Pup", "cn": "[小狗]", "en": "[Pup]", "image": "2_17.png" }, { "index": 2021, "key": "Onlooker", "cn": "[吃瓜]", "en": "[Onlooker]", "image": "Watermelon.png" }, { "index": 2022, "key": "GoForIt", "cn": "[加油]", "en": "[GoForIt]", "image": "Addoil.png" }, { "index": 2023, "key": "Sweats", "cn": "[汗]", "en": "[Sweats]", "image": "Sweat.png" }, { "index": 2025, "key": "OMG", "cn": "[天啊]", "en": "[OMG]", "image": "Shocked!.png" }, { "index": 2027, "key": "Emm", "cn": "[Emm]", "en": "[Emm]", "image": "Cold.png" }, { "index": 2028, "key": "Respect", "cn": "[社会社会]", "en": "[Respect]", "image": "Social.png" }, { "index": 2030, "key": "Doge", "cn": "[旺柴]", "en": "[Doge]", "image": "Yellowdog.png" }, { "index": 2034, "key": "NoProb", "cn": "[旺柴]", "en": "[NoProb]", "image": "NoProb.png" }, { "index": 2036, "key": "MyBad", "cn": "[打脸]", "en": "[MyBad]", "image": "Slap.png" }, { "index": 2037, "key": "Wow", "cn": "[哇]", "en": "[Wow]", "image": "Wow!.png" }, { "index": 2038, "key": "KeepFighting", "cn": "[哇]", "en": "[KeepFighting]", "image": "KeepFighting.png" }, { "index": 2043, "key": "Boring", "cn": "[翻白眼]", "en": "[Boring]", "image": "Boring.png" }, { "index": 2044, "key": "666", "cn": "[666]", "en": "[Awesome]", "image": "666.png" }, { "index": 2045, "key": "LetMeSee", "cn": "[让我看看]", "en": "[LetMeSee]", "image": "LetMeSee.png" }, { "index": 2046, "key": "Sigh", "cn": "[叹气]", "en": "[Sigh]", "image": "Sigh.png" }, { "index": 2047, "key": "Hurt", "cn": "[苦涩]", "en": "[Hurt]", "image": "Hurt.png" }, { "index": 2048, "key": "Broken", "cn": "[裂开]", "en": "[Broken]", "image": "Broken.png" }, { "index": 2049, "key": "Flushed", "cn": "[脸红]", "en": "[Flushed]", "image": "Flushed.png" }, { "index": 2050, "key": "Happy", "cn": "[笑脸]", "en": "[Happy]", "image": "Happy.png" }, { "index": 2051, "key": "Lol", "cn": "[破涕为笑]", "en": "[Lol]", "image": "Lol.png" }, { "index": 2052, "key": "Fireworks", "cn": "[烟花]", "en": "[Fireworks]", "image": "Fireworks.png" }, { "index": 2053, "key": "gift", "cn": "[礼物]", "en": "[Gift]", "image": "Gift.png" }, { "index": 2054, "key": "Party", "cn": "[庆祝]", "en": "[Party]", "image": "Party.png" }, { "index": 2055, "key": "Terror", "cn": "[恐惧]", "en": "[Terror]", "image": "Terror.png" }, { "index": 2056, "key": "Duh", "cn": "[恐惧]", "en": "[Duh]", "image": "Duh.png" }, { "index": 2057, "key": "LetDown", "cn": "[失望]", "en": "[Let Down]", "image": "Let Down.png" }, { "index": 2058, "key": "Sick", "cn": "[生病]", "en": "[Sick]", "image": "Sick.png" }, { "index": 2059, "key": "Worship", "cn": "[合十]", "en": "[Worship]", "image": "Worship.png" }]; // 表情转换实现 const emotionMap = {} emojis.forEach((item, index) => { if (item.cn) { emotionMap[item.cn] = item } if (item.en) { emotionMap[item.en] = item } }) /** * 转换微信新表情 * @param {string} content 转换内容 */ const parseEmoji = (content) => { let emojiIndexList = [] for (const k in emotionMap) { let idx = content.indexOf(k) while (idx >= 0) { emojiIndexList.push({ idx, code: k, type: 2 }) idx = content.indexOf(k, idx + k.length) } } emojiIndexList = emojiIndexList.sort((a, b) => { return a.idx - b.idx }) const newContentList = [] let lastTextIndex = 0 emojiIndexList.forEach(item => { if (lastTextIndex !== item.idx) { newContentList.push({ type: 1, content: content.substring(lastTextIndex, item.idx) }) } if (item.type === 2) { newContentList.push({ type: item.type, content: content.substr(item.idx, item.code.length), image: emotionMap[item.code].image }) } else { newContentList.push({ type: item.type, content: item.code, image: item.image }) } lastTextIndex = item.idx + item.code.length }) const lastText = content.substring(lastTextIndex) if (lastText) { newContentList.push({ type: 1, content: lastText }) } return newContentList; } const API = { Utils: {}, // 工具类 Common: {}, // 公共模块 Blogs: {}, // 日志模块 Diaries: {},// 日记模块 Friends: {},// 好友模块 Messages: {},// 说说模块 Boards: {},// 留言模块 Photos: {},// 相册模块 Videos: {},// 视频模块 Shares: {},// 分享模块 Visitors: {}// 访客模块 }; /** * 工具类 */ API.Utils = { /** * 获取URL参数值 * @param {string} name */ getUrlParam(name) { const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); const r = window.location.search.substr(1).match(reg); if (r != null) return decodeURI(r[2]); return null; }, /** * 获取URL参数值 * @param {string} url */ toParams(url) { var reg_url = /^[^\?]+\?([\w\W]+)$/, reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g, arr_url = reg_url.exec(url), ret = {}; if (arr_url && arr_url[1]) { var str_para = arr_url[1], result; while ((result = reg_para.exec(str_para)) != null) { ret[result[1]] = result[2]; } } return ret; }, /** * 通过参数构建URL * @param {string} url * @param {object} params */ toUrl(url, params) { let paramsArr = []; if (params) { Object.keys(params).forEach(item => { paramsArr.push(item + '=' + params[item]); }) if (url.search(/\?/) === -1) { url += '?' + paramsArr.join('&'); } else { url += '&' + paramsArr.join('&'); } } return url; }, /** * 转换时间 * @param {integer} time */ formatDate(time, str) { str = str || 'yyyy-MM-dd hh:mm:ss'; return new Date(time * 1000).format(str); }, /** * Base64解码 * @param {string} str base64字符串 */ base64ToUtf8(str) { return decodeURIComponent(escape(atob(str))); }, /** * 初始化表格 * @param {string} tableId 表格DOM * @param {Array} columns 列配置 * @param {Array} data 表格数据 * @param {Object} options 其他配置 */ initTable(tableId, columns, data, options) { let tableOptions = { undefinedText: '', toggle: tableId, locale: 'zh-CN', height: "700", search: true, searchAlign: 'right', showButtonText: true, pagination: true, pageList: "[10, 20, 50, 100, 200, 500, All]", paginationHAlign: 'left', clickToSelect: true, paginationDetailHAlign: 'right', theadClasses: 'thead-light', showSearchButton: true, toolbar: "#" + tableId + "-toolbar", toolbarAlign: "left", columns: columns || [], data: data || [] }; Object.assign(tableOptions, options); $("#" + tableId).bootstrapTable('destroy').bootstrapTable(tableOptions); $("#" + tableId).bootstrapTable('resetView'); }, /** * 获取超链接 */ getLink(url, title, type) { // 默认HTML超链接 let res = "<a href='{url}' target='_blank'>{title}</a>"; switch (type) { case 'MD': res = '[{title}]({url})'.format(title, url); break; default: break; } return res.format({ url: url, title: title }); }, /** * 获取Markdown的图片内容 * @param {string} url 图片地址 * @param {string} title 图片提示 */ getImagesMarkdown(url, title) { return '![{0}]({1})'.format(title || '', url); }, /** * 获取HTML的图片内容 * @param {string} url 图片地址 */ getImageHTML(url) { return "<img src='{0}' >".format(url); }, /** * Base64编码 * @param {string} str 原始字符串 */ utf8ToBase64(str) { return btoa(unescape(encodeURIComponent(str))); }, /** * Base64解码 * @param {string} str base64字符串 */ base64ToUtf8(str) { return decodeURIComponent(escape(atob(str))); }, /** * 根据年月份分组数据 * @param {array} data 数据集合 * @param {object} timeField 时间字段名 * @param {string} type 分组类型 all/year/month */ groupedByTime(data, timeField, type) { data = data || []; let resMaps = new Map(); for (const item of data) { let time = item[timeField]; if (Array.isArray(timeField) && !time) { for (const field of timeField) { time = item[field]; if (time) { break; } } } let date = null; if (typeof (time) === 'string') { date = new Date(time); } else { date = new Date(time * 1000); } if (!date) { date = new Date('1970-01-01'); } switch (type) { case 'year': let year_items = resMaps.get(date.getFullYear()) || []; year_items.push(item); resMaps.set(date.getFullYear(), year_items); break; case 'month': let month_items = resMaps.get(date.getMonth() + 1) || []; month_items.push(item); resMaps.set(date.getMonth() + 1, month_items); break; case 'day': let day_items = resMaps.get(date.getDate()) || []; day_items.push(item); resMaps.set(date.getDate(), day_items); break; default: let all_month_maps = resMaps.get(date.getFullYear()) || new Map(); let all_month_items = all_month_maps.get(date.getMonth() + 1) || []; all_month_items.push(item); all_month_maps.set(date.getMonth() + 1, all_month_items); resMaps.set(date.getFullYear(), all_month_maps); break; } } return resMaps; } } /** * QQ空间公共模块 */ API.Common = { /** * 获取用户空间地址 */ getUserUrl(uin) { return 'https://user.qzone.qq.com/' + uin; }, /** * 获取用户空间的头像地址 */ getUserLogoUrl(uin) { return "https://qlogo{host}.store.qq.com/qzone/{uin}/{uin}/{size}".format({ host: uin % 4 || 1, uin: uin, size: 100 }); }, /** * 转换HTML特殊字符 */ escHTML(content) { var l = { "&amp;": /&/g, "&lt;": /</g, "&gt;": />/g, "&#039;": /\x27/g, "&quot;": /\x22/g }; for (var i in l) { content = content.replace(l[i], i); } return content; }, /** * 获取分享来源标题 */ getURLTitle(item, index) { return item["url_title_" + index] || ""; }, /** * 转换话题 * @param {string} content 内容 * @param {string} type 转换类型,默认HTML,MD */ formatTopic(content, type) { content = (content || "") + ""; var t = content.split(/(#(?:.|<br\/>)+?#)/g); var o = false; var n = "" , res = ""; for (var a = 0; a < t.length; a++) { tag = t[a]; o = false; n = ""; n = tag.replace(/#((?:.|<br\/>)+?)#/g, function (e, t, n) { o = true; let url = 'http://rc.qzone.qq.com/qzonesoso/?search=' + encodeURIComponent(t); var a = API.Utils.getLink(url, '#{0}#'.format(t)); switch (type) { case 'MD': a = API.Utils.getLink(url, '#{0}#'.format(t), type); break; default: break; } return a }); if (!o) { n = tag; } res += n } return res; }, /** * 转换表情内容 * @param {string} contet 表情内容 * @param {string} type 转换类型,默认TEXT,可选HTML,MD */ formatEmoticon(contet, type) { if (!contet) { return contet; } // 替换无协议的链接 contet = contet.replace(/src=\"\/qzone\/em/g, 'src=\"http://qzonestyle.gtimg.cn/qzone/em'); // 转换emoji表情链接 contet = contet.replace(/\[em\]e(\d+)\[\/em\]/gi, function (emoji, eid) { let url = 'http://qzonestyle.gtimg.cn/qzone/em/e{0}.gif'.format(eid); // 默认返回HMTL格式 let res = "<img src='{0}' >".format(url); switch (type) { case 'MD': res = API.Utils.getImagesMarkdown(url); } return res; }); return contet; }, /** * 转换@内容 * @param {string} contet @内容 * @param {string} type 转换类型,默认TEXT,可选HTML,MD */ formatMention(contet, type) { if (!contet) { return contet; } const format = (item) => { var result = "<a href='https://user.qzone.qq.com/{uin}' target='_blank'>@{name}</a>".format(item); switch (type) { case 'MD': result = '[@{name}](https://user.qzone.qq.com/{uin})'.format(item); break; } return result; } if (typeof contet === 'object') { return format(contet); } // 先处理一遍正常的@的内容 contet = contet.replace(/@\{uin:([^\}]*),nick:([^\}]*?)(?:,who:([^\}]*))?(?:,auto:([^\}]*))?\}/g, function (str, uin, name) { return format({ uin: uin, name: name }); }) // 如果处理后,仍包含uin、nick、who,则表示是特殊情况(即nick存的是内容),再处理一遍 if (contet.indexOf('uin') > -1 && contet.indexOf('nick') > -1 && contet.indexOf('who') > -1) { contet = contet.replace(/\{uin:([^\}]*),nick:([^\}]*?)(?:,who:([^\}]*))\}/g, function (str, uin, name) { return name; }) } return contet; }, /** * 转换内容 * @param {string} contet @内容 * @param {string} type 转换类型,默认TEXT,可选HTML,MD * @param {boolean} isRt 是否是处理转发内容 * @param {boolean} isSupportedHtml 内容本身是否支持HTML */ formatContent(item, type, isRt, isSupportedHtml) { if (typeof item === 'string') { // 转换特殊符号 if (!isSupportedHtml) { item = this.escHTML(item); } // 转换话题 item = this.formatTopic(item, type); // 转换表情 item = this.formatEmoticon(item, type); // 转换@内容 item = this.formatMention(item, type); // 转换微信表情 item = API.Common.formatWxEmoji(item, type); return item; } var conlist = (isRt && item.rt_con && item.rt_con['conlist']) || item.conlist || []; var contents = []; var titleIndex = 0; for (let index = 0; index < conlist.length; index++) { let info = conlist[index]; // 说说内容类型 switch (info.type) { case 0: info.custom_url = "http://user.qzone.qq.com/{uin}".format(info); // 转换特殊符号 info.custom_display = this.escHTML(info.nick); // 转换话题 info.custom_display = this.formatTopic(info.con || info.custom_display, type); // 转换表情 info.custom_display = this.formatEmoticon(info.custom_display, type); // 转换微信表情 info.custom_display = API.Common.formatWxEmoji(info.custom_display, type); // 转换@内容 info.custom_display = this.formatMention({ uin: info.uin, name: info.custom_display }, type); // 添加到内容数组 contents.push(info.custom_display); break; case 1: // 分享来源? titleIndex++; // 获取分享URL info.url = this.escHTML(info.url); // 获取分享提示 info.text = this.getURLTitle(item, titleIndex) || info.url; // 获取Link info.custom_display = API.Utils.getLink(info.url, info.text, type); // 添加到内容数组 contents.push(info.custom_display) break; case 2: // 普通说说内容? if (info.con) { // 转换话题 info.custom_display = this.formatTopic(info.con, type); // 转换表情 info.custom_display = this.formatEmoticon(info.custom_display, type); // 转换微信表情 info.custom_display = API.Common.formatWxEmoji(info.custom_display, type); // 转换@内容 info.custom_display = this.formatMention(info.custom_display, type); // 替换换行符 switch (type) { case 'MD': info.custom_display = info.custom_display.replaceAll('\n', '\r\r\r\n'); break; default: break; } // 添加到内容数组 contents.push(info.custom_display) } break; } } let content = contents.join(""); content = content.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, ""); return content; }, /** * 获取用户空间超链接 * @param {string} uin 目标QQ号 * @param {string} nickName 目标昵称 * @param {string} type 类型 */ getUserLink(uin, nickName, type) { return API.Utils.getLink(this.getUserUrl(uin), nickName, type); }, /** * 获取用户头像超链接 * @param {string} uin 目标QQ号 * @param {string} nickName 目标昵称 * @param {string} type 类型 */ getUserImageLink(uin) { return API.Utils.getImageHTML(API.Common.getUserLogoLocalUrl(uin)); }, /** * 获取唤起QQ聊天地址 * @param {string} uin 目标QQ号 */ getMessageUrl(uin) { return "tencent://message/?uin=" + uin; }, /** * 获取用户空间超链接 * @param {string} uin 目标QQ号 * @param {string} nickName 目标昵称 * @param {string} type 类型 */ getMessageLink(uin, nickName, type) { return API.Utils.getLink(this.getMessageUrl(uin), nickName, type); }, /** * 获取多媒体路径 * @param {string} url 远程URL * @param {string} filepath 本地文件路径 * @param {string} sourceType 来源类型 */ getMediaPath(url, filepath, sourceType) { if (!filepath) { return url; } let res = filepath || url; switch (sourceType) { case 'Messages_HTML': res = '../' + res; break; case 'Photos_HTML': res = '../' + res; break; case 'Videos_HTML': res = '../' + res; break; case 'Friends_HTML': res = '../' + res; break; default: break; } return res; }, /** * 显示赞列表窗口 * @param {Object} dom DOM元素 * @param {Array} dataList 列表 */ showLikeWin(dom, dataList) { const targetId = $(dom).attr('data-target'); if (!targetId) { return; } // 获取指定数据 const itemIndex = dataList.getIndex(targetId, $(dom).attr('data-field')); if (itemIndex == -1) { return; } const item = dataList[itemIndex]; // 渲染列表 const like_html = template(TPL.LIKE_LIST, { items: item.likes || [] }); // 渲染模式窗口 const modal_html = template(TPL.MODAL_WIN, { id: 'like_win', size: '', title: '点赞列表', body: like_html }); // 存在元素直接移除重新创建 const $like_win = $('#like_win'); if ($like_win) { $like_win.modal('hide'); $like_win.remove(); } // 添加HTML到页面 $('body').append(modal_html); // 显示窗口 $('#like_win').modal('show'); }, /** * 显示最近访问窗口 * @param {Object} dom DOM元素 * @param {Array} dataList 列表 */ showVisitorsWin(dom, dataList) { const targetId = $(dom).attr('data-target'); if (!targetId) { return; } // 获取指定数据 const itemIndex = dataList.getIndex(targetId, $(dom).attr('data-field')); if (itemIndex == -1) { return; } const item = dataList[itemIndex]; // 渲染列表 const like_html = template(TPL.VISITOR_LIST, { items: item.custom_visitor && item.custom_visitor.list || [] }); // 渲染模式窗口 const modal_html = template(TPL.MODAL_WIN, { id: 'visitors_win', size: '', title: '最近访问', body: like_html }); // 存在元素直接移除重新创建 const $like_win = $('#visitors_win'); if ($like_win) { $like_win.modal('hide'); $like_win.remove(); } // 添加HTML到页面 $('body').append(modal_html); // 显示窗口 $('#visitors_win').modal('show'); }, /** * 显示评论列表窗口 * @param {Object} dom DOM元素 * @param {Array} dataList 列表 */ showCommentsWin(dom, dataList) { const targetId = $(dom).attr('data-target'); if (!targetId) { return; } // 获取指定数据 const itemIndex = dataList.getIndex(targetId, $(dom).attr('data-field')); if (itemIndex == -1) { return; } const item = dataList[itemIndex]; // 渲染列表 const comments_html = template(TPL.ALBUMS_COMMENTS, { comments: item.comments || [] }); // 渲染模式窗口 const modal_html = template(TPL.MODAL_WIN, { id: 'comments_win', title: '评论列表', size: 'modal-lg', body: comments_html }); // 存在元素直接移除重新创建 const $comments_win = $('#comments_win'); if ($comments_win) { $comments_win.modal('hide'); $comments_win.remove(); } // 添加HTML到页面 $('body').append(modal_html); // 显示窗口 $('#comments_win').modal('show'); }, /** * 获取那年今日的数据 * @param {Array} dataList 数组 * @param {string} field 时间字段 */ getOldYearData(dataList, field) { // 时间分组 // 时间分组 const yearMaps = API.Utils.groupedByTime(dataList, field, 'all'); const date = new Date(); // 当前年份跳过 const currentYear = date.getFullYear(); const currentMonthDay = date.format('-MM-dd'); const _yearMaps = new Map(); if (yearMaps) { // 移除今年数据 yearMaps.delete(currentYear); } for (const [year, yearItemMaps] of yearMaps) { for (const [month, monthItems] of yearItemMaps) { const monthDayItems = []; for (const item of monthItems) { const targetTime = API.Utils.formatDate(item[field]); if (targetTime.indexOf(currentMonthDay) > -1) { monthDayItems.push(item); } } if (monthDayItems.length > 0) { _yearMaps.set(year, monthDayItems); } } } return _yearMaps; }, /** * 获取图片Class乐行 * @param {Object} message 说说 */ getImgClassType(message, isShare) { let medias = isShare ? message.source.images || [] : message.custom_images || []; if (message.custom_magics && message.custom_magics.length > 0) { medias = medias.concat(message.custom_magics || []); } if (message.custom_videos && message.custom_videos.length > 0) { medias = medias.concat(message.custom_videos || []); } if (medias.length == 3) { // 数量为3,小图,放一行 return 'three'; } else if (1 < medias.length && medias.length <= 4) { // 数量为2-4的,大图 return 'two'; } else if (5 <= medias.length) { // 数量大于5的,小图 return 'three'; } return ''; }, /** * 转换微信新表情 */ formatWxEmoji(content, type) { const contentList = parseEmoji(content); const imgRelativePath = 'https://cdn.jsdelivr.net/gh/ShunCai/QZoneExport@dev/src/img/emoji'; const result = []; for (const _content of contentList) { if (_content.type === 1) { result.push(_content.content); } if (_content.type === 2) { let res = "<img src='{0}' >".format(imgRelativePath + "/" + _content.image); switch (type) { case 'MD': res = API.Utils.getImagesMarkdown(url); } result.push(res); } } return result.join(''); } } /** * 日志模块API */ API.Blogs = { getEffectBit(e, t) { if (t < 0 || t > 63) { throw new Error("nBit param error") } if (t < 32) { return (e.effect || e.effect1) & 1 << t } else if (t < 64) { return e.effect2 & 1 << t } }, getBlogLabel(e) { var t = [["8", "审核不通过"], ["22", "审核中"], ["4", "顶"], ["21", "荐"], ["3", "转"], ["28", "转"], ["35", "转"], ["36", "转"]]; var a = ''; for (var o = 0; o < t.length; o++) { var n = t[o][0]; if (n == 22) { continue; } if (API.Blogs.getEffectBit(e, n)) { a += '[{0}]'.format(t[o][1]); break; } } return a; } } /** * 说说模块API */ API.Messages = { /** * 获取地图超链接 * @param {object} lbs 坐标信息 */ getMapUrl(lbs) { if (!lbs) { return '#'; } return 'https://apis.map.qq.com/uri/v1/marker?marker=coord:{pos_y},{pos_x};title:{idname};addr:{name}'.format(lbs); } } /** * 分享模块API */ API.Shares = { /** * 获取类型 */ getDisplayType(innerType) { const Share_Types = { 1: '日志', 2: '相册', 3: "照片", 4: "网页", 5: '视频', 10: '商品', 13: '新闻', 17: '微博', 18: "音乐" } return Share_Types[innerType] || "其它"; } } /** * 访客模块API */ API.Visitors = { /** * 是否访问主页 * @param {Object} item 访客 */ isHome(item) { item.blogs = item.blogs || []; item.photoes = item.photoes || []; item.shuoshuoes = item.shuoshuoes || []; item.shares = item.shares || []; return item.blogs.length === 0 && item.photoes.length === 0 && item.shuoshuoes.length === 0 && item.shares.length === 0; }, /** * 获取访问标题 * @param {Object} item 访客 */ getTitle(item) { item.blogs = item.blogs || []; item.photoes = item.photoes || []; item.shuoshuoes = item.shuoshuoes || []; item.shares = item.shares || []; if (API.Visitors.isHome(item)) { // 主页 return "访问了主页"; } const titles = []; // 说说 if (item.shuoshuoes.length > 0) { titles.push('说说'); } // 日志 if (item.blogs.length > 0) { titles.push('日志'); } // 相册 if (item.photoes.length > 0) { titles.push('相册'); } // 分享 if (item.shares.length > 0) { titles.push('分享'); } return '查看了' + titles.join('、'); } } /** * 视频模块API */ API.Videos = { /** * 是否腾讯视频(判断不严谨,先临时判断) * @param {object} 视频信息 */ isTencentVideo(video) { let url2 = video.url2 || ''; let url3 = video.url3 || ''; if (!url2 || url3.indexOf('.mp4') > -1) { // 如果URL都没有值,或者地址含有.mp4,肯定是空间视频? return false; } if (url3.indexOf('tencentvideo') > -1) { // 该判断不严谨,但是不知道怎么判断的好 return true; } return false; }, /** * 是否外部视频(判断不严谨,先临时判断) * @param {object} 视频信息 */ isExternalVideo(video) { let url3 = video.url3 || ''; const isTencentTV = API.Videos.isTencentVideo(video); if (isTencentTV) { return true; } if (url3.indexOf('.swf') > -1) { // Flash地址肯定是外部视频? return true; } return false; }, /** * 获取视频连接 * @param {object} 视频信息 */ getVideoUrl(video) { // URL3个人相册视频? let url = video.url3 || video.url; if (video.source_type == "share") { // 分享视频连接? url = video.rt_url; } if (API.Videos.isTencentVideo(video)) { // 腾讯视频 if (!video.video_id) { return video.url2; } url = API.Videos.getTencentVideoUrl(video.video_id); } // 其他第三方视频 return url; }, /** * 获取腾讯视频的播放地址 * @param {string} vid 视频ID */ getTencentVideoUrl(vid) { let params = { "origin": "https://user.qzone.qq.com", "vid": vid, "autoplay": true, "volume": 100, "disableplugin": "IframeBottomOpenClientBar", "additionplugin": "IframeUiSearch", "platId": "qzone_feed", "show1080p": true, "isDebugIframe": false } return API.Utils.toUrl('https://v.qq.com/txp/iframe/player.html', params); } } /** * 模板常量 */ const TPL = { /** * 模式窗口 */ MODAL_WIN: ` <div id="<%:=id%>" class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog <%:=size%> modal-dialog-centered modal-dialog-scrollable"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title text-center"><%:=title%></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> <%:=body%> </div> </div> </div> </div> `, /** * 点赞列表 */ LIKE_LIST: ` <div class="list-group"> <%if(items.length === 0 ){%> <p>没人点赞,好伤心哦^_^</p> <%}%> <%for (const item of items) {%> <a href="<%:=API.Common.getUserUrl(item.fuin)%>" target="_blank" class="list-group-item list-group-item-action border rounded"> <div class="d-flex flex-row bd-highlight"> <div class="bd-highlight"> <img class="rounded-circle" src="<%:=API.Common.getUserLogoUrl(item.fuin)%>" alt="" style="height: 50px;width: 50px;"> </div> <div class="flex-fill bd-highlight align-self-center ml-3"> <%:=API.Common.formatContent(item.nick)%> </div> <div class="bd-highlight align-self-center ml-3"> <small> <%if(item.gender){%> <span><%:=item.gender%></span> <%}%> <%if(item.constellation){%> <span><%:=item.constellation%></span> <%}%> <%if(item.addr){%> <span><%:=item.addr%></span> <%}%> </small> </div> </div> </a> <%}%> </div> `, /** * 最近访问 */ VISITOR_LIST: ` <div class="list-group"> <%if(items.length === 0 ){%> <p>没人查看,好伤心哦^_^</p> <%}%> <%for (const item of items) {%> <a href="<%:=API.Common.getUserUrl(item.uin)%>" target="_blank" class="list-group-item list-group-item-action border rounded"> <div class="d-flex flex-row bd-highlight"> <div class="bd-highlight"> <img class="rounded-circle" src="<%:=API.Common.getUserLogoUrl(item.uin)%>" alt="" style="height: 50px;width: 50px;"> </div> <div class="flex-fill bd-highlight align-self-center ml-3"> <%:=API.Common.formatContent(item.name)%> </div> <div class="bd-highlight align-self-center ml-3"> <small> <span><%:=API.Utils.formatDate(item.time)%></span> </small> </div> </div> </a> <%}%> </div> `, /** * 相册评论模板 */ ALBUMS_COMMENTS: ` <%if(comments.length === 0 ){%> <p>没人评论,好伤心哦^_^</p> <%}%> <%for(const comment of comments){%> <div class="border-bottom comments mt-3"> <div class="container comment"> <a class="me-a avatar p-0 m-0" target="_blank" href="<%:=API.Common.getUserUrl(comment.poster.id)%>"> <img class="lazyload w-100 h-100 border rounded-circle" src="<%:=API.Common.getUserLogoUrl(comment.poster.id)%>" > </a> <div class="ml-5"> <div class="container"> <a class="author"> <a target="_blank" href="<%:=API.Common.getUserUrl(comment.poster.id)%>"> <span><%:=API.Common.formatContent(comment.poster.name)%></span> </a> <%if(comment.private){%> <span class="text-info"> 私密评论 </span> <%}%> <br> <span class="text-muted small"><%:=API.Utils.formatDate(comment.postTime)%></span> </a> </div> <div class="messageText container"> <p><%:=API.Common.formatContent(comment.content)%></p> <%if(comment.pic){%> <%for(let image of comment.pic){%> <img src="<%:=(image.custom_filepath || image.custom_url || image.o_url || image.hd_url || image.b_url || image.s_url || image.url)%>" class="comment-img img-thumbnail"> <%}%> <%}%> </div> <%if(comment.replies){%> <%for(const reply of comment.replies){%> <div class="comments"> <div class="container comment p-0"> <a class="me-a avatar p-0 m-0 " target="_blank" href="<%:=API.Common.getUserUrl(reply.poster.id)%>"> <img class="lazyload w-100 h-100 border rounded-circle" src="<%:=API.Common.getUserLogoUrl(reply.poster.id)%>"> </a> <div class="ml-5"> <div class="container"> <a class="author"> <a target="_blank" href="<%:=API.Common.getUserUrl(reply.poster.id)%>"> <span class="text-info"><%:=API.Common.formatContent(reply.poster.name)%></span> </a> <%if(reply.private){%> <span class="text-info"> 私密回复 </span> <%}%> <br> <span class="text-muted small"><%:=API.Utils.formatDate(reply.postTime)%></span> </a> </div> <div class="messageText container"> <p><%:=API.Common.formatContent(reply.content)%></p> <%if(reply.pic){%> <%for(let image of reply.pic){%> <img src="<%:=(image.custom_filepath || image.custom_url || image.o_url || image.hd_url || image.b_url || image.s_url || image.url)%>" class="comment-img img-thumbnail"> <%}%> <%}%> </div> </div> </div> </div> <%}%> <%}%> </div> </div> </div> <%}%> ` }
import Vue from 'vue'; import qs from 'qs'; import store from '../../store'; let getDecodingsQIP; let _decodingsCache; export default { /* service methods ------------------------------------------------------- */ /** * Gets a list of sessions from the server * @param {object} query Parameters to query the server * @returns {Promise} Promise A promise object that signals the completion * or rejection of the request. */ get: function (query) { return new Promise((resolve, reject) => { let params = { flatten: 1 }; if (query) { if (query.length) { params.length = query.length; } if (query.start) { params.start = query.start; } if (query.facets) { params.facets = query.facets; } if (query.expression) { params.expression = query.expression; } if (query.view) { params.view = query.view; } if (query.bounding) { params.bounding = query.bounding; } if (query.interval) { params.interval = query.interval; } // always send stopTime and startTime unless date is all time (-1) if (parseInt(query.date, 10) === -1) { params.date = query.date; } else { params.startTime = query.startTime; params.stopTime = query.stopTime; } // add sort to params params.order = store.state.sortsParam; // server takes one param (fields) if (query.fields && query.fields.length) { params.fields = ''; for (let i = 0, len = query.fields.length; i < len; ++i) { const item = query.fields[i]; params.fields += item; if (i < len - 1) { params.fields += ','; } } } } // set whether map is open on the sessions page if (localStorage.getItem('sessions-open-map') === 'true') { params.map = true; } let options = { url: 'sessions.json', method: 'GET', params: params }; Vue.axios(options) .then((response) => { if (response.data.bsqErr) { reject(response.data.bsqErr); } resolve(response); }, (error) => { reject(error); }); }); }, /** * Gets details about the session * @param {string} id The unique id of the session * @param {string} node The node that the session belongs to * @returns {Promise} Promise A promise object that signals the completion * or rejection of the request. */ getDetail: function (id, node) { return new Promise((resolve, reject) => { Vue.axios.get(`${node}/session/${id}/detail`) .then((response) => { resolve(response); }, (error) => { reject(error); }); }); }, /** * Gets session packets * @param {string} id The unique id of the session * @param {string} node The node that the session belongs to * @param {Object} params The params to send with the request * @returns {Object} { promise, source } An object including a promise object * that signals the completion or rejection of the request and a source object * to allow the request to be cancelled */ getPackets: function (id, node, params) { let source = Vue.axios.CancelToken.source(); let promise = new Promise((resolve, reject) => { let options = { method: 'GET', params: params, cancelToken: source.token, url: `${node}/session/${id}/packets` }; Vue.axios(options) .then((response) => { resolve(response.data); }) .catch((error) => { if (!Vue.axios.isCancel(error)) { reject(error); } }); }); return { promise, source }; }, /** * Gets other decodings for session pcap data * @returns {Promise} Promise A promise object that signals the completion * or rejection of the request. */ getDecodings: function () { if (getDecodingsQIP) { return getDecodingsQIP; } getDecodingsQIP = new Promise((resolve, reject) => { if (_decodingsCache) { resolve(_decodingsCache); } Vue.axios.get('decodings') .then((response) => { getDecodingsQIP = undefined; _decodingsCache = response.data; resolve(response.data); }, (error) => { getDecodingsQIP = undefined; reject(error); }); }); return getDecodingsQIP; }, /** * Adds or Removes tags from sessions * @param {Boolean} addTags Whether to add tags (otherwise remove) * @param {object} params The parameters to be added to the url * @param {object} routeParams The current url route parameters * @returns {Promise} Promise A promise object that signals the completion * or rejection of the request. */ tag: function (addTags, params, routeParams) { return new Promise((resolve, reject) => { let url = addTags ? 'addTags' : 'removeTags'; let options = this.getReqOptions(url, 'POST', params, routeParams); if (options.error) { return reject({text: options.error}); } // add sort to params options.params.order = store.state.sortsParam; // add tags to data instead of url params options.data.tags = params.tags; delete options.params.tags; Vue.axios(options) .then((response) => { resolve(response); }, (error) => { reject(error); }); }); }, /** * Removes PCAP and/or SPI data * @param {object} params The parameters to be passed to server * @param {object} routeParams The current url route parameters * @returns {Promise} Promise A promise object that signals the completion * or rejection of the request. */ remove: function (params, routeParams) { return new Promise((resolve, reject) => { let options = this.getReqOptions('delete', 'POST', params, routeParams); if (options.error) { return reject({text: options.error}); } // add sort to params options.params.order = store.state.sortsParam; Vue.axios(options) .then((response) => { resolve(response); }) .catch((error) => { reject(error); }); }); }, /** * Sends a session to a cluster * @param {object} params The parameters to be passed to server * @param {object} routeParams The current url route parameters * @returns {Promise} Promise A promise object that signals the completion * or rejection of the request. */ send: function (params, routeParams) { return new Promise((resolve, reject) => { let options = this.getReqOptions('sendSessions', 'POST', params, routeParams); if (options.error) { return reject({text: options.error}); }; // add sort to params options.params.order = store.state.sortsParam; // add tags and cluster to data instead of url params options.data.tags = params.tags; options.data.cluster = params.cluster; delete options.params.tags; delete options.params.cluster; Vue.axios(options) .then((response) => { resolve(response); }) .catch((error) => { reject(error); }); }); }, /** * Exports a pcap by setting window.location * @param {object} params The parameters to be passed to server * @param {object} routeParams The current url route parameters */ exportPcap: function (params, routeParams) { return new Promise((resolve, reject) => { let baseUrl = `sessions.pcap/${params.filename}`; // save segments for later because getReqOptions deletes it let segments = params.segments; delete params.filename; // don't need this anymore let options = this.getReqOptions(baseUrl, '', params, routeParams); if (options.error) { return reject({text: options.error}); }; // add missing params options.params.segments = segments; if (options.data.ids) { options.params.ids = options.data.ids; } // add sort to params options.params.order = store.state.sortsParam; let url = `${baseUrl}?${qs.stringify(options.params)}`; window.location = url; return resolve({text: 'PCAP now exporting'}); }); }, /** * Exports a csv by setting window.location * @param {object} params The parameters to be passed to server * @param {object} routeParams The current url route parameters */ exportCsv: function (params, routeParams) { return new Promise((resolve, reject) => { let baseUrl = `sessions.csv/${params.filename}`; // save segments for later because getReqOptions deletes it let segments = params.segments; delete params.filename; // don't need this anymore let options = this.getReqOptions(baseUrl, '', params, routeParams); if (options.error) { return reject({text: options.error}); }; // add missing params options.params.segments = segments; if (options.data.ids) { options.params.ids = options.data.ids; } // add sort to params options.params.order = store.state.sortsParam; let url = `${baseUrl}?${qs.stringify(options.params)}`; window.location = url; return resolve({text: 'CSV Exported'}); }); }, /** * Open a new page to view unique values for multiple fields * @param {object} params The parameters to be passed to server * @param {object} routeParams The current url route parameters */ viewIntersection: function (params, routeParams) { let clonedParams = JSON.parse(JSON.stringify(routeParams)); params.date = clonedParams.date; params.view = clonedParams.view; params.stopTime = clonedParams.stopTime; params.startTime = clonedParams.startTime; params.expression = clonedParams.expression; let url = `multiunique.txt?${qs.stringify(params)}`; window.open(url, '_blank'); }, /** * Open a new page to view unique values for different fields * @param {string} exp The field to get unique values for * @param {number} counts 1 or 0 whether to include counts of the values * @param {object} routeParams The current url route parameters */ exportUniqueValues: function (exp, counts, routeParams) { let clonedParams = JSON.parse(JSON.stringify(routeParams)); let params = { exp: exp, counts: counts, view: clonedParams.view, date: clonedParams.date, stopTime: clonedParams.stopTime, startTime: clonedParams.startTime, expression: clonedParams.expression }; let url = `unique.txt?${qs.stringify(params)}`; window.open(url, '_blank'); }, /** * Open a new page to view spi graph data * @param {string} dbField The field to display spi graph data for * @param {object} routeParams The current url route parameters */ openSpiGraph: function (dbField, routeParams) { let clonedParams = JSON.parse(JSON.stringify(routeParams)); clonedParams.field = dbField; let url = `spigraph?${qs.stringify(clonedParams)}`; window.open(url, '_blank'); }, /* internal methods ------------------------------------------------------ */ /** * Get Request Options * @param {string} baseUrl The base url to append params to * @param {string} method The HTTP method (POST, GET, PUT, DELETE, etc) * @param {object} params The parameters to be applied to url or data * @param {object} routeParams The current url route parameters * @returns { url: {string}, method: {string}, data: {object} } */ getReqOptions: function (baseUrl, method, params, routeParams) { let error; // keep track of any errors // add segments to data instead of url parameters let data = { segments: params.segments }; // merge params and routeParams params = Object.assign(params, routeParams); if (!params.applyTo || params.applyTo === 'open') { // specific sessions that have been opened data.ids = []; for (let i = 0, len = params.sessions.length; i < len; ++i) { data.ids.push(params.sessions[i].id); } if (data.ids.length > 0) { delete params.expression; } data.ids = data.ids.join(','); if (!data.ids) { error = 'There are no matching sessions open.'; } } else if (params.applyTo === 'visible') { // all sessions visible on the sessions page params.length = params.numVisible; } else if (params.applyTo === 'matching') { // all sessions in query results params.start = 0; params.length = params.numMatching; } // remove unnecessary url route params delete params.applyTo; delete params.segments; delete params.sessions; delete params.numVisible; delete params.numMatching; return { data: data, url: baseUrl, error: error, method: method, params: params }; } };
$(function(){ var $range=$('#range'), $age=$('#age'); $age.html($range.val()); $range.change(function(){ $age.html($range.val()); }) })
'use strict'; // Create the 'chat' controller angular.module('chat').controller('ChatController', ['$scope', '$location', 'Authentication', 'Socket', '$http', 'FeedService', function ($scope, $location, Authentication, Socket, $http, Feed) { // Create a messages array $scope.messages = []; /* RSS Feed Links - Needs to go to DB schema */ /*$scope.RSSfeeds = [ { title:'Top Stories', content:'http://rss.cnn.com/rss/cnn_topstories.rss' }, { title:'World', content:'http://rss.cnn.com/rss/cnn_world.rss' }, { title:'US', content:'http://rss.cnn.com/rss/cnn_us.rss' }, { title:'Business', content:'http://rss.cnn.com/rss/money_latest.rss' }, { title:'Politics', content:'http://rss.cnn.com/rss/cnn_allpolitics.rss' }, { title:'Technology', content:'http://rss.cnn.com/rss/cnn_tech.rss' }, { title:'Health', content:'http://rss.cnn.com/rss/cnn_health.rss' }, { title:'Entertainment', content:'http://rss.cnn.com/rss/cnn_showbiz.rss' }, { title:'Travel', content:'http://rss.cnn.com/rss/cnn_travel.rss' }, { title:'Living', content:'http://rss.cnn.com/rss/cnn_living.rss' }, ];*/ // initialize view $scope.init = function (){ $http.get('api/content').success(function (response) { $scope.RSSfeeds = response[0].rss; $scope.loadFeed($scope.RSSfeeds[0].content, null, 'Select Feed'); }).error(function (response) { // If error on chapter fetch, do not allow signup until resolved $location.path('/server-error'); }); }; $scope.init(); $scope.feedDefault='Select Feed'; $scope.loadFeed=function(feed, e, custom){ $scope.feedSrc = feed; Feed.parseFeed(feed).then(function(res){ // In case they enter an invalid url if (res.data.responseStatus !== 200){ $scope.feeds = []; $scope.error = 'Sorry, this link is not working'; $scope.feedDefault='Select Feed'; } // If they entered a valid url if (res.data.responseStatus === 200){ if (e){ $scope.feedDefault=angular.element(e.target).text(); } if (custom){ $scope.feedDefault = custom; } else{ $scope.feedDefault=angular.element(e.target).text(); } $scope.feeds=res.data.responseData.feed.entries; $scope.error = ''; } }); }; // If user is not signed in then redirect back home if (!Authentication.user) { $location.path('/'); } // Make sure the Socket is connected if (!Socket.socket) { Socket.connect(); } // Add an event listener to the 'chatMessage' event Socket.on('chatMessage', function (message) { $scope.messages.unshift(message); }); /* Disabled due to issues with Angular changing the view Socket.on('load:old:messages', function (docs) { for (var i = docs.length - 1; i >= 0; i--) { // Adds messages to local angular Array for posting $scope.messages.push({ username: docs[i].name, text: docs[i].msg, created: docs[i].created, profileImageURL: docs[i].img }); $scope.didLoad = true; console.log('Loaded for the first time:' + $scope.didLoad); //message.username : docs[i].name; //message.text : docs[i].msg; //message.created : docs[i].created; // $scope.messages.push({ // user: docs[i].name, // text: docs[i].msg // }); } });*/ // Get the old chat documents on page load $http.get('api/chat/docs').success(function (response) { for (var i = 0; i < response.length ; i++){ $scope.messages.push({ username: response[i].name, text: response[i].msg, created: response[i].created, profileImageURL: response[i].img }); } }).error(function (response) { //If error on chat fetch, what to do? // push an error message to $scope.messages }); // Create a controller method for sending messages $scope.sendMessage = function () { // Create a new message object var message = { text: this.messageText }; // Emit a 'chatMessage' message event Socket.emit('chatMessage', message); // Clear the message text this.messageText = ''; }; // Remove the event listener when the controller instance is destroyed $scope.$on('$destroy', function () { Socket.removeListener('chatMessage'); }); } ]);
import Vue from 'vue' import VueRouter from 'vue-router' const Home = () => import('../views/home/Home'); const Category = () => import('../views/category/Category'); const Cart = () => import('../views/cart/Cart'); const Profile = () => import('../views/profile/Profile'); Vue.use(VueRouter) const routes = [{ path: '', redirect: '/home' }, { path: '/home', name: 'home', component: Home }, { path: '/category', name: 'category', component: Category }, { path: '/cart', name: 'cart', component: Cart }, { path: '/profile', name: 'profile', component: Profile }, ] const router = new VueRouter({ mode: 'history', base: process.env.BASE_URL, routes }) export default router
import React from 'react'; import { Card, CardImg, CardText, CardBody, CardTitle, Breadcrumb, BreadcrumbItem } from 'reactstrap'; import { Link } from 'react-router-dom'; function RenderDish({dish}) { if (dish != null) return( <Card> <CardImg top src={dish.image} alt={dish.name} /> <CardBody> <CardTitle>{dish.name}</CardTitle> <CardText>{dish.description}</CardText> </CardBody> </Card> ); else return( <div></div> ); } function RenderComments({comments}) { if (comments == null) { return (<div></div>); } const cmnts = comments.map(comment => { return ( <li key={comment.id}> <p>{comment.comment}</p> <p>-- {comment.author}, &nbsp; {new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: '2-digit' }).format(new Date(comment.date))} </p> </li> ); }); return ( <div className='col-12 col-md-5 m-1'> <h4> Comments </h4> <ul className='list-unstyled'> {cmnts} </ul> </div> ); } const DishDetail = (props) => { const dish = props.dish if (dish == null) { return (<div></div>) } const commentItem = <RenderComments comments = {props.dish.comments} /> return ( <div className="container"> <div className="row"> <Breadcrumb> <BreadcrumbItem><Link to="/menu">Menu</Link></BreadcrumbItem> <BreadcrumbItem active>{props.dish.name}</BreadcrumbItem> </Breadcrumb> <div className="col-12"> <h3>{props.dish.name}</h3> <hr /> </div> </div> <div className="row"> <div className="col-12 col-md-5 m-1"> <RenderDish dish={props.dish} /> </div> <RenderComments comments={props.comments} /> </div> </div> ); } export default DishDetail;
import styled from 'styled-components' import { autoCssGenerator } from '../cssHelpers.js'; const _default = autoCssGenerator('tree-checkbox-wrapper'); export default styled.div` ${_default('color')} ${_default('margin-left')} ${_default('margin-bottom')} `
deepmacDetailCallback("0023d9000000/24",[{"d":"2008-10-08","t":"add","a":"9714 10th Ave. N.\nPlymouth MN 55441\n\n","c":"UNITED STATES","o":"Banner Engineering","s":"wireshark.org"},{"d":"2015-08-27","t":"change","a":"9714 10th Ave. N. Plymouth MN US 55441","c":"US","o":"Banner Engineering"}]);
console.log(16**2*8);//2048 console.log(2**16-1);//65535 console.log(0x4E07.toString(10)); //19975 //16 //xxxxxxxxxxxxxxxx //1111111111111111
const Upload = require('../../models/index').Upload; const User = require('../../models/index').User; const Subscription = require('../../models/index').Subscription; const PushEndpoint = require('../../models/index').PushEndpoint; const PushSubscription = require('../../models/index').PushSubscription; const EmailSubscription = require('../../models/index').EmailSubscription; // const { protonmailTransport } = require('../../config/protonmailTransport'); const pushNotificationLib = require('../../lib/mediaPlayer/pushNotification'); const { zohoTransport } = require('../../config/nodemailer'); // can't we just pass the upload, why have to hit the db? async function markUploadAsComplete(uniqueTag, channelUrl, user, res){ upload = await Upload.findOne({ uniqueTag }); upload.status = 'completed'; upload.processingCompletedAt = new Date(); await upload.save(); user.uploads.push(upload._id); await user.save(); return 'success' } async function updateUsersUnreadSubscriptions(user){ const subscriptions = await Subscription.find({ subscribedToUser: user._id, active: true }); for(const subscription of subscriptions){ let subscribingUser = await User.findOne({ _id: subscription.subscribingUser }); if(subscribingUser){ subscribingUser.unseenSubscriptionUploads = subscribingUser.unseenSubscriptionUploads + 1; await subscribingUser.save(); } } }; function runTimeoutFunction(){ (async function(){ await Promise.delay(1000 * 25); let timeoutUpload = await Upload.findOne({uniqueTag}); if(timeoutUpload.status !== 'completed'){ // note the upload is still processing timeoutUpload.status = 'processing'; await timeoutUpload.save(); uploadLogger.info('Still processing after 25s', logObject); // note that we've responded to the user and send them to processing page if(!responseSent){ responseSent = true; res.send({ message: 'ABOUT TO PROCESS', url: `/user/${channelUrl}/${uniqueTag}` }); } } })(); } function userCanUploadContentOfThisRating(maxRatingAllowed, contentRating) { switch (maxRatingAllowed) { case 'SFW': if (contentRating === 'mature' || contentRating === 'sensitive') { return false; } case 'NSFW': if (contentRating === 'sensitive') { return false } case 'SENSITIVE': return true default: return true } } // TODO: need an explanation of this math const bytesToMb = (bytes, decimalPlaces = 4) => { return(bytes / Math.pow(10,6)).toFixed(decimalPlaces); }; const bytesToGb = (bytes, decimalPlaces = 4) => { return(bytes / Math.pow(10,9)).toFixed(decimalPlaces); }; // check if already uploaded based on the title async function checkIfAlreadyUploaded(user, title, logObject, res){ // TODO: File size check const alreadyUploaded = await Upload.findOne({ uploader: user._id, title, visibility: 'public', status: 'completed' }); if(alreadyUploaded){ uploadLogger.info('Upload title already uploaded', logObject); res.status(500); res.send({message: 'ALREADY-UPLOADED'}); return true; } return false; } async function updateUsersPushNotifications(user, upload){ // TODO: find all push subscriptions for that user that are active // for all of the users of those push subscription, scroll through and hit their active ____ // find all subs of people who are subbed to the current user const pushSubscriptions = await PushSubscription.find({ subscribedToUser : user._id, active: true }); // loop through all the user's subs for(const sub of pushSubscriptions){ console.log(sub.subscribingUser); let url, icon, image = ''; url = `/user/channelUrl/${upload.uniqueTag}`; const uploadedImage = `/uploads/${user.channelUrl}/${upload.uniqueTag}.jpg`; const pushTitle = `New upload by: ${user.channelUrl}: ${upload.title}` const pushPayload = `url=${url}&$description=${upload.description}&image${uploadedImage}&icon=${uploadedImage}&title=${pushTitle}&description=${upload.description}`; const endpoints = await PushEndpoint.find({ user: sub.subscribingUser, expired: false }) for(const endpoint of endpoints){ pushNotificationLib.sendPushNotification(endpoint.subscription, pushPayload); } } // // console.log(pushSubscriptions); // // console.log('push subscriptions'); // // return // // // // // TODO: push notification functionality // const pushEndpoints = await PushEndpoint.find({ user, expired: false }); // // console.log(pushEndpoints); // // let url, icon, image = ''; // // url = `/user/channelUrl/${upload.uniqueTag}`; // // const uploadedImage = `/uploads/${user.channelUrl}/${upload.uniqueTag}.jpg`; // // const pushTitle = `New upload by: ${user.channelUrl}: ${upload.title}` // // const pushPayload = `url=${url}&$description=${upload.description}&image${uploadedImage}&icon=${uploadedImage}&title=${pushTitle}&description=${upload.description}`; // // for(const endpoint of pushEndpoints){ // console.log(endpoint); // console.log(pushPayload); // pushNotificationLib.sendPushNotification(endpoint.subscription, pushPayload); // } } async function updateUsersEmailNotifications(user, upload, host){ // TODO : have to know what the upload's user's thing // subscribingUser : user who is subscribing // subscribedToUser : user is receiving a subscription // Get list of users who have an email subscription with this user const emailSubscriptionsForUser = await EmailSubscription.find({ // the user whose content was subscribed to subscribedToUser : user._id, // make sure it's active active: true }); // find all the email subscribers for the email subscription console.log("updateUsersEmailNotifications -> emailSubscriptions", emailSubscriptionsForUser) // loop through all the user's subs for(const emailSubscription of emailSubscriptionsForUser){ const subscribingUserId = emailSubscription.subscribingUser; // find the user so you can find their email and send it off to them const userToFindEmail = await User.findOne({ _id : subscribingUserId }) console.log('upload'); console.log(upload); console.log(userToFindEmail); console.log(emailSubscription.subscribingUser); let url, icon, image = ''; url = `/user/channelUrl/${upload.uniqueTag}`; const uploadedImage = `/uploads/${user.channelUrl}/${upload.uniqueTag}.jpg`; // const mailOptions = { // to: userToFindEmail.email, // subject: `New upload by: ${user.channelUrl}: ${upload.title}`, // body: ` // ${user.channelUrl} has uploaded a new ${upload.fileType}: ${upload.title}. // <button>Watch now!</button> // // TODO: what can we all stick in here? // <img src='https://newtube.app/uploads/${user.channelUrl}/${upload.uniqueTag}.jpg' alt='Video preview' width='500' height='600'> // ` // }; const mailOptions = { to: userToFindEmail.email, from: process.env.NODETUBE_NOREPLY_EMAIL_ADDRESS, subject: `New upload by: ${user.channelUrl}: ${upload.title}`, text: `${user.channelUrl} has uploaded a new ${upload.fileType}: ${upload.title}:\n\n Please click on the following link, or paste this into your browser to view the upload:\n\n http://${host}/user/${user.channelUrl}/${upload.uniqueTag}\n\n You are receiving this email because you are subscribed to ${user.channelUrl} on NewTube.app\n` }; console.log(mailOptions); const response = await zohoTransport.sendMail(mailOptions) console.log(response); } } async function alertAdminOfNewUpload(user, upload){ const admins = await User.find({ role : 'admin' }).select('_id'); console.log(admins); let idArray = []; for(const admin of admins){ idArray.push(admin._id); } for(const id of idArray){ const pushEndpoints = await PushEndpoint.find({ user: id, expired: false }); console.log(pushEndpoints); let url, icon, image = ''; url = `/user/channelUrl/${upload.uniqueTag}`; const uploadedImage = `/uploads/${user.channelUrl}/${upload.uniqueTag}.jpg`; const pushTitle = `New upload by: ${user.channelUrl}: ${upload.title}` const pushPayload = `url=${url}&$description=${upload.description}&image${uploadedImage}&icon=${uploadedImage}&title=${pushTitle}&description=${upload.description}`; for(const endpoint of pushEndpoints){ console.log(endpoint); console.log(pushPayload); pushNotificationLib.sendPushNotification(endpoint.subscription, pushPayload, endpoint); } } console.log(idArray) console.log('something 11'); // TODO: push notification functionality const pushEndpoints = await PushEndpoint.find({ user, expired: false }); console.log(pushEndpoints); let url, icon, image = ''; url = `/user/channelUrl/${upload.uniqueTag}`; const uploadedImage = `/uploads/${user.channelUrl}/${upload.uniqueTag}.jpg`; const pushTitle = `New upload by: ${user.channelUrl}: ${upload.title}` const pushPayload = `url=${url}&$description=${upload.description}&image${uploadedImage}&icon=${uploadedImage}&title=${pushTitle}&description=${upload.description}`; for(const endpoint of pushEndpoints){ console.log(endpoint); console.log(pushPayload); pushNotificationLib.sendPushNotification(endpoint.subscription, pushPayload); } } module.exports = { markUploadAsComplete, updateUsersUnreadSubscriptions, runTimeoutFunction, userCanUploadContentOfThisRating, bytesToMb, bytesToGb, updateUsersPushNotifications, updateUsersEmailNotifications, alertAdminOfNewUpload };
/* global angular */ 'use strict'; /** * Main App Module */ let app = angular.module('app', ['search', 'utils', 'ui.bootstrap']) .controller('ALController', function ($scope, $http, $timeout) { //Parameters vars $scope.vm_list = null; $scope.user = null; $scope.loading = false; $scope.loading_extra = false; $scope.current_vm = null; $scope.started = false; $scope.new_vm = false; //DEBUG MODE $scope.debug = false; $scope.showParams = function () { console.log("Scope", $scope) }; //Error handling $scope.error = ''; $scope.success = ''; $scope.add_vm_modal = function () { $scope.new_vm = true; $scope.current_vm = { enabled: true, name: "", num_workers: 1, os_type: "windows", os_variant: "win7", ram: 1024, revert_every: 86400, vcpus: 1, virtual_disk_url: "" }; $scope.error = ''; $scope.success = ''; $scope.error_exist = ""; $("#vm_name_group").removeClass("has-error"); $("#myModal").modal('show'); }; $scope.editVM = function (vm) { $scope.loading_extra = true; $scope.error = ''; $scope.success = ''; $("#vm_name_group").removeClass("has-error"); $scope.error_exist = ""; $http({ method: 'GET', url: "/api/v4/vm/" + vm.name + "/" }) .success(function (data) { $scope.loading_extra = false; $scope.current_vm = data.api_response; $scope.new_vm = false; $("#myModal").modal('show'); }) .error(function (data, status, headers, config) { if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "" || data === null) { return; } if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } scroll(0, 0); }); }; //Save params $scope.save = function () { $scope.loading_extra = true; $scope.error = ''; $scope.success = ''; $http({ method: 'POST', url: "/api/v4/vm/" + $scope.current_vm.name + "/", data: $scope.current_vm }) .success(function () { $scope.loading_extra = false; $("#myModal").modal('hide'); $scope.success = "Virtual Machine " + $scope.current_vm.name + " successfully updated!"; $timeout(function () { $scope.success = ""; $scope.load_data(); }, 2000); }) .error(function (data, status, headers, config) { $scope.loading_extra = false; if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "" || data === null) { return; } if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } scroll(0, 0); }); }; $scope.add = function () { $scope.loading_extra = true; $scope.error = ''; $scope.success = ''; $http({ method: 'PUT', url: "/api/v4/vm/" + $scope.current_vm.name + "/", data: $scope.current_vm }) .success(function () { $scope.loading_extra = false; $("#myModal").modal('hide'); $scope.success = "Virtual Machine " + $scope.current_vm.name + " successfully updated!"; $timeout(function () { $scope.success = ""; $scope.load_data(); }, 2000); }) .error(function (data, status, headers, config) { $scope.loading_extra = false; if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "" || data === null || status === 400) { $("#vm_name_group").addClass("has-error"); $("#vm_name").select(); $scope.error_exist = data.api_error_message; return; } if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } scroll(0, 0); }); }; $scope.del = function () { swal({ title: "Delete Virtual Machine?", text: "You are about to delete the current virtual machine. Are you sure?", type: "warning", showCancelButton: true, confirmButtonColor: "#d9534f", confirmButtonText: "Yes, delete it!", closeOnConfirm: true }, function () { $scope.do_del(); }) }; $scope.do_del = function () { $scope.error = ''; $scope.success = ''; $scope.loading_extra = true; $http({ method: 'DELETE', url: "/api/v4/vm/" + $scope.current_vm.name + "/" }) .success(function () { $scope.loading_extra = false; $("#myModal").modal('hide'); $scope.success = "Virtual Machine '" + $scope.current_vm.name + "' successfully deleted!"; $timeout(function () { $scope.success = ""; $scope.load_data(); }, 2000); }) .error(function (data, status, headers, config) { $scope.loading_extra = false; if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "" || data === null) { return; } if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } scroll(0, 0); }); }; $scope.nonProvisioned = function () { if ($scope.vm_list == null || $scope.service_list == null || !$scope.new_vm) { return []; } let keys = []; for (let i in $scope.vm_list) { keys.push($scope.vm_list[i].name); } let array = []; let found = false; for (let idx in $scope.service_list) { if (!$scope.service_list[idx].enabled) { continue; } for (let k in keys) { if (keys[k] === $scope.service_list[idx].name) { found = true; break; } } if (!found) array.push($scope.service_list[idx]); found = false; } for (let idx_vmname in array) { if ($scope.current_vm.name === array[idx_vmname].name) { found = true; break; } } if (!found && array.length > 0) $scope.current_vm.name = array[0].name; return array; }; //Load params from datastore $scope.start = function () { $scope.load_services(); $scope.load_data(); }; //Pager methods $scope.load_data = function () { $scope.loading_extra = true; $http({ method: 'GET', url: "/api/v4/vm/list/" }) .success(function (data) { $scope.loading_extra = false; $scope.vm_list = data.api_response.items; $scope.started = true; }) .error(function (data, status, headers, config) { $scope.loading_extra = false; if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "" || data === null || status === 400) { $scope.vm_list = []; $scope.total = 0; $scope.filtered = true; $scope.pages = $scope.pagerArray(); $scope.started = true; return; } if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } $scope.started = true; }); }; $scope.load_services = function () { $scope.loading_extra = true; $http({ method: 'GET', url: "/api/v4/service/all/" }) .success(function (data) { $scope.loading_extra = false; $scope.service_list = data.api_response; }) .error(function (data, status, headers, config) { $scope.loading_extra = false; if (status === 401){ window.location = "/login.html?next=" + encodeURIComponent(window.location.pathname + window.location.search); return; } if (data === "" || data === null) { return; } if (data.api_error_message) { $scope.error = data.api_error_message; } else { $scope.error = config.url + " (" + status + ")"; } }); }; });
const dbUtils = require('../util/db') const table_name = 'pages' const MyResume = { async insertMyResume(model) { const result = dbUtils.insertData(table_name, model) return result }, async updateMyResume(id, options) { const result = dbUtils.updateData(table_name, options, id) return result }, async getMyResume() { const _sql = `select * from ${table_name} where type = 'resume'` const result = dbUtils.query(_sql) return result } } module.exports = MyResume
module.exports={A:{A:{"2":"J D F E A oB","33":"B"},B:{"1":"C P H I R K L W a M MB S T N V O aB"},C:{"1":"0 1 2 3 4 5 6 7 8 9 e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB dB HB SB Q KB LB U NB OB PB QB IB GB Z Y TB UB VB WB RB W a M nB MB S T N V O","2":"hB XB G b J D F E A B C P H I R K L c d vB yB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 B C P H I R K L c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB dB HB SB Q KB LB U NB OB PB QB IB GB Z Y TB UB VB WB RB W a M MB S T N V O aB 0B eB fB","2":"G b J D F E A"},E:{"1":"D F E A B C P H jB kB lB ZB X JB pB qB","2":"G b J gB YB iB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 I R K L c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB HB Q KB LB U NB OB PB QB IB GB Z Y","2":"E B C rB sB tB uB X bB wB JB"},G:{"1":"F 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC","2":"YB xB cB zB YC"},H:{"2":"GC"},I:{"1":"M LC MC","2":"XB G HC IC JC KC cB"},J:{"1":"A","2":"D"},K:{"1":"Q","2":"A B C X bB JB"},L:{"1":"O"},M:{"1":"N"},N:{"2":"A","33":"B"},O:{"1":"NC"},P:{"1":"G OC PC QC RC SC ZB TC UC VC"},Q:{"1":"WC"},R:{"1":"XC"},S:{"1":"mB"}},B:2,C:"crypto.getRandomValues()"};
// 图书馆 function Book(isbn,title,author) { this._setIsbn(isbn); this.title=title ||'未给标题'; this.author=author||'未给作者'; } Book.prototype.setIsbn = function (isbn) { if (this._checkIsbn()){ this.isbn=isbn; console.log('success'); }else { throw new Error('isbn有误'); } } Book.prototype.borrow=function () { } Book.prototype._checkIsbn=function (isbn) { return /[0-9]{10}/.test(isbn); } Book.prototype.getTitle=function () { return this.title; } Book.prototype.getAuthor = function () { return this.Author; } var book=new Book('1212121212','三国演义','罗贯中'); book.setIsbn();
describe('manualColumnMove', () => { const id = 'testContainer'; beforeEach(function() { this.$container = $(`<div id="${id}"></div>`).appendTo('body'); }); afterEach(function() { if (this.$container) { destroy(); this.$container.remove(); } }); describe('init', () => { it('should change column order at init', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: [1, 2, 0] }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('A1'); }); }); describe('persistentState', () => { it('should load data from cache after initialization of new Handsontable instance', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: true, persistentState: true }); const dataAt0x2Cell = getDataAtCell(0, 2); const manualColumnMovePlugin = hot.getPlugin('manualColumnMove'); manualColumnMovePlugin.moveColumn(2, 0); manualColumnMovePlugin.persistentStateSave(); hot.destroy(); spec().$container.remove(); spec().$container = $(`<div id="${id}"></div>`).appendTo('body'); handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: true, persistentState: true }); expect(getDataAtCell(0, 0)).toEqual(dataAt0x2Cell); }); it('should work with updateSettings properly', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: true, persistentState: true }); const dataAt0x2Cell = getDataAtCell(0, 2); const manualColumnMovePlugin = hot.getPlugin('manualColumnMove'); manualColumnMovePlugin.moveColumn(2, 0); manualColumnMovePlugin.persistentStateSave(); updateSettings({}); expect(getDataAtCell(0, 0)).toEqual(dataAt0x2Cell); }); }); describe('updateSettings', () => { it('should be enabled after specifying it in updateSettings config', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true }); updateSettings({ manualColumnMove: true }); spec().$container.find('thead tr:eq(0) th:eq(0)').simulate('mousedown'); spec().$container.find('thead tr:eq(0) th:eq(0)').simulate('mouseup'); expect(spec().$container.hasClass('after-selection--columns')).toBeGreaterThan(0); }); it('should change the default column order with updateSettings', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: true }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); updateSettings({ manualColumnMove: [2, 1, 0] }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('A1'); }); it('should change column order with updateSettings', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: [1, 2, 0] }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('A1'); updateSettings({ manualColumnMove: [2, 1, 0] }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('A1'); }); it('should update columnsMapper when updateSettings change numbers of columns', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: true }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); hot.getPlugin('manualColumnMove').moveColumn(2, 0); updateSettings({ columns: [ {data: 2}, {data: 0}, {data: 1}, ] }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('A1'); }); it('should reset column order with updateSettings when undefined is passed', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), manualColumnMove: [1, 2, 0] }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('A1'); updateSettings({ manualColumnMove: void 0 }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); }); }); describe('loadData', () => { it('should increase numbers of columns if it is necessary', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(5, 5), manualColumnMove: true }); hot.loadData(Handsontable.helper.createSpreadsheetData(10, 10)); expect(countRows()).toEqual(10); expect(hot.getPlugin('manualColumnMove').columnsMapper.__arrayMap.length).toEqual(10); }); it('should decrease numbers of columns if it is necessary', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(5, 5), manualColumnMove: true }); hot.loadData(Handsontable.helper.createSpreadsheetData(2, 2)); expect(countRows()).toEqual(2); expect(hot.getPlugin('manualColumnMove').columnsMapper.__arrayMap.length).toEqual(2); }); }); describe('moving', () => { it('should move column by API', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); hot.getPlugin('manualColumnMove').moveColumn(2, 0); hot.render(); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('B1'); }); it('should move many columns by API', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); hot.getPlugin('manualColumnMove').moveColumns([7, 9, 8], 0); hot.render(); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('H1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('J1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('I1'); }); it('should trigger an beforeColumnMove event before column move', () => { const beforeMoveColumnCallback = jasmine.createSpy('beforeMoveColumnCallback'); const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, beforeColumnMove: beforeMoveColumnCallback }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); hot.getPlugin('manualColumnMove').moveColumns([8, 9, 7], 0); hot.render(); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('I1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('J1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('H1'); expect(beforeMoveColumnCallback).toHaveBeenCalledWith([8, 9, 7], 0, void 0, void 0, void 0, void 0); }); it('should trigger an afterColumnMove event after column move', () => { const afterMoveColumnCallback = jasmine.createSpy('afterMoveColumnCallback'); spec().$container.height(150); const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, afterColumnMove: afterMoveColumnCallback }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); hot.getPlugin('manualColumnMove').moveColumns([8, 9, 7], 0); hot.render(); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('I1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('J1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('H1'); expect(afterMoveColumnCallback).toHaveBeenCalledWith([8, 9, 7], 0, void 0, void 0, void 0, void 0); }); it('should move the second column to the first column', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); const $rowsHeaders = spec().$container.find('.ht_clone_top tr th'); $rowsHeaders.eq(1).simulate('mousedown'); $rowsHeaders.eq(1).simulate('mouseup'); $rowsHeaders.eq(1).simulate('mousedown'); $rowsHeaders.eq(0).simulate('mouseover'); $rowsHeaders.eq(0).simulate('mousemove'); $rowsHeaders.eq(0).simulate('mouseup'); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); }); it('should move the second row to the third row', () => { handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true }); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('B1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('C1'); const $rowsHeaders = spec().$container.find('.ht_clone_top tr th'); $rowsHeaders.eq(1).simulate('mousedown'); $rowsHeaders.eq(1).simulate('mouseup'); $rowsHeaders.eq(1).simulate('mousedown'); $rowsHeaders.eq(3).simulate('mouseover'); $rowsHeaders.eq(3).simulate('mousemove'); $rowsHeaders.eq(3).simulate('mouseup'); expect(spec().$container.find('tbody tr:eq(0) td:eq(0)').text()).toEqual('A1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(1)').text()).toEqual('C1'); expect(spec().$container.find('tbody tr:eq(0) td:eq(2)').text()).toEqual('B1'); }); it('should properly scrolling viewport if mouse is over part-visible cell', (done) => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 20), colHeaders: true, rowHeaders: true, manualColumnMove: true, width: 600, height: 600, colWidths: 47 }); hot.selectCell(0, 19); setTimeout(() => { expect(hot.view.wt.wtTable.getFirstVisibleColumn()).toBeGreaterThan(8); const $rowsHeaders = spec().$container.find('.ht_clone_top tr th'); $rowsHeaders.eq(2).simulate('mousedown'); $rowsHeaders.eq(2).simulate('mouseup'); $rowsHeaders.eq(2).simulate('mousedown'); $rowsHeaders.eq(1).simulate('mouseover'); $rowsHeaders.eq(1).simulate('mousemove'); $rowsHeaders.eq(1).simulate('mouseup'); }, 50); setTimeout(() => { expect(hot.view.wt.wtTable.getFirstVisibleColumn()).toBeLessThan(9); done(); }, 150); }); it('moving column should keep cell meta created using cells function', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, cells(row, col) { if (row === 1 && col === 0) { this.readOnly = true; } } }); const htCore = getHtCore(); expect(htCore.find('tbody tr:eq(1) td:eq(0)')[0].className.indexOf('htDimmed')).toBeGreaterThan(-1); hot.getPlugin('manualColumnMove').moveColumn(0, 3); hot.render(); expect(htCore.find('tbody tr:eq(1) td:eq(2)')[0].className.indexOf('htDimmed')).toBeGreaterThan(-1); }); it('moving column should keep cell meta created using cell array', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, cell: [ {row: 1, col: 0, readOnly: true} ] }); const htCore = getHtCore(); expect(htCore.find('tbody tr:eq(1) td:eq(0)')[0].className.indexOf('htDimmed')).toBeGreaterThan(-1); hot.getPlugin('manualColumnMove').moveColumn(3, 0); hot.render(); expect(htCore.find('tbody tr:eq(1) td:eq(1)')[0].className.indexOf('htDimmed')).toBeGreaterThan(-1); }); }); describe('callbacks', () => { it('should run `beforeColumnMove` and `afterColumnMove` with proper visual `target` parameter', () => { let targetParameterInsideBeforeColumnMoveCallback; let targetParameterInsideAfterColumnMoveCallback; handsontable({ data: Handsontable.helper.createSpreadsheetData(3, 3), colHeaders: true, manualColumnMove: true, beforeColumnMove: (columns, target) => { targetParameterInsideBeforeColumnMoveCallback = target; }, afterColumnMove: (columns, target) => { targetParameterInsideAfterColumnMoveCallback = target; } }); spec().$container.find('thead tr:eq(0) th:eq(0)').simulate('mouseup'); spec().$container.find('thead tr:eq(0) th:eq(0)').simulate('mousedown'); spec().$container.find('thead tr:eq(0) th:eq(0)').simulate('mousedown'); spec().$container.find('thead tr:eq(0) th:eq(2)').simulate('mouseover'); spec().$container.find('thead tr:eq(0) th:eq(2)').simulate('mousemove'); spec().$container.find('thead tr:eq(0) th:eq(2)').simulate('mouseup'); expect(targetParameterInsideBeforeColumnMoveCallback).toEqual(2); expect(targetParameterInsideAfterColumnMoveCallback).toEqual(2); }); it('should run `beforeColumnMove` and `afterColumnMove` with proper visual `columns` parameter', () => { let columnsParameterInsideBeforeColumnMoveCallback; let columnsParameterInsideAfterColumnMoveCallback; const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, beforeColumnMove: (columns) => { columnsParameterInsideBeforeColumnMoveCallback = columns; }, afterColumnMove: (columns) => { columnsParameterInsideAfterColumnMoveCallback = columns; } }); hot.getPlugin('manualColumnMove').moveColumn(2, 0); expect(columnsParameterInsideBeforeColumnMoveCallback).toEqual([2]); expect(columnsParameterInsideAfterColumnMoveCallback).toEqual([2]); expect(columnsParameterInsideBeforeColumnMoveCallback).toEqual(columnsParameterInsideAfterColumnMoveCallback); hot.getPlugin('manualColumnMove').moveColumn(2, 0); expect(columnsParameterInsideBeforeColumnMoveCallback).toEqual([2]); expect(columnsParameterInsideAfterColumnMoveCallback).toEqual([2]); expect(columnsParameterInsideBeforeColumnMoveCallback).toEqual(columnsParameterInsideAfterColumnMoveCallback); }); }); describe('copy-paste', () => { it('should create new columns is are needed', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(5, 5), colHeaders: true, manualColumnMove: true, }); const changesSet = [ [3, 4, 'A1'], [3, 5, 'B1'], [3, 6, 'C1'], [3, 7, 'D1'], ]; // unfortunately couse of security rules, we can't simulate native mechanism (e.g. CTRL+C -> CTRL+V) hot.setDataAtCell(changesSet, void 0, void 0, 'CopyPaste.paste'); expect(hot.countCols()).toEqual(8); }); }); describe('undoRedo', () => { xit('should back changes', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, }); hot.getPlugin('manualColumnMove').moveColumn(1, 4); hot.render(); expect(hot.getDataAtCell(1, 3)).toBe('B2'); hot.undo(); expect(hot.getDataAtCell(1, 3)).toBe('D2'); }); xit('should revert changes', () => { const hot = handsontable({ data: Handsontable.helper.createSpreadsheetData(10, 10), colHeaders: true, manualColumnMove: true, }); hot.getPlugin('manualColumnMove').moveColumn(1, 4); hot.render(); expect(hot.getDataAtCell(1, 3)).toBe('A2'); hot.undo(); expect(hot.getDataAtCell(1, 1)).toBe('A2'); hot.redo(); expect(hot.getDataAtCell(1, 3)).toBe('A2'); }); }); });
const categories = require('express').Router(); const appRoot = require('app-root-path'); const validate = require(appRoot + '/middleware/Validate'); const handleError = require(appRoot + '/middleware/HandleError'); const Category = require(appRoot + '/models/Category'); categories.post('/', async (req, res) => { try { // todo: validation const category = new Category(); const id = await category.add(req.body); res.status(201).send(id); } catch (err) { handleError(err, res); } }) categories.get('/', async (req, res) => { try { const category = new Category(); const list = await category.list(); res.send(list); } catch (err) { handleError(err, res); } }) categories.get('/:id', async (req, res) => { try { // todo: validation const category = new Category(req.params.id); result = await category.get(); res.send(result); } catch (err) { handleError(err, res); } }) categories.put('/:id', async (req, res) => { try { // todo: validation const category = new Category(req.params.id); result = await category.update(req.body); res.send(result); } catch (err) { handleError(err, res); } }) categories.delete('/:id', async (req, res) => { try { // todo: validation const category = new Category(req.params.id); const result = await category.delete(); res.send(result); } catch (err) { handleError(err, res); } }) module.exports = categories;
import React, { useState } from "react"; import { useQuery } from "@apollo/client"; import { Box, makeStyles, FormControl, InputLabel, Select, MenuItem, Checkbox, ListItemText, Button, TextField, } from "@material-ui/core"; import ListSubheader from "@material-ui/core/ListSubheader"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import { Divider } from "@material-ui/core"; import AssignmentOutlinedIcon from "@material-ui/icons/AssignmentOutlined"; import { GET_ONLY_SPECIALTIES, GET_ONLY_SUB_SPECIALTIES, } from "../../data/queries"; function AddNewCompanyPart2({ company, setCompany, servicesData }) { const classes = useStyles(); const [servForm, setServForm] = useState(false); const [specForm, setSpecForm] = useState(""); const [subForm, setSubForm] = useState(""); const [customSpecialty, setCustomSpecialty] = useState(""); const [customSub, setCustomSub] = useState(""); const { data: onlySpecialtiesData } = useQuery(GET_ONLY_SPECIALTIES); const { data: onlySubSpecialtiesData } = useQuery(GET_ONLY_SUB_SPECIALTIES); const toggleServForm = () => { setServForm(!servForm); setSpecForm(""); setSubForm(""); }; const toggleSpecForm = (name) => { setServForm(false); setSpecForm(specForm === name ? "" : name); setSubForm(""); }; const toggleSubForm = (name) => { setServForm(false); setSpecForm(""); setSubForm(subForm === name ? "" : name); }; return ( <Box className={classes.wrapper}> <Box className={classes.serviceInput}> {servForm && ( <FormControl variant="outlined" size="small" onClick={() => setSpecForm("")} style={{ width: "100%" }} > <InputLabel id="services-label" variant="outlined" style={{ backgroundColor: "white", padding: "0 5px" }} > Select Services </InputLabel> <Select labelId="services-label" name="services" multiple value={company.services.map(({ name }) => `${name}`)} onChange={(e) => { setCompany({ ...company, services: e.target.value.map((name) => { const existing = company.services.find( (service) => service.name === name ); return { name, specialties: existing ? existing.specialties : [], }; }), }); }} renderValue={(selected) => `${selected.length} selected`} MenuProps={{ PaperProps: { style: { maxHeight: 600 } } }} > {servicesData?.serviceItems.map(({ name }) => ( <MenuItem key={name} value={name}> <Checkbox checked={company.services.map((s) => s.name).includes(name)} /> <ListItemText primary={name} /> </MenuItem> ))} </Select> </FormControl> )} <Button variant={servForm ? "contained" : undefined} color={servForm ? "primary" : undefined} onClick={toggleServForm} > {servForm ? "Done" : "Add Services"} </Button> </Box> {company.services.map((service) => { return ( <List key={service.name} component="nav" aria-labelledby="nested-list-subheader" subheader={ <ListSubheader component="div" id="nested-list-subheader" className={classes.inputRow} > {specForm !== service.name ? ( //Replace service title with specialty form <Box style={{ display: "flex", alignItems: "center", fontSize: 20, }} > <AssignmentOutlinedIcon style={{ fontSize: 20, color: "#333", marginRight: 8 }} /> {service.name} </Box> ) : ( <Box className={classes.inputRow}> <FormControl variant="outlined" size="small" className={classes.specialtyInput} > <InputLabel id="specialties-label" variant="outlined" style={{ backgroundColor: "white", padding: "0 5px" }} > Select Specialties for {service.name} </InputLabel> <Select labelId="specialties-label" name="specialties" multiple value={company.services .find(({ name }) => name === service.name) .specialties.map(({ name }) => name)} onChange={(e) => { setCompany({ ...company, services: company.services.map((serv) => serv.name === service.name ? { ...serv, specialties: e.target.value.map((name) => { const existing = company.services .map((s) => s) .find((s) => s.name === service.name) .specialties.find( (s) => s.name === name ); return { name, sub_specialties: existing?.sub_specialties || [], }; }), } : serv ), }); }} renderValue={(selected) => `${selected.length} selected` } MenuProps={{ PaperProps: { style: { maxHeight: 600 } }, }} > {onlySpecialtiesData?.onlySpecialties.map( ({ name }) => ( <MenuItem key={name} value={name}> <Checkbox checked={company.services .find(({ name }) => name === service.name) .specialties.map((s) => s.name) .includes(name)} /> <ListItemText primary={name} /> </MenuItem> ) )} </Select> </FormControl> <form className={classes.specialtyInput} style={{ marginTop: 8 }} onSubmit={(e) => { e.preventDefault(); console.log(e.target.customSpecialty.value); setCompany({ ...company, services: company.services.map((serv) => serv.name === service.name ? { ...serv, specialties: [ ...serv.specialties, { name: e.target.customSpecialty.value, sub_specialties: [], }, ], } : serv ), }); setCustomSpecialty(""); }} > <TextField name="customSpecialty" variant="outlined" size="small" style={{ width: "100%" }} label="Enter Custom Specialty" value={customSpecialty} onChange={(e) => setCustomSpecialty(e.target.value)} /> </form> </Box> )} <Button onClick={() => toggleSpecForm(service.name)} variant={specForm === service.name ? "contained" : undefined} color={specForm === service.name ? "primary" : undefined} > {specForm === service.name ? "Done" : "Add Specialty"} </Button> </ListSubheader> } className={classes.root} > {service.specialties.length > 0 && service.specialties.map((spec) => { return ( <React.Fragment key={spec.name}> <ListItem button onClick={() => setSubForm(spec.name + service.name)} // toggle open specialty to see subs > {subForm === spec.name + service.name ? ( // Sub specialty input <Box className={classes.inputRow}> <FormControl variant="outlined" size="small" className={classes.specialtyInput} > <InputLabel id="sub-specialties-label" variant="outlined" style={{ backgroundColor: "white", padding: "0 5px", }} > Select Sub-specialties for {spec.name} </InputLabel> <Select labelId="sub-specialties-label" name="sub-specialties" multiple value={company.services .find(({ name }) => name === service.name) .specialties.map((s) => s) .find((s) => s.name === spec.name) .sub_specialties.map(({ name }) => name)} onChange={(e) => { setCompany({ ...company, services: company.services.map((serv) => service.name === serv.name ? { ...serv, specialties: serv.specialties.map( (spe) => spe.name === spec.name ? { ...spe, sub_specialties: e.target.value.map( (name) => ({ name }) ), } : spe ), } : serv ), }); }} renderValue={(selected) => `${selected.length} selected` } MenuProps={{ PaperProps: { style: { maxHeight: 600 } }, }} > {onlySubSpecialtiesData?.onlySubSpecialties.map( ({ name }) => ( <MenuItem key={name} value={name}> <Checkbox checked={company.services .map((s) => s) .find( ({ name }) => service.name === name ) .specialties.map((s) => s) .find(({ name }) => name === spec.name) .sub_specialties.map((s) => s.name) .includes(name)} /> <ListItemText primary={name} /> </MenuItem> ) )} </Select> </FormControl> <form className={classes.specialtyInput} onSubmit={(e) => { e.preventDefault(); setCompany({ ...company, services: company.services.map((serv) => serv.name === service.name ? { ...serv, specialties: serv.specialties.map( (spe) => spe.name === spec.name ? { ...spe, sub_specialties: [ ...spe.sub_specialties, { name: customSub, }, ], } : spe ), } : serv ), }); setCustomSub(""); }} > <TextField name="customSub" variant="outlined" size="small" style={{ width: "100%" }} label="Enter Custom Sub-specialty" value={customSub} onChange={(e) => setCustomSub(e.target.value)} /> </form> </Box> ) : ( <ListItemText primary={spec.name} /> )} {subForm === spec.name + service.name ? ( <Button onClick={(e) => { e.stopPropagation(); toggleSubForm(spec.name + service.name); }} variant="contained" color="primary" > Done </Button> ) : ( <Button onClick={(e) => { e.stopPropagation(); toggleSubForm(spec.name + service.name); }} > Add Sub Specialty </Button> )} </ListItem> {spec.sub_specialties?.length > 0 && spec.sub_specialties.map((sub) => { return ( <List key={sub.name} component="div" disablePadding> <ListItem button className={classes.nested}> <ListItemText primary={sub.name} /> </ListItem> </List> ); })} </React.Fragment> ); })} <Divider /> </List> ); })} </Box> ); } const useStyles = makeStyles((theme) => ({ wrapper: { width: "100%", margin: "0 auto", }, root: { width: "100%", backgroundColor: "#fcfcfc", }, nested: { paddingLeft: theme.spacing(4), }, serviceName: { fontSize: "1.1rem", color: "black", padding: theme.spacing(1, 0), }, subName: { fontSize: "0.7rem", }, serviceInput: { width: "100%", margin: theme.spacing(0, 0, 3, 0), display: "flex", justifyContent: "center", alignItems: "center", }, inputRow: { width: "100%", display: "flex", justifyContent: "space-between", alignItems: "center", }, specialtyInput: { width: "50%", margin: theme.spacing(0, 2, 0, 0), }, })); export default AddNewCompanyPart2;
/* jshint node: true */ "use strict"; var options = require('./options'); var fs = require('fs'); var exists = require('./exists'); var cluster = require('cluster'); var makeserver = require('./makeserver'); function portInUse(port, host, callback) { var server = require('net').createServer(); server.listen(port, host); server.on('error', function () { callback(true); }); server.on('listening', function () { server.close(); callback(false); }); } function error(message) { console.error('Error: ' + message); process.exit(1); } function warn(message) { console.warn('Warning: ' + message); } function runMaster() { function handleExit() { console.log('(TerriaJS-Server exiting.)'); if (fs.existsSync('terriajs.pid')) { fs.unlinkSync('terriajs.pid'); } process.exit(0); } var cpuCount = require('os').cpus().length; // Let's equate non-public, localhost mode with "single-cpu, don't restart". if (options.listenHost === 'localhost') { cpuCount = 1; } console.log('Serving directory "' + options.wwwroot + '" on port ' + options.port + ' to ' + (options.listenHost ? options.listenHost: 'the world') + '.'); require('./controllers/convert')().testGdal(); if (!exists(options.wwwroot)) { warn('"' + options.wwwroot + '" does not exist.'); } else if (!exists(options.wwwroot + '/index.html')) { warn('"' + options.wwwroot + '" is not a TerriaJS wwwroot directory.'); } else if (!exists(options.wwwroot + '/build')) { warn('"' + options.wwwroot + '" has not been built. You should do this:\n\n' + '> cd ' + options.wwwroot + '/..\n' + '> gulp\n'); } if (typeof options.settings.allowProxyFor === 'undefined') { warn('The configuration does not contain a "allowProxyFor" list. The server will proxy _any_ request.'); } process.on('SIGTERM', handleExit); // Listen for dying workers cluster.on('exit', function (worker) { if (!worker.suicide) { // Replace the dead worker if not a startup error like port in use. if (options.listenHost === 'localhost') { console.log('Worker ' + worker.id + ' died. Not replacing it as we\'re running in non-public mode.'); } else { console.log('Worker ' + worker.id + ' died. Replacing it.'); cluster.fork(); } } }); fs.writeFileSync('terriajs.pid', process.pid.toString()); console.log('(TerriaJS-Server running with pid ' + process.pid + ')'); console.log('Launching ' + cpuCount + ' worker processes.'); // Create a worker for each CPU for (var i = 0; i < cpuCount; i += 1) { cluster.fork(); } } function startServer(options) { makeserver(options).listen(options.port, options.listenHost); } if (cluster.isMaster) { // The master process just spins up a few workers and quits. console.log ('TerriaJS Server ' + require('../package.json').version); options.init(); if (fs.existsSync('terriajs.pid')) { warn('TerriaJS-Server seems to already be running.'); } portInUse(options.port, options.listenHost, function (inUse) { if (inUse) { error('Port ' + options.port + ' is in use. Exiting.'); } else { if (options.listenHost !== 'localhost') { runMaster(); } else { // Let's equate non-public, localhost mode with "single-cpu, don't restart". startServer(options); } } }); return; } else { // We're a forked process. options.init(true); startServer(options); }
const mongoose = require('mongoose'); const Schema = mongoose.Schema; let crudPerson = new Schema({ personName: { type: String }, personEmail: { type: String }, personAddress: { type: String }, personNeed: { type: String }, personPhoneNumber: { type: String }, personDate: { type: String, }, personDescription: { type: String, } }); module.exports = mongoose.model('needs_deeds', crudPerson);
const path = require('path'); const webpack = require('webpack'); const srcdir = path.resolve(__dirname, 'src/main/frontend'); const entries = { irma: path.join(srcdir, 'entry/index-with-irma.js'), irmarefresher: path.join(srcdir, 'entry/index-with-irma-refresher.js'), irmaissuer: path.join(srcdir, 'entry/index-with-irma-issuer.js'), irmaissuercorona: path.join(srcdir, 'entry/index-with-irma-issuer-corona.js') }; module.exports = { entry: entries, output: { publicPath: '/static/bundle/', }, resolve: { extensions: ['.js'], modules: [srcdir, 'node_modules'], mainFields: ['browser', 'main', 'module'], } };
const userKey = '_mymoney_user'; const INITIAL_STATE = { user: JSON.parse(localStorage.getItem(userKey)), validToken: false, }; export default (state = INITIAL_STATE, action) => { switch (action.type) { case 'TOKEN_VALIDATED': if (action.payload) { return { ...state, validToken: true }; } localStorage.removeItem(userKey); return { ...state, validToken: false, user: null }; case 'USER_FETCHED': localStorage.setItem(userKey, JSON.stringify(action.payload)); return { ...state, user: action.payload, validToken: true }; default: return state; } };
const fetch = require('node-fetch'); require('dotenv').config(); const baseUrl = process.env.API_BASE_URL const options = { json: true, headers: { 'X-Auth-Token' : process.env.API_KEY } } const getHttpRequest = (async function (path) { try { const response = await fetch(`${baseUrl + path}`,{...options}); return await response.json(); } catch (error) { console.log(error); } }) module.exports = { getHttpRequest};
describe('isVisibleWithinViewport', () => { it('should check if a single element is visible', async function () { (await this.client.isVisibleWithinViewport('.nested')).should.be.true; (await this.client.isVisibleWithinViewport('.notInViewport')).should.be.false }) it.skip('should check multiple elements are not within the current viewport', async function () { const isVisibleWithinViewport = await this.client.isVisibleWithinViewport('.notInViewports') isVisibleWithinViewport.should.be.an.instanceOf(Array) isVisibleWithinViewport.should.have.length(2) isVisibleWithinViewport[0].should.be.equal(false) isVisibleWithinViewport[1].should.be.equal(false) // element is not inside the viewport }) it('should check that element is inside the viewport when it is', async function () { const isVisibleWithinViewport = await this.client.scroll('.notInViewports').isVisibleWithinViewport('.notInViewports') isVisibleWithinViewport.should.be.an.instanceOf(Array) isVisibleWithinViewport.should.have.length(2) isVisibleWithinViewport[0].should.be.equal(false) isVisibleWithinViewport[1].should.be.equal(true) // this element is now within the viewport }) it('should check that elements just outside the viewport are hidden', async function () { const isVisibleWithinViewport = await this.client.scroll(0, 0).isVisibleWithinViewport('.viewportTest') isVisibleWithinViewport.should.be.an.instanceOf(Array) isVisibleWithinViewport.should.have.length(4) isVisibleWithinViewport[0].should.equal(false) isVisibleWithinViewport[1].should.equal(false) isVisibleWithinViewport[2].should.equal(false) isVisibleWithinViewport[3].should.equal(false) }) })
import queryString from 'query-string' const create = async (params, credentials, product) => { try { let response = await fetch('/api/products/by/'+ params.shopId, { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer ' + credentials.t }, body: product }) return response.json() }catch(err) { console.log(err) } } const read = async (params, signal) => { try { let response = await fetch('/api/products/' + params.productId, { method: 'GET', signal: signal }) return response.json() } catch(err) { console.log(err) } } const update = async (params, credentials, product) => { try { let response = await fetch('/api/product/' + params.shopId +'/'+params.productId, { method: 'PUT', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer ' + credentials.t }, body: product }) return response.json() } catch(err) { console.log(err) } } const remove = async (params, credentials) => { try { let response = await fetch('/api/product/' + params.shopId +'/'+params.productId, { method: 'DELETE', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Bearer ' + credentials.t } }) return response.json() } catch(err) { console.log(err) } } const listByShop = async (params, signal) => { try { let response = await fetch('/api/products/by/'+params.shopId, { method: 'GET', signal: signal }) return response.json() } catch(err) { console.log(err) } } const listLatest = async (signal) => { try { let response = await fetch('/api/products/latest', { method: 'GET', signal: signal }) return response.json() } catch(err) { console.log(err) } } const listRelated = async (params, signal) => { try { let response = await fetch('/api/products/related/'+params.productId, { method: 'GET', signal: signal }) return response.json() }catch(err) { console.log(err) } } const listCategories = async (signal) => { try { let response = await fetch('/api/products/categories', { method: 'GET', signal: signal }) return response.json() } catch(err) { console.log(err) } } const list = async (params, signal) => { const query = queryString.stringify(params) try { let response = await fetch('/api/products?'+query, { method: 'GET', }) return response.json() }catch(err) { console.log(err) } } export { create, read, update, remove, listByShop, listLatest, listRelated, listCategories, list }
/* eslint-disable max-len */ /* * Package Import */ import React from 'react'; import PropTypes from 'prop-types'; /* * Local Import */ import * as S from './style'; /* * Component */ const Result = ({ language, score, totalQuestions }) => { // Props const otherLanguage = language === 'HTML' ? 'css' : 'html'; /* * View */ if (score < 4) { return ( <S.Container> <S.Score> Ton score : {score}/{totalQuestions} </S.Score> <S.Title> Bravo, tu as fait tes premiers pas avec le {language} ! </S.Title> <S.Text> Tu as obtenu{' '} <S.Bold> {score}/{totalQuestions} </S.Bold>{' '} bonnes réponses. Bon OK, c’est pas un score tonitruant mais c’ est normal, c’est le métier qui rentre. Ça mérite encore un peu d ’entrainement sur le {language} avant de passer à la suite. On continue ? <S.ButtonList> <S.Button to={`/initiation/${language.toLowerCase()}`}> Refaire le {language} </S.Button> </S.ButtonList> </S.Text> </S.Container> ); } return ( <S.Container> <S.Score> Ton score : {score}/{totalQuestions} </S.Score> <S.Title>Pas mal du tout !</S.Title> <S.Text> Tu as obtenu{' '} <S.Bold> {score}/{totalQuestions} </S.Bold>{' '} bonnes réponses, bravo. Les bases du {language} n’ont plus beaucoup de secrets pour toi. Tu es peut-être fait pour devenir dev ! On continue ? <S.ButtonList> <S.Button to={`/initiation/${language.toLowerCase()}`}> Refaire le {language} </S.Button> <S.Button to={`/initiation/${otherLanguage.toLowerCase()}`}> On passe au {otherLanguage} </S.Button> </S.ButtonList> </S.Text> </S.Container> ); }; /* * PropTypes */ Result.propTypes = { score: PropTypes.number.isRequired, totalQuestions: PropTypes.number.isRequired, language: PropTypes.string.isRequired, }; /* * Export */ export default Result;
const nodemailer = require('nodemailer'); const { user, host, pass, port } = require('../config/mailer'); const transport = nodemailer.createTransport({ host, port, auth: { user, pass } }); module.exports = transport;
/* eslint-disable react/prop-types */ import React from 'react'; import { storiesOf } from '@storybook/react'; import moment from 'moment'; import styled from 'styled-components'; import data from '../constants/sampleRMEpisodes'; import DataTable from '../../../src/index'; const SampleStyle = styled.div` padding: 16px; display: block; width: 100%; p { font-size: 16px; font-weight: 700; word-break: break-all; } `; // eslint-disable-next-line const SampleExpandedComponent = ({ data }) => ( <SampleStyle> <p> {data.summary} </p> <img height="75%" width="75%" alt={data.image.original} src={data.image.original} /> </SampleStyle> ); const columns = [ { name: 'Name', selector: 'name', sortable: true, }, { name: 'Season', selector: 'season', sortable: true, right: true, }, { name: 'Air Date', selector: 'airstamp', sortable: true, format: d => moment(d.airstamp).format('ll'), }, { name: 'Image', selector: 'image.medium', cell: d => <img height="32x" width="64px" alt={d.image.medium} src={d.image.medium} />, }, ]; const Expandable = () => ( <DataTable title="Rick & Morty Episodes" columns={columns} data={data} expandableRows highlightOnHover defaultSortField="name" expandableRowsComponent={<SampleExpandedComponent />} /> ); storiesOf('Expandable Rows', module) .add('Custom Expanded Component', Expandable);
import EmberRouter from '@ember/routing/router'; import config from './config/environment'; const Router = EmberRouter.extend({ location: config.locationType, rootURL: config.rootURL }); Router.map(() => { });
const Mam = require('./mam.node.js'); const iota = require('./iotaSetup.js'); const Cert = require('./cert.js'); const tools = require('./tools.js'); const now = require('moment'); const debug = process.env.DEBUG || 0; const localStore = require('./localStore.js'); const AccountStore = localStore.Account; const ContactStore = localStore.Contact; const MessageStore = localStore.Message; const path = require('path'); const mainPath = path.dirname(require.main.filename); class mam { /* make the callback function into promise */ constructor(callback) { const self = this; const databaseInitialize = () => { Mam.init(iota); self.accountStore = new AccountStore(path.resolve(mainPath, 'json', 'account.json'), () => { self.contactStore = new ContactStore(path.resolve(mainPath, 'json', 'contact.json'), () => { self.messageStore = new MessageStore(path.resolve(mainPath, 'json', 'message.json'), () => { callback(); }); }); }); }; databaseInitialize(); } async publishMessage(message, params) { const packet = { msg: message }; /* add timestamp */ packet.timestamp = now.utc().unix(); const mamState = await this.getActiveMamState(params); await this.sendMamMsg(packet, params, mamState); this.messageUpdate(packet, params); } async recoverMamMsg(params) { console.log('message recovering'); const { initRoot, sideKey } = this.getRecoveryProps(params); const messages = []; await Mam.fetch(initRoot, 'restricted', sideKey, (trytes) => { const data = JSON.parse(iota.utils.fromTrytes(tryte)); data.fromSelf = true; messages.push(data); /* data wrapped message and other things */ }); const store = this.messageStore.findOnly({ id: params.sender }); store.messages[params.receiver] = [].concat(messages); this.messageStore.update(store); } getRecoveryProps(params) { /* make it restart from first root */ let store = this.contactStore.findOnly({ id: params.sender }); let receiver = store.contacts[params.receiver]; const mamState = deepCopy(receiver.activateMamState); mamState.channel.start = 0; Mam.create(mamState, 'INITIALMESSAGE'); return { initRoot: mamState.channel.next_root, sideKey: mamState.channel.side_key }; } async fetchMessages(uuid) { const recvPriv = this.accountStore.findOnly({ id: uuid }).sk; const roots = await Cert.getBundles(uuid, 'M') .then(async data => await Promise.all(data.map(async item => { try { const message = JSON.parse(item.message); const msg = JSON.parse(tools.decryptUTF(message.msg, recvPriv)); const bundles = await Cert.getBundles(msg.id, 'I'); const sendPub = bundles[0].message.pk; const verified = tools.verify(msg.root, message.sign, sendPub); /* TODO: signature verification */ if (verified) { return { id: msg.id, root: msg.root, sideKey: msg.sideKey, }; } } catch (err) { console.log(err); } })) ); console.log('Fetched roots:', roots); const messages = {}; const contacts = this.contactStore.findOnly({ id: uuid }).contacts; /* TODO: filter messages in contact */ // var contactRoots = roots.filter(msg => msg.id in contacts) const contactRoots = roots; /* fetch from local */ const localmsg = this.messageStore.findOnly({ id: uuid }).messages; // console.log('local:', localmsg) await Promise.all(contactRoots.map(async (tx) => { const id = tx.id; const root = tx.root; const sideKey = tx.sideKey; messages[id] = []; /* fetch from tangle */ await Mam.fetch(root, 'restricted', sideKey, (tryte) => { const data = JSON.parse(iota.utils.fromTrytes(tryte)); data.fromSelf = false; messages[id].push(data); /* data wrapped message and other things */ }); })); Object.keys(localmsg).map((id) => { if (id in messages) { /* sort by timestamp */ messages[id] = combineSortedArray( messages[id], localmsg[id], (i, j) => i.timestamp >= j.timestamp, ); } else { messages[id] = [].concat(localmsg[id]); } }); console.log(messages); return messages; } async sendMamMsg(packet, params, mamState) { console.log('sendMamMsg'); let recvPub = await Cert.getBundles(params.receiver, 'I'); if (recvPub.length !== 1) { console.log('error: Get initial claim failed'); } recvPub = recvPub[0].message.pk; const sendPriv = this.accountStore.findOnly({ id: params.sender }).sk; const msg = JSON.stringify(packet); const trytes = iota.utils.toTrytes(msg); const message = Mam.create(mamState, trytes); this.updateActiveMamState(params, message.state); if (debug) { console.log('Root: ', message.root); console.log('Address: ', message.address); console.log('length: ', message.payload.length); } const tx = await Mam.attach(message.payload, message.address); console.log('sendMamMsg finished'); } addContact(userID, contactorID) { const store = this.contactStore.findOnly({ id: userID }); if (contactorID in store.contacts) { console.log('[ERROR] error adding exist contact'); return; } store.contacts[contactorID] = {}; this.contactStore.update(store); } async initMamClaim(params) { console.log('initMamClaim'); // console.log(params) const receiverBundles = await Cert.getBundles(params.receiver, 'I'); const receiverPublicKey = receiverBundles[0].message.pk; // console.log('recvPub:', receiverPublicKey) const senderPrivateKey = this.accountStore.findOnly({ id: params.sender }).sk; // console.log('sendPriv:', senderPrivatyKey) const state = this.getInitMamState(params); const root = Mam.getRoot(state); const sideKey = state.channel.side_key; // console.log(root) const info = { id: params.sender, root, /* TODO: find proper key length */ sideKey, }; const enc = tools.encrypt(JSON.stringify(info), receiverPublicKey); const packet = { msg: enc, sign: tools.sign(root, senderPrivateKey) }; if (debug) { console.log('id: ', params.sender); console.log('root: ', root); console.log(`len:${JSON.stringify(packet).length}`); } const tx = await Cert.attach(JSON.stringify(packet), params.receiver, 'M', null); } getInitMamState(params) { console.log('getInitMamState'); const store = this.contactStore.findOnly({ id: params.sender }); /* init mam state */ let mamState = Mam.init(iota); mamState = Mam.changeMode(mamState, 'restricted', tools.seedGen(56)); /* update next_root, doesn't care return value */ Mam.create(mamState, 'INITIALMESSAGE'); store.contacts[params.receiver] = { activeMamState: deepCopy(mamState), }; if (debug) { console.log('Store updated: ', store); } this.contactStore.update(store); return deepCopy(mamState); } async getActiveMamState(params) { console.log('getActiveMamState'); let store = this.contactStore.findOnly({ id: params.sender }); // console.log(store) let receiver = store.contacts[params.receiver]; if (!(params.receiver in store.contacts)) { await this.initMamClaim(params); store = this.contactStore.findOnly({ id: params.sender }); receiver = store.contacts[params.receiver]; } return deepCopy(receiver.activeMamState); } updateActiveMamState(params, mamState) { const store = this.contactStore.findOnly({ id: params.sender }); store.contacts[params.receiver].activeMamState = deepCopy(mamState); this.contactStore.update(store); } updateBackupMamState(params, bkState) { const store = this.contactStore.findOnly({ id: params.sender }); store.contacts[params.receiver].backupMamState = deepCopy(bkState); this.contactStore.update(store); } /* temporary workaround */ async createIdentity(packet) { packet = deepCopy(packet); delete packet.sk; await Cert.attach(packet, packet.uuid, 'I'); } accountUpdate(account) { this.accountStore.insert(account); this.contactStore.insert({ id: account.id, contacts: {}, }); this.messageStore.insert({ id: account.id, messages: {}, }); } messageUpdate(packet, params) { const store = this.messageStore.findOnly({ id: params.sender }); packet.fromSelf = true; if (!(params.receiver in store.messages)) { store.messages[params.receiver] = []; } store.messages[params.receiver].push(packet); this.messageStore.update(store); } } function deepCopy(data) { return JSON.parse(JSON.stringify(data)); } function combineSortedArray(arr1, arr2, cmp) { let target = deepCopy(arr1); let idx = 0; for (let i = 0; i < arr2.length; idx++) { if (idx === target.length) { target = target.concat(arr2.slice(i)); break; } if (cmp(target[idx], arr2[i])) { target.splice(idx, 0, arr2[i]); i++; } } return target; } module.exports = mam;
/* istanbul instrument in package npmdoc_grunt_contrib_csslint */ /*jslint bitwise: true, browser: true, maxerr: 8, maxlen: 96, node: true, nomen: true, regexp: true, stupid: true */ (function () { 'use strict'; var local; // run shared js-env code - init-before (function () { // init local local = {}; // init modeJs local.modeJs = (function () { try { return typeof navigator.userAgent === 'string' && typeof document.querySelector('body') === 'object' && typeof XMLHttpRequest.prototype.open === 'function' && 'browser'; } catch (errorCaughtBrowser) { return module.exports && typeof process.versions.node === 'string' && typeof require('http').createServer === 'function' && 'node'; } }()); // init global local.global = local.modeJs === 'browser' ? window : global; switch (local.modeJs) { // re-init local from window.local case 'browser': local = local.global.utility2.objectSetDefault( local.global.utility2_rollup || local.global.local, local.global.utility2 ); break; // re-init local from example.js case 'node': local = (local.global.utility2_rollup || require('utility2')) .requireReadme(); break; } // export local local.global.local = local; }()); // run shared js-env code - function (function () { return; }()); switch (local.modeJs) { // run browser js-env code - function case 'browser': break; // run node js-env code - function case 'node': break; } // run shared js-env code - init-after (function () { return; }()); switch (local.modeJs) { // run browser js-env code - init-after case 'browser': local.testCase_browser_nullCase = local.testCase_browser_nullCase || function ( options, onError ) { /* * this function will test browsers's null-case handling-behavior-behavior */ onError(null, options); }; // run tests local.nop(local.modeTest && document.querySelector('#testRunButton1') && document.querySelector('#testRunButton1').click()); break; // run node js-env code - init-after /* istanbul ignore next */ case 'node': local.testCase_buildApidoc_default = local.testCase_buildApidoc_default || function ( options, onError ) { /* * this function will test buildApidoc's default handling-behavior-behavior */ options = { modulePathList: module.paths }; local.buildApidoc(options, onError); }; local.testCase_buildApp_default = local.testCase_buildApp_default || function ( options, onError ) { /* * this function will test buildApp's default handling-behavior-behavior */ local.testCase_buildReadme_default(options, local.onErrorThrow); local.testCase_buildLib_default(options, local.onErrorThrow); local.testCase_buildTest_default(options, local.onErrorThrow); local.testCase_buildCustomOrg_default(options, local.onErrorThrow); options = []; local.buildApp(options, onError); }; local.testCase_buildCustomOrg_default = local.testCase_buildCustomOrg_default || function (options, onError) { /* * this function will test buildCustomOrg's default handling-behavior */ options = {}; local.buildCustomOrg(options, onError); }; local.testCase_buildLib_default = local.testCase_buildLib_default || function ( options, onError ) { /* * this function will test buildLib's default handling-behavior */ options = {}; local.buildLib(options, onError); }; local.testCase_buildReadme_default = local.testCase_buildReadme_default || function ( options, onError ) { /* * this function will test buildReadme's default handling-behavior-behavior */ options = {}; local.buildReadme(options, onError); }; local.testCase_buildTest_default = local.testCase_buildTest_default || function ( options, onError ) { /* * this function will test buildTest's default handling-behavior */ options = {}; local.buildTest(options, onError); }; local.testCase_webpage_default = local.testCase_webpage_default || function ( options, onError ) { /* * this function will test webpage's default handling-behavior */ options = { modeCoverageMerge: true, url: local.serverLocalHost + '?modeTest=1' }; local.browserTest(options, onError); }; // run test-server local.testRunServer(local); break; } }());
import React from "react"; import SocialLinks from "./SocialLinks"; const Banner = () => ( <div className="row banner"> <div className="banner-text"> <h1 className="responsive-headline">SushiStyle</h1> <h3> <span></span>, <span>RAW discussions with extra Wasabi</span> <span></span> <a className="smoothscroll" href="#about"> {" "} {/* start scrolling */} </a>{" "} {/* and learn more */} <a className="smoothscroll" href="#about"> {" "} BLOG </a>. </h3> <hr /> <SocialLinks /> </div> </div> ); export default Banner;
/* file : ulysses-fragments-client.js MIT License Copyright (c) 2017 Thomas Minier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 'use strict' const { isNull, isUndefined, sample } = require('lodash') const LRU = require('lru-cache') const FragmentsClient = require('ldf-client/lib/triple-pattern-fragments/FragmentsClient') /** * A TPF FragmentsClient which apply the adaptive Ulysses load balancing at triple pattern level. * @author Thomas Minier */ class UlyssesFragmentsClient { /** * Constructor * @param {Model} model - The model associated with the SPARQL query currently evaluated * @param {string[]} servers - Set of replicated TPF servers used to evaluate the query * @param {Selection} selection - Source selection used to process queries * @param {Object} [config={}] - Additional config object used to configure the TPF client */ constructor (model, servers, selection, options) { this._model = model this._selection = selection this._options = options this._clients = new Map() if (options.noCache) { this._cache = { set: function () {}, has: function () { return false }, get: function () { return undefined } } } else { this._cache = new LRU({ max: 100 }) } servers.forEach(url => { this._clients.set(url, new FragmentsClient(url, this._options)) this._clients.get(url)._cache = this._cache }) } /** * Same as classic FragmentsClient#getFragmentByPattern, but done using adaptive Ulysses * @param {Object} pattern - Triple pattern requested * @param {Object} sourcePattern - * @return {AsyncIterator} Iterator that evaluates the triple pattern against a TPF server */ getFragmentByPattern (pattern, sourcePattern = null) { // recompute model, then select the submodel corresponding to the pattern this._model.computeModel() let model = this._model let servers = this._selection.get(pattern) if (!isNull(servers) && !(isUndefined(servers))) { if (servers.length === 0) { return this._clients.get(model.servers[0]).getFragmentByPattern(pattern) } else if (servers.length === 1) { return this._clients.get(servers[0]).getFragmentByPattern(pattern) } model = this._model.subset(servers) } // select random target TPF server according to the cost-model const selectedServer = sample(model.getRNGVector()) return this._clients.get(selectedServer).getFragmentByPattern(pattern) } } module.exports = UlyssesFragmentsClient
/** * Copyright (c) 2014, 2016, Oracle and/or its affiliates. * The Universal Permissive License (UPL), Version 1.0 * as shown at https://oss.oracle.com/licenses/upl/ */ "use strict";var l={};(this?this:window)['DvtBaseMapManager']['_UNPROCESSED_MAPS'][2].push(["world","cities",l]);
function TDb(){} function NDb(){} function kbc(){} function hEc(){} function mEc(){} function tEc(){} function pEc(){} function mbc(b){this.b=b} function VDb(){QDb=new TDb;fC((cC(),bC),43);!!$stats&&$stats(YC(e3d,nld,-1,-1));QDb.Nd();!!$stats&&$stats(YC(e3d,lId,-1,-1))} function jEc(){var b;this.N=(b=$doc.createElement(xwd),b.type=h3d,b);this.N[Skd]=i3d;this.b=new tEc;this.b.d=this;this.J==-1?Bsc(this.N,4096|(this.N.__eventBits||0)):(this.J|=4096)} function sEc(b,c){var d;switch(muc(c.type)){case 1024:if(!b.b){b.c=true;return false}break;case 4096:if(b.c){b.b=true;b.d.N.dispatchEvent((d=$doc.createEvent(Uwd),d.initEvent(rmd,false,true),d));b.b=false;b.c=false}}return true} function SDb(){var b,c,d,e;while(ODb){b=ODb;ODb=ODb.c;!ODb&&(PDb=null);MJb(b.b.b,(e=new eVc,aVc(e,new xBc(a3d)),c=new jEc,tUc(c.N,dld,b3d),aVc(e,c),d=new cxc(c3d),zv(d,new mbc(c),(dN(),dN(),cN)),aVc(e,new xBc(d3d)),aVc(e,d),e))}} var a3d='<b>\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\uFF1A<\/b>',d3d='<br>',j3d='AsyncLoader43',k3d='CwFileUpload$1',m3d='FileUpload',l3d='FileUpload$FileUploadImpl',n3d='FileUpload$FileUploadImplOpera',b3d='cwFileUpload',h3d='file',i3d='gwt-FileUpload',e3d='runCallbacks43',c3d='\u4E0A\u4F20\u6587\u4EF6',f3d='\u4F60\u5FC5\u987B\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6',g3d='\u6587\u4EF6\u4E0A\u4F20\u5B8C\u6BD5\uFF01';_=TDb.prototype=NDb.prototype=new Ar;_.gC=function UDb(){return xbb};_.Nd=function YDb(){SDb()};_.cM={};_=mbc.prototype=kbc.prototype=new Ar;_.gC=function nbc(){return tgb};_.gc=function obc(b){var c;c=this.b.N.value;c.length==0?($wnd.alert(f3d),undefined):($wnd.alert(g3d),undefined)};_.cM={27:1,47:1};_.b=null;_=jEc.prototype=hEc.prototype=new Ru;_.gC=function kEc(){return bjb};_.Cb=function lEc(b){sEc(this.b,b)&&Fv(this,b)};_.cM={14:1,15:1,17:1,18:1,73:1,75:1};_.b=null;_=mEc.prototype=new Ar;_.gC=function oEc(){return ajb};_.cM={};_=tEc.prototype=pEc.prototype=new mEc;_.gC=function uEc(){return _ib};_.cM={};_.b=false;_.c=false;_.d=null;var xbb=I3c(OAd,j3d),tgb=I3c(wEd,k3d),ajb=I3c(wyd,l3d),bjb=I3c(wyd,m3d),_ib=I3c(wyd,n3d);$entry(VDb)();
import defaultInjectSheet from 'react-jss' const managers = new WeakMap() if (process.env.NODE_ENV === 'production') { // eslint-disable-next-line no-console console.error('react-jss-hmr should never be used in production!') } export default function injectSheet(...rest) { const createHoc = defaultInjectSheet.apply(this, rest) return (InnerComponent) => { const Jss = createHoc(InnerComponent) class HotJss extends Jss { componentWillMount() { // Note: this will never be called during hot module replacement, so we can // use it as a place to store away the SheetManager super.componentWillMount() managers.set(Object.getPrototypeOf(this), this.manager) } componentWillReceiveProps(nextProps, nextContext) { super.componentWillReceiveProps(nextProps, nextContext) const prevManager = managers.get(Object.getPrototypeOf(this)) const manager = this.manager if (prevManager !== manager) { // If the manager changed between mounting and updating, it was probably due to hot // module replacement. // In that case, we need to: // 1. Call createState() again because although the constructor called it, RHL // restored the instance’s previous state so now the classes in the SheetsManager // do not match those in this.state // 2. Call this.manage() so that the new SheetsManager will attach the new sheets // 3. Call unmanage() on the old SheetsManager to clean up the old sheets const {theme} = this.state const newState = this.createState({theme}, nextProps) this.manage(newState) this.setState(newState) // the new sheets have been attached now, so we can detach the old ones prevManager.unmanage(theme) } } componentDidUpdate(prevProps, prevState) { const key = Object.getPrototypeOf(this) const prevManager = managers.get(key) const manager = this.manager const isHmrUpdate = prevManager && prevManager !== manager if (isHmrUpdate) { managers.set(key, manager) } if (!isHmrUpdate || prevState.dynamicSheet) { // don't call when we don't have a previous dynamic sheet, otherwise it will throw if we // added a new dynamic sheet via hmr super.componentDidUpdate(prevProps, prevState) } } } return HotJss } }
/* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/license */ CKEDITOR.lang['fr']={"editor":"Éditeur de texte enrichi","editorPanel":"Tableau de bord de l'éditeur de texte enrichi","common":{"editorHelp":"Utilisez le raccourci Alt-0 pour obtenir de l'aide","browseServer":"Parcourir le serveur","url":"URL","protocol":"Protocole","upload":"Télécharger","uploadSubmit":"Envoyer sur le serveur","image":"Image","flash":"Flash","form":"Formulaire","checkbox":"Case à cocher","radio":"Bouton radio","textField":"Champ texte","textarea":"Zone de texte","hiddenField":"Champ invisible","button":"Bouton","select":"Liste déroulante","imageButton":"Bouton avec image","notSet":"<indéfini>","id":"ID","name":"Nom","langDir":"Sens d'écriture","langDirLtr":"Gauche à droite (LTR)","langDirRtl":"Droite à gauche (RTL)","langCode":"Code de langue","longDescr":"URL de description longue","cssClass":"Classes de style","advisoryTitle":"Infobulle","cssStyle":"Style","ok":"OK","cancel":"Annuler","close":"Fermer","preview":"Aperçu","resize":"Redimensionner","generalTab":"Général","advancedTab":"Avancé","validateNumberFailed":"Cette valeur n'est pas un nombre.","confirmNewPage":"Les changements non sauvegardés seront perdus. Êtes-vous sûr de vouloir charger une nouvelle page ?","confirmCancel":"Certaines options ont été modifiées. Êtes-vous sûr de vouloir fermer ?","options":"Options","target":"Cible","targetNew":"Nouvelle fenêtre (_blank)","targetTop":"Fenêtre supérieure (_top)","targetSelf":"Même fenêtre (_self)","targetParent":"Fenêtre parent (_parent)","langDirLTR":"Gauche à droite (LTR)","langDirRTL":"Droite à gauche (RTL)","styles":"Style","cssClasses":"Classes de style","width":"Largeur","height":"Hauteur","align":"Alignement","left":"Gauche","right":"Droite","center":"Centrer","justify":"Justifier","alignLeft":"Aligner à gauche","alignRight":"Aligner à droite","alignCenter":"Aligner au centre","alignTop":"Haut","alignMiddle":"Milieu","alignBottom":"Bas","alignNone":"Aucun","invalidValue":"Valeur invalide.","invalidHeight":"La hauteur doit être un nombre.","invalidWidth":"La largeur doit être un nombre.","invalidLength":"La valeur de \"%1\" doit être un nombre positif avec ou sans unité de mesure (%2).","invalidCssLength":"La valeur spécifiée pour le champ « %1 » doit être un nombre positif avec ou sans unité de mesure CSS valide (px, %, in, cm, mm, em, ex, pt, ou pc).","invalidHtmlLength":"La valeur spécifiée pour le champ « %1 » doit être un nombre positif avec ou sans unité de mesure HTML valide (px ou %).","invalidInlineStyle":"La valeur spécifiée pour le style en ligne doit être composée d'un ou plusieurs couples au format « nom : valeur », séparés par des points-virgules.","cssLengthTooltip":"Entrer un nombre pour une valeur en pixels ou un nombre avec une unité de mesure CSS valide (px, %, in, cm, mm, em, ex, pt, ou pc).","unavailable":"%1<span class=\"cke_accessibility\">, indisponible</span>","keyboard":{"8":"Retour arrière","13":"Entrée","16":"Majuscule","17":"Ctrl","18":"Alt","32":"Espace","35":"Fin","36":"Origine","46":"Supprimer","112":"F1","113":"F2","114":"F3","115":"F4","116":"F5","117":"F6","118":"F7","119":"F8","120":"F9","121":"F10","122":"F11","123":"F12","124":"F13","125":"F14","126":"F15","127":"F16","128":"F17","129":"F18","130":"F19","131":"F20","132":"F21","133":"F22","134":"F23","135":"F24","224":"Commande"},"keyboardShortcut":"Raccourci clavier","optionDefault":"Par défaut"},"about":{"copy":"Copyright &copy; $1. Tous droits réservés.","dlgTitle":"À propos de CKEditor 4","moreInfo":"Pour les informations de licence, veuillez visiter notre site web :"},"basicstyles":{"bold":"Gras","italic":"Italique","strike":"Barré","subscript":"Indice","superscript":"Exposant","underline":"Souligné"},"notification":{"closed":"Notification fermée."},"toolbar":{"toolbarCollapse":"Enrouler la barre d'outils","toolbarExpand":"Dérouler la barre d'outils","toolbarGroups":{"document":"Document","clipboard":"Presse-papier/Défaire","editing":"Édition","forms":"Formulaires","basicstyles":"Styles de base","paragraph":"Paragraphe","links":"Liens","insert":"Insérer","styles":"Styles","colors":"Couleurs","tools":"Outils"},"toolbars":"Barres d'outils de l'éditeur"},"clipboard":{"copy":"Copier","copyError":"Les paramètres de sécurité de votre navigateur n'autorisent pas l'éditeur à exécuter automatiquement l'opération « Copier ». Veuillez utiliser le raccourci clavier à cet effet (Ctrl/Cmd+C).","cut":"Couper","cutError":"Les paramètres de sécurité de votre navigateur n'autorisent pas l'éditeur à exécuter automatiquement l'opération « Couper ». Veuillez utiliser le raccourci clavier à cet effet (Ctrl/Cmd+X).","paste":"Coller","pasteNotification":"Utilisez le raccourci %1 pour coller. Votre navigateur n'accepte pas de coller à l'aide du bouton ou du menu contextuel.","pasteArea":"Coller la zone","pasteMsg":"Collez votre contenu dans la zone de saisie ci-dessous et cliquez OK."},"colorbutton":{"auto":"Automatique","bgColorTitle":"Couleur d'arrière-plan","colors":{"000":"Noir","800000":"Marron","8B4513":"Brun de selle","2F4F4F":"Gris sombre d'ardoise","008080":"Canard","000080":"Bleu marine","4B0082":"Indigo","696969":"Gris foncé","B22222":"Rouge brique","A52A2A":"Brun","DAA520":"Or terni","006400":"Vert foncé","40E0D0":"Turquoise","0000CD":"Bleu royal","800080":"Violet","808080":"Gris","F00":"Rouge","FF8C00":"Orange foncé","FFD700":"Or","008000":"Vert","0FF":"Cyan","00F":"Bleu","EE82EE":"Violet","A9A9A9":"Gris tamisé","FFA07A":"Saumon clair","FFA500":"Orange","FFFF00":"Jaune","00FF00":"Lime","AFEEEE":"Turquoise clair","ADD8E6":"Bleu clair","DDA0DD":"Prune","D3D3D3":"Gris clair","FFF0F5":"Fard lavande","FAEBD7":"Blanc antique","FFFFE0":"Jaune clair","F0FFF0":"Vert rosée","F0FFFF":"Azur","F0F8FF":"Bleu Alice","E6E6FA":"Lavande","FFF":"Blanc","1ABC9C":"Cyan dur","2ECC71":"Émeraude","3498DB":"Bleu brillant","9B59B6":"Améthyste","4E5F70":"Bleu-gris","F1C40F":"Jaune vif","16A085":"Cyan foncé","27AE60":"Émeraude foncée","2980B9":"Bleu dur","8E44AD":"Violet foncé","2C3E50":"Bleu désaturé","F39C12":"Orange","E67E22":"Carotte","E74C3C":"Rouge pâle","ECF0F1":"Argent brillant","95A5A6":"Cyan-gris clair","DDD":"Gris clair","D35400":"Citrouille","C0392B":"Rouge dur","BDC3C7":"Argent","7F8C8D":"Cyan-gris","999":"Gris foncé"},"more":"Plus de couleurs...","panelTitle":"Couleurs","textColorTitle":"Couleur du texte"},"font":{"fontSize":{"label":"Taille","voiceLabel":"Taille de police","panelTitle":"Taille de police"},"label":"Police","panelTitle":"Style de police","voiceLabel":"Police"},"format":{"label":"Format","panelTitle":"Format de paragraphe","tag_address":"Adresse","tag_div":"Division","tag_h1":"Titre 1","tag_h2":"Titre 2","tag_h3":"Titre 3","tag_h4":"Titre 4","tag_h5":"Titre 5","tag_h6":"Titre 6","tag_p":"Normal","tag_pre":"Préformaté"},"indent":{"indent":"Augmenter le retrait","outdent":"Diminuer le retrait"},"fakeobjects":{"anchor":"Ancre","flash":"Animation Flash","hiddenfield":"Champ invisible","iframe":"Cadre de contenu incorporé","unknown":"Objet inconnu"},"link":{"acccessKey":"Touche d'accessibilité","advanced":"Avancé","advisoryContentType":"Type de contenu (indicatif)","advisoryTitle":"Infobulle","anchor":{"toolbar":"Ancre","menu":"Modifier l'ancre","title":"Propriétés de l'ancre","name":"Nom de l'ancre","errorName":"Veuillez entrer le nom de l'ancre.","remove":"Supprimer l'ancre"},"anchorId":"Par ID d'élément","anchorName":"Par nom d'ancre","charset":"Encodage de la ressource liée","cssClasses":"Classes de style","download":"Forcer le téléchargement","displayText":"Afficher le texte","emailAddress":"Adresse électronique","emailBody":"Corps du message","emailSubject":"Sujet du message","id":"ID","info":"Informations sur le lien","langCode":"Code de langue","langDir":"Sens d'écriture","langDirLTR":"Gauche à droite","langDirRTL":"Droite à gauche (RTL)","menu":"Modifier le lien","name":"Nom","noAnchors":"(Aucune ancre disponible dans ce document)","noEmail":"Veuillez entrer l'adresse électronique","noUrl":"Veuillez entrer l'URL du lien","noTel":"Veuillez entrer le numéro de téléphone","other":"<autre>","phoneNumber":"Numéro de téléphone","popupDependent":"Dépendante (Netscape)","popupFeatures":"Caractéristiques de la fenêtre surgissante","popupFullScreen":"Plein écran (IE)","popupLeft":"À gauche","popupLocationBar":"Barre d'adresse","popupMenuBar":"Barre de menu","popupResizable":"Redimensionnable","popupScrollBars":"Barres de défilement","popupStatusBar":"Barre d'état","popupToolbar":"Barre d'outils","popupTop":"En haut","rel":"Relation","selectAnchor":"Sélectionner une ancre","styles":"Style","tabIndex":"Indice de tabulation","target":"Cible","targetFrame":"<cadre>","targetFrameName":"Nom du cadre affecté","targetPopup":"<fenêtre surgissante>","targetPopupName":"Nom de la fenêtre surgissante","title":"Lien","toAnchor":"Ancre","toEmail":"Courriel","toUrl":"URL","toPhone":"Téléphone","toolbar":"Lien","type":"Type de lien","unlink":"Supprimer le lien","upload":"Téléverser"},"list":{"bulletedlist":"Insérer/Supprimer une liste à puces","numberedlist":"Insérer/Supprimer une liste numérotée"},"table":{"border":"Taille de la bordure","caption":"Titre du tableau","cell":{"menu":"Cellule","insertBefore":"Insérer une cellule avant","insertAfter":"Insérer une cellule après","deleteCell":"Supprimer les cellules","merge":"Fusionner les cellules","mergeRight":"Fusionner vers la droite","mergeDown":"Fusionner vers le bas","splitHorizontal":"Scinder la cellule horizontalement","splitVertical":"Scinder la cellule verticalement","title":"Propriétés de la cellule","cellType":"Type de cellule","rowSpan":"Lignes occupées","colSpan":"Colonnes occupées","wordWrap":"Césure","hAlign":"Alignement horizontal","vAlign":"Alignement vertical","alignBaseline":"Ligne de base","bgColor":"Couleur d'arrière-plan","borderColor":"Couleur de bordure","data":"Données","header":"En-tête","yes":"Oui","no":"Non","invalidWidth":"La largeur de la cellule doit être un nombre.","invalidHeight":"La hauteur de la cellule doit être un nombre.","invalidRowSpan":"Le nombre de colonnes occupées doit être un nombre entier.","invalidColSpan":"Le nombre de colonnes occupées doit être un nombre entier.","chooseColor":"Choisir"},"cellPad":"Marge interne des cellules","cellSpace":"Espacement entre les cellules","column":{"menu":"Colonne","insertBefore":"Insérer une colonne avant","insertAfter":"Insérer une colonne après","deleteColumn":"Supprimer les colonnes"},"columns":"Colonnes","deleteTable":"Supprimer le tableau","headers":"En-têtes","headersBoth":"Les deux","headersColumn":"Première colonne","headersNone":"Aucun","headersRow":"Première ligne","heightUnit":"unité de hauteur","invalidBorder":"La taille de la bordure doit être un nombre.","invalidCellPadding":"La marge interne des cellules doit être un nombre positif.","invalidCellSpacing":"L'espacement entre les cellules doit être un nombre positif.","invalidCols":"Le nombre de colonnes doit être supérieur à 0.","invalidHeight":"La hauteur du tableau doit être un nombre.","invalidRows":"Le nombre de lignes doit être supérieur à 0.","invalidWidth":"La largeur du tableau doit être un nombre.","menu":"Propriétés du tableau","row":{"menu":"Ligne","insertBefore":"Insérer une ligne avant","insertAfter":"Insérer une ligne après","deleteRow":"Supprimer les lignes"},"rows":"Lignes","summary":"Résumé (description)","title":"Propriétés du tableau","toolbar":"Tableau","widthPc":"pour cent","widthPx":"pixels","widthUnit":"unité de largeur"},"undo":{"redo":"Rétablir","undo":"Annuler"}};
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. var listenersMap = new WeakMap(); var abortedMap = new WeakMap(); /** * An aborter instance implements AbortSignal interface, can abort HTTP requests. * * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled. * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation * cannot or will not ever be cancelled. * * @example * Abort without timeout * ```ts * await doAsyncWork(AbortSignal.none); * ``` */ var AbortSignal = /** @class */ (function () { function AbortSignal() { /** * onabort event listener. */ this.onabort = null; listenersMap.set(this, []); abortedMap.set(this, false); } Object.defineProperty(AbortSignal.prototype, "aborted", { /** * Status of whether aborted or not. * * @readonly */ get: function () { if (!abortedMap.has(this)) { throw new TypeError("Expected `this` to be an instance of AbortSignal."); } return abortedMap.get(this); }, enumerable: false, configurable: true }); Object.defineProperty(AbortSignal, "none", { /** * Creates a new AbortSignal instance that will never be aborted. * * @readonly */ get: function () { return new AbortSignal(); }, enumerable: false, configurable: true }); /** * Added new "abort" event listener, only support "abort" event. * * @param _type - Only support "abort" event * @param listener - The listener to be added */ AbortSignal.prototype.addEventListener = function ( // tslint:disable-next-line:variable-name _type, listener) { if (!listenersMap.has(this)) { throw new TypeError("Expected `this` to be an instance of AbortSignal."); } var listeners = listenersMap.get(this); listeners.push(listener); }; /** * Remove "abort" event listener, only support "abort" event. * * @param _type - Only support "abort" event * @param listener - The listener to be removed */ AbortSignal.prototype.removeEventListener = function ( // tslint:disable-next-line:variable-name _type, listener) { if (!listenersMap.has(this)) { throw new TypeError("Expected `this` to be an instance of AbortSignal."); } var listeners = listenersMap.get(this); var index = listeners.indexOf(listener); if (index > -1) { listeners.splice(index, 1); } }; /** * Dispatches a synthetic event to the AbortSignal. */ AbortSignal.prototype.dispatchEvent = function (_event) { throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); }; return AbortSignal; }()); export { AbortSignal }; /** * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered. * Will try to trigger abort event for all linked AbortSignal nodes. * * - If there is a timeout, the timer will be cancelled. * - If aborted is true, nothing will happen. * * @internal */ // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters export function abortSignal(signal) { if (signal.aborted) { return; } if (signal.onabort) { signal.onabort.call(signal); } var listeners = listenersMap.get(signal); if (listeners) { listeners.forEach(function (listener) { listener.call(signal, { type: "abort" }); }); } abortedMap.set(signal, true); } //# sourceMappingURL=AbortSignal.js.map
/** * We are using reactDom.browserServer.renderToString and not reactDom.render in order to * allow us to measure the elements from a different components render function. * If you call reactDom.render from another components render function react will crash with the following * error: * Warning: Render methods should be a pure function of props and state; * triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. */ import { renderToString } from "react-dom/server"; const containerStyle = { display: "inline-block", position: "absolute", visibility: "hidden", zIndex: -1 }; /** * Creates the hidden div appended to the document body */ export const createMeasureLayer = debug => { const container = document.createElement("div"); container.setAttribute("id", "measure-layer"); if (!debug) { container.style = containerStyle; } const root = document.querySelector('#root'); root.appendChild(container); return container; }; /** * Destroy the measuring layer. * Should be called when the dynamic list is unmounted. */ export const destroyMeasureLayer = () => { const container = document.querySelector("#measure-layer"); if (container) { container.parentNode.removeChild(container); } }; /** * Measure an element by temporary rendering it. */ const measureElement = (element, debug) => { const container = document.querySelector("#measure-layer") || createMeasureLayer(debug); // Renders the React element into the hidden div container.innerHTML = renderToString(element); // Gets the element size const child = container.querySelector("#item-container"); const height = child.offsetHeight; const width = child.offsetWidth; // Removes the element from the document if (!debug) { container.innerHTML = ""; } return { height, width }; }; export default measureElement;
import Vue from "vue" import App from "./App.vue" document.addEventListener('DOMContentLoaded', () => { new Vue({el: "#app", render: h => h(App)}) })
integration.meta = { 'sectionID' : '127647', 'siteName' : 'What to expect - Desktop - ( UK )', 'platform' : 'desktop' }; integration.testParams = { 'desktop_resolution' : [1260] }; integration.flaggedTests = []; integration.channelHome = []; integration.params = { 'mf_siteId' : '1035955', 'plr_PageAlignment' : 'center', 'plr_ContentW' : 1000, 'plr_ContentType' : 'PAGESKINEXPRESS', 'plr_UseFullVersion' : true, 'plr_UseCreativeSettings' : true, 'plr_HideElementsByID' : '', 'plr_HideElementsByClass' : '', 'plr_ScrollAdjustment' : 102 }; integration.on('adCallResult', function(e) { if (e.data.hasSkin) { $('#global-page-wrapper').css({ "width" : "1000px", "margin" : "0 auto" }); } });
// async function increment(number) { let promise = new Promise(function (resolve, reject) { setTimeout(function () { if (number) { return resolve(number++); } return reject("Invalid number"); }, 2000); }); try { let result = await promise; console.log(result); } catch (err) { console.error(err); } } increment(5); increment();
import React, { Component } from "react"; import { StatusBar, Alert, StyleSheet, SafeAreaView, ScrollView, Dimensions, View, TouchableOpacity } from "react-native"; import { Container,Header,Title,Content,Button, Separator, Textarea, Icon,Left,Right,Body,Text,ListItem,List, Item, Input, Thumbnail, Switch, Toast } from "native-base"; import { connect } from 'react-redux'; import { Rating, AirbnbRating } from 'react-native-ratings'; import ImagePicker from "react-native-image-picker"; import Loader from '../nav/Loader'; import { updateReviewAndRating, requestServiceDone } from '../../actions/requestService/actions'; // import styles from "./stylesHome"; const { width, height } = Dimensions.get("window"); const maxWord = 400; const maxCharacter = maxWord * 10; class UserRatingScreen extends Component { constructor() { super(); this.state = { wordsRemain: maxWord, isCommentChanged: false, isRatingChanged: false, comment: '', rating: 0, ratingItem: {} } } componentWillMount() { const { ratingItem } = this.props.navigation.state.params; this.setState({ratingItem: ratingItem}); // console.log('componentWillMount-ratingItem',ratingItem) }; componentDidMount() { const { ratingItem } = this.props.navigation.state.params; this.setState({ratingItem: ratingItem}); // console.log('componentDidMount-state',this.state) }; componentDidUpdate(prevProps) { const { logged, error, requestServiceSuccess } = this.props; if (!prevProps.error && error) Alert.alert('Error', error); // console.log('componentDidMount-state',this.state) if (requestServiceSuccess) { Alert.alert('', 'Thank you for your review'); this.setState({ wordsRemain: maxWord, comment: '', rating: 0, isCommentChanged: false, isRatingChanged: false, ratingItem: {}}) this.props.requestServiceDone() this.props.navigation.navigate('home') } }; _updateReviewAndRating = () => { const { isCommentChanged, isRatingChanged, comment, rating, ratingItem } = this.state; if (isCommentChanged && isRatingChanged) { // console.log('Changed-comment',comment) // console.log('Changed-rating',rating) // console.log('Changed-ratingItem',ratingItem) this.props.updateReviewAndRating(ratingItem.requestServiceId, ratingItem.jobIndex, ratingItem.userInfo.uid, comment, rating) } else { Alert.alert('Notice', 'Please enter all required information !'); } }; onChangeCommentText = (comment) => { let wordsCount = comment.split(" ").length; let wordsRemain = maxWord - wordsCount; if (wordsRemain >= 0) { this.setState({ wordsRemain: wordsRemain, comment: comment, isCommentChanged: true }) } } onChangeRating = (rating) => { // console.log("Rating is: " + rating) this.setState({ rating: rating, isRatingChanged: true }) } // ratingCompleted(rating) { // console.log("Rating is: " + rating) // } render() { return ( <Container style={styles.container}> <Header style={styles.headerBackgroundColor}> <Left> <Button transparent onPress={() => this.props.navigation.navigate('ratinglist')} > <Icon name="ios-arrow-back" /> </Button> </Left> <Body> <Title>{this.state.ratingItem.userInfo.name}</Title> </Body> </Header> <Content padder> <View style={styles.viewbody}> <Text style={styles.textItem}>Overall rating</Text> <Rating style={{alignSelf:'flex-start'}} ratingCount={5} //reviews={["Terrible", "Bad", "OK", "Good", "Great"]} startingValue={0} imageSize={30} onFinishRating={this.onChangeRating} //showRating /> </View> <View style={styles.viewbody}> <Text style={styles.textItem}>Write your review</Text> <Textarea rowSpan={10} bordered placeholder="What did you like or dislike service provider?" // value={this.state.aboutMe} maxLength={maxCharacter} //defaultValue={this.props.user.aboutMe} onChangeText={(comment) => this.onChangeCommentText(comment)} /> <Text note>You have {this.state.wordsRemain} words remain.</Text> </View> <Button disabled={!this.state.isCommentChanged || !this.state.isRatingChanged} block style={{marginTop: 20, backgroundColor: (this.state.isCommentChanged && this.state.isRatingChanged) ? '#507C08' : '#767a78' }} onPress={this._updateReviewAndRating}> <Text style={styles.buttonText}>Update</Text> </Button> </Content> </Container> ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: "#FFF" }, headerBackgroundColor: { backgroundColor: '#02420b' }, mb15: { marginBottom: 15 }, contentContainer: { paddingVertical: 10 }, items: { flex: 1, width: width - 20, }, avatar: { width: 60, height: 60, }, textItem: { paddingTop: 10, paddingBottom: 10, fontSize: 18, // fontWeight: 'bold', // color: '#043a00' }, rating: { paddingBottom: 10, }, displayName: { height: 55, width: 55, bottom: 8, borderWidth:1, borderColor:'#2E5103', borderRadius:30, backgroundColor:'#A6D869', justifyContent: 'center', textAlign: 'center' }, itemHeader: { backgroundColor:'#757575', }, headerText: { fontSize: 16, color: '#043a00', }, buttonText: { fontSize: 20, }, viewbody: { paddingTop: 10, paddingBottom: 10, } }); const mapStateToProps = ({ sessionReducer: { restoring, loading, user, error, logged }, requestServiceReducer: { requestServiceLoading, requestServiceError, requestServiceSuccess }}) => ({ restoring: restoring, loading: loading, user: user, error: error, logged: logged, requestServiceLoading: requestServiceLoading, requestServiceError: requestServiceError, requestServiceSuccess: requestServiceSuccess, }); const mapDispatchToProps = { updateReviewAndRating: updateReviewAndRating, requestServiceDone: requestServiceDone }; export default connect( mapStateToProps, mapDispatchToProps )(UserRatingScreen);
import {EntityField} from './entity_field' export class Edit { constructor() { this.initListeners() } initListeners() { this.initDeleteCurrentFileListener() this.initSaveAndNewListener() this.initEntityFields() this.initEntityModalButtonsListener() } initDeleteCurrentFileListener() { $('.current-file .delete-file a').on('click', (event) => { event.preventDefault(); // Display file field $(event.currentTarget).parents('.file-field:first').find('.btn').removeClass('hide') $(event.currentTarget).parents('.file-field:first').find('.file-path-wrapper').removeClass('hide') // Remove current file $(event.currentTarget).parents('.file-field:first').find('.delete-file-field').val(1) $(event.currentTarget).parents('.current-file:first').remove() }) } initSaveAndNewListener() { $('.btn-save-new').on('click', () => { // Set we want to create a new record after save $("input[name='save_new_hdn']").val(1); // Submit form $('form.edit-form').submit(); }) } /** * Initalize datatable for all entity fields */ initEntityFields() { let entityField = new EntityField() } initEntityModalButtonsListener() { if (!$("meta[name='entity-new-tab']").attr('content')) { $('a.create-related-record').click(event => { let modal = $(event.currentTarget).parents('.modal:first') $('div.create-related-record', modal).show() $('div.search-related-record', modal).hide() $('a.create-related-record', modal).hide() $('a.search-related-record', modal).show() }) $('a.search-related-record').click(event => { let modal = $(event.currentTarget).parents('.modal:first') $('div.search-related-record', modal).show() $('div.create-related-record', modal).hide() $('a.search-related-record', modal).hide() $('a.create-related-record', modal).show() }) } else { $('a.create-related-record').click(event => { let modal = $(event.currentTarget).parents('.modal:first') modal.modal('close'); }) } } }
/** * Copyright (C) 2019 Yudha Tama Aditiyara * * 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. */ const assert = require('assert'); const url = require('url'); const helper = require('../../helper'); describe('Request#parsedHref', () => { it('must be work with request url "/"', (done) => { let server = helper.createServer(); server.listen((request, response) => { response.end(url.format(request.parsedHref)); }); server.start().then(() => { helper.createHttp2Request({ host: server.config.host, port: server.config.port }).then(({buffer}) => { assert.strictEqual(buffer, 'http://' + server.config.host + ':' + server.config.port + '/'); server.stop().then(done); }); }); }); it('must be work with request url "/path?query=value"', (done) => { let server = helper.createServer(); server.listen((request, response) => { response.end(url.format(request.parsedHref)); }); server.start().then(() => { helper.createHttp2Request({ host: server.config.host, port: server.config.port, path: '/path?query=value' }).then(({buffer}) => { assert.strictEqual(buffer, 'http://' + server.config.host + ':' + server.config.port + '/path?query=value'); server.stop().then(done); }); }); }); it('must be work with request url "http://hostname/"', (done) => { let server = helper.createSecureServer(); server.listen((request, response) => { response.end(url.format(request.parsedHref)); }); server.start().then(() => { helper.createHttpSecureRequest({ host: server.config.host, port: server.config.port, path: 'http://hostname/' }).then(({buffer}) => { assert.strictEqual(buffer, 'http://hostname/'); server.stop().then(done); }); }); }); it('must be work with request url "http://hostname/path?query=value"', (done) => { let server = helper.createSecureServer(); server.listen((request, response) => { response.end(url.format(request.parsedHref)); }); server.start().then(() => { helper.createHttpSecureRequest({ host: server.config.host, port: server.config.port, path: 'http://hostname/path?query=value' }).then(({buffer}) => { assert.strictEqual(buffer, 'http://hostname/path?query=value'); server.stop().then(done); }); }); }); });
import Component from '/material/script/Component.js'; import '../../views/page/view-page.js'; import '../../views/section/view-section.js'; import '../../views/article/view-article.js'; import '../../views/source/view-source.js'; import '../../views/import/view-import.js'; import '/material/components/expand/material-expand.js'; const component = Component.meta(import.meta.url, 'page-expand'); /** * */ class ExpandPage extends Component { /** * */ constructor() { super(component); } } Component.define(component, ExpandPage); // #region [Private] // #endregion
/* eslint-disable no-console */ /* eslint-disable camelcase */ module.exports = Behavior({ methods: { ui_tap() { this.triggerEvent('Tap',) } }, })
/** * Created by zhangsihao on 17/3/25. */ angular.module('ngconfManagerApp') .controller('ProfileListCtrl', function ($scope, Projects) { $scope.$on('openProject', function (event, project) { console.log('opening', project); $scope.project = project; $scope.profiles = {}; $scope.currentPath = '/'; Projects.getProfiles(project.name).then(function (profiles) { $scope.profiles = {}; for (let i in profiles) { $scope.profiles[profiles[i].name] = profiles[i]; } if (profiles[0]) { $scope.selectProfile(profiles[0]); } }) }); function watcher(newVal, oldVal) { if (newVal && (newVal !== oldVal)) { loadDir(); } } function loadDir() { if ($scope.project && $scope.profile && typeof $scope.currentPath !== 'undefined' && typeof $scope.version !== 'undefined') { Projects.loadDir($scope.project.name, $scope.profile.name, $scope.version, $scope.currentPath).then(function (list) { $scope.dirs = list.dirs; $scope.files = list.files; }); } } $scope.$watch('currentPath', watcher); $scope.$watch('profile', watcher); $scope.$watch('version', watcher); $scope.$watch('project', watcher); $scope.selectProfile = function (profile) { $scope.profile = profile; $scope.loadVersions(profile.name); this.version = profile.currentVersion; }; $scope.loadVersions = function (profileName) { Projects.getVersions($scope.project.name, profileName).then(function (versions) { if (!$scope.profiles[profileName]) { $scope.profiles[profileName] = {}; } $scope.profiles[profileName].versions = versions; }); }; $scope.selectPrevPath = function () { var pathParts = $scope.currentPath.split('/'); pathParts.pop(); $scope.currentPath = pathParts.length ? '/' : '' + pathParts.join('/'); }; $scope.selectDir = function (dir) { $scope.currentPath = $scope.currentPath + '/' + dir.name; }; $scope.selectFile = function (file) { }; });
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/diy-img-ads/diy-img-ads"],{"01bb":function(e,t,l){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l={name:"diy-img-ads",props:{value:{type:Object}},data:function(){return{isDots:!0,pageWidth:0,swiperRate:0}},created:function(){this.getWidth(),this.getSwiperRate()},methods:{redirectTo:function(e){this.$util.diyRedirectTo(e)},getWidth:function(){var t=this;e.getSystemInfo({success:function(e){t.pageWidth=e.screenWidth}})},getSwiperRate:function(){for(var e=0,t=0,l=0,i=this.value.list,a=0;a<i.length;a++)t=(i[a].imgWidth/i[a].imgHeight).toFixed(2),i.length>=2&&a<i.length-1?(l=(i[a+1].imgWidth/i[a+1].imgHeight).toFixed(2),e=t<=l?t:l):e=t;this.swiperRate=e}}};t.default=l}).call(this,l("543d")["default"])},"0354":function(e,t,l){"use strict";l.r(t);var i=l("01bb"),a=l.n(i);for(var u in i)"default"!==u&&function(e){l.d(t,e,(function(){return i[e]}))}(u);t["default"]=a.a},"0f03":function(e,t,l){},5287:function(e,t,l){"use strict";var i=l("0f03"),a=l.n(i);a.a},"56ce":function(e,t,l){"use strict";var i;l.d(t,"b",(function(){return a})),l.d(t,"c",(function(){return u})),l.d(t,"a",(function(){return i}));var a=function(){var e=this,t=e.$createElement,l=(e._self._c,"carousel-posters"==e.value.selectedTemplate?e.__map(e.value.list,(function(t,l){var i=e.__get_orig(t),a=t.imageUrl?e.$util.img(t.imageUrl):null;return{$orig:i,g0:a}})):null),i="carousel-posters"!=e.value.selectedTemplate&&"vertically"==e.value.selectedTemplate?e.__map(e.value.list,(function(t,l){var i=e.__get_orig(t),a=e.$util.img(t.imageUrl);return{$orig:i,g1:a}})):null,a="carousel-posters"!=e.value.selectedTemplate&&"vertically"!=e.value.selectedTemplate&&"single-graph"==e.value.selectedTemplate&&e.value.list&&e.value.list[0].imgWidth>e.pageWidth-30?e.$util.img(e.value.list[0].imageUrl):null,u="carousel-posters"==e.value.selectedTemplate||"vertically"==e.value.selectedTemplate||"single-graph"!=e.value.selectedTemplate||!e.value.list||e.value.list[0].imgWidth>e.pageWidth-30?null:e.$util.img(e.value.list[0].imageUrl),r="carousel-posters"==e.value.selectedTemplate||"vertically"==e.value.selectedTemplate||"single-graph"==e.value.selectedTemplate&&e.value.list||"horizontal-sliding"!=e.value.selectedTemplate?null:e.__map(e.value.list,(function(t,l){var i=e.__get_orig(t),a=e.$util.img(t.imageUrl);return{$orig:i,g4:a}}));e.$mp.data=Object.assign({},{$root:{l0:l,l1:i,g2:a,g3:u,l2:r}})},u=[]},aa8d:function(e,t,l){"use strict";l.r(t);var i=l("56ce"),a=l("0354");for(var u in a)"default"!==u&&function(e){l.d(t,e,(function(){return a[e]}))}(u);l("5287");var r,n=l("f0c5"),s=Object(n["a"])(a["default"],i["b"],i["c"],!1,null,"75e852e2",null,!1,i["a"],r);t["default"]=s.exports}}]); ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ 'components/diy-img-ads/diy-img-ads-create-component', { 'components/diy-img-ads/diy-img-ads-create-component':(function(module, exports, __webpack_require__){ __webpack_require__('543d')['createComponent'](__webpack_require__("aa8d")) }) }, [['components/diy-img-ads/diy-img-ads-create-component']] ]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=68)}([function(t,e,n){(function(r){e.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(o=r))}),e.splice(o,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=n(28)(e);const{formatters:o}=t.exports;o.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,n(12))},function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<r.length;o++)if((n=r[o])===e||n.fn===e){r.splice(o,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,e);return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){var r,o=n(41),i=n(18),s=n(43),a=n(44),c=n(45);"undefined"!=typeof ArrayBuffer&&(r=n(46));var u="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),h="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),f=u||h;e.protocol=3;var p=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},l=o(p),d={type:"error",data:"parser error"},y=n(47);function g(t,e,n){for(var r=new Array(t.length),o=a(t.length,n),i=function(t,n,o){e(n,(function(e,n){r[t]=n,o(e,r)}))},s=0;s<t.length;s++)i(s,t[s],o)}e.encodePacket=function(t,n,r,o){"function"==typeof n&&(o=n,n=!1),"function"==typeof r&&(o=r,r=null);var i=void 0===t.data?void 0:t.data.buffer||t.data;if("undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=p[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return r(s.buffer)}(t,n,o);if(void 0!==y&&i instanceof y)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(f)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileReader;return o.onload=function(){e.encodePacket({type:t.type,data:o.result},n,!0,r)},o.readAsArrayBuffer(t.data)}(t,n,r);var o=new Uint8Array(1);o[0]=p[t.type];var i=new y([o.buffer,t.data]);return r(i)}(t,n,o);if(i&&i.base64)return function(t,n){var r="b"+e.packets[t.type]+t.data.data;return n(r)}(t,o);var s=p[t.type];return void 0!==t.data&&(s+=r?c.encode(String(t.data),{strict:!1}):String(t.data)),o(""+s)},e.encodeBase64Packet=function(t,n){var r,o="b"+e.packets[t.type];if(void 0!==y&&t.data instanceof y){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];n(o+t)},i.readAsDataURL(t.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var s=new Uint8Array(t.data),a=new Array(s.length),c=0;c<s.length;c++)a[c]=s[c];r=String.fromCharCode.apply(null,a)}return o+=btoa(r),n(o)},e.decodePacket=function(t,n,r){if(void 0===t)return d;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&!1===(t=function(t){try{t=c.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return d;var o=t.charAt(0);return Number(o)==o&&l[o]?t.length>1?{type:l[o],data:t.substring(1)}:{type:l[o]}:d}o=new Uint8Array(t)[0];var i=s(t,1);return y&&"blob"===n&&(i=new y([i])),{type:l[o],data:i}},e.decodeBase64Packet=function(t,e){var n=l[t.charAt(0)];if(!r)return{type:n,data:{base64:!0,data:t.substr(1)}};var o=r.decode(t.substr(1));return"blob"===e&&y&&(o=new y([o])),{type:n,data:o}},e.encodePayload=function(t,n,r){"function"==typeof n&&(r=n,n=null);var o=i(t);if(n&&o)return y&&!f?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r);if(!t.length)return r("0:");g(t,(function(t,r){e.encodePacket(t,!!o&&n,!1,(function(t){r(null,function(t){return t.length+":"+t}(t))}))}),(function(t,e){return r(e.join(""))}))},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);var o;if("function"==typeof n&&(r=n,n=null),""===t)return r(d,0,1);for(var i,s,a="",c=0,u=t.length;c<u;c++){var h=t.charAt(c);if(":"===h){if(""===a||a!=(i=Number(a)))return r(d,0,1);if(a!=(s=t.substr(c+1,i)).length)return r(d,0,1);if(s.length){if(o=e.decodePacket(s,n,!1),d.type===o.type&&d.data===o.data)return r(d,0,1);if(!1===r(o,c+i,u))return}c+=i,a=""}else a+=h}return""!==a?r(d,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));g(t,(function(t,n){e.encodePacket(t,!0,!0,(function(t){return n(null,t)}))}),(function(t,e){var r=e.reduce((function(t,e){var n;return t+(n="string"==typeof e?e.length:e.byteLength).toString().length+n+2}),0),o=new Uint8Array(r),i=0;return e.forEach((function(t){var e="string"==typeof t,n=t;if(e){for(var r=new Uint8Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);n=r.buffer}o[i++]=e?0:1;var a=n.byteLength.toString();for(s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]})),n(o.buffer)}))},e.encodePayloadAsBlob=function(t,n){g(t,(function(t,n){e.encodePacket(t,!0,!0,(function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var r=new Uint8Array(t.length),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);t=r.buffer,e[0]=0}var i=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,y){var a=new y([e.buffer,s.buffer,t]);n(null,a)}}))}),(function(t,e){return n(new y(e))}))},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var o=t,i=[];o.byteLength>0;){for(var a=new Uint8Array(o),c=0===a[0],u="",h=1;255!==a[h];h++){if(u.length>310)return r(d,0,1);u+=a[h]}o=s(o,2+u.length),u=parseInt(u);var f=s(o,0,u);if(c)try{f=String.fromCharCode.apply(null,new Uint8Array(f))}catch(t){var p=new Uint8Array(f);f="";for(h=0;h<p.length;h++)f+=String.fromCharCode(p[h])}i.push(f),o=s(o,u)}var l=i.length;i.forEach((function(t,o){r(e.decodePacket(t,n,!0),o,l)}))}},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e){t.exports=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){var r=n(30)("socket.io-parser"),o=n(1),i=n(33),s=n(13),a=n(14);function c(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=c,e.Decoder=f;var u=e.ERROR+'"encode error"';function h(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var o=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===o)return u;n+=o}return r("encoded %j as %s",t,n),n}function f(){this.reconstructor=null}function p(t){this.reconPack=t,this.buffers=[]}function l(t){return{type:e.ERROR,data:"parser error: "+t}}c.prototype.encode=function(t,n){(r("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)?function(t,e){i.removeBlobs(t,(function(t){var n=i.deconstructPacket(t),r=h(n.packet),o=n.buffers;o.unshift(r),e(o)}))}(t,n):n([h(t)])},o(f.prototype),f.prototype.add=function(t){var n;if("string"==typeof t)n=function(t){var n=0,o={type:Number(t.charAt(0))};if(null==e.types[o.type])return l("unknown packet type "+o.type);if(e.BINARY_EVENT===o.type||e.BINARY_ACK===o.type){for(var i="";"-"!==t.charAt(++n)&&(i+=t.charAt(n),n!=t.length););if(i!=Number(i)||"-"!==t.charAt(n))throw new Error("Illegal attachments");o.attachments=Number(i)}if("/"===t.charAt(n+1))for(o.nsp="";++n;){if(","===(c=t.charAt(n)))break;if(o.nsp+=c,n===t.length)break}else o.nsp="/";var a=t.charAt(n+1);if(""!==a&&Number(a)==a){for(o.id="";++n;){var c;if(null==(c=t.charAt(n))||Number(c)!=c){--n;break}if(o.id+=t.charAt(n),n===t.length)break}o.id=Number(o.id)}if(t.charAt(++n)){var u=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(n));if(!(!1!==u&&(o.type===e.ERROR||s(u))))return l("invalid payload");o.data=u}return r("decoded %s as %j",t,o),o}(t),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!a(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(n=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",n))}},f.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=i.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,n){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ var r=n(34),o=n(35),i=n(36);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return u(this,t,e,n)}function u(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),o=(t=a(t,r)).write(e,n);o!==r&&(t=t.slice(0,o));return t}(t,e,n):function(t,e){if(c.isBuffer(e)){var n=0|l(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(h(e),t=a(t,e<0?0:0|l(e)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|l(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function l(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(r)return j(t).length;e=(""+e).toLowerCase(),r=!0}}function y(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return x(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return S(this,e,n);case"base64":return B(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,o){var i,s=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var h=-1;for(i=n;i<a;i++)if(u(t,i)===u(e,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===c)return h*s}else-1!==h&&(i-=i-h),h=-1}else for(n+c>a&&(n=a-c),i=n;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(u(t,i+p)!==u(e,p)){f=!1;break}if(f)return i}return-1}function w(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function b(t,e,n,r){return Y(j(e,t.length-n),t,n,r)}function C(t,e,n,r){return Y(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function A(t,e,n,r){return C(t,e,n,r)}function E(t,e,n,r){return Y(q(e),t,n,r)}function k(t,e,n,r){return Y(function(t,e){for(var n,r,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function B(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function x(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,s,a,c,u=t[o],h=null,f=u>239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){case 1:u<128&&(h=u);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&u)<<6|63&i)>127&&(h=c);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(h=c)}null===h?(h=65533,f=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return u(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return function(t,e,n,r){return h(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=c.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,n,r,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(i,s),u=this.slice(r,o),h=t.slice(e,n),f=0;f<a;++f)if(u[f]!==h[f]){i=u[f],s=h[f];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return w(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return A(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function S(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function T(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=M(t[i]);return o}function P(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function _(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,n,r,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function O(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function U(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=e>>>8*(r?o:3-o)&255}function I(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,i){return i||I(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function N(t,e,n,r,i){return i||I(t,0,n,8),o.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;n=new c(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},c.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},c.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},c.prototype.readUInt8=function(t,e){return e||_(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||_(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||_(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||_(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||_(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||_(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||_(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||_(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||_(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||_(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||_(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||_(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||_(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||_(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||_(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},c.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||F(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);F(this,t,e,n,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<n&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);F(this,t,e,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return N(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return N(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,i=r-n;if(this===t&&n<e&&e<r)for(o=i-1;o>=0;--o)t[o+e]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},c.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var s=c.isBuffer(t)?t:j(new c(t,r).toString()),a=s.length;for(i=0;i<n-e;++i)this[i+e]=s[i%a]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function M(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function q(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}}).call(this,n(7))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(39);t.exports=function(t){var e=t.xdomain,n=t.xscheme,o=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||r))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&o)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},function(t,e,n){var r=n(2),o=n(1);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}t.exports=i,o(i.prototype),i.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=r.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){var r=n(57).Symbol;t.exports=r},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");-1!=o&&-1!=i&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=n.exec(t||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return-1!=o&&-1!=i&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e){var n,r,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var c,u=[],h=!1,f=-1;function p(){h&&c&&(h=!1,c.length?u=c.concat(u):f=-1,u.length&&l())}function l(){if(!h){var t=a(p);h=!0;for(var e=u.length;e;){for(c=u,u=[];++f<e;)c&&c[f].run();f=-1,e=u.length}c=null,h=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new d(t,e)),1!==u.length||h||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(e){t.exports=function(t){return n&&e.isBuffer(t)||r&&(t instanceof ArrayBuffer||function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}(t))};var n="function"==typeof e&&"function"==typeof e.isBuffer,r="function"==typeof ArrayBuffer}).call(this,n(6).Buffer)},function(t,e,n){var r=n(37),o=n(21),i=n(1),s=n(5),a=n(22),c=n(23),u=n(0)("socket.io-client:manager"),h=n(20),f=n(52),p=Object.prototype.hasOwnProperty;function l(t,e){if(!(this instanceof l))return new l(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||s;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}t.exports=l,l.prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)p.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},l.prototype.updateSocketIds=function(){for(var t in this.nsps)p.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},l.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},i(l.prototype),l.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},l.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},l.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},l.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},l.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},l.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},l.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},l.prototype.open=l.prototype.connect=function(t,e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=r(this.uri,this.opts);var n=this.engine,o=this;this.readyState="opening",this.skipReconnect=!1;var i=a(n,"open",(function(){o.onopen(),t&&t()})),s=a(n,"error",(function(e){if(u("connect_error"),o.cleanup(),o.readyState="closed",o.emitAll("connect_error",e),t){var n=new Error("Connection error");n.data=e,t(n)}else o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var c=this._timeout;u("connect attempt will timeout after %d",c);var h=setTimeout((function(){u("connect attempt timed out after %d",c),i.destroy(),n.close(),n.emit("error","timeout"),o.emitAll("connect_timeout",c)}),c);this.subs.push({destroy:function(){clearTimeout(h)}})}return this.subs.push(i),this.subs.push(s),this},l.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(a(t,"data",c(this,"ondata"))),this.subs.push(a(t,"ping",c(this,"onping"))),this.subs.push(a(t,"pong",c(this,"onpong"))),this.subs.push(a(t,"error",c(this,"onerror"))),this.subs.push(a(t,"close",c(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",c(this,"ondecoded")))},l.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},l.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},l.prototype.ondata=function(t){this.decoder.add(t)},l.prototype.ondecoded=function(t){this.emit("packet",t)},l.prototype.onerror=function(t){u("error",t),this.emitAll("error",t)},l.prototype.socket=function(t,e){var n=this.nsps[t];if(!n){n=new o(this,t,e),this.nsps[t]=n;var r=this;n.on("connecting",i),n.on("connect",(function(){n.id=r.generateId(t)})),this.autoConnect&&i()}function i(){~h(r.connecting,n)||r.connecting.push(n)}return n},l.prototype.destroy=function(t){var e=h(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},l.prototype.packet=function(t){u("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,(function(n){for(var r=0;r<n.length;r++)e.engine.write(n[r],t.options);e.encoding=!1,e.processPacketQueue()})))},l.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},l.prototype.cleanup=function(){u("cleanup");for(var t=this.subs.length,e=0;e<t;e++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},l.prototype.close=l.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},l.prototype.onclose=function(t){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},l.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout((function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open((function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())})))}),e);this.subs.push({destroy:function(){clearTimeout(n)}})}},l.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){var r=n(8),o=n(40),i=n(48),s=n(49);e.polling=function(t){var e=!1,n=!1,s=!1!==t.jsonp;if("undefined"!=typeof location){var a="https:"===location.protocol,c=location.port;c||(c=a?443:80),e=t.hostname!==location.hostname||c!==t.port,n=t.secure!==a}if(t.xdomain=e,t.xscheme=n,"open"in new r(t)&&!t.forceJSONP)return new o(t);if(!s)throw new Error("JSONP disabled");return new i(t)},e.websocket=s},function(t,e,n){var r=n(9),o=n(3),i=n(2),s=n(4),a=n(19),c=n(0)("engine.io-client:polling");t.exports=h;var u=null!=new(n(8))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;u&&!e||(this.supportsBinary=!1),r.call(this,t)}s(h,r),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e=this;function n(){c("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(c("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){c("pre-pause polling complete"),--r||n()}))),this.writable||(c("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){c("pre-pause writing complete"),--r||n()})))}else n()},h.prototype.poll=function(){c("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;c("polling got data %s",t);i.decodePayload(t,this.socket.binaryType,(function(t,n,r){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():c('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){c("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(c("transport open - closing"),e()):(c("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};i.encodePayload(t,this.supportsBinary,(function(t){e.doWrite(t,n)}))},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=o.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){(function(e){var r=n(42),o=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);t.exports=function t(n){if(!n||"object"!=typeof n)return!1;if(r(n)){for(var o=0,a=n.length;o<a;o++)if(t(n[o]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(n)||"function"==typeof ArrayBuffer&&n instanceof ArrayBuffer||i&&n instanceof Blob||s&&n instanceof File)return!0;if(n.toJSON&&"function"==typeof n.toJSON&&1===arguments.length)return t(n.toJSON(),!0);for(var c in n)if(Object.prototype.hasOwnProperty.call(n,c)&&t(n[c]))return!0;return!1}}).call(this,n(6).Buffer)},function(t,e,n){"use strict";var r,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i={},s=0,a=0;function c(t){var e="";do{e=o[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}function u(){var t=c(+new Date);return t!==r?(s=0,r=t):t+"."+c(s++)}for(;a<64;a++)i[o[a]]=a;u.encode=c,u.decode=function(t){var e=0;for(a=0;a<t.length;a++)e=64*e+i[t.charAt(a)];return e},t.exports=u},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e,n){var r=n(5),o=n(1),i=n(51),s=n(22),a=n(23),c=n(0)("socket.io-client:socket"),u=n(3),h=n(18);t.exports=l;var f={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=o.prototype.emit;function l(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}o(l.prototype),l.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[s(t,"open",a(this,"onopen")),s(t,"packet",a(this,"onpacket")),s(t,"close",a(this,"onclose"))]}},l.prototype.open=l.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},l.prototype.send=function(){var t=i(arguments);return t.unshift("message"),this.emit.apply(this,t),this},l.prototype.emit=function(t){if(f.hasOwnProperty(t))return p.apply(this,arguments),this;var e=i(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:h(e))?r.BINARY_EVENT:r.EVENT,data:e,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},l.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},l.prototype.onopen=function(){if(c("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"==typeof this.query?u.encode(this.query):this.query;c("sending connect packet with query %s",t),this.packet({type:r.CONNECT,query:t})}else this.packet({type:r.CONNECT})},l.prototype.onclose=function(t){c("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},l.prototype.onpacket=function(t){var e=t.nsp===this.nsp,n=t.type===r.ERROR&&"/"===t.nsp;if(e||n)switch(t.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(t);break;case r.ACK:case r.BINARY_ACK:this.onack(t);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",t.data)}},l.prototype.onevent=function(t){var e=t.data||[];c("emitting event %j",e),null!=t.id&&(c("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?p.apply(this,e):this.receiveBuffer.push(e)},l.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var o=i(arguments);c("sending ack %j",o),e.packet({type:h(o)?r.BINARY_ACK:r.ACK,id:t,data:o})}}},l.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(c("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):c("bad ack %s",t.id)},l.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},l.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)p.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},l.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},l.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},l.prototype.close=l.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},l.prototype.compress=function(t){return this.flags.compress=t,this},l.prototype.binary=function(t){return this.flags.binary=t,this}},function(t,e){t.exports=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}},function(t,e){var n=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}},function(t,e){t.exports=Object.freeze({PLAYER_RADIUS:20,PLAYER_MAX_HP:100,PLAYER_SPEED:400,PLAYER_FIRE_COOLDOWN:.25,BULLET_RADIUS:3,BULLET_SPEED:800,BULLET_DAMAGE:10,SCORE_BULLET_HIT:20,SCORE_PER_SECOND:1,MAP_SIZE:3e3,MSG_TYPES:{JOIN_GAME:"join_game",GAME_UPDATE:"update",INPUT:"input",GAME_OVER:"dead"}})},function(t,e,n){var r=n(27),o=n(5),i=n(15),s=n(0)("socket.io-client");t.exports=e=c;var a=e.managers={};function c(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,o=r(t),c=o.source,u=o.id,h=o.path,f=a[u]&&h in a[u].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||f?(s("ignoring socket cache for %s",c),n=i(c,e)):(a[u]||(s("new io instance for %s",c),a[u]=i(c,e)),n=a[u]),o.query&&!e.query&&(e.query=o.query),n.socket(o.path,e)}e.protocol=o.protocol,e.connect=c,e.Manager=n(15),e.Socket=n(21)},function(t,e,n){var r=n(53),o=n(55),i=/[&<>"']/g,s=RegExp(i.source);t.exports=function(t){return(t=o(t))&&s.test(t)?t.replace(i,r):t}},function(t,e,n){var r=n(11),o=n(0)("socket.io-client:url");t.exports=function(t,e){var n=t;e=e||"undefined"!=typeof location&&location,null==t&&(t=e.protocol+"//"+e.host);"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?e.protocol+t:e.host+t),/^(https?|wss?):\/\//.test(t)||(o("protocol-less url %s",t),t=void 0!==e?e.protocol+"//"+t:"https://"+t),o("parse %s",t),n=r(t));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var i=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port,n.href=n.protocol+"://"+i+(e&&e.port===n.port?"":":"+n.port),n}},function(t,e,n){t.exports=function(t){function e(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return r.colors[Math.abs(e)%r.colors.length]}function r(t){let n;function s(...t){if(!s.enabled)return;const e=s,o=Number(new Date),i=o-(n||o);e.diff=i,e.prev=n,e.curr=o,n=o,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return n;a++;const i=r.formatters[o];if("function"==typeof i){const r=t[a];n=i.call(e,r),t.splice(a,1),a--}return n}),r.formatArgs.call(e,t);(e.log||r.log).apply(e,t)}return s.namespace=t,s.enabled=r.enabled(t),s.useColors=r.useColors(),s.color=e(t),s.destroy=o,s.extend=i,"function"==typeof r.init&&r.init(s),r.instances.push(s),s}function o(){const t=r.instances.indexOf(this);return-1!==t&&(r.instances.splice(t,1),!0)}function i(t,e){const n=r(this.namespace+(void 0===e?":":e)+t);return n.log=this.log,n}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},r.disable=function(){const t=[...r.names.map(s),...r.skips.map(s).map(t=>"-"+t)].join(",");return r.enable(""),t},r.enable=function(t){let e;r.save(t),r.names=[],r.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(e=0;e<o;e++)n[e]&&("-"===(t=n[e].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+t.substr(1)+"$")):r.names.push(new RegExp("^"+t+"$")));for(e=0;e<r.instances.length;e++){const t=r.instances[e];t.enabled=r.enabled(t.namespace)}},r.enabled=function(t){if("*"===t[t.length-1])return!0;let e,n;for(e=0,n=r.skips.length;e<n;e++)if(r.skips[e].test(t))return!1;for(e=0,n=r.names.length;e<n;e++)if(r.names[e].test(t))return!0;return!1},r.humanize=n(29),Object.keys(t).forEach(e=>{r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=e,r.enable(r.load()),r}},function(t,e){var n=1e3,r=6e4,o=60*r,i=24*o;function s(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}t.exports=function(t,e){e=e||{};var a=typeof t;if("string"===a&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*o;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(t);if("number"===a&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=i)return s(t,e,i,"day");if(e>=o)return s(t,e,o,"hour");if(e>=r)return s(t,e,r,"minute");if(e>=n)return s(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=i)return Math.round(t/i)+"d";if(e>=o)return Math.round(t/o)+"h";if(e>=r)return Math.round(t/r)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){(function(r){function o(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG),t}(e=t.exports=n(31)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,r)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=o,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(o())}).call(this,n(12))},function(t,e,n){function r(t){var n;function r(){if(r.enabled){var t=r,o=+new Date,i=o-(n||o);t.diff=i,t.prev=n,t.curr=o,n=o;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=e.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(t,i),s.splice(c,1),c--}return n})),e.formatArgs.call(t,s);var u=r.log||e.log||console.log.bind(console);u.apply(t,s)}}return r.namespace=t,r.enabled=e.enabled(t),r.useColors=e.useColors(),r.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),r.destroy=o,"function"==typeof e.init&&e.init(r),e.instances.push(r),r}function o(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=r.debug=r.default=r).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var n;e.save(t),e.names=[],e.skips=[];var r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(n=0;n<e.instances.length;n++){var i=e.instances[n];i.enabled=e.enabled(i.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(32),e.instances=[],e.names=[],e.skips=[],e.formatters={}},function(t,e){var n=1e3,r=6e4,o=60*r,i=24*o;function s(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}t.exports=function(t,e){e=e||{};var a,c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var s=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*o;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(t);if("number"===c&&!1===isNaN(t))return e.long?s(a=t,i,"day")||s(a,o,"hour")||s(a,r,"minute")||s(a,n,"second")||a+" ms":function(t){if(t>=i)return Math.round(t/i)+"d";if(t>=o)return Math.round(t/o)+"h";if(t>=r)return Math.round(t/r)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){var r=n(13),o=n(14),i=Object.prototype.toString,s="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),a="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);e.deconstructPacket=function(t){var e=[],n=t.data,i=t;return i.data=function t(e,n){if(!e)return e;if(o(e)){var i={_placeholder:!0,num:n.length};return n.push(e),i}if(r(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a],n);return s}if("object"==typeof e&&!(e instanceof Date)){s={};for(var c in e)s[c]=t(e[c],n);return s}return e}(n,e),i.attachments=e.length,{packet:i,buffers:e}},e.reconstructPacket=function(t,e){return t.data=function t(e,n){if(!e)return e;if(e&&e._placeholder)return n[e.num];if(r(e))for(var o=0;o<e.length;o++)e[o]=t(e[o],n);else if("object"==typeof e)for(var i in e)e[i]=t(e[i],n);return e}(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){var n=0,i=t;!function t(c,u,h){if(!c)return c;if(s&&c instanceof Blob||a&&c instanceof File){n++;var f=new FileReader;f.onload=function(){h?h[u]=this.result:i=this.result,--n||e(i)},f.readAsArrayBuffer(c)}else if(r(c))for(var p=0;p<c.length;p++)t(c[p],p,c);else if("object"==typeof c&&!o(c))for(var l in c)t(c[l],l,c)}(i),n||e(i)}},function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=u(t),s=r[0],a=r[1],c=new i(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),h=0,f=a>0?s-4:s;for(n=0;n<f;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],c[h++]=e>>16&255,c[h++]=e>>8&255,c[h++]=255&e;2===a&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,c[h++]=255&e);1===a&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=0,a=n-o;s<a;s+=16383)i.push(h(t,s,s+16383>a?a:s+16383));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function h(t,e,n){for(var o,i,s=[],a=e;a<n;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,c=(1<<a)-1,u=c>>1,h=-7,f=n?o-1:0,p=n?-1:1,l=t[e+f];for(f+=p,i=l&(1<<-h)-1,l>>=-h,h+=a;h>0;i=256*i+t[e+f],f+=p,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=r;h>0;s=256*s+t[e+f],f+=p,h-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,r),i-=u}return(l?-1:1)*s*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var s,a,c,u=8*i-o-1,h=(1<<u)-1,f=h>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=r?0:i-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(s++,c/=2),s+f>=h?(a=0,s=h):s+f>=1?(a=(e*c-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[n+l]=255&a,l+=d,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;t[n+l]=255&s,l+=d,s/=256,u-=8);t[n+l-d]|=128*y}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){t.exports=n(38),t.exports.parser=n(2)},function(t,e,n){var r=n(16),o=n(1),i=n(0)("engine.io-client:socket"),s=n(20),a=n(2),c=n(11),u=n(3);function h(t,e){if(!(this instanceof h))return new h(t,e);e=e||{},t&&"object"==typeof t&&(e=t,t=null),t?(t=c(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=c(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=u.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.withCredentials=!1!==e.withCredentials,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}t.exports=h,h.priorWebsocketSuccess=!1,o(h.prototype),h.protocol=a.protocol,h.Socket=h,h.Transport=n(9),h.transports=n(16),h.parser=n(2),h.prototype.createTransport=function(t){i('creating transport "%s"',t);var e=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}(this.query);e.EIO=a.protocol,e.transport=t;var n=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new r[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,withCredentials:n.withCredentials||this.withCredentials,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},h.prototype.open=function(){var t;if(this.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout((function(){e.emit("error","No transports available")}),0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},h.prototype.setTransport=function(t){i("setting transport %s",t.name);var e=this;this.transport&&(i("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",(function(){e.onDrain()})).on("packet",(function(t){e.onPacket(t)})).on("error",(function(t){e.onError(t)})).on("close",(function(){e.onClose("transport close")}))},h.prototype.probe=function(t){i('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),n=!1,r=this;function o(){if(r.onlyBinaryUpgrades){var o=!this.supportsBinary&&r.transport.supportsBinary;n=n||o}n||(i('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",(function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(i('probe transport "%s" pong',t),r.upgrading=!0,r.emit("upgrading",e),!e)return;h.priorWebsocketSuccess="websocket"===e.name,i('pausing current transport "%s"',r.transport.name),r.transport.pause((function(){n||"closed"!==r.readyState&&(i("changing transport and sending upgrade packet"),p(),r.setTransport(e),e.send([{type:"upgrade"}]),r.emit("upgrade",e),e=null,r.upgrading=!1,r.flush())}))}else{i('probe transport "%s" failed',t);var s=new Error("probe error");s.transport=e.name,r.emit("upgradeError",s)}})))}function s(){n||(n=!0,p(),e.close(),e=null)}function a(n){var o=new Error("probe error: "+n);o.transport=e.name,s(),i('probe transport "%s" failed because of error: %s',t,n),r.emit("upgradeError",o)}function c(){a("transport closed")}function u(){a("socket closed")}function f(t){e&&t.name!==e.name&&(i('"%s" works - aborting "%s"',t.name,e.name),s())}function p(){e.removeListener("open",o),e.removeListener("error",a),e.removeListener("close",c),r.removeListener("close",u),r.removeListener("upgrading",f)}h.priorWebsocketSuccess=!1,e.once("open",o),e.once("error",a),e.once("close",c),this.once("close",u),this.once("upgrading",f),e.open()},h.prototype.onOpen=function(){if(i("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){i("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},h.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(i('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else i('packet received with socket readyState "%s"',this.readyState)},h.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},h.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout((function(){"closed"!==e.readyState&&e.onClose("ping timeout")}),t||e.pingInterval+e.pingTimeout)},h.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout((function(){i("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)}),t.pingInterval)},h.prototype.ping=function(){var t=this;this.sendPacket("ping",(function(){t.emit("ping")}))},h.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},h.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(i("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},h.prototype.write=h.prototype.send=function(t,e,n){return this.sendPacket("message",t,e,n),this},h.prototype.sendPacket=function(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:t,data:e,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},h.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?r():e()})):this.upgrading?r():e()}function e(){t.onClose("forced close"),i("socket closing - telling transport to close"),t.transport.close()}function n(){t.removeListener("upgrade",n),t.removeListener("upgradeError",n),e()}function r(){t.once("upgrade",n),t.once("upgradeError",n)}return this},h.prototype.onError=function(t){i("socket error %j",t),h.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},h.prototype.onClose=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){i('socket close with reason: "%s"',t);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0}},h.prototype.filterUpgrades=function(t){for(var e=[],n=0,r=t.length;n<r;n++)~s(this.transports,t[n])&&e.push(t[n]);return e}},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},function(t,e,n){var r=n(8),o=n(17),i=n(1),s=n(4),a=n(0)("engine.io-client:polling-xhr");function c(){}function u(t){if(o.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,"undefined"!=typeof location){var e="https:"===location.protocol,n=location.port;n||(n=e?443:80),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e}}function h(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}if(t.exports=u,t.exports.Request=h,s(u,o),u.prototype.supportsBinary=!0,u.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.withCredentials=this.withCredentials,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new h(t)},u.prototype.doWrite=function(t,e){var n="string"!=typeof t&&void 0!==t,r=this.request({method:"POST",data:t,isBinary:n}),o=this;r.on("success",e),r.on("error",(function(t){o.onError("xhr post error",t)})),this.sendXhr=r},u.prototype.doPoll=function(){a("xhr poll");var t=this.request(),e=this;t.on("data",(function(t){e.onData(t)})),t.on("error",(function(t){e.onError("xhr poll error",t)})),this.pollXhr=t},i(h.prototype),h.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new r(t),n=this;try{a("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var o in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&e.setRequestHeader(o,this.extraHeaders[o])}catch(t){}if("POST"===this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.withCredentials),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){n.onLoad()},e.onerror=function(){n.onError(e.responseText)}):e.onreadystatechange=function(){if(2===e.readyState)try{var t=e.getResponseHeader("Content-Type");(n.supportsBinary&&"application/octet-stream"===t||"application/octet-stream; charset=UTF-8"===t)&&(e.responseType="arraybuffer")}catch(t){}4===e.readyState&&(200===e.status||1223===e.status?n.onLoad():setTimeout((function(){n.onError("number"==typeof e.status?e.status:0)}),0))},a("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout((function(){n.onError(t)}),0)}"undefined"!=typeof document&&(this.index=h.requestsCount++,h.requests[this.index]=this)},h.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},h.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},h.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=c:this.xhr.onreadystatechange=c,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete h.requests[this.index],this.xhr=null}},h.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t=("application/octet-stream"===e||"application/octet-stream; charset=UTF-8"===e)&&this.xhr.response||this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},h.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},h.prototype.abort=function(){this.cleanup()},h.requestsCount=0,h.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",p);else if("function"==typeof addEventListener){var f="onpagehide"in self?"pagehide":"unload";addEventListener(f,p,!1)}function p(){for(var t in h.requests)h.requests.hasOwnProperty(t)&&h.requests[t].abort()}},function(t,e){t.exports=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){t.exports=function(t,e,n){var r=t.byteLength;if(e=e||0,n=n||r,t.slice)return t.slice(e,n);if(e<0&&(e+=r),n<0&&(n+=r),n>r&&(n=r),e>=r||e>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(n-e),s=e,a=0;s<n;s++,a++)i[a]=o[s];return i.buffer}},function(t,e){function n(){}t.exports=function(t,e,r){var o=!1;return r=r||n,i.count=t,0===t?e():i;function i(t,n){if(i.count<=0)throw new Error("after called too many times");--i.count,t?(o=!0,e(t),e=r):0!==i.count||o||e(null,n)}}},function(t,e){ /*! https://mths.be/utf8js v2.1.2 by @mathias */ var n,r,o,i=String.fromCharCode;function s(t){for(var e,n,r=[],o=0,i=t.length;o<i;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<i?56320==(64512&(n=t.charCodeAt(o++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--):r.push(e);return r}function a(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function c(t,e){return i(t>>e&63|128)}function u(t,e){if(0==(4294967168&t))return i(t);var n="";return 0==(4294965248&t)?n=i(t>>6&31|192):0==(4294901760&t)?(a(t,e)||(t=65533),n=i(t>>12&15|224),n+=c(t,6)):0==(4292870144&t)&&(n=i(t>>18&7|240),n+=c(t,12),n+=c(t,6)),n+=i(63&t|128)}function h(){if(o>=r)throw Error("Invalid byte index");var t=255&n[o];if(o++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(t){var e,i;if(o>r)throw Error("Invalid byte index");if(o==r)return!1;if(e=255&n[o],o++,0==(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|h())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|h()<<6|h())>=2048)return a(i,t)?i:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|h()<<12|h()<<6|h())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}t.exports={version:"2.1.2",encode:function(t,e){for(var n=!1!==(e=e||{}).strict,r=s(t),o=r.length,i=-1,a="";++i<o;)a+=u(r[i],n);return a},decode:function(t,e){var a=!1!==(e=e||{}).strict;n=s(t),r=n.length,o=0;for(var c,u=[];!1!==(c=f(a));)u.push(c);return function(t){for(var e,n=t.length,r=-1,o="";++r<n;)(e=t[r])>65535&&(o+=i((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=i(e);return o}(u)}}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<t.length;r++)n[t.charCodeAt(r)]=r;e.encode=function(e){var n,r=new Uint8Array(e),o=r.length,i="";for(n=0;n<o;n+=3)i+=t[r[n]>>2],i+=t[(3&r[n])<<4|r[n+1]>>4],i+=t[(15&r[n+1])<<2|r[n+2]>>6],i+=t[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,o,i,s,a=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var h=new ArrayBuffer(a),f=new Uint8Array(h);for(e=0;e<c;e+=4)r=n[t.charCodeAt(e)],o=n[t.charCodeAt(e+1)],i=n[t.charCodeAt(e+2)],s=n[t.charCodeAt(e+3)],f[u++]=r<<2|o>>4,f[u++]=(15&o)<<4|i>>2,f[u++]=(3&i)<<6|63&s;return h}}()},function(t,e){var n=void 0!==n?n:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),o=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),i=n&&n.prototype.append&&n.prototype.getBlob;function s(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var n=new Uint8Array(t.byteLength);n.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=n.buffer}return e}return t}))}function a(t,e){e=e||{};var r=new n;return s(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function c(t,e){return new Blob(s(t),e||{})}"undefined"!=typeof Blob&&(a.prototype=Blob.prototype,c.prototype=Blob.prototype),t.exports=r?o?Blob:c:i?a:void 0},function(t,e,n){(function(e){var r=n(17),o=n(4);t.exports=h;var i,s=/\n/g,a=/\\n/g;function c(){}function u(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{}}function h(t){if(r.call(this,t),this.query=this.query||{},!i){var e=u();i=e.___eio=e.___eio||[]}this.index=i.length;var n=this;i.push((function(t){n.onData(t)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=c)}),!1)}o(h,r),h.prototype.supportsBinary=!1,h.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),r.prototype.doClose.call(this)},h.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)}),100)},h.prototype.doWrite=function(t,e){var n=this;if(!this.form){var r,o=document.createElement("form"),i=document.createElement("textarea"),c=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=c,o.method="POST",o.setAttribute("accept-charset","utf-8"),i.name="d",o.appendChild(i),document.body.appendChild(o),this.form=o,this.area=i}function u(){h(),e()}function h(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(t){n.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+n.iframeId+'">';r=document.createElement(t)}catch(t){(r=document.createElement("iframe")).name=n.iframeId,r.src="javascript:0"}r.id=n.iframeId,n.form.appendChild(r),n.iframe=r}this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&u()}:this.iframe.onload=u}}).call(this,n(7))},function(t,e,n){(function(e){var r,o,i=n(9),s=n(2),a=n(3),c=n(4),u=n(19),h=n(0)("engine.io-client:websocket");if("undefined"!=typeof WebSocket?r=WebSocket:"undefined"!=typeof self&&(r=self.WebSocket||self.MozWebSocket),"undefined"==typeof window)try{o=n(50)}catch(t){}var f=r||o;function p(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=r&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(f=o),i.call(this,t)}t.exports=p,c(p,i),p.prototype.name="websocket",p.prototype.supportsBinary=!0,p.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new f(t,e):new f(t):new f(t,e,n)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},p.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},p.prototype.write=function(t){var n=this;this.writable=!1;for(var r=t.length,o=0,i=r;o<i;o++)!function(t){s.encodePacket(t,n.supportsBinary,(function(o){if(!n.usingBrowserWebSocket){var i={};if(t.options&&(i.compress=t.options.compress),n.perMessageDeflate)("string"==typeof o?e.byteLength(o):o.length)<n.perMessageDeflate.threshold&&(i.compress=!1)}try{n.usingBrowserWebSocket?n.ws.send(o):n.ws.send(o,i)}catch(t){h("websocket closed before onclose event")}--r||a()}))}(t[o]);function a(){n.emit("flush"),setTimeout((function(){n.writable=!0,n.emit("drain")}),0)}},p.prototype.onClose=function(){i.prototype.onClose.call(this)},p.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},p.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";return this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=u()),this.supportsBinary||(t.b64=1),(t=a.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t},p.prototype.check=function(){return!(!f||"__initialize"in f&&this.name===p.prototype.name)}}).call(this,n(6).Buffer)},function(t,e){},function(t,e){t.exports=function(t,e){for(var n=[],r=(e=e||0)||0;r<t.length;r++)n[r-e]=t[r];return n}},function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},function(t,e,n){var r=n(54)({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});t.exports=r},function(t,e){t.exports=function(t){return function(e){return null==t?void 0:t[e]}}},function(t,e,n){var r=n(56);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(10),o=n(59),i=n(60),s=n(61),a=r?r.prototype:void 0,c=a?a.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(s(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e,n){var r=n(58),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(7))},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(62),o=n(65);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(10),o=n(63),i=n(64),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?o(t):i(t)}},function(t,e,n){var r=n(10),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var o=s.call(t);return r&&(e?t[a]=n:delete t[a]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r=n(25),o=n.n(r);function i(t,e,n,r){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function c(){var c=this,u=Date.now()-s,h=arguments;function f(){s=Date.now(),n.apply(c,h)}function p(){o=void 0}i||(r&&!o&&f(),a(),void 0===r&&u>t?f():!0!==e&&(o=setTimeout(r?p:f,void 0===r?t-u:t)))}return"boolean"!=typeof e&&(r=n,n=e,e=void 0),c.cancel=function(){a(),i=!0},c}var s=n(26),a=n.n(s),c=document.getElementById("leaderboard"),u=document.querySelectorAll("#leaderboard table tr");function h(t){t?c.classList.add("hidden"):c.classList.remove("hidden")}var f=[],p=0,l=0;function d(t){l||(l=t.t,p=Date.now()),f.push(t),function(t){for(var e=0;e<t.length;e++)u[e+1].innerHTML="<td>".concat(a()(t[e].username.slice(0,15))||"Anonymous","</td><td>").concat(t[e].score,"</td>");for(var n=t.length;n<5;n++)u[n+1].innerHTML="<td>-</td><td>-</td>"}(t.leaderboard);var e=g();e>0&&f.splice(0,e)}function y(){return l+(Date.now()-p)-100}function g(){for(var t=y(),e=f.length-1;e>=0;e--)if(f[e].t<=t)return e;return-1}function m(t,e,n){if(!e)return t;var r={};return Object.keys(t).forEach((function(o){r[o]="direction"===o?function(t,e,n){return Math.abs(e-t)>=Math.PI?t>e?t+(e+2*Math.PI-t)*n:t-(e-2*Math.PI-t)*n:t+(e-t)*n}(t[o],e[o],n):t[o]+(e[o]-t[o])*n})),r}function v(t,e,n){return t.map((function(t){return m(t,e.find((function(e){return t.id===e.id})),n)}))}var w=n(24),b=window.location.protocol.includes("https")?"wss":"ws",C=o()("".concat(b,"://").concat(window.location.host),{reconnection:!1}),A=new Promise((function(t){C.on("connect",(function(){console.log("Connected to server!"),t()}))})),E=i(20,(function(t){C.emit(w.MSG_TYPES.INPUT,t)})),k={},B=Promise.all(["ship.svg","bullet.svg"].map((function(t){return new Promise((function(e){var n=new Image;n.onload=function(){console.log("Downloaded ".concat(t)),k[t]=n,e()},n.src="/assets/".concat(t)}))})));var x,R,S,T=function(t){return k[t]},P=n(24),_=P.PLAYER_RADIUS,F=P.PLAYER_MAX_HP,O=P.BULLET_RADIUS,U=P.MAP_SIZE,I=document.getElementById("game-canvas"),L=I.getContext("2d");function N(){var t=Math.max(1,800/window.innerWidth);I.width=t*window.innerWidth,I.height=t*window.innerHeight}function D(){var t=function(){if(!l)return{};var t=g(),e=y();if(t<0||t===f.length-1)return f[f.length-1];var n=f[t],r=f[t+1],o=(e-n.t)/(r.t-n.t);return{me:m(n.me,r.me,o),others:v(n.others,r.others,o),bullets:v(n.bullets,r.bullets,o)}}(),e=t.me,n=t.others,r=t.bullets;e&&(M(e.x,e.y),L.strokeStyle="black",L.lineWidth=2,L.strokeRect(I.width/2-e.x,I.height/2-e.y,U,U),r.forEach(q.bind(null,e)),j(e,e),n.forEach(j.bind(null,e)))}function M(t,e){I.width,I.height;backgroundGradient.addColorStop(0,"gray"),backgroundGradient.addColorStop(1,"gray"),L.fillStyle=backgroundGradient,L.fillRect(0,0,I.width,I.height)}function j(t,e){var n=e.x,r=e.y,o=e.direction,i=I.width/2+n-t.x,s=I.height/2+r-t.y;L.save(),L.translate(i,s),L.rotate(o),L.drawImage(T("ship.svg"),-_,-_,2*_,2*_),L.restore(),L.fillStyle="white",L.fillRect(i-_,s+_+8,2*_,2),L.fillStyle="red",L.fillRect(i-_+2*_*e.hp/F,s+_+8,2*_*(1-e.hp/F),2)}function q(t,e){var n=e.x,r=e.y;L.drawImage(T("bullet.svg"),I.width/2+n-t.x-O,I.height/2+r-t.y-O,2*O,2*O)}function Y(){var t=Date.now()/7500;M(U/2+800*Math.cos(t),U/2+800*Math.sin(t))}N(),window.addEventListener("resize",(x=40,R=N,void 0===S?i(x,R,!1):i(x,S,!1!==R)));var z=setInterval(Y,1e3/60);function H(t){W(t.clientX,t.clientY)}function X(t){var e=t.touches[0];W(e.clientX,e.clientY)}function W(t,e){var n=Math.atan2(t-window.innerWidth/2,window.innerHeight/2-e);E(n)}n(66),n(67);var J,G=document.getElementById("play-menu"),V=document.getElementById("play-button"),$=document.getElementById("username-input");Promise.all([(J=function(){window.removeEventListener("mousemove",H),window.removeEventListener("click",H),window.removeEventListener("touchstart",X),window.removeEventListener("touchmove",X),clearInterval(z),z=setInterval(Y,1e3/60),G.classList.remove("hidden"),h(!0)},A.then((function(){C.on(w.MSG_TYPES.GAME_UPDATE,d),C.on(w.MSG_TYPES.GAME_OVER,J),C.on("disconnect",(function(){console.log("Disconnected from server."),document.getElementById("disconnect-modal").classList.remove("hidden"),document.getElementById("reconnect-button").onclick=function(){window.location.reload()}}))}))),B]).then((function(){G.classList.remove("hidden"),$.focus(),V.onclick=function(){var t;t=$.value,C.emit(w.MSG_TYPES.JOIN_GAME,t),G.classList.add("hidden"),p=0,l=0,window.addEventListener("mousemove",H),window.addEventListener("click",H),window.addEventListener("touchstart",X),window.addEventListener("touchmove",X),clearInterval(z),z=setInterval(D,1e3/60),h(!1)}})).catch(console.error)}]);
(function() {var implementors = {}; implementors["bitvec"] = [{"text":"impl&lt;O, V, Rhs&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt; for <a class=\"struct\" href=\"bitvec/array/struct.BitArray.html\" title=\"struct bitvec::array::BitArray\">BitArray</a>&lt;O, V&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class=\"trait\" href=\"bitvec/order/trait.BitOrder.html\" title=\"trait bitvec::order::BitOrder\">BitOrder</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;V: <a class=\"trait\" href=\"bitvec/view/trait.BitView.html\" title=\"trait bitvec::view::BitView\">BitView</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class=\"struct\" href=\"bitvec/slice/struct.BitSlice.html\" title=\"struct bitvec::slice::BitSlice\">BitSlice</a>&lt;O, V::<a class=\"associatedtype\" href=\"bitvec/view/trait.BitView.html#associatedtype.Store\" title=\"type bitvec::view::BitView::Store\">Store</a>&gt;: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt;,&nbsp;</span>","synthetic":false,"types":["bitvec::array::BitArray"]},{"text":"impl&lt;O, T, Rhs&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt; for <a class=\"struct\" href=\"bitvec/slice/struct.BitSlice.html\" title=\"struct bitvec::slice::BitSlice\">BitSlice</a>&lt;O, T&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class=\"trait\" href=\"bitvec/order/trait.BitOrder.html\" title=\"trait bitvec::order::BitOrder\">BitOrder</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"bitvec/store/trait.BitStore.html\" title=\"trait bitvec::store::BitStore\">BitStore</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;Rhs: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/iter/traits/collect/trait.IntoIterator.html\" title=\"trait core::iter::traits::collect::IntoIterator\">IntoIterator</a>&lt;Item = <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.bool.html\">bool</a>&gt;,&nbsp;</span>","synthetic":false,"types":["bitvec::slice::BitSlice"]},{"text":"impl&lt;O, T, Rhs&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt; for <a class=\"struct\" href=\"bitvec/boxed/struct.BitBox.html\" title=\"struct bitvec::boxed::BitBox\">BitBox</a>&lt;O, T&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class=\"trait\" href=\"bitvec/order/trait.BitOrder.html\" title=\"trait bitvec::order::BitOrder\">BitOrder</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"bitvec/store/trait.BitStore.html\" title=\"trait bitvec::store::BitStore\">BitStore</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class=\"struct\" href=\"bitvec/slice/struct.BitSlice.html\" title=\"struct bitvec::slice::BitSlice\">BitSlice</a>&lt;O, T&gt;: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt;,&nbsp;</span>","synthetic":false,"types":["bitvec::boxed::BitBox"]},{"text":"impl&lt;O, T, Rhs&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt; for <a class=\"struct\" href=\"bitvec/vec/struct.BitVec.html\" title=\"struct bitvec::vec::BitVec\">BitVec</a>&lt;O, T&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class=\"trait\" href=\"bitvec/order/trait.BitOrder.html\" title=\"trait bitvec::order::BitOrder\">BitOrder</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"bitvec/store/trait.BitStore.html\" title=\"trait bitvec::store::BitStore\">BitStore</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a class=\"struct\" href=\"bitvec/slice/struct.BitSlice.html\" title=\"struct bitvec::slice::BitSlice\">BitSlice</a>&lt;O, T&gt;: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;Rhs&gt;,&nbsp;</span>","synthetic":false,"types":["bitvec::vec::BitVec"]}]; implementors["frame_support"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"frame_support/traits/tokens/struct.WithdrawReasons.html\" title=\"struct frame_support::traits::tokens::WithdrawReasons\">WithdrawReasons</a>&gt; for <a class=\"struct\" href=\"frame_support/traits/tokens/struct.WithdrawReasons.html\" title=\"struct frame_support::traits::tokens::WithdrawReasons\">WithdrawReasons</a>","synthetic":false,"types":["frame_support::traits::tokens::misc::WithdrawReasons"]}]; implementors["primitive_types"] = [{"text":"impl&lt;'r&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;&amp;'r <a class=\"struct\" href=\"primitive_types/struct.H128.html\" title=\"struct primitive_types::H128\">H128</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H128.html\" title=\"struct primitive_types::H128\">H128</a>","synthetic":false,"types":["primitive_types::H128"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"primitive_types/struct.H128.html\" title=\"struct primitive_types::H128\">H128</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H128.html\" title=\"struct primitive_types::H128\">H128</a>","synthetic":false,"types":["primitive_types::H128"]},{"text":"impl&lt;'r&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;&amp;'r <a class=\"struct\" href=\"primitive_types/struct.H160.html\" title=\"struct primitive_types::H160\">H160</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H160.html\" title=\"struct primitive_types::H160\">H160</a>","synthetic":false,"types":["primitive_types::H160"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"primitive_types/struct.H160.html\" title=\"struct primitive_types::H160\">H160</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H160.html\" title=\"struct primitive_types::H160\">H160</a>","synthetic":false,"types":["primitive_types::H160"]},{"text":"impl&lt;'r&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;&amp;'r <a class=\"struct\" href=\"primitive_types/struct.H256.html\" title=\"struct primitive_types::H256\">H256</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H256.html\" title=\"struct primitive_types::H256\">H256</a>","synthetic":false,"types":["primitive_types::H256"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"primitive_types/struct.H256.html\" title=\"struct primitive_types::H256\">H256</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H256.html\" title=\"struct primitive_types::H256\">H256</a>","synthetic":false,"types":["primitive_types::H256"]},{"text":"impl&lt;'r&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;&amp;'r <a class=\"struct\" href=\"primitive_types/struct.H512.html\" title=\"struct primitive_types::H512\">H512</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H512.html\" title=\"struct primitive_types::H512\">H512</a>","synthetic":false,"types":["primitive_types::H512"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"primitive_types/struct.H512.html\" title=\"struct primitive_types::H512\">H512</a>&gt; for <a class=\"struct\" href=\"primitive_types/struct.H512.html\" title=\"struct primitive_types::H512\">H512</a>","synthetic":false,"types":["primitive_types::H512"]}]; implementors["region"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"region/struct.Protection.html\" title=\"struct region::Protection\">Protection</a>&gt; for <a class=\"struct\" href=\"region/struct.Protection.html\" title=\"struct region::Protection\">Protection</a>","synthetic":false,"types":["region::protect::Protection"]}]; implementors["subtle"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"subtle/struct.Choice.html\" title=\"struct subtle::Choice\">Choice</a>&gt; for <a class=\"struct\" href=\"subtle/struct.Choice.html\" title=\"struct subtle::Choice\">Choice</a>","synthetic":false,"types":["subtle::Choice"]}]; implementors["tracing_subscriber"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/bit/trait.BitXorAssign.html\" title=\"trait core::ops::bit::BitXorAssign\">BitXorAssign</a>&lt;<a class=\"struct\" href=\"tracing_subscriber/fmt/format/struct.FmtSpan.html\" title=\"struct tracing_subscriber::fmt::format::FmtSpan\">FmtSpan</a>&gt; for <a class=\"struct\" href=\"tracing_subscriber/fmt/format/struct.FmtSpan.html\" title=\"struct tracing_subscriber::fmt::format::FmtSpan\">FmtSpan</a>","synthetic":false,"types":["tracing_subscriber::fmt::format::FmtSpan"]}]; if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
module.exports = { title: 'Web Magic Board', /** * @type {boolean} true | false * 右侧 设置 */ showSettings: false, /** * @type {boolean} true | false * 开启 Tags-View 导航 */ tagsView: true, /** * @type {boolean} true | false * 固定 Header */ fixedHeader: false, /** * @type {boolean} true | false * 侧边栏 Logo */ sidebarLogo: true, /** * @type {boolean} true | false * 菜单支持拼音搜索 */ supportPinyinSearch: true, /** * @type {string | array} 'production' | ['production', 'development'] * @description Need show err logs component. * The default is only used in the production env * If you want to also use it in dev, you can pass ['production', 'development'] */ errorLog: 'production' }
var Feature = require('feature'); if (!require('ua').phantomjs && Feature.isTouchEventSupported()) { require('./double-tap'); require('./tap'); require('./tap-hold'); }
var assert = require('assert'); var request = require('../context').request; describe('req.inspect()', function(){ describe('with no request.req present', function(){ it('should return null', function(){ var req = request(); req.method = 'GET'; delete req.req; assert(null == req.inspect()); }) }) it('should return a json representation', function(){ var req = request(); req.method = 'GET'; req.url = 'example.com'; req.header.host = 'example.com'; req.inspect().should.eql({ method: 'GET', url: 'example.com', header: { host: 'example.com' } }); }) })
define({"topics" : [{"title":"Offset Management","shortdesc":"\n <p class=\"shortdesc\">The first time that a Kafka Consumer origin identified by a consumer group receives messages from a topic, an offset entry\n is created for that consumer group and topic. The offset entry is created in ZooKeeper or Kafka, depending on your Kafka\n version and broker configuration. \n </p>\n ","href":"datacollector\/UserGuide\/Origins\/KConsumer.html#concept_zlc_ppn_js","attributes": {"data-id":"concept_zlc_ppn_js",},"menu": {"hasChildren":false,},"tocID":"concept_zlc_ppn_js-d46e72649","topics":[]},{"title":"Additional Kafka Properties","shortdesc":"\n <p class=\"shortdesc\">You can add custom Kafka configuration properties to the Kafka Consumer.</p>\n ","href":"datacollector\/UserGuide\/Origins\/KConsumer.html#concept_d5f_n2g_vq","attributes": {"data-id":"concept_d5f_n2g_vq",},"menu": {"hasChildren":false,},"tocID":"concept_d5f_n2g_vq-d46e72674","topics":[]},{"title":"Record Header Attributes","href":"datacollector\/UserGuide\/Origins\/KConsumer.html#concept_tlj_3g1_2z","attributes": {"data-id":"concept_tlj_3g1_2z",},"menu": {"hasChildren":false,},"tocID":"concept_tlj_3g1_2z-d46e72709","topics":[]},{"title":"Kafka Security","href":"datacollector\/UserGuide\/Origins\/KConsumer.html#concept_yg3_k31_t5","attributes": {"data-id":"concept_yg3_k31_t5",},"menu": {"hasChildren":false,},"tocID":"concept_yg3_k31_t5-d46e72751","topics":[]},{"title":"Data Formats","href":"datacollector\/UserGuide\/Origins\/KConsumer.html#concept_xgs_nlc_wr","attributes": {"data-id":"concept_xgs_nlc_wr",},"menu": {"hasChildren":false,},"tocID":"concept_xgs_nlc_wr-d46e72803","topics":[]},{"title":"Configuring a Kafka Consumer Origin","shortdesc":"\n <p class=\"shortdesc\">Configure a Kafka Consumer origin to read messages from a Kafka cluster. </p>\n ","href":"datacollector\/UserGuide\/Origins\/KConsumer.html#task_npx_xgf_vq","attributes": {"data-id":"task_npx_xgf_vq",},"menu": {"hasChildren":false,},"tocID":"task_npx_xgf_vq-d46e72865","topics":[]}]});
const fs = require('fs'); function getMainFile() { const dirname = '.next/static/commons'; const files = fs.readdirSync(dirname); const [file] = files .reduce((result, filename) => { if (!/^main-[a-f0-9]+\.js$/.test(filename)) { return result; } const path = `${dirname}/${filename}`; return [...result, { path, ctime: fs.statSync(path).ctimeMs }]; }, []) .sort((x, y) => y.ctime - x.ctime); return file; } module.exports = [ { name: 'The initial cost people pay for using one component', webpack: true, path: 'packages/material-ui/build/Paper/index.js', limit: '17.6 KB', }, { name: 'The size of all the modules of material-ui.', webpack: true, path: 'packages/material-ui/build/index.js', limit: '95.3 KB', }, { name: 'The main bundle of the docs', webpack: false, path: getMainFile().path, limit: '177 KB', }, { name: 'The home page of the docs', webpack: false, path: '.next/bundles/pages/index.js', limit: '6 KB', }, ];
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Produccionstock Schema */ var ProduccionstockSchema = new Schema({ tipo: { type: String,//fomi-{corte-perforado-estampado-huellado},empacado,tiras ensamble,espanson-{herradura-bahia,boom,brisa,gato,cruzada},pvc{plantilla , chancla},TPL1-tiras default: '', required: 'Por favor ingrese el tipo de produccion', trim: true }, cantidad_produccion: {//acumulador de stock type: Number, default: '', trim: true }, peso_produccion: {//acumulador de stock type: Number, default: '', trim: true }, genero: {//niño,niña,hombre,dama type: String, default: '', trim: true }, tamano: {//numero de calzado type: String, default: '', trim: true }, updated: { type: Date, default:'' }, created: { type: Date, default: '' }, user: {//usuario que creo la entrada type: Schema.ObjectId, ref: 'User' } }); mongoose.model('Produccionstock', ProduccionstockSchema);
(function() { var module = angular.module('brew-o-module.controller'); module.controller('RecipeWaterCtrl', function($scope, BrewCalc, WaterReport) { var reports = JSON.parse( window.localStorage.getItem( "waterReport" )); if(!reports) { $scope.updateReport(); }else{ $scope.reports = reports; } $scope.updateReport() = function(){ WaterReport.query(function(reports) { $scope.reports = reports; window.localStorage.setItem( "waterReport", JSON.stringify(reports)); }); } $scope.ions = [ {txt: 'Ca',sup:'+2',key:'ca',balance: 'Ca_balance',showLevel:true,wr:'calcium',type:'cations'}, {txt: 'Mg',sup:'+2',key:'mg',balance: 'Mg_balance',showLevel:true,wr:'magnesium',type:'cations'}, {txt: 'SO',sup:'-2',sub:'4',key:'so4',balance: 'SO4_balance',showLevel:true,wr:'sulfate',type:'anions'}, {txt: 'Na',sup:'+',key:'na',balance: 'Na_balance',showLevel:true,wr:'sodium',type:'cations'}, {txt: 'Cl',sup:'-',key:'cl',balance: 'Cl_balance',showLevel:true,wr:'chloride',type:'anions'}, {txt: 'HCO',sup:'-',sub:'3',key:'hco3',balance: 'SO4Cl_balance',wr:'bicarbonate',type:'anions'}, {txt: 'Alkalinity',key:'alc'} ]; $scope.output = { diluted: new Array(6), diff: new Array(6), salts: new Array(6), result: new Array(6), adjusted: new Array(6) }; $scope.updateSource = function() { var report = $scope.getReport($scope.recipe.water.selectedSource); if ( report ) { for ( var i=0;i<$scope.ions.length-1;i++) { var ion = $scope.ions[i]; $scope.recipe.water.source[ion.key] = report[ion.type][ion.wr]; } $scope.onChange(); } }; $scope.sourceEqual = function() { var report = $scope.getReport($scope.recipe.water.selectedSource); if ( report ) { var ret = true; for ( var i=0;i<$scope.ions.length-1;i++) { var ion = $scope.ions[i]; ret = ret && ($scope.recipe.water.source[ion.key] === report[ion.type][ion.wr]); } return ret; } else { return false; } }; $scope.updateTarget = function() { var report = $scope.getReport($scope.recipe.water.selectedTarget); if ( report ) { for ( var i=0;i<$scope.ions.length-1;i++) { var ion = $scope.ions[i]; $scope.recipe.water.target[ion.key] = report[ion.type][ion.wr]; } $scope.onChange(); } }; $scope.targetEqual = function() { var report = $scope.getReport($scope.recipe.water.selectedTarget); if ( report ) { var ret = true; for ( var i=0;i<$scope.ions.length-1;i++) { var ion = $scope.ions[i]; ret = ret && ($scope.recipe.water.target[ion.key] === report[ion.type][ion.wr]); } return ret; } else { return false; } }; $scope.getReport = function(id) { if ( $scope.reports ) { var ret = null; angular.forEach($scope.reports, function(report) { if (report._id === id) { ret = report; } }); return ret; } }; $scope.getLiters = function() { var total = BrewCalc.calculateBoilSize($scope.recipe.BATCH_SIZE, $scope.recipe.TrubChillerLosses, $scope.recipe.BOIL_TIME, $scope.recipe.PercentEvap, $scope.recipe.TopUpWater) +$scope.recipe.SpargeDeadSpace +$scope.recipe.GrainAbsorbtion*$scope.recipe.totalAmountMash; $scope.recipe.water.liters = Math.round(total); $scope.onChange(); }; $scope.suggest = function() { var input = { dilution: $scope.recipe.water.dilution, mashvolume: $scope.recipe.water.liters, source: convertArray($scope.recipe.water.source), target: convertArray($scope.recipe.water.target), CaCO3: $scope.recipe.water.CaCO3, NaHCO3: $scope.recipe.water.NaHCO3, CaSO4: $scope.recipe.water.CaSO4, CaCl2: $scope.recipe.water.CaCl2, MgSO4: $scope.recipe.water.MgSO4, NaCl: $scope.recipe.water.NaCl }; var suggest = BrewCalc.suggestWaterCalculation(input, { diluted: new Array(6), diff: new Array(6), salts: new Array(6), result: new Array(6), adjusted: new Array(6) }); $scope.recipe.water.CaCO3 = suggest.CaCO3; $scope.recipe.water.NaHCO3 = suggest.NaHCO3; $scope.recipe.water.CaSO4 = suggest.CaSO4; $scope.recipe.water.CaCl2 = suggest.CaCl2; $scope.recipe.water.MgSO4 = suggest.MgSO4; $scope.recipe.water.NaCl = suggest.NaCl; $scope.onChange(); }; $scope.onChange = function() { var input = { dilution: $scope.recipe.water.dilution, mashvolume: $scope.recipe.water.liters, source: convertArray($scope.recipe.water.source), target: convertArray($scope.recipe.water.target), CaCO3: $scope.recipe.water.CaCO3, NaHCO3: $scope.recipe.water.NaHCO3, CaSO4: $scope.recipe.water.CaSO4, CaCl2: $scope.recipe.water.CaCl2, MgSO4: $scope.recipe.water.MgSO4, NaCl: $scope.recipe.water.NaCl }; BrewCalc.waterCalculation(input, $scope.output); $scope.recipe.water.source.alc = input.source[6]; }; function convertArray(ions) { var ret = []; angular.forEach($scope.ions, function(ion) { ret.push(ions[ion.key]); }) return ret; }; $scope.onChange(); }) .filter('result', function() { return function(value) { if ( value > 0 ) { return '+ ' + value; } if ( value === 0 ) { return '0'; } else { return '- '+(-value); } } }); })();
import app from './server' import config from 'config' import { runLastBlockJob } from './jobs/invoices' import { runCallbackJob } from './jobs/callbacks' app.listen(config.listen, _ => console.log("Listening on port",config.listen)) runLastBlockJob() runCallbackJob()
import {makeSVG, jitter} from './utils.js'; function make_key(x, y, z) { return [x, y, z].join('.') } function is_visited(x, y, z, lookup, max_x, max_y) { if (x >= max_x || x < 0) { return true } else if (y >= max_y || y < 0) { return true } else if (lookup.hasOwnProperty(make_key(x, y, z))) { return true } return false } function mark(x, y, z, lookup) { lookup[make_key(x, y, z)] = true } function regenerate () { console.log('START tree') var SVG_ID = '#canvas' var N_X = 13 var N_Y = 13 var N_Z = 13 var N_BRANCHES = 5 var STROKE_WIDTH = 2; // warm leaves var colors = [ chroma.rgb(224, 27, 23), chroma.rgb(224, 200, 50), chroma.rgb(224, 116, 45) ] var colors = [ chroma.rgb(238, 203, 225), chroma.rgb(155, 39, 61), chroma.rgb(220, 136, 168), ] // make an svg with a viewbox var s = makeSVG(SVG_ID, N_X, N_Y) var visited = {} var n_branches = 0 while (n_branches < N_BRANCHES) { var points = [] var x = ~~(N_X / 2) var y = ~~(N_Y / 2) var z = 0 while (z <= N_Z) { var amount = 1 points.push([ x + 0.5 + jitter(amount), y + 0.5 + jitter(amount), z + 0.5 + jitter(amount) ]) mark(x, y, z, visited) var new_x = x + _.sample([-1, 0, 1]) var new_y = y + _.sample([-1, 0, 1]) if (Math.random() < 0.9) { var new_z = z + 1 } else { var new_z = z } while (is_visited(new_x, new_y, new_z, visited, N_X - 1, N_Y - 1)) { new_x = x + _.sample([-1, 0, 1]) new_y = y + _.sample([-1, 0, 1]) if (Math.random() < 0.9) { new_z = z + 1 } else { new_z = z } } x = new_x y = new_y z = new_z } points.reverse() _.each(_.range(points.length - 1), function (i) { var a = points[i] var b = points[i + 1] var depth = 0.5 * (a[2] + b[2]) var color = chroma.mix('black', 'white', depth / N_Z).hex() console.log(a, b, depth, color) var l = s.line(a[0], a[1], b[0], b[1]) l.attr({ stroke: color, strokeWidth: i * (1 / points.length), strokeLinecap: 'round' }); }); n_branches += 1 } var n_dots = 0 var N_DOTS = 1000 while (n_dots < N_DOTS) { s.circle(N_X * Math.random(), N_Y * Math.random(), 0.3 * Math.random()).attr({ stroke: 'none', fill: _.sample(colors), }) n_dots += 1 } }
import React, { Component } from 'react'; import { string } from 'prop-types'; import classNames from 'classnames'; import { FormattedMessage } from '../../../util/reactIntl'; import { lazyLoadWithDimensions } from '../../../util/contextHelpers'; import { NamedLink } from '../../../components'; import css from './SectionFilteredSearches.module.css'; // Update images by saving images to src/LandingPage/SeactionFilteredSearches/images directory. // If those images have been saved with the same name, no need to make changes to these imports. import imageForFilter1 from './images/imageForFilter1_648x448.jpg'; import imageForFilter2 from './images/imageForFilter2_648x448.jpg'; import imageForFilter3 from './images/imageForFilter3_648x448.jpg'; // Thumbnail image for the search "card" class ThumbnailImage extends Component { render() { const { alt, ...rest } = this.props; return <img alt={alt} {...rest} />; } } // Load the image only if it's close to viewport (user has scrolled the page enough). const LazyImage = lazyLoadWithDimensions(ThumbnailImage); // Create a "card" that contains a link to filtered search on SearchPage. const FilterLink = props => { const { name, image, link } = props; const url = typeof window !== 'undefined' ? new window.URL(link) : new global.URL(link); const searchQuery = url.search; const nameText = <span className={css.searchName}>{name}</span>; return ( <NamedLink name="SearchPage" to={{ search: searchQuery }} className={css.searchLink}> <div className={css.imageWrapper}> <div className={css.aspectWrapper}> <LazyImage src={image} alt={name} className={css.searchImage} /> </div> </div> <div className={css.linkText}> <FormattedMessage id="SectionFilteredSearches.filteredSearch" values={{ filter: nameText }} /> </div> </NamedLink> ); }; // Component that shows full-width section on LandingPage. // Inside it shows 3 "cards" that link to SearchPage with specific filters applied. const SectionFilteredSearches = props => { const { rootClassName, className } = props; const classes = classNames(rootClassName || css.root, className); // FilterLink props: // - "name" is a string that defines what kind of search the link is going to make // - "image" is imported from images directory and you can update it by changing the file // - "link" should be copy-pasted URL from search page. // The domain doesn't matter, but search query does. (I.e. "?pub_brand=nike") return ( <div className={classes}> <div className={css.title}> <FormattedMessage id="SectionFilteredSearches.title" /> </div> <div className={css.filteredSearches}> <FilterLink name="Ρούχα" image={imageForFilter1} link="http://localhost:3000/s?pub_size=1" /> <FilterLink name="Παπούτσια" image={imageForFilter2} link="http://localhost:3000/s?pub_size=2" /> <FilterLink name="Αξεσουάρ" image={imageForFilter3} link="http://localhost:3000/s?pub_size=3" /> </div> </div> ); }; SectionFilteredSearches.defaultProps = { rootClassName: null, className: null }; SectionFilteredSearches.propTypes = { rootClassName: string, className: string, }; export default SectionFilteredSearches;
import PropTypes from "prop-types"; import React, { useEffect } from "react"; import { useHistory } from "react-router-dom"; import { connect } from "react-redux"; import Button from "@material-ui/core/Button"; import ListTable from "../../components/table/ListTable"; // import SpecDialog from "./SpecDialog"; import { setSpec, fetchSpecs, } from "../../redux/spec/spec.actions"; const columns = [ { field: "createUTC", label: "Created Date", type: "date" }, { field: "name", label: "Spec Name" }, { field: "description", label: "Description" }, { field: "status", label: "Status" }, { field: "brand", label: "Brand", type: "object", property: "name", }, { field: "actions", label: "Actions" }, ]; const defaultSort = ["createUTC", 1]; const DEFAULT_SPEC = { _id: "", logoUrl: "", name: "", description: "", status: "", brand: "", createUTC: "", actions: "", }; const SpecListPage = ({ specs, setSpec, fetchSpecs, }) => { const history = useHistory(); useEffect(() => { setSpec(DEFAULT_SPEC); }, []); useEffect(() => { fetchSpecs(); }, [fetchSpecs]); const handleOpenSpecDialog = () => { setSpec(DEFAULT_SPEC); history.push("/specs/new"); }; const handleEditRow = (row) => { setSpec(row); setTimeout(() => { history.push(`/specs/${row._id}`); }, 100) }; return ( <div> <Button variant="contained" color="primary" onClick={handleOpenSpecDialog} > Add </Button> {specs && ( <ListTable label="spec" defaultSort={defaultSort} columns={columns} rows={specs} onEditRow={handleEditRow} /> )} </div> ); }; SpecListPage.propTypes = { fetchSpecs: PropTypes.func, setSpec: PropTypes.func, specs: PropTypes.any, } const mapStateToProps = (state) => ({ specs: state.specs, }); export default connect(mapStateToProps, { setSpec, fetchSpecs, })(SpecListPage);
import React from 'react' import {Helmet} from 'react-helmet' import {useStaticQuery, graphql} from "gatsby" const Metadata = ({ title, description }) => { const data = useStaticQuery( graphql` query { site { siteMetadata { title description } } } ` ) const metaTitle = title || data.site.siteMetadata.title const metaDescription = description || data.site.siteMetadata.description return ( <Helmet> <title>{`${metaTitle} | ${data.site.siteMetadata.title}`}</title> <meta name="description" content={metaDescription} /> </Helmet> ) } export default Metadata
/** * * Tests for InstagramPic * * @see https://github.com/react-boilerplate/react-boilerplate/tree/master/docs/testing * */ import React from 'react'; import { render } from 'react-testing-library'; import { IntlProvider } from 'react-intl'; // import 'jest-dom/extend-expect'; // add some helpful assertions import InstagramPic from '../index'; import { DEFAULT_LOCALE } from '../../../i18n'; describe('<InstagramPic />', () => { it('Expect to not log errors in console', () => { const spy = jest.spyOn(global.console, 'error'); render( <IntlProvider locale={DEFAULT_LOCALE}> <InstagramPic /> </IntlProvider>, ); expect(spy).not.toHaveBeenCalled(); }); it('Expect to have additional unit tests specified', () => { expect(true).toEqual(false); }); /** * Unskip this test to use it * * @see {@link https://jestjs.io/docs/en/api#testskipname-fn} */ it.skip('Should render and match the snapshot', () => { const { container: { firstChild }, } = render( <IntlProvider locale={DEFAULT_LOCALE}> <InstagramPic /> </IntlProvider>, ); expect(firstChild).toMatchSnapshot(); }); });
'use strict' import { settings, game } from '../main.js' settings.title = 'A First Step...' settings.author = 'The Pixie' settings.version = '1.2' settings.thanks = ['Kyle', 'Lara'] settings.noTalkTo = false settings.noAskTell = false settings.tests = true settings.textEffectDelay = 100 settings.imagesFolder = 'images' settings.status = [ 'hitpoints', function () { return '<td>Spell points:</td><td>3</td>' }, function () { return '<td>Health points:</td><td>' + game.player.hitpoints + '</td>' }, function () { return '<td colspan="2">' + game.player.status + '</td>' } ] settings.intro = 'This is a quick example of what can be done in Quest 6.|Your objective is to turn on the light in the basement, but there are, of course, numerous hoops to jump through.|If you are successful, see if you can do it again, but getting Kyle to do everything. You should find that you can tell an NPC to do pretty much anything (except look at things for you and talk to people for you).'
/* Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.gfx.arc"]){ dojo._hasResource["dojox.gfx.arc"]=true; dojo.provide("dojox.gfx.arc"); dojo.require("dojox.gfx.matrix"); (function(){ var m=dojox.gfx.matrix,_2=function(_3){ var _4=Math.cos(_3),_5=Math.sin(_3),p2={x:_4+(4/3)*(1-_4),y:_5-(4/3)*_4*(1-_4)/_5}; return {s:{x:_4,y:-_5},c1:{x:p2.x,y:-p2.y},c2:p2,e:{x:_4,y:_5}}; },_7=2*Math.PI,_8=Math.PI/4,_9=Math.PI/8,_a=_8+_9,_b=_2(_9); dojo.mixin(dojox.gfx.arc,{unitArcAsBezier:_2,curvePI4:_b,arcAsBezier:function(_c,rx,ry,_f,_10,_11,x,y){ _10=Boolean(_10); _11=Boolean(_11); var _14=m._degToRad(_f),rx2=rx*rx,ry2=ry*ry,pa=m.multiplyPoint(m.rotate(-_14),{x:(_c.x-x)/2,y:(_c.y-y)/2}),_18=pa.x*pa.x,_19=pa.y*pa.y,c1=Math.sqrt((rx2*ry2-rx2*_19-ry2*_18)/(rx2*_19+ry2*_18)); if(isNaN(c1)){ c1=0; } var ca={x:c1*rx*pa.y/ry,y:-c1*ry*pa.x/rx}; if(_10==_11){ ca={x:-ca.x,y:-ca.y}; } var c=m.multiplyPoint([m.translate((_c.x+x)/2,(_c.y+y)/2),m.rotate(_14)],ca); var _1d=m.normalize([m.translate(c.x,c.y),m.rotate(_14),m.scale(rx,ry)]); var _1e=m.invert(_1d),sp=m.multiplyPoint(_1e,_c),ep=m.multiplyPoint(_1e,x,y),_21=Math.atan2(sp.y,sp.x),_22=Math.atan2(ep.y,ep.x),_23=_21-_22; if(_11){ _23=-_23; } if(_23<0){ _23+=_7; }else{ if(_23>_7){ _23-=_7; } } var _24=_9,_25=_b,_26=_11?_24:-_24,_27=[]; for(var _28=_23;_28>0;_28-=_8){ if(_28<_a){ _24=_28/2; _25=_2(_24); _26=_11?_24:-_24; _28=0; } var c1,c2,e,M=m.normalize([_1d,m.rotate(_21+_26)]); if(_11){ c1=m.multiplyPoint(M,_25.c1); c2=m.multiplyPoint(M,_25.c2); e=m.multiplyPoint(M,_25.e); }else{ c1=m.multiplyPoint(M,_25.c2); c2=m.multiplyPoint(M,_25.c1); e=m.multiplyPoint(M,_25.s); } _27.push([c1.x,c1.y,c2.x,c2.y,e.x,e.y]); _21+=2*_26; } return _27; }}); })(); }
//devmode_service.js var serviceName = "com.palm.service.devmode"; var Service = require("webos-service"); var node_fs = require("fs"); var pmlog = require("pmloglib"); var console = new pmlog.Console(serviceName); var node_child = require("child_process"); var testMode = false; if (process.argv.indexOf("--testmode") !== -1) { testMode = true; console.log("*** Test mode - reboot disabled ***"); } var service = new Service(serviceName); service.register("getDevMode", function(message) { //console.log(">>>>>>> in GetDevModeCommandAssistant"); console.log ("%j", message.payload); var prefs_dir = "/var/luna/preferences/"; var enabled_file = prefs_dir+"devmode_enabled"; var is_enabled = false; // Is DevMode currently on? try { node_fs.openSync(enabled_file, 'r'); is_enabled = true; } catch(err) {} console.log ("DevMode is currently " + (is_enabled ? "enabled" : "disabled")); // Return enabled=true if file exists, which should mean DevMode is on // (since we force a reboot immediately after enabling or disabling it) message.respond({"enabled":is_enabled, "returnValue":true}); }); service.register("setDevMode", function(message) { console.log("%j", message.payload); var callingAppID = message.sender; var set_enabled = message.payload.enabled; // If calling from the test script, don't reboot. But require that the service is started in a particular test mode if (callingAppID === "com.palm.service.devmode.test") { if (!testMode) { message.respond({ returnValue: false, errorText: "SetDevMode: Test mode not enabled. Restart devmode service with --testmode option", errorCode: 10 }); return; } } // NOTE: Add com.palm.service.devmode to palm_jail_pardons in /usr/bin/run-js-service // if palm_jail is re-enabled (so we can write to /var/luna/preferences) var prefs_dir = "/var/luna/preferences/"; var enabled_file = prefs_dir + "devmode_enabled"; var is_enabled = false; var reboot_needed = false; // Is DevMode currently on? try { node_fs.openSync(enabled_file, 'r'); is_enabled = true; } catch(err) {} console.log("DevMode was " + (is_enabled ? "enabled" : "disabled")); if (typeof set_enabled === "boolean") { if (set_enabled) { // Request to turn DevMode ON if (!is_enabled) { // Create DevMode file node_fs.writeFileSync(enabled_file, "", 'utf8', function(err) { if (err) { message.respond({ errorText: "write of "+enabled_file+" failed", errorCode: 1, returnValue: false }); return; } }); try { node_fs.openSync(prefs_dir + "dc0", 'r'); } catch(err) {} node_fs.writeFileSync(prefs_dir + "dc0", "", 'utf8', function(err) { if (err) { message.respond({ errorText: "write of "+prefs_dir + "dc0"+" failed", errorCode: 1, returnValue: false }); return; } }); // And reboot! reboot_needed = true; } } else { // Request to turn DevMode OFF if (is_enabled) { // Remove DevMode file node_fs.unlinkSync(enabled_file); for(i = 0 ; i < 10 ; i++) { try { node_fs.unlinkSync(prefs_dir + "dc" + i); } catch(err) {} } // And reboot! reboot_needed = true; } } } else { // "enabled" parameter was missing or not boolean message.respond({ returnValue: false, errorText: "SetDevMode: enabled parameter must exist and be true or false", errorCode: 42 }); return; } if (reboot_needed) { if (!testMode) { node_child.exec("reboot", function(err) { if (err) { message.respond({ errorText: "exec of 'reboot' failed", message: err.toString(), returnValue: false, errorCode: 3 }); } }); } else { console.log("skipping reboot"); } } message.respond({ "returnValue": true }); }); service.register("getPassphrase", function(message) { var callingAppID = message.sender; service.call("luna://com.palm.systemservice/deviceInfo/query", {parameters: ["nduid"]}, function(response) { if (response.payload.nduid) { message.respond({ passphrase: response.payload.nduid.slice(0,6).toUpperCase() }); } else { message.respond({ returnValue: false, errorText: "getPassphrase: nduid not received from systemservice", errorCode: 12 }); } }); });
import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; const FileCode = forwardRef(({ color, size, ...rest }, ref) => { return ( <svg ref={ref} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width={size} height={size} fill={color} {...rest} > <path fillRule="evenodd" d="M4 0h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H4z" /> <path fillRule="evenodd" d="M8.646 5.646a.5.5 0 0 1 .708 0l2 2a.5.5 0 0 1 0 .708l-2 2a.5.5 0 0 1-.708-.708L10.293 8 8.646 6.354a.5.5 0 0 1 0-.708zm-1.292 0a.5.5 0 0 0-.708 0l-2 2a.5.5 0 0 0 0 .708l2 2a.5.5 0 0 0 .708-.708L5.707 8l1.647-1.646a.5.5 0 0 0 0-.708z" /> </svg> ); }); FileCode.propTypes = { color: PropTypes.string, size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; FileCode.defaultProps = { color: 'currentColor', size: '1em', }; export default FileCode;
const Engine = Matter.Engine; const World = Matter.World; const Bodies = Matter.Bodies; const Body = Matter.Body; var btn2; var ground1 var angle=60 function setup() { createCanvas(400,400) engine = Engine.create(); world = engine.world; var ball_options = { restitution: 0.95, frictionAir:0.01 } var ground_options ={ isStatic: true }; btn2 = createImg('up.png'); btn2.position(20,30); btn2.size(50,50); btn2.mouseClicked(vForce); ground = Bodies.rectangle(100,400,400,20,ground_options); World.add(world,ground); ground1 = Bodies.rectangle(100,300,100,20,ground_options) World.add(world,ground1) ball = Bodies.circle(100,10,20,ball_options); World.add(world,ball); rectMode(CENTER); ellipseMode(RADIUS); } function draw() { background(51); Engine.update(engine); Matter.Body.rotate(ground1,angle) ellipse(ball.position.x,ball.position.y,20); rect(ground.position.x,ground.position.y,500,20); push() translate(ground1.position.x,ground1.position.y) rotate(angle) rect(0,0,100,20) pop() angle = angle +0.1 console.log(ground.position.y) } function vForce() { Matter.Body.applyForce(ball,{x:0,y:0},{x:0,y:-0.05}); }
;(function(global){ var MAX_DELAY = 5 * 1000, MIN_DELAY = 10, dt = 5; var emitterFunctions = ["on", "addListener", "removeListener", "removeAllListeners"]; var noop = function(){}; var nextDelay = function(last){ return Math.min(last * dt, MAX_DELAY); }; var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; var uuid = function(){ var i, out = ""; for(i = 0; i < 10; i++) out += chars.charAt(Math.random() * chars.length | 0); return out; }; Object.size = function(obj){ var size = 0, key; for(key in obj){ if(obj.hasOwnProperty(key)) size++; } return size; }; Object.shallowCopy = function(obj){ var key, copy = {}; for(key in obj){ if(obj.hasOwnProperty(key)) copy[key] = obj[key]; } return copy; }; // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys if (!Object.keys) { Object.keys = (function() { 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function(obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); } var Monitor = function(socket, emitter){ this._socket = socket; this._inTransit = {}; this._emitter = emitter; }; Monitor.prototype.sendMessage = function(data, callback){ if(typeof data === "string") data = JSON.parse(data); data.uuid = uuid(); if(!this._inTransit[data.rpc]) this._inTransit[data.rpc] = {}; this._inTransit[data.rpc][data.uuid] = callback || noop; this._socket.send(JSON.stringify(data)); }; Monitor.prototype.callCallback = function(data){ var fn = null; if(data.rpc && data.uuid) fn = this._inTransit[data.rpc][data.uuid]; if(fn && typeof fn === "function"){ if(data.error) fn(data.error); else fn(null, data.resp); delete this._inTransit[data.rpc][data.uuid]; if(Object.size(this._inTransit[data.rpc]) === 0) delete this._inTransit[data.rpc]; } }; Monitor.prototype.handleResponse = function(data){ this.callCallback(data); if (data.channel) { this._emitter.emit("message", data.channel, data.message); } }; var rpcResponse = function(error, resp, instance, data){ var res = {}; if(error) res.error = error.message || error; else res.data = resp; var out = { rpc: "_rpc", fid: data.fid, resp: res }; instance._socket.send(JSON.stringify(out)); }; var handleInternal = function(instance, command, data){ if(command === "subscribe"){ instance._channels[data.channel] = true; instance._monitor.callCallback(data); }else if(command === "unsubscribe"){ delete instance._channels[data.channel]; }else if(command === "rpc"){ var fn = instance._actions; data.command.split(".").forEach(function(s){ fn = fn && fn[s] ? fn[s] : null; }); if(fn && typeof fn === "function"){ fn(data.args, function(error, resp){ rpcResponse(error, resp, instance, data); }); } } }; var attemptReconnect = function(tokenSocket){ tokenSocket._connectTimer = setTimeout(function(instance){ resetConnection(instance, function(error){ if(error){ instance._emitter.emit("reconnect", error); attemptReconnect(instance); }else{ instance._emitter.emit("reconnect"); } }); }, tokenSocket._connectDelay, tokenSocket); tokenSocket._connectDelay = nextDelay(tokenSocket._connectDelay); }; var formEncode = function(obj, prefix) { var prop, out = []; for(prop in obj){ if(!obj.hasOwnProperty(prop) || (typeof obj[prop] === "string" && obj[prop].length < 1)) continue; var key = prefix ? prefix + "[" + prop + "]" : prop, val = obj[prop]; out.push(typeof val == "object" ? formEncode(val, key) : encodeURIComponent(key) + "=" + encodeURIComponent(val)); } return out.join("&"); }; var request = function(options, data, callback){ options = Object.shallowCopy(options); if(options.dataType && options.dataType.toLowerCase() === "jsonp"){ var callbackKey = "token_callback_" + new Date().getTime() + "_" + (Math.round(Math.random() * 1e16)).toString(36); var script = global.document.createElement("script"); global[callbackKey] = function(resp) { global.document.body.removeChild(script); delete global[callbackKey]; if(typeof resp === "string"){ try{ resp = JSON.parse(resp); }catch(e){ return callback(new Error(resp || "Error making jsonp request!")); } } callback(resp && resp.error ? resp.error : null, resp); }; script.onerror = function(e){ global.document.body.removeChild(script); delete global[callbackKey]; callback(new Error("Error making jsonp request!")); return false; }; script.onload = function(e){ return false; }; script.src = options.url + (options.url.indexOf("?") > 0 ? "&" : "?") + "callback=" + callbackKey + "&" + formEncode(data || {}); global.document.body.appendChild(script); }else{ var xhr = new global.XMLHttpRequest(); options.url += (data && options.url.indexOf("?") > 0 ? "&" : "?") + formEncode(data || {}); xhr.open(options.method, options.url, true); xhr.onreadystatechange = function(){ if(xhr.readyState === 4){ var msg = xhr.target ? xhr.target.responseText : xhr.responseText; try{ msg = JSON.parse(msg); }catch(ev){} if(xhr.status >= 200 && xhr.status < 300) callback(null, msg); else callback(msg && msg.error ? new Error(msg.error) : msg instanceof Error ? msg : new Error(msg || "Error making HTTP request")); } }; xhr.setRequestHeader("Accept", "application/json"); xhr.send(); } }; var resetConnection = function(tokenSocket, callback){ request(tokenSocket._opts, tokenSocket._authentication, function(error, resp){ if(error || !resp || !resp.token){ error = error || new Error("No token found!"); return typeof callback === "string" ? tokenSocket._emitter.emit(callback, error) : callback(error); } tokenSocket._token = resp.token; tokenSocket._socket = new global.SockJS(tokenSocket._apiRoute + tokenSocket._socketPrefix, null, tokenSocket._sockjs); tokenSocket._socket.onopen = function(){ tokenSocket._monitor.sendMessage({ rpc: "auth", token: tokenSocket._token }, function(error, resp){ callback = typeof callback === "string" ? tokenSocket._emitter.emit.bind(tokenSocket._emitter, callback) : callback; if(error){ callback(error); }else{ delete tokenSocket._closed; clearInterval(tokenSocket._connectTimer); delete tokenSocket._connectTimer; tokenSocket._connectDelay = MIN_DELAY; replay(tokenSocket); callback(); } }); }; tokenSocket._monitor = new Monitor(tokenSocket._socket, tokenSocket._emitter); tokenSocket._socket.onmessage = function(e){ try{ e.data = JSON.parse(e.data); }catch(ev){ return; } if(e.data.internal) handleInternal(tokenSocket, e.data.command, e.data.data); else tokenSocket._monitor.handleResponse(e.data); }; tokenSocket._socket.onclose = function(){ tokenSocket._closed = true; if(tokenSocket._reconnect) attemptReconnect(tokenSocket); }; }); }; var checkAndUseConnection = function(tokenSocket, callback){ if(tokenSocket._closed) tokenSocket._queue.push({ fn: callback }); else callback(); }; var replay = function(tokenSocket){ for(var channel in tokenSocket._channels) tokenSocket.subscribe(channel); tokenSocket._queue.forEach(function(curr){ if(curr.fn && typeof curr.fn === "function") curr.fn(); }); tokenSocket._queue = []; }; var TokenSocket = function(options, actions){ var self = this; self._emitter = new EventEmitter(); emitterFunctions.forEach(function(fn){ self[fn] = self._emitter[fn]; }); self._closed = true; if(!options) options = {}; if(!self._ready && typeof options.ready === "function") self.ready(options.ready); if(!self._onreconnect && typeof options.onreconnect === "function") self.onreconnect(options.onreconnect); if(!options.host) options.host = global.location.host; self._reconnect = typeof options.reconnect === "undefined" ? true : options.reconnect; self._channels = {}; self._ping = options.ping || false; self._sockjs = options.sockjs || {}; self._apiRoute = options.host.indexOf("http") < 0 ? global.location.protocol + "//" + options.host : options.host; self._socketPrefix = options.socketPrefix || "/sockets"; self._tokenPath = options.tokenPath || "/socket/token"; self._actions = typeof actions === "object" ? actions : {}; self._authentication = options.authentication || {}; self._queue = []; self._connectDelay = MIN_DELAY; self._connectTimer = null; self._opts = { method: "GET", url: self._apiRoute + self._tokenPath, dataType: options.host !== global.location.host ? "jsonp" : "json" }; if(self._ping && self._ping > 0){ self._pingTimer = setInterval(function(){ if(!self._closed) self.rpc("_ping", {}); }, self._ping); } resetConnection(self, "ready"); }; TokenSocket.prototype.ready = function(callback){ this._emitter.on("ready", callback); }; TokenSocket.prototype.onreconnect = function(callback){ this._emitter.on("reconnect", callback); }; TokenSocket.prototype.channels = function(){ return Object.keys(this._channels); }; // @rpc is the controller action TokenSocket.prototype.rpc = function(rpc, data, callback){ var self = this; checkAndUseConnection(self, function(){ self._monitor.sendMessage({ rpc: rpc, req: data }, callback); }); }; TokenSocket.prototype.register = function(actions){ this._actions = actions; }; TokenSocket.prototype.subscribe = function(channel, callback){ var self = this; checkAndUseConnection(self, function(){ self._channels[channel] = true; self._monitor.sendMessage({ rpc: "_subscribe", req: { channel: channel } }, callback); }); }; TokenSocket.prototype.unsubscribe = function(channel, callback){ var self = this; checkAndUseConnection(self, function(){ delete self._channels[channel]; self._monitor.sendMessage({ rpc: "_unsubscribe", req: { channel: channel } }, callback); }); }; TokenSocket.prototype.publish = function(channel, data, callback){ var self = this; checkAndUseConnection(self, function(){ self._monitor.sendMessage({ rpc: "_publish", req: { channel: channel, data: data } }, callback); }); }; TokenSocket.prototype.broadcast = function(data, callback){ var self = this; checkAndUseConnection(self, function(){ self._monitor.sendMessage({ rpc: "_broadcast", req: { data: data } }, callback); }); }; TokenSocket.prototype.onmessage = function(callback){ this._emitter.on("message", callback); }; TokenSocket.prototype.end = function(callback){ this._emitter.removeAllListeners("ready"); this._emitter.removeAllListeners("reconnect"); this._emitter.removeAllListeners("message"); this._closed = true; this._socket.onclose = callback; this._socket.close(); }; global.TokenSocket = TokenSocket; }(typeof window === "undefined" ? {} : window));
/* * Copyright 2015-2019 The OpenZipkin Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ const buildOrderedConditionKeyOptions = autocompleteKeys => ([ 'serviceName', 'spanName', 'minDuration', 'maxDuration', ...autocompleteKeys, 'tags', 'remoteServiceName', ]); export const buildConditionKeyOptions = (currentConditionKey, conditions, autocompleteKeys) => { const existingConditions = {}; conditions.forEach((condition) => { if (condition.key === 'tags') { return; } existingConditions[condition.key] = true; }); return buildOrderedConditionKeyOptions(autocompleteKeys).map((conditionKeyOption) => { if (conditionKeyOption === currentConditionKey) { return { conditionKey: conditionKeyOption, isDisabled: false }; } if (existingConditions[conditionKeyOption]) { return { conditionKey: conditionKeyOption, isDisabled: true }; } return { conditionKey: conditionKeyOption, isDisabled: false }; }); }; export const retrieveNextConditionKey = (conditions, autocompleteKeys) => { const conditionKeyOptions = buildOrderedConditionKeyOptions(autocompleteKeys); const existingConditions = {}; conditions.forEach((condition) => { existingConditions[condition.key] = true; }); for (let i = 0; i < conditionKeyOptions.length; i += 1) { const conditionKey = conditionKeyOptions[i]; if (!existingConditions[conditionKey]) { return conditionKey; } } return 'tags'; }; export const retrieveDefaultConditionValue = (conditionKey) => { switch (conditionKey) { case 'serviceName': return ''; case 'remoteServiceName': return ''; case 'spanName': return undefined; case 'minDuration': return 0; case 'maxDuration': return 0; case 'tags': return ''; default: // autocompleteKeys return undefined; } };
/** * SPDX-License-Identifier: Apache-2.0 */ const helper = require('../../../common/helper'); const logger = helper.getLogger('NetworkService'); /** * * * @class NetworkService */ class NetworkService { /** * Creates an instance of NetworkService. * @param {*} platform * @memberof NetworkService */ constructor(platform) { this.platform = platform; } /** * * * @returns * @memberof NetworkService */ async networkList() { // Get the list of the networks from the configuration that was loaded from the config.json const networklist = []; const networks = this.platform.getNetworks(); const iterator = networks.entries(); for (const value of iterator) { networklist.push(value); } logger.log('Network list ', networklist); return networklist; } } module.exports = NetworkService;
class Player { constructor(x, y, radius, color) { this.x = x; this.y = y; this.radius = radius; this.color = color; } }; export default Player;
// revisão sobre objetos const produto = new Object produto.nome = 'Cadeira' produto['marca do produto'] = 'Generica' produto.preco = 220 console.log(produto) delete produto.preco delete produto['marca do produto'] console.log(produto) const carro = { modelo: 'a4', valor: 89000, proprietario: { nome: 'Raul', idade: 56, endereco: { logradouro: 'rua abc', numero: 123 } }, condutores: [{ nome: 'Junior', idade: 19 }, { nome: 'Ana', idade: 42 }], calcularValorSeguro: function() { //... } } carro.proprietario.endereco.numero = 1000 carro['proprietario']['endereco']['logradouro'] = 'av gigante' console.log(carro) delete carro.condutores delete carro.proprietario.endereco delete carro.calcularValorSeguro console.log(carro) console.log(carro.condutores) // console.log(carro.condutores.length) // vai dar erro por ser undefined
// Karma configuration // Generated on Tue Sep 01 2015 12:55:42 GMT+0200 (CEST) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine', 'jasmine-sinon'], // list of files / patterns to load in the browser files: [ 'lib/*.js', 'tests/*.js' ], // list of files to exclude exclude: [ ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['PhantomJS', 'Firefox', 'Chrome'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false }) }
/* * * NOTE: The client side of hack.chat is currently in development, * a new, more modern but still minimal version will be released * soon. As a result of this, the current code has been deprecated * and will not actively be updated. * */ // initialize markdown engine var markdownOptions = { html: false, xhtmlOut: false, breaks: true, langPrefix: '', linkify: true, linkTarget: '_blank" rel="noreferrer', typographer: true, quotes: `""''`, doHighlight: true, highlight: function (str, lang) { if (!markdownOptions.doHighlight || !window.hljs) { return ''; } if (lang && hljs.getLanguage(lang)) { try { return hljs.highlight(lang, str).value; } catch (__) {} } try { return hljs.highlightAuto(str).value; } catch (__) {} return ''; } }; var md = new Remarkable('full', markdownOptions); // image handler var allowImages = false; var imgHostWhitelist = [ 'i.imgur.com', 'imgur.com', ]; function getDomain(link) { var a = document.createElement('a'); a.href = link; return a.hostname; } function isWhiteListed(link) { return imgHostWhitelist.indexOf(getDomain(link)) !== -1; } md.renderer.rules.image = function (tokens, idx, options) { var src = Remarkable.utils.escapeHtml(tokens[idx].src); if (isWhiteListed(src) && allowImages) { var imgSrc = ' src="' + Remarkable.utils.escapeHtml(tokens[idx].src) + '"'; var title = tokens[idx].title ? (' title="' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].title)) + '"') : ''; var alt = ' alt="' + (tokens[idx].alt ? Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(Remarkable.utils.unescapeMd(tokens[idx].alt))) : '') + '"'; var suffix = options.xhtmlOut ? ' /' : ''; var scrollOnload = isAtBottom() ? ' onload="window.scrollTo(0, document.body.scrollHeight)"' : ''; return '<a href="' + src + '" target="_blank" rel="noreferrer"><img' + scrollOnload + imgSrc + alt + title + suffix + '></a>'; } return '<a href="' + src + '" target="_blank" rel="noreferrer">' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(src)) + '</a>'; }; md.renderer.rules.link_open = function (tokens, idx, options) { var title = tokens[idx].title ? (' title="' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].title)) + '"') : ''; var target = options.linkTarget ? (' target="' + options.linkTarget + '"') : ''; return '<a rel="noreferrer" onclick="return verifyLink(this)" href="' + Remarkable.utils.escapeHtml(tokens[idx].href) + '"' + title + target + '>'; }; md.renderer.rules.text = function(tokens, idx) { tokens[idx].content = Remarkable.utils.escapeHtml(tokens[idx].content); if (tokens[idx].content.indexOf('?') !== -1) { tokens[idx].content = tokens[idx].content.replace(/(^|\s)(\?)\S+?(?=[,.!?:)]?\s|$)/gm, function(match) { var channelLink = Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(match.trim())); var whiteSpace = ''; if (match[0] !== '?') { whiteSpace = match[0]; } return whiteSpace + '<a href="' + channelLink + '" target="_blank">' + channelLink + '</a>'; }); } return tokens[idx].content; }; md.use(remarkableKatex); function verifyLink(link) { var linkHref = Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(link.href)); if (linkHref !== link.innerHTML) { return confirm('Warning, please verify this is where you want to go: ' + linkHref); } return true; } var verifyNickname = function (nick) { return /^[a-zA-Z0-9_]{1,24}$/.test(nick); } var frontpage = [ " _ _ _ _ ", " | |_ ___ ___| |_ ___| |_ ___| |_ ", " | |_ || _| '_| | _| |_ || _|", " |_|_|__/|___|_,_|.|___|_|_|__/|_| ", "", "", "Welcome to hack.chat, a minimal, distraction-free chat application.", "Channels are created, joined and shared with the url, create your own channel by changing the text after the question mark.", "If you wanted your channel name to be 'your-channel': https://hack.chat/?your-channel", "There are no channel lists, so a secret channel name can be used for private discussions.", "", "Here are some pre-made channels you can join:", "?lounge ?meta", "?math ?physics ?chemistry", "?technology ?programming", "?games ?banana", "And here's a random one generated just for you: ?" + Math.random().toString(36).substr(2, 8), "", "Formatting:", "Whitespace is preserved, so source code can be pasted verbatim.", "Surround LaTeX with a dollar sign for inline style $\\zeta(2) = \\pi^2/6$, and two dollars for display. $$\\int_0^1 \\int_0^1 \\frac{1}{1-xy} dx dy = \\frac{\\pi^2}{6}$$", "For syntax highlight, wrap the code like: ```<language> <the code>``` where <language> is any known programming language.", "", "Current Github: https://github.com/hack-chat", "Legacy GitHub: https://github.com/AndrewBelt/hack.chat", "", "Bots, Android clients, desktop clients, browser extensions, docker images, programming libraries, server modules and more:", "https://github.com/hack-chat/3rd-party-software-list", "", "Server and web client released under the WTFPL and MIT open source license.", "No message history is retained on the hack.chat server." ].join("\n"); function $(query) { return document.querySelector(query); } function localStorageGet(key) { try { return window.localStorage[key] } catch (e) { } } function localStorageSet(key, val) { try { window.localStorage[key] = val } catch (e) { } } var ws; var myNick = localStorageGet('my-nick') || ''; var myChannel = window.location.search.replace(/^\?/, ''); var lastSent = [""]; var lastSentPos = 0; /** Notification switch and local storage behavior **/ var notifySwitch = document.getElementById("notify-switch") var notifySetting = localStorageGet("notify-api") var notifyPermissionExplained = 0; // 1 = granted msg shown, -1 = denied message shown // Inital request for notifications permission function RequestNotifyPermission() { try { var notifyPromise = Notification.requestPermission(); if (notifyPromise) { notifyPromise.then(function (result) { console.log("Hack.Chat notification permission: " + result); if (result === "granted") { if (notifyPermissionExplained === 0) { pushMessage({ cmd: "chat", nick: "*", text: "Notifications permission granted.", time: null }); notifyPermissionExplained = 1; } return false; } else { if (notifyPermissionExplained === 0) { pushMessage({ cmd: "chat", nick: "*", text: "Notifications permission denied, you won't be notified if someone @mentions you.", time: null }); notifyPermissionExplained = -1; } return true; } }); } } catch (error) { pushMessage({ cmd: "chat", nick: "*", text: "Unable to create a notification.", time: null }); console.error("An error occured trying to request notification permissions. This browser might not support desktop notifications.\nDetails:") console.error(error) return false; } } // Update localStorage with value of checkbox notifySwitch.addEventListener('change', (event) => { if (event.target.checked) { RequestNotifyPermission(); } localStorageSet("notify-api", notifySwitch.checked) }) // Check if localStorage value is set, defaults to OFF if (notifySetting === null) { localStorageSet("notify-api", "false") notifySwitch.checked = false } // Configure notifySwitch checkbox element if (notifySetting === "true" || notifySetting === true) { notifySwitch.checked = true } else if (notifySetting === "false" || notifySetting === false) { notifySwitch.checked = false } /** Sound switch and local storage behavior **/ var soundSwitch = document.getElementById("sound-switch") var notifySetting = localStorageGet("notify-sound") // Update localStorage with value of checkbox soundSwitch.addEventListener('change', (event) => { localStorageSet("notify-sound", soundSwitch.checked) }) // Check if localStorage value is set, defaults to OFF if (notifySetting === null) { localStorageSet("notify-sound", "false") soundSwitch.checked = false } // Configure soundSwitch checkbox element if (notifySetting === "true" || notifySetting === true) { soundSwitch.checked = true } else if (notifySetting === "false" || notifySetting === false) { soundSwitch.checked = false } // Create a new notification after checking if permission has been granted function spawnNotification(title, body) { // Let's check if the browser supports notifications if (!("Notification" in window)) { console.error("This browser does not support desktop notification"); } else if (Notification.permission === "granted") { // Check if notification permissions are already given // If it's okay let's create a notification var options = { body: body, icon: "/favicon-96x96.png" }; var n = new Notification(title, options); } // Otherwise, we need to ask the user for permission else if (Notification.permission !== "denied") { if (RequestNotifyPermission()) { var options = { body: body, icon: "/favicon-96x96.png" }; var n = new Notification(title, options); } } else if (Notification.permission == "denied") { // At last, if the user has denied notifications, and you // want to be respectful, there is no need to bother them any more. } } function notify(args) { // Spawn notification if enabled if (notifySwitch.checked) { spawnNotification("?" + myChannel + " — " + args.nick, args.text) } // Play sound if enabled if (soundSwitch.checked) { var soundPromise = document.getElementById("notify-sound").play(); if (soundPromise) { soundPromise.catch(function (error) { console.error("Problem playing sound:\n" + error); }); } } } function join(channel) { if (document.domain == 'hack.chat') { // For https://hack.chat/ ws = new WebSocket('wss://hack.chat/chat-ws'); } else { // for local installs var protocol = location.protocol === 'https:' ? 'wss:' : 'ws:' // if you changed the port during the server config, change 'wsPath' // to the new port (example: ':8080') // if you are reverse proxying, change 'wsPath' to the new location // (example: '/chat-ws') var wsPath = ':6060'; ws = new WebSocket(protocol + '//' + document.domain + wsPath); } var wasConnected = false; ws.onopen = function () { var shouldConnect = true; if (!wasConnected) { if (location.hash) { myNick = location.hash.substr(1); } else { var newNick = prompt('Nickname:', myNick); if (newNick !== null) { myNick = newNick; } else { // The user cancelled the prompt in some manner shouldConnect = false; } } } if (myNick && shouldConnect) { localStorageSet('my-nick', myNick); send({ cmd: 'join', channel: channel, nick: myNick }); } wasConnected = true; } ws.onclose = function () { if (wasConnected) { pushMessage({ nick: '!', text: "Server disconnected. Attempting to reconnect. . ." }); } window.setTimeout(function () { join(channel); }, 2000); } ws.onmessage = function (message) { var args = JSON.parse(message.data); var cmd = args.cmd; var command = COMMANDS[cmd]; command.call(null, args); } } var COMMANDS = { chat: function (args) { if (ignoredUsers.indexOf(args.nick) >= 0) { return; } pushMessage(args); }, info: function (args) { args.nick = '*'; pushMessage(args); }, warn: function (args) { args.nick = '!'; pushMessage(args); }, onlineSet: function (args) { var nicks = args.nicks; usersClear(); nicks.forEach(function (nick) { userAdd(nick); }); pushMessage({ nick: '*', text: "Users online: " + nicks.join(", ") }) }, onlineAdd: function (args) { var nick = args.nick; userAdd(nick); if ($('#joined-left').checked) { pushMessage({ nick: '*', text: nick + " joined" }); } }, onlineRemove: function (args) { var nick = args.nick; userRemove(nick); if ($('#joined-left').checked) { pushMessage({ nick: '*', text: nick + " left" }); } } } function pushMessage(args) { // Message container var messageEl = document.createElement('div'); if ( typeof (myNick) === 'string' && ( args.text.match(new RegExp('@' + myNick.split('#')[0] + '\\b', "gi")) || ((args.type === "whisper" || args.type === "invite") && args.from) ) ) { notify(args); } messageEl.classList.add('message'); if (verifyNickname(myNick) && args.nick == myNick) { messageEl.classList.add('me'); } else if (args.nick == '!') { messageEl.classList.add('warn'); } else if (args.nick == '*') { messageEl.classList.add('info'); } else if (args.admin) { messageEl.classList.add('admin'); } else if (args.mod) { messageEl.classList.add('mod'); } // Nickname var nickSpanEl = document.createElement('span'); nickSpanEl.classList.add('nick'); messageEl.appendChild(nickSpanEl); if (args.trip) { var tripEl = document.createElement('span'); tripEl.textContent = args.trip + " "; tripEl.classList.add('trip'); nickSpanEl.appendChild(tripEl); } if (args.nick) { var nickLinkEl = document.createElement('a'); nickLinkEl.textContent = args.nick; nickLinkEl.onclick = function () { insertAtCursor("@" + args.nick + " "); $('#chatinput').focus(); } var date = new Date(args.time || Date.now()); nickLinkEl.title = date.toLocaleString(); nickSpanEl.appendChild(nickLinkEl); } // Text var textEl = document.createElement('p'); textEl.classList.add('text'); textEl.innerHTML = md.render(args.text); messageEl.appendChild(textEl); // Scroll to bottom var atBottom = isAtBottom(); $('#messages').appendChild(messageEl); if (atBottom) { window.scrollTo(0, document.body.scrollHeight); } unread += 1; updateTitle(); } function insertAtCursor(text) { var input = $('#chatinput'); var start = input.selectionStart || 0; var before = input.value.substr(0, start); var after = input.value.substr(start); before += text; input.value = before + after; input.selectionStart = input.selectionEnd = before.length; updateInputSize(); } function send(data) { if (ws && ws.readyState == ws.OPEN) { ws.send(JSON.stringify(data)); } } var windowActive = true; var unread = 0; window.onfocus = function () { windowActive = true; updateTitle(); } window.onblur = function () { windowActive = false; } window.onscroll = function () { if (isAtBottom()) { updateTitle(); } } function isAtBottom() { return (window.innerHeight + window.scrollY) >= (document.body.scrollHeight - 1); } function updateTitle() { if (windowActive && isAtBottom()) { unread = 0; } var title; if (myChannel) { title = "?" + myChannel; } else { title = "hack.chat"; } if (unread > 0) { title = '(' + unread + ') ' + title; } document.title = title; } $('#footer').onclick = function () { $('#chatinput').focus(); } $('#chatinput').onkeydown = function (e) { if (e.keyCode == 13 /* ENTER */ && !e.shiftKey) { e.preventDefault(); // Submit message if (e.target.value != '') { var text = e.target.value; e.target.value = ''; send({ cmd: 'chat', text: text }); lastSent[0] = text; lastSent.unshift(""); lastSentPos = 0; updateInputSize(); } } else if (e.keyCode == 38 /* UP */) { // Restore previous sent messages if (e.target.selectionStart === 0 && lastSentPos < lastSent.length - 1) { e.preventDefault(); if (lastSentPos == 0) { lastSent[0] = e.target.value; } lastSentPos += 1; e.target.value = lastSent[lastSentPos]; e.target.selectionStart = e.target.selectionEnd = e.target.value.length; updateInputSize(); } } else if (e.keyCode == 40 /* DOWN */) { if (e.target.selectionStart === e.target.value.length && lastSentPos > 0) { e.preventDefault(); lastSentPos -= 1; e.target.value = lastSent[lastSentPos]; e.target.selectionStart = e.target.selectionEnd = 0; updateInputSize(); } } else if (e.keyCode == 27 /* ESC */) { e.preventDefault(); // Clear input field e.target.value = ""; lastSentPos = 0; lastSent[lastSentPos] = ""; updateInputSize(); } else if (e.keyCode == 9 /* TAB */) { // Tab complete nicknames starting with @ if (e.ctrlKey) { // Skip autocompletion and tab insertion if user is pressing ctrl // ctrl-tab is used by browsers to cycle through tabs return; } e.preventDefault(); var pos = e.target.selectionStart || 0; var text = e.target.value; var index = text.lastIndexOf('@', pos); var autocompletedNick = false; if (index >= 0) { var stub = text.substring(index + 1, pos).toLowerCase(); // Search for nick beginning with stub var nicks = onlineUsers.filter(function (nick) { return nick.toLowerCase().indexOf(stub) == 0 }); if (nicks.length > 0) { autocompletedNick = true; if (nicks.length == 1) { insertAtCursor(nicks[0].substr(stub.length) + " "); } } } // Since we did not insert a nick, we insert a tab character if (!autocompletedNick) { insertAtCursor('\t'); } } } function updateInputSize() { var atBottom = isAtBottom(); var input = $('#chatinput'); input.style.height = 0; input.style.height = input.scrollHeight + 'px'; document.body.style.marginBottom = $('#footer').offsetHeight + 'px'; if (atBottom) { window.scrollTo(0, document.body.scrollHeight); } } $('#chatinput').oninput = function () { updateInputSize(); } updateInputSize(); /* sidebar */ $('#sidebar').onmouseenter = $('#sidebar').ontouchstart = function (e) { $('#sidebar-content').classList.remove('hidden'); $('#sidebar').classList.add('expand'); e.stopPropagation(); } $('#sidebar').onmouseleave = document.ontouchstart = function (event) { var e = event.toElement || event.relatedTarget; try { if (e.parentNode == this || e == this) { return; } } catch (e) { return; } if (!$('#pin-sidebar').checked) { $('#sidebar-content').classList.add('hidden'); $('#sidebar').classList.remove('expand'); } } $('#clear-messages').onclick = function () { // Delete children elements var messages = $('#messages'); messages.innerHTML = ''; } // Restore settings from localStorage if (localStorageGet('pin-sidebar') == 'true') { $('#pin-sidebar').checked = true; $('#sidebar-content').classList.remove('hidden'); } if (localStorageGet('joined-left') == 'false') { $('#joined-left').checked = false; } if (localStorageGet('parse-latex') == 'false') { $('#parse-latex').checked = false; md.inline.ruler.disable([ 'katex' ]); md.block.ruler.disable([ 'katex' ]); } $('#pin-sidebar').onchange = function (e) { localStorageSet('pin-sidebar', !!e.target.checked); } $('#joined-left').onchange = function (e) { localStorageSet('joined-left', !!e.target.checked); } $('#parse-latex').onchange = function (e) { var enabled = !!e.target.checked; localStorageSet('parse-latex', enabled); if (enabled) { md.inline.ruler.enable([ 'katex' ]); md.block.ruler.enable([ 'katex' ]); } else { md.inline.ruler.disable([ 'katex' ]); md.block.ruler.disable([ 'katex' ]); } } if (localStorageGet('syntax-highlight') == 'false') { $('#syntax-highlight').checked = false; markdownOptions.doHighlight = false; } $('#syntax-highlight').onchange = function (e) { var enabled = !!e.target.checked; localStorageSet('syntax-highlight', enabled); markdownOptions.doHighlight = enabled; } if (localStorageGet('allow-imgur') == 'false') { $('#allow-imgur').checked = false; allowImages = false; } $('#allow-imgur').onchange = function (e) { var enabled = !!e.target.checked; localStorageSet('allow-imgur', enabled); allowImages = enabled; } // User list var onlineUsers = []; var ignoredUsers = []; function userAdd(nick) { var user = document.createElement('a'); user.textContent = nick; user.onclick = function (e) { userInvite(nick) } var userLi = document.createElement('li'); userLi.appendChild(user); $('#users').appendChild(userLi); onlineUsers.push(nick); } function userRemove(nick) { var users = $('#users'); var children = users.children; for (var i = 0; i < children.length; i++) { var user = children[i]; if (user.textContent == nick) { users.removeChild(user); } } var index = onlineUsers.indexOf(nick); if (index >= 0) { onlineUsers.splice(index, 1); } } function usersClear() { var users = $('#users'); while (users.firstChild) { users.removeChild(users.firstChild); } onlineUsers.length = 0; } function userInvite(nick) { send({ cmd: 'invite', nick: nick }); } function userIgnore(nick) { ignoredUsers.push(nick); } /* color scheme switcher */ var schemes = [ 'android', 'android-white', 'atelier-dune', 'atelier-forest', 'atelier-heath', 'atelier-lakeside', 'atelier-seaside', 'banana', 'bright', 'bubblegum', 'chalk', 'default', 'eighties', 'fresh-green', 'greenscreen', 'hacker', 'maniac', 'mariana', 'military', 'mocha', 'monokai', 'nese', 'ocean', 'omega', 'pop', 'railscasts', 'solarized', 'tk-night', 'tomorrow', 'carrot', 'lax', 'Ubuntu' ]; var highlights = [ 'agate', 'androidstudio', 'atom-one-dark', 'darcula', 'github', 'rainbow', 'tk-night', 'tomorrow', 'xcode', 'zenburn' ] var currentScheme = 'atelier-dune'; var currentHighlight = 'darcula'; function setScheme(scheme) { currentScheme = scheme; $('#scheme-link').href = "schemes/" + scheme + ".css"; localStorageSet('scheme', scheme); } function setHighlight(scheme) { currentHighlight = scheme; $('#highlight-link').href = "vendor/hljs/styles/" + scheme + ".min.css"; localStorageSet('highlight', scheme); } // Add scheme options to dropdown selector schemes.forEach(function (scheme) { var option = document.createElement('option'); option.textContent = scheme; option.value = scheme; $('#scheme-selector').appendChild(option); }); highlights.forEach(function (scheme) { var option = document.createElement('option'); option.textContent = scheme; option.value = scheme; $('#highlight-selector').appendChild(option); }); $('#scheme-selector').onchange = function (e) { setScheme(e.target.value); } $('#highlight-selector').onchange = function (e) { setHighlight(e.target.value); } // Load sidebar configaration values from local storage if available if (localStorageGet('scheme')) { setScheme(localStorageGet('scheme')); } if (localStorageGet('highlight')) { setHighlight(localStorageGet('highlight')); } $('#scheme-selector').value = currentScheme; $('#highlight-selector').value = currentHighlight; /* main */ if (myChannel == '') { pushMessage({ text: frontpage }); $('#footer').classList.add('hidden'); $('#sidebar').classList.add('hidden'); } else { join(myChannel); }
$("#searchcustomerdata").typeahead({ source: function(request, process) { $.ajax({ url: "viewbillcustomer_search", dataType: "json", data: { search_val: $("#searchcustomerdata").val(), term: request.term }, success: function (data) {$("#searchcustomerdata").val() process(data); } }); }, hint: true, highlight: true, minLength: 1, autoSelect:false, }); // $("#searchcustomerdata").typeahead({ // source: function(request, process) // { // var url = "viewbillcustomer_search"; // var type = "post"; // var dataType = "json"; // var data = { // "search_val": $("#searchcustomerdata").val(), // "term": request.term // }; // callroute(url,type,dataType,data,function (data) // { // objects = []; // map = {}; // if($("#searchcustomerdata").val()!='') // { // $.each(data, function(i, object) // { // map[object.label] = object; // objects.push(object.label); // }); // process(objects); // if(objects!='') // { // if(objects.length === 1) // { // //$(".typeahead.dropdown-menu").find('.dropdown-item').html(''); // // $(".dropdown-menu .active").html(""); // //$(".dropdown-menu .active").val(""); // // $(".typeahead dropdown-menu").hide(); // // $(".typeahead dropdown-menu").html(''); // //getproductdetail(data[0]['product_id']); // $(".typeahead.dropdown-menu .active").trigger("click"); // return false; // //$(".dropdown-menu .active").trigger("click"); // } // } // } // else // { // $(".typeahead.dropdown-menu").hide(); // } // }); // }, // // minLength: 1, // autoselect:true, // // autoSelect:false, // // typeahead-select-on-exact="true" // afterSelect: function (item) // { // if(map[item] != undefined) // { // $('.loaderContainer').show(); // var value = item; // // var barcode = map[item]['barcode']; // // var product_name = map[item]['product_name']; // var customer_id = map[item]['customer_id']; // $("customer_id").val(customer_id); // // getproductdetail(product_id); // } // } // }); function reset_customer_filterdata(){ $(".common-search").find('input,select,hidden').val(''); resettable('top_customers_data','customer_sales_report_table'); } $(document).on('click', '#customer_sales_report_export', function() { var query = {}; var dynamic_query = {}; $(".common-search").find('input,select,hidden').each(function () { if($(this).attr('name-attr') != undefined) { var name_attr = $(this).attr('name-attr'); if(name_attr == "from_to_date") { query['from_date'] = ''; query['to_date'] = ''; var separate_date = $(this).val().split(' - '); if(separate_date[0] != undefined) { query['from_date'] = separate_date[0]; } if(separate_date[1] != undefined) { query['to_date'] = separate_date[1]; } } else { if(name_attr.indexOf('dynamic_') > -1) { dynamic_query[name_attr] = $(this).val(); } else { query[name_attr] = $(this).val(); } } } }); var querydata = { 'query' : query, 'dynamic_query' : dynamic_query }; var url = "customer_sales_report_export?" + $.param(querydata) window.open(url,'_blank'); }); function viewCustomerBill(obj) { var id = $(obj).attr('id'); // var supplier_id = $(obj).attr('id'); var customer_id = $(obj).attr('id').split('view_customer_bill_')[1]; var data = { 'customer_id': customer_id }; var url = 'view_customer_bill_popup'; var type = "POST"; var dataType = ""; callroute(url, type, dataType, data, function(data) { // var dta = JSON.parse(data,true); // if(dta['Success'] == "True") // { $('.popup_values').html(''); $('.popup_values').html(data); $("#customer_bill_popup").modal('show'); // } }); }
import React, { PureComponent, Component } from 'react'; import { findDOMNode } from 'react-dom'; import PropTypes from 'prop-types'; import isFunction from 'lodash/isFunction'; import scroll from '../utils/scroll'; import offset from '../utils/offset'; function scrollNodeToTop(node, offsets) { const pos = offset(node); const top = isFunction(offsets.top) ? offsets.top(pos.top) : pos.top + offsets.top; const left = isFunction(offsets.left) ? offsets.left(pos.left) : pos.left + offsets.left; scroll(document.body, left, top); } export default class DesignPreviewItem extends (PureComponent || Component) { static propTypes = { children: PropTypes.node.isRequired, prefix: PropTypes.string }; static defaultProps = { prefix: 'zent' }; render() { const { children, prefix } = this.props; return <div className={`${prefix}-design-preview-item`}>{children}</div>; } scrollTop(offsets) { const node = findDOMNode(this); scrollNodeToTop(node, offsets); } }
module.exports = { __depends__: [ require('diagram-js/lib/features/rules') ], __init__: ['spartaRules'], spartaRules: [ 'type', require('./SpartaRules') ] };
function assignmentAllDataToObject(assignmentObject) { let assignment = {} assignment.assignmentName = assignmentObject.assignmentName assignment.assignmentDescription = assignmentObject.assignmentDescription assignment.professorId = assignmentObject.professorId assignment.dueDate = assignmentObject.dueDate assignment.openDate = assignmentObject.openDate assignment.closeDate = assignmentObject.closeDate assignment.totalPossiblePoints = assignmentObject.totalPossiblePoints assignment.studentPoints = assignmentObject.studentPoints assignment.assignmentSubmissions = assignmentObject.assignmentSubmissions return assignment } module.exports = { assignmentAllDataToObject }
import { combineReducers } from 'redux'; import songReducer from 'redux/reducers/songReducer'; import dialogReducer from './dialogReducer'; const rootReducer = combineReducers({ songs: songReducer, dialogs: dialogReducer }); export default rootReducer;
/* global QUnit */ sap.ui.define([ "sap/ui/fl/ChangePersistence", "sap/ui/fl/ChangePersistenceFactory", "sap/ui/fl/Layer", "sap/ui/fl/Utils", "sap/ui/fl/LayerUtils", "sap/ui/fl/apply/api/SmartVariantManagementApplyAPI", "sap/ui/fl/write/_internal/Storage", "sap/ui/core/UIComponent", "sap/ui/core/Control", "sap/ui/fl/registry/Settings", "sap/ui/fl/apply/_internal/flexState/FlexState", "sap/ui/fl/initial/_internal/connectors/LrepConnector", "sap/base/util/LoaderExtensions", "sap/ui/thirdparty/sinon-4" ], function( ChangePersistence, ChangePersistenceFactory, Layer, Utils, LayerUtils, SmartVariantManagementApplyAPI, Storage, UIComponent, Control, Settings, FlexState, LrepConnector, LoaderExtensions, sinon ) { "use strict"; var sandbox = sinon.sandbox.create(); QUnit.module("SmartVariantManagementApplyAPI", { beforeEach: function() { this.oAppComponent = new UIComponent("AppComponent21"); sandbox.stub(Utils, "getAppComponentForControl").returns(this.oAppComponent); }, afterEach: function() { FlexState.clearState(); if (this.oControl) { this.oControl.destroy(); } this.oAppComponent.destroy(); sandbox.restore(); } }, function() { QUnit.test("When loadVariants() is called and multiple variants are present for the persistencyKey of the passed control", function (assert) { this.oControl = new Control("controlId1"); var sPersistencyKey = "variantManagement1"; this.oControl.getPersonalizableControlPersistencyKey = function () { return sPersistencyKey; }; var mFlexData = LoaderExtensions.loadResource({ dataType: "json", url: sap.ui.require.toUrl("test-resources/sap/ui/fl/qunit/apply/api/SmartVariantManagementAPI.loadVariantsTestSetup-flexData.json") }); sandbox.stub(LrepConnector, "loadFlexData").resolves(mFlexData); var aVariants = [{ id: "variant_3", name: "C Variant", content: {} }, { id: "variant_4", executeOnSelection: true, name: "B Variant", content: {} }, { id: "variant_5", name: "A Variant", content: {} }]; var sStandardVariantTitle = "this is a localized standard variant title"; return SmartVariantManagementApplyAPI.loadVariants({ control: this.oControl, standardVariant: { name: sStandardVariantTitle }, variants: aVariants }) .then(function (oResponse) { var oStandardVariant = oResponse.standardVariant; assert.equal(oStandardVariant.getId(), "*standard*", "the first is the standard variant passed"); assert.equal(oStandardVariant.getText("variantName"), sStandardVariantTitle, "with the passed title"); assert.equal(oStandardVariant.getExecuteOnSelection(), true, "and is executed on selection by a standardVariant change"); assert.equal(oStandardVariant.getFavorite(), true, "which is by default a favorite"); var aVariants = oResponse.variants; assert.equal(aVariants.length, 5, "then five entities are returned"); assert.equal(aVariants[0].getId(), "variant_3", "the six is the variant provided from the loadFlexData"); assert.equal(aVariants[0].getFavorite(), true, "which was changed to be a favorite"); assert.equal(aVariants[0].getExecuteOnSelection(), false, "and is not executed on selection by default"); assert.equal(aVariants[0].getText("variantName"), "C Variant", "and the oData variant has the correct title"); assert.equal(aVariants[1].getId(), "variant_4", "the third is the variant provided from the loadFlexData"); assert.equal(aVariants[1].getFavorite(), false, "which is NOT a favorite"); assert.equal(aVariants[1].getExecuteOnSelection(), true, "and is executed on selection, because it is flagged within the object"); assert.equal(aVariants[1].getText("variantName"), "B Variant", "and the oData variant has the correct title"); assert.equal(aVariants[2].getId(), "variant_5", "the second is the variant provided from the loadFlexData"); assert.equal(aVariants[2].getFavorite(), false, "which is NOT a favorite"); assert.equal(aVariants[2].getExecuteOnSelection(), false, "and is not executed on selection by default"); assert.equal(aVariants[2].getText("variantName"), "A Variant", "and the oData variant has the correct title"); assert.equal(aVariants[3].getId(), "variant_1", "the fourth is the variant provided from the loadFlexData"); assert.equal(aVariants[3].getFavorite(), false, "which is NOT a favorite, because it was added as a favorite and afterwards removed"); assert.equal(aVariants[3].getExecuteOnSelection(), false, "and is not executed on selection by default"); assert.equal(aVariants[3].getText("variantName"), "B Variant", "and the variant has the correct title"); assert.equal(aVariants[4].getId(), "variant_2", "the fifth is the variant provided from the loadFlexData"); assert.equal(aVariants[4].getFavorite(), true, "which is a favorite, because it is flagged as one within the content"); assert.equal(aVariants[4].getExecuteOnSelection(), true, "and is executed on selection, because it is flagged within the content"); assert.equal(aVariants[4].getText("variantName"), "B Variant2", "and the variant has the correct title"); }); }); QUnit.test("When loadVariants() is called and multiple variants, of which multiple are a overruling the standard variant, are present for the persistencyKey of the passed control", function (assert) { this.oControl = new Control("controlId1"); var sPersistencyKey = "variantManagement1"; this.oControl.getPersonalizableControlPersistencyKey = function () { return sPersistencyKey; }; var mFlexData = LoaderExtensions.loadResource({ dataType: "json", url: sap.ui.require.toUrl("test-resources/sap/ui/fl/qunit/apply/api/SmartVariantManagementAPI.loadVariantsTestSetup-flexData-withStandardVariant.json") }); sandbox.stub(LrepConnector, "loadFlexData").resolves(mFlexData); var aVariants = [{ id: "variant_3", name: "C variant" // explicitly no content to test the optional content parameter }, { id: "variant_4", executeOnSelection: true, name: "A variant", content: {} }, { id: "variant_5", name: "A Variant", content: {} }]; var sStandardVariantTitle = "this is a localized standard variant title"; return SmartVariantManagementApplyAPI.loadVariants({ control: this.oControl, standardVariant: { name: sStandardVariantTitle }, variants: aVariants }) .then(function (oResponse) { var oStandardVariant = oResponse.standardVariant; assert.equal(oStandardVariant.getId(), "variant_standard2", "the first is the overwritten standard variant"); assert.equal(oStandardVariant.getText("variantName"), "This another of my very own standard variant text", "with the title from the variant file"); assert.equal(oStandardVariant.getExecuteOnSelection(), true, "and not is executed on selection due to a change"); assert.equal(oStandardVariant.getFavorite(), true, "and it is a favorite"); var aVariants = oResponse.variants; assert.equal(aVariants.length, 5, "then five entities are returned"); assert.equal(aVariants[0].getId(), "variant_3", "the six is the variant provided from the loadFlexData"); assert.equal(aVariants[0].getFavorite(), true, "which was changed to be a favorite"); assert.equal(aVariants[0].getExecuteOnSelection(), false, "and is not executed on selection by default"); assert.equal(aVariants[1].getId(), "variant_4", "the third is the variant provided from the loadFlexData"); assert.equal(aVariants[1].getFavorite(), false, "which is NOT a favorite"); assert.equal(aVariants[1].getExecuteOnSelection(), true, "and is executed on selection, because it is flagged within the object"); assert.equal(aVariants[2].getId(), "variant_5", "the second is the variant provided from the loadFlexData"); assert.equal(aVariants[2].getFavorite(), false, "which is NOT a favorite"); assert.equal(aVariants[2].getExecuteOnSelection(), false, "and is not executed on selection by default"); assert.equal(aVariants[3].getId(), "variant_1", "the fourth is the variant provided from the loadFlexData"); assert.equal(aVariants[3].getFavorite(), false, "which is NOT a favorite, because it was added as a favorite and afterwards removed"); assert.equal(aVariants[3].getExecuteOnSelection(), false, "and is not executed on selection by default"); assert.equal(aVariants[4].getId(), "variant_2", "the fifth is the variant provided from the loadFlexData"); assert.equal(aVariants[4].getFavorite(), true, "which is a favorite, because it is flagged as one within the content"); assert.equal(aVariants[4].getExecuteOnSelection(), true, "and is executed on selection, because it is flagged within the content"); }); }); QUnit.test("When isApplicationVariant() is called", function (assert) { this.oControl = new Control("controlId1"); //Utils.isApplicationVariant returns true var oStubUtilsIsApplicationVariant = sandbox.stub(Utils, "isApplicationVariant").withArgs(this.oControl).returns(true); assert.equal(SmartVariantManagementApplyAPI.isApplicationVariant({control: this.oControl}), true); //Utils.isApplicationVariant returns false, Utils.getComponentForControl return null oStubUtilsIsApplicationVariant.withArgs(this.oControl).returns(false); var oStubUtilsGetComponentForControl = sandbox.stub(Utils, "getComponentForControl").withArgs(this.oControl).returns(null); assert.equal(SmartVariantManagementApplyAPI.isApplicationVariant({control: this.oControl}), false); //Utils.isApplicationVariant returns false, Utils.getComponentForControl return empty object oStubUtilsGetComponentForControl.withArgs(this.oControl).returns({}); assert.equal(SmartVariantManagementApplyAPI.isApplicationVariant({control: this.oControl}), false); //Utils.isApplicationVariant returns false, Utils.getComponentForControl return component but not appComponent oStubUtilsGetComponentForControl.withArgs(this.oControl).returns({ getAppComponent: function () { return null; } }); assert.equal(SmartVariantManagementApplyAPI.isApplicationVariant({control: this.oControl}), false); //Utils.isApplicationVariant returns false, Utils.getComponentForControl return component and appComponent oStubUtilsGetComponentForControl.withArgs(this.oControl).returns({ getAppComponent: function () { return {}; } }); assert.equal(SmartVariantManagementApplyAPI.isApplicationVariant({control: this.oControl}), true); }); QUnit.test("When isVendorLayer() is called it calls the corresponding Utils function", function (assert) { sandbox.stub(LayerUtils, "isVendorLayer").withArgs().returns(false); var bVendorLayer = SmartVariantManagementApplyAPI.isVendorLayer(); assert.equal(bVendorLayer, false); }); QUnit.test("When isVariantDownport() is called it calls the corresponding Utils function", function (assert) { sandbox.stub(LayerUtils, "getCurrentLayer").withArgs().returns('VENDOR'); sandbox.stub(Utils, "isHotfixMode").withArgs().returns(true); var bVendorLayer = SmartVariantManagementApplyAPI.isVariantDownport(); assert.equal(bVendorLayer, true); }); }); QUnit.module("SmartVariantManagementApplyAPI.getDefaultVariantId", { beforeEach: function() { this.oAppComponent = new UIComponent("AppComponent21"); this.oControl = new Control("controlId1"); sandbox.stub(Utils, "getAppComponentForControl").returns(this.oAppComponent); }, afterEach: function() { FlexState.clearState("sap.ui.core.Component"); this.oControl.destroy(); this.oAppComponent.destroy(); sandbox.restore(); } }, function() { [{ testName: "When getDefaultVariantId() is called and NO defaultVariant change for the persistencyKey is present", changes: [], expected: "" }, { testName: "When getDefaultVariantId() is called and the last defaultVariant change for the persistencyKey sets it to false", changes: [{ fileName: "defaultVariant1", fileType: "change", changeType: "defaultVariant", selector: { persistencyKey: "variant1" }, content: { defaultVariantName: "anotherVariant" } }, { fileName: "defaultVariant2", fileType: "change", changeType: "defaultVariant", selector: { persistencyKey: "variant1" }, content: { defaultVariantName: "theDefaultVariant" } }], expected: "theDefaultVariant" }, { testName: "When getDefaultVariantId() is called and the last defaultVariant change for the persistencyKey sets to true", changes: [{ fileName: "defaultVariant1", fileType: "change", changeType: "defaultVariant", selector: { persistencyKey: "variant1" }, content: { defaultVariantName: "theDefaultVariant" } }, { fileName: "defaultVariant2", fileType: "change", changeType: "defaultVariant", selector: { persistencyKey: "anotherKey" }, content: { defaultVariantName: "someVariant" } }], expected: "theDefaultVariant" }].forEach(function (oTestData) { QUnit.test(oTestData.testName, function (assert) { this.oControl.getPersonalizableControlPersistencyKey = function () { return "variant1"; }; sandbox.stub(LrepConnector, "loadFlexData").resolves({ changes: oTestData.changes }); // clear state created in the beforeEach FlexState.clearState("sap.ui.core.Component"); // simulate FlexState initialization return SmartVariantManagementApplyAPI.loadVariants({control: this.oControl, standardVariant: {}}) .then(function () { var sDefaultVariantName = SmartVariantManagementApplyAPI.getDefaultVariantId({control: this.oControl}); assert.equal(sDefaultVariantName, oTestData.expected); }.bind(this)); }); }); }); QUnit.module("SmartVariantManagementApplyAPI.getExecuteOnSelect", { beforeEach: function() { this.oAppComponent = new UIComponent("AppComponent21"); this.oControl = new Control("controlId1"); sandbox.stub(Utils, "getAppComponentForControl").returns(this.oAppComponent); // simulate FlexState initialization return SmartVariantManagementApplyAPI.loadVariants({control: this.oControl, standardVariant: {}}); }, afterEach: function() { FlexState.clearState("sap.ui.core.Component"); this.oControl.destroy(); this.oAppComponent.destroy(); sandbox.restore(); } }, function() { [{ testName: "When getExecuteOnSelect is called and NO standardVariant change for the persistencyKey is present", changes: [], expected: null }, { testName: "When getExecuteOnSelect is called and the last standardVariant change for the persistencyKey sets it to false", changes: [{ fileName: "standardVariant1", fileType: "change", changeType: "standardVariant", selector: { persistencyKey: "variant1" }, content: { executeOnSelect: true } }, { fileName: "standardVariant2", fileType: "change", changeType: "standardVariant", selector: { persistencyKey: "variant1" }, content: { executeOnSelect: false } }], expected: false }, { testName: "When getExecuteOnSelect is called and the last standardVariant change for the persistencyKey sets it to true", changes: [{ fileName: "standardVariant1", fileType: "change", changeType: "standardVariant", selector: { persistencyKey: "variant1" }, content: { executeOnSelect: true } }, { fileName: "standardVariant2", fileType: "change", changeType: "standardVariant", selector: { persistencyKey: "anotherKey" }, content: { executeOnSelect: false } }], expected: true }].forEach(function(oTestData) { QUnit.test(oTestData.testName, function (assert) { var sPersistencyKey = "variant1"; this.oControl.getPersonalizableControlPersistencyKey = function () { return sPersistencyKey; }; sandbox.stub(LrepConnector, "loadFlexData").resolves({ changes: oTestData.changes }); FlexState.clearState("sap.ui.core.Component"); // simulate FlexState initialization return SmartVariantManagementApplyAPI.loadVariants({control: this.oControl, standardVariant: {}}) .then(function () { var bExecuteOnSelect = SmartVariantManagementApplyAPI.getExecuteOnSelect({control: this.oControl}); assert.equal(bExecuteOnSelect, oTestData.expected); }.bind(this)); }); }); }); QUnit.module("SmartVariantManagementApplyAPI._getChangeMap", { beforeEach: function() { this.oAppComponent = new UIComponent("AppComponent21"); this.oControl = new Control("controlId1"); sandbox.stub(Utils, "getAppComponentForControl").returns(this.oAppComponent); }, afterEach: function() { FlexState.clearState("sap.ui.core.Component"); this.oControl.destroy(); this.oAppComponent.destroy(); sandbox.restore(); } }, function() { QUnit.test("collects the changes for a smartVariantManagement", function (assert) { var sPersistencyKey = "smartVariantManagement1"; this.oControl.getPersonalizableControlPersistencyKey = function () { return sPersistencyKey; }; var oChange1 = { fileName: "defaultVariant1", fileType: "change", changeType: "defaultVariant", selector: { persistencyKey: sPersistencyKey }, content: { defaultVariantName: "anotherVariant" } }; var oChange2 = { fileName: "defaultVariant2", fileType: "change", changeType: "defaultVariant", selector: { persistencyKey: sPersistencyKey }, content: { defaultVariantName: "theDefaultVariant" } }; var oChange3 = { fileName: "addFavorite1", fileType: "change", changeType: "addFavorite", selector: { persistencyKey: sPersistencyKey }, content: {} }; sandbox.stub(LrepConnector, "loadFlexData").resolves({ changes: [ oChange1, oChange2, { fileName: "addFavorite2", fileType: "change", changeType: "addFavorite", selector: { persistencyKey: "variantManagement2" }, content: {} }, { fileName: sPersistencyKey, fileType: "variant", selector: { persistencyKey: sPersistencyKey }, content: {} }, oChange3, { fileName: "variant2", fileType: "variant", selector: { persistencyKey: "variantManagement2" }, content: {} } ] }); this.oControl.getPersonalizableControlPersistencyKey = function () { return sPersistencyKey; }; // clear state created in the beforeEach FlexState.clearState("sap.ui.core.Component"); // simulate FlexState initialization return FlexState.initialize({ reference: "sap.ui.core.Component", componentData: {}, manifest: {}, componentId: "sap.ui.core" }) .then(SmartVariantManagementApplyAPI._getChangeMap.bind(undefined, this.oControl)) .then(function (mChanges) { assert.equal(Object.keys(mChanges).length, 3, "3 changes are returned"); assert.ok(mChanges[oChange1.fileName], "the first change of the variantManagement is included"); assert.ok(mChanges[oChange2.fileName], "the second change of the variantManagement is included"); assert.ok(mChanges[oChange3.fileName], "the third change of the variantManagement is included"); }); }); }); QUnit.done(function () { jQuery('#qunit-fixture').hide(); }); });
$(function() { var availableTags = [ "Archipel du Frioul", "Ratonneau", "Tiboulen de Ratonneau", "Tiboulen de Ratonneau", "Le Grand Salaman", "Le Petit Salaman", "Ilot des Eyglaudes", "Pomegues", "Le Gros Esteou", "Rocher du Cap Caveaux", "Chateau d'If", "Ilot du Planier", "Archipel de Riou", "Les Pharillons nord", "Les Pharillons sud", "Jarron", "Jarre", "Ile Plane", "Riou", "Petit Congloue", "Grand Congloue", "Ile de Moyade", "Les moyadons", "Les Empereurs nord", "Les Empereurs sud", "Ile de la Redonne", "Ile Longue", "Ile de la Ratonnière", "Les Fourmigues Est", "Les Fourmigues Ouest", "Ile du Portugais", "Ile du Petit Langoustier", "Gros Sarranier", "Petit Sarranier", "Porquerolles", "Port-cros", "Bagaud", "Levant", "Lavezzi", "Archipel des Lavezzi", "Isolotto Luigi Giafferi", "Isolotto Giacento Paoli", "Scoglio della Silene", "Sc. Gian Pietro Gaffori", "Ito. Pasquale Paoli", "Ito. Andrea Ceccaldi", "Sc. Di Cala Di u Ghiuncu", "Ilot de la Semillante", "Ilot L", "Cavallo", "Camaro Canto", "San Bainsu", "Sperduto grande", "Sperduto piccolo", "Ratino", "Rocher sud de Ratino", "Rocher ouest de Ratino", "Rocher est de Ratino", "Piana", "Porraggia grande", "Porraggia piccola", "Gavetti", "Archipel des Cerbicales", "Ilot Toro Grande", "Ilot Toro Piccolo", "Rocher 1 du Toro Piccolo", "Rocher 2 du Toro Piccolo", "Ilot du Torello", "Pietricaggiosa", "Piana", "Maestro Maria", "Ilot nord Maestro Maria", "Rocher de la Vacca", "Forana", "Archipel des Sanguinaires", "Grande Sanguinaire", "Isolotto di Cala d'Alga", "Isolotto della Locca", "Scoglio dei Cormorani", "Isolotto di Porro", "Pomegues", ]; $( "#form_lieudit" ).autocomplete({ source: availableTags }); $( "#parc_puffinsbagbundle_donneesprincipalestype_lieudit" ).autocomplete({ source: availableTags }); }); $(function() { var href ="", password = $( "#password" ), password2 = $( "#password2" ), allFields = $( [] ).add( password ).add( password2 ), tips = $( ".validateTips" ); $( "#mdpchange" ) .ready(function() { href=$(this).attr("id"); $("#dialog-form3" ).dialog( "open" ); }); function updateTips( t ) { tips .text( t ) .addClass( "ui-state-highlight" ); setTimeout(function() { tips.removeClass( "ui-state-highlight", 1500 ); }, 500 ); } function checkLength( p, min, max ) { if ( p.val().length > max || p.val().length < min ) { p.addClass( "ui-state-error" ); updateTips( "Mot de passe doit etre entre " + min + " et " + max + " caratères." ); return false; } else { return true; } } function checkEquality( p,p2 ) { if ( p.val()!= p2.val() ) { p.addClass( "ui-state-error" ); updateTips("Les deux mots de passe sont différents."); return false; } else { return true; } } $( "#dialog-form3" ).dialog({ autoOpen: false, height: 300, width: 300, modal: true, buttons: { "Modifier": function() { var bValid = true; allFields.removeClass( "ui-state-error" ); bValid = bValid && checkLength( password, 6, 20 ); bValid = bValid && checkEquality( password, password2); if ( bValid ) { $("#form_mp").submit(); $( this ).dialog( "close" ); } } }, close: function() { } }); }); $(document).ready(function(){ // on sélectionne tous les div avec la classe zoneTexteAfficherMasquer et on les parcourt $("div.zoneTexteAfficherMasquer").each(function(i){ // find permet d appliquer un sélecteur sur un ensemble selectionné $(this).find("div.TexteAAfficher").attr("id","TexteAAfficher"+(i+1)).hide(); $(this).find("span.inviteClic").attr("id","inviteClic"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/plus.png' class='icone'/>Ajouter Donnees PNPC").attr("statut","1").click( function(){ $("#TexteAAfficher"+(i+1)).slideToggle("slow"); // selon le statut on renomme le texte if ($("#inviteClic"+(i+1)).attr("statut")=="1"){ $("#inviteClic"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/moins.png' class='icone'/>(cliquez pour fermer)").attr("statut","0"); } else{ $("#inviteClic"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/plus.png' class='icone'/>Ajouter Donnees PNPC").attr("statut","1"); }; }) }); }); $(document).ready(function(){ // on sélectionne tous les div avec la classe zoneTexteAfficherMasquer et on les parcourt $("div.zoneTexteAfficherMasquer2").each(function(i){ // find permet d appliquer un sélecteur sur un ensemble selectionné $(this).find("div.TexteAAfficher2").attr("id","TexteAAfficher2"+(i+1)).hide(); $(this).find("span.inviteClic2").attr("id","inviteClic2"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/plus.png' class='icone'/>Ajouter Autres données").attr("statut","1").click( function(){ $("#TexteAAfficher2"+(i+1)).slideToggle("slow"); // selon le statut on renomme le texte if ($("#inviteClic2"+(i+1)).attr("statut")=="1"){ $("#inviteClic2"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/moins.png' class='icone'/>(cliquez pour fermer)").attr("statut","0"); } else{ $("#inviteClic2"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/plus.png' class='icone'/>Ajouter Autres données").attr("statut","1"); }; }) }); }); $(document).ready(function(){ // on sélectionne tous les div avec la classe zoneTexteAfficherMasquer et on les parcourt $("div.zoneTexte").each(function(i){ // find permet d appliquer un sélecteur sur un ensemble selectionné $(this).find("div.Texte").attr("class","Texte"+(i+1)).hide(); $(this).find("span.inviteClick").attr("class","inviteClick"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/plus.png' class='icone'/> Ajouter").attr("statut","1").click( function(){ $(".Texte"+(i+1)).slideToggle("slow"); // selon le statut on renomme le texte if ($(".inviteClick"+(i+1)).attr("statut")=="1"){ $(".inviteClick"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/moins.png' class='icone'/>(cliquez pour fermer)").attr("statut","0"); } else{ $(".inviteClick"+(i+1)).html("<img src='../bundles/parcpuffinsbag/images/plus.png' class='icone'/> Ajouter").attr("statut","1"); }; }) }); }); $(document).ready(function(){ // on sélectionne tous les div avec la classe zoneTexteAfficherMasquer et on les parcourt $("div.zoneTexte1").each(function(i){ // find permet d appliquer un sélecteur sur un ensemble selectionné $(this).find("div.Texte1").attr("class","Texte1"+(i+1)).hide(); $(this).find("span.inviteClick1").attr("class","inviteClick1"+(i+1)).html("<img src='../../../bundles/parcpuffinsbag/images/plus.png' class='icone'/> Ajouter").attr("statut","1").click( function(){ $(".Texte1"+(i+1)).slideToggle("slow"); // selon le statut on renomme le texte if ($(".inviteClick1"+(i+1)).attr("statut")=="1"){ $(".inviteClick1"+(i+1)).html("<img src='../../../bundles/parcpuffinsbag/images/moins.png' class='icone'/>(cliquez pour fermer)").attr("statut","0"); } else{ $(".inviteClick1"+(i+1)).html("<img src='../../../bundles/parcpuffinsbag/images/plus.png' class='icone'/> Ajouter").attr("statut","1"); }; }) }); }); $(function() { $( document ).tooltip({ track: true }); }); /*$(function() { $( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" ); $( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" ); }); */ $(function() { $( "#tabs" ).tabs({ collapsible: true }); }); $(function() { $( "#accordion" ).accordion(); }); $(function() { $( ".info" ) .ready(function() { setTimeout( "jQuery('.info').hide('slide',1500);",8000 ); //$(".flash").hide('slide',5000); }); }); $(function() { $( ".warning" ) .ready(function() { setTimeout( "jQuery('.warning').hide('slide',1000);",5000 ); //$(".flash").hide('slide',5000); }); }); /*! * jQuery JavaScript Library v1.10.2 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03T13:48Z */ (function( window, undefined ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ //"use strict"; var // The deferred used on DOM ready readyList, // A central reference to the root jQuery(document) rootjQuery, // Support: IE<10 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` core_strundefined = typeof undefined, // Use the correct document accordingly with window argument (sandbox) location = window.location, document = window.document, docElem = document.documentElement, // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$, // [[Class]] -> type pairs class2type = {}, // List of deleted data cache ids, so we can reuse them core_deletedIds = [], core_version = "1.10.2", // Save a reference to some core methods core_concat = core_deletedIds.concat, core_push = core_deletedIds.push, core_slice = core_deletedIds.slice, core_indexOf = core_deletedIds.indexOf, core_toString = class2type.toString, core_hasOwn = class2type.hasOwnProperty, core_trim = core_version.trim, // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context, rootjQuery ); }, // Used for matching numbers core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, // Used for splitting on whitespace core_rnotwhite = /\S+/g, // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, // JSON RegExp rvalidchars = /^[\],:{}\s]*$/, rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }, // The ready event handler completed = function( event ) { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } }, // Clean-up method for dom ready events detach = function() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: core_version, constructor: jQuery, init: function( selector, context, rootjQuery ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return rootjQuery.ready( selector ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return core_slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == null ? // Return a 'clean' array this.toArray() : // Return just the object ( num < 0 ? this[ this.length + num ] : this[ num ] ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, ready: function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }, slice: function() { return this.pushStack( core_slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: core_push, sort: [].sort, splice: [].splice }; // Give the init function the jQuery prototype for later instantiation jQuery.fn.init.prototype = jQuery.fn; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( length === i ) { target = this; --i; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page // Non-digits removed to match rinlinejQuery expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), noConflict: function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }, // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.trigger ) { jQuery( document ).trigger("ready").off("ready"); } }, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { return !isNaN( parseFloat(obj) ) && isFinite( obj ); }, type: function( obj ) { if ( obj == null ) { return String( obj ); } return typeof obj === "object" || typeof obj === "function" ? class2type[ core_toString.call(obj) ] || "object" : typeof obj; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !core_hasOwn.call(obj, "constructor") && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( jQuery.support.ownLast ) { for ( key in obj ) { return core_hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || core_hasOwn.call( obj, key ); }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, error: function( msg ) { throw new Error( msg ); }, // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string parseHTML: function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }, parseJSON: function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { return window.JSON.parse( data ); } if ( data === null ) { return data; } if ( typeof data === "string" ) { // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); if ( data ) { // Make sure the incoming data is actual JSON // Logic borrowed from http://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { return ( new Function( "return " + data ) )(); } } } jQuery.error( "Invalid JSON: " + data ); }, // Cross-browser xml parsing parseXML: function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data , "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }, noop: function() {}, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Use native String.trim function wherever possible trim: core_trim && !core_trim.call("\uFEFF\xA0") ? function( text ) { return text == null ? "" : core_trim.call( text ); } : // Otherwise use our own trimming functionality function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { core_push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( core_indexOf ) { return core_indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var l = second.length, i = first.length, j = 0; if ( typeof l === "number" ) { for ( ; j < l; j++ ) { first[ i++ ] = second[ j ]; } } else { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, inv ) { var retVal, ret = [], i = 0, length = elems.length; inv = !!inv; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { retVal = !!callback( elems[ i ], i ); if ( inv !== retVal ) { ret.push( elems[ i ] ); } } return ret; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret[ ret.length ] = value; } } } // Flatten any nested arrays return core_concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = core_slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function access: function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }, now: function() { return ( new Date() ).getTime(); }, // A method for quickly swapping in/out CSS properties to get correct calculations. // Note: this method belongs to the css module but it's needed here for the support module. // If support gets modularized, this method should be moved back to the css module. swap: function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; } }); jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || type !== "function" && ( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj ); } // All jQuery objects should point back to these rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.10.2 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-07-03 */ (function( window, undefined ) { var i, support, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), hasDuplicate = false, sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; return 0; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", // Prefer arguments quoted, // then not containing pseudos/brackets, // then attribute selectors/non-parenthetical expressions, // then anything else // These preferences are here to reduce the number of selectors // needing tokenize in the PSEUDO preFilter pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rsibling = new RegExp( whitespace + "*[+~]" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : // BMP codepoint high < 0 ? String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && context.parentNode || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key += " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Detect xml * @param {Element|Object} elem An element or a document */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; // Expose support vars for convenience support = Sizzle.support = {}; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent.attachEvent && parent !== parent.top ) { parent.attachEvent( "onbeforeunload", function() { setDocument(); }); } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [m] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select><option selected=''></option></select>"; // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Opera 10-12/IE8 // ^= $= *= and empty values // Should not select anything // Support: Windows 8 Native Apps // The type attribute is restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "t", "" ); if ( div.querySelectorAll("[t^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = docElem.compareDocumentPosition ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); if ( compare ) { // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || contains(preferredDoc, a) ) { return -1; } if ( b === doc || contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } // Not directly comparable, sort on existence of method return a.compareDocumentPosition ? -1 : 1; } : function( a, b ) { var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; // Parentless nodes are either documents or disconnected } else if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [elem] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array for ( ; (node = elem[i]); i++ ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (see #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[5] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] && match[4] !== undefined ) { match[2] = match[4]; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut // Greater than "@" means alpha characters (specifically not starting with "#" or "?") for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) // use getAttribute instead to test this case return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( tokens = [] ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); } function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var data, cache, outerCache, dirkey = dirruns + " " + doneName; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { if ( (data = cache[1]) === true || data === cachedruns ) { return data === true; } } else { cache = outerCache[ dir ] = [ dirkey ]; cache[1] = matcher( elem, context, xml ) || cachedruns; if ( cache[1] === true ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // A counter to specify which element is currently being matched var matcherCachedRuns = 0, bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, expandContext ) { var elem, j, matcher, setMatched = [], matchedCount = 0, i = "0", unmatched = seed && [], outermost = expandContext != null, contextBackup = outermostContext, // We must always have either seed elements or context elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); if ( outermost ) { outermostContext = context !== document && context; cachedruns = matcherCachedRuns; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below for ( ; (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; cachedruns = ++matcherCachedRuns; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !group ) { group = tokenize( selector ); } i = group.length; while ( i-- ) { cached = matcherFromTokens( group[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); } return cached; }; function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function select( selector, context, results, seed ) { var i, tokens, token, type, find, match = tokenize( selector ); if ( !seed ) { // Try to minimize operations if there is only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && context.parentNode || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } } // Compile and execute a filtering function // Provide `match` to avoid retokenization if we modified the selector above compile( selector, match )( seed, context, !documentIsHTML, results, rsibling.test( selector ) ); return results; } // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return (val = elem.getAttributeNode( name )) && val.specified ? val.value : elem[ name ] === true ? name.toLowerCase() : null; } }); } jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; })( window ); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var action = tuple[ 0 ], fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = core_slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; if( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !( --remaining ) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); jQuery.support = (function( support ) { var all, a, input, select, fragment, opt, eventName, isSupported, i, div = document.createElement("div"); // Setup div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // Finish early in limited (non-browser) environments all = div.getElementsByTagName("*") || []; a = div.getElementsByTagName("a")[ 0 ]; if ( !a || !a.style || !all.length ) { return support; } // First batch of tests select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px;float:left;opacity:.5"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName("tbody").length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName("link").length; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Make sure that element opacity exists // (IE uses filter instead) // Use a regex to work around a WebKit issue. See #5145 support.opacity = /^0.5/.test( a.style.opacity ); // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!a.style.cssFloat; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Will be defined later support.inlineBlockNeedsLayout = false; support.shrinkWrapBlocks = false; support.pixelPosition = false; support.deleteExpando = true; support.noCloneEvent = true; support.reliableMarginRight = true; support.boxSizingReliable = true; // Make sure checked status is properly cloned input.checked = true; support.noCloneChecked = input.cloneNode( true ).checked; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE<9 try { delete div.test; } catch( e ) { support.deleteExpando = false; } // Check if we can trust getAttribute("value") input = document.createElement("input"); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; // #11217 - WebKit loses check when the name is after the checked attribute input.setAttribute( "checked", "t" ); input.setAttribute( "name", "t" ); fragment = document.createDocumentFragment(); fragment.appendChild( input ); // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) support.appendChecked = input.checked; // WebKit doesn't clone checked state correctly in fragments support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) for ( i in { submit: true, change: true, focusin: true }) { div.setAttribute( eventName = "on" + i, "t" ); support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; } div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: IE<9 // Iteration over object's inherited properties before its own. for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Run tests that need a body at doc ready jQuery(function() { var container, marginDiv, tds, divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", body = document.getElementsByTagName("body")[0]; if ( !body ) { // Return for frameset docs that don't have a body return; } container = document.createElement("div"); container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; body.appendChild( container ).appendChild( div ); // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; tds = div.getElementsByTagName("td"); tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; isSupported = ( tds[ 0 ].offsetHeight === 0 ); tds[ 0 ].style.display = ""; tds[ 1 ].style.display = "none"; // Support: IE8 // Check if empty table cells still have offsetWidth/Height support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); // Check box-sizing and margin behavior. div.innerHTML = ""; div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; // Workaround failing boxSizing test due to offsetWidth returning wrong value // with some non-1 values of body zoom, ticket #13543 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { support.boxSizing = div.offsetWidth === 4; }); // Use window.getComputedStyle because jsdom on node.js will break without it. if ( window.getComputedStyle ) { support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Check if div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container. (#3333) // Fails in WebKit before Feb 2011 nightlies // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right marginDiv = div.appendChild( document.createElement("div") ); marginDiv.style.cssText = div.style.cssText = divReset; marginDiv.style.marginRight = marginDiv.style.width = "0"; div.style.width = "1px"; support.reliableMarginRight = !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); } if ( typeof div.style.zoom !== core_strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.innerHTML = ""; div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); // Support: IE6 // Check if elements with layout shrink-wrap their children div.style.display = "block"; div.innerHTML = "<div></div>"; div.firstChild.style.width = "5px"; support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); if ( support.inlineBlockNeedsLayout ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); // Null elements to avoid leaks in IE container = div = tds = marginDiv = null; }); // Null elements to avoid leaks in IE all = select = fragment = opt = a = input = null; return support; })({}); var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, rmultiDash = /([A-Z])/g; function internalData( elem, name, data, pvt /* Internal Use Only */ ){ if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( jQuery.support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements throw uncatchable exceptions if you // attempt to add expando properties to them. noData: { "applet": true, "embed": true, // Ban all objects except for Flash (which handle expandos) "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); }, // A method for determining if a DOM node can handle the data expando acceptData: function( elem ) { // Do not set data on non-element because it will not be cleared (#8335). if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { return false; } var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; // nodes accept data unless otherwise specified; rejection can be conditional return !noData || noData !== true && elem.getAttribute("classid") === noData; } }); jQuery.fn.extend({ data: function( key, value ) { var attrs, name, data = null, i = 0, elem = this[0]; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { attrs = elem.attributes; for ( ; i < attrs.length; i++ ) { name = attrs[i].name; if ( name.indexOf("data-") === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var nodeHook, boolHook, rclass = /[\t\r\n\f]/g, rreturn = /\r/g, rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = jQuery.support.getSetAttribute, getSetInput = jQuery.support.input; jQuery.fn.extend({ attr: function( name, value ) { return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); }, prop: function( name, value ) { return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); }, addClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } elem.className = jQuery.trim( cur ); } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( core_rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } elem.className = value ? jQuery.trim( cur ) : ""; } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( core_rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === core_strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; }, val: function( value ) { var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map(val, function ( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { // Use proper attribute retrieval(#6932, #12072) var val = jQuery.find.attr( elem, "value" ); return val != null ? val : elem.text; } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { optionSet = true; } } // force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } }, attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === core_strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( core_rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var fn = jQuery.expr.attrHandle[ name ], ret = isXML ? undefined : /* jshint eqeqeq: false */ (jQuery.expr.attrHandle[ name ] = undefined) != getter( elem, name, isXML ) ? name.toLowerCase() : null; jQuery.expr.attrHandle[ name ] = fn; return ret; } : function( elem, name, isXML ) { return isXML ? undefined : elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) return name === "value" || value === elem.getAttribute( name ) ? value : undefined; } }; jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = // Some attributes are constructed with empty-string values when not defined function( elem, name, isXML ) { var ret; return isXML ? undefined : (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; }; jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); return ret && ret.specified ? ret.value : undefined; }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } if ( !jQuery.support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } // Safari mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !jQuery.support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !jQuery.support.enctype ) { jQuery.propFix.enctype = "encoding"; } // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !jQuery.support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( core_rnotwhite ) || [""]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = core_hasOwn.call( event, "type" ) ? event.type : event, namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { event.preventDefault(); } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Even when returnValue equals to undefined Firefox will still show alert if ( event.result !== undefined ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === core_strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !jQuery.support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !jQuery.support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !jQuery.support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler while someone wants focusin/focusout var attaches = 0, handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { if ( attaches++ === 0 ) { document.addEventListener( orig, handler, true ); } }, teardown: function() { if ( --attaches === 0 ) { document.removeEventListener( orig, handler, true ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); var isSimple = /^.[^:#\[\.,]*$/, rparentsprev = /^(?:parents|prev(?:Until|All))/, rneedsContext = jQuery.expr.match.needsContext, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, ret = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { cur = ret.push( cur ); break; } } } return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { var set = typeof selector === "string" ? jQuery( selector, context ) : jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), all = jQuery.merge( this.get(), set ); return this.pushStack( jQuery.unique(all) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); jQuery.extend({ filter: function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }, dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( isSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, manipulation_rcheckableType = /^(?:checkbox|radio)$/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; jQuery.fn.extend({ text: function( value ) { return jQuery.access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, // keepData is for internal use only--do not document remove: function( selector, keepData ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function () { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return jQuery.access( this, function( value ) { var elem = this[0] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var // Snapshot the DOM in case .domManip sweeps something relevant into its fragment args = jQuery.map( this, function( elem ) { return [ elem.nextSibling, elem.parentNode ]; }), i = 0; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { var next = args[ i++ ], parent = args[ i++ ]; if ( parent ) { // Don't use the snapshot next if it has moved (#13810) if ( next && next.parentNode !== parent ) { next = this.nextSibling; } jQuery( this ).remove(); parent.insertBefore( elem, next ); } // Allow new content to include elements from the context set }, true ); // Force removal if there was no new content (e.g., from empty arguments) return i ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback, allowIntersection ) { // Flatten any nested arrays args = core_concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback, allowIntersection ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Hope ajax is available... jQuery._evalUrl( node.src ); } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() core_push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( manipulation_rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !jQuery.support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = jQuery.support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== core_strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } core_deletedIds.push( id ); } } } } }, _evalUrl: function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); } }); jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); var iframe, getStyles, curCSS, ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, rposition = /^(top|right|bottom|left)$/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rmargin = /^margin/, rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), elemdisplay = { BODY: "block" }, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: 0, fontWeight: 400 }, cssExpand = [ "Top", "Right", "Bottom", "Left" ], cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function isHidden( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); } } else { if ( !values[ index ] ) { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } jQuery.fn.extend({ css: function( name, value ) { return jQuery.access( this, function( elem, name, value ) { var len, styles, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that NaN and null values aren't set. See: #7116 if ( value == null || type === "number" && isNaN( value ) ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Wrapped to prevent IE from throwing errors when 'invalid' values are provided // Fixes bug #5509 try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); // NOTE: we've included the "window" in window.getComputedStyle // because jsdom on node.js will break without it. if ( window.getComputedStyle ) { getStyles = function( elem ) { return window.getComputedStyle( elem, null ); }; curCSS = function( elem, name, _computed ) { var width, minWidth, maxWidth, computed = _computed || getStyles( elem ), // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, style = elem.style; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, _computed ) { var left, rs, rsLeft, computed = _computed || getStyles( elem ), ret = computed ? computed[ name ] : undefined, style = elem.style; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } return ret === "" ? "auto" : ret; }; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } // Try to determine the default display value of an element function css_defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = ( iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>") .css( "cssText", "display:block !important" ) ).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document; doc.write("<!doctype html><html><body>"); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } // Called ONLY from within css_defaultDisplay function actualDisplay( name, doc ) { var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), display = jQuery.css( elem[0], "display" ); elem.remove(); return display; } jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !jQuery.support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } // These hooks cannot be added until DOM ready because the support test // for it is not run until after DOM ready jQuery(function() { if ( !jQuery.support.reliableMarginRight ) { jQuery.cssHooks.marginRight = { get: function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } }; } // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here if ( !jQuery.support.pixelPosition && jQuery.fn.position ) { jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = { get: function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } }; }); } }); if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; } // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function(){ // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function(){ var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !manipulation_rcheckableType.test( type ) ); }) .map(function( i, elem ){ var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ){ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); //Serialize an array of form elements or a set of //key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, // Keep a copy of the old load method _load = jQuery.fn.load, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType[0] === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = url.slice( off, url.length ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){ jQuery.fn[ type ] = function( fn ){ return this.on( type, fn ); }; }); jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) : // Otherwise add one to the end cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); var xhrCallbacks, xhrSupported, xhrId = 0, // #5280: Internet Explorer will keep connections alive if we don't abort on unload xhrOnUnloadAbort = window.ActiveXObject && function() { // Abort all pending requests var key; for ( key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }; // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch( e ) {} } // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject ? /* Microsoft failed to properly * implement the XMLHttpRequest in IE7 (can't request local files), * so we use the ActiveXObject when it is available * Additionally XMLHttpRequest can be disabled in IE7/IE8 so * we need a fallback. */ function() { return !this.isLocal && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; // Determine support properties xhrSupported = jQuery.ajaxSettings.xhr(); jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = jQuery.support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !s.crossDomain || jQuery.support.cors ) { var callback; return { send: function( headers, complete ) { // Get a new xhr var handle, i, xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) if ( s.username ) { xhr.open( s.type, s.url, s.async, s.username, s.password ); } else { xhr.open( s.type, s.url, s.async ); } // Apply custom fields if provided if ( s.xhrFields ) { for ( i in s.xhrFields ) { xhr[ i ] = s.xhrFields[ i ]; } } // Override mime type if needed if ( s.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( s.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !s.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Need an extra try/catch for cross domain requests in Firefox 3 try { for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } } catch( err ) {} // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( s.hasContent && s.data ) || null ); // Listener callback = function( _, isAbort ) { var status, responseHeaders, statusText, responses; // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Only called once callback = undefined; // Do not keep as active anymore if ( handle ) { xhr.onreadystatechange = jQuery.noop; if ( xhrOnUnloadAbort ) { delete xhrCallbacks[ handle ]; } } // If it's an abort if ( isAbort ) { // Abort it manually if needed if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; responseHeaders = xhr.getAllResponseHeaders(); // When requesting binary data, IE6-9 will throw an exception // on any attempt to access responseText (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && s.isLocal && !s.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } } catch( firefoxAccessException ) { if ( !isAbort ) { complete( -1, firefoxAccessException ); } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, responseHeaders ); } }; if ( !s.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { handle = ++xhrId; if ( xhrOnUnloadAbort ) { // Create the active xhrs callbacks list if needed // and attach the unload handler if ( !xhrCallbacks ) { xhrCallbacks = {}; jQuery( window ).unload( xhrOnUnloadAbort ); } // Add to list of active xhrs callbacks xhrCallbacks[ handle ] = callback; } xhr.onreadystatechange = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ), rrun = /queueHooks$/, animationPrefilters = [ defaultPrefilter ], tweeners = { "*": [function( prop, value ) { var tween = this.createTween( prop, value ), target = tween.cur(), parts = rfxnum.exec( value ), unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && rfxnum.exec( jQuery.css( tween.elem, prop ) ), scale = 1, maxIterations = 20; if ( start && start[ 3 ] !== unit ) { // Trust units reported by jQuery.css unit = unit || start[ 3 ]; // Make sure we update the tween properties later on parts = parts || []; // Iteratively approximate from a nonzero starting point start = +target || 1; do { // If previous iteration zeroed out, double until we get *something* // Use a string for doubling factor so we don't accidentally see scale as unchanged below scale = scale || ".5"; // Adjust and apply start = start / scale; jQuery.style( tween.elem, prop, start + unit ); // Update scale, tolerating zero or NaN from tween.cur() // And breaking the loop if scale is unchanged or perfect, or if we've just had enough } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); } // Update tween properties if ( parts ) { start = tween.start = +start || +target || 0; tween.unit = unit; // If a +=/-= token was provided, we're doing a relative animation tween.end = parts[ 1 ] ? start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : +parts[ 2 ]; } return tween; }] }; // Animations created synchronously will run synchronously function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); } function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property return tween; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ]); if ( percent < 1 && length ) { return remaining; } else { deferred.resolveWith( elem, [ animation ] ); return false; } }, animation = deferred.promise({ elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {} }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // if we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length ; index++ ) { animation.tweens[ index ].run( 1 ); } // resolve when we played the last frame // otherwise, reject if ( gotoEnd ) { deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } }), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length ; index++ ) { result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { return result; } } jQuery.map( props, createTween, animation ); if ( jQuery.isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue }) ); // attach callbacks from options return animation.progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // not quite $.extend, this wont overwrite keys already present. // also - reusing 'index' from above because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } jQuery.Animation = jQuery.extend( Animation, { tweener: function( props, callback ) { if ( jQuery.isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.split(" "); } var prop, index = 0, length = props.length; for ( ; index < length ; index++ ) { prop = props[ index ]; tweeners[ prop ] = tweeners[ prop ] || []; tweeners[ prop ].unshift( callback ); } }, prefilter: function( callback, prepend ) { if ( prepend ) { animationPrefilters.unshift( callback ); } else { animationPrefilters.push( callback ); } } }); function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false promises if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always(function() { // doing this makes sure that the complete handler will be called // before this completes anim.always(function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } }); }); } // height/width overflow pass if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { // Make sure that nothing sneaks out // Record all 3 overflow attributes because IE does not // change the overflow attribute when overflowX and // overflowY are set to the same value opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Set display property to inline-block for height/width // animations on inline elements that are having width/height animated if ( jQuery.css( elem, "display" ) === "inline" && jQuery.css( elem, "float" ) === "none" ) { // inline-level elements accept inline-block; // block-level elements need to be inline with layout if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) { style.display = "inline-block"; } else { style.zoom = 1; } } } if ( opts.overflow ) { style.overflow = "hidden"; if ( !jQuery.support.shrinkWrapBlocks ) { anim.always(function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; }); } } // show/hide pass for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.exec( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { continue; } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } if ( !jQuery.isEmptyObject( orig ) ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = jQuery._data( elem, "fxshow", {} ); } // store state if its toggle - enables .stop().toggle() to "reverse" if ( toggle ) { dataShow.hidden = !hidden; } if ( hidden ) { jQuery( elem ).show(); } else { anim.done(function() { jQuery( elem ).hide(); }); } anim.done(function() { var prop; jQuery._removeData( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } }); for ( prop in orig ) { tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = tween.start; if ( hidden ) { tween.end = tween.start; tween.start = prop === "width" || prop === "height" ? 1 : 0; } } } } } function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || "swing"; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; if ( tween.elem[ tween.prop ] != null && (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { return tween.elem[ tween.prop ]; } // passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails // so, simple values such as "10px" are parsed to Float. // complex values such as "rotate(1rad)" are returned as is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // use step hook for back compat - use cssHook if its there - use .style if its // available and use plain properties where available if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; }); jQuery.fn.extend({ fadeTo: function( speed, to, easing, callback ) { // show any hidden elements after setting opacity to 0 return this.filter( isHidden ).css( "opacity", 0 ).show() // animate to the value specified .end().animate({ opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue && type !== false ) { this.queue( type || "fx", [] ); } return this.each(function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = jQuery._data( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // start the next in the queue if the last step wasn't forced // timers currently will call their complete callbacks, which will dequeue // but only if they were gotoEnd if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } }); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each(function() { var index, data = jQuery._data( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // enable finishing flag on private data data.finish = true; // empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // turn off finishing flag delete data.finish; }); } }); // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth? 1 : 0; for( ; i < 4 ; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } // Generate shortcuts for custom animations jQuery.each({ slideDown: genFx("show"), slideUp: genFx("hide"), slideToggle: genFx("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; }); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing }; opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; // normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( jQuery.isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p*Math.PI ) / 2; } }; jQuery.timers = []; jQuery.fx = Tween.prototype.init; jQuery.fx.tick = function() { var timer, timers = jQuery.timers, i = 0; fxNow = jQuery.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Checks the timer has not already been removed if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { if ( timer() && jQuery.timers.push( timer ) ) { jQuery.fx.start(); } }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( !timerId ) { timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); } }; jQuery.fx.stop = function() { clearInterval( timerId ); timerId = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Back Compat <1.8 extension point jQuery.fx.step = {}; if ( jQuery.expr && jQuery.expr.filters ) { jQuery.expr.filters.animated = function( elem ) { return jQuery.grep(jQuery.timers, function( fn ) { return elem === fn.elem; }).length; }; } jQuery.fn.offset = function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== core_strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }; jQuery.offset = { setOffset: function( elem, options, i ) { var position = jQuery.css( elem, "position" ); // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } var curElem = jQuery( elem ), curOffset = curElem.offset(), curCSSTop = jQuery.css( elem, "top" ), curCSSLeft = jQuery.css( elem, "left" ), calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1, props = {}, curPosition = {}, curTop, curLeft; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return jQuery.access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return jQuery.access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // Limit scope pollution from any deprecated API // (function() { // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // })(); if ( typeof module === "object" && module && typeof module.exports === "object" ) { // Expose jQuery as module.exports in loaders that implement the Node // module pattern (including browserify). Do not create the global, since // the user will be storing it themselves locally, and globals are frowned // upon in the Node module world. module.exports = jQuery; } else { // Otherwise expose jQuery to the global object as usual window.jQuery = window.$ = jQuery; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. if ( typeof define === "function" && define.amd ) { define( "jquery", [], function () { return jQuery; } ); } } })( window ); /*! jQuery UI - v1.10.4 - 2014-03-09 * http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ (function(e,t){function i(t,i){var s,a,o,r=t.nodeName.toLowerCase();return"area"===r?(s=t.parentNode,a=s.name,t.href&&a&&"map"===s.nodeName.toLowerCase()?(o=e("img[usemap=#"+a+"]")[0],!!o&&n(o)):!1):(/input|select|textarea|button|object/.test(r)?!t.disabled:"a"===r?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var n,s,a=e(this[0]);a.length&&a[0]!==document;){if(n=a.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),s=isNaN(n);return(s||n>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,n){function s(t,i,n,s){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(i){return i===t?r["inner"+n].call(this):this.each(function(){e(this).css(o,s(this,i)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each(function(){e(this).css(o,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var s,a=e.ui[t].prototype;for(s in n)a.plugins[s]=a.plugins[s]||[],a.plugins[s].push([i,n[s]])},call:function(e,t,i){var n,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;s.length>n;n++)e.options[s[n][0]]&&s[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0?!0:(t[n]=1,s=t[n]>0,t[n]=0,s)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),k=t.position.getScrollInfo(y),w=(e.collision||"flip").split(" "),D={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=h.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=h.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),D[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),a=i(D.at,p,g),v.left+=a[0],v.top+=a[1],this.each(function(){var n,h,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),x=u+f+s(this,"marginRight")+k.width,C=d+_+s(this,"marginBottom")+k.height,M=t.extend({},v),T=i(D.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?M.left-=u:"center"===e.my[0]&&(M.left-=u/2),"bottom"===e.my[1]?M.top-=d:"center"===e.my[1]&&(M.top-=d/2),M.left+=T[0],M.top+=T[1],t.support.offsetFractions||(M.left=l(M.left),M.top=l(M.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[w[i]]&&t.ui.position[w[i]][s](M,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:x,collisionHeight:C,offset:[a[0]+T[0],a[1]+T[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(h=function(t){var i=m.left-M.left,s=i+p-u,n=m.top-M.top,a=n+g-d,l={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:M.left,top:M.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+a)&&(l.vertical="middle"),l.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(M,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-o-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-o-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-o-a,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,a=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,a))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,a,o,r,l,h,c,u,d,p=t(this).data("ui-draggable"),g=p.options,f=g.snapTolerance,m=i.offset.left,_=m+p.helperProportions.width,v=i.offset.top,b=v+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-f>_||m>l+f||h-f>b||v>c+f||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==g.snapMode&&(s=f>=Math.abs(h-b),n=f>=Math.abs(c-v),a=f>=Math.abs(r-_),o=f>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||a||o,"outer"!==g.snapMode&&(s=f>=Math.abs(h-v),n=f>=Math.abs(c-b),a=f>=Math.abs(r-m),o=f>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||a||o||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,a,o=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=o+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return o>=c&&d>=l&&r>=u&&p>=h;case"intersect":return o+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,a=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(a,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(o>=c&&d>=o||l>=c&&d>=l||c>o&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,a=t.ui.ddmanager.droppables[e.options.scope]||[],o=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||e&&!a[s].accept.call(a[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue t}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=t.ui.intersect(e,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),a.length&&(s=t.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),a="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,a;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,a),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(t(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),o.containment&&(s+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-a.left||0,d=e.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,a=s?0:c.sizeDiff.width,o={width:c.helper.width()-a,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(o,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,a=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),a&&(t.height=e.maxHeight),o&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),a&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,a=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:o,h=t.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,a,o=t(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-u.left:o.offset.left-u.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=Math.abs(o.parentData.left)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,c&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,a=e.containerElement,o=t(e.helper),r=o.offset(),h=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(a.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(a[e]=i||null)}),e.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,a=e.originalPosition,o=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(o)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.top=a.top-u):/^(sw)$/.test(o)?(e.size.width=d,e.size.height=p,e.position.left=a.left-c):(p-l>0?(e.size.height=p,e.position.top=a.top-u):(e.size.height=l,e.position.top=a.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=a.left-c):(e.size.width=h,e.position.left=a.left+n.width-h))}})})(jQuery);(function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=e.pageX,l=e.pageY;return a>r&&(i=r,r=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:l-o}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?h=!(i.left>r||a>i.right||i.top>l||o>i.bottom):"fit"===n.tolerance&&(h=i.left>a&&r>i.right&&i.top>o&&l>i.bottom),h?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(e){var t=0,i={},a={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",a.height=a.paddingTop=a.paddingBottom=a.borderTopWidth=a.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),undefined):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t),undefined)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,a=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:n=this.headers[(s+1)%a];break;case i.LEFT:case i.UP:n=this.headers[(s-1+a)%a];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:n=this.headers[0];break;case i.END:n=this.headers[a-1]}n&&(e(t.target).attr("tabIndex",-1),e(n).attr("tabIndex",0),n.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,a=this.options,s=a.heightStyle,n=this.element.parent(),r=this.accordionId="ui-accordion-"+(this.element.attr("id")||++t);this.active=this._findActive(a.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),a=i.attr("id"),s=i.next(),n=s.attr("id");a||(a=r+"-header-"+t,i.attr("id",a)),n||(n=r+"-panel-"+t,s.attr("id",n)),i.attr("aria-controls",n),s.attr("aria-labelledby",a)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(a.event),"fill"===s?(i=n.height(),this.element.siblings(":visible").each(function(){var t=e(this),a=t.css("position");"absolute"!==a&&"fixed"!==a&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(i=0,this.headers.next().each(function(){i=Math.max(i,e(this).css("height","").height())}).height(i))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,a=this.active,s=e(t.currentTarget),n=s[0]===a[0],r=n&&i.collapsible,o=r?e():s.next(),h=a.next(),d={oldHeader:a,oldPanel:h,newHeader:r?e():s,newPanel:o};t.preventDefault(),n&&!i.collapsible||this._trigger("beforeActivate",t,d)===!1||(i.active=r?!1:this.headers.index(s),this.active=n?e():s,this._toggle(d),a.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&a.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),n||(s.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),s.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,a=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=a,this.options.animate?this._animate(i,a,t):(a.hide(),i.show(),this._toggleComplete(t)),a.attr({"aria-hidden":"true"}),a.prev().attr("aria-selected","false"),i.length&&a.length?a.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(e,t,s){var n,r,o,h=this,d=0,c=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},u=c&&l.down||l,v=function(){h._toggleComplete(s)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||l.easing,o=o||u.duration||l.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(i,{duration:o,easing:r,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(a,{duration:o,easing:r,complete:v,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?d+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-d),d=0)}}),undefined):t.animate(i,o,r,v):e.animate(a,o,r,v)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})})(jQuery);(function(e){e.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(e){var t,i="ui-button ui-widget ui-state-default ui-corner-all",n="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",s=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},a=function(t){var i=t.name,n=t.form,s=e([]);return i&&(i=i.replace(/'/g,"\\'"),s=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),s};e.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,s),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var n=this,o=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===o.label&&(o.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){o.disabled||this===t&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){o.disabled||e(this).removeClass(h)}).bind("click"+this.eventNamespace,function(e){o.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){n.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return o.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(o.disabled)return!1;e(this).addClass("ui-state-active"),n.buttonElement.attr("aria-pressed","true");var t=n.element[0];a(t).not(t).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return o.disabled?!1:(e(this).addClass("ui-state-active"),t=this,n.document.one("mouseup",function(){t=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return o.disabled?!1:(e(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(t){return o.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",o.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+n).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.element.prop("disabled",!!t),t&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?a(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var t=this.buttonElement.removeClass(n),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,a=s.primary&&s.secondary,o=[];s.primary||s.secondary?(this.options.text&&o.push("ui-button-text-icon"+(a?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(o.push(a?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):o.push("ui-button-text-only"),t.addClass(o.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(n.inline?t.parent()[0]:n.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function s(t,i){e.extend(t,i);for(var a in i)null==i[a]&&(t[a]=i[a]);return t}e.extend(e.ui,{datepicker:{version:"1.10.4"}});var n,r="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return s(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var a,s,n;a=t.nodeName.toLowerCase(),s="div"===a||"span"===a,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),s),n.settings=e.extend({},i||{}),"input"===a?this._connectDatepicker(t,n):s&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var a=e(t);i.append=e([]),i.trigger=e([]),a.hasClass(this.markerClassName)||(this._attachments(a,i),a.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,r,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var a,s,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),a=this._get(i,"showOn"),("focus"===a||"both"===a)&&t.focus(this._showDatepicker),("button"===a||"both"===a)&&(s=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,a,s,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,a=0,s=0;e.length>s;s++)e[s].length>i&&(i=e[s].length,a=s);return a},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var a=e(t);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(i.dpDiv),e.data(t,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,a,n,o){var u,c,h,l,d,p=this._dialogInst;return p||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],r,p)),s(p.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(c=document.documentElement.clientWidth,h=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+l,h/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(t){var i,a=e(t),s=e.data(t,r);a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,r),"input"===i?(s.append.remove(),s.trigger.remove(),a.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&a.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,a,s=e(t),n=e.data(t,r);s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(a=s.children("."+this._inlineClass),a.children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,a,n){var r,o,u,c,h=this._getInst(i);return 2===arguments.length&&"string"==typeof a?"defaults"===a?e.extend({},e.datepicker._defaults):h?"all"===a?e.extend({},h.settings):this._get(h,a):null:(r=a||{},"string"==typeof a&&(r={},r[a]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),u=this._getMinMaxDate(h,"min"),c=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==u&&r.dateFormat!==t&&r.minDate===t&&(h.settings.minDate=this._formatDate(h,u)),null!==c&&r.dateFormat!==t&&r.maxDate===t&&(h.settings.maxDate=this._formatDate(h,c)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(e(i),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),t)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,a,s,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),s[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,s[0]),i=e.datepicker._get(n,"onSelect"),i?(a=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[a,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(i){var a,s,n=e.datepicker._getInst(i.target);return e.datepicker._get(n,"constrainInput")?(a=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">s||!a||a.indexOf(s)>-1):t},_doKeyUp:function(t){var i,a=e.datepicker._getInst(t.target);if(a.input.val()!==a.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,e.datepicker._getFormatConfig(a)),i&&(e.datepicker._setDateFromField(a),e.datepicker._updateAlternate(a),e.datepicker._updateDatepicker(a))}catch(s){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,o,u,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(s(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),o=e.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(u=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[u]?i.dpDiv.show(u,e.datepicker._get(i,"showOptions"),c):i.dpDiv[u||"show"](u?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,n=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,a=this._getNumberOfMonths(t),s=a[1],r=17;t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",r*s+"em"),t.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,a){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,u=document.documentElement.clientWidth+(a?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-r:0,i.left-=a&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=a&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>u&&u>s?Math.abs(i.left+s-u):0),i.top-=Math.min(i.top,i.top+n>c&&c>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,a=this._getInst(t),s=this._get(a,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,a,s,n,o=this._curInst;!o||t&&o!==e.data(t,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),a=this._get(o,"duration"),s=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),a,s):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?a:null,s),i||s(),this._datepickerShowing=!1,n=this._get(o,"onClose"),n&&n.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),a=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==a)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,a){var s=e(t),n=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(n,i+("M"===a?this._get(n,"showCurrentAtPos"):0),a),this._updateDatepicker(n))},_gotoToday:function(t){var i,a=e(t),s=this._getInst(a[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(a)},_selectMonthYear:function(t,i,a){var s=e(t),n=this._getInst(s[0]);n["selected"+("M"===a?"Month":"Year")]=n["draw"+("M"===a?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(s)},_selectDay:function(t,i,a,s){var n,r=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",s).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=a,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var a,s=e(t),n=this._getInst(s[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),a=this._get(n,"onSelect"),a?a.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,a,s,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),a=this._getDate(t),s=this.formatDate(i,a,this._getFormatConfig(t)),e(n).each(function(){e(this).val(s)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(i,a,s){if(null==i||null==a)throw"Invalid arguments";if(a="object"==typeof a?""+a:a+"",""===a)return null;var n,r,o,u,c=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,p=(s?s.dayNames:null)||this._defaults.dayNames,g=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,m=(s?s.monthNames:null)||this._defaults.monthNames,f=-1,_=-1,v=-1,k=-1,y=!1,b=function(e){var t=i.length>n+1&&i.charAt(n+1)===e;return t&&n++,t},D=function(e){var t=b(e),i="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s=RegExp("^\\d{1,"+i+"}"),n=a.substring(c).match(s);if(!n)throw"Missing number at position "+c;return c+=n[0].length,parseInt(n[0],10)},w=function(i,s,n){var r=-1,o=e.map(b(i)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,i){var s=i[1];return a.substr(c,s.length).toLowerCase()===s.toLowerCase()?(r=i[0],c+=s.length,!1):t}),-1!==r)return r+1;throw"Unknown name at position "+c},M=function(){if(a.charAt(c)!==i.charAt(n))throw"Unexpected literal at position "+c;c++};for(n=0;i.length>n;n++)if(y)"'"!==i.charAt(n)||b("'")?M():y=!1;else switch(i.charAt(n)){case"d":v=D("d");break;case"D":w("D",d,p);break;case"o":k=D("o");break;case"m":_=D("m");break;case"M":_=w("M",g,m);break;case"y":f=D("y");break;case"@":u=new Date(D("@")),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"!":u=new Date((D("!")-this._ticksTo1970)/1e4),f=u.getFullYear(),_=u.getMonth()+1,v=u.getDate();break;case"'":b("'")?M():y=!0;break;default:M()}if(a.length>c&&(o=a.substr(c),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():100>f&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=f?0:-100)),k>-1)for(_=1,v=k;;){if(r=this._getDaysInMonth(f,_-1),r>=v)break;_++,v-=r}if(u=this._daylightSavingAdjust(new Date(f,_-1,v)),u.getFullYear()!==f||u.getMonth()+1!==_||u.getDate()!==v)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,u=function(t){var i=e.length>a+1&&e.charAt(a+1)===t;return i&&a++,i},c=function(e,t,i){var a=""+t;if(u(e))for(;i>a.length;)a="0"+a;return a},h=function(e,t,i,a){return u(e)?a[t]:i[t]},l="",d=!1;if(t)for(a=0;e.length>a;a++)if(d)"'"!==e.charAt(a)||u("'")?l+=e.charAt(a):d=!1;else switch(e.charAt(a)){case"d":l+=c("d",t.getDate(),2);break;case"D":l+=h("D",t.getDay(),s,n);break;case"o":l+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":l+=c("m",t.getMonth()+1,2);break;case"M":l+=h("M",t.getMonth(),r,o);break;case"y":l+=u("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=1e4*t.getTime()+this._ticksTo1970;break;case"'":u("'")?l+="'":d=!0;break;default:l+=e.charAt(a)}return l},_possibleChars:function(e){var t,i="",a=!1,s=function(i){var a=e.length>t+1&&e.charAt(t+1)===i;return a&&t++,a};for(t=0;e.length>t;t++)if(a)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):a=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":a=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,i){return e.settings[i]!==t?e.settings[i]:this._defaults[i]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),a=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),n=s,r=this._getFormatConfig(e);try{n=this.parseDate(i,a,r)||s}catch(o){a=t?"":a}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=a?n.getDate():0,e.currentMonth=a?n.getMonth():0,e.currentYear=a?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,a){var s=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(a){}for(var s=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=s.getFullYear(),r=s.getMonth(),o=s.getDate(),u=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,c=u.exec(i);c;){switch(c[2]||"d"){case"d":case"D":o+=parseInt(c[1],10);break;case"w":case"W":o+=7*parseInt(c[1],10);break;case"m":case"M":r+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(c[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}c=u.exec(i)}return new Date(n,r,o)},r=null==i||""===i?a:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?a:s(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?a:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var a=!t,s=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),s===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(a?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),a="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(a,-i,"M")},next:function(){e.datepicker._adjustDate(a,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(a)},selectDay:function(){return e.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(a,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,a,s,n,r,o,u,c,h,l,d,p,g,m,f,_,v,k,y,b,D,w,M,C,x,I,N,T,A,E,S,Y,F,P,O,j,K,R,H=new Date,W=this._daylightSavingAdjust(new Date(H.getFullYear(),H.getMonth(),H.getDate())),L=this._get(e,"isRTL"),U=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),Q=1!==q[0]||1!==q[1],V=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),$=this._getMinMaxDate(e,"min"),X=this._getMinMaxDate(e,"max"),Z=e.drawMonth-G,et=e.drawYear;if(0>Z&&(Z+=12,et--),X)for(t=this._daylightSavingAdjust(new Date(X.getFullYear(),X.getMonth()-q[0]*q[1]+1,X.getDate())),t=$&&$>t?$:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=z?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):i,a=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=z?this.formatDate(s,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):s,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(L?"w":"e")+"'>"+s+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?V:W,r=z?this.formatDate(r,o,this._getFormatConfig(e)):r,u=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(L?u:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(L?"":u)+"</div>":"",h=parseInt(this._get(e,"firstDay"),10),h=isNaN(h)?0:h,l=this._get(e,"showWeek"),d=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),g=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),f=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),k=this._getDefaultDate(e),y="",D=0;q[0]>D;D++){for(w="",this.maxRows=4,M=0;q[1]>M;M++){if(C=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),x=" ui-corner-all",I="",Q){if(I+="<div class='ui-datepicker-group",q[1]>1)switch(M){case 0:I+=" ui-datepicker-group-first",x=" ui-corner-"+(L?"right":"left");break;case q[1]-1:I+=" ui-datepicker-group-last",x=" ui-corner-"+(L?"left":"right");break;default:I+=" ui-datepicker-group-middle",x=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+x+"'>"+(/all|left/.test(x)&&0===D?L?n:a:"")+(/all|right/.test(x)&&0===D?L?a:n:"")+this._generateMonthYearHeader(e,Z,et,$,X,D>0||M>0,g,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",N=l?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;7>b;b++)T=(b+h)%7,N+="<th"+((b+h+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[T]+"'>"+p[T]+"</span></th>";for(I+=N+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),E=(this._getFirstDayOfMonth(et,Z)-h+7)%7,S=Math.ceil((E+A)/7),Y=Q?this.maxRows>S?this.maxRows:S:S,this.maxRows=Y,F=this._daylightSavingAdjust(new Date(et,Z,1-E)),P=0;Y>P;P++){for(I+="<tr>",O=l?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;7>b;b++)j=f?f.apply(e.input?e.input[0]:null,[F]):[!0,""],K=F.getMonth()!==Z,R=K&&!v||!j[0]||$&&$>F||X&&F>X,O+="<td class='"+((b+h+6)%7>=5?" ui-datepicker-week-end":"")+(K?" ui-datepicker-other-month":"")+(F.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||k.getTime()===F.getTime()&&k.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(K&&!_?"":" "+j[1]+(F.getTime()===V.getTime()?" "+this._currentClass:"")+(F.getTime()===W.getTime()?" ui-datepicker-today":""))+"'"+(K&&!_||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(K&&!_?"&#xa0;":R?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===W.getTime()?" ui-state-highlight":"")+(F.getTime()===V.getTime()?" ui-state-active":"")+(K?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);I+=O+"</tr>"}Z++,Z>11&&(Z=0,et++),I+="</tbody></table>"+(Q?"</div>"+(q[0]>0&&M===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=I}y+=w}return y+=c,e._keyEvent=!1,y},_generateMonthYearHeader:function(e,t,i,a,s,n,r,o){var u,c,h,l,d,p,g,m,f=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),k="<div class='ui-datepicker-title'>",y="";if(n||!f)y+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(u=a&&a.getFullYear()===i,c=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",h=0;12>h;h++)(!u||h>=a.getMonth())&&(!c||s.getMonth()>=h)&&(y+="<option value='"+h+"'"+(h===t?" selected='selected'":"")+">"+o[h]+"</option>");y+="</select>"}if(v||(k+=y+(!n&&f&&_?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",n||!_)k+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(l=this._get(e,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?d+parseInt(e,10):parseInt(e,10); return isNaN(t)?d:t},g=p(l[0]),m=Math.max(g,p(l[1]||"")),g=a?Math.max(g,a.getFullYear()):g,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=g;g++)e.yearshtml+="<option value='"+g+"'"+(g===i?" selected='selected'":"")+">"+g+"</option>";e.yearshtml+="</select>",k+=e.yearshtml,e.yearshtml=null}return k+=this._get(e,"yearSuffix"),v&&(k+=(!n&&f&&_?"":"&#xa0;")+y),k+="</div>"},_adjustInstDate:function(e,t,i){var a=e.drawYear+("Y"===i?t:0),s=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(a,s))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(a,s,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),s=i&&i>t?i:t;return a&&s>a?a:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,a){var s=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,a+(0>t?t:s[0]*s[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,a,s=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,u=this._get(e,"yearRange");return u&&(i=u.split(":"),a=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=a),i[1].match(/[+\-].*/)&&(o+=a)),(!s||t.getTime()>=s.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,a){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(a,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.4"})(jQuery);(function(e){var t={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,a=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(s){}this._hide(this.uiDialog,this.options.hide,function(){a._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),undefined;if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),a=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==a[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(s.focus(1),t.preventDefault()):(a.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(e.each(i,function(i,a){var s,n;a=e.isFunction(a)?{click:a,text:i}:a,a=e.extend({type:"button"},a),s=a.click,a.click=function(){s.apply(t.element[0],arguments)},n={icons:a.icons,text:a.showText},delete a.icons,delete a.showText,e("<button></button>",a).button(n).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,a=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(a,s){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",a,t(s))},drag:function(e,a){i._trigger("drag",e,t(a))},stop:function(s,n){a.position=[n.position.left-i.document.scrollLeft(),n.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(n))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,a=this.options,s=a.resizable,n=this.uiDialog.css("position"),r="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:r,start:function(a,s){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",a,t(s))},resize:function(e,a){i._trigger("resize",e,t(a))},stop:function(s,n){a.height=e(this).height(),a.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(n))}}).css("position",n)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(a){var s=this,n=!1,r={};e.each(a,function(e,a){s._setOption(e,a),e in t&&(n=!0),e in i&&(r[e]=a)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,t){var i,a,s=this.uiDialog;"dialogClass"===e&&s.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=s.is(":data(ui-draggable)"),i&&!t&&s.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(a=s.is(":data(ui-resizable)"),a&&!t&&s.resizable("destroy"),a&&"string"==typeof t&&s.resizable("option","handles",t),a||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,a=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),a.minWidth>a.width&&(a.width=a.minWidth),e=this.uiDialog.css({height:"auto",width:a.width}).outerHeight(),t=Math.max(0,a.minHeight-e),i="number"==typeof a.maxHeight?Math.max(0,a.maxHeight-e):"none","auto"===a.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,a.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(a){t._allowInteraction(a)||(a.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,a=[],s=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(a=i.split?i.split(" "):[i[0],i[1]],1===a.length&&(a[1]=a[0]),e.each(["left","top"],function(e,t){+a[e]===a[e]&&(s[e]=a[e],a[e]=t)}),i={my:a[0]+(0>s[0]?s[0]:"+"+s[0])+" "+a[1]+(0>s[1]?s[1]:"+"+s[1]),at:a.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,l=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:l=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,l,h,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),l=a.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-a.width()/2,top:e.pageY-l.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,a){var o,r=a.re.exec(i),l=r&&a.parse(r),h=a.space||"rgba";return l?(o=s[h](l),s[c[h].cache]=o[c[h].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,o,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,l],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),a=c[n],o=0===this.alpha()?h("transparent"):this,r=o[a.cache]||a.to(o._rgba),l=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],h=s[a],c=u[n.type]||{};null!==h&&(null===o?l[a]=h:(c.mod&&(h-o>c.mod/2?o+=c.mod:o-h>c.mod/2&&(o-=c.mod)),l[a]=i((h-o)*e+o,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),l=Math.min(s,n,a),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-a)/h+360:n===r?60*(a-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[o]&&(this[o]=l(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[o]=d,n):h(d)},f(a,function(e,i){h.fn[e]||(h.fn[e]=function(n){var a,o=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=h(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var l=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",h=l.children?o.find("*").addBack():o;h=h.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),h=h.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,l=t(this),h=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(l,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;l.parent().is(".ui-effects-wrapper")?t.effects.save(l.parent(),h):t.effects.save(l,h),l.show(),a=t.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,m[p]=v?o:0,g||(l.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:o+r),v&&(a.css(p,0),g||a.css(f,r+o)),a.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&l.hide(),t.effects.restore(l,h),t.effects.removeWrapper(l),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"effect"),h="hide"===l,c="show"===l,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||h?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||h)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,g,m)),h&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m).animate(a,g,m),d=h?2*d:d/2;h&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,g,m)),o.queue(function(){h&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],l=t.effects.setMode(o,e.mode||"hide"),h="show"===l,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),h&&(n.css(d,0),n.css(p,a/2)),f[d]=h?a:0,f[p]=h?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){h||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(h,"pos"===c?-s:s),u[h]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var a,o,r,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(l=m.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=m.left+o*v,h=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?h*v:0),top:l+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),l="show"===r,h="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=l!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[h?0:1]),l&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=l?n[0]:c,v[f[1]]=l?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){h&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,l=o||"hide"===a,h=2*(e.times||5)+(l?1:0),c=e.duration/h,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;h>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,h+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?l:{height:l.height*r,width:l.width*r,outerHeight:l.outerHeight*r,outerWidth:l.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=o.css("position"),_=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===g||"both"===g)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===g||"both"===g)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(h),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(n=t.effects.getBaseline(m,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",l=e.distance||20,h=e.times||3,c=2*h+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+l,g[d]=(p?"+=":"-=")+2*l,m[d]=(p?"-=":"+=")+2*l,n.animate(f,u,e.easing),s=1;h>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(h,c?isNaN(s)?"-"+s:-s:s),u[h]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,l=a?o.scrollLeft():0,h=n.offset(),c={top:h.top-r,left:h.left-l,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-l,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery); function create_champ(i) { var i2 = i + 1, champ=document.getElementById('leschamps_'+i); var tablenom=['Lieudit','Action','Annee','Bague','BG','Colonie','Secteur','Terrier','Bagueur','Sexe','Age'], tablenom1=['lieudit','action','date','bague','bg', 'colonie','secteur','terrier','bagueur','sexe','age']; //alert(champ); if(i>1) { var i3=i-1, img=document.getElementById('ferm'+i3); img.parentNode.removeChild(img); } var inputs=document.getElementsByTagName('span'); var form='<br/><select onchange="change(this.value,this.id,'+i+')" name="new_champ_'+i+'" id="new_champ_'+i+'">', form2, act1=true; for(var j=0; j<11; j++) { var act=true; for(var k=1; k<i+1; k++) { if(inputs[k].childNodes.length >2 ){ if(tablenom1[j]==inputs[k].childNodes[1].value || tablenom1[j]==inputs[0].childNodes[3].value) act=false; } } if(act==true && act1==true) { form+='<option value="'+tablenom1[j]+'" selected>'+tablenom[j]+'</option>'; act1=false; } else { form+='<option value="'+tablenom1[j]+'">'+tablenom[j]+'</option>'; } } form+='</select>'; champ.innerHTML = form; if(document.getElementById('new_champ_'+i).value=='action') { form+='<select name="champ'+i+'" id="action"> <option value="B">B</option><option value="C">C</option><option value="R">R</option><option value=""> </option></select>'; } else if(document.getElementById('new_champ_'+i).value=='date') { form+='<select name="champ'+i+'" id="date">'; for (var j=2023; j>1982; j--) { if(j==2014){ form += '<option value="'+j+'" selected>'+j+'</option>'; } else{ form += '<option value="'+j+'">'+j+'</option>'; } } form += '</select>'; } else if(document.getElementById('new_champ_'+i).value=='sexe') { form+='<select name="champ'+i+'" id="sexe"> <option value="M">M</option><option value="F">F</option><option value="?">?</option><option value=""> </option></select>'; } else if(document.getElementById('new_champ_'+i).value=='age') { form+='<select name="champ'+i+'" id="age"> <option value="PUL">PUL</option><option value="VOL">VOL</option><option value="+1A">+1A</option><option value=""> </option></select>'; } else { form+='<input type="text" name="champ'+i+'" id="champ_'+i+'" />'; } form+='<img src="../bundles/parcpuffinsbag/images/icone_fermer.png" alt="" id="ferm'+i+'" onclick="supprimer(this.id,'+i+')" class="icone"/>'; //form+=(i < 7) ? '<img src="../bundles/parcpuffinsbag/images/icone_fermer.png" alt="" id="ferm'+i+'" onclick="supprimer(this.id,'+i+')" class="icone"/>' : ''; form+= (i < 11) ? '<span id="leschamps_'+i2+'"> <br/> <a href="javascript:create_champ('+i2+')" class="ajout">Ajouter un champ</a></span>' : ''; //form2+='<script type="text/javascript">; </script>' //alert(champ.parentNode); //champ.parentNode.innerHTML+=form2; champ.innerHTML = form; } function change(select,id,i) { var form=''; new_elmt=document.createElement('div'), inp=document.getElementById(id).parentNode; if(i==0) {k=5;}else{k=2} var old_elmt=inp.childNodes[k]; new_elmt.style.display='inline-block'; //alert(old_elmt); if(select=='action') { form='<select name="champ'+i+'" id="action"> <option value="B">B</option><option value="C">C</option><option value="R">R</option><option value=""></option></select>'; } else if(select=='date') { form='<select name="champ'+i+'" id="date">'; for (var j=2023; j>1982; j--) { if(j==2014){ form += '<option value="'+j+'" selected>'+j+'</option>';} else{form += '<option value="'+j+'">'+j+'</option>';} } form += '</select>'; } else if(document.getElementById('new_champ_'+i).value=='sexe') { form+='<select name="champ'+i+'" id="sexe"> <option value="M">M</option><option value="F">F</option><option value="?">?</option><option value=""> </option></select>'; } else if(document.getElementById('new_champ_'+i).value=='age') { form+='<select name="champ'+i+'" id="age"> <option value="PUL">PUL</option><option value="VOL">VOL</option><option value="+1A">+1A</option><option value=""> </option></select>'; } else { form+='<input type="text" name="champ'+i+'" id="champ_'+i+'" />'; } //alert(inp); inp.replaceChild(new_elmt,old_elmt); inp.childNodes[k].innerHTML=form; } function supprimer(id,i){ var a=document.getElementById(id).parentNode, form="", p=i-1; a.parentNode.removeChild(a); var champ=document.getElementById('leschamps_'+p); if(i>1) {form='<img src="../bundles/parcpuffinsbag/images/icone_fermer.png" alt="" id="ferm'+p+'" onclick="supprimer(this.id,'+p+')" />';} form+='<span id="leschamps_'+i+'"> <br/> <a href="javascript:create_champ('+i+')" class="ajout">Ajouter un champ</a></span>'; champ.innerHTML+=form; } $(function() { var href =""; $( ".dialog-form" ).dialog({ autoOpen: false, height: 150, width: 300, modal: true, buttons: { "Supprimer": function() { $("form").attr("action",href); $("form").submit(); $( this ).dialog( "close" ); }, Annuler: function() { $( this ).dialog( "close" ); } }, close: function() { } }); $( ".supp_enr" ) .click(function() { href=$(this).attr("id"); $( ".dialog-form" ).dialog( "open" ); }); $( ".dialog-form2" ).dialog({ autoOpen: false, height: 415, width: 515, modal: true, buttons: { "Ajouter": function() { //$("form").attr("action",href); $("form").submit(); $( this ).dialog( "close" ); }, Annuler: function() { $( this ).dialog( "close" ); } }, close: function() { } }); $( "#news-add" ) .button() .click(function() { //href=$(this).attr("id"); $(".dialog-form2" ).dialog( "open" ); }); $( "#doc-add" ) .button() .click(function() { //href=$(this).attr("id"); $(".dialog-form2" ).dialog( "open" ); }); $( ".dialog-form3" ).dialog({ autoOpen: false, height: 150, width: 300, modal: true, buttons: { "Reinitialiser": function() { $("form").attr("action",href); $("form").submit(); $( this ).dialog( "close" ); }, Annuler: function() { $( this ).dialog( "close" ); } }, close: function() { } }); $( ".mdp_reinit" ) .click(function() { href=$(this).attr("id"); $( ".dialog-form3" ).dialog( "open" ); }); });
/* http://keith-wood.name/calendars.html Traditional Chinese localisation for Gregorian/Julian calendars for jQuery. Written by Ressol (ressol@gmail.com). */ (function($) { $.calendars.calendars.gregorian.prototype.regionalOptions['zh-TW'] = { name: 'Gregorian', epochs: ['BCE', 'CE'], monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'], monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'], dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'], dayNamesMin: ['日','一','二','三','四','五','六'], dateFormat: 'yyyy/mm/dd', firstDay: 1, isRTL: false }; if ($.calendars.calendars.julian) { $.calendars.calendars.julian.prototype.regionalOptions['zh-TW'] = $.calendars.calendars.gregorian.prototype.regionalOptions['zh-TW']; } })(jQuery);
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _pure = require('recompose/pure'); var _pure2 = _interopRequireDefault(_pure); var _svgIcon = require('../../svg-icon'); var _svgIcon2 = _interopRequireDefault(_svgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ActionRowing = function ActionRowing(props) { return _react2.default.createElement( _svgIcon2.default, props, _react2.default.createElement('path', { d: 'M8.5 14.5L4 19l1.5 1.5L9 17h2l-2.5-2.5zM15 1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 20.01L18 24l-2.99-3.01V19.5l-7.1-7.09c-.31.05-.61.07-.91.07v-2.16c1.66.03 3.61-.87 4.67-2.04l1.4-1.55c.19-.21.43-.38.69-.5.29-.14.62-.23.96-.23h.03C15.99 6.01 17 7.02 17 8.26v5.75c0 .84-.35 1.61-.92 2.16l-3.58-3.58v-2.27c-.63.52-1.43 1.02-2.29 1.39L16.5 18H18l3 3.01z' }) ); }; ActionRowing = (0, _pure2.default)(ActionRowing); ActionRowing.displayName = 'ActionRowing'; exports.default = ActionRowing;
webpackHotUpdate("static/development/pages/calc.js",{ /***/ "./componentes/calculadora.js": /*!************************************!*\ !*** ./componentes/calculadora.js ***! \************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/classCallCheck */ "./node_modules/@babel/runtime-corejs2/helpers/esm/classCallCheck.js"); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/createClass */ "./node_modules/@babel/runtime-corejs2/helpers/esm/createClass.js"); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/possibleConstructorReturn */ "./node_modules/@babel/runtime-corejs2/helpers/esm/possibleConstructorReturn.js"); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/getPrototypeOf */ "./node_modules/@babel/runtime-corejs2/helpers/esm/getPrototypeOf.js"); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/assertThisInitialized */ "./node_modules/@babel/runtime-corejs2/helpers/esm/assertThisInitialized.js"); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/inherits */ "./node_modules/@babel/runtime-corejs2/helpers/esm/inherits.js"); /* harmony import */ var _babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime-corejs2/helpers/esm/defineProperty */ "./node_modules/@babel/runtime-corejs2/helpers/esm/defineProperty.js"); /* harmony import */ var styled_jsx_style__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! styled-jsx/style */ "./node_modules/styled-jsx/style.js"); /* harmony import */ var styled_jsx_style__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(styled_jsx_style__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__); var _jsxFileName = "/Users/urialcantar/Proyectos/proyectosNuevos/holaMundoNext/componentes/calculadora.js"; var __jsx = react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement; var Calculadora = /*#__PURE__*/ function (_React$Component) { Object(_babel_runtime_corejs2_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_5__["default"])(Calculadora, _React$Component); function Calculadora() { var _getPrototypeOf2; var _this; Object(_babel_runtime_corejs2_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__["default"])(this, Calculadora); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = Object(_babel_runtime_corejs2_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__["default"])(this, (_getPrototypeOf2 = Object(_babel_runtime_corejs2_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__["default"])(Calculadora)).call.apply(_getPrototypeOf2, [this].concat(args))); Object(_babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_corejs2_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this), "state", { res: '' }); Object(_babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_corejs2_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this), "onDigit", function (digit) { var expression = _this.state.res + digit; console.log(digit); _this.setState({ res: expression }); }); Object(_babel_runtime_corejs2_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_babel_runtime_corejs2_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__["default"])(_this), "ejecutarOperacion", function () { var resultados = eval(_this.state.res); _this.setState({ res: resultados }); }); return _this; } Object(_babel_runtime_corejs2_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__["default"])(Calculadora, [{ key: "render", value: function render() { var _this2 = this; var alerta2 = function alerta2() { return alert('const alertados'); }; return __jsx("div", { className: "jsx-1222015479", __source: { fileName: _jsxFileName, lineNumber: 26 }, __self: this }, __jsx("div", { className: "jsx-1222015479" + " " + "z-depth-2 cyan darken-3 white-text center-align resultados", __source: { fileName: _jsxFileName, lineNumber: 27 }, __self: this }, this.state.res || '0'), __jsx("div", { className: "jsx-1222015479" + " " + "calc-container blue lighten-3 hoverable z-depth-2", __source: { fileName: _jsxFileName, lineNumber: 30 }, __self: this }, ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.'].map(function (digit) { return __jsx("a", { key: digit, onClick: function onClick() { return _this2.onDigit(digit); }, className: "jsx-1222015479" + " " + "waves-effect waves-light cyan darken-3 btn-large", __source: { fileName: _jsxFileName, lineNumber: 34 }, __self: this }, digit); }), __jsx("div", { className: "jsx-1222015479" + " " + "operadores center-align", __source: { fileName: _jsxFileName, lineNumber: 38 }, __self: this }, ['+', '-', '/', '*'].map(function (digit) { return __jsx("a", { key: digit, onClick: function onClick() { return _this2.onDigit(digit); }, className: "jsx-1222015479" + " " + "waves-effect waves-light amber darken-3 btn", __source: { fileName: _jsxFileName, lineNumber: 42 }, __self: this }, digit); }), __jsx("a", { onClick: function onClick() { return _this2.setState({ res: '' }); }, className: "jsx-1222015479" + " " + "waves-effect waves-light amber darken-3 btn", __source: { fileName: _jsxFileName, lineNumber: 46 }, __self: this }, "C")), __jsx("a", { onClick: this.ejecutarOperacion, className: "jsx-1222015479" + " " + "waves-effect waves-light amber darken-3 btn", __source: { fileName: _jsxFileName, lineNumber: 48 }, __self: this }, "Enter")), __jsx(styled_jsx_style__WEBPACK_IMPORTED_MODULE_7___default.a, { id: "1222015479", __self: this }, ".resultados.jsx-1222015479{width:300px;margin:0 auto;font-size:32px;margin-bottom:10px;}.calc-container.jsx-1222015479{width:300px;text-align:center;margin:0 auto;padding:12px;}.calc-container.jsx-1222015479 a.jsx-1222015479{margin:5px;}.operadors.jsx-1222015479{border:1px solid #ccc;padding:10px;margin-top:20px;}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy91cmlhbGNhbnRhci9Qcm95ZWN0b3MvcHJveWVjdG9zTnVldm9zL2hvbGFNdW5kb05leHQvY29tcG9uZW50ZXMvY2FsY3VsYWRvcmEuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbURnQixBQUdpQyxBQU1BLEFBTUQsQUFHVyxXQUYxQixDQVprQixBQU1JLFVBU04sSUFkRyxJQU1ELEtBU0UsTUFkRyxHQU94QixPQVFDLE1BUkEsR0FOQSIsImZpbGUiOiIvVXNlcnMvdXJpYWxjYW50YXIvUHJveWVjdG9zL3Byb3llY3Rvc051ZXZvcy9ob2xhTXVuZG9OZXh0L2NvbXBvbmVudGVzL2NhbGN1bGFkb3JhLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgQ2FsY3VsYWRvcmEgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnR7XG5cbiAgICBzdGF0ZSA9IHtcbiAgICAgICAgcmVzOicnXG4gICAgfVxuXG4gICAgb25EaWdpdCA9IChkaWdpdCkgPT4ge1xuICAgICAgICBjb25zdCBleHByZXNzaW9uID0gdGhpcy5zdGF0ZS5yZXMgKyBkaWdpdDtcbiAgICAgICAgY29uc29sZS5sb2coZGlnaXQpO1xuICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgIHJlczogZXhwcmVzc2lvblxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBlamVjdXRhck9wZXJhY2lvbiA9ICgpID0+IHtcbiAgICAgICAgY29uc3QgcmVzdWx0YWRvcyA9IGV2YWwodGhpcy5zdGF0ZS5yZXMpO1xuICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgIHJlczpyZXN1bHRhZG9zXG4gICAgICAgIH0pXG4gICAgfVxuXG4gICAgcmVuZGVyKCkge1xuXG4gICAgICAgIGNvbnN0IGFsZXJ0YTIgPSAoKT0+YWxlcnQoJ2NvbnN0IGFsZXJ0YWRvcycpO1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPGRpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiei1kZXB0aC0yIGN5YW4gZGFya2VuLTMgd2hpdGUtdGV4dCBjZW50ZXItYWxpZ24gcmVzdWx0YWRvc1wiPlxuICAgICAgICAgICAgICAgIHt0aGlzLnN0YXRlLnJlcyB8fCAnMCd9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiY2FsYy1jb250YWluZXIgYmx1ZSBsaWdodGVuLTMgaG92ZXJhYmxlIHotZGVwdGgtMlwiPlxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgWycwJywnMScsJzInLCczJywnNCcsJzUnLCc2JywnNycsJzgnLCc5JywnLiddLm1hcChkaWdpdCA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEga2V5PXtkaWdpdH0gY2xhc3NOYW1lPVwid2F2ZXMtZWZmZWN0IHdhdmVzLWxpZ2h0IGN5YW4gZGFya2VuLTMgYnRuLWxhcmdlXCIgb25DbGljaz17KCkgPT4gdGhpcy5vbkRpZ2l0KGRpZ2l0KX0+e2RpZ2l0fTwvYT5cbiAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cIm9wZXJhZG9yZXMgY2VudGVyLWFsaWduXCI+XG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBbJysnLCctJywnLycsJyonXS5tYXAoZGlnaXQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGtleT17ZGlnaXR9IGNsYXNzTmFtZT1cIndhdmVzLWVmZmVjdCB3YXZlcy1saWdodCBhbWJlciBkYXJrZW4tMyBidG5cIiBvbkNsaWNrPXsoKSA9PiB0aGlzLm9uRGlnaXQoZGlnaXQpfT57ZGlnaXR9PC9hPlxuICAgICAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICA8YSBjbGFzc05hbWU9XCJ3YXZlcy1lZmZlY3Qgd2F2ZXMtbGlnaHQgYW1iZXIgZGFya2VuLTMgYnRuXCIgb25DbGljaz17KCkgPT4gdGhpcy5zZXRTdGF0ZSh7cmVzOicnfSl9PkM8L2E+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxhIGNsYXNzTmFtZT1cIndhdmVzLWVmZmVjdCB3YXZlcy1saWdodCBhbWJlciBkYXJrZW4tMyBidG5cIiBvbkNsaWNrPXt0aGlzLmVqZWN1dGFyT3BlcmFjaW9ufT5FbnRlcjwvYT5cblxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8c3R5bGUganN4PntcbiAgICAgICAgICAgICAgICBgXG4gICAgICAgICAgICAgICAgLnJlc3VsdGFkb3Mge1xuICAgICAgICAgICAgICAgICAgICB3aWR0aDogMzAwcHg7XG4gICAgICAgICAgICAgICAgICAgIG1hcmdpbjogMCBhdXRvO1xuICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDMycHg7XG4gICAgICAgICAgICAgICAgICAgIG1hcmdpbi1ib3R0b206IDEwcHg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC5jYWxjLWNvbnRhaW5lciB7XG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAzMDBweDtcbiAgICAgICAgICAgICAgICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgICAgICAgICAgICAgICBtYXJnaW46IDAgYXV0bztcbiAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogMTJweFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAuY2FsYy1jb250YWluZXIgYSB7XG4gICAgICAgICAgICAgICAgICAgIG1hcmdpbjogNXB4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAub3BlcmFkb3JzIHtcbiAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggc29saWQgI2NjYztcbiAgICAgICAgICAgICAgICAgICAgcGFkZGluZyAxMHB4O1xuICAgICAgICAgICAgICAgICAgICBtYXJnaW4tdG9wOiAyMHB4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBgXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICA8L3N0eWxlPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IENhbGN1bGFkb3JhIl19 */\n/*@ sourceURL=/Users/urialcantar/Proyectos/proyectosNuevos/holaMundoNext/componentes/calculadora.js */")); } }]); return Calculadora; }(react__WEBPACK_IMPORTED_MODULE_8___default.a.Component); /* harmony default export */ __webpack_exports__["default"] = (Calculadora); /***/ }) }) //# sourceMappingURL=calc.js.153c6a146cac06e1b526.hot-update.js.map
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _brainfuck = _interopRequireDefault(require("refractor/lang/brainfuck.js")); var _default = _brainfuck.default; exports.default = _default;
var webpack = require('webpack'); var WebpackDevServer = require('webpack-dev-server'); var opn = require('opn') const chalk = require('chalk'); var webpackConfig = require('./webpack.config.js'); webpackConfig.entry.index = "webpack-dev-server/client?http://localhost:9000/"; console.log(webpackConfig) let compiler; const hotUpdate = process.argv.indexOf('--ie8') === -1 function setupCompiler(host, port, protocol) { if (!hotUpdate){ // ie8 不使用热加载, 但需配置es3ify webpackConfig.module.postLoaders = [ { test: /\.(js|jsx)$/, include: [/node_modules/,/src/,/samples/], loaders: ['es3ify'], }, ] } compiler = webpack(webpackConfig); compiler.plugin('done', function(stats) { console.log(stats) }); } function runDevServer(host, port, protocol) { var server = new WebpackDevServer(compiler, { compress: true, clientLogLevel: 'none', contentBase: "./dist",//本地服务器所加载的页面所在的目录 publicPath: '/', hot: true, quiet: true, watchOptions: { ignored: /node_modules/, }, }); server.listen(port, function(err) { if(err) { return console.log(err); } console.log(chalk.cyan('Starting the development server...')); console.log(); opn('http://localhost:9000/') }); } function run(port) { const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; const host = require('quick-local-ip').getLocalIP4(); setupCompiler(host, port, protocol); runDevServer(host, port, protocol); } run(9000);