vendor: 4,491 bytes, lines 1-2
1/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */ 2!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*ne
vendor: 3,069 bytes, line 2
2w Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}
vendor: 9,959 bytes, line 2
2function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)}
vendor: 79,644 bytes, lines 2-5
2,input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0; 3}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={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>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",j.childNodes[0].style.borderCollapse="separate",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g=l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Sa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Oa.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+eb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{ 4marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g,sb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(sb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>-1)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var tb,ub,vb=n.expr.attrHandle,wb=/^(?:checked|selected)$/i,xb=l.getSetAttribute,yb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ub:tb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?yb&&xb||!wb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(xb?c:d)}}),ub={set:function(a,b,c){return b===!1?n.removeAttr(a,c):yb&&xb||!wb.test(c)?a.setAttribute(!xb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=vb[b]||n.find.attr;yb&&xb||!wb.test(b)?vb[b]=function(a,b,d){var e,f;return d||(f=vb[b],vb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,vb[b]=f),e}:vb[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),yb&&xb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):tb&&tb.set(a,b,c)}}),xb||(tb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},vb.id=vb.name=vb.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:tb.set},n.attrHooks.contenteditable={set:function(a,b,c){tb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var zb=/^(?:input|select|textarea|button|object)$/i,Ab=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):zb.test(a.nodeName)||Ab.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Bb=/[\t\r\n\f]/g;function Cb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Cb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Cb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Cb(c),d=1===c.nodeType&&(" "+e+" ").replace(Bb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Cb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=Cb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Cb(c)+" ").replace(Bb," ").indexOf(b)>-1)return!0;return!1}}),n.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(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Db=a.location,Eb=n.now(),Fb=/\?/,Gb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Gb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Hb=/#.*$/,Ib=/([?&])_=[^&]*/,Jb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Kb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Lb=/^(?:GET|HEAD)$/,Mb=/^\/\//,Nb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ob={},Pb={},Qb="*/".concat("*"),Rb=Db.href,Sb=Nb.exec(Rb.toLowerCase())||[];function Tb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Ub(a,b,c,d){var e={},f=a===Pb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Vb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Wb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Xb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Rb,type:"GET",isLocal:Kb.test(Sb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Vb(Vb(a,n.ajaxSettings),b):Vb(n.ajaxSettings,a)},ajaxPrefilter:Tb(Ob),ajaxTransport:Tb(Pb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Jb.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Rb)+"").replace(Hb,"").replace(Mb,Sb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Nb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Sb[1]&&d[2]===Sb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Sb[3]||("http:"===Sb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Ub(Ob,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Lb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Fb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ib.test(f)?f.replace(Ib,"$1_="+Eb++):f+(Fb.test(f)?"&":"?")+"_="+Eb++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Qb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Ub(Pb,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Wb(l,w,d)),v=Xb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Yb(a){return a.style&&a.style.display||n.css(a,"display")}function Zb(a){if(!n.contains(a.ownerDocument||d,a))return!0;while(a&&1===a.nodeType){if("none"===Yb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Zb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var $b=/%20/g,_b=/\[\]$/,ac=/\r?\n/g,bc=/^(?:submit|button|image|reset|file)$/i,cc=/^(?:input|select|textarea|keygen)/i;function dc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||_b.test(a)?d(a,e):dc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)dc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)dc(c,a[c],b,e);return d.join("&").replace($b,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&cc.test(this.nodeName)&&!bc.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(ac,"\r\n")}}):{name:b.name,value:c.replace(ac,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?ic():d.documentMode>8?hc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&hc()||ic()}:hc;var ec=0,fc={},gc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in fc)fc[a](void 0,!0)}),l.cors=!!gc&&"withCredentials"in gc,gc=l.ajax=!!gc,gc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++ec;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete fc[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=fc[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function hc(){try{return new a.XMLHttpRequest}catch(b){}}function ic(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var jc=[],kc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=jc.pop()||n.expando+"_"+Eb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(kc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&kc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(kc,"$1"+e):b.jsonp!==!1&&(b.url+=(Fb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,jc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var lc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&lc)return lc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function mc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=mc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=mc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({ 5padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var nc=a.jQuery,oc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=oc),b&&a.jQuery===n&&(a.jQuery=nc),n},b||(a.jQuery=a.$=n),n});
6 7/** vim: et:ts=4:sw=4:sts=4 8 * @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors. 9 * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE 10 */ 11//Not using strict: uneven strict support in browsers, #392, and causes 12//problems with requirejs.exec()/transpiler plugins that may not be strict. 13/*jslint regexp: true, nomen: true, sloppy: true */ 14/*global window, navigator, document, importScripts, setTimeout, opera */ 15 16var requirejs, require, define; 17(function (global, setTimeout) { 18 var req, s, head, baseElement, dataMain, src, 19 interactiveScript, currentlyAddingScript, mainScript, subPath, 20 version = '2.3.6', 21 commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg, 22 cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, 23 jsSuffixRegExp = /\.js$/, 24 currDirRegExp = /^\.\//, 25 op = Object.prototype, 26 ostring = op.toString, 27 hasOwn = op.hasOwnProperty, 28 isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), 29 isWebWorker = !isBrowser && typeof importScripts !== 'undefined', 30 //PS3 indicates loaded and complete, but need to wait for complete 31 //specifically. Sequence is 'loading', 'loaded', execution, 32 // then 'complete'. The UA check is unfortunate, but not sure how 33 //to feature test w/o causing perf issues. 34 readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? 35 /^complete$/ : /^(complete|loaded)$/, 36 defContextName = '_', 37 //Oh the tragedy, detecting opera. See the usage of isOpera for reason. 38 isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', 39 contexts = {}, 40 cfg = {}, 41 globalDefQueue = [], 42 useInteractive = false;
vendor: 1,631 bytes, lines 43-103
43 44 //Could match something like ')//comment', do not lose the prefix to comment. 45 function commentReplace(match, singlePrefix) { 46 return singlePrefix || ''; 47 } 48 49 function isFunction(it) { 50 return ostring.call(it) === '[object Function]'; 51 } 52 53 function isArray(it) { 54 return ostring.call(it) === '[object Array]'; 55 } 56 57 /** 58 * Helper function for iterating over an array. If the func returns 59 * a true value, it will break out of the loop. 60 */ 61 function each(ary, func) { 62 if (ary) { 63 var i; 64 for (i = 0; i < ary.length; i += 1) { 65 if (ary[i] && func(ary[i], i, ary)) { 66 break; 67 } 68 } 69 } 70 } 71 72 /** 73 * Helper function for iterating over an array backwards. If the func 74 * returns a true value, it will break out of the loop. 75 */ 76 function eachReverse(ary, func) { 77 if (ary) { 78 var i; 79 for (i = ary.length - 1; i > -1; i -= 1) { 80 if (ary[i] && func(ary[i], i, ary)) { 81 break; 82 } 83 } 84 } 85 } 86 87 function hasProp(obj, prop) { 88 return hasOwn.call(obj, prop); 89 } 90 91 function getOwn(obj, prop) { 92 return hasProp(obj, prop) && obj[prop]; 93 } 94 95 /** 96 * Cycles over properties in an object and calls a function for each 97 * property value. If the function returns a truthy value, then the 98 * iteration is stopped. 99 */ 100 function eachProp(obj, func) { 101 var prop; 102 for (prop in obj) { 103 if (hasProp(obj, prop)
vendor: 82,966 bytes, lines 103-2151
103) { 104 if (func(obj[prop], prop)) { 105 break; 106 } 107 } 108 } 109 } 110 111 /** 112 * Simple function to mix in properties from source into target, 113 * but only if target does not already have a property of the same name. 114 */ 115 function mixin(target, source, force, deepStringMixin) { 116 if (source) { 117 eachProp(source, function (value, prop) { 118 if (force || !hasProp(target, prop)) { 119 if (deepStringMixin && typeof value === 'object' && value && 120 !isArray(value) && !isFunction(value) && 121 !(value instanceof RegExp)) { 122 123 if (!target[prop]) { 124 target[prop] = {}; 125 } 126 mixin(target[prop], value, force, deepStringMixin); 127 } else { 128 target[prop] = value; 129 } 130 } 131 }); 132 } 133 return target; 134 } 135 136 //Similar to Function.prototype.bind, but the 'this' object is specified 137 //first, since it is easier to read/figure out what 'this' will be. 138 function bind(obj, fn) { 139 return function () { 140 return fn.apply(obj, arguments); 141 }; 142 } 143 144 function scripts() { 145 return document.getElementsByTagName('script'); 146 } 147 148 function defaultOnError(err) { 149 throw err; 150 } 151 152 //Allow getting a global that is expressed in 153 //dot notation, like 'a.b.c'. 154 function getGlobal(value) { 155 if (!value) { 156 return value; 157 } 158 var g = global; 159 each(value.split('.'), function (part) { 160 g = g[part]; 161 }); 162 return g; 163 } 164 165 /** 166 * Constructs an error with a pointer to an URL with more information. 167 * @param {String} id the error ID that maps to an ID on a web page. 168 * @param {String} message human readable error. 169 * @param {Error} [err] the original error, if there is one. 170 * 171 * @returns {Error} 172 */ 173 function makeError(id, msg, err, requireModules) { 174 var e = new Error(msg + '\nhttps://requirejs.org/docs/errors.html#' + id); 175 e.requireType = id; 176 e.requireModules = requireModules; 177 if (err) { 178 e.originalError = err; 179 } 180 return e; 181 } 182 183 if (typeof define !== 'undefined') { 184 //If a define is already in play via another AMD loader, 185 //do not overwrite. 186 return; 187 } 188 189 if (typeof requirejs !== 'undefined') { 190 if (isFunction(requirejs)) { 191 //Do not overwrite an existing requirejs instance. 192 return; 193 } 194 cfg = requirejs; 195 requirejs = undefined; 196 } 197 198 //Allow for a require config object 199 if (typeof require !== 'undefined' && !isFunction(require)) { 200 //assume it is a config object. 201 cfg = require; 202 require = undefined; 203 } 204 205 function newContext(contextName) { 206 var inCheckLoaded, Module, context, handlers, 207 checkLoadedTimeoutId, 208 config = { 209 //Defaults. Do not set a default for map 210 //config to speed up normalize(), which 211 //will run faster if there is no default. 212 waitSeconds: 7, 213 baseUrl: './', 214 paths: {}, 215 bundles: {}, 216 pkgs: {}, 217 shim: {}, 218 config: {} 219 }, 220 registry = {}, 221 //registry of just enabled modules, to speed 222 //cycle breaking code when lots of modules 223 //are registered, but not activated. 224 enabledRegistry = {}, 225 undefEvents = {}, 226 defQueue = [], 227 defined = {}, 228 urlFetched = {}, 229 bundlesMap = {}, 230 requireCounter = 1, 231 unnormalizedCounter = 1; 232 233 /** 234 * Trims the . and .. from an array of path segments. 235 * It will keep a leading path segment if a .. will become 236 * the first path segment, to help with module name lookups, 237 * which act like paths, but can be remapped. But the end result, 238 * all paths that use this function should look normalized. 239 * NOTE: this method MODIFIES the input array. 240 * @param {Array} ary the array of path segments. 241 */ 242 function trimDots(ary) { 243 var i, part; 244 for (i = 0; i < ary.length; i++) { 245 part = ary[i]; 246 if (part === '.') { 247 ary.splice(i, 1); 248 i -= 1; 249 } else if (part === '..') { 250 // If at the start, or previous value is still .., 251 // keep them so that when converted to a path it may 252 // still work when converted to a path, even though 253 // as an ID it is less than ideal. In larger point 254 // releases, may be better to just kick out an error. 255 if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') { 256 continue; 257 } else if (i > 0) { 258 ary.splice(i - 1, 2); 259 i -= 2; 260 } 261 } 262 } 263 } 264 265 /** 266 * Given a relative module name, like ./something, normalize it to 267 * a real name that can be mapped to a path. 268 * @param {String} name the relative name 269 * @param {String} baseName a real name that the name arg is relative 270 * to. 271 * @param {Boolean} applyMap apply the map config to the value. Should 272 * only be done if this normalization is for a dependency ID. 273 * @returns {String} normalized name 274 */ 275 function normalize(name, baseName, applyMap) { 276 var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, 277 foundMap, foundI, foundStarMap, starI, normalizedBaseParts, 278 baseParts = (baseName && baseName.split('/')), 279 map = config.map, 280 starMap = map && map['*']; 281 282 //Adjust any relative paths. 283 if (name) { 284 name = name.split('/'); 285 lastIndex = name.length - 1; 286 287 // If wanting node ID compatibility, strip .js from end 288 // of IDs. Have to do this here, and not in nameToUrl 289 // because node allows either .js or non .js to map 290 // to same file. 291 if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { 292 name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); 293 } 294 295 // Starts with a '.' so need the baseName 296 if (name[0].charAt(0) === '.' && baseParts) { 297 //Convert baseName to array, and lop off the last part, 298 //so that . matches that 'directory' and not name of the baseName's 299 //module. For instance, baseName of 'one/two/three', maps to 300 //'one/two/three.js', but we want the directory, 'one/two' for 301 //this normalization. 302 normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); 303 name = normalizedBaseParts.concat(name); 304 } 305 306 trimDots(name); 307 name = name.join('/'); 308 } 309 310 //Apply map config if available. 311 if (applyMap && map && (baseParts || starMap)) { 312 nameParts = name.split('/'); 313 314 outerLoop: for (i = nameParts.length; i > 0; i -= 1) { 315 nameSegment = nameParts.slice(0, i).join('/'); 316 317 if (baseParts) { 318 //Find the longest baseName segment match in the config. 319 //So, do joins on the biggest to smallest lengths of baseParts. 320 for (j = baseParts.length; j > 0; j -= 1) { 321 mapValue = getOwn(map, baseParts.slice(0, j).join('/')); 322 323 //baseName segment has config, find if it has one for 324 //this name. 325 if (mapValue) { 326 mapValue = getOwn(mapValue, nameSegment); 327 if (mapValue) { 328 //Match, update name to the new value. 329 foundMap = mapValue; 330 foundI = i; 331 break outerLoop; 332 } 333 } 334 } 335 } 336 337 //Check for a star map match, but just hold on to it, 338 //if there is a shorter segment match later in a matching 339 //config, then favor over this star map. 340 if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { 341 foundStarMap = getOwn(starMap, nameSegment); 342 starI = i; 343 } 344 } 345 346 if (!foundMap && foundStarMap) { 347 foundMap = foundStarMap; 348 foundI = starI; 349 } 350 351 if (foundMap) { 352 nameParts.splice(0, foundI, foundMap); 353 name = nameParts.join('/'); 354 } 355 } 356 357 // If the name points to a package's name, use 358 // the package main instead. 359 pkgMain = getOwn(config.pkgs, name); 360 361 return pkgMain ? pkgMain : name; 362 } 363 364 function removeScript(name) { 365 if (isBrowser) { 366 each(scripts(), function (scriptNode) { 367 if (scriptNode.getAttribute('data-requiremodule') === name && 368 scriptNode.getAttribute('data-requirecontext') === context.contextName) { 369 scriptNode.parentNode.removeChild(scriptNode); 370 return true; 371 } 372 }); 373 } 374 } 375 376 function hasPathFallback(id) { 377 var pathConfig = getOwn(config.paths, id); 378 if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { 379 //Pop off the first array value, since it failed, and 380 //retry 381 pathConfig.shift(); 382 context.require.undef(id); 383 384 //Custom require that does not do map translation, since 385 //ID is "absolute", already mapped/resolved. 386 context.makeRequire(null, { 387 skipMap: true 388 })([id]); 389 390 return true; 391 } 392 } 393 394 //Turns a plugin!resource to [plugin, resource] 395 //with the plugin being undefined if the name 396 //did not have a plugin prefix. 397 function splitPrefix(name) { 398 var prefix, 399 index = name ? name.indexOf('!') : -1; 400 if (index > -1) { 401 prefix = name.substring(0, index); 402 name = name.substring(index + 1, name.length); 403 } 404 return [prefix, name]; 405 } 406 407 /** 408 * Creates a module mapping that includes plugin prefix, module 409 * name, and path. If parentModuleMap is provided it will 410 * also normalize the name via require.normalize() 411 * 412 * @param {String} name the module name 413 * @param {String} [parentModuleMap] parent module map 414 * for the module name, used to resolve relative names. 415 * @param {Boolean} isNormalized: is the ID already normalized. 416 * This is true if this call is done for a define() module ID. 417 * @param {Boolean} applyMap: apply the map config to the ID. 418 * Should only be true if this map is for a dependency. 419 * 420 * @returns {Object} 421 */ 422 function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { 423 var url, pluginModule, suffix, nameParts, 424 prefix = null, 425 parentName = parentModuleMap ? parentModuleMap.name : null, 426 originalName = name, 427 isDefine = true, 428 normalizedName = ''; 429 430 //If no name, then it means it is a require call, generate an 431 //internal name. 432 if (!name) { 433 isDefine = false; 434 name = '_@r' + (requireCounter += 1); 435 } 436 437 nameParts = splitPrefix(name); 438 prefix = nameParts[0]; 439 name = nameParts[1]; 440 441 if (prefix) { 442 prefix = normalize(prefix, parentName, applyMap); 443 pluginModule = getOwn(defined, prefix); 444 } 445 446 //Account for relative paths if there is a base name. 447 if (name) { 448 if (prefix) { 449 if (isNormalized) { 450 normalizedName = name; 451 } else if (pluginModule && pluginModule.normalize) { 452 //Plugin is loaded, use its normalize method. 453 normalizedName = pluginModule.normalize(name, function (name) { 454 return normalize(name, parentName, applyMap); 455 }); 456 } else { 457 // If nested plugin references, then do not try to 458 // normalize, as it will not normalize correctly. This 459 // places a restriction on resourceIds, and the longer 460 // term solution is not to normalize until plugins are 461 // loaded and all normalizations to allow for async 462 // loading of a loader plugin. But for now, fixes the 463 // common uses. Details in #1131 464 normalizedName = name.indexOf('!') === -1 ? 465 normalize(name, parentName, applyMap) : 466 name; 467 } 468 } else { 469 //A regular module. 470 normalizedName = normalize(name, parentName, applyMap); 471 472 //Normalized name may be a plugin ID due to map config 473 //application in normalize. The map config values must 474 //already be normalized, so do not need to redo that part. 475 nameParts = splitPrefix(normalizedName); 476 prefix = nameParts[0]; 477 normalizedName = nameParts[1]; 478 isNormalized = true; 479 480 url = context.nameToUrl(normalizedName); 481 } 482 } 483 484 //If the id is a plugin id that cannot be determined if it needs 485 //normalization, stamp it with a unique ID so two matching relative 486 //ids that may conflict can be separate. 487 suffix = prefix && !pluginModule && !isNormalized ? 488 '_unnormalized' + (unnormalizedCounter += 1) : 489 ''; 490 491 return { 492 prefix: prefix, 493 name: normalizedName, 494 parentMap: parentModuleMap, 495 unnormalized: !!suffix, 496 url: url, 497 originalName: originalName, 498 isDefine: isDefine, 499 id: (prefix ? 500 prefix + '!' + normalizedName : 501 normalizedName) + suffix 502 }; 503 } 504 505 function getModule(depMap) { 506 var id = depMap.id, 507 mod = getOwn(registry, id); 508 509 if (!mod) { 510 mod = registry[id] = new context.Module(depMap); 511 } 512 513 return mod; 514 } 515 516 function on(depMap, name, fn) { 517 var id = depMap.id, 518 mod = getOwn(registry, id); 519 520 if (hasProp(defined, id) && 521 (!mod || mod.defineEmitComplete)) { 522 if (name === 'defined') { 523 fn(defined[id]); 524 } 525 } else { 526 mod = getModule(depMap); 527 if (mod.error && name === 'error') { 528 fn(mod.error); 529 } else { 530 mod.on(name, fn); 531 } 532 } 533 } 534 535 function onError(err, errback) { 536 var ids = err.requireModules, 537 notified = false; 538 539 if (errback) { 540 errback(err); 541 } else { 542 each(ids, function (id) { 543 var mod = getOwn(registry, id); 544 if (mod) { 545 //Set error on module, so it skips timeout checks. 546 mod.error = err; 547 if (mod.events.error) { 548 notified = true; 549 mod.emit('error', err); 550 } 551 } 552 }); 553 554 if (!notified) { 555 req.onError(err); 556 } 557 } 558 } 559 560 /** 561 * Internal method to transfer globalQueue items to this context's 562 * defQueue. 563 */ 564 function takeGlobalQueue() { 565 //Push all the globalDefQueue items into the context's defQueue 566 if (globalDefQueue.length) { 567 each(globalDefQueue, function(queueItem) { 568 var id = queueItem[0]; 569 if (typeof id === 'string') { 570 context.defQueueMap[id] = true; 571 } 572 defQueue.push(queueItem); 573 }); 574 globalDefQueue = []; 575 } 576 } 577 578 handlers = { 579 'require': function (mod) { 580 if (mod.require) { 581 return mod.require; 582 } else { 583 return (mod.require = context.makeRequire(mod.map)); 584 } 585 }, 586 'exports': function (mod) { 587 mod.usingExports = true; 588 if (mod.map.isDefine) { 589 if (mod.exports) { 590 return (defined[mod.map.id] = mod.exports); 591 } else { 592 return (mod.exports = defined[mod.map.id] = {}); 593 } 594 } 595 }, 596 'module': function (mod) { 597 if (mod.module) { 598 return mod.module; 599 } else { 600 return (mod.module = { 601 id: mod.map.id, 602 uri: mod.map.url, 603 config: function () { 604 return getOwn(config.config, mod.map.id) || {}; 605 }, 606 exports: mod.exports || (mod.exports = {}) 607 }); 608 } 609 } 610 }; 611 612 function cleanRegistry(id) { 613 //Clean up machinery used for waiting modules. 614 delete registry[id]; 615 delete enabledRegistry[id]; 616 } 617 618 function breakCycle(mod, traced, processed) { 619 var id = mod.map.id; 620 621 if (mod.error) { 622 mod.emit('error', mod.error); 623 } else { 624 traced[id] = true; 625 each(mod.depMaps, function (depMap, i) { 626 var depId = depMap.id, 627 dep = getOwn(registry, depId); 628 629 //Only force things that have not completed 630 //being defined, so still in the registry, 631 //and only if it has not been matched up 632 //in the module already. 633 if (dep && !mod.depMatched[i] && !processed[depId]) { 634 if (getOwn(traced, depId)) { 635 mod.defineDep(i, defined[depId]); 636 mod.check(); //pass false? 637 } else { 638 breakCycle(dep, traced, processed); 639 } 640 } 641 }); 642 processed[id] = true; 643 } 644 } 645 646 function checkLoaded() { 647 var err, usingPathFallback, 648 waitInterval = config.waitSeconds * 1000, 649 //It is possible to disable the wait interval by using waitSeconds of 0. 650 expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), 651 noLoads = [], 652 reqCalls = [], 653 stillLoading = false, 654 needCycleCheck = true; 655 656 //Do not bother if this call was a result of a cycle break. 657 if (inCheckLoaded) { 658 return; 659 } 660 661 inCheckLoaded = true; 662 663 //Figure out the state of all the modules. 664 eachProp(enabledRegistry, function (mod) { 665 var map = mod.map, 666 modId = map.id; 667 668 //Skip things that are not enabled or in error state. 669 if (!mod.enabled) { 670 return; 671 } 672 673 if (!map.isDefine) { 674 reqCalls.push(mod); 675 } 676 677 if (!mod.error) { 678 //If the module should be executed, and it has not 679 //been inited and time is up, remember it. 680 if (!mod.inited && expired) { 681 if (hasPathFallback(modId)) { 682 usingPathFallback = true; 683 stillLoading = true; 684 } else { 685 noLoads.push(modId); 686 removeScript(modId); 687 } 688 } else if (!mod.inited && mod.fetched && map.isDefine) { 689 stillLoading = true; 690 if (!map.prefix) { 691 //No reason to keep looking for unfinished 692 //loading. If the only stillLoading is a 693 //plugin resource though, keep going, 694 //because it may be that a plugin resource 695 //is waiting on a non-plugin cycle. 696 return (needCycleCheck = false); 697 } 698 } 699 } 700 }); 701 702 if (expired && noLoads.length) { 703 //If wait time expired, throw error of unloaded modules. 704 err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); 705 err.contextName = context.contextName; 706 return onError(err); 707 } 708 709 //Not expired, check for a cycle. 710 if (needCycleCheck) { 711 each(reqCalls, function (mod) { 712 breakCycle(mod, {}, {}); 713 }); 714 } 715 716 //If still waiting on loads, and the waiting load is something 717 //other than a plugin resource, or there are still outstanding 718 //scripts, then just try back later. 719 if ((!expired || usingPathFallback) && stillLoading) { 720 //Something is still waiting to load. Wait for it, but only 721 //if a timeout is not already in effect. 722 if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { 723 checkLoadedTimeoutId = setTimeout(function () { 724 checkLoadedTimeoutId = 0; 725 checkLoaded(); 726 }, 50); 727 } 728 } 729 730 inCheckLoaded = false; 731 } 732 733 Module = function (map) { 734 this.events = getOwn(undefEvents, map.id) || {}; 735 this.map = map; 736 this.shim = getOwn(config.shim, map.id); 737 this.depExports = []; 738 this.depMaps = []; 739 this.depMatched = []; 740 this.pluginMaps = {}; 741 this.depCount = 0; 742 743 /* this.exports this.factory 744 this.depMaps = [], 745 this.enabled, this.fetched 746 */ 747 }; 748 749 Module.prototype = { 750 init: function (depMaps, factory, errback, options) { 751 options = options || {}; 752 753 //Do not do more inits if already done. Can happen if there 754 //are multiple define calls for the same module. That is not 755 //a normal, common case, but it is also not unexpected. 756 if (this.inited) { 757 return; 758 } 759 760 this.factory = factory; 761 762 if (errback) { 763 //Register for errors on this module. 764 this.on('error', errback); 765 } else if (this.events.error) { 766 //If no errback already, but there are error listeners 767 //on this module, set up an errback to pass to the deps. 768 errback = bind(this, function (err) { 769 this.emit('error', err); 770 }); 771 } 772 773 //Do a copy of the dependency array, so that 774 //source inputs are not modified. For example 775 //"shim" deps are passed in here directly, and 776 //doing a direct modification of the depMaps array 777 //would affect that config. 778 this.depMaps = depMaps && depMaps.slice(0); 779 780 this.errback = errback; 781 782 //Indicate this module has be initialized 783 this.inited = true; 784 785 this.ignore = options.ignore; 786 787 //Could have option to init this module in enabled mode, 788 //or could have been previously marked as enabled. However, 789 //the dependencies are not known until init is called. So 790 //if enabled previously, now trigger dependencies as enabled. 791 if (options.enabled || this.enabled) { 792 //Enable this module and dependencies. 793 //Will call this.check() 794 this.enable(); 795 } else { 796 this.check(); 797 } 798 }, 799 800 defineDep: function (i, depExports) { 801 //Because of cycles, defined callback for a given 802 //export can be called more than once. 803 if (!this.depMatched[i]) { 804 this.depMatched[i] = true; 805 this.depCount -= 1; 806 this.depExports[i] = depExports; 807 } 808 }, 809 810 fetch: function () { 811 if (this.fetched) { 812 return; 813 } 814 this.fetched = true; 815 816 context.startTime = (new Date()).getTime(); 817 818 var map = this.map; 819 820 //If the manager is for a plugin managed resource, 821 //ask the plugin to load it now. 822 if (this.shim) { 823 context.makeRequire(this.map, { 824 enableBuildCallback: true 825 })(this.shim.deps || [], bind(this, function () { 826 return map.prefix ? this.callPlugin() : this.load(); 827 })); 828 } else { 829 //Regular dependency. 830 return map.prefix ? this.callPlugin() : this.load(); 831 } 832 }, 833 834 load: function () { 835 var url = this.map.url; 836 837 //Regular dependency. 838 if (!urlFetched[url]) { 839 urlFetched[url] = true; 840 context.load(this.map.id, url); 841 } 842 }, 843 844 /** 845 * Checks if the module is ready to define itself, and if so, 846 * define it. 847 */ 848 check: function () { 849 if (!this.enabled || this.enabling) { 850 return; 851 } 852 853 var err, cjsModule, 854 id = this.map.id, 855 depExports = this.depExports, 856 exports = this.exports, 857 factory = this.factory; 858 859 if (!this.inited) { 860 // Only fetch if not already in the defQueue. 861 if (!hasProp(context.defQueueMap, id)) { 862 this.fetch(); 863 } 864 } else if (this.error) { 865 this.emit('error', this.error); 866 } else if (!this.defining) { 867 //The factory could trigger another require call 868 //that would result in checking this module to 869 //define itself again. If already in the process 870 //of doing that, skip this work. 871 this.defining = true; 872 873 if (this.depCount < 1 && !this.defined) { 874 if (isFunction(factory)) { 875 //If there is an error listener, favor passing 876 //to that instead of throwing an error. However, 877 //only do it for define()'d modules. require 878 //errbacks should not be called for failures in 879 //their callbacks (#699). However if a global 880 //onError is set, use that. 881 if ((this.events.error && this.map.isDefine) || 882 req.onError !== defaultOnError) { 883 try { 884 exports = context.execCb(id, factory, depExports, exports); 885 } catch (e) { 886 err = e; 887 } 888 } else { 889 exports = context.execCb(id, factory, depExports, exports); 890 } 891 892 // Favor return value over exports. If node/cjs in play, 893 // then will not have a return value anyway. Favor 894 // module.exports assignment over exports object. 895 if (this.map.isDefine && exports === undefined) { 896 cjsModule = this.module; 897 if (cjsModule) { 898 exports = cjsModule.exports; 899 } else if (this.usingExports) { 900 //exports already set the defined value. 901 exports = this.exports; 902 } 903 } 904 905 if (err) { 906 err.requireMap = this.map; 907 err.requireModules = this.map.isDefine ? [this.map.id] : null; 908 err.requireType = this.map.isDefine ? 'define' : 'require'; 909 return onError((this.error = err)); 910 } 911 912 } else { 913 //Just a literal value 914 exports = factory; 915 } 916 917 this.exports = exports; 918 919 if (this.map.isDefine && !this.ignore) { 920 defined[id] = exports; 921 922 if (req.onResourceLoad) { 923 var resLoadMaps = []; 924 each(this.depMaps, function (depMap) { 925 resLoadMaps.push(depMap.normalizedMap || depMap); 926 }); 927 req.onResourceLoad(context, this.map, resLoadMaps); 928 } 929 } 930 931 //Clean up 932 cleanRegistry(id); 933 934 this.defined = true; 935 } 936 937 //Finished the define stage. Allow calling check again 938 //to allow define notifications below in the case of a 939 //cycle. 940 this.defining = false; 941 942 if (this.defined && !this.defineEmitted) { 943 this.defineEmitted = true; 944 this.emit('defined', this.exports); 945 this.defineEmitComplete = true; 946 } 947 948 } 949 }, 950 951 callPlugin: function () { 952 var map = this.map, 953 id = map.id, 954 //Map already normalized the prefix. 955 pluginMap = makeModuleMap(map.prefix); 956 957 //Mark this as a dependency for this plugin, so it 958 //can be traced for cycles. 959 this.depMaps.push(pluginMap); 960 961 on(pluginMap, 'defined', bind(this, function (plugin) { 962 var load, normalizedMap, normalizedMod, 963 bundleId = getOwn(bundlesMap, this.map.id), 964 name = this.map.name, 965 parentName = this.map.parentMap ? this.map.parentMap.name : null, 966 localRequire = context.makeRequire(map.parentMap, { 967 enableBuildCallback: true 968 }); 969 970 //If current map is not normalized, wait for that 971 //normalized name to load instead of continuing. 972 if (this.map.unnormalized) { 973 //Normalize the ID if the plugin allows it. 974 if (plugin.normalize) { 975 name = plugin.normalize(name, function (name) { 976 return normalize(name, parentName, true); 977 }) || ''; 978 } 979 980 //prefix and name should already be normalized, no need 981 //for applying map config again either. 982 normalizedMap = makeModuleMap(map.prefix + '!' + name, 983 this.map.parentMap, 984 true); 985 on(normalizedMap, 986 'defined', bind(this, function (value) { 987 this.map.normalizedMap = normalizedMap; 988 this.init([], function () { return value; }, null, { 989 enabled: true, 990 ignore: true 991 }); 992 })); 993 994 normalizedMod = getOwn(registry, normalizedMap.id); 995 if (normalizedMod) { 996 //Mark this as a dependency for this plugin, so it 997 //can be traced for cycles. 998 this.depMaps.push(normalizedMap); 999 1000 if (this.events.error) { 1001 normalizedMod.on('error', bind(this, function (err) { 1002 this.emit('error', err); 1003 })); 1004 } 1005 normalizedMod.enable(); 1006 } 1007 1008 return; 1009 } 1010 1011 //If a paths config, then just load that file instead to 1012 //resolve the plugin, as it is built into that paths layer. 1013 if (bundleId) { 1014 this.map.url = context.nameToUrl(bundleId); 1015 this.load(); 1016 return; 1017 } 1018 1019 load = bind(this, function (value) { 1020 this.init([], function () { return value; }, null, { 1021 enabled: true 1022 }); 1023 }); 1024 1025 load.error = bind(this, function (err) { 1026 this.inited = true; 1027 this.error = err; 1028 err.requireModules = [id]; 1029 1030 //Remove temp unnormalized modules for this module, 1031 //since they will never be resolved otherwise now. 1032 eachProp(registry, function (mod) { 1033 if (mod.map.id.indexOf(id + '_unnormalized') === 0) { 1034 cleanRegistry(mod.map.id); 1035 } 1036 }); 1037 1038 onError(err); 1039 }); 1040 1041 //Allow plugins to load other code without having to know the 1042 //context or how to 'complete' the load. 1043 load.fromText = bind(this, function (text, textAlt) { 1044 /*jslint evil: true */ 1045 var moduleName = map.name, 1046 moduleMap = makeModuleMap(moduleName), 1047 hasInteractive = useInteractive; 1048 1049 //As of 2.1.0, support just passing the text, to reinforce 1050 //fromText only being called once per resource. Still 1051 //support old style of passing moduleName but discard 1052 //that moduleName in favor of the internal ref. 1053 if (textAlt) { 1054 text = textAlt; 1055 } 1056 1057 //Turn off interactive script matching for IE for any define 1058 //calls in the text, then turn it back on at the end. 1059 if (hasInteractive) { 1060 useInteractive = false; 1061 } 1062 1063 //Prime the system by creating a module instance for 1064 //it. 1065 getModule(moduleMap); 1066 1067 //Transfer any config to this other module. 1068 if (hasProp(config.config, id)) { 1069 config.config[moduleName] = config.config[id]; 1070 } 1071 1072 try { 1073 req.exec(text); 1074 } catch (e) { 1075 return onError(makeError('fromtexteval', 1076 'fromText eval for ' + id + 1077 ' failed: ' + e, 1078 e, 1079 [id])); 1080 } 1081 1082 if (hasInteractive) { 1083 useInteractive = true; 1084 } 1085 1086 //Mark this as a dependency for the plugin 1087 //resource 1088 this.depMaps.push(moduleMap); 1089 1090 //Support anonymous modules. 1091 context.completeLoad(moduleName); 1092 1093 //Bind the value of that module to the value for this 1094 //resource ID. 1095 localRequire([moduleName], load); 1096 }); 1097 1098 //Use parentName here since the plugin's name is not reliable, 1099 //could be some weird string with no path that actually wants to 1100 //reference the parentName's path. 1101 plugin.load(map.name, localRequire, load, config); 1102 })); 1103 1104 context.enable(pluginMap, this); 1105 this.pluginMaps[pluginMap.id] = pluginMap; 1106 }, 1107 1108 enable: function () { 1109 enabledRegistry[this.map.id] = this; 1110 this.enabled = true; 1111 1112 //Set flag mentioning that the module is enabling, 1113 //so that immediate calls to the defined callbacks 1114 //for dependencies do not trigger inadvertent load 1115 //with the depCount still being zero. 1116 this.enabling = true; 1117 1118 //Enable each dependency 1119 each(this.depMaps, bind(this, function (depMap, i) { 1120 var id, mod, handler; 1121 1122 if (typeof depMap === 'string') { 1123 //Dependency needs to be converted to a depMap 1124 //and wired up to this module. 1125 depMap = makeModuleMap(depMap, 1126 (this.map.isDefine ? this.map : this.map.parentMap), 1127 false, 1128 !this.skipMap); 1129 this.depMaps[i] = depMap; 1130 1131 handler = getOwn(handlers, depMap.id); 1132 1133 if (handler) { 1134 this.depExports[i] = handler(this); 1135 return; 1136 } 1137 1138 this.depCount += 1; 1139 1140 on(depMap, 'defined', bind(this, function (depExports) { 1141 if (this.undefed) { 1142 return; 1143 } 1144 this.defineDep(i, depExports); 1145 this.check(); 1146 })); 1147 1148 if (this.errback) { 1149 on(depMap, 'error', bind(this, this.errback)); 1150 } else if (this.events.error) { 1151 // No direct errback on this module, but something 1152 // else is listening for errors, so be sure to 1153 // propagate the error correctly. 1154 on(depMap, 'error', bind(this, function(err) { 1155 this.emit('error', err); 1156 })); 1157 } 1158 } 1159 1160 id = depMap.id; 1161 mod = registry[id]; 1162 1163 //Skip special modules like 'require', 'exports', 'module' 1164 //Also, don't call enable if it is already enabled, 1165 //important in circular dependency cases. 1166 if (!hasProp(handlers, id) && mod && !mod.enabled) { 1167 context.enable(depMap, this); 1168 } 1169 })); 1170 1171 //Enable each plugin that is used in 1172 //a dependency 1173 eachProp(this.pluginMaps, bind(this, function (pluginMap) { 1174 var mod = getOwn(registry, pluginMap.id); 1175 if (mod && !mod.enabled) { 1176 context.enable(pluginMap, this); 1177 } 1178 })); 1179 1180 this.enabling = false; 1181 1182 this.check(); 1183 }, 1184 1185 on: function (name, cb) { 1186 var cbs = this.events[name]; 1187 if (!cbs) { 1188 cbs = this.events[name] = []; 1189 } 1190 cbs.push(cb); 1191 }, 1192 1193 emit: function (name, evt) { 1194 each(this.events[name], function (cb) { 1195 cb(evt); 1196 }); 1197 if (name === 'error') { 1198 //Now that the error handler was triggered, remove 1199 //the listeners, since this broken Module instance 1200 //can stay around for a while in the registry. 1201 delete this.events[name]; 1202 } 1203 } 1204 }; 1205 1206 function callGetModule(args) { 1207 //Skip modules already defined. 1208 if (!hasProp(defined, args[0])) { 1209 getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); 1210 } 1211 } 1212 1213 function removeListener(node, func, name, ieName) { 1214 //Favor detachEvent because of IE9 1215 //issue, see attachEvent/addEventListener comment elsewhere 1216 //in this file. 1217 if (node.detachEvent && !isOpera) { 1218 //Probably IE. If not it will throw an error, which will be 1219 //useful to know. 1220 if (ieName) { 1221 node.detachEvent(ieName, func); 1222 } 1223 } else { 1224 node.removeEventListener(name, func, false); 1225 } 1226 } 1227 1228 /** 1229 * Given an event from a script node, get the requirejs info from it, 1230 * and then removes the event listeners on the node. 1231 * @param {Event} evt 1232 * @returns {Object} 1233 */ 1234 function getScriptData(evt) { 1235 //Using currentTarget instead of target for Firefox 2.0's sake. Not 1236 //all old browsers will be supported, but this one was easy enough 1237 //to support and still makes sense. 1238 var node = evt.currentTarget || evt.srcElement; 1239 1240 //Remove the listeners once here. 1241 removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); 1242 removeListener(node, context.onScriptError, 'error'); 1243 1244 return { 1245 node: node, 1246 id: node && node.getAttribute('data-requiremodule') 1247 }; 1248 } 1249 1250 function intakeDefines() { 1251 var args; 1252 1253 //Any defined modules in the global queue, intake them now. 1254 takeGlobalQueue(); 1255 1256 //Make sure any remaining defQueue items get properly processed. 1257 while (defQueue.length) { 1258 args = defQueue.shift(); 1259 if (args[0] === null) { 1260 return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + 1261 args[args.length - 1])); 1262 } else { 1263 //args are id, deps, factory. Should be normalized by the 1264 //define() function. 1265 callGetModule(args); 1266 } 1267 } 1268 context.defQueueMap = {}; 1269 } 1270 1271 context = { 1272 config: config, 1273 contextName: contextName, 1274 registry: registry, 1275 defined: defined, 1276 urlFetched: urlFetched, 1277 defQueue: defQueue, 1278 defQueueMap: {}, 1279 Module: Module, 1280 makeModuleMap: makeModuleMap, 1281 nextTick: req.nextTick, 1282 onError: onError, 1283 1284 /** 1285 * Set a configuration for the context. 1286 * @param {Object} cfg config object to integrate. 1287 */ 1288 configure: function (cfg) { 1289 //Make sure the baseUrl ends in a slash. 1290 if (cfg.baseUrl) { 1291 if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { 1292 cfg.baseUrl += '/'; 1293 } 1294 } 1295 1296 // Convert old style urlArgs string to a function. 1297 if (typeof cfg.urlArgs === 'string') { 1298 var urlArgs = cfg.urlArgs; 1299 cfg.urlArgs = function(id, url) { 1300 return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs; 1301 }; 1302 } 1303 1304 //Save off the paths since they require special processing, 1305 //they are additive. 1306 var shim = config.shim, 1307 objs = { 1308 paths: true, 1309 bundles: true, 1310 config: true, 1311 map: true 1312 }; 1313 1314 eachProp(cfg, function (value, prop) { 1315 if (objs[prop]) { 1316 if (!config[prop]) { 1317 config[prop] = {}; 1318 } 1319 mixin(config[prop], value, true, true); 1320 } else { 1321 config[prop] = value; 1322 } 1323 }); 1324 1325 //Reverse map the bundles 1326 if (cfg.bundles) { 1327 eachProp(cfg.bundles, function (value, prop) { 1328 each(value, function (v) { 1329 if (v !== prop) { 1330 bundlesMap[v] = prop; 1331 } 1332 }); 1333 }); 1334 } 1335 1336 //Merge shim 1337 if (cfg.shim) { 1338 eachProp(cfg.shim, function (value, id) { 1339 //Normalize the structure 1340 if (isArray(value)) { 1341 value = { 1342 deps: value 1343 }; 1344 } 1345 if ((value.exports || value.init) && !value.exportsFn) { 1346 value.exportsFn = context.makeShimExports(value); 1347 } 1348 shim[id] = value; 1349 }); 1350 config.shim = shim; 1351 } 1352 1353 //Adjust packages if necessary. 1354 if (cfg.packages) { 1355 each(cfg.packages, function (pkgObj) { 1356 var location, name; 1357 1358 pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj; 1359 1360 name = pkgObj.name; 1361 location = pkgObj.location; 1362 if (location) { 1363 config.paths[name] = pkgObj.location; 1364 } 1365 1366 //Save pointer to main module ID for pkg name. 1367 //Remove leading dot in main, so main paths are normalized, 1368 //and remove any trailing .js, since different package 1369 //envs have different conventions: some use a module name, 1370 //some use a file name. 1371 config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') 1372 .replace(currDirRegExp, '') 1373 .replace(jsSuffixRegExp, ''); 1374 }); 1375 } 1376 1377 //If there are any "waiting to execute" modules in the registry, 1378 //update the maps for them, since their info, like URLs to load, 1379 //may have changed. 1380 eachProp(registry, function (mod, id) { 1381 //If module already has init called, since it is too 1382 //late to modify them, and ignore unnormalized ones 1383 //since they are transient. 1384 if (!mod.inited && !mod.map.unnormalized) { 1385 mod.map = makeModuleMap(id, null, true); 1386 } 1387 }); 1388 1389 //If a deps array or a config callback is specified, then call 1390 //require with those args. This is useful when require is defined as a 1391 //config object before require.js is loaded. 1392 if (cfg.deps || cfg.callback) { 1393 context.require(cfg.deps || [], cfg.callback); 1394 } 1395 }, 1396 1397 makeShimExports: function (value) { 1398 function fn() { 1399 var ret; 1400 if (value.init) { 1401 ret = value.init.apply(global, arguments); 1402 } 1403 return ret || (value.exports && getGlobal(value.exports)); 1404 } 1405 return fn; 1406 }, 1407 1408 makeRequire: function (relMap, options) { 1409 options = options || {}; 1410 1411 function localRequire(deps, callback, errback) { 1412 var id, map, requireMod; 1413 1414 if (options.enableBuildCallback && callback && isFunction(callback)) { 1415 callback.__requireJsBuild = true; 1416 } 1417 1418 if (typeof deps === 'string') { 1419 if (isFunction(callback)) { 1420 //Invalid call 1421 return onError(makeError('requireargs', 'Invalid require call'), errback); 1422 } 1423 1424 //If require|exports|module are requested, get the 1425 //value for them from the special handlers. Caveat: 1426 //this only works while module is being defined. 1427 if (relMap && hasProp(handlers, deps)) { 1428 return handlers[deps](registry[relMap.id]); 1429 } 1430 1431 //Synchronous access to one module. If require.get is 1432 //available (as in the Node adapter), prefer that. 1433 if (req.get) { 1434 return req.get(context, deps, relMap, localRequire); 1435 } 1436 1437 //Normalize module name, if it contains . or .. 1438 map = makeModuleMap(deps, relMap, false, true); 1439 id = map.id; 1440 1441 if (!hasProp(defined, id)) { 1442 return onError(makeError('notloaded', 'Module name "' + 1443 id + 1444 '" has not been loaded yet for context: ' + 1445 contextName + 1446 (relMap ? '' : '. Use require([])'))); 1447 } 1448 return defined[id]; 1449 } 1450 1451 //Grab defines waiting in the global queue. 1452 intakeDefines(); 1453 1454 //Mark all the dependencies as needing to be loaded. 1455 context.nextTick(function () { 1456 //Some defines could have been added since the 1457 //require call, collect them. 1458 intakeDefines(); 1459 1460 requireMod = getModule(makeModuleMap(null, relMap)); 1461 1462 //Store if map config should be applied to this require 1463 //call for dependencies. 1464 requireMod.skipMap = options.skipMap; 1465 1466 requireMod.init(deps, callback, errback, { 1467 enabled: true 1468 }); 1469 1470 checkLoaded(); 1471 }); 1472 1473 return localRequire; 1474 } 1475 1476 mixin(localRequire, { 1477 isBrowser: isBrowser, 1478 1479 /** 1480 * Converts a module name + .extension into an URL path. 1481 * *Requires* the use of a module name. It does not support using 1482 * plain URLs like nameToUrl. 1483 */ 1484 toUrl: function (moduleNamePlusExt) { 1485 var ext, 1486 index = moduleNamePlusExt.lastIndexOf('.'), 1487 segment = moduleNamePlusExt.split('/')[0], 1488 isRelative = segment === '.' || segment === '..'; 1489 1490 //Have a file extension alias, and it is not the 1491 //dots from a relative path. 1492 if (index !== -1 && (!isRelative || index > 1)) { 1493 ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); 1494 moduleNamePlusExt = moduleNamePlusExt.substring(0, index); 1495 } 1496 1497 return context.nameToUrl(normalize(moduleNamePlusExt, 1498 relMap && relMap.id, true), ext, true); 1499 }, 1500 1501 defined: function (id) { 1502 return hasProp(defined, makeModuleMap(id, relMap, false, true).id); 1503 }, 1504 1505 specified: function (id) { 1506 id = makeModuleMap(id, relMap, false, true).id; 1507 return hasProp(defined, id) || hasProp(registry, id); 1508 } 1509 }); 1510 1511 //Only allow undef on top level require calls 1512 if (!relMap) { 1513 localRequire.undef = function (id) { 1514 //Bind any waiting define() calls to this context, 1515 //fix for #408 1516 takeGlobalQueue(); 1517 1518 var map = makeModuleMap(id, relMap, true), 1519 mod = getOwn(registry, id); 1520 1521 mod.undefed = true; 1522 removeScript(id); 1523 1524 delete defined[id]; 1525 delete urlFetched[map.url]; 1526 delete undefEvents[id]; 1527 1528 //Clean queued defines too. Go backwards 1529 //in array so that the splices do not 1530 //mess up the iteration. 1531 eachReverse(defQueue, function(args, i) { 1532 if (args[0] === id) { 1533 defQueue.splice(i, 1); 1534 } 1535 }); 1536 delete context.defQueueMap[id]; 1537 1538 if (mod) { 1539 //Hold on to listeners in case the 1540 //module will be attempted to be reloaded 1541 //using a different config. 1542 if (mod.events.defined) { 1543 undefEvents[id] = mod.events; 1544 } 1545 1546 cleanRegistry(id); 1547 } 1548 }; 1549 } 1550 1551 return localRequire; 1552 }, 1553 1554 /** 1555 * Called to enable a module if it is still in the registry 1556 * awaiting enablement. A second arg, parent, the parent module, 1557 * is passed in for context, when this method is overridden by 1558 * the optimizer. Not shown here to keep code compact. 1559 */ 1560 enable: function (depMap) { 1561 var mod = getOwn(registry, depMap.id); 1562 if (mod) { 1563 getModule(depMap).enable(); 1564 } 1565 }, 1566 1567 /** 1568 * Internal method used by environment adapters to complete a load event. 1569 * A load event could be a script load or just a load pass from a synchronous 1570 * load call. 1571 * @param {String} moduleName the name of the module to potentially complete. 1572 */ 1573 completeLoad: function (moduleName) { 1574 var found, args, mod, 1575 shim = getOwn(config.shim, moduleName) || {}, 1576 shExports = shim.exports; 1577 1578 takeGlobalQueue(); 1579 1580 while (defQueue.length) { 1581 args = defQueue.shift(); 1582 if (args[0] === null) { 1583 args[0] = moduleName; 1584 //If already found an anonymous module and bound it 1585 //to this name, then this is some other anon module 1586 //waiting for its completeLoad to fire. 1587 if (found) { 1588 break; 1589 } 1590 found = true; 1591 } else if (args[0] === moduleName) { 1592 //Found matching define call for this script! 1593 found = true; 1594 } 1595 1596 callGetModule(args); 1597 } 1598 context.defQueueMap = {}; 1599 1600 //Do this after the cycle of callGetModule in case the result 1601 //of those calls/init calls changes the registry. 1602 mod = getOwn(registry, moduleName); 1603 1604 if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { 1605 if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { 1606 if (hasPathFallback(moduleName)) { 1607 return; 1608 } else { 1609 return onError(makeError('nodefine', 1610 'No define call for ' + moduleName, 1611 null, 1612 [moduleName])); 1613 } 1614 } else { 1615 //A script that does not call define(), so just simulate 1616 //the call for it. 1617 callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); 1618 } 1619 } 1620 1621 checkLoaded(); 1622 }, 1623 1624 /** 1625 * Converts a module name to a file path. Supports cases where 1626 * moduleName may actually be just an URL. 1627 * Note that it **does not** call normalize on the moduleName, 1628 * it is assumed to have already been normalized. This is an 1629 * internal API, not a public one. Use toUrl for the public API. 1630 */ 1631 nameToUrl: function (moduleName, ext, skipExt) { 1632 var paths, syms, i, parentModule, url, 1633 parentPath, bundleId, 1634 pkgMain = getOwn(config.pkgs, moduleName); 1635 1636 if (pkgMain) { 1637 moduleName = pkgMain; 1638 } 1639 1640 bundleId = getOwn(bundlesMap, moduleName); 1641 1642 if (bundleId) { 1643 return context.nameToUrl(bundleId, ext, skipExt); 1644 } 1645 1646 //If a colon is in the URL, it indicates a protocol is used and it is just 1647 //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) 1648 //or ends with .js, then assume the user meant to use an url and not a module id. 1649 //The slash is important for protocol-less URLs as well as full paths. 1650 if (req.jsExtRegExp.test(moduleName)) { 1651 //Just a plain path, not module name lookup, so just return it. 1652 //Add extension if it is included. This is a bit wonky, only non-.js things pass 1653 //an extension, this method probably needs to be reworked. 1654 url = moduleName + (ext || ''); 1655 } else { 1656 //A module that needs to be converted to a path. 1657 paths = config.paths; 1658 1659 syms = moduleName.split('/'); 1660 //For each module name segment, see if there is a path 1661 //registered for it. Start with most specific name 1662 //and work up from it. 1663 for (i = syms.length; i > 0; i -= 1) { 1664 parentModule = syms.slice(0, i).join('/'); 1665 1666 parentPath = getOwn(paths, parentModule); 1667 if (parentPath) { 1668 //If an array, it means there are a few choices, 1669 //Choose the one that is desired 1670 if (isArray(parentPath)) { 1671 parentPath = parentPath[0]; 1672 } 1673 syms.splice(0, i, parentPath); 1674 break; 1675 } 1676 } 1677 1678 //Join the path parts together, then figure out if baseUrl is needed. 1679 url = syms.join('/'); 1680 url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js')); 1681 url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; 1682 } 1683 1684 return config.urlArgs && !/^blob\:/.test(url) ? 1685 url + config.urlArgs(moduleName, url) : url; 1686 }, 1687 1688 //Delegates to req.load. Broken out as a separate function to 1689 //allow overriding in the optimizer. 1690 load: function (id, url) { 1691 req.load(context, id, url); 1692 }, 1693 1694 /** 1695 * Executes a module callback function. Broken out as a separate function 1696 * solely to allow the build system to sequence the files in the built 1697 * layer in the right sequence. 1698 * 1699 * @private 1700 */ 1701 execCb: function (name, callback, args, exports) { 1702 return callback.apply(exports, args); 1703 }, 1704 1705 /** 1706 * callback for script loads, used to check status of loading. 1707 * 1708 * @param {Event} evt the event from the browser for the script 1709 * that was loaded. 1710 */ 1711 onScriptLoad: function (evt) { 1712 //Using currentTarget instead of target for Firefox 2.0's sake. Not 1713 //all old browsers will be supported, but this one was easy enough 1714 //to support and still makes sense. 1715 if (evt.type === 'load' || 1716 (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { 1717 //Reset interactive script so a script node is not held onto for 1718 //to long. 1719 interactiveScript = null; 1720 1721 //Pull out the name of the module and the context. 1722 var data = getScriptData(evt); 1723 context.completeLoad(data.id); 1724 } 1725 }, 1726 1727 /** 1728 * Callback for script errors. 1729 */ 1730 onScriptError: function (evt) { 1731 var data = getScriptData(evt); 1732 if (!hasPathFallback(data.id)) { 1733 var parents = []; 1734 eachProp(registry, function(value, key) { 1735 if (key.indexOf('_@r') !== 0) { 1736 each(value.depMaps, function(depMap) { 1737 if (depMap.id === data.id) { 1738 parents.push(key); 1739 return true; 1740 } 1741 }); 1742 } 1743 }); 1744 return onError(makeError('scripterror', 'Script error for "' + data.id + 1745 (parents.length ? 1746 '", needed by: ' + parents.join(', ') : 1747 '"'), evt, [data.id])); 1748 } 1749 } 1750 }; 1751 1752 context.require = context.makeRequire(); 1753 return context; 1754 } 1755 1756 /** 1757 * Main entry point. 1758 * 1759 * If the only argument to require is a string, then the module that 1760 * is represented by that string is fetched for the appropriate context. 1761 * 1762 * If the first argument is an array, then it will be treated as an array 1763 * of dependency string names to fetch. An optional function callback can 1764 * be specified to execute when all of those dependencies are available. 1765 * 1766 * Make a local req variable to help Caja compliance (it assumes things 1767 * on a require that are not standardized), and to give a short 1768 * name for minification/local scope use. 1769 */ 1770 req = requirejs = function (deps, callback, errback, optional) { 1771 1772 //Find the right context, use default 1773 var context, config, 1774 contextName = defContextName; 1775 1776 // Determine if have config object in the call. 1777 if (!isArray(deps) && typeof deps !== 'string') { 1778 // deps is a config object 1779 config = deps; 1780 if (isArray(callback)) { 1781 // Adjust args if there are dependencies 1782 deps = callback; 1783 callback = errback; 1784 errback = optional; 1785 } else { 1786 deps = []; 1787 } 1788 } 1789 1790 if (config && config.context) { 1791 contextName = config.context; 1792 } 1793 1794 context = getOwn(contexts, contextName); 1795 if (!context) { 1796 context = contexts[contextName] = req.s.newContext(contextName); 1797 } 1798 1799 if (config) { 1800 context.configure(config); 1801 } 1802 1803 return context.require(deps, callback, errback); 1804 }; 1805 1806 /** 1807 * Support require.config() to make it easier to cooperate with other 1808 * AMD loaders on globally agreed names. 1809 */ 1810 req.config = function (config) { 1811 return req(config); 1812 }; 1813 1814 /** 1815 * Execute something after the current tick 1816 * of the event loop. Override for other envs 1817 * that have a better solution than setTimeout. 1818 * @param {Function} fn function to execute later. 1819 */ 1820 req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { 1821 setTimeout(fn, 4); 1822 } : function (fn) { fn(); }; 1823 1824 /** 1825 * Export require as a global, but only if it does not already exist. 1826 */ 1827 if (!require) { 1828 require = req; 1829 } 1830 1831 req.version = version; 1832 1833 //Used to filter out dependencies that are already paths. 1834 req.jsExtRegExp = /^\/|:|\?|\.js$/; 1835 req.isBrowser = isBrowser; 1836 s = req.s = { 1837 contexts: contexts, 1838 newContext: newContext 1839 }; 1840 1841 //Create default context. 1842 req({}); 1843 1844 //Exports some context-sensitive methods on global require. 1845 each([ 1846 'toUrl', 1847 'undef', 1848 'defined', 1849 'specified' 1850 ], function (prop) { 1851 //Reference from contexts instead of early binding to default context, 1852 //so that during builds, the latest instance of the default context 1853 //with its config gets used. 1854 req[prop] = function () { 1855 var ctx = contexts[defContextName]; 1856 return ctx.require[prop].apply(ctx, arguments); 1857 }; 1858 }); 1859 1860 if (isBrowser) { 1861 head = s.head = document.getElementsByTagName('head')[0]; 1862 //If BASE tag is in play, using appendChild is a problem for IE6. 1863 //When that browser dies, this can be removed. Details in this jQuery bug: 1864 //http://dev.jquery.com/ticket/2709 1865 baseElement = document.getElementsByTagName('base')[0]; 1866 if (baseElement) { 1867 head = s.head = baseElement.parentNode; 1868 } 1869 } 1870 1871 /** 1872 * Any errors that require explicitly generates will be passed to this 1873 * function. Intercept/override it if you want custom error handling. 1874 * @param {Error} err the error object. 1875 */ 1876 req.onError = defaultOnError; 1877 1878 /** 1879 * Creates the node for the load command. Only used in browser envs. 1880 */ 1881 req.createNode = function (config, moduleName, url) { 1882 var node = config.xhtml ? 1883 document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : 1884 document.createElement('script'); 1885 node.type = config.scriptType || 'text/javascript'; 1886 node.charset = 'utf-8'; 1887 node.async = true; 1888 return node; 1889 }; 1890 1891 /** 1892 * Does the request to load a module for the browser case. 1893 * Make this a separate function to allow other environments 1894 * to override it. 1895 * 1896 * @param {Object} context the require context to find state. 1897 * @param {String} moduleName the name of the module. 1898 * @param {Object} url the URL to the module. 1899 */ 1900 req.load = function (context, moduleName, url) { 1901 var config = (context && context.config) || {}, 1902 node; 1903 if (isBrowser) { 1904 //In the browser so use a script tag 1905 node = req.createNode(config, moduleName, url); 1906 1907 node.setAttribute('data-requirecontext', context.contextName); 1908 node.setAttribute('data-requiremodule', moduleName); 1909 1910 //Set up load listener. Test attachEvent first because IE9 has 1911 //a subtle issue in its addEventListener and script onload firings 1912 //that do not match the behavior of all other browsers with 1913 //addEventListener support, which fire the onload event for a 1914 //script right after the script execution. See: 1915 //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution 1916 //UNFORTUNATELY Opera implements attachEvent but does not follow the script 1917 //script execution mode. 1918 if (node.attachEvent && 1919 //Check if node.attachEvent is artificially added by custom script or 1920 //natively supported by browser 1921 //read https://github.com/requirejs/requirejs/issues/187 1922 //if we can NOT find [native code] then it must NOT natively supported. 1923 //in IE8, node.attachEvent does not have toString() 1924 //Note the test for "[native code" with no closing brace, see: 1925 //https://github.com/requirejs/requirejs/issues/273 1926 !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && 1927 !isOpera) { 1928 //Probably IE. IE (at least 6-8) do not fire 1929 //script onload right after executing the script, so 1930 //we cannot tie the anonymous define call to a name. 1931 //However, IE reports the script as being in 'interactive' 1932 //readyState at the time of the define call. 1933 useInteractive = true; 1934 1935 node.attachEvent('onreadystatechange', context.onScriptLoad); 1936 //It would be great to add an error handler here to catch 1937 //404s in IE9+. However, onreadystatechange will fire before 1938 //the error handler, so that does not help. If addEventListener 1939 //is used, then IE will fire error before load, but we cannot 1940 //use that pathway given the connect.microsoft.com issue 1941 //mentioned above about not doing the 'script execute, 1942 //then fire the script load event listener before execute 1943 //next script' that other browsers do. 1944 //Best hope: IE10 fixes the issues, 1945 //and then destroys all installs of IE 6-9. 1946 //node.attachEvent('onerror', context.onScriptError); 1947 } else { 1948 node.addEventListener('load', context.onScriptLoad, false); 1949 node.addEventListener('error', context.onScriptError, false); 1950 } 1951 node.src = url; 1952 1953 //Calling onNodeCreated after all properties on the node have been 1954 //set, but before it is placed in the DOM. 1955 if (config.onNodeCreated) { 1956 config.onNodeCreated(node, config, moduleName, url); 1957 } 1958 1959 //For some cache cases in IE 6-8, the script executes before the end 1960 //of the appendChild execution, so to tie an anonymous define 1961 //call to the module name (which is stored on the node), hold on 1962 //to a reference to this node, but clear after the DOM insertion. 1963 currentlyAddingScript = node; 1964 if (baseElement) { 1965 head.insertBefore(node, baseElement); 1966 } else { 1967 head.appendChild(node); 1968 } 1969 currentlyAddingScript = null; 1970 1971 return node; 1972 } else if (isWebWorker) { 1973 try { 1974 //In a web worker, use importScripts. This is not a very 1975 //efficient use of importScripts, importScripts will block until 1976 //its script is downloaded and evaluated. However, if web workers 1977 //are in play, the expectation is that a build has been done so 1978 //that only one script needs to be loaded anyway. This may need 1979 //to be reevaluated if other use cases become common. 1980 1981 // Post a task to the event loop to work around a bug in WebKit 1982 // where the worker gets garbage-collected after calling 1983 // importScripts(): https://webkit.org/b/153317 1984 setTimeout(function() {}, 0); 1985 importScripts(url); 1986 1987 //Account for anonymous modules 1988 context.completeLoad(moduleName); 1989 } catch (e) { 1990 context.onError(makeError('importscripts', 1991 'importScripts failed for ' + 1992 moduleName + ' at ' + url, 1993 e, 1994 [moduleName])); 1995 } 1996 } 1997 }; 1998 1999 function getInteractiveScript() { 2000 if (interactiveScript && interactiveScript.readyState === 'interactive') { 2001 return interactiveScript; 2002 } 2003 2004 eachReverse(scripts(), function (script) { 2005 if (script.readyState === 'interactive') { 2006 return (interactiveScript = script); 2007 } 2008 }); 2009 return interactiveScript; 2010 } 2011 2012 //Look for a data-main script attribute, which could also adjust the baseUrl. 2013 if (isBrowser && !cfg.skipDataMain) { 2014 //Figure out baseUrl. Get it from the script tag with require.js in it. 2015 eachReverse(scripts(), function (script) { 2016 //Set the 'head' where we can append children by 2017 //using the script's parent. 2018 if (!head) { 2019 head = script.parentNode; 2020 } 2021 2022 //Look for a data-main attribute to set main script for the page 2023 //to load. If it is there, the path to data main becomes the 2024 //baseUrl, if it is not already set. 2025 dataMain = script.getAttribute('data-main'); 2026 if (dataMain) { 2027 //Preserve dataMain in case it is a path (i.e. contains '?') 2028 mainScript = dataMain; 2029 2030 //Set final baseUrl if there is not already an explicit one, 2031 //but only do so if the data-main value is not a loader plugin 2032 //module ID. 2033 if (!cfg.baseUrl && mainScript.indexOf('!') === -1) { 2034 //Pull off the directory of data-main for use as the 2035 //baseUrl. 2036 src = mainScript.split('/'); 2037 mainScript = src.pop(); 2038 subPath = src.length ? src.join('/') + '/' : './'; 2039 2040 cfg.baseUrl = subPath; 2041 } 2042 2043 //Strip off any trailing .js since mainScript is now 2044 //like a module name. 2045 mainScript = mainScript.replace(jsSuffixRegExp, ''); 2046 2047 //If mainScript is still a path, fall back to dataMain 2048 if (req.jsExtRegExp.test(mainScript)) { 2049 mainScript = dataMain; 2050 } 2051 2052 //Put the data-main script in the files to load. 2053 cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; 2054 2055 return true; 2056 } 2057 }); 2058 } 2059 2060 /** 2061 * The function that handles definitions of modules. Differs from 2062 * require() in that a string for the module should be the first argument, 2063 * and the function to execute after dependencies are loaded should 2064 * return a value to define the module corresponding to the first argument's 2065 * name. 2066 */ 2067 define = function (name, deps, callback) { 2068 var node, context; 2069 2070 //Allow for anonymous modules 2071 if (typeof name !== 'string') { 2072 //Adjust args appropriately 2073 callback = deps; 2074 deps = name; 2075 name = null; 2076 } 2077 2078 //This module may not have dependencies 2079 if (!isArray(deps)) { 2080 callback = deps; 2081 deps = null; 2082 } 2083 2084 //If no name, and callback is a function, then figure out if it a 2085 //CommonJS thing with dependencies. 2086 if (!deps && isFunction(callback)) { 2087 deps = []; 2088 //Remove comments from the callback string, 2089 //look for require calls, and pull them into the dependencies, 2090 //but only if there are function args. 2091 if (callback.length) { 2092 callback 2093 .toString() 2094 .replace(commentRegExp, commentReplace) 2095 .replace(cjsRequireRegExp, function (match, dep) { 2096 deps.push(dep); 2097 }); 2098 2099 //May be a CommonJS thing even without require calls, but still 2100 //could use exports, and module. Avoid doing exports and module 2101 //work though if it just needs require. 2102 //REQUIRES the function to expect the CommonJS variables in the 2103 //order listed below. 2104 deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); 2105 } 2106 } 2107 2108 //If in IE 6-8 and hit an anonymous define() call, do the interactive 2109 //work. 2110 if (useInteractive) { 2111 node = currentlyAddingScript || getInteractiveScript(); 2112 if (node) { 2113 if (!name) { 2114 name = node.getAttribute('data-requiremodule'); 2115 } 2116 context = contexts[node.getAttribute('data-requirecontext')]; 2117 } 2118 } 2119 2120 //Always save off evaluating the def call until the script onload handler. 2121 //This allows multiple modules to be in a file without prematurely 2122 //tracing dependencies, and allows for anonymous module support, 2123 //where the module name is not known until the script onload event 2124 //occurs. If no context, use the global queue, and get it processed 2125 //in the onscript load callback. 2126 if (context) { 2127 context.defQueue.push([name, deps, callback]); 2128 context.defQueueMap[name] = true; 2129 } else { 2130 globalDefQueue.push([name, deps, callback]); 2131 } 2132 }; 2133 2134 define.amd = { 2135 jQuery: true 2136 }; 2137 2138 /** 2139 * Executes the text. Normally just uses eval, but can be modified 2140 * to use a better, environment-specific call. Only used for transpiling 2141 * loader plugins, not for plain JS modules. 2142 * @param {String} text the text to execute/evaluate. 2143 */ 2144 req.exec = function (text) { 2145 /*jslint evil: true */ 2146 return eval(text); 2147 }; 2148 2149 //Set up with config info. 2150 req(cfg); 2151}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));
2152 2153requirejs.config({ 2154 baseUrl: PORTAL_URL, 2155 paths: { 2156 "ace-mode-css": "++plone++static/components/ace-builds/src/mode-css", 2157 "ace-mode-javascript": "++plone++static/components/ace-builds/src/mode-javascript", 2158 "ace-mode-text": "++plone++static/components/ace-builds/src/mode-text", 2159 "ace-theme-monokai": "++plone++static/components/ace-builds/src/theme-monokai", 2160 "ace": "++plone++static/components/ace-builds/src/ace", 2161 "backbone": "++plone++static/components/backbone/backbone", 2162 "backbone.paginator": "++plone++static/components/backbone.paginator/lib/backbone.paginator", 2163 "booost-extratiles": "++resource++cloud19.extratiles/main", 2164 "booost-extratiles-url": "++resource++cloud19.extratiles", 2165 "booost-isotope-js": "++resource++cloud19.theme/javascripts/booost-isotope", 2166 "booost-logged-in": "++resource++cloud19.theme/javascripts/booost-logged-in", 2167 "booost-media": "++resource++wildcard-media/integration", 2168 "booost-standardtiles": "++resource++cloud19.standardtiles/main", 2169 "booost-standardtiles-url": "++resource++cloud19.standardtiles", 2170 "booost-theme": "++resource++cloud19.theme/javascripts/booost", 2171 "booost-ttw": "++plone++custom/custom", 2172 "bootstrap-alert": "++plone++static/components/bootstrap/js/alert", 2173 "bootstrap-collapse": "++plone++static/components/bootstrap/js/collapse", 2174 "bootstrap-dropdown": "++plone++static/components/bootstrap/js/dropdown", 2175 "bootstrap-tooltip": "++plone++static/components/bootstrap/js/tooltip", 2176 "bootstrap-transition": "++plone++static/components/bootstrap/js/transition", 2177 "bundle-leaflet": "++plone++patternslib/bundle-leaflet", 2178 "datatables.net-autofill-bs": "++plone++static/components/datatables.net-autofill-bs/js/autoFill.bootstrap", 2179 "datatables.net-autofill": "++plone++static/components/datatables.net-autofill/js/dataTables.autoFill.min", 2180 "datatables.net-bs": "++plone++static/components/datatables.net-bs/js/dataTables.bootstrap", 2181 "datatables.net-buttons-bs": "++plone++static/components/datatables.net-buttons-bs/js/buttons.bootstrap.min", 2182 "datatables.net-buttons-colvis": "++plone++static/components/datatables.net-buttons/js/buttons.colVis.min", 2183 "datatables.net-buttons-flash": "++plone++static/components/datatables.net-buttons/js/buttons.flash.min", 2184 "datatables.net-buttons-html5": "++plone++static/components/datatables.net-buttons/js/buttons.html5.min", 2185 "datatables.net-buttons-print": "++plone++static/components/datatables.net-buttons/js/buttons.print.min", 2186 "datatables.net-buttons": "++plone++static/components/datatables.net-buttons/js/dataTables.buttons.min", 2187 "datatables.net-colreorder": "++plone++static/components/datatables.net-colreorder/js/dataTables.colReorder.min", 2188 "datatables.net-fixedcolumns": "++plone++static/components/datatables.net-fixedcolumns/js/dataTables.fixedColumns.min", 2189 "datatables.net-fixedheader": "++plone++static/components/datatables.net-fixedheader/js/dataTables.fixedHeader.min", 2190 "datatables.net-keytable": "++plone++static/components/datatables.net-keytable/js/dataTables.keyTable.min", 2191 "datatables.net-responsive-bs": "++plone++static/components/datatables.net-responsive-bs/js/responsive.bootstrap.min", 2192 "datatables.net-responsive": "++plone++static/components/datatables.net-responsive/js/dataTables.responsive.min", 2193 "datatables.net-rowreorder": "++plone++static/components/datatables.net-rowreorder/js/dataTables.rowReorder.min", 2194 "datatables.net-scroller": "++plone++static/components/datatables.net-scroller/js/dataTables.scroller.min", 2195 "datatables.net-select": "++plone++static/components/datatables.net-select/js/dataTables.select.min", 2196 "datatables.net": "++plone++static/components/datatables.net/js/jquery.dataTables", 2197 "desandro-matches-selector": "++plone++patternslib/components/desandro-matches-selector/matches-selector", 2198 "dropzone": "++plone++static/components/dropzone/dist/dropzone-amd-module", 2199 "ev-emitter": "++plone++patternslib/components/ev-emitter/ev-emitter", 2200 "filemanager": "++plone++static/filemanager", 2201 "get-size": "++plone++patternslib/components/get-size/get-size", 2202 "imagesloaded": "++plone++patternslib/components/imagesloaded/imagesloaded.pkgd", 2203 "jcrop": "++plone++patternslib/components/jcrop/js/jquery.Jcrop", 2204 "jqtree-contextmenu": "++plone++static/components/cs-jqtree-contextmenu/src/jqTreeContextMenu", 2205 "jqtree": "++plone++static/components/jqtree/tree.jquery", 2206 "jquery.anythingslider": "++plone++patternslib/components/AnythingSlider/js/jquery.anythingslider", 2207 "jquery.browser": "++plone++patternslib/components/jquery.browser/dist/jquery.browser", 2208 "jquery": "++plone++static/components/jquery/dist/jquery.min", 2209 "jquery.cookie": "++plone++static/components/jquery.cookie/jquery.cookie", 2210 "jquery.event.drag": "++resource++mockuplib/jquery.event.drag", 2211 "jquery.event.drop": "++resource++mockuplib/jquery.event.drop", 2212 "jquery.form": "++plone++static/components/jquery-form/src/jquery.form", 2213 "jquery.placeholder": "++plone++patternslib/components/jquery-placeholder/jquery.placeholder", 2214 "jquery.recurrenceinput": "++plone++static/components/jquery.recurrenceinput.js/src/jquery.recurrenceinput", 2215 "jquery.tmpl": "++plone++static/components/jquery.recurrenceinput.js/lib/jquery.tmpl", 2216 "layouts-editor": "++plone++mosaic/js/layouts-editor", 2217 "leaflet-awesomemarkers": "++plone++patternslib/components/Leaflet.awesome-markers/dist/leaflet.awesome-markers", 2218 "leaflet-fullscreen": "++plone++patternslib/components/Leaflet.fullscreen/dist/Leaflet.fullscreen", 2219 "leaflet-geosearch-bing": "++plone++patternslib/components/L.GeoSearch/src/js/l.geosearch.provider.bing", 2220 "leaflet-geosearch-esri": "++plone++patternslib/components/L.GeoSearch/src/js/l.geosearch.provider.esri", 2221 "leaflet-geosearch-google": "++plone++patternslib/components/L.GeoSearch/src/js/l.geosearch.provider.google", 2222 "leaflet-geosearch-openstreetmap": "++plone++patternslib/components/L.GeoSearch/src/js/l.geosearch.provider.openstreetmap", 2223 "leaflet-geosearch": "++plone++patternslib/components/L.GeoSearch/src/js/l.control.geosearch", 2224 "leaflet-locatecontrol": "++plone++patternslib/components/leaflet.locatecontrol/src/L.Control.Locate", 2225 "leaflet-markercluster": "++plone++patternslib/components/leaflet.markercluster/dist/leaflet.markercluster-src", 2226 "leaflet-minimap": "++plone++patternslib/components/Leaflet-MiniMap/dist/Control.MiniMap.min", 2227 "leaflet-providers": "++plone++patternslib/components/leaflet-providers/leaflet-providers", 2228 "leaflet-simplemarkers": "++plone++patternslib/components/Leaflet.SimpleMarkers/lib/Control.SimpleMarkers", 2229 "leaflet-sleep": "++plone++patternslib/components/Leaflet.Sleep/Leaflet.Sleep", 2230 "leaflet": "++plone++patternslib/components/leaflet/dist/leaflet-src", 2231 "less": "++plone++static/components/less/dist/less", 2232 "logging": "++plone++patternslib/components/logging/src/logging", 2233 "masonry": "++plone++patternslib/components/masonry/dist/masonry.pkgd", 2234 "mockup-i18n": "++resource++mockupjs/i18n", 2235 "mockup-patterns-autotoc": "++resource++mockup/autotoc/pattern", 2236 "mockup-patterns-backdrop": "++resource++mockup/backdrop/pattern", 2237 "mockup-patterns-base": "++resource++mockup/base/pattern", 2238 "mockup-patterns-contentloader": "++resource++mockup/contentloader/pattern", 2239 "mockup-patterns-cookietrigger": "++resource++mockup/cookietrigger/pattern", 2240 "mockup-patterns-datatables": "++resource++mockup/datatables/pattern", 2241 "mockup-patterns-filemanager": "++resource++mockup/filemanager/pattern", 2242 "mockup-patterns-filemanager-url": "++resource++mockup/filemanager", 2243 "mockup-patterns-formautofocus": "++resource++mockup/formautofocus/pattern", 2244 "mockup-patterns-formunloadalert": "++resource++mockup/formunloadalert/pattern", 2245 "mockup-patterns-inlinevalidation": "++resource++mockup/inlinevalidation/pattern", 2246 "mockup-patterns-livesearch": "++resource++mockup/livesearch/pattern", 2247 "mockup-patterns-markspeciallinks": "++resource++mockup/markspeciallinks/pattern", 2248 "mockup-patterns-modal": "++resource++mockup/modal/pattern", 2249 "mockup-patterns-moment": "++resource++mockup/moment/pattern", 2250 "mockup-patterns-navigationmarker": "++resource++mockup/navigationmarker/pattern", 2251 "mockup-patterns-pickadate": "++resource++mockup/pickadate/pattern", 2252 "mockup-patterns-preventdoublesubmit": "++resource++mockup/preventdoublesubmit/pattern", 2253 "mockup-patterns-querystring": "++resource++mockup/querystring/pattern", 2254 "mockup-patterns-recurrence": "++resource++mockup/recurrence/pattern", 2255 "mockup-patterns-relateditems-upload": "++resource++mockup/relateditems/upload", 2256 "mockup-patterns-relateditems": "++resource++mockup/relateditems/pattern", 2257 "mockup-patterns-relateditems-url": "++resource++mockup/relateditems", 2258 "mockup-patterns-resourceregistry": "++resource++mockup/resourceregistry/pattern", 2259 "mockup-patterns-resourceregistry-url": "++resource++mockup/resourceregistry", 2260 "mockup-patterns-select2": "++resource++mockup/select2/pattern", 2261 "mockup-patterns-sortable": "++resource++mockup/sortable/pattern", 2262 "mockup-patterns-structure": "++resource++mockup/structure/pattern", 2263 "mockup-patterns-structure-url": "++resource++mockup/structure",
2264 "mockup-patterns-structureupdater": "++resource++mockup/structure/pattern-structureupdater", 2265 "mockup-patterns-textareamimetypeselector": "++resource++mockup/textareamimetypeselector/pattern", 2266 "mockup-patterns-texteditor": "++resource++mockup/texteditor/pattern", 2267 "mockup-patterns-thememapper": "++resource++mockup/thememapper/pattern", 2268 "mockup-patterns-thememapper-url": "++resource++mockup/thememapper", 2269 "mockup-patterns-tinymce": "++resource++mockup/tinymce/pattern", 2270 "mockup-patterns-tinymce-url": "++resource++mockup/tinymce", 2271 "mockup-patterns-toggle": "++resource++mockup/toggle/pattern", 2272 "mockup-patterns-tooltip": "++resource++mockup/tooltip/pattern", 2273 "mockup-patterns-tree": "++resource++mockup/tree/pattern", 2274 "mockup-patterns-upload": "++resource++mockup/upload/pattern", 2275 "mockup-patterns-upload-url": "++resource++mockup/upload", 2276 "mockup-router": "++resource++mockupjs/router", 2277 "mockup-ui-url": "++resource++mockupjs/ui", 2278 "mockup-utils": "++resource++mockupjs/utils", 2279 "modernizr-csspositionsticky": "++plone++patternslib/components/modernizr/feature-detects/css-positionsticky", 2280 "modernizr": "++plone++patternslib/components/modernizr/modernizr", 2281 "moment-timezone-data": "++plone++patternslib/components/patternslib/src/pat/calendar/moment-timezone-with-data-2010-2020", 2282 "moment-timezone": "++plone++patternslib/components/moment-timezone/moment-timezone", 2283 "moment": "++plone++static/components/moment/min/moment.min", 2284 "moment-url": "++plone++static/components/moment/locale", 2285 "mosaic-base-url": "++plone++mosaic/js", 2286 "mosaic": "++plone++mosaic/js/mosaic.pattern", 2287 "mosaic-url": "++plone++mosaic/js", 2288 "outlayer": "++plone++patternslib/components/outlayer/outlayer", 2289 "pat-ajax": "++plone++patternslib/components/patternslib/src/pat/ajax/ajax", 2290 "pat-auto-scale": "++plone++patternslib/components/patternslib/src/pat/auto-scale/auto-scale", 2291 "pat-auto-submit": "++plone++patternslib/components/patternslib/src/pat/auto-submit/auto-submit", 2292 "pat-auto-suggest": "++plone++patternslib/components/patternslib/src/pat/auto-suggest/auto-suggest", 2293 "pat-base": "++plone++patternslib/components/patternslib/src/core/base", 2294 "pat-breadcrumbs": "++plone++patternslib/components/patternslib/src/pat/breadcrumbs/breadcrumbs", 2295 "pat-bumper": "++plone++patternslib/components/patternslib/src/pat/bumper/bumper", 2296 "pat-checked-flag": "++plone++patternslib/components/patternslib/src/pat/checked-flag/checked-flag", 2297 "pat-checklist": "++plone++patternslib/components/patternslib/src/pat/checklist/checklist", 2298 "pat-clone": "++plone++patternslib/components/patternslib/src/pat/clone/clone", 2299 "pat-collapsible": "++plone++patternslib/components/patternslib/src/pat/collapsible/collapsible", 2300 "pat-colour-picker": "++plone++patternslib/components/patternslib/src/pat/colour-picker/colour-picker", 2301 "pat-compat": "++plone++patternslib/components/patternslib/src/core/compat", 2302 "pat-date-picker": "++plone++patternslib/components/patternslib/src/pat/date-picker/date-picker", 2303 "pat-date-picker-url": "++plone++patternslib/components/patternslib/src/pat/date-picker", 2304 "pat-datetime-picker": "++plone++patternslib/components/patternslib/src/pat/datetime-picker/datetime-picker", 2305 "pat-depends": "++plone++patternslib/components/patternslib/src/pat/depends/depends", 2306 "pat-depends_parse": "++plone++patternslib/components/patternslib/src/lib/depends_parse", 2307 "pat-dependshandler": "++plone++patternslib/components/patternslib/src/lib/dependshandler", 2308 "pat-equaliser": "++plone++patternslib/components/patternslib/src/pat/equaliser/equaliser", 2309 "pat-expandable": "++plone++patternslib/components/patternslib/src/pat/expandable-tree/expandable-tree", 2310 "pat-focus": "++plone++patternslib/components/patternslib/src/pat/focus/focus", 2311 "pat-form-state": "++plone++patternslib/components/patternslib/src/pat/form-state/form-state", 2312 "pat-forward": "++plone++patternslib/components/patternslib/src/pat/forward/forward", 2313 "pat-gallery": "++plone++patternslib/components/patternslib/src/pat/gallery/gallery", 2314 "pat-gallery-url": "++plone++patternslib/components/patternslib/src/pat/gallery", 2315 "pat-grid": "++plone++patternslib/components/patternslib/src/pat/grid/grid", 2316 "pat-htmlparser": "++plone++patternslib/components/patternslib/src/lib/htmlparser", 2317 "pat-image-crop": "++plone++patternslib/components/patternslib/src/pat/image-crop/image-crop", 2318 "pat-inject": "++plone++patternslib/components/patternslib/src/pat/inject/inject", 2319 "pat-input-change-events": "++plone++patternslib/components/patternslib/src/lib/input-c
2319hange-events", 2320 "pat-jquery-ext": "++plone++patternslib/components/patternslib/src/core/jquery-ext", 2321 "pat-leaflet": "++plone++patternslib/components/pat-leaflet/src/pat-leaflet", 2322 "pat-legend": "++plone++patternslib/components/patternslib/src/pat/legend/legend", 2323 "pat-logger": "++plone++patternslib/components/patternslib/src/core/logger", 2324 "pat-markdown": "++plone++patternslib/components/patternslib/src/pat/markdown/markdown", 2325 "pat-masonry": "++plone++patternslib/components/patternslib/src/pat/masonry/masonry", 2326 "pat-menu": "++plone++patternslib/components/patternslib/src/pat/menu/menu", 2327 "pat-mockup-parser": "++plone++patternslib/components/patternslib/src/core/mockup-parser", 2328 "pat-modal": "++plone++patternslib/components/patternslib/src/pat/modal/modal", 2329 "pat-navigation": "++plone++patternslib/components/patternslib/src/pat/navigation/navigation", 2330 "pat-parser": "++plone++patternslib/components/patternslib/src/core/parser", 2331 "pat-placeholder": "++plone++patternslib/components/patternslib/src/pat/placeholder/placeholder", 2332 "pat-registry": "++plone++patternslib/components/patternslib/src/core/registry", 2333 "pat-remove": "++plone++patternslib/components/patternslib/src/core/remove", 2334 "pat-scroll": "++plone++patternslib/components/patternslib/src/pat/scroll/scroll", 2335 "pat-selectbox": "++plone++patternslib/components/patternslib/src/pat/selectbox/selectbox", 2336 "pat-slides": "++plone++patternslib/components/patternslib/src/pat/slides/slides", 2337 "pat-slideshow-builder": "++plone++patternslib/components/patternslib/src/pat/slideshow-builder/slideshow-builder", 2338 "pat-stacks": "++plone++patternslib/components/patternslib/src/pat/stacks/stacks", 2339 "pat-sticky": "++plone++patternslib/components/patternslib/src/pat/sticky/sticky", 2340 "pat-store": "++plone++patternslib/components/patternslib/src/core/store", 2341 "pat-subform": "++plone++patternslib/components/patternslib/src/pat/subform/subform", 2342 "pat-switch": "++plone++patternslib/components/patternslib/src/pat/switch/switch", 2343 "pat-utils": "++plone++patternslib/components/patternslib/src/core/utils", 2344 "pat-validation": "++plone++patternslib/components/patternslib/src/pat/validation/validation", 2345 "pat-zoom": "++plone++patternslib/components/patternslib/src/pat/zoom/zoom", 2346 "patterns": "++resource++patterns", 2347 "photoswipe-ui": "++plone++patternslib/components/photoswipe/dist/photoswipe-ui-default", 2348 "photoswipe": "++plone++patternslib/components/photoswipe/dist/photoswipe", 2349 "picker": "++plone++static/components/pickadate/lib/picker", 2350 "picker.date": "++plone++static/components/pickadate/lib/picker.date", 2351 "picker.time": "++plone++static/components/pickadate/lib/picker.time", 2352 "pikaday": "++plone++patternslib/components/pikaday/pikaday", 2353 "plone-app-discussion": "++plone++plone.app.discussion.javascripts/comments", 2354 "plone-app-event": "++plone++plone.app.event/event", 2355 "plone-base": "++resource++plone-base", 2356 "plone-datatables": "++resource++plone-datatables", 2357 "plone-editor-tools": "++resource++plone-editor-tools", 2358 "plone-logged-in": "++resource++plone-logged-in", 2359 "plone-moment": "++resource++plone-moment", 2360 "plone-patterns-portletmanager": "++resource++manage-portlets", 2361 "plone-patterns-toolbar": "++resource++mockup/toolbar/pattern", 2362 "plone-tinymce": "++resource++plone-tinymce", 2363 "plone": "++resource++plone", 2364 "plone_app_imagecropping": "++resource++plone.app.imagecropping.static/bundle", 2365 "plone_app_imagecropping_cropper": "++resource++plone.app.imagecropping.static/cropper-dist/cropper", 2366 "plone_app_imagecropping_cropperpattern": "++resource++plone.app.imagecropping.static/cropperpattern", 2367 "plone_app_imagecropping_cropscaleselect": "++resource++plone.app.imagecropping.static/cropscaleselect", 2368 "prefixfree": "++plone++patternslib/components/prefixfree/prefixfree.min", 2369 "resource-plone-app-jquerytools-dateinput-js": "++plone++static/components/jquery.recurrenceinput.js/lib/jquery.tools.dateinput", 2370 "resource-plone-app-jquerytools-js": "++plone++static/components/jquery.recurrenceinput.js/lib/jquery.tools.overlay", 2371 "resourceregistry": "++plone++static/resourceregistry", 2372 "select2": "++plone++static/components/select2/select2", 2373 "showdown-github": "++plone++patternslib/components/showdown/compressed/extensions/github.min", 2374 "showdown-table": "++plone++patternslib/components/showdown/compressed/extensions/table.min", 2375 "showdown": "++plone++patternslib/components/showdown/compressed/showdown", 2376 "slides": "++plone++patternslib/components/slides/src/slides", 2377 "spectrum": "++plone++patternslib/components/spectrum/spectrum", 2378 "stickyfill": "++plone++patternslib/components/Stickyfill/dist/stickyfill", 2379 "text": "++plone++static/components/requirejs-text/text", 2380 "thememapper": "++plone++static/thememapper", 2381 "tinymce-advlist": "++plone++static/components/tinymce-builded/js/tinymce/plugins/advlist/plugin", 2382 "tinymce-anchor": "++plone++static/components/tinymce-builded/js/tinymce/plugins/anchor/plugin", 2383 "tinymce-autolink": "++plone++static/components/tinymce-builded/js/tinymce/plugins/autolink/plugin", 2384 "tinymce-autoresize": "++plone++static/components/tinymce-builded/js/tinymce/plugins/autoresize/plugin", 2385 "tinymce-autosave": "++plone++static/components/tinymce-builded/js/tinymce/plugins/autosave/plugin", 2386 "tinymce-bbcode": "++plone++static/components/tinymce-builded/js/tinymce/plugins/bbcode/plugin", 2387 "tinymce-charmap": "++plone++static/components/tinymce-builded/js/tinymce/plugins/charmap/plugin", 2388 "tinymce-code": "++plone++static/components/tinymce-builded/js/tinymce/plugins/code/plugin", 2389 "tinymce-colorpicker": "++plone++static/components/tinymce-builded/js/tinymce/plugins/colorpicker/plugin", 2390 "tinymce-compat3x": "++plone++static/components/tinymce-builded/js/tinymce/plugins/compat3x/plugin", 2391 "tinymce-contextmenu": "++plone++static/components/tinymce-builded/js/tinymce/plugins/contextmenu/plugin", 2392 "tinymce-directionality": "++plone++static/components/tinymce-builded/js/tinymce/plugins/directionality/plugin", 2393 "tinymce-emoticons": "++plone++static/components/tinymce-builded/js/tinymce/plugins/emoticons/plugin", 2394 "tinymce-fullpage": "++plone++static/components/tinymce-builded/js/tinymce/plugins/fullpage/plugin", 2395 "tinymce-fullscreen": "++plone++static/components/tinymce-builded/js/tinymce/plugins/fullscreen/plugin", 2396 "tinymce-hr": "++plone++static/components/tinymce-builded/js/tinymce/plugins/hr/plugin", 2397 "tinymce-image": "++plone++static/components/tinymce-builded/js/tinymce/plugins/image/plugin", 2398 "tinymce-importcss": "++plone++static/components/tinymce-builded/js/tinymce/plugins/importcss/plugin", 2399 "tinymce-insertdatetime": "++plone++static/components/tinymce-builded/js/tinymce/plugins/insertdatetime/plugin", 2400 "tinymce-legacyoutput": "++plone++static/components/tinymce-builded/js/tinymce/plugins/legacyoutput/plugin", 2401 "tinymce-link": "++plone++static/components/tinymce-builded/js/tinymce/plugins/link/plugin", 2402 "tinymce-lists": "++plone++static/components/tinymce-builded/js/tinymce/plugins/lists/plugin", 2403 "tinymce-media": "++plone++static/components/tinymce-builded/js/tinymce/plugins/media/plugin", 2404 "tinymce-modern-theme": "++plone++static/components/tinymce-builded/js/tinymce/themes/modern/theme", 2405 "tinymce-nonbreaking": "++plone++static/components/tinymce-builded/js/tinymce/plugins/nonbreaking/plugin", 2406 "tinymce-noneditable": "++plone++static/components/tinymce-builded/js/tinymce/plugins/noneditable/plugin", 2407 "tinymce-pagebreak": "++plone++static/components/tinymce-builded/js/tinymce/plugins/pagebreak/plugin", 2408 "tinymce-paste": "++plone++static/components/tinymce-builded/js/tinymce/plugins/paste/plugin", 2409 "tinymce-preview": "++plone++static/components/tinymce-builded/js/tinymce/plugins/preview/plugin", 2410 "tinymce-print": "++plone++static/components/tinymce-builded/js/tinymce/plugins/print/plugin", 2411 "tinymce-save": "++plone++static/components/tinymce-builded/js/tinymce/plugins/save/plugin", 2412 "tinymce-searchreplace": "++plone++static/components/tinymce-builded/js/tinymce/plugins/searchreplace/plugin", 2413 "tinymce-spellchecker": "++plone++static/components/tinymce-builded/js/tinymce/plugins/spellchecker/plugin", 2414 "tinymce-tabfocus": "++plone++static/components/tinymce-builded/js/tinymce/plugins/tabfocus/plugin", 2415 "tinymce-table": "++plone++static/components/tinymce-builded/js/tinymce/plugins/table/plugin", 2416 "tinymce-template": "++plone++static/components/tinymce-builded/js/tinymce/plugins/template/plugin", 2417 "tinymce-textcolor": "++plone++static/components/tinymce-builded/js/tinymce/plugins/textcolor/plugin", 2418 "tinymce-textpattern": "++plone++static/components/tinymce-builded/js/tinymce/plugins/textpattern/plugin", 2419 "tinymce-visualblocks": "++plone++static/components/tinymce-builded/js/tinymce/plugins/visualblocks/plugin", 2420 "tinymce-visualchars": "++plone++static/components/tinymce-builded/js/tinymce/plugins/visualchars/plugin", 2421 "tinymce-wordcount": "++plone++static/components/tinymce-builded/js/tinymce/plugins/wordcount/plugin", 2422 "tinymce": "++plone++static/components/tinymce-builded/js/tinymce/tinymce", 2423 "translate": "++resource++mockupjs/i18n-wrapper", 2424 "underscore": "++plone++static/components/underscore/underscore", 2425 "validate": "++plone++patternslib/components/validate/validate", 2426 "webcouturier-dropdownmenu": "++plone++dropdown/dropdown" 2427}, 2428 shim: { 2429 "backbone": { 2430 exports: "window.Backbone", 2431 deps: ["underscore", "jquery"] 2432 }, 2433 "backbone.paginator": { 2434 exports: "window.Backbone.Paginator", 2435 deps: ["backbone"] 2436 }, 2437 "bootstrap-alert": { 2438 deps: ["jquery"] 2439 }, 2440 "bootstrap-collapse": { 2441 exports: "window.jQuery.fn.collapse.Constructor", 2442 deps: ["jquery"] 2443 }, 2444 "bootstrap-dropdown": { 2445 deps: ["jquery"] 2446 }, 2447 "bootstrap-tooltip": { 2448 deps: ["jquery"] 2449 }, 2450 "bootstrap-transition": { 2451 exports: "window.jQuery.support.transition", 2452 deps: ["jquery"] 2453 }, 2454 "jcrop": { 2455 deps: ["jquery"] 2456 }, 2457 "jqtree-contextmenu": { 2458 deps: ["jqtree"] 2459 }, 2460 "jqtree": { 2461 deps: ["jquery"] 2462 }, 2463 "jquery.browser": { 2464 deps: ["jquery"] 2465 }, 2466 "jquery.cookie": { 2467 deps: ["jquery"] 2468 }, 2469 "jquery.event.drag": { 2470 deps: ["jquery"] 2471 }, 2472 "jquery.event.drop": { 2473 exports: "$.drop", 2474 deps: ["jquery"] 2475 }, 2476 "jquery.placeholder": { 2477 deps: ["jquery"] 2478 }, 2479 "jquery.recurrenceinput": { 2480 deps: ["jquery", "resource-plone-app-jquerytools-js", "resource-plone-app-jquerytools-dateinput-js", "jquery.tmpl"] 2481 }, 2482 "jquery.tmpl": { 2483 deps: ["jquery"] 2484 }, 2485 "leaflet-awesomemarkers": { 2486 deps: ["leaflet"] 2487 }, 2488 "leaflet-fullscreen": { 2489 deps: ["leaflet"] 2490 }, 2491 "leaflet-geosearch-bing": { 2492 deps: ["leaflet-geosearch"] 2493 }, 2494 "leaflet-geosearch-esri": { 2495 deps: ["leaflet-geosearch"] 2496 }, 2497 "leaflet-geosearch-google": { 2498 deps: ["leaflet-geosearch"] 2499 }, 2500 "leaflet-geosearch-openstreetmap": { 2501 deps: ["leaflet-geosearch"] 2502 }, 2503 "leaflet-geosearch": { 2504 deps: ["leaflet"] 2505 }, 2506 "leaflet-locatecontrol": { 2507 deps: ["leaflet"] 2508 }, 2509 "leaflet-markercluster": { 2510 deps: ["leaflet"] 2511 }, 2512 "leaflet-minimap": { 2513 deps: ["leaflet"] 2514 }, 2515 "leaflet-simplemarkers": { 2516 deps: ["leaflet"] 2517 }, 2518 "leaflet-sleep": { 2519 deps: ["leaflet"] 2520 }, 2521 "modernizr-csspositionsticky": { 2522 deps: ["modernizr"] 2523 }, 2524 "pat-leaflet": { 2525 deps: ["leaflet"] 2526 }, 2527 "picker.date": { 2528 deps: ["picker"] 2529 }, 2530 "picker.time": { 2531 deps: ["picker"] 2532 }, 2533 "resource-plone-app-jquerytools-dateinput-js": { 2534 deps: ["jquery"] 2535 }, 2536 "resource-plone-app-jquerytools-js": { 2537 deps: ["jquery"] 2538 }, 2539 "showdown-github": { 2540 deps: ["showdown"] 2541 }, 2542 "showdown-table": { 2543 deps: ["showdown"] 2544 }, 2545 "spectrum": { 2546 deps: ["jquery"] 2547 }, 2548 "tinymce-advlist": { 2549 deps: ["tinymce"] 2550 }, 2551 "tinymce-anchor": { 2552 deps: ["tinymce"] 2553 }, 2554 "tinymce-autolink": { 2555 deps: ["tinymce"] 2556 }, 2557 "tinymce-autoresize": { 2558 deps: ["tinymce"] 2559 }, 2560 "tinymce-autosave": { 2561 deps: ["tinymce"] 2562 }, 2563 "tinymce-bbcode": { 2564 deps: ["tinymce"] 2565 }, 2566 "tinymce-charmap": { 2567 deps: ["tinymce"] 2568 }, 2569 "tinymce-code": { 2570 deps: ["tinymce"] 2571 }, 2572 "tinymce-colorpicker": { 2573 deps: ["tinymce"] 2574 }, 2575 "tinymce-compat3x": { 2576 deps: ["tinymce"] 2577 }, 2578 "tinymce-contextmenu": { 2579 deps: ["tinymce"] 2580 }, 2581 "tinymce-directionality": { 2582 deps: ["tinymce"] 2583 }, 2584 "tinymce-emoticons": { 2585 deps: ["tinymce"] 2586 }, 2587 "tinymce-fullpage": { 2588 deps: ["tinymce"] 2589 }, 2590 "tinymce-fullscreen": { 2591 deps: ["tinymce"] 2592 }, 2593 "tinymce-hr": { 2594 deps: ["tinymce"] 2595 }, 2596 "tinymce-image": { 2597 deps: ["tinymce"] 2598 }, 2599 "tinymce-importcss": { 2600 deps: ["tinymce"] 2601 }, 2602 "tinymce-insertdatetime": { 2603 deps: ["tinymce"] 2604 }, 2605 "tinymce-legacyoutput": { 2606 deps: ["tinymce"] 2607 }, 2608 "tinymce-link": { 2609 deps: ["tinymce"] 2610 }, 2611 "tinymce-lists": { 2612 deps: ["tinymce"] 2613 }, 2614 "tinymce-media": { 2615 deps: ["tinymce"] 2616 }, 2617 "tinymce-modern-theme": { 2618 deps: ["tinymce"] 2619 }, 2620 "tinymce-nonbreaking": { 2621 deps: ["tinymce"] 2622 }, 2623 "tinymce-noneditable": { 2624 deps: ["tinymce"] 2625 }, 2626 "tinymce-pagebreak": { 2627 deps: ["tinymce"] 2628 }, 2629 "tinymce-paste": { 2630 deps: ["tinymce"] 2631 }, 2632 "tinymce-preview": { 2633 deps: ["tinymce"] 2634 }, 2635 "tinymce-print": { 2636 deps: ["tinymce"] 2637 }, 2638 "tinymce-save": { 2639 deps: ["tinymce"] 2640 }, 2641 "tinymce-searchreplace": { 2642 deps: ["tinymce"] 2643 }, 2644 "tinymce-spellchecker": { 2645 deps: ["tinymce"] 2646 }, 2647 "tinymce-tabfocus": { 2648 deps: ["tinymce"] 2649 }, 2650 "tinymce-table": { 2651 deps: ["tinymce"] 2652 }, 2653 "tinymce-template": { 2654 deps: ["tinymce"] 2655 }, 2656 "tinymce-textcolor": { 2657 deps: ["tinymce"] 2658 }, 2659 "tinymce-textpattern": { 2660 deps: ["tinymce"] 2661 }, 2662 "tinymce-visualblocks": { 2663 deps: ["tinymce"] 2664 }, 2665 "tinymce-visualchars": { 2666 deps: ["tinymce"] 2667 }, 2668 "tinymce-wordcount": { 2669 deps: ["tinymce"] 2670 }, 2671 "tinymce": { 2672 exports: "window.tinyMCE", 2673 init: function () { this.tinyMCE.DOM.events.domLoaded = true; return this.tinyMCE; } 2674 }, 2675 "underscore": { 2676 exports: "window._" 2677 } 2678 }, 2679 optimize: 'uglify', 2680 wrapShim: true 2681}); 2682!function(){function n(){}var t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this||{},e=t._,r=Array.prototype,a=Object.prototype,f="undefined"!=typeof Symbol?Symbol.prototype:null,i=r.push,l=r.slice,p=a.toString,o=a.hasOwnProperty,u=Array.isArray,c=Object.keys,s=Object.create,h=function(t){return t instanceof h?t:this instanceof h?void(this._wrapped=t):new h(t)};"undefined"==
2682typeof exports||exports.nodeType?t._=h:("undefined"!=typeof module&&!module.nodeType&&module.exports&&(exports=module.exports=h),exports._=h),h.VERSION="1.9.1";function d(i,o,t){if(void 0===o)return i;switch(null==t?3:t){case 1:return function(t){return i.call(o,t)};case 3:return function(t,e,n){return i.call(o,t,e,n)};case 4:return function(t,e,n,r){return i.call(o,t,e,n,r)}}return function(){return i.apply(o,arguments)}}function y(t,e,n){return h.iteratee!==v?h.iteratee(t,e):null==t?h.identity:h.isFunction(t)?d(t,e,n):h.isObject(t)&&!h.isArray(t)?h.matcher(t):h.property(t)}var v;h.iteratee=v=function(t,e){return y(t,e,1/0)};function g(i,o){return o=null==o?i.length-1:+o,function(){for(var t=Math.max(arguments.length-o,0),e=Array(t),n=0;n<t;n++)e[n]=arguments[n+o];switch(o){case 0:return i.call(this,e);case 1:return i.call(this,arguments[0],e);case 2:return i.call(this,arguments[0],arguments[1],e)}var r=Array(o+1);for(n=0;n<o;n++)r[n]=arguments[n];return r[o]=e,i.apply(this,r)}}function m(t){if(!h.isObject(t))return{};if(s)return s(t);n.prototype=t;var e=new n;return n.prototype=null,e}function w(e){return function(t){return null==t?void 0:t[e]}}function b(t,e){return null!=t&&o.call(t,e)}function x(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function j(t){var e=_(t);return"number"==typeof e&&0<=e&&e<=A}var A=Math.pow(2,53)-1,_=w("length");h.each=h.forEach=function(t,e,n){var r,i;if(e=d(e,n),j(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=h.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},h.map=h.collect=function(t,e,n){e=y(e,n);for(var r=!j(t)&&h.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var u=r?r[a]:a;o[a]=e(t[u],u,t)}return o};function E(l){return function(t,e,n,r){var i=3<=arguments.length;return function(t,e,n,r){var i=!j(t)&&h.keys(t),o=(i||t).length,a=0<l?0:o-1;for(r||(n=t[i?i[a]:a],a+=l);0<=a&&a<o;a+=l){var u=i?i[a]:a;n=e(n,t[u],u,t)}return n}(t,d(e,r,4),n,i)}}h.reduce=h.foldl=h.inject=E(1),h.reduceRight=h.foldr=E(-1),h.find=h.detect=function(t,e,n){var r=(j(t)?h.findIndex:h.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},h.filter=h.select=function(t,r,e){var i=[];return r=y(r,e),h.each(t,function(t,e,n){r(t,e,n)&&i.push(t)}),i},h.reject=function(t,e,n){return h.filter(t,h.negate(y(e)),n)},h.every=h.all=function(t,e,n){e=y(e,n);for(var r=!j(t)&&h.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},h.some=h.any=function(t,e,n){e=y(e,n);for(var r=!j(t)&&h.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},h.contains=h.includes=h.include=function(t,e,n,r){return j(t)||(t=h.values(t)),"number"==typeof n&&!r||(n=0),0<=h.indexOf(t,e,n)},h.invoke=g(function(t,n,r){var i,o;return h.isFunction(n)?o=n:h.isArray(n)&&(i=n.slice(0,-1),n=n[n.length-1]),h.map(t,function(t){var e=o;if(!e){if(i&&i.length&&(t=x(t,i)),null==t)return;e=t[n]}return null==e?e:e.apply(t,r)})}),h.pluck=function(t,e){return h.map(t,h.property(e))},h.where=function(t,e){return h.filter(t,h.matcher(e))},h.findWhere=function(t,e){return h.find(t,h.matcher(e))},h.max=function(t,r,e){var n,i,o=-1/0,a=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof t[0]&&null!=t)for(var u=0,l=(t=j(t)?t:h.values(t)).length;u<l;u++)null!=(n=t[u])&&o<n&&(o=n);else r=y(r,e),h.each(t,function(t,e,n){i=r(t,e,n),(a<i||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},h.min=function(t,r,e){var n,i,o=1/0,a=1/0;if(null==r||"number"==typeof r&&"object"!=typeof t[0]&&null!=t)for(var u=0,l=(t=j(t)?t:h.values(t)).length;u<l;u++)null!=(n=t[u])&&n<o&&(o=n);else r=y(r,e),h.each(t,function(t,e,n){((i=r(t,e,n))<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},h.shuffle=function(t){return h.sample(t,1/0)},h.sample=function(t,e,n){if(null==e||n)return j(t)||(t=h.values(t)),t[h.random(t.length-1)];var r=j(t)?h.clone(t):h.values(t),i=_(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var u=h.random(a,o),l=r[a];r[a]=r[u],r[u]=l}return r.slice(0,e)},h.sortBy=function(t,r,e){var i=0;return r=y(r,e),h.pluck(h.map(t,function(t,e,n){return{value:t,index:i++,criteria:r(t,e,n)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(r<n||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};function O(a,e){return function(r,i,t){var o=e?[[],[]]:{};return i=y(i,t),h.each(r,function(t,e){var n=i(t,e,r);a(o,t,n)}),o}}h.groupBy=O(function(t,e,n){b(t,n)?t[n].push(e):t[n]=[e]}),h.indexBy=O(function(t,e,n){t[n]=e}),h.countBy=O(function(t,e,n){b(t,n)?t[n]++:t[n]=1});var k=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;h.toArray=function(t){return t?h.isArray(t)?l.call(t):h.isString(t)?t.match(k):j(t)?h.map(t,h.identity):h.values(t):[]},h.size=function(t){return null==t?0:j(t)?t.length:h.keys(t).length},h.partition=O(function(t,e,n){t[n?0:1].push(e)},!0),h.first=h.head=h.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:h.initial(t,t.length-e)},h.initial=function(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},h.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:h.rest(t,Math.max(0,t.length-e))},h.rest=h.tail=h.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},h.compact=function(t){return h.filter(t,Boolean)};var T=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,a=_(t);o<a;o++){var u=t[o];if(j(u)&&(h.isArray(u)||h.isArguments(u)))if(e)for(var l=0,c=u.length;l<c;)r[i++]=u[l++];else T(u,e,n,r),i=r.length;else n||(r[i++]=u)}return r};h.flatten=function(t,e){return T(t,e,!1)},h.without=g(function(t,e){return h.difference(t,e)}),h.uniq=h.unique=function(t,e,n,r){h.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=y(n,r));for(var i=[],o=[],a=0,u=_(t);a<u;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?h.contains(o,c)||(o.push(c),i.push(l)):h.contains(i,l)||i.push(l)}return i},h.union=g(function(t){return h.uniq(T(t,!0,!0))}),h.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=_(t);r<i;r++){var o=t[r];
2682if(!h.contains(e,o)){var a;for(a=1;a<n&&h.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},h.difference=g(function(t,e){return e=T(e,!0,!0),h.filter(t,function(t){return!h.contains(e,t)})}),h.unzip=function(t){for(var e=t&&h.max(t,_).length||0,n=Array(e),r=0;r<e;r++)n[r]=h.pluck(t,r);return n},h.zip=g(h.unzip),h.object=function(t,e){for(var n={},r=0,i=_(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};function I(o){return function(t,e,n){e=y(e,n);for(var r=_(t),i=0<o?0:r-1;0<=i&&i<r;i+=o)if(e(t[i],i,t))return i;return-1}}h.findIndex=I(1),h.findLastIndex=I(-1),h.sortedIndex=function(t,e,n,r){for(var i=(n=y(n,r,1))(e),o=0,a=_(t);o<a;){var u=Math.floor((o+a)/2);n(t[u])<i?o=u+1:a=u}return o};function S(o,a,u){return function(t,e,n){var r=0,i=_(t);if("number"==typeof n)0<o?r=0<=n?n:Math.max(n+i,r):i=0<=n?Math.min(n+1,i):n+i+1;else if(u&&n&&i)return t[n=u(t,e)]===e?n:-1;if(e!=e)return 0<=(n=a(l.call(t,r,i),h.isNaN))?n+r:-1;for(n=0<o?r:i-1;0<=n&&n<i;n+=o)if(t[n]===e)return n;return-1}}h.indexOf=S(1,h.findIndex,h.sortedIndex),h.lastIndexOf=S(-1,h.findLastIndex),h.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||(e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},h.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(l.call(t,r,r+=e));return n};function F(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=m(t.prototype),a=t.apply(o,i);return h.isObject(a)?a:o}h.bind=g(function(e,n,r){if(!h.isFunction(e))throw new TypeError("Bind must be called on a function");var i=g(function(t){return F(e,i,n,this,r.concat(t))});return i}),h.partial=g(function(i,o){var a=h.partial.placeholder,u=function(){for(var t=0,e=o.length,n=Array(e),r=0;r<e;r++)n[r]=o[r]===a?arguments[t++]:o[r];for(;t<arguments.length;)n.push(arguments[t++]);return F(i,u,this,this,n)};return u}),(h.partial.placeholder=h).bindAll=g(function(t,e){var n=(e=T(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=h.bind(t[r],t)}}),h.memoize=function(r,i){var o=function(t){var e=o.cache,n=""+(i?i.apply(this,arguments):t);return b(e,n)||(e[n]=r.apply(this,arguments)),e[n]};return o.cache={},o},h.delay=g(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),h.defer=h.partial(h.delay,h,1),h.throttle=function(n,r,i){var o,a,u,l,c=0;i=i||{};function s(){c=!1===i.leading?0:h.now(),o=null,l=n.apply(a,u),o||(a=u=null)}function t(){var t=h.now();c||!1!==i.leading||(c=t);var e=r-(t-c);return a=this,u=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),c=t,l=n.apply(a,u),o||(a=u=null)):o||!1===i.trailing||(o=setTimeout(s,e)),l}return t.cancel=function(){clearTimeout(o),c=0,o=a=u=null},t},h.debounce=function(n,r,i){function o(t,e){a=null,e&&(u=n.apply(t,e))}var a,u,t=g(function(t){if(a&&clearTimeout(a),i){var e=!a;a=setTimeout(o,r),e&&(u=n.apply(this,t))}else a=h.delay(o,r,this,t);return u});return t.cancel=function(){clearTimeout(a),a=null},t},h.wrap=function(t,e){return h.partial(e,t)},h.negate=function(t){return function(){return!t.apply(this,arguments)}},h.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},h.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},h.before=function(t,e){var n;return function(){return 0<--t&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},h.once=h.partial(h.before,2),h.restArguments=g;function M(t,e){var n=L.length,r=t.constructor,i=h.isFunction(r)&&r.prototype||a,o="constructor";for(b(t,o)&&!h.contains(e,o)&&e.push(o);n--;)(o=L[n])in t&&t[o]!==i[o]&&!h.contains(e,o)&&e.push(o)}var N=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];h.keys=function(t){if(!h.isObject(t))return[];if(c)return c(t);var e=[];for(var n in t)b(t,n)&&e.push(n);return N&&M(t,e),e},h.allKeys=function(t){if(!h.isObject(t))return[];var e=[];for(var n in t)e.push(n);return N&&M(t,e),e},h.values=function(t){for(var e=h.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},h.mapObject=function(t,e,n){e=y(e,n);for(var r=h.keys(t),i=r.length,o={},a=0;a<i;a++){var u=r[a];o[u]=e(t[u],u,t)}return o},h.pairs=function(t){for(var e=h.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},h.invert=function(t){for(var e={},n=h.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},h.functions=h.methods=function(t){var e=[];for(var n in t)h.isFunction(t[n])&&e.push(n);return e.sort()};function P(l,c){return function(t){var e=arguments.length;if(c&&(t=Object(t)),e<2||null==t)return t;for(var n=1;n<e;n++)for(var r=arguments[n],i=l(r),o=i.length,a=0;a<o;a++){var u=i[a];c&&void 0!==t[u]||(t[u]=r[u])}return t}}h.extend=P(h.allKeys),h.extendOwn=h.assign=P(h.keys),h.findKey=function(t,e,n){e=y(e,n);for(var r,i=h.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r};function q(t,e,n){return e in n}var R,C;h.pick=g(function(t,e){var n={},r=e[0];if(null==t)return n;
2682h.isFunction(r)?(1<e.length&&(r=d(r,e[1])),e=h.allKeys(t)):(r=q,e=T(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],u=t[a];r(u,a,t)&&(n[a]=u)}return n}),h.omit=g(function(t,n){var e,r=n[0];return h.isFunction(r)?(r=h.negate(r),1<n.length&&(e=n[1])):(n=h.map(T(n,!1,!1),String),r=function(t,e){return!h.contains(n,e)}),h.pick(t,r,e)}),h.defaults=P(h.allKeys,!0),h.create=function(t,e){var n=m(t);return e&&h.extendOwn(n,e),n},h.clone=function(t){return h.isObject(t)?h.isArray(t)?t.slice():h.extend({},t):t},h.tap=function(t,e){return e(t),t},h.isMatch=function(t,e){var n=h.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0},R=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"==i||"object"==i||"object"==typeof e)&&C(t,e,n,r)},C=function(t,e,n,r){t instanceof h&&(t=t._wrapped),e instanceof h&&(e=e._wrapped);var i=p.call(t);if(i!==p.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return f.valueOf.call(t)===f.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,u=e.constructor;if(a!==u&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!R(t[l],e[l],n,r))return!1}else{var c,s=h.keys(t);if(l=s.length,h.keys(e).length!==l)return!1;for(;l--;)if(c=s[l],!b(e,c)||!R(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},h.isEqual=function(t,e){return R(t,e)},h.isEmpty=function(t){return null==t||(j(t)&&(h.isArray(t)||h.isString(t)||h.isArguments(t))?0===t.length:0===h.keys(t).length)},h.isElement=function(t){return!(!t||1!==t.nodeType)},h.isArray=u||function(t){return"[object Array]"===p.call(t)},h.isObject=function(t){var e=typeof t;return"function"==e||"object"==e&&!!t},h.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){h["is"+e]=function(t){return p.call(t)==="[object "+e+"]"}}),h.isArguments(arguments)||(h.isArguments=function(t){return b(t,"callee")});var B=t.document&&t.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof B&&(h.isFunction=function(t){return"function"==typeof t||!1}),h.isFinite=function(t){return!h.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},h.isNaN=function(t){return h.isNumber(t)&&isNaN(t)},h.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===p.call(t)},h.isNull=function(t){return null===t},h.isUndefined=function(t){return void 0===t},h.has=function(t,e){if(!h.isArray(e))return b(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!o.call(t,i))return!1;t=t[i]}return!!n},h.noConflict=function(){return t._=e,this},h.identity=function(t){return t},h.constant=function(t){return function(){return t}},h.noop=function(){},h.property=function(e){return h.isArray(e)?function(t){return x(t,e)}:w(e)},h.propertyOf=function(e){return null==e?function(){}:function(t){return h.isArray(t)?x(e,t):e[t]}},h.matcher=h.matches=function(e){return e=h.extendOwn({},e),function(t){return h.isMatch(t,e)}},h.times=function(t,e,n){var r=Array(Math.max(0,t));e=d(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},h.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},h.now=Date.now||function(){return(new Date).getTime()};function W(e){function n(t){return e[t]}var t="(?:"+h.keys(e).join("|")+")",r=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,n):t}}var D={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$=h.invert(D);h.escape=W(D),h.unescape=W($),h.result=function(t,e,n){h.isArray(e)||(e=[e]);var r=e.length;if(!r)return h.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=h.isFunction(o)?o.call(t):o}return t};var U=0;h.uniqueId=function(t){var e=++U+"";return t?t+e:e},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function z(t){return"\\"+G[t]}var Q=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g;h.template=function(o,t,e){!t&&e&&(t=e),t=h.defaults({},t,h.templateSettings);var n,r=RegExp([(t.escape||Q).source,(t.interpolate||Q).source,(t.evaluate||Q).source].join("|")+"|$","g"),a=0,u="__p+='";o.replace(r,function(t,e,n,r,i){return u+=o.slice(a,i).replace(H,z),a=i+t.length,e?u+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":n?u+="'+\n((__t=("+n+"))==null?'':__t)+\n'":r&&(u+="';\n"+r+"\n__p+='"),t}),u+="';\n",t.variable||(u="with(obj||{}){\n"+u+"}\n"),u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{n=new Function(t.variable||"obj","_",u)}catch(t){throw t.source=u,t}function i(t){return n.call(this,t,h)}var l=t.variable||"obj";return i.source="function("+l+"){\n"+u+"}",i},h.chain=function(t){var e=h(t);return e._chain=!0,e};function K(t,e){return t._chain?h(e).chain():e}h.mixin=function(n){return h.each(h.functions(n),function(t){var e=h[t]=n[t];h.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),K(this,e.apply(h,t))}}),h},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var n=r[e];h.prototype[e]=function(){var t=this._wrapped;return n.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],K(this,t)}}),h.each(["concat","join","slice"],function(t){var e=r[t];h.prototype[t]=function(){return K(this,e.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},h.prototype.valueOf=h.prototype.toJSON=h.prototype.value,h.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}(),function(){var t,n;Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");function e(){}function n(){return i.apply(this instanceof e&&t?this:t,r.concat(Array.prototype.slice.call(arguments)))}
2682var r=Array.prototype.slice.call(arguments,1),i=this;return e.prototype=this.prototype,n.prototype=new e,n});var i={DEBUG:10,INFO:20,WARN:30,ERROR:40,FATAL:50};function e(){}function r(){}function o(t,e){this._loggers={},this.name=t||"",this._parent=e||null,e||(this._enabled=!0,this._level=i.WARN)}function a(t){n=t}e.prototype={output:function(t,e,n){if(void 0!==window.console&&void 0!==console.log){t&&n.unshift(t+":");var r=n.join(" ");console.info,e<=i.DEBUG?(r="[DEBUG] "+r,console.log(r)):e<=i.INFO?console.info(r):e<=i.WARN?console.warn(r):console.error(r)}}},r.prototype={output:function(t,e,n){t&&n.unshift(t+":"),e<=i.DEBUG?(n.unshift("[DEBUG]"),console.log.apply(console,n)):e<=i.INFO?console.info.apply(console,n):e<=i.WARN?console.warn.apply(console,n):console.error.apply(console,n)}},o.prototype={getLogger:function(t){for(var e=t.split("."),n=this,r=this.name?[this.name]:[];e.length;){var i=e.shift();r.push(i),i in n._loggers||(n._loggers[i]=new o(r.join("."),n)),n=n._loggers[i]}return n},_getFlag:function(t){var e=this;for(t="_"+t;null!==e;){if(void 0!==e[t])return e[t];e=e._parent}return null},setEnabled:function(t){this._enabled=!!t},isEnabled:function(){this._getFlag("enabled")},setLevel:function(t){"number"==typeof t?this._level=t:"string"==typeof t&&(t=t.toUpperCase())in i&&(this._level=i[t])},getLevel:function(){return this._getFlag("level")},log:function(t,e){!e.length||!this._getFlag("enabled")||t<this._getFlag("level")||(e=Array.prototype.slice.call(e),n.output(this.name,t,e))},debug:function(){this.log(i.DEBUG,arguments)},info:function(){this.log(i.INFO,arguments)},warn:function(){this.log(i.WARN,arguments)},error:function(){this.log(i.ERROR,arguments)},fatal:function(){this.log(i.FATAL,arguments)}},window.console&&window.console.log&&"function"==typeof window.console.log.apply?a(new r):a(new e),t=new o;for(var u,l=/loglevel(|-[^=]+)=([^&]+)/g;null!==(u=l.exec(window.location.search));){(""===u[1]?t:t.getLogger(u[1].slice(1))).setLevel(u[2].toUpperCase())}var c={Level:i,getLogger:t.getLogger.bind(t),setEnabled:t.setEnabled.bind(t),isEnabled:t.isEnabled.bind(t),setLevel:t.setLevel.bind(t),getLevel:t.getLevel.bind(t),debug:t.debug.bind(t),info:t.info.bind(t),warn:t.warn.bind(t),error:t.error.bind(t),fatal:t.fatal.bind(t),getWriter:function(){return n},setWriter:a};"function"==typeof define?define("logging",[],function(){return c}):window.logging=c}(),define("pat-logger",["logging"],function(t){return t.getLogger("patterns")}),function(e){"function"==typeof define&&define.amd?define("jquery.browser",["jquery"],function(t){return e(t)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(window.jQuery)}(function(t){"use strict";function e(t){void 0===t&&(t=window.navigator.userAgent),t=t.toLowerCase();var e=/(edge)\/([\w.]+)/.exec(t)||/(opr)[\/]([\w.]+)/.exec(t)||/(chrome)[ \/]([\w.]+)/.exec(t)||/(iemobile)[\/]([\w.]+)/.exec(t)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||0<=t.indexOf("trident")&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[],n=/(ipad)/.exec(t)||/(ipod)/.exec(t)||/(windows phone)/.exec(t)||/(iphone)/.exec(t)||/(kindle)/.exec(t)||/(silk)/.exec(t)||/(android)/.exec(t)||/(win)/.exec(t)||/(mac)/.exec(t)||/(linux)/.exec(t)||/(cros)/.exec(t)||/(playbook)/.exec(t)||/(bb)/.exec(t)||/(blackberry)/.exec(t)||[],r={},i={browser:e[5]||e[3]||e[1]||"",version:e[2]||e[4]||"0",versionNumber:e[4]||e[2]||"0",platform:n[0]||""};if(i.browser&&(r[i.browser]=!0,r.version=i.version,r.versionNumber=parseInt(i.versionNumber,10)),i.platform&&(r[i.platform]=!0),(r.android||r.bb||r.blackberry||r.ipad||r.iphone||r.ipod||r.kindle||r.playbook||r.silk||r["windows phone"])&&(r.mobile=!0),(r.cros||r.mac||r.linux||r.win)&&(r.desktop=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){i.browser="msie",r.msie=!0}if(r.edge){delete r.edge;i.browser="msedge",r.msedge=!0}if(r.safari&&r.blackberry){var o="blackberry";r[i.browser=o]=!0}if(r.safari&&r.playbook){var a="playbook";r[i.browser=a]=!0}if(r.bb){var u="blackberry";r[i.browser=u]=!0}if(r.opr){i.browser="opera",r.opera=!0}if(r.safari&&r.android){var l="android";r[i.browser=l]=!0}if(r.safari&&r.kindle){i.browser="kindle",r.kindle=!0}if(r.safari&&r.silk){i.browser="silk",r.silk=!0}return r.name=i.browser,r.platform=i.platform,r}return window.jQBrowser=e(window.navigator.userAgent),window.jQBrowser.uaMatch=e,t&&(t.browser=window.jQBrowser),window.jQBrowser}),define("pat-utils",["jquery","underscore","jquery.browser"],function(o,a){o.fn.safeClone=function(){var t=this.clone();return void 0!==o.browser.msie&&t.findInclusive(":input[placeholder]").each(function(t,e){var n=o(e);n.attr("placeholder")===n.val()&&n.val("")}
2682),t},Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var n,r;if(null===this)throw new TypeError(" this is null or not defined");var i=Object(this),o=i.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1<arguments.length&&(n=e),r=0;r<o;){var a;r in i&&(a=i[r],t.call(n,a,r,i)),r++}});function u(t){var e=typeof t;return"function"==e||"object"==e&&!!t}var l={none:{hide:"hide",show:"show"},fade:{hide:"fadeOut",show:"fadeIn"},slide:{hide:"slideUp",show:"slideDown"}};return isElementInViewport=function(t,e,n){if(t===[])return!1;t instanceof o&&(t=t[0]);var r=t.getBoundingClientRect(),i=[r.top,r.bottom,r.left,r.right];return!a.every(i,function(t){if(0===t)return!0})&&(e?(void 0===n&&(n=0),r.top<=0+n&&r.bottom>=0+n):0<=r.top&&0<=r.left&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth))},{jqueryPlugin:function(n){return function(t,e){return 0===this.length?this:("object"==typeof t&&(e=t,t=void 0),"function"==typeof n?function(n,r,i){return this.each(function(){var t,e=o(this);if(t=n.init(e,i),r){if(void 0===t[r])return o.error("Method "+r+" does not exist on jQuery."+n.name),!1;if("_"===r.charAt(0))return o.error("Method "+r+" is private on jQuery."+n.name),!1;t[r].apply(t,[i])}}),this}.call(this,n,t,e):function(t,e,n){var r=this;if(e){if(t[e])return t[e].apply(r,[r].concat([n]));o.error("Method "+e+" does not exist on jQuery."+t.name)}else t.init.apply(r,[r].concat([n]));return r}.call(this,n,t,e))}},debounce:function(n,r){var i;return function(){var t=this,e=arguments;clearTimeout(i),i=setTimeout(function(){i=null,n.apply(t,e)},r)}},escapeRegExp:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isObject:u,extend:function(t){if(!u(t))return t;for(var e,n,r=1,i=arguments.length;r<i;r++)for(n in e=arguments[r])hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},rebaseURL:function(t,e){return-1!==e.indexOf("://")||"/"===e[0]?e:t.slice(0,t.lastIndexOf("/")+1)+e},findLabel:function(t){for(var e,n=t.parentNode;n&&11!==n.nodeType;n=n.parentNode)if("LABEL"===n.tagName)return n;return t.id&&(e=o('label[for="'+t.id+'"]')),e&&0===e.length&&t.form&&(e=o('label[for="'+t.name+'"]',t.form)),e&&e.length?e[0]:null},elementInViewport:function(t){var e=t.getBoundingClientRect(),n=document.documentElement,r=window.innerWidth||n.clientWidth,i=window.innerHeight||n.clientHeight;return!(e.right<0||e.bottom<0||e.left>r||e.top>i)},removeWildcardClass:function(t,e){if(-1===e.indexOf("*"))t.removeClass(e);else{var i=e.replace(/[\-\[\]{}()+?.,\\\^$|#\s]/g,"\\$&");i=i.replace(/[*]/g,".*"),i=new RegExp("^"+i+"$"),t.filter("[class]").each(function(){for(var t=o(this),e=t.attr("class").split(/\s+/),n=[],r=0;r<e.length;r++)i.test(e[r])||n.push(e[r]);n.length?t.attr("class",n.join(" ")):t.removeAttr("class")})}},hideOrShow:function(t,e,n,r){var i="css"===n.transition||"none"===n.transition?null:n.effect.duration;function o(){t.removeClass("in-progress").addClass(e?"visible":"hidden").trigger("pat-update",{pattern:r,transition:"complete"})}if(t.removeClass("visible hidden in-progress"),i){var a=l[n.transition];t.addClass("in-progress").trigger("pat-update",{pattern:r,transition:"start"}),t[e?a.show:a.hide]({duration:i,easing:n.effect.easing,complete:o})}else"css"!==n.transition&&t[e?"show":"hide"](),o()},addURLQueryParameter:function(t,e,n){var r=new RegExp("(\\?|\\&)"+e+"=.*?(?=(&|$))"),i=t.toString().split("#"),o=i[0],a=i[1],u=o;return u=r.test(o)?o.replace(r,"$1"+e+"="+n):/\?.+$/.test(o)?o+"&"+e+"="+n:o+"?"+e+"="+n,a&&(u+="#"+a),u},removeDuplicateObjects:function(t){return a.reduce(t,function(t,e){var n=!1;return a.each(t,function(t){n=a.keys(t).length===a.keys(e).length&&!a.chain(t).omit(function(t,e){return this[e]===t}.bind(e)).keys().value().length}),n||t.push(e),t},[])},mergeStack:function(t,r){for(var i=[],e=0;e<r;e++)i.push({});return a.each(t,function(t){for(var e=t.length-1,n=0;n<r;n++)i[n]=o.extend(i[n]||{},t[e<n?e:n])}),i},isElementInViewport:isElementInViewport}}),define("pat-compat",[],function(){var i,o,a,u;Array.prototype.every||(Array.prototype.every=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var r=arguments[1],i=0;i<n;i++)if(i in e&&!t.call(r,e[i],i,e))return!1;return!0}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var r=[],i=arguments[1],o=0;o<n;o++)if(o in e){var a=e[o];t.call(i,a,o,e)&&r.push(a)}return r}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var n,r;if(null===this)throw new TypeError(" this is null or not defined");var i=Object(this),o=i.length>>>0;if("[object Function]"!=={}.toString.call(t))throw new TypeError(t+" is not a function");for(e&&(n=e),r=0;r<o;){var a;r in i&&(a=i[r],t.call(n,a,r,i)),r++}}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if(0==n)return-1;var r=0;if(0<arguments.length&&((r=Number(arguments[1]))!=r?r=0:0!==r&&r!==1/0&&r!==-1/0&&(r=(0<r||-1)*Math.floor(Math.abs(r)))),n<=r)return-1;for(var i=0<=r?r:Math.max(n-Math.abs(r),0);i<n;i++)if(i in e&&e[i]===t)return i;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if(0==n)return-1;var r=n;1<arguments.length&&((r=Number(arguments[1]))!=r?r=0:0!==r&&r!==1/0&&r!==-1/0&&(r=(0<r||-1)*Math.floor(Math.abs(r))));for(var i=0<=r?Math.min(r,n-1):n-Math.abs(r);0<=i;i--)if(i in e&&e[i]===t)return i;return-1}),Array.prototype.map||(Array.prototype.map=function(t,e){var n,r,i;if(null===this)throw new TypeError(" this is null or not defined");var o=Object(this),a=o.length>>>0;if("[object Function]"!=={}.toString.call(t))throw new TypeError(t+" is not a function");for(e&&(n=e),r=new Array(a),i=0;i<a;){var u,l;i in o&&(u=o[i],l=t.call(n,u,i,o),r[i]=l),i++}
2682return r}),Array.prototype.reduce||(Array.prototype.reduce=function(t,e){if(null==this)throw new TypeError("Object is null or undefined");var n,r=0,i=this.length>>0;if("function"!=typeof t)throw new TypeError("First argument is not callable");if(arguments.length<2){if(0==i)throw new TypeError("Array length is 0 and no second argument");n=this[0],r=1}else n=e;for(;r<i;)r in this&&(n=t.call(void 0,n,this[r],r,this)),++r;return n}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;if(0==n&&1===arguments.length)throw new TypeError;var r,i=n-1;if(2<=arguments.length)r=arguments[1];else for(;;){if(i in this){r=this[i--];break}if(--i<0)throw new TypeError}for(;0<=i;)i in e&&(r=t.call(void 0,r,e[i],i,e)),i--;return r}),Array.prototype.some||(Array.prototype.some=function(t){"use strict";if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var r=arguments[1],i=0;i<n;i++)if(i in e&&t.call(r,e[i],i,e))return!0;return!1}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");function e(){}function n(){return i.apply(this instanceof e&&t?this:t,r.concat(Array.prototype.slice.call(arguments)))}var r=Array.prototype.slice.call(arguments,1),i=this;return e.prototype=this.prototype,n.prototype=new e,n}),Object.keys||(Object.keys=(i=Object.prototype.hasOwnProperty,o=!{toString:null}.propertyIsEnumerable("toString"),u=(a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(t){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError("Object.keys called on non-object");var e=[];for(var n in t)i.call(t,n)&&e.push(n);if(o)for(var r=0;r<u;r++)i.call(t,a[r])&&e.push(a[r]);return e}))}),define("pat-jquery-ext",["jquery"],function(s){var r={init:function(e){var n={time:3,initialTime:8,exceptionAreas:[]};return this.each(function(){var t=s(this);t.data("timeout")||(e&&s.extend(n,e),t.data("timeout",{lastEvent:new Date,trueTime:n.time,time:n.initialTime,untouched:!0,inExceptionArea:!1}),t.bind("mouseover.timeout",r.mouseMoved),t.bind("mouseenter.timeout",r.mouseMoved),s(n.exceptionAreas).each(function(){t.find(this).live("mouseover.timeout",{parent:t},r.enteredException).live("mouseleave.timeout",{parent:t},r.leftException)}),0<n.initialTime?t.timeout("startTimer"):t.addClass("timeout"))})},enteredException:function(t){var e=t.data.parent.data("timeout");e.inExceptionArea=!0,t.data.parent.data("timeout",e),t.data.parent.trigger("mouseover")},leftException:function(t){var e=t.data.parent.data("timeout");e.inExceptionArea=!1,t.data.parent.data("timeout",e)},destroy:function(){return this.each(function(){var t=s(this),e=t.data("timeout");s(window).unbind(".timeout"),e.timeout.remove(),t.removeData("timeout")})},mouseMoved:function(){var t=s(this),e=t.data("timeout");t.hasClass("timeout")?(t.removeClass("timeout"),t.timeout("startTimer")):e.untouched&&(e.untouched=!1,e.time=e.trueTime),e.lastEvent=new Date,t.data("timeout",e)},startTimer:function(){var r=s(this),t=r.data("timeout"),i=function(){var t=r.data("timeout");if(t&&t.lastEvent)if(t.inExceptionArea)setTimeout(i,Math.floor(1e3*t.time));else{var e=new Date,n=Math.floor(1e3*t.time)-(e-t.lastEvent);0<n?setTimeout(i,100+n):r.addClass("timeout")}};setTimeout(i,Math.floor(1e3*t.time))}};s.fn.timeout=function(t){return r[t]?r[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void s.error("Method "+t+" does not exist on jQuery.timeout"):r.init.apply(this,arguments)},s.extend(s.expr[":"],{scrollable:function(t){return"scroll"===s(t).css("overflow")||"scroll"===s(t).css("overflowX")||"scroll"===s(t).css("overflowY")||(t.clientHeight<t.scrollHeight&&(-1!==s.inArray(s(t).css("overflowY"),["scroll","auto"])||-1!==s.inArray(s(t).css("overflow"),["scroll","auto"]))||t.clientWidth<t.scrollWidth&&(-1!==s.inArray(s(t).css("overflowX"),["scroll","auto"])||-1!==s.inArray(s(t).css("overflow"),["scroll","auto"])))}}),s.fn.makeVisibleInScroll=function(t){var a=null;return"string"==typeof t?a=s("#"+t):t&&(a=s(t)),this.each(function(){var t,e=s(this);t=a||(0<(t=e.parents(":scrollable")).length?s(t[0]):s(window));var n=e.position().top,r=e.height()+n,i=t.scrollTop(),o=t.height()+i;n<i?t.scrollTop(n):r>o-t.height()/2&&t.scrollTop(n-(t.height()-e.height())/2)})},s.fn.setPositionAbsolute=function(u,l,c){return this.each(function(){var t=s(this),e=s(this).width(),n=u.offset(),r=u.width(),i=u.height(),o=n.left+r-e+c,a=n.top+i+l;t.css({"z-index":1,position:"absolute",marginLeft:0,marginTop:0,left:o+"px",top:a+"px",width:e}),t.remove().appendTo("body").show()})},s.fn.positionAncestor=function(a){var u=0,l=0;return this.each(function(){var t=s(this).closest(a);if(t.length&&"static"!==t.css("position")){var e=s(this),n=e.offset().left-parseInt(e.css("marginLeft"),10),r=e.offset().top-parseInt(e.css("marginTop"),10),i=t.offset().left+parseInt(t.css("borderLeftWidth"),10),o=t.offset().top+parseInt(t.css("borderTopWidth"),
268210);return u=n-i,l=r-o,!1}}),{left:u,top:l}},String.prototype.startsWith=function(t){return null!==this.match("^"+t)},String.prototype.endsWith=function(t){return null!==this.match(t+"$")},s.simplePlaceholder={placeholder_class:null,hide_placeholder:function(){var t=s(this);t.val()===t.attr("placeholder")&&t.val("").removeClass(s.simplePlaceholder.placeholder_class)},show_placeholder:function(){var t=s(this);""===t.val()&&t.val(t.attr("placeholder")).addClass(s.simplePlaceholder.placeholder_class)},prevent_placeholder_submit:function(){return s(this).find(".simple-placeholder").each(function(){var t=s(this);t.val()===t.attr("placeholder")&&t.val("")}),!0}},s.fn.simplePlaceholder=function(t){if(void 0===document.createElement("input").placeholder){var e={placeholder_class:"placeholding"};t&&s.extend(e,t),s.simplePlaceholder.placeholder_class=e.placeholder_class,this.each(function(){var t=s(this);t.focus(s.simplePlaceholder.hide_placeholder),t.blur(s.simplePlaceholder.show_placeholder),""===t.val()&&(t.val(t.attr("placeholder")),t.addClass(s.simplePlaceholder.placeholder_class)),t.addClass("simple-placeholder"),s(this.form).submit(s.simplePlaceholder.prevent_placeholder_submit)})}return this},s.fn.findInclusive=function(t){return this.find("*").addBack().filter(t)},s.fn.slideIn=function(t,e,n){return this.animate({width:"show"},t,e,n)},s.fn.slideOut=function(t,e,n){return this.animate({width:"hide"},t,e,n)},s.expr[":"].Contains=function(t,e,n){return 0<=s(t).text().toUpperCase().indexOf(n[3].toUpperCase())},s.fn.scopedFind=function(t){return t.startsWith("#")?s(t):this.find(t)}}),define("pat-registry",["jquery","underscore","pat-logger","pat-utils","pat-compat","pat-jquery-ext"],function(o,a,u,r){for(var t,i=u.getLogger("registry"),e=/patterns-disable=([^&]+)/g,n=/patterns-dont-catch/g,l=!1,c={};null!==(t=e.exec(window.location.search));)c[t[1]]=!0,i.info("Pattern disabled via url config:",t[1]);for(;null!==(t=n.exec(window.location.search));)l=!0,i.info("I will not catch init exceptions");var s={patterns:{},initialized:!1,init:function(){o(document).ready(function(){i.info("loaded: "+Object.keys(s.patterns).sort().join(", ")),s.scan(document.body),s.initialized=!0,i.info("finished initial scan.")})},clear:function(){this.patterns={}},transformPattern:function(e,t){if(c[e])i.debug("Skipping disabled pattern:",e);else{var n=s.patterns[e];if(n.transform)try{n.transform(o(t))}catch(t){if(l)throw t;i.error("Transform error for pattern"+e,t)}}},initPattern:function(t,e,n){var r=o(e),i=s.patterns[t];if(i.init&&(plog=u.getLogger("pat."+t),r.is(i.trigger))){plog.debug("Initialising:",r);try{i.init(r,null,n),plog.debug("done.")}catch(t){if(l)throw t;plog.error("Caught error:",t)}}},orderPatterns:function(t){return a.contains(t,"validation")&&a.contains(t,"inject")&&(t.splice(t.indexOf("validation"),1),t.unshift("validation")),t},scan:function(t,n,r){var i=[];(n=this.orderPatterns(n||Object.keys(s.patterns))).forEach(a.partial(this.transformPattern,a,t)),n=a.each(n,function(t){var e=s.patterns[t];e.trigger&&i.unshift(e.trigger)}),o(t).findInclusive(i.join(",")).filter(function(){return 0===o(this).parents("pre").length}).filter(":not(.cant-touch-this)").toArray().reduceRight(function(t,e){n.forEach(a.partial(this.initPattern,a,e,r))}.bind(this),null),o("body").addClass("patterns-loaded")},register:function(t,e){var n;return(e=e||t.name)?s.patterns[e]?(i.error("Already have a pattern called: "+e),!1):((s.patterns[e]=t).jquery_plugin&&(n=("pat-"+e).replace(/-([a-zA-Z])/g,function(t,e){return e.toUpperCase()}),o.fn[n]=r.jqueryPlugin(t),o.fn[n.replace(/^pat/,"pattern")]=o.fn[n]),i.debug("Registered pattern:",e,t),s.initialized&&s.scan(document.body,[e]),!0):(i.error("Pattern lacks a name:",t),!1)}};return s}),define("pat-mockup-parser",["jquery"],function(a){"use strict";return{getOptions:function t(e,n,r){r=r||{},0===e.length||a.nodeName(e[0],"body")||(r=t(e.parent(),n,r));var i={};if(0!==e.length&&(i=e.data("pat-"+n))&&"string"==typeof i){var o={};a.each(i.split(";"),function(t,e){(e=e.split(":")).reverse();var n=e.pop();n=n.replace(/^\s+|\s+$/g,""),e.reverse();var r=e.join(":");r=r.replace(/^\s+|\s+$/g,""),o[n]=r}),i=o}return a.extend(!0,{},r,i)}}}),define("pat-base",["jquery","pat-registry","pat-mockup-parser","pat-logger"],function(i,a,u,l){"use strict";function o(t,e,n){var r=this.prototype.name,i=l.getLogger("pat."+r),o=t.data("pattern-"+r);if(void 0===o&&a.patterns[r]){try{e="mockup"===this.prototype.parser?u.getOptions(t,r,e):e,o=new a.patterns[r](t,e,n)}catch(t){i.error("Failed while initializing '"+r+"' pattern.",t)}t.data("pattern-"+r,o)}return o}function c(t,e,n){this.$el=t,this.options=i.extend(!0,{},this.defaults||{},e||{}
2682),this.init(t,e,n),this.emit("init")}var s=l.getLogger("Patternslib Base");return c.prototype={constructor:c,on:function(t,e){this.$el.on(t+"."+this.name+".patterns",e)},emit:function(t,e){void 0===e&&(e=[]),this.$el.trigger(t+"."+this.name+".patterns",e)}},c.extend=function(t){var e,n=this;if(!t)throw new Error("Pattern configuration properties required when calling Base.extend");(e=t.hasOwnProperty("constructor")?t.constructor:function(){n.apply(this,arguments)}).extend=c.extend,e.init=o,e.jquery_plugin=!0,e.trigger=t.trigger;function r(){this.constructor=e}return r.prototype=n.prototype,e.prototype=new r,i.extend(!0,e.prototype,t),e.__super__=n.prototype,t.name?t.trigger?a.register(e,t.name):s.warn("The pattern '"+t.name+"' does not have a trigger attribute, it will not be registered."):s.warn("This pattern without a name attribute will not be registered!"),e},c}),window.jQuery&&define("jquery",[],function(){"use strict";return window.jQuery.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),window.jQuery}),require(["jquery","pat-registry","pat-base","pat-logger","pat-mockup-parser"],function(i,t){"use strict";window.parent!==window&&"IFRAME"!==window.frameElement.nodeName||i(document).ready(function(){i("body").addClass("pat-plone"),t.initialized||t.init()}),i(document).ready(function(){!0!=("selected"===i("#form-widgets-use_cookie_negotiation > input").value)?i("#formfield-form-widgets-authenticated_users_only").hide():i("#formfield-form-widgets-authenticated_users_only").show()}),i(document).ready(function(){function t(t){var e=i("#form-widgets-highpixeldensity_scales option:selected").attr("value"),n=i('div[data-fieldname="form.widgets.quality_2x"]'),r=i('div[data-fieldname="form.widgets.quality_3x"]');"disabled"==e?(n.fadeOut(),r.fadeOut()):"2x"==e?(n.fadeIn(),r.fadeOut()):"3x"==e&&(n.fadeIn(),r.fadeIn())}i("#ImagingSettings")&&(i('div[data-fieldname="form.widgets.quality_2x"]').hide(),i('div[data-fieldname="form.widgets.quality_3x"]').hide(),t(),i("#form-widgets-highpixeldensity_scales").change(t))})}),define("/home/_thet/data/dev/plone/buildout.coredev/src/plone.staticresources/src/plone/staticresources/static/plone-base.js",function(){}); 2683//# sourceMappingURL=plone-base-compiled.min.js.map 2684!function(n){"use strict";"function"==typeof define&&define.amd?define("datatables.net",["jquery"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e=e||("undefined"!=typeof window?require("jquery"):require("jquery")(t)),n(e,t,t.document)}:n(jQuery,window,document)}(function(z,D,y,U){"use strict";function r(t){return!t||!0===t||"-"===t}function h(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null}function a(t,e){return n[e]||(n[e]=new RegExp(Ct(e),"g")),"string"==typeof t&&"."!==e?t.replace(/\./g,"").replace(n[e],"."):t}function o(t,e,n){var o="string"==typeof t;return!!r(t)||(e&&o&&(t=a(t,e)),n&&o&&(t=t.replace(u,"")),!isNaN(parseFloat(t))&&isFinite(t))}function l(t,e,n){return!!r(t)||(function(t){return r(t)||"string"==typeof t}(t)&&!!o(f(t),e,n)||null)}function m(t,e,n,o){var r=[],a=0,l=e.length;if(o!==U)for(;a<l;a++)t[e[a]][n]&&r.push(t[e[a]][n][o]);else for(;a<l;a++)r.push(t[e[a]][n]);return r}function p(t,e){var n,o=[];e===U?(e=0,n=t):(n=e,e=t);for(var r=e;r<n;r++)o.push(r);return o}function g(t){for(var e=[],n=0,o=t.length;n<o;n++)t[n]&&e.push(t[n]);return e}var b,v,e,t,S=function(C){this.$=function(t,e){return this.api(!0).$(t,e)},this._=function(t,e){return this.api(!0).rows(t,e).data()},this.api=function(t){return new v(t?ae(this[b.iApiIndex]):this)},this.fnAddData=function(t,e){var n=this.api(!0),o=z.isArray(t)&&(z.isArray(t[0])||z.isPlainObject(t[0]))?n.rows.add(t):n.row.add(t);return e!==U&&!e||n.draw(),o.flatten().toArray()},this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),n=e.settings()[0],o=n.oScroll;t===U||t?e.draw(!1):""===o.sX&&""===o.sY||Mt(n)},this.fnClearTable=function(t){var e=this.api(!0).clear();t!==U&&!t||e.draw()},this.fnClose=function(t){this.api(!0).row(t).child.hide()},this.fnDeleteRow=function(t,e,n){var o=this.api(!0),r=o.rows(t),a=r.settings()[0],l=a.aoData[r[0][0]];return r.remove(),e&&e.call(this,a,l),n!==U&&!n||o.draw(),l},this.fnDestroy=function(t){this.api(!0).destroy(t)},this.fnDraw=function(t){this.api(!0).draw(t)},this.fnFilter=function(t,e,n,o,r,a){var l=this.api(!0);null===e||e===U?l.search(t,n,o,a):l.column(e).search(t,n,o,a),l.draw()},this.fnGetData=function(t,e){var n=this.api(!0);if(t===U)return n.data().toArray();var o=t.nodeName?t.nodeName.toLowerCase():"";return e!==U||"td"==o||"th"==o?n.cell(t,e).data():n.row(t).data()||null},this.fnGetNodes=function(t){var e=this.api(!0);return t!==U?e.row(t).node():e.rows().nodes().flatten().toArray()},this.fnGetPosition=function(t){var e=this.api(!0),n=t.nodeName.toUpperCase();if("TR"==n)return e.row(t).index();if("TD"!=n&&"TH"!=n)return null;var o=e.cell(t).index();return[o.row,o.columnVisible,o.column]},this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()},this.fnOpen=function(t,e,n){return this.api(!0).row(t).child(e,n).show().child()[0]},this.fnPageChange=function(t,e){var n=this.api(!0).page(t);e!==U&&!e||n.draw(!1)}
vendor: 30,112 bytes, line 2684
2684,this.fnSetColumnVis=function(t,e,n){var o=this.api(!0).column(t).visible(e);n!==U&&!n||o.columns.adjust().draw()},this.fnSettings=function(){return ae(this[b.iApiIndex])},this.fnSort=function(t){this.api(!0).order(t).draw()},this.fnSortListener=function(t,e,n){this.api(!0).order.listener(t,e,n)},this.fnUpdate=function(t,e,n,o,r){var a=this.api(!0);return n===U||null===n?a.row(e).data(t):a.cell(e,n).data(t),r!==U&&!r||a.columns.adjust(),o!==U&&!o||a.draw(),0},this.fnVersionCheck=b.fnVersionCheck;var _=this,T=C===U,F=this.length;for(var t in T&&(C={}),this.oApi=this.internal=b.internal,S.ext.internal)t&&(this[t]=Le(t));return this.each(function(){var a,l=1<F?se({},C,!0):C,i=0,t=this.getAttribute("id"),s=!1,e=S.defaults,d=z(this);if("table"==this.nodeName.toLowerCase()){B(e),k(e.column),A(e,e,!0),A(e.column,e.column,!0),A(e,z.extend(l,d.data()));var n=S.settings;for(i=0,a=n.length;i<a;i++){var o=n[i];if(o.nTable==this||o.nTHead.parentNode==this||o.nTFoot&&o.nTFoot.parentNode==this){var r=l.bRetrieve!==U?l.bRetrieve:e.bRetrieve,c=l.bDestroy!==U?l.bDestroy:e.bDestroy;if(T||r)return o.oInstance;if(c){o.oInstance.fnDestroy();break}return void le(o,0,"Cannot reinitialise DataTable",3)}if(o.sTableId==this.id){n.splice(i,1);break}}null!==t&&""!==t||(t="DataTables_Table_"+S.ext._unique++,this.id=t);var u=z.extend(!0,{},S.models.oSettings,{sDestroyWidth:d[0].style.width,sInstance:t,sTableId:t});u.nTable=this,u.oApi=_.internal,u.oInit=l,n.push(u),u.oInstance=1===_.length?_:d.dataTable(),B(l),l.oLanguage&&R(l.oLanguage),l.aLengthMenu&&!l.iDisplayLength&&(l.iDisplayLength=z.isArray(l.aLengthMenu[0])?l.aLengthMenu[0][0]:l.aLengthMenu[0]),l=se(z.extend(!0,{},e),l),ie(u.oFeatures,l,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),ie(u,l,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),ie(u.oScroll,l,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),ie(u.oLanguage,l,"fnInfoCallback"),ce(u,"aoDrawCallback",l.fnDrawCallback,"user"),ce(u,"aoServerParams",l.fnServerParams,"user"),ce(u,"aoStateSaveParams",l.fnStateSaveParams,"user"),ce(u,"aoStateLoadParams",l.fnStateLoadParams,"user"),ce(u,"aoStateLoaded",l.fnStateLoaded,"user"),ce(u,"aoRowCallback",l.fnRowCallback,"user"),ce(u,"aoRowCreatedCallback",l.fnCreatedRow,"user"),ce(u,"aoHeaderCallback",l.fnHeaderCallback,"user"),ce(u,"aoFooterCallback",l.fnFooterCallback,"user"),ce(u,"aoInitComplete",l.fnInitComplete,"user"),ce(u,"aoPreDrawCallback",l.fnPreDrawCallback,"user"),u.rowIdFn=Y(l.rowId),N(u);var f=u.oClasses;if(z.extend(f,S.ext.classes,l.oClasses),d.addClass(f.sTable),u.iInitDisplayStart===U&&(u.iInitDisplayStart=l.iDisplayStart,u._iDisplayStart=l.iDisplayStart),null!==l.iDeferLoading){u.bDeferLoading=!0;var h=z.isArray(l.iDeferLoading);u._iRecordsDisplay=h?l.iDeferLoading[0]:l.iDeferLoading,u._iRecordsTotal=h?l.iDeferLoading[1]:l.iDeferLoading}var p=u.oLanguage;z.extend(!0,p,l.oLanguage),p.sUrl&&(z.ajax({dataType:"json",url:p.sUrl,success:function(t){R(t),A(e.oLanguage,t),z.extend(!0,p,t),kt(u)},error:function(){kt(u)}}),s=!0),null===l.asStripeClasses&&(u.asStripeClasses=[f.sStripeOdd,f.sStripeEven]);var m=u.asStripeClasses,g=d.children("tbody").find("tr").eq(0);-1!==z.inArray(!0,z.map(m,function(t,e){return g.hasClass(t)}))&&(z("tbody tr",this).removeClass(m.join(" ")),u.asDestroyStripes=m.slice());var b,y=[],v=this.getElementsByTagName("thead");if(0!==v.length&&(ct(u.aoHeader,v[0]),y=ut(u)),null===l.aoColumns)for(b=[],i=0,a=y.length;i<a;i++)b.push(null);else b=l.aoColumns;for(i=0,a=b.length;i<a;i++)L(u,y?y[i]:null);if(j(u,l.aoColumnDefs,b,function(t,e){H(u,t,e)}),g.length){var x=function(t,e){return null!==t.getAttribute("data-"+e)?e:null};z(g[0]).children("th, td").each(function(t,e){var n=u.aoColumns[t];if(n.mData===t){var o=x(e,"sort")||x(e,"order"),r=x(e,"filter")||x(e,"search");null===o&&null===r||(n.mData={_:t+".display",sort:null!==o?t+".@data-"+o:U,type:null!==o?t+".@data-"+o:U,filter:null!==r?t+".@data-"+r:U},H(u,t))}})}var I=u.oFeatures,w=function(){if(l.aaSorting===U){var t=u.aaSorting;for(i=0,a=t.length;i<a;i++)t[i][1]=u.aoColumns[i].asSorting[0]}ee(u),I.bSort&&ce(u,"aoDrawCallback",function(){if(u.bSorted){var t=Yt(u),n={};z.each(t,function(t,e){n[e.src]=e.dir}),ue(u,null,"order",[u,t,n]),Qt(u)}}),ce(u,"aoDrawCallback",function(){(u.bSorted||"ssp"===pe(u)||I.bDeferRender)&&ee(u)},"sc");var e=d.children("caption").each(function(){this._captionSide=z(this).css("caption-side")}),n=d.children("thead");0===n.length&&(n=z("<thead/>").appendTo(d)),u.nTHead=n[0];var o=d.children("tbody");0===o.length&&(o=z("<tbody/>").appendTo(d)),u.nTBody=o[0];var r=d.children("tfoot");if(0===r.length&&0<e.length&&(""!==u.oScroll.sX||""!==u.oScroll.sY)&&(r=z("<tfoot/>").appendTo(d)),0===r.length||0===r.children().length?d.addClass(f.sNoFooter):0<r.length&&(u.nTFoot=r[0],ct(u.aoFooter,u.nTFoot)),l.aaData)for(i=0;i<l.aaData.length;i++)E(u,l.aaData[i]);else!u.bDeferLoading&&"dom"!=pe(u)||W(u,z(u.nTBody).children("tr"));u.aiDisplay=u.aiDisplayMaster.slice(),!(u.bInitialised=!0)===s&&kt(u)};l.bStateSave?(I.bStateSave=!0,ce(u,"aoDrawCallback",oe,"state_save"),re(u,l,w)):w()}else le(null,0,"Non-table node initialisation ("+this.nodeName+")",2)}),_=null,this},n={},i=/[\r\n]/g,s=/<.*?>/g,d=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,c=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),u=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,q=function(t,e,n){var o=[],r=0,a=t.length;if(n!==U)for(;r<a;r++)t[r]&&t[r][e]&&o.push(t[r][e][n]);else for(;r<a;r++)t[r]&&o.push(t[r][e]);return o},f=function(t){return t.replace(s,"")},x=function(t){if(function(t){if(t.length<2)return!0;for(var e=t.slice().sort(),n=e[0],o=1,r=e.length;o<r;o++){if(e[o]===n)return!1;n=e[o]}return!0}(t))return t.slice();var e,n,o,r=[],a=t.length,l=0;t:for(n=0;n<a;n++){for(e=t[n],o=0;o<l;o++)if(r[o]===e)continue t;r.push(e),l++}return r};function I(n){var o,r,a={};z.each(n,function(t,e){(o=t.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(o[1]+" ")&&(r=t.replace(o[0],o[2].toLowerCase()),a[r]=t,"o"===o[1]&&I(n[t]))}),n._hungarianMap=a}function A(n,o,r){var a;n._hungarianMap||I(n),z.each(o,function(t,e){(a=n._hungarianMap[t])===U||!r&&o[a]!==U||("o"===a.charAt(0)?(o[a]||(o[a]={}),z.extend(!0,o[a],o[t]),A(n[a],o[a],r)):o[a]=o[t])})}function R(t){var e=S.defaults.oLanguage,n=t.sZeroRecords;!t.sEmptyTable&&n&&"No data available in table"===e.sEmptyTable&&ie(t,t,"sZeroRecords","sEmptyTable"),!t.sLoadingRecords&&n&&"Loading..."===e.sLoadingRecords&&ie(t,t,"sZeroRecords","sLoadingRecords"),t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var o=t.sDecimal;o&&ke(o)}S.util={throttle:function(o,t){var r,a,l=t!==U?t:200;return function(){var t=this,e=+new Date,n=arguments;r&&e<r+l?(clearTimeout(a),a=setTimeout(function(){r=U,o.apply(t,n)},l)):(r=e,o.apply(t,n))}},escapeRegex:function(t){return t.replace(c,"\\$1")}};var w=function(t,e,n){t[e]!==U&&(t[n]=t[e])};function B(t){w(t,"ordering","bSort"),w(t,"orderMulti","bSortMulti"),w(t,"orderClasses","bSortClasses"),w(t,"orderCellsTop","bSortCellsTop"),w(t,"order","aaSorting"),w(t,"orderFixed","aaSortingFixed"),w(t,"paging","bPaginate"),w(t,"pagingType","sPaginationType"),w(t,"pageLength","iDisplayLength"),w(t,"searching","bFilter"),"boolean"==typeof t.sScrollX&&(t.sScrollX=t.sScrollX?"100%":""),"boolean"==typeof t.scrollX&&(t.scrollX=t.scrollX?"100%":"");var e=t.aoSearchCols;if(e)for(var n=0,o=e.length;n<o;n++)e[n]&&A(S.models.oSearch,e[n])}function k(t){w(t,"orderable","bSortable"),w(t,"orderData","aDataSort"),w(t,"orderSequence","asSorting"),w(t,"orderDataType","sortDataType");var e=t.aDataSort;"number"!=typeof e||z.isArray(e)||(t.aDataSort=[e])}function N(t){if(!S.__browser){var e={};S.__browser=e;var n=z("<div/>").css({position:"fixed",top:0,left:-1*z(D).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(z("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(z("<div/>").css({width:"100%",height:10}))).appendTo("body"),o=n.children(),r=o.children();e.barWidth=o[0].offsetWidth-o[0].clientWidth,e.bScrollOversize=100===r[0].offsetWidth&&100!==o[0].clientWidth,e.bScrollbarLeft=1!==Math.round(r.offset().left),e.bBounding=!!n[0].getBoundingClientRect().width,n.remove()}z.extend(t.oBrowser,S.__browser),t.oScroll.iBarWidth=S.__browser.barWidth}function C(t,e,n,o,r,a){var l,i=o,s=!1;for(n!==U&&(l=n,s=!0);i!==r;)t.hasOwnProperty(i)&&(l=s?e(l,t[i],i,t):t[i],s=!0,i+=a);return l}function L(t,e){var n=S.defaults.column,o=t.aoColumns.length,r=z.extend({},S.models.oColumn,n,{nTh:e||y.createElement("th"),sTitle:n.sTitle?n.sTitle:e?e.innerHTML:"",aDataSort:n.aDataSort?n.aDataSort:[o],mData:n.mData?n.mData:o,idx:o});t.aoColumns.push(r);var a=t.aoPreSearchCols;a[o]=z.extend({},S.models.oSearch,a[o]),H(t,o,z(e).data())}function H(t,e,n){var o=t.aoColumns[e],r=t.oClasses,a=z(o.nTh);if(!o.sWidthOrig){o.sWidthOrig=a.attr("width")||null;var l=(a.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);l&&(o.sWidthOrig=l[1])}n!==U&&null!==n&&(k(n),A(S.defaults.column,n),n.mDataProp===U||n.mData||(n.mData=n.mDataProp),n.sType&&(o._sManualType=n.sType),n.className&&!n.sClass&&(n.sClass=n.className),n.sClass&&a.addClass(n.sClass),z.extend(o,n),ie(o,n,"sWidth","sWidthOrig"),n.iDataSort!==U&&(o.aDataSort=[n.iDataSort]),ie(o,n,"aDataSort"));function i(t){return"string"==typeof t&&-1!==t.indexOf("@")}var s=o.mData,d=Y(s),c=o.mRender?Y(o.mRender):null;o._bAttrSrc=z.isPlainObject(s)&&(i(s.sort)||i(s.type)||i(s.filter)),o._setter=null,o.fnGetData=function(t,e,n){var o=d(t,e,U,n);return c&&e?c(o,e,t,n):o},o.fnSetData=function(t,e,n){return K(s)(t,e,n)},"number"!=typeof s&&(t._rowReadObject=!0),t.oFeatures.bSort||(o.bSortable=!1,a.addClass(r.sSortableNone));var u=-1!==z.inArray("asc",o.asSorting),f=-1!==z.inArray("desc",o.asSorting);o.bSortable&&(u||f)?u&&!f?(o.sSortingClass=r.sSortableAsc,o.sSortingClassJUI=r.sSortJUIAscAllowed):!u&&f?(o.sSortingClass=r.sSortableDesc,o.sSortingClassJUI=r.sSortJUIDescAllowed):(o.sSortingClass=r.sSortable,o.sSortingClassJUI=r.sSortJUI):(o.sSortingClass=r.sSortableNone,o.sSortingClassJUI="")}function X(t){if(!1!==t.oFeatures.bAutoWidth){var e=t.aoColumns;qt(t);for(var n=0,o=e.length;n<o;n++)e[n].nTh.style.width=e[n].sWidth}var r=t.oScroll;""===r.sY&&""===r.sX||Mt(t),ue(t,null,"column-sizing",[t])}function V(t,e){var n=P(t,"bVisible");return"number"==typeof n[e]?n[e]:null}function _(t,e){var n=P(t,"bVisible"),o=z.inArray(e,n);return-1!==o?o:null}function O(t){var n=0;return z.each(t.aoColumns,function(t,e){e.bVisible&&"none"!==z(e.nTh).css("display")&&n++}),n}function P(t,n){var o=[];return z.map(t.aoColumns,function(t,e){t[n]&&o.push(e)}),o}function T(t){var e,n,o,r,a,l,i,s,d,c=t.aoColumns,u=t.aoData,f=S.ext.type.detect;for(e=0,n=c.length;e<n;e++)if(d=[],!(i=c[e]).sType&&i._sManualType)i.sType=i._sManualType;else if(!i.sType){for(o=0,r=f.length;o<r;o++){for(a=0,l=u.length;a<l&&(d[a]===U&&(d[a]=F(t,a,e,"type")),(s=f[o](d[a],t))||o===f.length-1)&&"html"!==s;a++);if(s){i.sType=s;break}}i.sType||(i.sType="string")}}function j(t,e,n,o){var r,a,l,i,s,d,c,u=t.aoColumns;if(e)for(r=e.length-1;0<=r;r--){var f=(c=e[r]).targets!==U?c.targets:c.aTargets;for(z.isArray(f)||(f=[f]),l=0,i=f.length;l<i;l++)if("number"==typeof f[l]&&0<=f[l]){for(;u.length<=f[l];)L(t);o(f[l],c)}else if("number"==typeof f[l]&&f[l]<0)o(u.length+f[l],c);else if("string"==typeof f[l])for(s=0,d=u.length;s<d;s++)"_all"!=f[l]&&!z(u[s].nTh).hasClass(f[l])||o(s,c)}if(n)for(r=0,a=n.length;r<a;r++)o(r,n[r])}function E(t,e,n,o){var r=t.aoData.length,a=z.extend(!0,{},S.models.oRow,{src:n?"dom":"data",idx:r});a._aData=e,t.aoData.push(a);for(var l=t.aoColumns,i=0,s=l.length;i<s;i++)l[i].sType=null;t.aiDisplayMaster.push(r);var d=t.rowIdFn(e);return d!==U&&(t.aIds[d]=a),!n&&t.oFeatures.bDeferRender||ot(t,r,n,o),r}function W(n,t){var o;return t instanceof z||(t=z(t)),t.map(function(t,e){return o=nt(n,e),E(n,o.data,e,o.cells)})}function F(t,e,n,o){var r=t.iDraw,a=t.aoColumns[n],l=t.aoData[e]._aData,i=a.sDefaultContent,s=a.fnGetData(l,o,{settings:t,row:e,col:n});if(s===U)return t.iDrawError!=r&&null===i&&(le(t,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+e+", column "+n,4),t.iDrawError=r),i;if(s!==l&&null!==s||null===i||o===U){if("function"==typeof s)return s.call(l)}else s=i;return null===s&&"display"==o?"":s}function M(t,e,n,o){var r=t.aoColumns[n],a=t.aoData[e]._aData;r.fnSetData(a,o,{settings:t,row:e,col:n})}var $=/\[.*?\]$/,G=/\(\)$/;function J(t){return z.map(t.match(/(\\.|[^\.])+/g)||[""],function(t){return t.replace(/\\\./g,".")})}function Y(r){if(z.isPlainObject(r)){var a={};return z.each(r,function(t,e){e&&(a[t]=Y(e))}),function(t,e,n,o){var r=a[e]||a._;return r!==U?r(t,e,n,o):t}}if(null===r)return function(t){return t};if("function"==typeof r)return function(t,e,n,o){return r(t,e,n,o)};if("string"!=typeof r||-1===r.indexOf(".")&&-1===r.indexOf("[")&&-1===r.indexOf("("))return function(t,e){return t[r]};var h=function(t,e,n){var o,r,a,l;if(""!==n)for(var i=J(n),s=0,d=i.length;s<d;s++){if(o=i[s].match($),r=i[s].match(G),o){if(i[s]=i[s].replace($,""),""!==i[s]&&(t=t[i[s]]),a=[],i.splice(0,s+1),l=i.join("."),z.isArray(t))for(var c=0,u=t.length;c<u;c++)a.push(h(t[c],e,l));var f=o[0].substring(1,o[0].length-1);t=""===f?a:a.join(f);break}if(r)i[s]=i[s].replace(G,""),t=t[i[s]]();else{if(null===t||t[i[s]]===U)return U;t=t[i[s]]}}return t};return function(t,e){return h(t,e,r)}}function K(o){if(z.isPlainObject(o))return K(o._);if(null===o)return function(){};if("function"==typeof o)return function(t,e,n){o(t,"set",e,n)};if("string"!=typeof o||-1===o.indexOf(".")&&-1===o.indexOf("[")&&-1===o.indexOf("("))return function(t,e){t[o]=e};var p=function(t,e,n){for(var o,r,a,l,i,s=J(n),d=s[s.length-1],c=0,u=s.length-1;c<u;c++){if(r=s[c].match($),a=s[c].match(G),r){if(s[c]=s[c].replace($,""),t[s[c]]=[],(o=s.slice()).splice(0,c+1),i=o.join("."),z.isArray(e))for(var f=0,h=e.length;f<h;f++)p(l={},e[f],i),t[s[c]].push(l);else t[s[c]]=e;return}a&&(s[c]=s[c].replace(G,""),t=t[s[c]](e)),null!==t[s[c]]&&t[s[c]]!==U||(t[s[c]]={}),t=t[s[c]]}d.match(G)?t=t[d.replace(G,"")](e):t[d.replace($,"")]=e};return function(t,e){return p(t,e,o)}}function Q(t){return q(t.aoData,"_aData")}function Z(t){t.aoData.length=0,t.aiDisplayMaster.length=0,t.aiDisplay.length=0,t.aIds={}}function tt(t,e,n){for(var o=-1,r=0,a=t.length;r<a;r++)t[r]==e?o=r:t[r]>e&&t[r]--;-1!=o&&n===U&&t.splice(o,1)}function et(n,o,t,e){function r(t,e){for(;t.childNodes.length;)t.removeChild(t.firstChild);t.innerHTML=F(n,o,e,"display")}var a,l,i=n.aoData[o];if("dom"!==t&&(t&&"auto"!==t||"dom"!==i.src)){var s=i.anCells;if(s)if(e!==U)r(s[e],e);else for(a=0,l=s.length;a<l;a++)r(s[a],a)}else i._aData=nt(n,i,e,e===U?U:i._aData).data;i._aSortData=null,i._aFilterData=null;var d=n.aoColumns;if(e!==U)d[e].sType=null;else{for(a=0,l=d.length;a<l;a++)d[a].sType=null;rt(n,i)}}function nt(t,e,n,r){var o,a,l,i=[],s=e.firstChild,d=0,c=t.aoColumns,u=t._rowReadObject;r=r!==U?r:u?{}:[];function f(t,e){if("string"==typeof t){var n=t.indexOf("@");if(-1!==n){var o=t.substring(n+1);K(t)(r,e.getAttribute(o))}}}function h(t){n!==U&&n!==d||(a=c[d],l=z.trim(t.innerHTML),a&&a._bAttrSrc?(K(a.mData._)(r,l),f(a.mData.sort,t),f(a.mData.type,t),f(a.mData.filter,t)):u?(a._setter||(a._setter=K(a.mData)),a._setter(r,l)):r[d]=l),d++}if(s)for(;s;)"TD"!=(o=s.nodeName.toUpperCase())&&"TH"!=o||(h(s),i.push(s)),s=s.nextSibling;else for(var p=0,m=(i=e.anCells).length;p<m;p++)h(i[p]);var g=e.firstChild?e:e.nTr;if(g){var b=g.getAttribute("id");b&&K(t.rowId)(r,b)}return{data:r,cells:i}}function ot(t,e,n,o){var r,a,l,i,s,d=t.aoData[e],c=d._aData,u=[];if(null===d.nTr){for(r=n||y.createElement("tr"),d.nTr=r,d.anCells=u,r._DT_RowIndex=e,rt(t,d),i=0,s=t.aoColumns.length;i<s;i++)l=t.aoColumns[i],(a=n?o[i]:y.createElement(l.sCellType))._DT_CellIndex={row:e,column:i},u.push(a),n&&!l.mRender&&l.mData===i||z.isPlainObject(l.mData)&&l.mData._===i+".display"||(a.innerHTML=F(t,e,i,"display")),l.sClass&&(a.className+=" "+l.sClass),l.bVisible&&!n?r.appendChild(a):!l.bVisible&&n&&a.parentNode.removeChild(a),l.fnCreatedCell&&l.fnCreatedCell.call(t.oInstance,a,F(t,e,i),c,e,i);ue(t,"aoRowCreatedCallback",null,[r,c,e])}d.nTr.setAttribute("role","row")}function rt(t,e){var n=e.nTr,o=e._aData;if(n){var r=t.rowIdFn(o);if(r&&(n.id=r),o.DT_RowClass){var a=o.DT_RowClass.split(" ");e.__rowc=e.__rowc?x(e.__rowc.concat(a)):a,z(n).removeClass(e.__rowc.join(" ")).addClass(o.DT_RowClass)}o.DT_RowAttr&&z(n).attr(o.DT_RowAttr),o.DT_RowData&&z(n).data(o.DT_RowData)}}function at(t){var e,n,o,r,a,l=t.nTHead,i=t.nTFoot,s=0===z("th, td",l).length,d=t.oClasses,c=t.aoColumns;for(s&&(r=z("<tr/>").appendTo(l)),e=0,n=c.length;e<n;e++)a=c[e],o=z(a.nTh).addClass(a.sClass),s&&o.appendTo(r),t.oFeatures.bSort&&(o.addClass(a.sSortingClass),!1!==a.bSortable&&(o.attr("tabindex",t.iTabIndex).attr("aria-controls",t.sTableId),te(t,a.nTh,e))),a.sTitle!=o[0].innerHTML&&o.html(a.sTitle),he(t,"header")(t,o,a,d);if(s&&ct(t.aoHeader,l),z(l).find(">tr").attr("role","row"),z(l).find(">tr>th, >tr>td").addClass(d.sHeaderTH),z(i).find(">tr>th, >tr>td").addClass(d.sFooterTH),null!==i){var u=t.aoFooter[0];for(e=0,n=u.length;e<n;e++)(a=c[e]).nTf=u[e].cell,a.sClass&&z(a.nTf).addClass(a.sClass)}}function lt(t,e,n){var o,r,a,l,i,s,d,c,u,f=[],h=[],p=t.aoColumns.length;if(e){for(n===U&&(n=!1),o=0,r=e.length;o<r;o++){for(f[o]=e[o].slice(),f[o].nTr=e[o].nTr,a=p-1;0<=a;a--)t.aoColumns[a].bVisible||n||f[o].splice(a,1);h.push([])}for(o=0,r=f.length;o<r;o++){if(d=f[o].nTr)for(;s=d.firstChild;)d.removeChild(s);for(a=0,l=f[o].length;a<l;a++)if(u=c=1,h[o][a]===U){for(d.appendChild(f[o][a].cell),h[o][a]=1;f[o+c]!==U&&f[o][a].cell==f[o+c][a].cell;)h[o+c][a]=1,c++;for(;f[o][a+u]!==U&&f[o][a].cell==f[o][a+u].cell;){for(i=0;i<c;i++)h[o+i][a+u]=1;u++}z(f[o][a].cell).attr("rowspan",c).attr("colspan",u)}}}}function it(t){var e=ue(t,"aoPreDrawCallback","preDraw",[t]);if(-1===z.inArray(!1,e)){var n=[],o=0,r=t.asStripeClasses,a=r.length,l=(t.aoOpenRows.length,t.oLanguage),i=t.iInitDisplayStart,s="ssp"==pe(t),d=t.aiDisplay;t.bDrawing=!0,i!==U&&-1!==i&&(t._iDisplayStart=s?i:i>=t.fnRecordsDisplay()?0:i,t.iInitDisplayStart=-1);var c=t._iDisplayStart,u=t.fnDisplayEnd();if(t.bDeferLoading)t.bDeferLoading=!1,t.iDraw++,Et(t,!1);else if(s){if(!t.bDestroying&&!ht(t))return}else t.iDraw++;if(0!==d.length)for(var f=s?0:c,h=s?t.aoData.length:u,p=f;p<h;p++){var m=d[p],g=t.aoData[m];null===g.nTr&&ot(t,m);var b=g.nTr;if(0!==a){var y=r[o%a];g._sRowStripe!=y&&(z(b).removeClass(g._sRowStripe).addClass(y),g._sRowStripe=y)}ue(t,"aoRowCallback",null,[b,g._aData,o,p]),n.push(b),o++}else{var v=l.sZeroRecords;1==t.iDraw&&"ajax"==pe(t)?v=l.sLoadingRecords:l.sEmptyTable&&0===t.fnRecordsTotal()&&(v=l.sEmptyTable),n[0]=z("<tr/>",{class:a?r[0]:""}).append(z("<td />",{valign:"top",colSpan:O(t),class:t.oClasses.sRowEmpty}).html(v))[0]}ue(t,"aoHeaderCallback","header",[z(t.nTHead).children("tr")[0],Q(t),c,u,d]),ue(t,"aoFooterCallback","footer",[z(t.nTFoot).children("tr")[0],Q(t),c,u,d]);var x=z(t.nTBody);x.children().detach(),x.append(z(n)),ue(t,"aoDrawCallback","draw",[t]),t.bSorted=!1,t.bFiltered=!1,t.bDrawing=!1}else Et(t,!1)}function st(t,e){var n=t.oFeatures,o=n.bSort,r=n.bFilter;o&&Kt(t),r?yt(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice(),!0!==e&&(t._iDisplayStart=0),t._drawHold=e,it(t),t._drawHold=!1}function dt(t){var e=t.oClasses,n=z(t.nTable),o=z("<div/>").insertBefore(n),r=t.oFeatures,a=z("<div/>",{id:t.sTableId+"_wrapper",class:e.sWrapper+(t.nTFoot?"":" "+e.sNoFooter)});t.nHolding=o[0],t.nTableWrapper=a[0],t.nTableReinsertBefore=t.nTable.nextSibling;for(var l,i,s,d,c,u,f=t.sDom.split(""),h=0;h<f.length;h++){if(l=null,"<"==(i=f[h])){if(s=z("<div/>")[0],"'"==(d=f[h+1])||'"'==d){for(c="",u=2;f[h+u]!=d;)c+=f[h+u],u++;if("H"==c?c=e.sJUIHeader:"F"==c&&(c=e.sJUIFooter),-1!=c.indexOf(".")){var p=c.split(".");s.id=p[0].substr(1,p[0].length-1),s.className=p[1]}else"#"==c.charAt(0)?s.id=c.substr(1,c.length-1):s.className=c;h+=u}a.append(s),a=z(s)}else if(">"==i)a=a.parent();else if("l"==i&&r.bPaginate&&r.bLengthChange)l=Ht(t);else if("f"==i&&r.bFilter)l=bt(t);else if("r"==i&&r.bProcessing)l=jt(t);else if("t"==i)l=Wt(t);else if("i"==i&&r.bInfo)l=At(t);else if("p"==i&&r.bPaginate)l=Ot(t);else if(0!==S.ext.feature.length)for(var m=S.ext.feature,g=0,b=m.length;g<b;g++)if(i==m[g].cFeature){l=m[g].fnInit(t);break}if(l){var y=t.aanFeatures;y[i]||(y[i]=[]),y[i].push(l),a.append(l)}}o.replaceWith(a),t.nHolding=null}function ct(t,e){function n(t,e,n){for(var o=t[e];o[n];)n++;return n}var o,r,a,l,i,s,d,c,u,f,h=z(e).children("tr");for(t.splice(0,t.length),a=0,s=h.length;a<s;a++)t.push([]);for(a=0,s=h.length;a<s;a++)for(0,r=(o=h[a]).firstChild;r;){if("TD"==r.nodeName.toUpperCase()||"TH"==r.nodeName.toUpperCase())for(c=(c=1*r.getAttribute("colspan"))&&0!==c&&1!==c?c:1,u=(u=1*r.getAttribute("rowspan"))&&0!==u&&1!==u?u:1,d=n(t,a,0),f=1===c,i=0;i<c;i++)for(l=0;l<u;l++)t[a+l][d+i]={cell:r,unique:f},t[a+l].nTr=o;r=r.nextSibling}}function ut(t,e,n){var o=[];n||(n=t.aoHeader,e&&ct(n=[],e));for(var r=0,a=n.length;r<a;r++)for(var l=0,i=n[r].length;l<i;l++)!n[r][l].unique||o[l]&&t.bSortCellsTop||(o[l]=n[r][l].cell);return o}function ft(r,t,e){if(ue(r,"aoServerParams","serverParams",[t]),t&&z.isArray(t)){var a={},l=/(.*?)\[\]$/;z.each(t,function(t,e){var n=e.name.match(l);if(n){var o=n[0];a[o]||(a[o]=[]),a[o].push(e.value)}else a[e.name]=e.value}),t=a}function n(t){ue(r,null,"xhr",[r,t,r.jqXHR]),e(t)}var o,i=r.ajax,s=r.oInstance;if(z.isPlainObject(i)&&i.data){o=i.data;var d=z.isFunction(o)?o(t,r):o;t=z.isFunction(o)&&d?d:z.extend(!0,t,d),delete i.data}var c={data:t,success:function(t){var e=t.error||t.sError;e&&le(r,0,e),r.json=t,n(t)},dataType:"json",cache:!1,type:r.sServerMethod,error:function(t,e,n){var o=ue(r,null,"xhr",[r,null,r.jqXHR]);-1===z.inArray(!0,o)&&("parsererror"==e?le(r,0,"Invalid JSON response",1):4===t.readyState&&le(r,0,"Ajax error",7)),Et(r,!1)}};r.oAjaxData=t,ue(r,null,"preXhr",[r,t]),r.fnServerData?r.fnServerData.call(s,r.sAjaxSource,z.map(t,function(t,e){return{name:e,value:t}}),n,r):r.sAjaxSource||"string"==typeof i?r.jqXHR=z.ajax(z.extend(c,{url:i||r.sAjaxSource})):z.isFunction(i)?r.jqXHR=i.call(s,t,n,r):(r.jqXHR=z.ajax(z.extend(c,i)),i.data=o)}function ht(e){return!e.bAjaxDataGet||(e.iDraw++,Et(e,!0),ft(e,pt(e),function(t){mt(e,t)}),!1)}function pt(t){function n(t,e){u.push({name:t,value:e})}var e,o,r,a,l=t.aoColumns,i=l.length,s=t.oFeatures,d=t.oPreviousSearch,c=t.aoPreSearchCols,u=[],f=Yt(t),h=t._iDisplayStart,p=!1!==s.bPaginate?t._iDisplayLength:-1;n("sEcho",t.iDraw),n("iColumns",i),n("sColumns",q(l,"sName").join(",")),n("iDisplayStart",h),n("iDisplayLength",p);var m={draw:t.iDraw,columns:[],order:[],start:h,length:p,search:{value:d.sSearch,regex:d.bRegex}};for(e=0;e<i;e++)r=l[e],a=c[e],o="function"==typeof r.mData?"function":r.mData,m.columns.push({data:o,name:r.sName,searchable:r.bSearchable,orderable:r.bSortable,search:{value:a.sSearch,regex:a.bRegex}}),n("mDataProp_"+e,o),s.bFilter&&(n("sSearch_"+e,a.sSearch),n("bRegex_"+e,a.bRegex),n("bSearchable_"+e,r.bSearchable)),s.bSort&&n("bSortable_"+e,r.bSortable);s.bFilter&&(n("sSearch",d.sSearch),n("bRegex",d.bRegex)),s.bSort&&(z.each(f,function(t,e){m.order.push({column:e.col,dir:e.dir}),n("iSortCol_"+t,e.col),n("sSortDir_"+t,e.dir)}),n("iSortingCols",f.length));var g=S.ext.legacy.ajax;return null===g?t.sAjaxSource?u:m:g?u:m}function mt(t,n){function e(t,e){return n[t]!==U?n[t]:n[e]}var o=gt(t,n),r=e("sEcho","draw"),a=e("iTotalRecords","recordsTotal"),l=e("iTotalDisplayRecords","recordsFiltered");if(r){if(1*r<t.iDraw)return;t.iDraw=1*r}Z(t),t._iRecordsTotal=parseInt(a,10),t._iRecordsDisplay=parseInt(l,10);for(var i=0,s=o.length;i<s;i++)E(t,o[i]);t.aiDisplay=t.aiDisplayMaster.slice(),t.bAjaxDataGet=!1,it(t),t._bInitComplete||Nt(t,n),t.bAjaxDataGet=!0,Et(t,!1)}function gt(t,e){var n=z.isPlainObject(t.ajax)&&t.ajax.dataSrc!==U?t.ajax.dataSrc:t.sAjaxDataProp;return"data"===n?e.aaData||e[n]:""!==n?Y(n)(e):e}function bt(n){var t=n.oClasses,e=n.sTableId,o=n.oLanguage,r=n.oPreviousSearch,a=n.aanFeatures,l='<input type="search" class="'+t.sFilterInput+'"/>',i=o.sSearch;i=i.match(/_INPUT_/)?i.replace("_INPUT_",l):i+l;function s(){a.f;var t=this.value?this.value:"";t!=r.sSearch&&(yt(n,{sSearch:t,bRegex:r.bRegex,bSmart:r.bSmart,bCaseInsensitive:r.bCaseInsensitive}),n._iDisplayStart=0,it(n))}var d=z("<div/>",{id:a.f?null:e+"_filter",class:t.sFilter}).append(z("<label/>").append(i)),c=null!==n.searchDelay?n.searchDelay:"ssp"===pe(n)?400:0,u=z("input",d).val(r.sSearch).attr("placeholder",o.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",c?Xt(s,c):s).on("keypress.DT",function(t){if(13==t.keyCode)return!1}).attr("aria-controls",e);return z(n.nTable).on("search.dt.DT",function(t,e){if(n===e)try{u[0]!==y.activeElement&&u.val(r.sSearch)}catch(t){}}),d[0]}function yt(t,e,n){function o(t){a.sSearch=t.sSearch,a.bRegex=t.bRegex,a.bSmart=t.bSmart,a.bCaseInsensitive=t.bCaseInsensitive}function r(t){return t.bEscapeRegex!==U?!t.bEscapeRegex:t.bRegex}var a=t.oPreviousSearch,l=t.aoPreSearchCols;if(T(t),"ssp"!=pe(t)){It(t,e.sSearch,n,r(e),e.bSmart,e.bCaseInsensitive),o(e);for(var i=0;i<l.length;i++)xt(t,l[i].sSearch,i,r(l[i]),l[i].bSmart,l[i].bCaseInsensitive);vt(t)}else o(e);t.bFiltered=!0,ue(t,null,"search",[t])}function vt(t){for(var e,n,o=S.ext.search,r=t.aiDisplay,a=0,l=o.length;a<l;a++){for(var i=[],s=0,d=r.length;s<d;s++)n=r[s],e=t.aoData[n],o[a](t,e._aFilterData,n,e._aData,s)&&i.push(n);r.length=0,z.merge(r,i)}}function xt(t,e,n,o,r,a){if(""!==e){for(var l,i=[],s=t.aiDisplay,d=wt(e,o,r,a),c=0;c<s.length;c++)l=t.aoData[s[c]]._aFilterData[n],d.test(l)&&i.push(s[c]);t.aiDisplay=i}}function It(t,e,n,o,r,a){var l,i,s,d=wt(e,o,r,a),c=t.oPreviousSearch.sSearch,u=t.aiDisplayMaster,f=[];if(0!==S.ext.search.length&&(n=!0),i=Ft(t),e.length<=0)t.aiDisplay=u.slice();else{for((i||n||c.length>e.length||0!==e.indexOf(c)||t.bSorted)&&(t.aiDisplay=u.slice()),l=t.aiDisplay,s=0;s<l.length;s++)d.test(t.aoData[l[s]]._sFilterRow)&&f.push(l[s]);t.aiDisplay=f}}function wt(t,e,n,o){t=e?t:Ct(t),n&&(t="^(?=.*?"+z.map(t.match(/"[^"]+"|[^ ]+/g)||[""],function(t){if('"'===t.charAt(0)){var e=t.match(/^"(.*)"$/);t=e?e[1]:t}return t.replace('"',"")}).join(")(?=.*?")+").*$");return new RegExp(t,o?"i":"")}var Ct=S.util.escapeRegex,_t=z("<div>")[0],Tt=_t.textContent!==U;function Ft(t){var e,n,o,r,a,l,i,s,d=t.aoColumns,c=S.ext.type.search,u=!1;for(n=0,r=t.aoData.length;n<r;n++)if(!(s=t.aoData[n])._aFilterData){for(l=[],o=0,a=d.length;o<a;o++)(e=d[o]).bSearchable?(i=F(t,n,o,"filter"),c[e.sType]&&(i=c[e.sType](i)),null===i&&(i=""),"string"!=typeof i&&i.toString&&(i=i.toString())):i="",i.indexOf&&-1!==i.indexOf("&")&&(_t.innerHTML=i,i=Tt?_t.textContent:_t.innerText),i.replace&&(i=i.replace(/[\r\n]/g,"")),l.push(i);s._aFilterData=l,s._sFilterRow=l.join(" "),u=!0}return u}function St(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function Dt(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function At(t){var e=t.sTableId,n=t.aanFeatures.i,o=z("<div/>",{class:t.oClasses.sInfo,id:n?null:e+"_info"});return n||(t.aoDrawCallback.push({fn:Rt,sName:"information"}),o.attr("role","status").attr("aria-live","polite"),z(t.nTable).attr("aria-describedby",e+"_info")),o[0]}function Rt(t){var e=t.aanFeatures.i;if(0!==e.length){var n=t.oLanguage,o=t._iDisplayStart+1,r=t.fnDisplayEnd(),a=t.fnRecordsTotal(),l=t.fnRecordsDisplay(),i=l?n.sInfo:n.sInfoEmpty;l!==a&&(i+=" "+n.sInfoFiltered),i=Bt(t,i+=n.sInfoPostFix);var s=n.fnInfoCallback;null!==s&&(i=s.call(t.oInstance,t,o,r,a,l,i)),z(e).html(i)}}function Bt(t,e){var n=t.fnFormatNumber,o=t._iDisplayStart+1,r=t._iDisplayLength,a=t.fnRecordsDisplay(),l=-1===r;return e.replace(/_START_/g,n.call(t,o)).replace(/_END_/g,n.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,n.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(t,a)).replace(/_PAGE_/g,n.call(t,l?1:Math.ceil(o/r))).replace(/_PAGES_/g,n.call(t,l?1:Math.ceil(a/r)))}function kt(n){var o,t,e,r=n.iInitDisplayStart,a=n.aoColumns,l=n.oFeatures,i=n.bDeferLoading;if(n.bInitialised){for(dt(n),at(n),lt(n,n.aoHeader),lt(n,n.aoFooter),Et(n,!0),l.bAutoWidth&&qt(n),o=0,t=a.length;o<t;o++)(e=a[o]).sWidth&&(e.nTh.style.width=Jt(e.sWidth));ue(n,null,"preInit",[n]),st(n);var s=pe(n);"ssp"==s&&!i||("ajax"==s?ft(n,[],function(t){var e=gt(n,t);for(o=0;o<e.length;o++)E(n,e[o]);n.iInitDisplayStart=r,st(n),Et(n,!1),Nt(n,t)}):(Et(n,!1),Nt(n)))}else setTimeout(function(){kt(n)},200)}function Nt(t,e){t._bInitComplete=!0,(e||t.oInit.aaData)&&X(t),ue(t,null,"plugin-init",[t,e]),ue(t,"aoInitComplete","init",[t,e])}function Lt(t,e){var n=parseInt(e,10);t._iDisplayLength=n,fe(t),ue(t,null,"length",[t,n])}function Ht(o){for(var t=o.oClasses,e=o.sTableId,n=o.aLengthMenu,r=z.isArray(n[0]),a=r?n[0]:n,l=r?n[1]:n,i=z("<select/>",{name:e+"_length","aria-controls":e,class:t.sLengthSelect}),s=0,d=a.length;s<d;s++)i[0][s]=new Option("number"==typeof l[s]?o.fnFormatNumber(l[s]):l[s],a[s]);var c=z("<div><label/></div>").addClass(t.sLength);return o.aanFeatures.l||(c[0].id=e+"_length"),c.children().append(o.oLanguage.sLengthMenu.replace("_MENU_",i[0].outerHTML)),z("select",c).val(o._iDisplayLength).on("change.DT",function(t){Lt(o,z(this).val()),it(o)}),z(o.nTable).on("length.dt.DT",function(t,e,n){o===e&&z("select",c).val(n)}),c[0]}function Ot(t){function c(t){it(t)}var e=t.sPaginationType,u=S.ext.pager[e],f="function"==typeof u,n=z("<div/>
2684").addClass(t.oClasses.sPaging+e)[0],h=t.aanFeatures;return f||u.fnInit(t,n,c),h.p||(n.id=t.sTableId+"_paginate",t.aoDrawCallback.push({fn:function(t){if(f){var e,n,o=t._iDisplayStart,r=t._iDisplayLength,a=t.fnRecordsDisplay(),l=-1===r,i=l?0:Math.ceil(o/r),s=l?1:Math.ceil(a/r),d=u(i,s);for(e=0,n=h.p.length;e<n;e++)he(t,"pageButton")(t,h.p[e],e,d,i,s)}else u.fnUpdate(t,c)},sName:"pagination"})),n}function Pt(t,e,n){var o=t._iDisplayStart,r=t._iDisplayLength,a=t.fnRecordsDisplay();0===a||-1===r?o=0:"number"==typeof e?a<(o=e*r)&&(o=0):"first"==e?o=0:"previous"==e?(o=0<=r?o-r:0)<0&&(o=0):"next"==e?o+r<a&&(o+=r):"last"==e?o=Math.floor((a-1)/r)*r:le(t,0,"Unknown paging action: "+e,5);var l=t._iDisplayStart!==o;return t._iDisplayStart=o,l&&(ue(t,null,"page",[t]),n&&it(t)),l}function jt(t){return z("<div/>",{id:t.aanFeatures.r?null:t.sTableId+"_processing",class:t.oClasses.sProcessing}).html(t.oLanguage.sProcessing).insertBefore(t.nTable)[0]}function Et(t,e){t.oFeatures.bProcessing&&z(t.aanFeatures.r).css("display",e?"block":"none"),ue(t,null,"processing",[t,e])}function Wt(t){var e=z(t.nTable);e.attr("role","grid");var n=t.oScroll;if(""===n.sX&&""===n.sY)return t.nTable;function o(t){return t?Jt(t):null}var r=n.sX,a=n.sY,l=t.oClasses,i=e.children("caption"),s=i.length?i[0]._captionSide:null,d=z(e[0].cloneNode(!1)),c=z(e[0].cloneNode(!1)),u=e.children("tfoot"),f="<div/>";u.length||(u=null);var h=z(f,{class:l.sScrollWrapper}).append(z(f,{class:l.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:r?o(r):"100%"}).append(z(f,{class:l.sScrollHeadInner}).css({"box-sizing":"content-box",width:n.sXInner||"100%"}).append(d.removeAttr("id").css("margin-left",0).append("top"===s?i:null).append(e.children("thead"))))).append(z(f,{class:l.sScrollBody}).css({position:"relative",overflow:"auto",width:o(r)}).append(e));u&&h.append(z(f,{class:l.sScrollFoot}).css({overflow:"hidden",border:0,width:r?o(r):"100%"}).append(z(f,{class:l.sScrollFootInner}).append(c.removeAttr("id").css("margin-left",0).append("bottom"===s?i:null).append(e.children("tfoot")))));var p=h.children(),m=p[0],g=p[1],b=u?p[2]:null;return r&&z(g).on("scroll.DT",function(t){var e=this.scrollLeft;m.scrollLeft=e,u&&(b.scrollLeft=e)}),z(g).css(a&&n.bCollapse?"max-height":"height",a),t.nScrollHead=m,t.nScrollBody=g,t.nScrollFoot=b,t.aoDrawCallback.push({fn:Mt,sName:"scrolling"}),h[0]}function Mt(n){function t(t){var e=t.style;e.paddingTop="0",e.paddingBottom="0",e.borderTopWidth="0",e.borderBottomWidth="0",e.height=0}var e,o,r,a,l,i,s,d,c,u=n.oScroll,f=u.sX,h=u.sXInner,p=u.sY,m=u.iBarWidth,g=z(n.nScrollHead),b=g[0].style,y=g.children("div"),v=y[0].style,x=y.children("table"),I=n.nScrollBody,w=z(I),C=I.style,_=z(n.nScrollFoot).children("div"),T=_.children("table"),F=z(n.nTHead),S=z(n.nTable),D=S[0],A=D.style,R=n.nTFoot?z(n.nTFoot):null,B=n.oBrowser,k=B.bScrollOversize,N=q(n.aoColumns,"nTh"),L=[],H=[],O=[],P=[],j=I.scrollHeight>I.clientHeight;if(n.scrollBarVis!==j&&n.scrollBarVis!==U)return n.scrollBarVis=j,void X(n);n.scrollBarVis=j,S.children("thead, tfoot").remove(),R&&(i=R.clone().prependTo(S),o=R.find("tr"),a=i.find("tr")),l=F.clone().prependTo(S),e=F.find("tr"),r=l.find("tr"),l.find("th, td").removeAttr("tabindex"),f||(C.width="100%",g[0].style.width="100%"),z.each(ut(n,l),function(t,e){s=V(n,t),e.style.width=n.aoColumns[s].sWidth}),R&&zt(function(t){t.style.width=""},a),c=S.outerWidth(),""===f?(A.width="100%",k&&(S.find("tbody").height()>I.offsetHeight||"scroll"==w.css("overflow-y"))&&(A.width=Jt(S.outerWidth()-m)),c=S.outerWidth()):""!==h&&(A.width=Jt(h),c=S.outerWidth()),zt(t,r),zt(function(t){O.push(t.innerHTML),L.push(Jt(z(t).css("width")))},r),zt(function(t,e){-1!==z.inArray(t,N)&&(t.style.width=L[e])},e),z(r).height(0),R&&(zt(t,a),zt(function(t){P.push(t.innerHTML),H.push(Jt(z(t).css("width")))},a),zt(function(t,e){t.style.width=H[e]},o),z(a).height(0)),zt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+O[e]+"</div>",t.style.width=L[e]},r),R&&zt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+P[e]+"</div>",t.style.width=H[e]},a),S.outerWidth()<c?(d=I.scrollHeight>I.offsetHeight||"scroll"==w.css("overflow-y")?c+m:c,k&&(I.scrollHeight>I.offsetHeight||"scroll"==w.css("overflow-y"))&&(A.width=Jt(d-m)),""!==f&&""===h||le(n,1,"Possible column misalignment",6)):d="100%",C.width=Jt(d),b.width=Jt(d),R&&(n.nScrollFoot.style.width=Jt(d)),p||k&&(C.height=Jt(D.offsetHeight+m));var E=S.outerWidth();x[0].style.width=Jt(E),v.width=Jt(E);var W=S.height()>I.clientHeight||"scroll"==w.css("overflow-y"),M="padding"+(B.bScrollbarLeft?"Left":"Right");v[M]=W?m+"px":"0px",R&&(T[0].style.width=Jt(E),_[0].style.width=Jt(E),_[0].style[M]=W?m+"px":"0px"),S.children("colgroup").insertBefore(S.children("thead")),w.scroll(),!n.bSorted&&!n.bFiltered||n._drawHold||(I.scrollTop=0)}function zt(t,e,n){for(var o,r,a=0,l=0,i=e.length;l<i;){for(o=e[l].firstChild,r=n?n[l].firstChild:null;o;)1===o.nodeType&&(n?t(o,r,a):t(o,a),a++),o=o.nextSibling,r=n?r.nextSibling:null;l++}}var Ut=/<.*?>/g;function qt(t){var e,n,o,r=t.nTable,a=t.aoColumns,l=t.oScroll,i=l.sY,s=l.sX,d=l.sXInner,c=a.length,u=P(t,"bVisible"),f=z("th",t.nTHead),h=r.getAttribute("width"),p=r.parentNode,m=!1,g=t.oBrowser,b=g.bScrollOversize,y=r.style.width;for(y&&-1!==y.indexOf("%")&&(h=y),e=0;e<u.length;e++)null!==(n=a[u[e]]).sWidth&&(n.sWidth=Vt(n.sWidthOrig,p),m=!0);if(b||!m&&!s&&!i&&c==O(t)&&c==f.length)for(e=0;e<c;e++){var v=V(t,e);null!==v&&(a[v].sWidth=Jt(f.eq(e).width()))}else{var x=z(r).clone().css("visibility","hidden").removeAttr("id");x.find("tbody tr").remove();var I=z("<tr/>").appendTo(x.find("tbody"));for(x.find("thead, tfoot").remove(),x.append(z(t.nTHead).clone()).append(z(t.nTFoot).clone()),x.find("tfoot th, tfoot td").css("width",""),f=ut(t,x.find("thead")[0]),e=0;e<u.length;e++)n=a[u[e]],f[e].style.width=null!==n.sWidthOrig&&""!==n.sWidthOrig?Jt(n.sWidthOrig):"",n.sWidthOrig&&s&&z(f[e]).append(z("<div/>").css({width:n.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(t.aoData.length)for(e=0;e<u.length;e++)n=a[o=u[e]],z($t(t,o)).clone(!1).append(n.sContentPadding).appendTo(I);z("[name]",x).removeAttr("name");var w=z("<div/>").css(s||i?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(x).appendTo(p);s&&d?x.width(d):s?(x.css("width","auto"),x.removeAttr("width"),x.width()<p.clientWidth&&h&&x.width(p.clientWidth)):i?x.width(p.clientWidth):h&&x.width(h);var C=0;for(e=0;e<u.length;e++){var _=z(f[e]),T=_.outerWidth()-_.width(),F=g.bBounding?Math.ceil(f[e].getBoundingClientRect().width):_.outerWidth();C+=F,a[u[e]].sWidth=Jt(F-T)}r.style.width=Jt(C),w.remove()}if(h&&(r.style.width=Jt(h)),(h||s)&&!t._reszEvt){var S=function(){z(D).on("resize.DT-"+t.sInstance,Xt(function(){X(t)}))};b?setTimeout(S,1e3):S(),t._reszEvt=!0}}var Xt=S.util.throttle;function Vt(t,e){if(!t)return 0;var n=z("<div/>").css("width",Jt(t)).appendTo(e||y.body),o=n[0].offsetWidth;return n.remove(),o}function $t(t,e){var n=Gt(t,e);if(n<0)return null;var o=t.aoData[n];return o.nTr?o.anCells[e]:z("<td/>
2684").html(F(t,n,e,"display"))[0]}function Gt(t,e){for(var n,o=-1,r=-1,a=0,l=t.aoData.length;a<l;a++)(n=(n=(n=F(t,a,e,"display")+"").replace(Ut,"")).replace(/ /g," ")).length>o&&(o=n.length,r=a);return r}function Jt(t){return null===t?"0px":"number"==typeof t?t<0?"0px":t+"px":t.match(/\d$/)?t+"px":t}function Yt(t){function e(t){t.length&&!z.isArray(t[0])?h.push(t):z.merge(h,t)}var n,o,r,a,l,i,s,d=[],c=t.aoColumns,u=t.aaSortingFixed,f=z.isPlainObject(u),h=[];for(z.isArray(u)&&e(u),f&&u.pre&&e(u.pre),e(t.aaSorting),f&&u.post&&e(u.post),n=0;n<h.length;n++)for(o=0,r=(a=c[s=h[n][0]].aDataSort).length;o<r;o++)i=c[l=a[o]].sType||"string",h[n]._idx===U&&(h[n]._idx=z.inArray(h[n][1],c[l].asSorting)),d.push({src:s,col:l,dir:h[n][1],index:h[n]._idx,type:i,formatter:S.ext.type.order[i+"-pre"]});return d}function Kt(t){var e,n,o,r,c,u=[],f=S.ext.type.order,h=t.aoData,a=(t.aoColumns,0),l=t.aiDisplayMaster;for(T(t),e=0,n=(c=Yt(t)).length;e<n;e++)(r=c[e]).formatter&&a++,ne(t,r.col);if("ssp"!=pe(t)&&0!==c.length){for(e=0,o=l.length;e<o;e++)u[l[e]]=e;a===c.length?l.sort(function(t,e){var n,o,r,a,l,i=c.length,s=h[t]._aSortData,d=h[e]._aSortData;for(r=0;r<i;r++)if(0!=(a=(n=s[(l=c[r]).col])<(o=d[l.col])?-1:o<n?1:0))return"asc"===l.dir?a:-a;return(n=u[t])<(o=u[e])?-1:o<n?1:0}):l.sort(function(t,e){var n,o,r,a,l,i=c.length,s=h[t]._aSortData,d=h[e]._aSortData;for(r=0;r<i;r++)if(n=s[(l=c[r]).col],o=d[l.col],0!==(a=(f[l.type+"-"+l.dir]||f["string-"+l.dir])(n,o)))return a;return(n=u[t])<(o=u[e])?-1:o<n?1:0})}t.bSorted=!0}function Qt(t){for(var e,n=t.aoColumns,o=Yt(t),r=t.oLanguage.oAria,a=0,l=n.length;a<l;a++){var i=n[a],s=i.asSorting,d=i.sTitle.replace(/<.*?>/g,""),c=i.nTh;c.removeAttribute("aria-sort"),e=i.bSortable?d+("asc"===(0<o.length&&o[0].col==a?(c.setAttribute("aria-sort","asc"==o[0].dir?"ascending":"descending"),s[o[0].index+1]||s[0]):s[0])?r.sSortAscending:r.sSortDescending):d,c.setAttribute("aria-label",e)}}function Zt(t,e,n,o){function r(t,e){var n=t._idx;return n===U&&(n=z.inArray(t[1],s)),n+1<s.length?n+1:e?null:0}var a,l=t.aoColumns[e],i=t.aaSorting,s=l.asSorting;if("number"==typeof i[0]&&(i=t.aaSorting=[i]),n&&t.oFeatures.bSortMulti){var d=z.inArray(e,q(i,"0"));-1!==d?(null===(a=r(i[d],!0))&&1===i.length&&(a=0),null===a?i.splice(d,1):(i[d][1]=s[a],i[d]._idx=a)):(i.push([e,s[0],0]),i[i.length-1]._idx=0)}else i.length&&i[0][0]==e?(a=r(i[0]),i.length=1,i[0][1]=s[a],i[0]._idx=a):(i.length=0,i.push([e,s[0]]),i[0]._idx=0);st(t),"function"==typeof o&&o(t)}function te(e,t,n,o){var r=e.aoColumns[n];de(t,{},function(t){!1!==r.bSortable&&(e.oFeatures.bProcessing?(Et(e,!0),setTimeout(function(){Zt(e,n,t.shiftKey,o),"ssp"!==pe(e)&&Et(e,!1)},0)):Zt(e,n,t.shiftKey,o))})}function ee(t){var e,n,o,r=t.aLastSort,a=t.oClasses.sSortColumn,l=Yt(t),i=t.oFeatures;if(i.bSort&&i.bSortClasses){for(e=0,n=r.length;e<n;e++)o=r[e].src,z(q(t.aoData,"anCells",o)).removeClass(a+(e<2?e+1:3));for(e=0,n=l.length;e<n;e++)o=l[e].src,z(q(t.aoData,"anCells",o)).addClass(a+(e<2?e+1:3))}t.aLastSort=l}function ne(t,e){var n,o,r,a=t.aoColumns[e],l=S.ext.order[a.sSortDataType];l&&(n=l.call(t.oInstance,t,e,_(t,e)));for(var i=S.ext.type.order[a.sType+"-pre"],s=0,d=t.aoData.length;s<d;s++)(o=t.aoData[s])._aSortData||(o._aSortData=[]),o._aSortData[e]&&!l||(r=l?n[s]:F(t,s,e,"sort"),o._aSortData[e]=i?i(r):r)}function oe(n){if(n.oFeatures.bStateSave&&!n.bDestroying){var t={time:+new Date,start:n._iDisplayStart,length:n._iDisplayLength,order:z.extend(!0,[],n.aaSorting),search:St(n.oPreviousSearch),columns:z.map(n.aoColumns,function(t,e){return{visible:t.bVisible,search:St(n.aoPreSearchCols[e])}})};ue(n,"aoStateSaveParams","stateSaveParams",[n,t]),n.oSavedState=t,n.fnStateSaveCallback.call(n.oInstance,n,t)}}function re(r,t,a){function e(t){if(t&&t.time){var e=ue(r,"aoStateLoadParams","stateLoadParams",[r,t]);if(-1===z.inArray(!1,e)){var n=r.iStateDuration;if(0<n&&t.time<+new Date-1e3*n)a();else if(t.columns&&s.length!==t.columns.length)a();else{if(r.oLoadedState=z.extend(!0,{},t),t.start!==U&&(r._iDisplayStart=t.start,r.iInitDisplayStart=t.start),t.length!==U&&(r._iDisplayLength=t.length),t.order!==U&&(r.aaSorting=[],z.each(t.order,function(t,e){r.aaSorting.push(e[0]>=s.length?[0,e[1]]:e)})),t.search!==U&&z.extend(r.oPreviousSearch,Dt(t.search)),t.columns)for(l=0,i=t.columns.length;l<i;l++){var o=t.columns[l];o.visible!==U&&(s[l].bVisible=o.visible),o.search!==U&&z.extend(r.aoPreSearchCols[l],Dt(o.search))}ue(r,"aoStateLoaded","stateLoaded",[r,t]),a()}}else a()}else a()}var l,i,s=r.aoColumns;if(r.oFeatures.bStateSave){var n=r.fnStateLoadCallback.call(r.oInstance,r,e);n!==U&&e(n)}else a()}function ae(t){var e=S.settings,n=z.inArray(t,q(e,"nTable"));return-1!==n?e[n]:null}function le(t,e,n,o){if(n="DataTables warning: "+(t?"table id="+t.sTableId+" - ":"")+n,o&&(n+=". For more information about this error, please see http://datatables.net/tn/"+o),e)D.console&&console.log&&console.log(n);else{var r=S.ext,a=r.sErrMode||r.errMode;if(t&&ue(t,null,"error",[t,o,n]),"alert"==a)alert(n);else{if("throw"==a)throw new Error(n);"function"==typeof a&&a(t,o,n)}}}function ie(n,o,t,e){z.isArray(t)?z.each(t,function(t,e){z.isArray(e)?ie(n,o,e[0],e[1]):ie(n,o,e)}):(e===U&&(e=t),o[t]!==U&&(n[e]=o[t]))}function se(t,e,n){var o;for(var r in e)e.hasOwnProperty(r)&&(o=e[r],z.isPlainObject(o)?(z.isPlainObject(t[r])||(t[r]={}),z.extend(!0,t[r],o)):n&&"data"!==r&&"aaData"!==r&&z.isArray(o)?t[r]=o.slice():t[r]=o);return t}function de(e,t,n){z(e).on("click.DT",t,function(t){e.blur(),n(t)}).on("keypress.DT",t,function(t){13===t.which&&(t.preventDefault(),n(t))}).on("selectstart.DT",function(){return!1})}function ce(t,e,n,o){n&&t[e].push({fn:n,sName:o})}function ue(n,t,e,o){var r=[];if(t&&(r=z.map(n[t].slice().reverse(),function(t,e){return t.fn.apply(n.oInstance,o)})),null!==e){var a=z.Event(e+".dt");z(n.nTable).trigger(a,o),r.push(a.result)}return r}function fe(t){var e=t._iDisplayStart,n=t.fnDisplayEnd(),o=t._iDisplayLength;n<=e&&(e=n-o),e-=e%o,(-1===o||e<0)&&(e=0),t._iDisplayStart=e}function he(t,e){var n=t.renderer,o=S.ext.renderer[e];return z.isPlainObject(n)&&n[e]?o[n[e]]||o._:"string"==typeof n&&o[n]||o._}function pe(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}var me=[],ge=Array.prototype;v=function(t,e){if(!(this instanceof v))return new v(t,e);function n(t){var e=function(t){var e,n,o=S.settings,r=z.map(o,function(t,e){return t.nTable});return t?t.nTable&&t.oApi?[t]:t.nodeName&&"table"===t.nodeName.toLowerCase()?-1!==(e=z.inArray(t,r))?[o[e]]:null:t&&"function"==typeof t.settings?t.settings().toArray():("string"==typeof t?n=z(t):t instanceof z&&(n=t),n?n.map(function(t){return-1!==(e=z.inArray(this,r))?o[e]:null}).toArray():void 0):[]}(t);e&&(o=o.concat(e))}var o=[];if(z.isArray(t))for(var r=0,a=t.length;r<a;r++)n(t[r]);else n(t);this.context=x(o),e&&z.merge(this,e),this.selector={rows:null,cols:null,opts:null},v.extend(this,this,me)},S.Api=v,z.extend(v.prototype,{any:function(){return 0!==this.count()},concat:ge.concat,context:[],count:function(){return this.flatten().length},each:function(t){for(var e=0,n=this.length;e<n;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new v(e[t],this[t]):null},filter:function(t){var e=[];
2684if(ge.filter)e=ge.filter.call(this,t,this);else for(var n=0,o=this.length;n<o;n++)t.call(this,this[n],n,this)&&e.push(this[n]);return new v(this.context,e)},flatten:function(){var t=[];return new v(this.context,t.concat.apply(t,this.toArray()))},join:ge.join,indexOf:ge.indexOf||function(t,e){for(var n=e||0,o=this.length;n<o;n++)if(this[n]===t)return n;return-1},iterator:function(t,e,n,o){var r,a,l,i,s,d,c,u,f=[],h=this.context,p=this.selector;for("string"==typeof t&&(o=n,n=e,e=t,t=!1),a=0,l=h.length;a<l;a++){var m=new v(h[a]);if("table"===e)(r=n.call(m,h[a],a))!==U&&f.push(r);else if("columns"===e||"rows"===e)(r=n.call(m,h[a],this[a],a))!==U&&f.push(r);else if("column"===e||"column-rows"===e||"row"===e||"cell"===e)for(c=this[a],"column-rows"===e&&(d=Ie(h[a],p.opts)),i=0,s=c.length;i<s;i++)u=c[i],(r="cell"===e?n.call(m,h[a],u.row,u.column,a,i):n.call(m,h[a],u,a,i,d))!==U&&f.push(r)}if(f.length||o){var g=new v(h,t?f.concat.apply([],f):f),b=g.selector;return b.rows=p.rows,b.cols=p.cols,b.opts=p.opts,g}return this},lastIndexOf:ge.lastIndexOf||function(t,e){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(ge.map)e=ge.map.call(this,t,this);else for(var n=0,o=this.length;n<o;n++)e.push(t.call(this,this[n],n));return new v(this.context,e)},pluck:function(e){return this.map(function(t){return t[e]})},pop:ge.pop,push:ge.push,reduce:ge.reduce||function(t,e){return C(this,t,e,0,this.length,1)},reduceRight:ge.reduceRight||function(t,e){return C(this,t,e,this.length-1,-1,-1)},reverse:ge.reverse,selector:null,shift:ge.shift,slice:function(){return new v(this.context,this)},sort:ge.sort,splice:ge.splice,toArray:function(){return ge.slice.call(this)},to$:function(){return z(this)},toJQuery:function(){return z(this)},unique:function(){return new v(this.context,x(this))},unshift:ge.unshift}),v.extend=function(t,e,n){if(n.length&&e&&(e instanceof v||e.__dt_wrapper)){var o,r,a,l=function(e,n,o){return function(){var t=n.apply(e,arguments);return v.extend(t,t,o.methodExt),t}};for(o=0,r=n.length;o<r;o++)e[(a=n[o]).name]="function"==typeof a.val?l(t,a.val,a):z.isPlainObject(a.val)?{}:a.val,e[a.name].__dt_wrapper=!0,v.extend(t,e[a.name],a.propExt)}},v.register=e=function(t,e){if(z.isArray(t))for(var n=0,o=t.length;n<o;n++)v.register(t[n],e);else{var r,a,l,i,s=t.split("."),d=me,c=function(t,e){for(var n=0,o=t.length;n<o;n++)if(t[n].name===e)return t[n];return null};for(r=0,a=s.length;r<a;r++){var u=c(d,l=(i=-1!==s[r].indexOf("()"))?s[r].replace("()",""):s[r]);u||(u={name:l,val:{},methodExt:[],propExt:[]},d.push(u)),r===a-1?u.val=e:d=i?u.methodExt:u.propExt}}},v.registerPlural=t=function(t,e,n){v.register(t,n),v.register(e,function(){var t=n.apply(this,arguments);return t===this?this:t instanceof v?t.length?z.isArray(t[0])?new v(t.context,t[0]):t[0]:U:t})};e("tables()",function(t){return t?new v(function(t,n){if("number"==typeof t)return[n[t]];var o=z.map(n,function(t,e){return t.nTable});return z(o).filter(t).map(function(t){var e=z.inArray(this,o);return n[e]}).toArray()}(t,this.context)):this}),e("table()",function(t){var e=this.tables(t),n=e.context;return n.length?new v(n[0]):e}),t("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable},1)}),t("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody},1)}),t("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead},1)}),t("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot},1)}),t("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper},1)}),e("draw()",function(e){return this.iterator("table",function(t){"page"===e?it(t):("string"==typeof e&&(e="full-hold"!==e),st(t,!1===e))})}),e("page()",function(e){return e===U?this.page.info().page:this.iterator("table",function(t){Pt(t,e)})}),e("page.info()",function(t){if(0===this.context.length)return U;var e=this.context[0],n=e._iDisplayStart,o=e.oFeatures.bPaginate?e._iDisplayLength:-1,r=e.fnRecordsDisplay(),a=-1===o;return{page:a?0:Math.floor(n/o),pages:a?1:Math.ceil(r/o),start:n,end:e.fnDisplayEnd(),length:o,recordsTotal:e.fnRecordsTotal(),recordsDisplay:r,serverSide:"ssp"===pe(e)}}),e("page.len()",function(e){return e===U?0!==this.context.length?this.context[0]._iDisplayLength:U:this.iterator("table",function(t){Lt(t,e)})});function be(r,a,t){if(t){var e=new v(r);e.one("draw",function(){t(e.ajax.json())})}if("ssp"==pe(r))st(r,a);else{Et(r,!0);var n=r.jqXHR;n&&4!==n.readyState&&n.abort(),ft(r,[],function(t){Z(r);for(var e=gt(r,t),n=0,o=e.length;n<o;n++)E(r,e[n]);st(r,a),Et(r,!1)})}}e("ajax.json()",function(){var t=this.context;if(0<t.length)return t[0].json}
2684),e("ajax.params()",function(){var t=this.context;if(0<t.length)return t[0].oAjaxData}),e("ajax.reload()",function(e,n){return this.iterator("table",function(t){be(t,!1===n,e)})}),e("ajax.url()",function(e){var t=this.context;return e===U?0===t.length?U:(t=t[0]).ajax?z.isPlainObject(t.ajax)?t.ajax.url:t.ajax:t.sAjaxSource:this.iterator("table",function(t){z.isPlainObject(t.ajax)?t.ajax.url=e:t.ajax=e})}),e("ajax.url().load()",function(e,n){return this.iterator("table",function(t){be(t,!1===n,e)})});function ye(t,e,n,o,r){var a,l,i,s,d,c,u=[],f=typeof e;for(e&&"string"!=f&&"function"!=f&&e.length!==U||(e=[e]),i=0,s=e.length;i<s;i++)for(d=0,c=(l=e[i]&&e[i].split&&!e[i].match(/[\[\(:]/)?e[i].split(","):[e[i]]).length;d<c;d++)(a=n("string"==typeof l[d]?z.trim(l[d]):l[d]))&&a.length&&(u=u.concat(a));var h=b.selector[t];if(h.length)for(i=0,s=h.length;i<s;i++)u=h[i](o,r,u);return x(u)}function ve(t){return(t=t||{}).filter&&t.search===U&&(t.search=t.filter),z.extend({search:"none",order:"current",page:"all"},t)}function xe(t){for(var e=0,n=t.length;e<n;e++)if(0<t[e].length)return t[0]=t[e],t[0].length=1,t.length=1,t.context=[t.context[e]],t;return t.length=0,t}var Ie=function(t,e){var n,o,r,a=[],l=t.aiDisplay,i=t.aiDisplayMaster,s=e.search,d=e.order,c=e.page;if("ssp"==pe(t))return"removed"===s?[]:p(0,i.length);if("current"==c)for(n=t._iDisplayStart,o=t.fnDisplayEnd();n<o;n++)a.push(l[n]);else if("current"==d||"applied"==d)a="none"==s?i.slice():"applied"==s?l.slice():z.map(i,function(t,e){return-1===z.inArray(t,l)?t:null});else if("index"==d||"original"==d)for(n=0,o=t.aoData.length;n<o;n++)"none"==s?a.push(n):(-1===(r=z.inArray(n,l))&&"removed"==s||0<=r&&"applied"==s)&&a.push(n);return a};e("rows()",function(e,n){e===U?e="":z.isPlainObject(e)&&(n=e,e=""),n=ve(n);var t=this.iterator("table",function(t){return function(a,t,l){var i;return ye("row",t,function(n){var t=h(n);if(null!==t&&!l)return[t];if(i=i||Ie(a,l),null!==t&&-1!==z.inArray(t,i))return[t];if(null===n||n===U||""===n)return i;if("function"==typeof n)return z.map(i,function(t){var e=a.aoData[t];return n(t,e._aData,e.nTr)?t:null});var e=g(m(a.aoData,i,"nTr"));if(n.nodeName){if(n._DT_RowIndex!==U)return[n._DT_RowIndex];if(n._DT_CellIndex)return[n._DT_CellIndex.row];var o=z(n).closest("*[data-dt-row]");return o.length?[o.data("dt-row")]:[]}if("string"==typeof n&&"#"===n.charAt(0)){var r=a.aIds[n.replace(/^#/,"")];if(r!==U)return[r.idx]}return z(e).filter(n).map(function(){return this._DT_RowIndex}).toArray()},a,l)}(t,e,n)},1);return t.selector.rows=e,t.selector.opts=n,t}),e("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||U},1)}),e("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return m(t.aoData,e,"_aData")},1)}),t("rows().cache()","row().cache()",function(o){return this.iterator("row",function(t,e){var n=t.aoData[e];return"search"===o?n._aFilterData:n._aSortData},1)}),t("rows().invalidate()","row().invalidate()",function(n){return this.iterator("row",function(t,e){et(t,e,n)})}),t("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e},1)}),t("rows().ids()","row().id()",function(t){for(var e=[],n=this.context,o=0,r=n.length;o<r;o++)for(var a=0,l=this[o].length;a<l;a++){var i=n[o].rowIdFn(n[o].aoData[this[o][a]]._aData);e.push((!0===t?"#":"")+i)}return new v(n,e)}),t("rows().remove()","row().remove()",function(){var f=this;return this.iterator("row",function(t,e,n){var o,r,a,l,i,s,d=t.aoData,c=d[e];for(d.splice(e,1),o=0,r=d.length;o<r;o++)if(s=(i=d[o]).anCells,null!==i.nTr&&(i.nTr._DT_RowIndex=o),null!==s)for(a=0,l=s.length;a<l;a++)s[a]._DT_CellIndex.row=o;tt(t.aiDisplayMaster,e),tt(t.aiDisplay,e),tt(f[n],e,!1),0<t._iRecordsDisplay&&t._iRecordsDisplay--,fe(t);var u=t.rowIdFn(c._aData);u!==U&&delete t.aIds[u]}),this.iterator("table",function(t){for(var e=0,n=t.aoData.length;e<n;e++)t.aoData[e].idx=e}),this}),e("rows.add()",function(a){var t=this.iterator("table",function(t){var e,n,o,r=[];for(n=0,o=a.length;n<o;n++)(e=a[n]).nodeName&&"TR"===e.nodeName.toUpperCase()?r.push(W(t,e)[0]):r.push(E(t,e));return r},1),e=this.rows(-1);return e.pop(),z.merge(e,t),e}),e("row()",function(t,e){return xe(this.rows(t,e))}),e("row().data()",function(t){var e=this.context;return t===U?e.length&&this.length?e[0].aoData[this[0]]._aData:U:(e[0].aoData[this[0]]._aData=t,et(e[0],this[0],"data"),this)}),e("row().node()",function(){var t=this.context;return t.length&&this.length&&t[0].aoData[this[0]].nTr||null}),e("row.add()",function(e){e instanceof z&&e.length&&(e=e[0]);
2684var t=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?W(t,e)[0]:E(t,e)});return this.row(t[0])});function we(t,e){var n=t.context;if(n.length){var o=n[0].aoData[e!==U?e:t[0]];o&&o._details&&(o._details.remove(),o._detailsShow=U,o._details=U)}}function Ce(t,e){var n=t.context;if(n.length&&t.length){var o=n[0].aoData[t[0]];o._details&&((o._detailsShow=e)?o._details.insertAfter(o.nTr):o._details.detach(),_e(n[0]))}}var _e=function(s){var r=new v(s),t=".dt.DT_details",e="draw"+t,n="column-visibility"+t,o="destroy"+t,d=s.aoData;r.off(e+" "+n+" "+o),0<q(d,"_details").length&&(r.on(e,function(t,e){s===e&&r.rows({page:"current"}).eq(0).each(function(t){var e=d[t];e._detailsShow&&e._details.insertAfter(e.nTr)})}),r.on(n,function(t,e,n,o){if(s===e)for(var r,a=O(e),l=0,i=d.length;l<i;l++)(r=d[l])._details&&r._details.children("td[colspan]").attr("colspan",a)}),r.on(o,function(t,e){if(s===e)for(var n=0,o=d.length;n<o;n++)d[n]._details&&we(r,n)}))},Te="row().child",Fe=Te+"()";e(Fe,function(t,e){var n=this.context;return t===U?n.length&&this.length?n[0].aoData[this[0]]._details:U:(!0===t?this.child.show():!1===t?we(this):n.length&&this.length&&function(a,t,e,n){var l=[],i=function(t,e){if(z.isArray(t)||t instanceof z)for(var n=0,o=t.length;n<o;n++)i(t[n],e);else if(t.nodeName&&"tr"===t.nodeName.toLowerCase())l.push(t);else{var r=z("<tr><td/></tr>").addClass(e);z("td",r).addClass(e).html(t)[0].colSpan=O(a),l.push(r[0])}};i(e,n),t._details&&t._details.detach(),t._details=z(l),t._detailsShow&&t._details.insertAfter(t.nTr)}(n[0],n[0].aoData[this[0]],t,e),this)}),e([Te+".show()",Fe+".show()"],function(t){return Ce(this,!0),this}),e([Te+".hide()",Fe+".hide()"],function(){return Ce(this,!1),this}),e([Te+".remove()",Fe+".remove()"],function(){return we(this),this}),e(Te+".isShown()",function(){var t=this.context;return t.length&&this.length&&t[0].aoData[this[0]]._detailsShow||!1});function Se(t,e,n,o,r){for(var a=[],l=0,i=r.length;l<i;l++)a.push(F(t,r[l],e));return a}var De=/^([^:]+):(name|visIdx|visible)$/;e("columns()",function(e,n){e===U?e="":z.isPlainObject(e)&&(n=e,e=""),n=ve(n);var t=this.iterator("table",function(t){return function(s,t,d){var c=s.aoColumns,u=q(c,"sName"),f=q(c,"nTh");return ye("column",t,function(n){var t=h(n);if(""===n)return p(c.length);if(null!==t)return[0<=t?t:c.length+t];if("function"==typeof n){var o=Ie(s,d);return z.map(c,function(t,e){return n(e,Se(s,e,0,0,o),f[e])?e:null})}var r="string"==typeof n?n.match(De):"";if(r)switch(r[2]){case"visIdx":case"visible":var e=parseInt(r[1],10);if(e<0){var a=z.map(c,function(t,e){return t.bVisible?e:null});return[a[a.length+e]]}return[V(s,e)];case"name":return z.map(u,function(t,e){return t===r[1]?e:null});default:return[]}if(n.nodeName&&n._DT_CellIndex)return[n._DT_CellIndex.column];var l=z(f).filter(n).map(function(){return z.inArray(this,f)}).toArray();if(l.length||!n.nodeName)return l;var i=z(n).closest("*[data-dt-column]");return i.length?[i.data("dt-column")]:[]},s,d)}(t,e,n)},1);return t.selector.cols=e,t.selector.opts=n,t}),t("columns().header()","column().header()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh},1)}),t("columns().footer()","column().footer()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf},1)}),t("columns().data()","column().data()",function(){return this.iterator("column-rows",Se,1)}),t("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].mData},1)}),t("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(t,e,n,o,r){return m(t.aoData,r,"search"===a?"_aFilterData":"_aSortData",e)},1)}),t("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,n,o,r){return m(t.aoData,r,"anCells",e)},1)}),t("columns().visible()","column().visible()",function(n,o){var t=this.iterator("column",function(t,e){if(n===U)return t.aoColumns[e].bVisible;!function(t,e,n){var o,r,a,l,i=t.aoColumns,s=i[e],d=t.aoData;if(n===U)return s.bVisible;if(s.bVisible!==n){if(n){var c=z.inArray(!0,q(i,"bVisible"),e+1);for(r=0,a=d.length;r<a;r++)l=d[r].nTr,o=d[r].anCells,l&&l.insertBefore(o[e],o[c]||null)}else z(q(t.aoData,"anCells",e)).detach();s.bVisible=n,lt(t,t.aoHeader),lt(t,t.aoFooter),oe(t)}}(t,e,n)});return n!==U&&(this.iterator("column",function(t,e){ue(t,null,"column-visibility",[t,e,n,o])}),o!==U&&!o||this.columns.adjust()),t}),t("columns().indexes()","column().index()",function(n){return this.iterator("column",function(t,e){return"visible"===n?_(t,e):e},1)}),e("columns.adjust()",function(){return this.iterator("table",function(t){X(t)},1)}),e("column.index()",function(t,e){if(0!==this.context.length){var n=this.context[0];if("fromVisible"===t||"toData"===t)return V(n,e);if("fromData"===t||"toVisible"===t)return _(n,e)}}),e("column()",function(t,e){return xe(this.columns(t,e))});e("cells()",function(e,t,n){if(z.isPlainObject(e)&&(e.row===U?(n=e,e=null):(n=t,t=null)),z.isPlainObject(t)&&(n=t,t=null),null===t||t===U)return this.iterator("table",function(t){return function(o,t,e){var r,a,l,i,s,d,c,u=o.aoData,f=Ie(o,e),n=g(m(u,f,"anCells")),h=z([].concat.apply([],n)),p=o.aoColumns.length;return ye("cell",t,function(t){var e="function"==typeof t;if(null===t||t===U||e){for(a=[],l=0,i=f.length;l<i;l++)for(r=f[l],s=0;s<p;s++)d={row:r,column:s},e?(c=u[r],t(d,F(o,r,s),c.anCells?c.anCells[s]:null)&&a.push(d)):a.push(d);return a}if(z.isPlainObject(t))return[t];var n=h.filter(t).map(function(t,e){return{row:e._DT_CellIndex.row,column:e._DT_CellIndex.column}}).toArray();return n.length||!t.nodeName?n:(c=z(t).closest("*[data-dt-row]")).length?[{row:c.data("dt-row"),column:c.data("dt-column")}]:[]},o,e)}(t,e,ve(n))});var o,r,a,l,i,s=this.columns(t,n),d=this.rows(e,n),c=this.iterator("table",function(t,e){for(o=[],r=0,a=d[e].length;r<a;r++)for(l=0,i=s[e].length;l<i;l++)o.push({row:d[e][r],column:s[e][l]});return o},1);return z.extend(c.selector,{cols:t,rows:e,opts:n}
vendor: 4,240 bytes, line 2684
2684),c}),t("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,n){var o=t.aoData[e];return o&&o.anCells?o.anCells[n]:U},1)}),e("cells().data()",function(){return this.iterator("cell",function(t,e,n){return F(t,e,n)},1)}),t("cells().cache()","cell().cache()",function(o){return o="search"===o?"_aFilterData":"_aSortData",this.iterator("cell",function(t,e,n){return t.aoData[e][o][n]},1)}),t("cells().render()","cell().render()",function(o){return this.iterator("cell",function(t,e,n){return F(t,e,n,o)},1)}),t("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,n){return{row:e,column:n,columnVisible:_(t,n)}},1)}),t("cells().invalidate()","cell().invalidate()",function(o){return this.iterator("cell",function(t,e,n){et(t,e,o,n)})}),e("cell()",function(t,e,n){return xe(this.cells(t,e,n))}),e("cell().data()",function(t){var e=this.context,n=this[0];return t===U?e.length&&n.length?F(e[0],n[0].row,n[0].column):U:(M(e[0],n[0].row,n[0].column,t),et(e[0],n[0].row,"data",n[0].column),this)}),e("order()",function(e,t){var n=this.context;return e===U?0!==n.length?n[0].aaSorting:U:("number"==typeof e?e=[[e,t]]:e.length&&!z.isArray(e[0])&&(e=Array.prototype.slice.call(arguments)),this.iterator("table",function(t){t.aaSorting=e.slice()}))}),e("order.listener()",function(e,n,o){return this.iterator("table",function(t){te(t,e,n,o)})}),e("order.fixed()",function(e){if(e)return this.iterator("table",function(t){t.aaSortingFixed=z.extend(!0,{},e)});var t=this.context,n=t.length?t[0].aaSortingFixed:U;return z.isArray(n)?{pre:n}:n}),e(["columns().order()","column().order()"],function(o){var r=this;return this.iterator("table",function(t,e){var n=[];z.each(r[e],function(t,e){n.push([e,o])}),t.aaSorting=n})}),e("search()",function(e,n,o,r){var t=this.context;return e===U?0!==t.length?t[0].oPreviousSearch.sSearch:U:this.iterator("table",function(t){t.oFeatures.bFilter&&yt(t,z.extend({},t.oPreviousSearch,{sSearch:e+"",bRegex:null!==n&&n,bSmart:null===o||o,bCaseInsensitive:null===r||r}),1)})}),t("columns().search()","column().search()",function(o,r,a,l){return this.iterator("column",function(t,e){var n=t.aoPreSearchCols;if(o===U)return n[e].sSearch;t.oFeatures.bFilter&&(z.extend(n[e],{sSearch:o+"",bRegex:null!==r&&r,bSmart:null===a||a,bCaseInsensitive:null===l||l}),yt(t,t.oPreviousSearch,1))})}),e("state()",function(){return this.context.length?this.context[0].oSavedState:null}),e("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})}),e("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),e("state.save()",function(){return this.iterator("table",function(t){oe(t)})}),S.versionCheck=S.fnVersionCheck=function(t){for(var e,n,o=S.version.split("."),r=t.split("."),a=0,l=r.length;a<l;a++)if((e=parseInt(o[a],10)||0)!==(n=parseInt(r[a],10)||0))return n<e;return!0},S.isDataTable=S.fnIsDataTable=function(t){var r=z(t).get(0),a=!1;return t instanceof S.Api||(z.each(S.settings,function(t,e){var n=e.nScrollHead?z("table",e.nScrollHead)[0]:null,o=e.nScrollFoot?z("table",e.nScrollFoot)[0]:null;e.nTable!==r&&n!==r&&o!==r||(a=!0)}),a)},S.tables=S.fnTables=function(e){var t=!1;z.isPlainObject(e)&&(t=e.api,e=e.visible);var n=z.map(S.settings,function(t){if(!e||e&&z(t.nTable).is(":visible"))return t.nTable});return t?new v(n):n},S.camelToHungarian=A,e("$()",function(t,e){var n=this.rows(e).nodes(),o=z(n);return z([].concat(o.filter(t).toArray(),o.find(t).toArray()))}),z.each(["on","one","off"],function(t,n){e(n+"()",function(){var t=Array.prototype.slice.call(arguments);t[0]=z.map(t[0].split(/\s/),function(t){return t.match(/\.dt\b/)?t:t+".dt"}).join(" ");var e=z(this.tables().nodes());return e[n].apply(e,t),this})}),e("clear()",function(){return this.iterator("table",function(t){Z(t)})}),e("settings()",function(){return new v(this.context,this.context)}),e("init()",function(){var t=this.context;return t.length?t[0].oInit:null}),e("data()",function(){return this.iterator("table",function(t){return q(t.aoData,"_aData")}).flatten()}),e("destroy()",function(p){return p=p||!1,this.iterator("table",function(e){var n,t=e.nTableWrapper.parentNode,o=e.oClasse
vendor: 5,512 bytes, line 2684
2684s,r=e.nTable,a=e.nTBody,l=e.nTHead,i=e.nTFoot,s=z(r),d=z(a),c=z(e.nTableWrapper),u=z.map(e.aoData,function(t){return t.nTr});e.bDestroying=!0,ue(e,"aoDestroyCallback","destroy",[e]),p||new v(e).columns().visible(!0),c.off(".DT").find(":not(tbody *)").off(".DT"),z(D).off(".DT-"+e.sInstance),r!=l.parentNode&&(s.children("thead").detach(),s.append(l)),i&&r!=i.parentNode&&(s.children("tfoot").detach(),s.append(i)),e.aaSorting=[],e.aaSortingFixed=[],ee(e),z(u).removeClass(e.asStripeClasses.join(" ")),z("th, td",l).removeClass(o.sSortable+" "+o.sSortableAsc+" "+o.sSortableDesc+" "+o.sSortableNone),d.children().detach(),d.append(u);var f=p?"remove":"detach";s[f](),c[f](),!p&&t&&(t.insertBefore(r,e.nTableReinsertBefore),s.css("width",e.sDestroyWidth).removeClass(o.sTable),(n=e.asDestroyStripes.length)&&d.children().each(function(t){z(this).addClass(e.asDestroyStripes[t%n])}));var h=z.inArray(e,S.settings);-1!==h&&S.settings.splice(h,1)})}),z.each(["column","row","cell"],function(t,s){e(s+"s().every()",function(a){var l=this.selector.opts,i=this;return this.iterator(s,function(t,e,n,o,r){a.call(i[s](e,"cell"===s?n:l,"cell"===s?l:U),e,n,o,r)})})}),e("i18n()",function(t,e,n){var o=this.context[0],r=Y(t)(o.oLanguage);return r===U&&(r=e),n!==U&&z.isPlainObject(r)&&(r=r[n]!==U?r[n]:r._),r.replace("%d",n)}),S.version="1.10.16",S.settings=[],S.models={},S.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0},S.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1},S.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null},S.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(t){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(t){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:z.extend({},S.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"},I(S.defaults),S.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},I(S.defaults.column),S.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:U,oAjaxD
2684ata:U,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==pe(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==pe(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,n=e+t,o=this.aiDisplay.length,r=this.oFeatures,a=r.bPaginate;return r.bServerSide?!1===a||-1===t?e+o:Math.min(e+t,this._iRecordsDisplay):!a||o<n||-1===t?o:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null},S.ext=b={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:S.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:S.version},z.extend(b,{afnFiltering:b.search,aTypes:b.type.detect,ofnSearch:b.type.search,oSort:b.type.order,afnSortData:b.order,aoFeatures:b.feature,oApi:b.internal,oStdClasses:b.classes,oPagination:b.pager}),z.extend(S.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ae=S.ext.pager;function Re(t,e){var n=[],o=Ae.numbers_length,r=Math.floor(o/2);return e<=o?n=p(0,e):t<=r?((n=p(0,o-2)).push("ellipsis"),n.push(e-1)):(e-1-r<=t?(n=p(e-(o-2),e)).splice(0,0,"ellipsis"):((n=p(t-r+2,t+r-1)).push("ellipsis"),n.push(e-1),n.splice(0,0,"ellipsis")),n.splice(0,0,0)),n.DT_el="span",n}z.extend(Ae,{simple:function(t,e){return["previous","next"]},full:function(t,e){return["first","previous","next","last"]},numbers:function(t,e){return[Re(t,e)]},simple_numbers:function(t,e){return["previous",Re(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Re(t,e),"next","last"]},first_last_numbers:function(t,e){return["first",Re(t,e),"last"]},_numbers:Re,numbers_length:7}),z.extend(!0,S.ext.renderer,{pageButton:{_:function(i,t,s,e,d,c){var u,f,n,h=i.oClasses,p=i.oLanguage.oPaginate,m=i.oLanguage.oAria.paginate||{},g=0,b=function(t,e){function n(t){Pt(i,t.data.action,!0)}var o,r,a;for(o=0,r=e.length;o<r;o++)if(a=e[o],z.isArray(a)){var l=z("<"+(a.DT_el||"div")+"/>").appendTo(t);b(l,a)}else{switch(u=null,f="",a){case"ellipsis":t.append('<span class="ellipsis">…</span>');break;case"first":u=p.sFirst,f=a+(0<d?"":" "+h.sPageButtonDisabled);break;case"previous":u=p.sPrevious,f=a+(0<d?"":" "+h.sPageButtonDisabled);break;case"next":u=p.sNext,f=a+(d<c-1?"":" "+h.sPageButtonDisabled);break;case"last":u=p.sLast,f=a+(d<c-1?"":" "+h.sPageButtonDisabled);break;default:u=a+1,f=d===a?h.sPageButtonActive:""}null!==u&&(de(z("<a>",{class:h.sPageButton+" "+f,"aria-controls":i.sTableId,"aria-label":m[a],"data-dt-idx":g,tabindex:i.iTabIndex,id:0===s&&"string"==typeof a?i.sTableId+"_"+a:null}).html(u).appendTo(t),{action:a},n),g++)}};try{n=z(t).find(y.activeElement).data("dt-idx")}catch(t){}b(z(t).empty(),e),n!==U&&z(t).find("[data-dt-idx="+n+"]").focus()}}}),z.extend(S.ext.type.detect,[function(t,e){var n=e.oLanguage.sDecimal;return o(t,n)?"num"+n:null},function(t,e){if(t&&!(t instanceof Date)&&!d.test(t))return null;var n=Date.parse(t);return null!==n&&!isNaN(n)||r(t)?"date":null},function(t,e){var n=e.oLanguage.sDecimal;return o(t,n,!0)?"num-fmt"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return l(t,n)?"html-num"+n:null},function(t,e){var n=e.oLanguage.sDecimal;return l(t,n,!0)?"html-num-fmt"+n:null},function(t,e){return r(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]),z.extend(S.ext.type.search,{html:function(t){return r(t)?t:"string"==typeof t?t.replace(i," ").replace(s,""):""},string:function(t){return r(t)?t:"string"==typeof t?t.replace(i," "):t}});var Be=function(t,e,n,o){return 0===t||t&&"-"!==t?(e&&(t=a(t,e)),t.replace&&(n&&(t=t.replace(n,"")),o&&(t=t.replace(o,""))),1*t):-1/0};function ke(n){z.each({num:function(t){return Be(t,n)},"num-fmt":function(t){return Be(t,n,u)},"html-num":function(t){return Be(t,n,s)},"html-num-fmt":function(t){return Be(t,n,s,u)}},function(t,e){b.type.order[t+n+"-pre"]=e,t.match(/^html\-/)&&(b.type.search[t+n]=b.type.search.html)})}z.extend(b.type.order,{"date-pre":function(t){return Date.parse(t)||-1/0},"html-pre":function(t){return r(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return r(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return t<e?-1:e<t?1:0},"string-desc":function(t,e){return t<e?1:e<t?-1:0}}),ke(""),z.extend(!0,S.ext.renderer,{header:{_:function(a,l,i,s){z(a.nTable).on("order.dt.DT",function(t,e,n,o){if(a===e){var r=i.idx;l.removeClass(i.sSortingClass+" "+s.sSortAsc+" "+s.sSortDesc).addClass("asc"==o[r]?s.sSortAsc:"desc"==o[r]?s.sSortDesc:i.sSortingClass)}})},jqueryui:function(a,l,i,s){z("<div/>").addClass(s.sSortJUIWrapper).append(l.contents()).append(z("<span/>").addClass(s.sSortIcon+" "+i.sSortingClassJUI)).appendTo(l),z(a.nTable).on("order.dt.DT",function(t,e,n,o){if(a===e){var r=i.idx;l.removeClass(s.sSortAsc+" "+s.sSortDesc).addClass("asc"==o[r]?s.sSortAsc:"desc"==o[r]?s.sSortDesc:i.sSortingClass),l.find("span."+s.sSortIcon).removeClass(s.sSortJUIAsc+" "+s.sSortJUIDesc+" "+s.sSortJUI+" "+s.sSortJUIAscAllowed+" "+s.sSortJUIDescAllowed).addClass("asc"==o[r]?s.sSortJUIAsc:"desc"==o[r]?s.sSortJUIDesc:i.sSortingClassJUI)}})}}});function Ne(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t}function Le(e){return function(){var t=[ae(this[S.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return S.ext.internal[e].apply(this,t)}}return S.render={number:function(a,l,i,s,d){return{display:function(t){if("number"!=typeof t&&"string"!=typeof t)return t;var e=t<0?"-":"",n=parseFloat(t);if(isNaN(n))return Ne(t);n=n.toFixed(i),t=Math.abs(n);var o=parseInt(t,10),r=i?l+(t-o).toFixed(i).substring(2):"";return e+(s||"")+o.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+r+(d||"")}}},text:function(){return{display:Ne}}},z.extend(S.ext.internal,{_fnExternApiFunc:Le,_fnBuildAjax:ft,_fnAjaxUpdate:ht,_fnAjaxParameters:pt,_fnAjaxUpdateDraw:mt,_fnAjaxDataSrc:gt,_fnAddColumn:L,_fnColumnOptions:H,_fnAdjustColumnSizing:X,_fnVisibleToColumnIndex:V,_fnColumnIndexToVisible:_,_fnVisbleColumns:O,_fnGetColumns:P,_fnColumnTypes:T,_fnApplyColumnDefs:j,_fnHungarianMap:I,_fnCamelToHungarian:A,_fnLanguageCompat:R,_fnBrowserDetect:N,_fnAddData:E,_fnAddTr:W,_fnNodeToDataIndex:function(t,e){return e._DT_RowIndex!==U?e._DT_RowIndex:null},_fnNodeToColumnIndex:function(t,e,n){return z.inArray(n,t.aoData[e].anCells)},_fnGetCellData:F,_fnSetCellData:M,_fnSplitObjNotation:J,_fnGetObjectDataFn:Y,_fnSetObjectDataFn:K,_fnGetDataMaster:Q,_fnClearTable:Z,_fnDeleteIndex:tt,_fnInvalidate:et,_fnGetRowElements:nt,_fnCreateTr:ot,_fnBuildHead:at,_fnDrawHead:lt,_fnDraw:it,_fnReDraw:st,_fnAddOptionsHtml:dt,_fnDetectHeader:ct,_fnGetUniqueThs:ut,_fnFeatureHtmlFilter:bt,_fnFilterComplete:yt,_fnFilterCustom:vt,_fnFilterColumn:xt,_fnFilter:It,_fnFilterCreateSearch:wt,_fnEscapeRegex:Ct,_fnFilterData:Ft,_fnFeatureHtmlInfo:At,_fnUpdateInfo:Rt,_fnInfoMacros:Bt,_fnInitialise:kt,_fnInitComplete:Nt,_fnLengthChange:Lt,_fnFeatureHtmlLength:Ht,_fnFeatureHtmlPaginate:Ot,_fnPageChange:Pt,_fnFeatureHtmlProcessing:jt,_fnProcessingDisplay:Et,_fnFeatureHtmlTable:Wt,_fnScrollDraw:Mt,_fnApplyToChildren:zt,_fnCalculateColumnWidths:qt,_fnThrottle:Xt,_fnConvertToWidth:Vt,_fnGetWidestNode:$t,_fnGetMaxLenString:Gt,_fnStringToCss:Jt,_fnSortFlatten:Yt,_fnSort:Kt,_fnSortAria:Qt,_fnSortListener:Zt,_fnSortAttachListener:te,_fnSortingClasses:ee,_fnSortData:ne,_fnSaveState:oe,_fnLoadState:re,_fnSettingsFromNode:ae,_fnLog:le,_fnMap:ie,_fnBindAction:de,_fnCallbackReg:ce,_fnCallbackFire:ue,_fnLengthOverflow:fe,_fnRenderer:he,_fnDataSource:pe,_fnRowAttributes:rt,_fnCalculateEnd:function(){}}),((z.fn.dataTable=S).$=z).fn.dataTableSettings=S.settings,z.fn.dataTableExt=S.ext,z.fn.DataTable=function(t){return z(this).dataTable(t).api()},z.each(S,function(t,e){z.fn.DataTable[t]=e}),z.fn.dataTable}),function(n){"function"==typeof define&&define.amd?define("datatables.net-bs",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(v,t,o,r){"use strict";var a=v.fn.dataTable;return v.extend(!0,a.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"}),v.extend(a.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"}),a.ext.renderer.pageButton.bootstrap=function(i,t,s,e,d,c){var u,f,n,h=new a.Api(i),p=i.oClasses,m=i.oLanguage.oPaginate,g=i.oLanguage.oAria.paginate||{},b=0,y=function(t,e){function n(t){t.preventDefault(),v(t.currentTarget).hasClass("disabled")||h.page()==t.data.action||h.page(t.data.action).draw("page")}var o,r,a,l;for(o=0,r=e.length;o<r;o++)if(l=e[o],v.isArray(l))y(t,l);else{switch(f=u="",l){case"ellipsis":u="…",f="disabled";break;case"first":u=m.sFirst,f=l+(0<d?"":" disabled");break;case"previous":u=m.sPrevious,f=l+(0<d?"":" disabled");break;case"next":u=m.sNext,f=l+(d<c-1?"":" disabled");break;case"last":u=m.sLast,f=l+(d<c-1?"":" disabled");break;default:u=l+1,f=d===l?"active":""}u&&(a=v("<li>",{class:p.sPageButton+" "+f,id:0===s&&"string"==typeof l?i.sTableId+"_"+l:null}).append(v("<a>",{href:"#","aria-controls":i.sTableId,"aria-label":g[l],"data-dt-idx":b,tabindex:i.iTabIndex}).html(u)).appendTo(t),i.oApi._fnBindAction(a,{action:l},n),b++)}};try{n=v(t).find(o.activeElement).data("dt-idx")}catch(t){}y(v(t).empty().html('<ul class="pagination"/>').children("ul"),e),n!==r&&v(t).find("[data-dt-idx="+n+"]").focus()},a}),function(n){"function"==typeof define&&define.amd?define("datatables.net-buttons",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(p,i,a,c){var r,m=p.fn.dataTable,n=0,d=0,s=m.ext.buttons,u=function(t,e){void 0===e&&(e={}),!0===e&&(e={}),p.isArray(e)&&(e={buttons:e}),this.c=p.extend(!0,{},u.defaults,e),e.buttons&&(this.c.buttons=e.buttons),this.s={dt:new m.Api(t),buttons:[],listenKeys:"",namespace:"dtb"+n++},this.dom={container:p("<"+this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)},this._constructor()};p.extend(u.prototype,{action:function(t,e){var n=this._nodeToButton(t);return e===c?n.conf.action:(n.conf.action=e,this)},active:function(t,e){var n=this._nodeToButton(t),o=this.c.dom.button.active;n=p(n.node);return e===c?n.hasClass(o):(n.toggleClass(o,e===c||e),this)},add:function(t,e){var n=this.s.buttons;if("string"==typeof e){for(var o=e.split("-"),r=(n=this.s,0),a=o.length-1;r<a;r++)n=n.buttons[1*o[r]];n=n.buttons,e=1*o[o.length-1]}return this._expandButton(n,t,!1,e),this._draw(),this},container:function(){return this.dom.container},disable:function(t){return t=this._nodeToButton(t),p(t.node).addClass(this.c.dom.button.disabled),this},destroy:function(){p("body").off("keyup."+this.s.namespace);var t,e,n=this.s.buttons.slice();for(t=0,e=n.length;t<e;t++)this.remove(n[t].node);for(this.dom.container.remove(),t=0,e=(n=this.s.dt.settings()[0]).length;t<e;t++)if(n.inst===this){n.splice(t,1);break}return this},enable:function(t,e){if(!1===e)return this.disable(t);var n=this._nodeToButton(t);return p(n.node).removeClass(this.c.dom.button.disabled),this},name:function(){return this.c.name},node:function(t){return t=this._nodeToButton(t),p(t.node)},processing:function(t,e){var n=this._nodeToButton(t);return e===c?p(n.node).hasClass("processing"):(p(n.node).toggleClass("processing",e),this)},remove:function(t){var e=this._nodeToButton(t),n=this._nodeToHost(t),o=this.s.dt;if(e.buttons.length)for(var r=e.buttons.length-1;0<=r;r--)this.remove(e.buttons[r].node);return e.conf.destroy&&e.conf.destroy.call(o.button(t),o,p(t),e.conf),this._removeKey(e.conf),p(e.node).remove(),t=p.inArray(e,n),n.splice(t,1),this},text:function(t,e){function n(t){return"function"==typeof t?t(a,l,o.conf):t}var o=this._nodeToButton(t),r=this.c.dom.collection.buttonLiner,a=(r=o.inCollection&&r&&r.tag?r.tag:this.c.dom.buttonLiner.tag,this.s.dt),l=p(o.node);return e===c?n(o.conf.text):(o.conf.text=e,r?l.children(r).html(n(e)):l.html(n(e)),this)},_constructor:function(){var n=this,t=this.s.dt,e=t.settings()[0],o=this.c.buttons;e._buttons||(e._buttons=[]),e._buttons.push({inst:this,name:this.c.name});e=0;for(var r=o.length;e<r;e++)this.add(o[e]);t.on("destroy",function(){n.destroy()}),p("body").on("keyup."+this.s.namespace,function(t){if(!a.activeElement||a.activeElement===a.body){var e=String.fromCharCode(t.keyCode).toLowerCase();-1!==n.s.listenKeys.toLowerCase().indexOf(e)&&n._keypress(e,t)}})},_addKey:function(t){t.key&&(this.s.listenKeys+=p.isPlainObject(t.key)?t.key.key:t.key)},_draw:function(t,e){t||(t=this.dom.container,e=this.s.buttons),t.children().detach();for(var n=0,o=e.length;n<o;n++)t.append(e[n].inserter),t.append(" "),e[n].buttons&&e[n].buttons.length&&this._draw(e[n].collection,e[n].buttons)},_expandButton:function(t,e,n,o){for(var r=this.s.dt,a=0,l=(e=p.isArray(e)?e:[e]).length;a<l;a++){var i=this._resolveExtends(e[a]);if(i)if(p.isArray(i))this._expandButton(t,i,n,o);else{var s=this._buildButton(i,n);if(s){if(o!==c?(t.splice(o,0,s),o++):t.push(s),s.conf.buttons){var d=this.c.dom.collection;s.collection=p("<"+d.tag+"/>").addClass(d.className).attr("role","menu"),s.conf._collection=s.collection,this._expandButton(s.buttons,s.conf.buttons,!0,o)}i.init&&i.init.call(r.button(s.node),r,p(s.node),i),0}}}},_buildButton:function(e,t){function n(t){return"function"==typeof t?t(l,s,e):t}var o=this.c.dom.button,r=this.c.dom.buttonLiner,a=this.c.dom.collection,l=this.s.dt;if(t&&a.button&&(o=a.button),t&&a.buttonLiner&&(r=a.buttonLiner),e.available&&!e.available(l,e))return!1;function i(t,e,n,o){o.action.call(e.button(n),t,e,n,o),p(e.table().node()).triggerHandler("buttons-action.dt",[e.button(n),e,n,o])}var s=p("<"+o.tag+"/>").addClass(o.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",function(t){t.preventDefault(),!s.hasClass(o.disabled)&&e.action&&i(t,l,s,e),s.blur()}).on("keyup.dtb",function(t){13===t.keyCode&&!s.hasClass(o.disabled)&&e.action&&i(t,l,s,e)});return"a"===o.tag.toLowerCase()&&s.attr("href","#"),r.tag?(a=p("<"+r.tag+"/>").html(n(e.text)).addClass(r.className),"a"===r.tag.toLowerCase()&&a.attr("href","#"),s.append(a)):s.html(n(e.text)),!1===e.enabled&&s.addClass(o.disabled),e.className&&s.addClass(e.className),e.titleAttr&&s.attr("title",n(e.titleAttr)),e.namespace||(e.namespace=".dt-button-"+d++),r=(r=this.c.dom.buttonContainer)&&r.tag?p("<"+r.tag+"/>").addClass(r.className).append(s):s,this._addKey(e),{conf:e,node:s.get(0),inserter:r,buttons:[],
2684inCollection:t,collection:null}},_nodeToButton:function(t,e){for(var n=0,o=(e=e||this.s.buttons).length;n<o;n++){if(e[n].node===t)return e[n];if(e[n].buttons.length){var r=this._nodeToButton(t,e[n].buttons);if(r)return r}}},_nodeToHost:function(t,e){for(var n=0,o=(e=e||this.s.buttons).length;n<o;n++){if(e[n].node===t)return e;if(e[n].buttons.length){var r=this._nodeToHost(t,e[n].buttons);if(r)return r}}},_keypress:function(a,l){var i=function(t){for(var e=0,n=t.length;e<n;e++){var o=t[e].conf,r=t[e].node;o.key&&(o.key===a?p(r).click():!p.isPlainObject(o.key)||o.key.key!==a||o.key.shiftKey&&!l.shiftKey||o.key.altKey&&!l.altKey||o.key.ctrlKey&&!l.ctrlKey||o.key.metaKey&&!l.metaKey||p(r).click()),t[e].buttons.length&&i(t[e].buttons)}};i(this.s.buttons)},_removeKey:function(t){if(t.key){var e=p.isPlainObject(t.key)?t.key.key:t.key;t=this.s.listenKeys.split(""),e=p.inArray(e,t);t.splice(e,1),this.s.listenKeys=t.join("")}},_resolveExtends:function(n){function t(t){for(var e=0;!p.isPlainObject(t)&&!p.isArray(t);){if(t===c)return;if("function"==typeof t){if(!(t=t(r,n)))return!1}else if("string"==typeof t){if(!s[t])throw"Unknown button type: "+t;t=s[t]}if(30<++e)throw"Buttons: Too many iterations"}return p.isArray(t)?t:p.extend({},t)}var e,o,r=this.s.dt;for(n=t(n);n&&n.extend;){if(!s[n.extend])throw"Cannot extend unknown button type: "+n.extend;var a=t(s[n.extend]);if(p.isArray(a))return a;if(!a)return!1;e=a.className,n=p.extend({},a,n),e&&n.className!==e&&(n.className=e+" "+n.className);var l=n.postfixButtons;if(l){for(n.buttons||(n.buttons=[]),e=0,o=l.length;e<o;e++)n.buttons.push(l[e]);n.postfixButtons=null}if(l=n.prefixButtons){for(n.buttons||(n.buttons=[]),e=0,o=l.length;e<o;e++)n.buttons.splice(e,0,l[e]);n.prefixButtons=null}n.extend=a.extend}return n}}),u.background=function(t,e,n){n===c&&(n=400),t?p("<div/>").addClass(e).css("display","none").appendTo("body").fadeIn(n):p("body > div."+e).fadeOut(n,function(){p(this).removeClass(e).remove()})},u.instanceSelector=function(t,o){if(!t)return p.map(o,function(t){return t.inst});var r=[],a=p.map(o,function(t){return t.name}),l=function(t){if(p.isArray(t))for(var e=0,n=t.length;e<n;e++)l(t[e]);else"string"==typeof t?-1!==t.indexOf(",")?l(t.split(",")):-1!==(t=p.inArray(p.trim(t),a))&&r.push(o[t].inst):"number"==typeof t&&r.push(o[t].inst)};return l(t),r},u.buttonSelector=function(t,e){for(var l=[],i=function(t,e,n){for(var o,r,a=0,l=e.length;a<l;a++)(o=e[a])&&(r=n!==c?n+a:a+"",t.push({node:o.node,name:o.conf.name,idx:r}),o.buttons&&i(t,o.buttons,r+"-"))},s=function(t,e){var n,o,r=[];if(i(r,e.s.buttons),n=p.map(r,function(t){return t.node}),p.isArray(t)||t instanceof p)for(n=0,o=t.length;n<o;n++)s(t[n],e);else if(null===t||t===c||"*"===t)for(n=0,o=r.length;n<o;n++)l.push({inst:e,node:r[n].node});else if("number"==typeof t)l.push({inst:e,node:e.s.buttons[t].node});else if("string"==typeof t)if(-1!==t.indexOf(","))for(n=0,o=(r=t.split(",")).length;n<o;n++)s(p.trim(r[n]),e);else if(t.match(/^\d+(\-\d+)*$/))n=p.map(r,function(t){return t.idx}),l.push({inst:e,node:r[p.inArray(t,n)].node});else if(-1!==t.indexOf(":name")){var a=t.replace(":name","");for(n=0,o=r.length;n<o;n++)r[n].name===a&&l.push({inst:e,node:r[n].node})}else p(n).filter(t).each(function(){l.push({inst:e,node:this})});else"object"==typeof t&&t.nodeName&&(-1!==(r=p.inArray(t,n))&&l.push({inst:e,node:n[r]}))},n=0,o=t.length;n<o;n++)s(e,t[n]);return l},u.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:"dt-button-collection"},button:{tag:"a",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}},u.version="1.4.2",p.extend(s,{collection:{text:function(t){return t.i18n("buttons.collection","Collection")},className:"buttons-collection",action:function(t,n,e,o){t=e.offset();var r=p(n.table().container()),a=!1;p("div.dt-button-background").length&&(a=p(".dt-button-collection").offset(),p("body").trigger("click.dtb-collection")),o._collection.addClass(o.collectionLayout).css("display","none").appendTo("body").fadeIn(o.fade);var l=o._collection.css("position");
2684a&&"absolute"===l?o._collection.css({top:a.top,left:a.left}):"absolute"===l?(o._collection.css({top:t.top+e.outerHeight(),left:t.left}),a=r.offset().top+r.height(),e=t.top+e.outerHeight()+o._collection.outerHeight()-a,a=t.top-o._collection.outerHeight(),(a=r.offset().top-a)<e&&o._collection.css("top",t.top-o._collection.outerHeight()-5),e=t.left+o._collection.outerWidth(),(r=r.offset().left+r.width())<e&&o._collection.css("left",t.left-(e-r))):((t=o._collection.height()/2)>p(i).height()/2&&(t=p(i).height()/2),o._collection.css("marginTop",-1*t)),o.background&&u.background(!0,o.backgroundClassName,o.fade),setTimeout(function(){p("div.dt-button-background").on("click.dtb-collection",function(){}),p("body").on("click.dtb-collection",function(t){var e=p.fn.addBack?"addBack":"andSelf";p(t.target).parents()[e]().filter(o._collection).length||(o._collection.fadeOut(o.fade,function(){o._collection.detach()}),p("div.dt-button-background").off("click.dtb-collection"),u.background(!1,o.backgroundClassName,o.fade),p("body").off("click.dtb-collection"),n.off("buttons-action.b-internal"))})},10),o.autoClose&&n.on("buttons-action.b-internal",function(){p("div.dt-button-background").click()})},background:!0,collectionLayout:"",backgroundClassName:"dt-button-background",autoClose:!1,fade:400},copy:function(t,e){return s.copyHtml5?"copyHtml5":s.copyFlash&&s.copyFlash.available(t,e)?"copyFlash":void 0},csv:function(t,e){return s.csvHtml5&&s.csvHtml5.available(t,e)?"csvHtml5":s.csvFlash&&s.csvFlash.available(t,e)?"csvFlash":void 0},excel:function(t,e){return s.excelHtml5&&s.excelHtml5.available(t,e)?"excelHtml5":s.excelFlash&&s.excelFlash.available(t,e)?"excelFlash":void 0},pdf:function(t,e){return s.pdfHtml5&&s.pdfHtml5.available(t,e)?"pdfHtml5":s.pdfFlash&&s.pdfFlash.available(t,e)?"pdfFlash":void 0},pageLength:function(t){t=t.settings()[0].aLengthMenu;function r(t){return t.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},t.page.len())}var e=p.isArray(t[0])?t[0]:t,n=p.isArray(t[0])?t[1]:t;return{extend:"collection",text:r,className:"buttons-page-length",autoClose:!0,buttons:p.map(e,function(r,t){return{text:n[t],className:"button-page-length",action:function(t,e){e.page.len(r).draw()},init:function(t,e,n){var o=this;e=function(){o.active(t.page.len()===r)};t.on("length.dt"+n.namespace,e),e()},destroy:function(t,e,n){t.off("length.dt"+n.namespace)}}}),init:function(t,e,n){var o=this;t.on("length.dt"+n.namespace,function(){o.text(r(t))})},destroy:function(t,e,n){t.off("length.dt"+n.namespace)}}}}
2684),m.Api.register("buttons()",function(e,n){n===c&&(n=e,e=c),this.selector.buttonGroup=e;var t=this.iterator(!0,"table",function(t){if(t._buttons)return u.buttonSelector(u.instanceSelector(e,t._buttons),n)},!0);return t._groupSelector=e,t}),m.Api.register("button()",function(t,e){var n=this.buttons(t,e);return 1<n.length&&n.splice(1,n.length),n}),m.Api.registerPlural("buttons().active()","button().active()",function(e){return e===c?this.map(function(t){return t.inst.active(t.node)}):this.each(function(t){t.inst.active(t.node,e)})}),m.Api.registerPlural("buttons().action()","button().action()",function(e){return e===c?this.map(function(t){return t.inst.action(t.node)}):this.each(function(t){t.inst.action(t.node,e)})}),m.Api.register(["buttons().enable()","button().enable()"],function(e){return this.each(function(t){t.inst.enable(t.node,e)})}),m.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(t){t.inst.disable(t.node)})}),m.Api.registerPlural("buttons().nodes()","button().node()",function(){var e=p();return p(this.each(function(t){e=e.add(t.inst.node(t.node))})),e}),m.Api.registerPlural("buttons().processing()","button().processing()",function(e){return e===c?this.map(function(t){return t.inst.processing(t.node)}):this.each(function(t){t.inst.processing(t.node,e)})}),m.Api.registerPlural("buttons().text()","button().text()",function(e){return e===c?this.map(function(t){return t.inst.text(t.node)}):this.each(function(t){t.inst.text(t.node,e)})}),m.Api.registerPlural("buttons().trigger()","button().trigger()",function(){return this.each(function(t){t.inst.node(t.node).trigger("click")})}),m.Api.registerPlural("buttons().containers()","buttons().container()",function(){var o=p(),r=this._groupSelector;return this.iterator(!0,"table",function(t){if(t._buttons)for(var e=0,n=(t=u.instanceSelector(r,t._buttons)).length;e<n;e++)o=o.add(t[e].container())}),o}),m.Api.register("button().add()",function(t,e){var n=this.context;return n.length&&((n=u.instanceSelector(this._groupSelector,n[0]._buttons)).length&&n[0].add(e,t)),this.button(this._groupSelector,t)}),m.Api.register("buttons().destroy()",function(){return this.pluck("inst").unique().each(function(t){t.destroy()}),this}),m.Api.registerPlural("buttons().remove()","buttons().remove()",function(){return this.each(function(t){t.inst.remove(t.node)}),this}),m.Api.register("buttons.info()",function(t,e,n){var o=this;return!1===t?(p("#datatables_buttons_info").fadeOut(function(){p(this).remove()}),clearTimeout(r),r=null):(r&&clearTimeout(r),p("#datatables_buttons_info").length&&p("#datatables_buttons_info").remove(),p('<div id="datatables_buttons_info" class="dt-button-info"/>').html(t?"<h2>"+t+"</h2>":"").append(p("<div/>")["string"==typeof e?"html":"append"](e)).css("display","none").appendTo("body").fadeIn(),n!==c&&0!==n&&(r=setTimeout(function(){o.buttons.info(!1)},n))),this}),m.Api.register("buttons.exportData()",function(t){if(this.context.length){for(var n=new m.Api(this.context[0]),o=p.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(t){return e(t)},footer:function(t){return e(t)},body:function(t){return e(t)}}},t),e=function(t){return"string"!=typeof t||(t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),o.stripHtml&&(t=t.replace(/<[^>]*>/g,"")),o.trim&&(t=t.replace(/^\s+|\s+$/g,"")),o.stripNewlines&&(t=t.replace(/\n/g," ")),o.decodeEntities&&(g.innerHTML=t,t=g.value)),t},r=(t=n.columns(o.columns).indexes().map(function(t){var e=n.column(t).header();return o.format.header(e.innerHTML,t,e)}).toArray(),n.table().footer()?n.columns(o.columns).indexes().map(function(t){var e=n.column(t).footer();return o.format.footer(e?e.innerHTML:"",t,e)}).toArray():null),a=n.rows(o.rows,o.modifier).indexes().toArray(),l=(a=(l=n.cells(a,o.columns)).render(o.orthogonal).toArray(),l.nodes().toArray()),i=t.length,s=0<i?a.length/i:0,d=Array(s),c=0,u=0;u<s;u++){for(var f=Array(i),h=0;h<i;h++)f[h]=o.format.body(a[c],u,h,l[c]),c++;d[u]=f}
2684return{header:t,footer:r,body:d}}}),m.Api.register("buttons.exportInfo()",function(t){var e,n=t=t||{};return"function"==typeof(e="*"===n.filename&&"*"!==n.title&&n.title!==c?n.title:n.filename)&&(e=e()),e===c||null===e?e=null:(-1!==e.indexOf("*")&&(e=p.trim(e.replace("*",p("title").text()))),e=e.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(n=o(n.extension))||(n=""),e+=n),{filename:e,title:n=null===(n=o(t.title))?null:-1!==n.indexOf("*")?n.replace("*",p("title").text()||"Exported data"):n,messageTop:l(this,t.messageTop||t.message,"top"),messageBottom:l(this,t.messageBottom,"bottom")}});var o=function(t){return null===t||t===c?null:"function"==typeof t?t():t},l=function(t,e,n){return null===(e=o(e))?null:(t=p("caption",t.table().container()).eq(0),"*"===e?t.css("caption-side")!==n?null:t.length?t.text():"":e)},g=p("<textarea/>")[0];return p.fn.dataTable.Buttons=u,p.fn.DataTable.Buttons=u,p(a).on("init.dt plugin-init.dt",function(t,e){if("dt"===t.namespace){var n=e.oInit.buttons||m.defaults.buttons;n&&!e._buttons&&new u(e,n).container()}}),m.ext.feature.push({fnInit:function(t){var e=(t=new m.Api(t)).init().buttons||m.defaults.buttons;return new u(t,e).container()},cFeature:"B"}),u}),function(n){"function"==typeof define&&define.amd?define("datatables.net-buttons-colvis",["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e),n(e,t,t.document)}:n(jQuery,window,document)}(function(t,e,n,r){return e=t.fn.dataTable,t.extend(e.ext.buttons,{colvis:function(t,e){return{extend:"collection",text:function(t){return t.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:e.columns,columnText:e.columnText}]}},columnsToggle:function(t,e){return t.columns(e.columns).indexes().map(function(t){return{extend:"columnToggle",columns:t,columnText:e.columnText}}).toArray()},columnToggle:function(t,e){return{extend:"columnVisibility",columns:e.columns,columnText:e.columnText}},columnsVisibility:function(t,e){return t.columns(e.columns).indexes().map(function(t){return{extend:"columnVisibility",columns:t,visibility:e.visibility,columnText:e.columnText}}).toArray()},columnVisibility:{columns:r,text:function(t,e,n){return n._columnText(t,n)},className:"buttons-columnVisibility",action:function(t,e,n,o){e=(t=e.columns(o.columns)).visible(),t.visible(o.visibility!==r?o.visibility:!(e.length&&e[0]))},init:function(o,t,r){var a=this;o.on("column-visibility.dt"+r.namespace,function(t,e){e.bDestroying||e.nTable!=o.settings()[0].nTable||a.active(o.column(r.columns).visible())}).on("column-reorder.dt"+r.namespace,function(t,e,n){1===o.columns(r.columns).count()&&("number"==typeof r.columns&&(r.columns=n.mapping[r.columns]),t=o.column(r.columns),a.text(r._columnText(o,r)),a.active(t.visible()))}),this.active(o.column(r.columns).visible())},destroy:function(t,e,n){t.off("column-visibility.dt"+n.namespace).off("column-reorder.dt"+n.namespace)},_columnText:function(t,e){var n=t.column(e.columns).index(),o=t.settings()[0].aoColumns[n].sTitle.replace(/\n/g," ").replace(/<br\s*\/?>/gi," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"");return e.columnText?e.columnText(t,n,o):o}},colvisRestore:{className:"buttons-colvisRestore",text:function(t){return t.i18n("buttons.colvisRestore","Restore visibility")},init:function(e,t,n){n._visOriginal=e.columns().indexes().map(function(t){return e.column(t).visible()}).toArray()},action:function(t,e,n,o){e.columns().every(function(t){t=e.colReorder&&e.colReorder.transpose?e.colReorder.transpose(t,"toOriginal"):t,this.visible(o._visOriginal[t])})}},colvisGroup:{className:"buttons-colvisGroup",action:function(t,e,n,o){e.columns(o.show).visible(!0,!1),e.columns(o.hide).visible(!1,!1),e.columns.adjust()},show:[],hide:[]}}),e.Buttons}),function(n){"function"==typeof define&&define.amd?define("datatables.net-buttons-flash",["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e),n(e,t,t.document)}:n(jQuery,window,document)}(function(p,l,i,m){function g(t){for(var e="";0<=t;
2684)e=String.fromCharCode(t%26+65)+e,t=Math.floor(t/26)-1;return e}function b(t,e,n){var o=t.createElement(e);return n&&(n.attr&&p(o).attr(n.attr),n.children&&p.each(n.children,function(t,e){o.appendChild(e)}),null!==n.text&&n.text!==m&&o.appendChild(t.createTextNode(n.text))),o}function y(t,e){var n,o=t.header[e].length;t.footer&&t.footer[e].length>o&&(o=t.footer[e].length);for(var r=0,a=t.body.length;r<a;r++)if(o<(n=-1!==(n=null!==(n=t.body[r][e])&&n!==m?n.toString():"").indexOf("\n")?((n=n.split("\n")).sort(function(t,e){return e.length-t.length}),n[0].length):n.length)&&(o=n),40<o)return 52;return 6<(o*=1.3)?o:6}var r=p.fn.dataTable,a={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(t){return"string"==typeof t&&(t=i.getElementById(t)),t.addClass||(t.hide=function(){this.style.display="none"},t.show=function(){this.style.display=""},t.addClass=function(t){this.removeClass(t),this.className+=" "+t},t.removeClass=function(t){this.className=this.className.replace(RegExp("\\s*"+t+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},t.hasClass=function(t){return!!this.className.match(RegExp("\\s*"+t+"\\s*"))}),t},setMoviePath:function(t){this.moviePath=t},dispatch:function(t,e,n){(t=this.clients[t])&&t.receiveEvent(e,n)},log:function(t){console.log("Flash: "+t)},register:function(t,e){this.clients[t]=e},getDOMObjectPosition:function(t){var e={left:0,top:0,width:t.width?t.width:t.offsetWidth,height:t.height?t.height:t.offsetHeight};for(""!==t.style.width&&(e.width=t.style.width.replace("px","")),""!==t.style.height&&(e.height=t.style.height.replace("px",""));t;)e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;return e},Client:function(t){this.handlers={},this.id=a.nextId++,this.movieId="ZeroClipboard_TableToolsMovie_"+this.id,a.register(this.id,this),t&&this.glue(t)}};a.Client.prototype={id:0,ready:!1,movie:null,clipText:"",fileName:"",action:"copy",handCursorEnabled:!0,cssEffects:!0,handlers:null,sized:!1,sheetName:"",glue:function(t,e){this.domElement=a.$(t);var n=99;this.domElement.style.zIndex&&(n=parseInt(this.domElement.style.zIndex,10)+1);var o=a.getDOMObjectPosition(this.domElement);this.div=i.createElement("div");var r=this.div.style;r.position="absolute",r.left="0px",r.top="0px",r.width=o.width+"px",r.height=o.height+"px",r.zIndex=n,void 0!==e&&""!==e&&(this.div.title=e),0!==o.width&&0!==o.height&&(this.sized=!0),this.domElement&&(this.domElement.appendChild(this.div),this.div.innerHTML=this.getHTML(o.width,o.height).replace(/&/g,"&"))},positionElement:function(){var t=a.getDOMObjectPosition(this.domElement),e=this.div.style;e.position="absolute",e.width=t.width+"px",e.height=t.height+"px",0!==t.width&&0!==t.height&&(this.sized=!0,(e=this.div.childNodes[0]).width=t.width,e.height=t.height)},getHTML:function(t,e){var n="",o="id="+this.id+"&width="+t+"&height="+e;if(navigator.userAgent.match(/MSIE/))n=n+'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+(location.href.match(/^https/i)?"https://":"http://")+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="'+t+'" height="'+e+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+a.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+o+'"/><param name="wmode" value="transparent"/></object>';else n+='<embed id="'+this.movieId+'" src="'+a.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+t+'" height="'+e+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+o+'" wmode="transparent" />';return n},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){var n=this;this.domElement&&this.div&&(p(this.div).remove(),this.div=this.domElement=null,p.each(a.clients,function(t,e){e===n&&delete a.clients[t]}))},reposition:function(t){if(t&&((this.domElement=a.$(t))||this.hide()),this.domElement&&this.div){t=a.getDOMObjectPosition(this.domElement);var e=this.div.style;e.left=t.left+"px",e.top=t.top+"px"}},clearText:function(){this.clipText="",this.ready&&this.movie.clearText()},appendText:function(t){this.clipText+=t,this.ready&&this.movie.appendText(t)},setText:function(t){this.clipText=t,this.ready&&this.movie.setText(t)},setFileName:function(t){this.fileName=t,this.ready&&this.movie.setFileName(t)},setSheetData:function(t){this.ready&&this.movie.setSheetData(JSON.stringify(t))}
2684,setAction:function(t){this.action=t,this.ready&&this.movie.setAction(t)},addEventListener:function(t,e){t=t.toString().toLowerCase().replace(/^on/,""),this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(e)},setHandCursor:function(t){this.handCursorEnabled=t,this.ready&&this.movie.setHandCursor(t)},setCSSEffects:function(t){this.cssEffects=!!t},receiveEvent:function(t,e){var n;switch(t=t.toString().toLowerCase().replace(/^on/,"")){case"load":if(this.movie=i.getElementById(this.movieId),!this.movie)return n=this,void setTimeout(function(){n.receiveEvent("load",null)},1);if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/))return n=this,setTimeout(function(){n.receiveEvent("load",null)},100),void(this.ready=!0);this.ready=!0,this.movie.clearText(),this.movie.appendText(this.clipText),this.movie.setFileName(this.fileName),this.movie.setAction(this.action),this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":this.domElement&&this.cssEffects&&this.recoverActive&&this.domElement.addClass("active");break;case"mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0));break;case"mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case"mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[t])for(var o=0,r=this.handlers[t].length;o<r;o++){var a=this.handlers[t][o];"function"==typeof a?a(this,e):"object"==typeof a&&2==a.length?a[0][a[1]](this,e):"string"==typeof a&&l[a](this,e)}}},a.hasFlash=function(){try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))return!0}catch(t){if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]!==m&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return!0}return!1},l.ZeroClipboard_TableTools=a;function v(t,e){var n=e.match(/[\s\S]{1,8192}/g)||[];t.clearText();for(var o=0,r=n.length;o<r;o++)t.appendText(n[o])}function x(t){return t.newline?t.newline:navigator.userAgent.match(/Windows/)?"\r\n":"\n"}function s(t,e){function n(t){for(var e="",n=0,o=t.length;n<o;n++)0<n&&(e+=l),e+=a?a+(""+t[n]).replace(i,s+a)+a:t[n];return e}for(var o=x(e),r=t.buttons.exportData(e.exportOptions),a=e.fieldBoundary,l=e.fieldSeparator,i=RegExp(a,"g"),s=e.escapeChar!==m?e.escapeChar:"\\",d=e.header?n(r.header)+o:"",c=e.footer&&r.footer?o+n(r.footer):"",u=[],f=0,h=r.body.length;f<h;f++)u.push(n(r.body[f]));return{str:d+u.join(o)+c,rows:u.length}}var I,d=function(t,e){e.attr("id"),e.parents("html").length?t.glue(e[0],""):setTimeout(function(){d(t,e)},500)},t={available:function(){return a.hasFlash()},init:function(t,e,n){a.moviePath=r.Buttons.swfPath;var o=new a.Client;o.setHandCursor(!0),o.addEventListener("mouseDown",function(){n._fromFlash=!0,t.button(e[0]).trigger(),n._fromFlash=!1}),d(o,e),n._flash=o},destroy:function(t,e,n){n._flash.destroy()},fieldSeparator:",",fieldBoundary:'"',exportOptions:{},title:"*",messageTop:"*",messageBottom:"*",filename:"*",extension:".csv",header:!0,footer:!1},w="",C=(w=void 0===l.XMLSerializer?new function(){this.serializeToString=function(t){return t.xml}}:new XMLSerializer,{"_rels/.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',"xl/_rels/workbook.xml.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>',"[Content_Types].xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="jpeg" ContentType="image/jpeg" />
2684<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /></Types>',"xl/workbook.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="24816"/><workbookPr showInkAnnotation="0" autoCompressPictures="0"/><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="25600" windowHeight="19020" tabRatio="500"/></bookViews><sheets><sheet name="" sheetId="1" r:id="rId1"/></sheets></workbook>',"xl/worksheets/sheet1.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><sheetData/><mergeCells count="0"/></worksheet>',"xl/styles.xml":'<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="6"><numFmt numFmtId="164" formatCode="#,##0.00_- [$$-45C]"/><numFmt numFmtId="165" formatCode=""£"#,##0.00"/><numFmt numFmtId="166" formatCode="[$€-2] #,##0.00"/><numFmt numFmtId="167" formatCode="0.0%"/><numFmt numFmtId="168" formatCode="#,##0;(#,##0)"/><numFmt numFmtId="169" formatCode="#,##0.00;(#,##0.00)"/></numFmts><fonts count="5" x14ac:knownFonts="1"><font><sz val="11" /><name val="Calibri" /></font><font><sz val="11" /><name val="Calibri" /><color rgb="FFFFFFFF" /></font><font><sz val="11" /><name val="Calibri" /><b /></font><font><sz val="11" /><name val="Calibri" /><i /></font><font><sz val="11" /><name val="Calibri" /><u /></font></fonts><fills count="6"><fill><patternFill patternType="none" /></fill><fill/><fill><patternFill patternType="solid"><fgColor rgb="FFD9D9D9" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="FFD99795" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6efce" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6cfef" /><bgColor indexed="64" /></patternFill></fill></fills><borders count="2"><border><left /><right /><top /><bottom /><diagonal /></border><border diagonalUp="false" diagonalDown="false"><left style="thin"><color auto="1" /></left><right style="thin"><color auto="1" /></right><top style="thin"><color auto="1" /></top><bottom style="thin"><color auto="1" /></bottom><diagonal /></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" /></cellStyleXfs><cellXfs count="61"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="left"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="center"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="right"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="fill"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment textRotation="90"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment wrapText="1"/></xf><xf numFmtId="9" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="164" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="165" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="166" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="167" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="168" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="169" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="3" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="4" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0" /></cellStyles><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4" /></styleSheet>'}),_=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(t){return t/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(t){return t/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\([\d,]+\)$/,style:61,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^[\d,]+$/,style:63},{match:/^[\d,]+\.\d{2}$/,style:64}];return r.Buttons.swfPath="//cdn.datatables.net/buttons/"+r.Buttons.version+"/swf/flashExport.swf",r.Api.register("buttons.resize()",function(){p.each(a.clients,function(t,e){e.domElement!==m&&e.domElement.parentNode&&e.positionElement()})}),r.ext.buttons.copyFlash=p.extend({},t,{className:"buttons-copy buttons-flash",text:function(t){return t.i18n("buttons.copy","Copy")},action:function(t,e,n,o){if(o._fromFlash){this.processing(!0);t=o._flash;var r=s(e,o),a=(n=e.buttons.exportInfo(o),x(o));r=r.str;n.title&&(r=n.title+a+a+r),n.messageTop&&(r=n.messageTop+a+a+r),n.messageBottom&&(r=r+a+a+n.messageBottom),o.customize&&(r=o.customize(r,o)),t.setAction("copy"),v(t,r),this.processing(!1),e.buttons.info(e.i18n("buttons.copyTitle","Copy to clipboard"),e.i18n("buttons.copySuccess",{_:"Copied %d rows to clipboard",1:"Copied 1 row to clipboard"},data.rows),3e3)}},fieldSeparator:"\t",fieldBoundary:""}),r.ext.buttons.csvFlash=p.extend({},t,{className:"buttons-csv buttons-flash",text:function(t){return t.i18n("buttons.csv","CSV")},action:function(t,e,n,o){t=o._flash,e=s(e,o),e=o.customize?o.customize(e.str,o):e.str,t.setAction("csv"),t.setFileName(_filename(o)),v(t,e)},escapeChar:'"'}),r.ext.buttons.excelFlash=p.extend({},t,{className:"buttons-excel buttons-flash",text:function(t){return t.i18n("buttons.excel","Excel")},action:function(t,e,n,o){this.processing(!0);t=o._flash;var s,d,c=0,u=p.parseXML(C["xl/worksheets/sheet1.xml"]),f=u.getElementsByTagName("sheetData")[0],r=(n={_rels:{".rels":p.parseXML(C["_rels/.rels"])},xl:{_rels:{"workbook.xml.rels":p.parseXML(C["xl/_rels/workbook.xml.rels"])},"workbook.xml":p.parseXML(C["xl/workbook.xml"]),"styles.xml":p.parseXML(C["xl/styles.xml"]),worksheets:{"sheet1.xml":u}},"[Content_Types].xml":p.parseXML(C["[Content_Types].xml"])},e.buttons.exportData(o.exportOptions)),a=function(t){d=b(u,"row",{attr:{r:s=c+1}});for(var e=0,n=t.length;e<n;e++){var o=g(e)+""+s,r=null;if(null!==t[e]&&t[e]!==m&&""!==t[e]){t[e]=p.trim(t[e]);for(var a=0,l=_.length;a<l;a++){var i=_[a];if(t[e].match&&!t[e].match(/^0\d+/)&&t[e].match(i.match)){r=t[e].replace(/[^\d\.\-]/g,""),i.fmt&&(r=i.fmt(r)),r=b(u,"c",{attr:{r:o,s:i.style},children:[b(u,"v",{text:r})]});break}}r=r||("number"==typeof t[e]||t[e].match&&t[e].match(/^-?\d+(\.\d+)?$/)&&!t[e].match(/^0\d+/)?b(u,"c",{attr:{t:"n",r:o},children:[b(u,"v",{text:t[e]})]}):(i=t[e].replace?t[e].replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,""):t[e],b(u,"c",{attr:{t:"inlineStr",r:
2684o},children:{row:b(u,"is",{children:{row:b(u,"t",{text:i})}})}}))),d.appendChild(r)}}f.appendChild(d),c++};p("sheets sheet",n.xl["workbook.xml"]).attr("name",function(t){var e="Sheet1";return t.sheetName&&(e=t.sheetName.replace(/[\[\]\*\/\\\?\:]/g,"")),e}(o)),o.customizeData&&o.customizeData(r);var l=function(t,e){var n=p("mergeCells",u);n[0].appendChild(b(u,"mergeCell",{attr:{ref:"A"+t+":"+g(e)+t}})),n.attr("count",n.attr("count")+1),p("row:eq("+(t-1)+") c",u).attr("s","51")};(e=e.buttons.exportInfo(o)).title&&(a([e.title],c),l(c,r.header.length-1)),e.messageTop&&(a([e.messageTop],c),l(c,r.header.length-1)),o.header&&(a(r.header,c),p("row:last c",u).attr("s","2"));for(var i=0,h=r.body.length;i<h;i++)a(r.body[i],c);for(o.footer&&r.footer&&(a(r.footer,c),p("row:last c",u).attr("s","2")),e.messageBottom&&(a([e.messageBottom],c),l(c,r.header.length-1)),a=b(u,"cols"),p("worksheet",u).prepend(a),l=0,i=r.header.length;l<i;l++)a.appendChild(b(u,"col",{attr:{min:l+1,max:l+1,width:y(r,l),customWidth:1}}));o.customize&&o.customize(n),function i(s){I===m&&(I=-1===w.serializeToString(p.parseXML(C["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r")),p.each(s,function(t,e){if(p.isPlainObject(e))i(e);else{if(I){var n,o,r=e.childNodes[0],a=[];for(n=r.attributes.length-1;0<=n;n--){o=r.attributes[n].nodeName;var l=r.attributes[n].nodeValue;-1!==o.indexOf(":")&&(a.push({name:o,value:l}),r.removeAttribute(o))}for(n=0,o=a.length;n<o;n++)(l=e.createAttribute(a[n].name.replace(":","_dt_b_namespace_token_"))).value=a[n].value,r.setAttributeNode(l)}r=w.serializeToString(e),I&&(-1===r.indexOf("<?xml")&&(r='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+r),r=r.replace(/_dt_b_namespace_token_/g,":")),r=r.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g,"<$1 $2>"),s[t]=r}})}(n),t.setAction("excel"),t.setFileName(e.filename),t.setSheetData(n),v(t,""),this.processing(!1)},extension:".xlsx"}),r.ext.buttons.pdfFlash=p.extend({},t,{className:"buttons-pdf buttons-flash",text:function(t){return t.i18n("buttons.pdf","PDF")},action:function(t,e,n,o){this.processing(!0);t=o._flash,n=e.buttons.exportData(o.exportOptions);var r=e.buttons.exportInfo(o),a=e.table().node().offsetWidth,l=e.columns(o.columns).indexes().map(function(t){return e.column(t).header().offsetWidth/a});t.setAction("pdf"),t.setFileName(r.filename),v(t,JSON.stringify({title:r.title||"",messageTop:r.messageTop||"",messageBottom:r.messageBottom||"",colWidth:l.toArray(),orientation:o.orientation,size:o.pageSize,header:o.header?n.header:null,footer:o.footer?n.footer:null,body:n.body})),this.processing(!1)},extension:".pdf",orientation:"portrait",pageSize:"A4",newline:"\n"}),r.Buttons}),function(r){"function"==typeof define&&define.amd?define("datatables.net-buttons-html5",["jquery","datatables.net","datatables.net-buttons"],function(t){return r(t,window,document)}):"object"==typeof exports?module.exports=function(t,e,n,o){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e),r(e,t,t.document,n,o)}:r(jQuery,window,document)}(function(p,m,u,g,i,b){function y(t){for(var e="";0<=t;)e=String.fromCharCode(t%26+65)+e,t=Math.floor(t/26)-1;return e}function v(t,e,n){var o=t.createElement(e);return n&&(n.attr&&p(o).attr(n.attr),n.children&&p.each(n.children,function(t,e){o.appendChild(e)}),null!==n.text&&n.text!==b&&o.appendChild(t.createTextNode(n.text))),o}function x(t,e){var n,o=t.header[e].length;t.footer&&t.footer[e].length>o&&(o=t.footer[e].length);for(var r=0,a=t.body.length;r<a;r++)if(o<(n=-1!==(n=null!==(n=t.body[r][e])&&n!==b?n.toString():"").indexOf("\n")?((n=n.split("\n")).sort(function(t,e){return e.length-t.length}),n[0].length):n.length)&&(o=n),40<o)return 52;return 6<(o*=1.3)?o:6}var I,t=p.fn.dataTable,s="undefined"!=typeof self&&self||void 0!==m&&m||this.content;if(void 0===s||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))I=void 0;else{function d(t){(s.setImmediate||s.setTimeout)(function(){throw t},0)}function c(t){setTimeout(function(){"string"==typeof t?(s.URL||s.webkitURL||s).revokeObjectURL(t):t.remove()},4e4)}function f(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}function o(t,e,n){n||(t=f(t));function o(){for(var t,e=(t=[].concat(t=["writestart","progress","write","writeend"])).length;e--;){var n=a["on"+t[e]];if("function"==typeof n)try{n.call(a,a)}catch(t){d(t)}}}var r,a=this;
2684n="application/octet-stream"===t.type;if(a.readyState=a.INIT,w)r=(s.URL||s.webkitURL||s).createObjectURL(t),setTimeout(function(){h.href=r,h.download=e;var t=new MouseEvent("click");h.dispatchEvent(t),o(),c(r),a.readyState=a.DONE});else if((_||n&&C)&&s.FileReader){var l=new FileReader;l.onloadend=function(){var t=_?l.result:l.result.replace(/^data:[^;]*;/,"data:attachment/file;");s.open(t,"_blank")||(s.location.href=t),a.readyState=a.DONE,o()},l.readAsDataURL(t),a.readyState=a.INIT}else r=r||(s.URL||s.webkitURL||s).createObjectURL(t),n?s.location.href=r:s.open(r,"_blank")||(s.location.href=r),a.readyState=a.DONE,o(),c(r)}var h=s.document.createElementNS("http://www.w3.org/1999/xhtml","a"),w="download"in h,C=/constructor/i.test(s.HTMLElement)||s.safari,_=/CriOS\/[\d]+/.test(navigator.userAgent),e=o.prototype;I="undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download",n||(t=f(t)),navigator.msSaveOrOpenBlob(t,e)}:(e.abort=function(){},e.readyState=e.INIT=0,e.WRITING=1,e.DONE=2,e.error=e.onwritestart=e.onprogress=e.onwrite=e.onabort=e.onerror=e.onwriteend=null,function(t,e,n){return new o(t,e||t.name||"download",n)})}t.fileSave=I;function T(t){return t.newline?t.newline:navigator.userAgent.match(/Windows/)?"\r\n":"\n"}function F(t,e){function n(t){for(var e="",n=0,o=t.length;n<o;n++)0<n&&(e+=l),e+=a?a+(""+t[n]).replace(i,s+a)+a:t[n];return e}for(var o=T(e),r=t.buttons.exportData(e.exportOptions),a=e.fieldBoundary,l=e.fieldSeparator,i=RegExp(a,"g"),s=e.escapeChar!==b?e.escapeChar:"\\",d=e.header?n(r.header)+o:"",c=e.footer&&r.footer?o+n(r.footer):"",u=[],f=0,h=r.body.length;f<h;f++)u.push(n(r.body[f]));return{str:d+u.join(o)+c,rows:u.length}}function S(){if(-1===navigator.userAgent.indexOf("Safari")||-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Opera"))return!1;var t=navigator.userAgent.match(/AppleWebKit\/(\d+\.\d+)/);return!!(t&&1<t.length&&1*t[1]<603.1)}try{var D,A=new XMLSerializer}catch(t){}var R={"_rels/.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',"xl/_rels/workbook.xml.rels":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>',"[Content_Types].xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml" /><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="jpeg" ContentType="image/jpeg" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /></Types>',"xl/workbook.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="24816"/><workbookPr showInkAnnotation="0" autoCompressPictures="0"/><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="25600" windowHeight="19020" tabRatio="500"/></bookViews><sheets><sheet name="" sheetId="1" r:id="rId1"/></sheets></workbook>',"xl/worksheets/sheet1.xml":'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><sheetData/><mergeCells count="0"/></worksheet>',"xl/styles.xml":'<?xml version="1.0" encoding="UTF-8"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><numFmts count="6"><numFmt numFmtId="164" formatCode="#,##0.00_- [$$-45C]"/><numFmt numFmtId="165" formatCode=""£"#,##0.00"/><numFmt numFmtId="166" formatCode="[$€-2] #,##0.00"/><numFmt numFmtId="167" formatCode="0.0%"/><numFmt numFmtId="168" formatCode="#,##0;(#,##0)"/><numFmt numFmtId="169" formatCode="#,##0.00;(#,##0.00)"/></numFmts><fonts count="5" x14ac:knownFonts="1"><font><sz val="11" /><name val="Calibri" /></font><font><sz val="11" /><name val="Calibri" /><color rgb="FFFFFFFF" /></font><font><sz val="11" /><name val="Calibri" /><b /></font><font><sz val="11" /><name val="Calibri" /><i /></font><font><sz val="11" /><name val="Calibri" /><u /></font></fonts><fills count="6"><fill><patternFill patternType="none" /></fill><fill/><fill><patternFill patternType="solid"><fgColor rgb="FFD9D9D9" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="FFD99795" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6efce" /><bgColor indexed="64" /></patternFill></fill><fill><patternFill patternType="solid"><fgColor rgb="ffc6cfef" /><bgColor indexed="64" /></patternFill></fill></fills><borders count="2"><border><left /><right /><top /><bottom /><diagonal /></border><border diagonalUp="false" diagonalDown="false"><left style="thin"><color auto="1" /></left><right style="thin"><color auto="1" /></right><top style="thin"><color auto="1" /></top><bottom style="thin"><color auto="1" /></bottom><diagonal /></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" /></cellStyleXfs><cellXfs count="67"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="4" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="1" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="2" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="3" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="4" fillId="5" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="left"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="center"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="right"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment horizontal="fill"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment textRotation="90"/></xf><xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyAlignment="1"><alignment wrapText="1"/></xf><xf numFmtId="9" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="164" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="165" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="166" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="167" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="168" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="169" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="3" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="4" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="1" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/><xf numFmtId="2" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1" xfId="0" applyNumberFormat="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0" /></cellStyles><dxfs count="0" /><tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4" /></styleSheet>'},B=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(t){return t/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(t){return t/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63},{match:/^\-?[\d,]+\.\d{2}$/,style:64}];return t.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(t){return t.i18n("buttons.copy","Copy")},action:function(t,e,n,o){this.processing(!0);var r=this,a=(t=F(e,o),e.buttons.exportInfo(o)),l=T(o),i=t.str;n=p("<div/>").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0});if(a.title&&(i=a.title+l+l+i),a.messageTop&&(i=a.messageTop+l+l+i),a.messageBottom&&(i=i+l+l+a.messageBottom),o.customize&&(i=o.customize(i,o)),o=p("<textarea readonly/>").val(i).appendTo(n),u.queryCommandSupported("copy")){n.appendTo(e.table().container()),o[0].focus(),o[0].select();try{var s=u.execCommand("copy");if(n.remove(),s)return e.buttons.info(e.i18n("buttons.copyTitle","Copy to clipboard"),e.i18n("buttons.copySuccess",{1:"Copied one row to clipboard",_:"Copied %d rows to clipboard"},t.rows),2e3),void this.processing(!1)}catch(t){}}s=p("<span>"+e.i18n("buttons.copyKeys","Press <i>ctrl</i> or <i>⌘</i> + <i>C</i> to copy the table data<br>to your system clipboard.<br><br>To cancel, click this message or press escape.")+"</span>").append(n),e.buttons.info(e.i18n("buttons.copyTitle","Copy to clipboard"),s,0),o[0].focus(),o[0].select();function d(){c.off("click.buttons-copy"),p(u).off(".buttons-copy"),e.buttons.info(!1)}var c=p(s).closest(".dt-button-info");c.on("click.buttons-copy",d),p(u).on("keydown.buttons-copy",function(t){27===t.keyCode&&(d(),r.processing(!1))}).on("copy.buttons-copy cut.buttons-copy",function(){d(),r.processing(!1)})},exportOptions:{},fieldSeparator:"\t",fieldBoundary:"",header:!0,footer:!1,title:"*",messageTop:"*",messageBottom:"*"},t.ext.buttons.csvHtml5={bom:!1,className:"buttons-csv buttons-html5",available:function(){return m.FileReader!==b&&m.Blob},text:function(t){return t.i18n("buttons.csv","CSV")},action:function(t,e,n,o){this.processing(!0),t=F(e,o).str,e=e.buttons.exportInfo(o),n=o.charset,o
2684.customize&&(t=o.customize(t,o)),n=!1!==n?(n=n||(u.characterSet||u.charset))&&";charset="+n:"",o.bom&&(t="\ufeff"+t),I(new Blob([t],{type:"text/csv"+n}),e.filename,!0),this.processing(!1)},filename:"*",extension:".csv",exportOptions:{},fieldSeparator:",",fieldBoundary:'"',escapeChar:'"',charset:null,header:!0,footer:!1},t.ext.buttons.excelHtml5={className:"buttons-excel buttons-html5",available:function(){return m.FileReader!==b&&(g||m.JSZip)!==b&&!S()&&A},text:function(t){return t.i18n("buttons.excel","Excel")},action:function(t,e,n,o){this.processing(!0);var s,d,r=this,c=0,u=(t=function(t){return p.parseXML(R[t])})("xl/worksheets/sheet1.xml"),f=u.getElementsByTagName("sheetData")[0],a=(t={_rels:{".rels":t("_rels/.rels")},xl:{_rels:{"workbook.xml.rels":t("xl/_rels/workbook.xml.rels")},"workbook.xml":t("xl/workbook.xml"),"styles.xml":t("xl/styles.xml"),worksheets:{"sheet1.xml":u}},"[Content_Types].xml":t("[Content_Types].xml")},n=e.buttons.exportData(o.exportOptions),function(t){d=v(u,"row",{attr:{r:s=c+1}});for(var e=0,n=t.length;e<n;e++){var o=y(e)+""+s,r=null;if(null!==t[e]&&t[e]!==b&&""!==t[e]){t[e]=p.trim(t[e]);for(var a=0,l=B.length;a<l;a++){var i=B[a];if(t[e].match&&!t[e].match(/^0\d+/)&&t[e].match(i.match)){r=t[e].replace(/[^\d\.\-]/g,""),i.fmt&&(r=i.fmt(r)),r=v(u,"c",{attr:{r:o,s:i.style},children:[v(u,"v",{text:r})]});break}}r=r||("number"==typeof t[e]||t[e].match&&t[e].match(/^-?\d+(\.\d+)?$/)&&!t[e].match(/^0\d+/)?v(u,"c",{attr:{t:"n",r:o},children:[v(u,"v",{text:t[e]})]}):(i=t[e].replace?t[e].replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,""):t[e],v(u,"c",{attr:{t:"inlineStr",r:o},children:{row:v(u,"is",{children:{row:v(u,"t",{text:i})}})}}))),d.appendChild(r)}}f.appendChild(d),c++});p("sheets sheet",t.xl["workbook.xml"]).attr("name",function(t){var e="Sheet1";return t.sheetName&&(e=t.sheetName.replace(/[\[\]\*\/\\\?\:]/g,"")),e}(o)),o.customizeData&&o.customizeData(n);var l=function(t,e){var n=p("mergeCells",u);n[0].appendChild(v(u,"mergeCell",{attr:{ref:"A"+t+":"+y(e)+t}})),n.attr("count",n.attr("count")+1),p("row:eq("+(t-1)+") c",u).attr("s","51")},i=e.buttons.exportInfo(o);i.title&&(a([i.title],c),l(c,n.header.length-1)),i.messageTop&&(a([i.messageTop],c),l(c,n.header.length-1)),o.header&&(a(n.header,c),p("row:last c",u).attr("s","2"));e=0;for(var h=n.body.length;e<h;e++)a(n.body[e],c);for(o.footer&&n.footer&&(a(n.footer,c),p("row:last c",u).attr("s","2")),i.messageBottom&&(a([i.messageBottom],c),l(c,n.header.length-1)),e=v(u,"cols"),p("worksheet",u).prepend(e),a=0,l=n.header.length;a<l;a++)e.appendChild(v(u,"col",{attr:{min:a+1,max:a+1,width:x(n,a),customWidth:1}}));o.customize&&o.customize(t),n={type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},function i(s,t){D===b&&(D=-1===A.serializeToString(p.parseXML(R["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r")),p.each(t,function(t,e){if(p.isPlainObject(e))i(n=s.folder(t),e);else{if(D){var n,o,r,a=[];for(o=(n=e.childNodes[0]).attributes.length-1;0<=o;o--){r=n.attributes[o].nodeName;var l=n.attributes[o].nodeValue;-1!==r.indexOf(":")&&(a.push({name:r,value:l}),n.removeAttribute(r))}for(o=0,r=a.length;o<r;o++)(l=e.createAttribute(a[o].name.replace(":","_dt_b_namespace_token_"))).value=a[o].value,n.setAttributeNode(l)}n=A.serializeToString(e),D&&(-1===n.indexOf("<?xml")&&(n='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+n),n=n.replace(/_dt_b_namespace_token_/g,":")),n=n.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g,"<$1 $2>"),s.file(t,n)}})}(o=new(g||m.JSZip),t),o.generateAsync?o.generateAsync(n).then(function(t){I(t,i.filename),r.processing(!1)}):(I(o.generate(n),i.filename),this.processing(!1))},filename:"*",extension:".xlsx",exportOptions:{},header:!0,footer:!1,title:"*",messageTop:"*",messageBottom:"*"},t.ext.buttons.pdfHtml5={className:"buttons-pdf buttons-html5",available:function(){return m.FileReader!==b&&(i||m.pdfMake)},text:function(t){return t.i18n("buttons.pdf","PDF")},action:function(t,e,n,o){this.processing(!0);var r=this,a=(t=e.buttons.exportData(o.exportOptions),e.buttons.exportInfo(o));e=[];o.header&&e.push(p.map(t.header,function(t){return{text:"string"==typeof t?t:t+"",style:"tableHeader"}}));var l=0;for(n=t.body.length;l<n;l++)e.push(p.map(t.body[l],function(t){return{text:"string"==typeof t?t:t+"",style:l%2?"tableBodyEven":"tableBodyOdd"}}));o.footer&&t.footer&&e.push(p.map(t.footer,function(t){return{text:"string"==typeof t?t:t+"",style:"tableFooter"}})),e={pageSize:o.pageSize,pageOrientation:o.orientation,content:[{table:{headerRows:1,body:e},layout:"noBorders"}],styles:{tableHeader:{bold:!0,fontSize:11,color:"white",fillColor:"#2d4154",alignment:"center"},tableBodyEven:{},tableBodyOdd:{fillColor:"#f3f3f3"},tableFooter:{bold:!0,fontSize:11,color:"white",fillColor:"#2d4154"},title:{alignment:"center",fontSize:15},message:{}},defaultStyle:{fontSize:10}},a.messageTop&&e.content.unshift({text:a.messageTop,style:"message",margin:[0,0,0,12]}),a.messageBottom&&e.content.push({text:a.messageBottom,style:"message",margin:[0,0,0,12]}),a.title&&e.content.unshift({text:a.title,style:"title",margin:[0,0,0,12]}),o.customize&&o.customize(e,o),e=(i||m.pdfMake).createPdf(e),"open"!==o.download||S()?e.getBuffer(function(t){t=new Blob([t],{type:"application/pdf"}),I(t,a.filename),r.processing(!1)}):(e.open(),this.processing(!1))},title:"*",filename:"*",extension:".pdf",exportOptions:{},orientation:"portrait",pageSize:"A4",header:!0,footer:!1,messageTop:"*",messageBottom:"*",customize:null,download:"download"},t.Buttons}),function(n){"function"==typeof define&&define.amd?define("datatables.net-buttons-print",["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e),n(e,t,t.document)}:n(jQuery,window,document)}(function(d,c,t){function u(t){return n.href=t,-1===(t=n.host).indexOf("/")&&0!==n.pathname.indexOf("/")&&(t+="/"),n.protocol+"//"+t+n.pathname+n.search}var e=d.fn.dataTable,n=t.createElement("a");return e.ext.buttons.print={className:"buttons-print",text:function(t){return t.i18n("buttons.print","Print")},action:function(t,e,n,o){function r(t,e){for(var n="<tr>",o=0,r=t.length;o<r;o++)n+="<"+e+">"+t[o]+"</"+e+">";return n+"</tr>"}t=e.buttons.exportData(d.extend({decodeEntities:!1},o.exportOptions)),n=e.buttons.exportInfo(o),e='<table class="'+e.table().node().className+'">';o.header&&(e+="<thead>"+r(t.header,"th")+"</thead>");e+="<tbody>";for(var a=0,l=t.body.length;a<l;a++)e+=r(t.body[a],"td");e+="</tbody>",o.footer&&t.footer&&(e+="<tfoot>"+r(t.footer,"th")+"</tfoot>");e+="</table>";var i=c.open("","");i.document.close();var s="<title>"+n.title+"</title>";d("style, link").each(function(){var t=s,e=d(this).clone()[0];
2684"link"===e.nodeName.toLowerCase()&&(e.href=u(e.href)),s=t+e.outerHTML});try{i.document.head.innerHTML=s}catch(t){d(i.document.head).html(s)}i.document.body.innerHTML="<h1>"+n.title+"</h1><div>"+(n.messageTop||"")+"</div>"+e+"<div>"+(n.messageBottom||"")+"</div>",d(i.document.body).addClass("dt-print-view"),d("img",i.document.body).each(function(t,e){e.setAttribute("src",u(e.getAttribute("src")))}),o.customize&&o.customize(i),setTimeout(function(){o.autoPrint&&(i.print(),i.close())},1e3)},title:"*",messageTop:"*",messageBottom:"*",exportOptions:{},header:!0,footer:!1,autoPrint:!0,customize:null},e.Buttons}),function(n){"function"==typeof define&&define.amd?define("datatables.net-buttons-bs",["jquery","datatables.net-bs","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net-bs")(t,e).$),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e),n(e,t.document)}:n(jQuery,window,document)}(function(t){var e=t.fn.dataTable;return t.extend(!0,e.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"},button:{className:"btn btn-default"},collection:{tag:"ul",className:"dt-button-collection dropdown-menu",button:{tag:"li",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"a",className:""}}}}),e.ext.buttons.collection.text=function(t){return t.i18n("buttons.collection",'Collection <span class="caret"/>')},e.Buttons}),function(n){"function"==typeof define&&define.amd?define("datatables.net-colreorder",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(h,t,a,p){function m(t){for(var e=[],n=0,o=t.length;n<o;n++)e[t[n]]=n;return e}function g(t,e,n){e=t.splice(e,1)[0],t.splice(n,0,e)}function b(t,e,n){for(var o=[],r=0,a=t.childNodes.length;r<a;r++)1==t.childNodes[r].nodeType&&o.push(t.childNodes[r]);e=o[e],null!==n?t.insertBefore(e,o[n]):t.appendChild(e)}var r=h.fn.dataTable;h.fn.dataTableExt.oApi.fnColReorder=function(n,t,e,o,r){var a,l,i,s,d,c,u=n.aoColumns.length;if(d=function(t,e,n){if(t[e]&&"function"!=typeof t[e]){var o=t[e].split("."),r=o.shift();isNaN(1*r)||(t[e]=n[1*r]+"."+o.join("."))}},t!=e)if(t<0||u<=t)this.oApi._fnLog(n,1,"ColReorder 'from' index is out of bounds: "+t);else if(e<0||u<=e)this.oApi._fnLog(n,1,"ColReorder 'to' index is out of bounds: "+e);else{for(i=[],a=0,l=u;a<l;a++)i[a]=a;g(i,t,e);var f=m(i);for(a=0,l=n.aaSorting.length;a<l;
2684a++)n.aaSorting[a][0]=f[n.aaSorting[a][0]];if(null!==n.aaSortingFixed)for(a=0,l=n.aaSortingFixed.length;a<l;a++)n.aaSortingFixed[a][0]=f[n.aaSortingFixed[a][0]];for(a=0,l=u;a<l;a++){for(i=0,s=(c=n.aoColumns[a]).aDataSort.length;i<s;i++)c.aDataSort[i]=f[c.aDataSort[i]];c.idx=f[c.idx]}for(h.each(n.aLastSort,function(t,e){n.aLastSort[t].src=f[e.src]}),a=0,l=u;a<l;a++)"number"==typeof(c=n.aoColumns[a]).mData?c.mData=f[c.mData]:h.isPlainObject(c.mData)&&(d(c.mData,"_",f),d(c.mData,"filter",f),d(c.mData,"sort",f),d(c.mData,"type",f));if(n.aoColumns[t].bVisible){for(d=this.oApi._fnColumnIndexToVisible(n,t),s=null,a=e<t?e:e+1;null===s&&a<u;)s=this.oApi._fnColumnIndexToVisible(n,a),a++;for(a=0,l=(i=n.nTHead.getElementsByTagName("tr")).length;a<l;a++)b(i[a],d,s);if(null!==n.nTFoot)for(a=0,l=(i=n.nTFoot.getElementsByTagName("tr")).length;a<l;a++)b(i[a],d,s);for(a=0,l=n.aoData.length;a<l;a++)null!==n.aoData[a].nTr&&b(n.aoData[a].nTr,d,s)}for(g(n.aoColumns,t,e),a=0,l=u;a<l;a++)n.oApi._fnColumnOptions(n,a,{});for(g(n.aoPreSearchCols,t,e),a=0,l=n.aoData.length;a<l;a++){if(c=(s=n.aoData[a]).anCells)for(g(c,t,e),i=0,d=c.length;i<d;i++)c[i]&&c[i]._DT_CellIndex&&(c[i]._DT_CellIndex.column=i);"dom"!==s.src&&h.isArray(s._aData)&&g(s._aData,t,e)}for(a=0,l=n.aoHeader.length;a<l;a++)g(n.aoHeader[a],t,e);if(null!==n.aoFooter)for(a=0,l=n.aoFooter.length;a<l;a++)g(n.aoFooter[a],t,e);for(!r&&r!==p||h.fn.dataTable.Api(n).rows().invalidate(),a=0,l=u;a<l;a++)h(n.aoColumns[a].nTh).off("click.DT"),this.oApi._fnSortAttachListener(n,n.aoColumns[a].nTh,a);h(n.oInstance).trigger("column-reorder.dt",[n,{from:t,to:e,mapping:f,drop:o,iFrom:t,iTo:e,aiInvertMapping:f}])}};var l=function(t,e){var n=new h.fn.dataTable.Api(t).settings()[0];if(n._colReorder)return n._colReorder;!0===e&&(e={});var o=h.fn.dataTable.camelToHungarian;return o&&(o(l.defaults,l.defaults,!0),o(l.defaults,e||{})),this.s={dt:null,init:h.extend(!0,{},l.defaults,e),fixed:0,fixedRight:0,reorderCallback:null,mouse:{startX:-1,startY:-1,offsetX:-1,offsetY:-1,target:-1,targetIndex:-1,fromIndex:-1},aoTargets:[]},this.dom={drag:null,pointer:null},this.s.dt=n,(this.s.dt._colReorder=this)._fnConstruct(),this};return h.extend(l.prototype,{fnReset:function(){return this._fnOrderColumns(this.fnOrder()),this},fnGetCurrentOrder:function(){return this.fnOrder()},fnOrder:function(t,e){var n,o,r=[],a=this.s.dt.aoColumns;if(t===p){for(n=0,o=a.length;n<o;n++)r.push(a[n]._ColReorder_iOrigCol);return r}if(e){for(a=this.fnOrder(),n=0,o=t.length;n<o;n++)r.push(h.inArray(t[n],a));t=r}return this._fnOrderColumns(m(t)),this},fnTranspose:function(t,e){e=e||"toCurrent";var n=this.fnOrder(),o=this.s.dt.aoColumns;return"toCurrent"===e?h.isArray(t)?h.map(t,function(t){return h.inArray(t,n)}):h.inArray(t,n):h.isArray(t)?h.map(t,function(t){return o[t]._ColReorder_iOrigCol}):o[t]._ColReorder_iOrigCol},_fnConstruct:function(){var t,n=this,e=this.s.dt.aoColumns.length,o=this.s.dt.nTable;for(this.s.init.iFixedColumns&&(this.s.fixed=this.s.init.iFixedColumns),this.s.init.iFixedColumnsLeft&&(this.s.fixed=this.s.init.iFixedColumnsLeft),this.s.fixedRight=this.s.init.iFixedColumnsRight?this.s.init.iFixedColumnsRight:0,this.s.init.fnReorderCallback&&(this.s.reorderCallback=this.s.init.fnReorderCallback),t=0;t<e;t++)t>this.s.fixed-1&&t<e-this.s.fixedRight&&this._fnMouseListener(t,this.s.dt.aoColumns[t].nTh),this.s.dt.aoColumns[t]._ColReorder_iOrigCol=t;this.s.dt.oApi._fnCallbackReg(this.s.dt,"aoStateSaveParams",function(t,e){n._fnStateSave.call(n,e)},"ColReorder_State");var r=null;if(this.s.init.aiOrder&&(r=this.s.init.aiOrder.slice()),this.s.dt.oLoadedState&&void 0!==this.s.dt.oLoadedState.ColReorder&&this.s.dt.oLoadedState.ColReorder.length==this.s.dt.aoColumns.length&&(r=this.s.dt.oLoadedState.ColReorder),r)if(n.s.dt._bInitComplete)e=m(r),n._fnOrderColumns.call(n,e);else{var a=!1;h(o).on("draw.dt.colReorder",function(){if(!n.s.dt._bInitComplete&&!a){a=!0;var t=m(r);n._fnOrderColumns.call(n,t)}})}else this._fnSetColumnIndexes();h(o).on("destroy.dt.colReorder",function(){h(o).off("destroy.dt.colReorder draw.dt.colReorder"),h(n.s.dt.nTHead).find("*").off(".ColReorder"),h.each(n.s.dt.aoColumns,function(t,e){h(e.nTh).removeAttr("data-column-index")}),n.s.dt._colReorder=null,n.s=null})},_fnOrderColumns:function(t){var e=!1;if(t.length!=this.s.dt.aoColumns.length)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"ColReorder - array reorder does not match known number of columns. Skipping.");else{for(var n=0,o=t.length;n<o;n++){var r=h.inArray(n,t);n!=r&&(g(t,r,n),this.s.dt.oInstance.fnColReorder(r,n,!0,!1),e=!0)}h.fn.dataTable.Api(this.s.dt).rows().invalidate(),this._fnSetColumnIndexes(),e&&(""===this.s.dt.oScroll.sX&&""===this.s.dt.oScroll.sY||this.s.dt.oInstance.fnAdjustColumnSizing(!1),this.s.dt.oInstance.oApi._fnSaveState(this.s.dt),null!==this.s.reorderCallback&&this.s.reorderCallback.call(this))}},_fnStateSave:function(t){var e,n,o,r=this.s.dt.aoColumns;if(t.ColReorder=[],t.aaSorting){for(e=0;e<t.aaSorting.length;e++)t.aaSorting[e][0]=r[t.aaSorting[e][0]]._ColReorder_iOrigCol;var a=h.extend(!0,[],t.aoSearchCols);for(e=0,n=r.length;e<n;e++)o=r[e]._ColReorder_iOrigCol,t.aoSearchCols[o]=a[e],t.abVisCols[o]=r[e].bVisible,t.ColReorder.push(o)}else if(t.order){for(e=0;e<t.order.length;e++)t.order[e][0]=r[t.order[e][0]]._ColReorder_iOrigCol;for(a=h.extend(!0,[],t.columns),e=0,n=r.length;e<n;e++)o=r[e]._ColReorder_iOrigCol,t.columns[o]=a[e],t.ColReorder.push(o)}},_fnMouseListener:function(t,e){var n=this;h(e).on("mousedown.ColReorder",function(t){n._fnMouseDown.call(n,t,e)}).on("touchstart.ColReorder",function(t){n._fnMouseDown.call(n,t,e)})},_fnMouseDown:function(t,e){var n=this,o=h(t.target).closest("th, td").offset(),r=parseInt(h(e).attr("data-column-index"),10);
2684r!==p&&(this.s.mouse.startX=this._fnCursorPosition(t,"pageX"),this.s.mouse.startY=this._fnCursorPosition(t,"pageY"),this.s.mouse.offsetX=this._fnCursorPosition(t,"pageX")-o.left,this.s.mouse.offsetY=this._fnCursorPosition(t,"pageY")-o.top,this.s.mouse.target=this.s.dt.aoColumns[r].nTh,this.s.mouse.targetIndex=r,this.s.mouse.fromIndex=r,this._fnRegions(),h(a).on("mousemove.ColReorder touchmove.ColReorder",function(t){n._fnMouseMove.call(n,t)}).on("mouseup.ColReorder touchend.ColReorder",function(t){n._fnMouseUp.call(n,t)}))},_fnMouseMove:function(t){if(null===this.dom.drag){if(Math.pow(Math.pow(this._fnCursorPosition(t,"pageX")-this.s.mouse.startX,2)+Math.pow(this._fnCursorPosition(t,"pageY")-this.s.mouse.startY,2),.5)<5)return;this._fnCreateDragNode()}this.dom.drag.css({left:this._fnCursorPosition(t,"pageX")-this.s.mouse.offsetX,top:this._fnCursorPosition(t,"pageY")-this.s.mouse.offsetY});for(var e=!1,n=this.s.mouse.toIndex,o=1,r=this.s.aoTargets.length;o<r;o++)if(this._fnCursorPosition(t,"pageX")<this.s.aoTargets[o-1].x+(this.s.aoTargets[o].x-this.s.aoTargets[o-1].x)/2){this.dom.pointer.css("left",this.s.aoTargets[o-1].x),this.s.mouse.toIndex=this.s.aoTargets[o-1].to,e=!0;break}e||(this.dom.pointer.css("left",this.s.aoTargets[this.s.aoTargets.length-1].x),this.s.mouse.toIndex=this.s.aoTargets[this.s.aoTargets.length-1].to),this.s.init.bRealtime&&n!==this.s.mouse.toIndex&&(this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex,!1),this.s.mouse.fromIndex=this.s.mouse.toIndex,this._fnRegions())},_fnMouseUp:function(){h(a).off(".ColReorder"),null!==this.dom.drag&&(this.dom.drag.remove(),this.dom.pointer.remove(),this.dom.drag=null,this.dom.pointer=null,this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex,!0),this._fnSetColumnIndexes(),""===this.s.dt.oScroll.sX&&""===this.s.dt.oScroll.sY||this.s.dt.oInstance.fnAdjustColumnSizing(!1),this.s.dt.oInstance.oApi._fnSaveState(this.s.dt),null!==this.s.reorderCallback&&this.s.reorderCallback.call(this))},_fnRegions:function(){var t=this.s.dt.aoColumns;this.s.aoTargets.splice(0,this.s.aoTargets.length),this.s.aoTargets.push({x:h(this.s.dt.nTable).offset().left,to:0});for(var e=0,n=this.s.aoTargets[0].x,o=0,r=t.length;o<r;o++)o!=this.s.mouse.fromIndex&&e++,t[o].bVisible&&"none"!==t[o].nTh.style.display&&(n+=h(t[o].nTh).outerWidth(),this.s.aoTargets.push({x:n,to:e}));0!==this.s.fixedRight&&this.s.aoTargets.splice(this.s.aoTargets.length-this.s.fixedRight),0!==this.s.fixed&&this.s.aoTargets.splice(0,this.s.fixed)},_fnCreateDragNode:function(){var t=""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY,e=this.s.dt.aoColumns[this.s.mouse.targetIndex].nTh,n=e.parentNode,o=n.parentNode,r=o.parentNode,a=h(e).clone();this.dom.drag=h(r.cloneNode(!1)).addClass("DTCR_clonedTable").append(h(o.cloneNode(!1)).append(h(n.cloneNode(!1)).append(a[0]))).css({position:"absolute",top:0,left:0,width:h(e).outerWidth(),height:h(e).outerHeight()}).appendTo("body"),this.dom.pointer=h("<div></div>").addClass("DTCR_pointer").css({position:"absolute",top:t?h("div.dataTables_scroll",this.s.dt.nTableWrapper).offset().top:h(this.s.dt.nTable).offset().top,height:t?h("div.dataTables_scroll",this.s.dt.nTableWrapper).height():h(this.s.dt.nTable).height()}).appendTo("body")},_fnSetColumnIndexes:function(){h.each(this.s.dt.aoColumns,function(t,e){h(e.nTh).attr("data-column-index",t)})},_fnCursorPosition:function(t,e){return-1!==t.type.indexOf("touch")?t.originalEvent.touches[0][e]:t[e]}}),l.defaults={aiOrder:null,bRealtime:!0,iFixedColumnsLeft:0,iFixedColumnsRight:0,fnReorderCallback:null},l.version="1.4.1",h.fn.dataTable.ColReorder=l,h.fn.DataTable.ColReorder=l,"function"==typeof h.fn.dataTable&&"function"==typeof h.fn.dataTableExt.fnVersionCheck&&h.fn.dataTableExt.fnVersionCheck("1.10.8")?h.fn.dataTableExt.aoFeatures.push({fnInit:function(t){var e=t.oInstance;return t._colReorder?e.oApi._fnLog(t,1,"ColReorder attempted to initialise twice. Ignoring second"):(e=t.oInit,new l(t,e.colReorder||e.oColReorder||{})),null},cFeature:"R",sFeature:"ColReorder"}):alert("Warning: ColReorder requires DataTables 1.10.8 or greater - www.datatables.net/download"),h(a).on("preInit.dt.colReorder",function(t,e){if("dt"===t.namespace){var n=e.oInit.colReorder,o=r.defaults.colReorder;(n||o)&&(o=h.extend({},n,o),!1!==n&&new l(e,o))}}),h.fn.dataTable.Api.register("colReorder.reset()",function(){return this.iterator("table",function(t){t._colReorder.fnReset()})}),h.fn.dataTable.Api.register("colReorder.order()",function(e,n){return e?this.iterator("table",function(t){t._colReorder.fnOrder(e,n)}):this.context.length?this.context[0]._colReorder.fnOrder():null}),h.fn.dataTable.Api.register("colReorder.transpose()",function(t,e){return this.context.length&&this.context[0]._colReorder?this.context[0]._colReorder.fnTranspose(t,e):t}),h.fn.dataTable.Api.register("colReorder.move()",function(t,e,n,o){return this.context.length&&this.context[0]._colReorder.s.dt.oInstance.fnColReorder(t,e,n,o),this}),l}),function(n){"function"==typeof define&&define.amd?define("datatables.net-rowreorder",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(b,l,y,t){var r=b.fn.dataTable,a=function(t,e){if(!r.versionCheck||!r.versionCheck("1.10.8"))throw"DataTables RowReorder requires DataTables 1.10.8 or newer";this.c=b.extend(!0,{},r.defaults.rowReorder,a.defaults,e),this.s={bodyTop:null,dt:new r.Api(t),getDataFn:r.ext.oApi._fnGetObjectDataFn(this.c.dataSrc),middles:null,scroll:{},scrollInterval:null,setDataFn:r.ext.oApi._fnSetObjectDataFn(this.c.dataSrc),start:{top:0,left:0,offsetTop:0,offsetLeft:0,nodes:[]},windowHeight:0,documentOuterHeight:0,domCloneOuterHeight:0},this.dom={clone:null,dtScroll:b("div.dataTables_scrollBody",this.s.dt.table().container())};var n=this.s.dt.settings()[0],o=n.rowreorder;if(o)return o;(n.rowreorder=this)._constructor()};b.extend(a.prototype,{_constructor:function(){var o=this,r=this.s.dt,t=b(r.table().node());"static"===t.css("position")&&t.css("position","relative"),b(r.table().container()).on("mousedown.rowReorder touchstart.rowReorder",this.c.selector,function(t){if(o.c.enable){var e=b(this).closest("tr"),n=r.row(e);if(n.any())return o._emitEvent("pre-row-reorder",{node:n.node(),index:n.index()}),o._mouseDown(t,e),!1}}),r.on("destroy.rowReorder",function(){b(r.table().container()).off(".rowReorder"),r.off(".rowReorder")})},_cachePositions:function(){var n=this.s.dt,e=b(n.table().node()).find("thead").outerHeight(),t=b.unique(n.rows({page:"current"}).nodes().toArray()),o=b.map(t,function(t){return b(t).position().top-e});t=b.map(o,function(t,e){return o.length<e-1?(t+o[e+1])/2:(t+t+b(n.row(":last-child").node()).outerHeight())/2});this.s.middles=t,this.s.bodyTop=b(n.table().body()).offset().top,this.s.windowHeight=b(l).height(),this.s.documentOuterHeight=b(y).outerHeight()},_clone:function(t){var e=b(this.s.dt.table().node().cloneNode(!1)).addClass("dt-rowReorder-float").append("<tbody/>").append(t.clone(!1)),n=t.outerWidth(),o=t.outerHeight(),r=t.children().map(function(){return b(this).width()});e.width(n).height(o).find("tr").children().each(function(t){this.style.width=r[t]+"px"}),e.appendTo("body"),this.dom.clone=e,this.s.domCloneOuterHeight=e.outerHeight()},_clonePosition:function(t){var e=this.s.start,n=this._eventToPage(t,"Y")-e.top,o=(t=this._eventToPage(t,"X")-e.left,this.c.snapX);n+=e.offsetTop,e=!0===o?e.offsetLeft:"number"==typeof o?e.offsetLeft+o:t+e.offsetLeft;n<0?n=0:n+this.s.domCloneOuterHeight>this.s.documentOuterHeight&&(n=this.s.documentOuterHeight-this.s.domCloneOuterHeight),this.dom.clone.css({top:n,left:e})},_emitEvent:function(e,n){this.s.dt.iterator("table",function(t){b(t.
2684nTable).triggerHandler(e+".dt",n)})},_eventToPage:function(t,e){return-1!==t.type.indexOf("touch")?t.originalEvent.touches[0]["page"+e]:t["page"+e]},_mouseDown:function(t,e){var n=this,o=this.s.dt,r=this.s.start,a=e.offset();r.top=this._eventToPage(t,"Y"),r.left=this._eventToPage(t,"X"),r.offsetTop=a.top,r.offsetLeft=a.left,r.nodes=b.unique(o.rows({page:"current"}).nodes().toArray()),this._cachePositions(),this._clone(e),this._clonePosition(t),(this.dom.target=e).addClass("dt-rowReorder-moving"),b(y).on("mouseup.rowReorder touchend.rowReorder",function(t){n._mouseUp(t)}).on("mousemove.rowReorder touchmove.rowReorder",function(t){n._mouseMove(t)}),b(l).width()===b(y).width()&&b(y.body).addClass("dt-rowReorder-noOverflow"),o=this.dom.dtScroll,this.s.scroll={windowHeight:b(l).height(),windowWidth:b(l).width(),dtTop:o.length?o.offset().top:null,dtLeft:o.length?o.offset().left:null,dtHeight:o.length?o.outerHeight():null,dtWidth:o.length?o.outerWidth():null}},_mouseMove:function(t){this._clonePosition(t);for(var e=this._eventToPage(t,"Y")-this.s.bodyTop,n=this.s.middles,o=null,r=this.s.dt,a=r.table().body(),l=0,i=n.length;l<i;l++)if(e<n[l]){o=l;break}null===o&&(o=n.length),null!==this.s.lastInsert&&this.s.lastInsert===o||(0===o?this.dom.target.prependTo(a):(e=b.unique(r.rows({page:"current"}).nodes().toArray()),o>this.s.lastInsert?this.dom.target.insertAfter(e[o-1]):this.dom.target.insertBefore(e[o])),this._cachePositions(),this.s.lastInsert=o),this._shiftScroll(t)},_mouseUp:function(){var e,n,o=this,r=this.s.dt,a=this.c.dataSrc;this.dom.clone.remove(),this.dom.clone=null,this.dom.target.removeClass("dt-rowReorder-moving"),b(y).off(".rowReorder"),b(y.body).removeClass("dt-rowReorder-noOverflow"),clearInterval(this.s.scrollInterval),this.s.scrollInterval=null;var t=this.s.start.nodes,l=b.unique(r.rows({page:"current"}).nodes().toArray()),i={},s=[],d=[],c=this.s.getDataFn,u=this.s.setDataFn;for(e=0,n=t.length;e<n;e++)if(t[e]!==l[e]){var f=r.row(l[e]).id(),h=r.row(l[e]).data(),p=r.row(t[e]).data();f&&(i[f]=c(p)),s.push({node:l[e],oldData:c(h),newData:c(p),newPosition:e,oldPosition:b.inArray(l[e],t)}),d.push(l[e])}var m=[s,{dataSrc:a,nodes:d,values:i,triggerRow:r.row(this.dom.target)}];this._emitEvent("row-reorder",m);function g(){if(o.c.update){for(e=0,n=s.length;e<n;e++){var t=r.row(s[e].node).data();u(t,s[e].newData),r.columns().every(function(){this.dataSrc()===a&&r.cell(s[e].node,this.index()).invalidate("data")})}o._emitEvent("row-reordered",m),r.draw(!1)}}this.c.editor?(this.c.enable=!1,this.c.editor.edit(d,!1,b.extend({submit:"changed"},this.c.formOptions)).multiSet(a,i).one("submitUnsuccessful.rowReorder",function(){r.draw(!1)}).one("submitSuccess.rowReorder",function(){g()}).one("submitComplete",function(){o.c.enable=!0,o.c.editor.off(".rowReorder")}).submit()):g()},_shiftScroll:function(t){var e,n,o=this,r=this.s.scroll,a=!1,l=t.pageY-y.body.scrollTop;l<65?e=-5:l>r.windowHeight-65&&(e=5),null!==r.dtTop&&t.pageY<r.dtTop+65?n=-5:null!==r.dtTop&&t.pageY>r.dtTop+r.dtHeight-65&&(n=5),e||n?(r.windowVert=e,r.dtVert=n,a=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),this.s.scrollInterval=null),!this.s.scrollInterval&&a&&(this.s.scrollInterval=setInterval(function(){if(r.windowVert&&(y.body.scrollTop=y.body.scrollTop+r.windowVert),r.dtVert){var t=o.dom.dtScroll[0];r.dtVert&&(t.scrollTop=t.scrollTop+r.dtVert)}},20))}}),a.defaults={dataSrc:0,editor:null,enable:!0,formOptions:{},selector:"td:first-child",snapX:!1,update:!0};var e=b.fn.dataTable.Api;return e.register("rowReorder()",function(){return this}),e.register("rowReorder.enable()",function(e){return e===t&&(e=!0),this.iterator("table",function(t){t.rowreorder&&(t.rowreorder.c.enable=e)})}),e.register("rowReorder.disable()",function(){return this.iterator("table",function(t){t.rowreorder&&(t.rowreorder.c.enable=!1)})}),a.version="1.2.3",b.fn.dataTable.RowReorder=a,b.fn.DataTable.RowReorder=a,b(y).on("init.dt.dtr",function(t,e){if("dt"===t.namespace){var n=e.oInit.rowReorder,o=r.defaults.rowReorder;(n||o)&&(o=b.extend({},n,o),!1!==n&&new a(e,o))}}),a}),function(n){"function"==typeof define&&define.amd?define("datatables.net-fixedcolumns",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(g,i,s,b){var e,r=g.fn.dataTable,d=function(t,e){var n=this;
2684if(this instanceof d){e!==b&&!0!==e||(e={});var o=g.fn.dataTable.camelToHungarian;if(o&&(o(d.defaults,d.defaults,!0),o(d.defaults,e)),o=new g.fn.dataTable.Api(t).settings()[0],this.s={dt:o,iTableColumns:o.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[],rtl:"rtl"===g(o.nTable).css("direction")},this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}},o._oFixedColumns)throw"FixedColumns already initialised on this table";o._oFixedColumns=this,o._bInitComplete?this._fnConstruct(e):o.oApi._fnCallbackReg(o,"aoInitComplete",function(){n._fnConstruct(e)},"FixedColumns")}else alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.")};return g.extend(d.prototype,{fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnColCalc(),this._fnGridLayout(),this.fnUpdate()},fnRecalculateHeight:function(t){delete t._DTTC_iHeight,t.style.height="auto"},fnSetRowHeight:function(t,e){t.style.height=e+"px"},fnGetPosition:function(t){var e=this.s.dt.oInstance;if(g(t).parents(".DTFC_Cloned").length){if("tr"===t.nodeName.toLowerCase())return t=g(t).index(),e.fnGetPosition(g("tr",this.s.dt.nTBody)[t]);var n=g(t).index();t=g(t.parentNode).index();return[e.fnGetPosition(g("tr",this.s.dt.nTBody)[t]),n,e.oApi._fnVisibleToColumnIndex(this.s.dt,n)]}return e.fnGetPosition(t)},_fnConstruct:function(t){var a=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+d.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");else if(""===this.s.dt.oScroll.sX)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled");else{this.s=g.extend(!0,this.s,d.defaults,t),t=this.s.dt.oClasses,this.dom.grid.dt=g(this.s.dt.nTable).parents("div."+t.sScrollWrapper)[0],this.dom.scroller=g("div."+t.sScrollBody,this.dom.grid.dt)[0],this._fnColCalc(),this._fnGridSetup();var e,n=!1;g(this.s.dt.nTableWrapper).on("mousedown.DTFC",function(){n=!0,g(s).one("mouseup",function(){n=!1})}),g(this.dom.scroller).on("mouseover.DTFC touchstart.DTFC",function(){n||(e="main")}).on("scroll.DTFC",function(t){!e&&t.originalEvent&&(e="main"),"main"===e&&(0<a.s.iLeftColumns&&(a.dom.grid.left.liner.scrollTop=a.dom.scroller.scrollTop),0<a.s.iRightColumns)&&(a.dom.grid.right.liner.scrollTop=a.dom.scroller.scrollTop)});var o="onwheel"in s.createElement("div")?"wheel.DTFC":"mousewheel.DTFC";0<a.s.iLeftColumns&&g(a.dom.grid.left.liner).on("mouseover.DTFC touchstart.DTFC",function(){n||(e="left")}).on("scroll.DTFC",function(t){!e&&t.originalEvent&&(e="left"),"left"===e&&(a.dom.scroller.scrollTop=a.dom.grid.left.liner.scrollTop,0<a.s.iRightColumns&&(a.dom.grid.right.liner.scrollTop=a.dom.grid.left.liner.scrollTop))}).on(o,function(t){a.dom.scroller.scrollLeft-="wheel"===t.type?-t.originalEvent.deltaX:t.originalEvent.wheelDeltaX}),0<a.s.iRightColumns&&g(a.dom.grid.right.liner).on("mouseover.DTFC touchstart.DTFC",function(){n||(e="right")}).on("scroll.DTFC",function(t){!e&&t.originalEvent&&(e="right"),"right"===e&&(a.dom.scroller.scrollTop=a.dom.grid.right.liner.scrollTop,0<a.s.iLeftColumns&&(a.dom.grid.left.liner.scrollTop=a.dom.grid.right.liner.scrollTop))}).on(o,function(t){a.dom.scroller.scrollLeft-="wheel"===t.type?-t.originalEvent.deltaX:t.originalEvent.wheelDeltaX}),g(i).on("resize.DTFC",function(){a._fnGridLayout.call(a)});var r=!0,l=g(this.s.dt.nTable);l.on("draw.dt.DTFC",function(){a._fnColCalc(),a._fnDraw.call(a,r),r=!1}).on("column-sizing.dt.DTFC",function(){a._fnColCalc(),a._fnGridLayout(a)}).on("column-visibility.dt.DTFC",function(t,e,n,o,r){r!==b&&!r||(a._fnColCalc(),a._fnGridLayout(a),a._fnDraw(!0))}).on("select.dt.DTFC deselect.dt.DTFC",function(t){"dt"===t.namespace&&a._fnDraw(!1)}).on("destroy.dt.DTFC",function(){l.off(".DTFC"),g(a.dom.scroller).off(".DTFC"),g(i).off(".DTFC"),g(a.s.dt.nTableWrapper).off(".DTFC"),g(a.dom.grid.left.liner).off(".DTFC "+o),g(a.dom.grid.left.wrapper).remove(),g(a.dom.grid.right.liner).off(".DTFC "+o),g(a.dom.grid.right.wrapper).remove()}),this._fnGridLayout(),this.s.dt.oInstance.fnDraw(!1)}},_fnColCalc:function(){var a=this,l=0,i=0;this.s.aiInnerWidths=[],this.s.aiOuterWidths=[],g.each(this.s.dt.aoColumns,function(t,e){var n,o=g(e.nTh);if(o.filter(":visible").length){var r=o.outerWidth();0===a.s.aiOuterWidths.length&&(r+="string"==typeof(n=g(a.s.dt.nTable).css("border-left-width"))?1:parseInt(n,10)),a.s.aiOuterWidths.length===a.s.dt.aoColumns.length-1&&(r+="string"==typeof(n=g(a.s.dt.nTable).css("border-right-width"))?1:parseInt(n,10)),a.s.aiOuterWidths.push(r),a.s.aiInnerWidths.push(o.width()),t<a.s.iLeftColumns&&(l+=r),a.s.iTableColumns-a.s.iRightColumns<=t&&(i+=r)}else a.s.aiInnerWidths.push(0),a.s.aiOuterWidths.push(0)}),this.s.iLeftWidth=l,this.s.iRightWidth=i},_fnGridSetup:function(){var t,e=this._fnDTOverflow();this.dom.body=this.s.dt.nTable,this.dom.header=this.s.dt.nTHead.parentNode,this.dom.header.parentNode.parentNode.style.position="relative";var n=g('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;"><div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_LeftBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div><div class="DTFC_RightWrapper" style="position:absolute; top:0; right:0;"><div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightHeadBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div><div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_RightBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightFootBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div></div></div>')[0],o=n.childNodes[0],r=n.childNodes[1];this.dom.grid.dt.parentNode.insertBefore(n,this.dom.grid.dt),n.appendChild(this.dom.grid.dt),this.dom.grid.wrapper=n,0<this.s.iLeftColumns&&(this.dom.grid.left.wrapper=o,this.dom.grid.left.head=o.childNodes[0],this.dom.grid.left.body=o.childNodes[1],this.dom.grid.left.liner=g("div.DTFC_LeftBodyLiner",n)[0],n.appendChild(o)),0<this.s.iRightColumns&&(this.dom.grid.right.wrapper=r,this.dom.grid.right.head=r.childNodes[0],this.dom.grid.right.body=r.childNodes[1],this.dom.grid.right.liner=g("div.DTFC_RightBodyLiner",n)[0],r.style.right=e.bar+"px",(t=g("div.DTFC_RightHeadBlocker",n)[0]).style.width=e.bar+"px",t.style.right=-e.bar+"px",this.dom.grid.right.headBlock=t,(t=g("div.DTFC_RightFootBlocker",n)[0]).style.width=e.bar+"px",t.style.right=-e.bar+"px",this.dom.grid.right.footBlock=t,n.appendChild(r)),this.s.dt.nTFoot&&(this.dom.footer=this.s.dt.nTFoot.parentNode,0<this.s.iLeftColumns&&(this.dom.grid.left.foot=o.childNodes[2]),0<this.s.iRightColumns)&&(this.dom.grid.right.foot=r.childNodes[2]),this.s.rtl&&g("div.DTFC_RightHeadBlocker",n).css({left:-e.bar+"px",right:""})},_fnGridLayout:function(){var n=this,t=this.dom.grid;g(t.wrapper).width();function e(t,e){a.bar?n._firefoxScrollError()?34<g(t).height()&&(t.style.width=e+a.bar+"px"):t.style.width=e+a.bar+"px":(t.style.width=e+20+"px",t.style.paddingRight="20px",t.style.boxSizing="border-box")}
2684var o=g(this.s.dt.nTable.parentNode).outerHeight(),r=g(this.s.dt.nTable.parentNode.parentNode).outerHeight(),a=this._fnDTOverflow(),l=this.s.iLeftWidth,i=this.s.iRightWidth,s="rtl"===g(this.dom.body).css("direction");a.x&&(o-=a.bar),t.wrapper.style.height=r+"px",0<this.s.iLeftColumns&&((r=t.left.wrapper).style.width=l+"px",r.style.height="1px",s?(r.style.left="",r.style.right=0):(r.style.left=0,r.style.right=""),t.left.body.style.height=o+"px",t.left.foot&&(t.left.foot.style.top=(a.x?a.bar:0)+"px"),e(t.left.liner,l),t.left.liner.style.height=o+"px",t.left.liner.style.maxHeight=o+"px"),0<this.s.iRightColumns&&((r=t.right.wrapper).style.width=i+"px",r.style.height="1px",this.s.rtl?(r.style.left=a.y?a.bar+"px":0,r.style.right=""):(r.style.left="",r.style.right=a.y?a.bar+"px":0),t.right.body.style.height=o+"px",t.right.foot&&(t.right.foot.style.top=(a.x?a.bar:0)+"px"),e(t.right.liner,i),t.right.liner.style.height=o+"px",t.right.liner.style.maxHeight=o+"px",t.right.headBlock.style.display=a.y?"block":"none",t.right.footBlock.style.display=a.y?"block":"none")},_fnDTOverflow:function(){var t=this.s.dt.nTable,e=t.parentNode,n={x:!1,y:!1,bar:this.s.dt.oScroll.iBarWidth};return t.offsetWidth>e.clientWidth&&(n.x=!0),t.offsetHeight>e.clientHeight&&(n.y=!0),n},_fnDraw:function(t){this._fnGridLayout(),this._fnCloneLeft(t),this._fnCloneRight(t),null!==this.s.fnDrawCallback&&this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right),g(this).trigger("draw.dtfc",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(t){if(!(this.s.iRightColumns<=0)){var e,n=[];for(e=this.s.iTableColumns-this.s.iRightColumns;e<this.s.iTableColumns;e++)this.s.dt.aoColumns[e].bVisible&&n.push(e);this._fnClone(this.dom.clone.right,this.dom.grid.right,n,t)}},_fnCloneLeft:function(t){if(!(this.s.iLeftColumns<=0)){var e,n=[];for(e=0;e<this.s.iLeftColumns;e++)this.s.dt.aoColumns[e].bVisible&&n.push(e);this._fnClone(this.dom.clone.left,this.dom.grid.left,n,t)}},_fnCopyLayout:function(t,e,n){for(var o=[],r=[],a=[],l=0,i=t.length;l<i;l++){var s=[];s.nTr=g(t[l].nTr).clone(n,!1)[0];for(var d=0,c=this.s.iTableColumns;d<c;d++)if(-1!==g.inArray(d,e)){var u=g.inArray(t[l][d].cell,a);-1===u?(u=g(t[l][d].cell).clone(n,!1)[0],r.push(u),a.push(t[l][d].cell),s.push({cell:u,unique:t[l][d].unique})):s.push({cell:r[u],unique:t[l][d].unique})}o.push(s)}return o},_fnClone:function(t,e,o,n){var r,a,l,i,s,d,c,u,f,h=this,p=this.s.dt;if(n){for(g(t.header).remove(),t.header=g(this.dom.header).clone(!0,!1)[0],t.header.className+=" DTFC_Cloned",t.header.style.width="100%",e.head.appendChild(t.header),u=this._fnCopyLayout(p.aoHeader,o,!0),(i=g(">thead",t.header)).empty(),r=0,a=u.length;r<a;r++)i[0].appendChild(u[r].nTr);p.oApi._fnDrawHead(p,u,!0)}else for(u=this._fnCopyLayout(p.aoHeader,o,!1),f=[],p.oApi._fnDetectHeader(f,g(">thead",t.header)[0]),r=0,a=u.length;r<a;r++)for(l=0,i=u[r].length;l<i;l++)f[r][l].cell.className=u[r][l].cell.className,g("span.DataTables_sort_icon",f[r][l].cell).each(function(){this.className=g("span.DataTables_sort_icon",u[r][l].cell)[0].className});this._fnEqualiseHeights("thead",this.dom.header,t.header),"auto"==this.s.sHeightMatch&&g(">tbody>tr",h.dom.body).css("height","auto"),null!==t.body&&(g(t.body).remove(),t.body=null),t.body=g(this.dom.body).clone(!0)[0],t.body.className+=" DTFC_Cloned",t.body.style.paddingBottom=p.oScroll.iBarWidth+"px",t.body.style.marginBottom=2*p.oScroll.iBarWidth+"px",null!==t.body.getAttribute("id")&&t.body.removeAttribute("id"),g(">thead>tr",t.body).empty(),g(">tfoot",t.body).remove();var m=g("tbody",t.body)[0];if(g(m).empty(),0<p.aiDisplay.length){for(a=g(">thead>tr",t.body)[0],c=0;c<o.length;c++)s=o[c],(d=g(p.aoColumns[s].nTh).clone(!0)[0]).innerHTML="",(i=d.style).paddingTop="0",i.paddingBottom="0",i.borderTopWidth="0",i.borderBottomWidth="0",i.height=0,i.width=h.s.aiInnerWidths[s]+"px",a.appendChild(d);g(">tbody>tr",h.dom.body).each(function(t){t=!1===h.s.dt.oFeatures.bServerSide?h.s.dt.aiDisplay[h.s.dt._iDisplayStart+t]:t;var e=h.s.dt.aoData[t].anCells||g(this).children("td, th"),n=this.cloneNode(!1);for(n.removeAttribute("id"),n.setAttribute("data-dt-row",t),c=0;c<o.length;c++)s=o[c],0<e.length&&((d=g(e[s]).clone(!0,!0)[0]).removeAttribute("id"),d.setAttribute("data-dt-row",t),d.setAttribute("data-dt-column",p.oApi._fnVisibleToColumnIndex(p,s)),n.appendChild(d));m.appendChild(n)})}else g(">tbody>tr",h.dom.body).each(function(){(d=this.cloneNode(!0)).className=d.className+" DTFC_NoData",g("td",d).html(""),m.appendChild(d)});if(t.body.style.width="100%",t.body.style.margin="0",t.body.style.padding="0",p.oScroller!==b&&(a=p.oScroller.dom.force,e.forcer?e.forcer.style.height=a.style.height:(e.forcer=a.cloneNode(!0),e.liner.appendChild(e.forcer))),e.liner.appendChild(t.body),this._fnEqualiseHeights("tbody",h.dom.body,t.body),null!==p.nTFoot){if(n){for(null!==t.footer&&t.footer.parentNode.removeChild(t.footer),t.footer=g(this.dom.footer).clone(!0,!0)[0],t.footer.className+=" DTFC_Cloned",t.footer.style.width="100%",e.foot.appendChild(t.footer),u=this._fnCopyLayout(p.aoFooter,o,!0),(e=g(">tfoot",t.footer)).empty(),r=0,a=u.length;r<a;r++)e[0].appendChild(u[r].nTr);p.oApi._fnDrawHead(p,u,!0)}else for(u=this._fnCopyLayout(p.aoFooter,o,!1),e=[],p.oApi._fnDetectHeader(e,g(">tfoot",t.footer)[0]),r=0,a=u.length;r<a;r++)for(l=0,i=u[r].length;l<i;l++)e[r][l].cell.className=u[r][l].cell.className;this._fnEqualiseHeights("tfoot",this.dom.footer,t.footer)}e=p.oApi._fnGetUniqueThs(p,g(">thead",t.header)[0]),g(e).each(function(t){s=o[t],this.style.width=h.s.aiInnerWidths[s]+"px"}),null!==h.s.dt.nTFoot&&(e=p.oApi._fnGetUniqueThs(p,g(">tfoot",t.footer)[0]),g(e).each(function(t){s=o[t],this.style.width=h.s.aiInnerWidths[s]+"px"}))},_fnGetTrNodes:function(t){for(var e=[],n=0,o=t.childNodes.length;n<o;n++)"TR"==t.childNodes[n].nodeName.toUpperCase()&&e.push(t.childNodes[n]);return e},_fnEqualiseHeights:function(t,e,n){if("none"!=this.s.sHeightMatch||"thead"===t||"tfoot"===t){var o,r,a=e.getElementsByTagName(t)[0];n=n.getElementsByTagName(t)[0];(t=g(">"+t+">tr:eq(0)",e).children(":first")).outerHeight(),t.height();a=this._fnGetTrNodes(a),e=this._fnGetTrNodes(n);var l=[];for(n=0,t=e.length;n<t;n++)o=(o=a[n].offsetHeight)<(r=e[n].offsetHeight)?r:o,"semiauto"==this.s.sHeightMatch&&(a[n]._DTTC_iHeight=o),l.push(o);for(n=0,t=e.length;n<t;n++)e[n].style.height=l[n]+"px",a[n].style.height=l[n]+"px"}},_firefoxScrollError:function(){if(e===b){var t=g("<div/>").css({position:"absolute",top:0,left:0,height:10,width:50,overflow:"scroll"}).appendTo("body");e=t[0].clientWidth===t[0].offsetWidth&&0!==this._fnDTOverflow().bar,t.remove()}return e}}),d.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sHeightMatch:"semiauto"},d.version="3.2.3",r.Api.register("fixedColumns()",function(){return this}),r.Api.register("fixedColumns().update()",function(){return this.iterator("table",function(t){t._oFixedColumns&&t._oFixedColumns.fnUpdate()})}),r.Api.register("fixedColumns().relayout()",function(){return this.iterator("table",function(t){t._oFixedColumns&&t._oFixedColumns.fnRedrawLayout()})}),r.Api.register("rows().recalcHeight()",function(){return this.iterator("row",function(t,e){t._oFixedColumns&&t._oFixedColumns.fnRecalculateHeight(this.row(e).node())})}),r.Api.register("fixedColumns().rowIndex()",function(t){return(t=g(t)).parents(".DTFC_Cloned").length?this.rows({page:"current"}).indexes()[t.index()]:this.row(t).index()}),r.Api.register("fixedColumns().cellIndex()",function(t){if((t=g(t)).parents(".DTFC_Cloned").length){var e=t.parent().index();e=this.rows({page:"current"}).indexes()[e],t=t.parents(".DTFC_LeftWrapper").length?t.index():this.columns().flatten().length-this.context[0]._oFixedColumns.s.iRightColumns+t.index();return{row:e,column:this.column.index("toData",t),columnVisible:t}}return this.cell(t).index()}),g(s).on("init.dt.fixedColumns",function(t,e){if("dt"===t.namespace){var n=e.oInit.fixedColumns,o=r.defaults.fixedColumns;(n||o)&&(o=g.extend({},n,o),!1!==n&&new d(e,o))}}),g.fn.dataTable.FixedColumns=d,g.fn.DataTable.FixedColumns=d}),function(n){"function"==typeof define&&define.amd?define("datatables.net-fixedheader",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(l,o,i,r){var a=l.fn.dataTable,s=0,d=function(t,e){if(!(this instanceof d))throw"FixedHeader must be initialised with the 'new' keyword.";!0===e&&(e={}),t=new a.Api(t),this.c=l.extend(!0,{},d.defaults,e),this.s={dt:t,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:l(o).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:t.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+s++,scrollLeft:{header:-1,footer:-1}
2684,enable:!0},this.dom={floatingHeader:null,thead:l(t.table().header()),tbody:l(t.table().body()),tfoot:l(t.table().footer()),header:{host:null,floating:null,placeholder:null},footer:{host:null,floating:null,placeholder:null}},this.dom.header.host=this.dom.thead.parent(),this.dom.footer.host=this.dom.tfoot.parent();var n=t.settings()[0];if(n._fixedHeader)throw"FixedHeader already initialised on table "+n.nTable.id;(n._fixedHeader=this)._constructor()};return l.extend(d.prototype,{enable:function(t){this.s.enable=t,this.c.header&&this._modeChange("in-place","header",!0),this.c.footer&&this.dom.tfoot.length&&this._modeChange("in-place","footer",!0),this.update()},headerOffset:function(t){return t!==r&&(this.c.headerOffset=t,this.update()),this.c.headerOffset},footerOffset:function(t){return t!==r&&(this.c.footerOffset=t,this.update()),this.c.footerOffset},update:function(){this._positions(),this._scroll(!0)},_constructor:function(){var t=this,e=this.s.dt;l(o).on("scroll"+this.s.namespace,function(){t._scroll()}).on("resize"+this.s.namespace,function(){t.s.position.windowHeight=l(o).height(),t.update()});var n=l(".fh-fixedHeader");!this.c.headerOffset&&n.length&&(this.c.headerOffset=n.outerHeight()),n=l(".fh-fixedFooter"),!this.c.footerOffset&&n.length&&(this.c.footerOffset=n.outerHeight()),e.on("column-reorder.dt.dtfc column-visibility.dt.dtfc draw.dt.dtfc column-sizing.dt.dtfc",function(){t.update()}),e.on("destroy.dtfc",function(){e.off(".dtfc"),l(o).off(t.s.namespace)}),this._positions(),this._scroll()},_clone:function(t,e){var n=this.s.dt,o=this.dom[t],r="header"===t?this.dom.thead:this.dom.tfoot;!e&&o.floating?o.floating.removeClass("fixedHeader-floating fixedHeader-locked"):(o.floating&&(o.placeholder.remove(),this._unsize(t),o.floating.children().detach(),o.floating.remove()),o.floating=l(n.table().node().cloneNode(!1)).css("table-layout","fixed").removeAttr("id").append(r).appendTo("body"),o.placeholder=r.clone(!1),o.placeholder.find("*[id]").removeAttr("id"),o.host.prepend(o.placeholder),this._matchWidths(o.placeholder,o.floating))},_matchWidths:function(e,n){function t(t,e){l(t,n).each(function(t){l(this).css({width:e[t],minWidth:e[t]})})}var o=(r=function(t){return l(t,e).map(function(){return l(this).width()}).toArray()})("th"),r=r("td");t("th",o),t("td",r)},_unsize:function(t){var e=this.dom[t].floating;e&&("footer"===t||"header"===t&&!this.s.autoWidth)?l("th, td",e).css({width:"",minWidth:""}):e&&"header"===t&&l("th, td",e).css("min-width","")},_horizontal:function(t,e){var n=this.dom[t],o=this.s.position,r=this.s.scrollLeft;n.floating&&r[t]!==e&&(n.floating.css("left",o.left-e),r[t]=e)},_modeChange:function(t,e,n){var o=this.dom[e],r=this.s.position,a=l.contains(this.dom["footer"===e?"tfoot":"thead"][0],i.activeElement)?i.activeElement:null;"in-place"===t?(o.placeholder&&(o.placeholder.remove(),o.placeholder=null),this._unsize(e),"header"===e?o.host.prepend(this.dom.thead):o.host.append(this.dom.tfoot),o.floating&&(o.floating.remove(),o.floating=null)):"in"===t?(this._clone(e,n),o.floating.addClass("fixedHeader-floating").css("header"===e?"top":"bottom",this.c[e+"Offset"]).css("left",r.left+"px").css("width",r.width+"px"),"footer"===e&&o.floating.css("top","")):"below"===t?(this._clone(e,n),o.floating.addClass("fixedHeader-locked").css("top",r.tfootTop-r.theadHeight).css("left",r.left+"px").css("width",r.width+"px")):"above"===t&&(this._clone(e,n),o.floating.addClass("fixedHeader-locked").css("top",r.tbodyTop).css("left",r.left+"px").css("width",r.width+"px")),a&&a!==i.activeElement&&a.focus(),this.s.scrollLeft.header=-1,this.s.scrollLeft.footer=-1,this.s[e+"Mode"]=t},_positions:function(){var t=this.s.dt.table(),e=this.s.position,n=this.dom,o=(t=l(t.node())).children("thead"),r=t.children("tfoot");n=n.tbody;e.visible=t.is(":visible"),e.width=t.outerWidth(),e.left=t.offset().left,e.theadTop=o.offset().top,e.tbodyTop=n.offset().top,e.theadHeight=e.tbodyTop-e.theadTop,r.length?(e.tfootTop=r.offset().top,e.tfootBottom=e.tfootTop+r.outerHeight(),e.tfootHeight=e.tfootBottom-e.tfootTop):(e.tfootTop=e.tbodyTop+n.outerHeight(),e.tfootBottom=e.tfootTop,e.tfootHeight=e.tfootTop)},_scroll:function(t){var e,n=l(i).scrollTop(),o=l(i).scrollLeft(),r=this.s.position;this.s.enable&&(this.c.header&&(e=!r.visible||n<=r.theadTop-this.c.headerOffset?"in-
2684place":n<=r.tfootTop-r.theadHeight-this.c.headerOffset?"in":"below",!t&&e===this.s.headerMode||this._modeChange(e,"header",t),this._horizontal("header",o)),this.c.footer&&this.dom.tfoot.length)&&(n=!r.visible||n+r.windowHeight>=r.tfootBottom+this.c.footerOffset?"in-place":r.windowHeight+n>r.tbodyTop+r.tfootHeight+this.c.footerOffset?"in":"above",!t&&n===this.s.footerMode||this._modeChange(n,"footer",t),this._horizontal("footer",o))}}),d.version="3.1.3",d.defaults={header:!0,footer:!1,headerOffset:0,footerOffset:0},l.fn.dataTable.FixedHeader=d,l.fn.DataTable.FixedHeader=d,l(i).on("init.dt.dtfh",function(t,e){if("dt"===t.namespace){var n=e.oInit.fixedHeader,o=a.defaults.fixedHeader;!n&&!o||e._fixedHeader||(o=l.extend({},o,n),!1!==n&&new d(e,o))}}),a.Api.register("fixedHeader()",function(){}),a.Api.register("fixedHeader.adjust()",function(){return this.iterator("table",function(t){(t=t._fixedHeader)&&t.update()})}),a.Api.register("fixedHeader.enable()",function(e){return this.iterator("table",function(t){t=t._fixedHeader,e=e===r||e,t&&e!==t.s.enable&&t.enable(e)})}),a.Api.register("fixedHeader.disable()",function(){return this.iterator("table",function(t){(t=t._fixedHeader)&&t.s.enable&&t.enable(!1)})}),l.each(["header","footer"],function(t,n){a.Api.register("fixedHeader."+n+"Offset()",function(e){var t=this.context;return e===r?t.length&&t[0]._fixedHeader?t[0]._fixedHeader[n+"Offset"]():r:this.iterator("table",function(t){(t=t._fixedHeader)&&t[n+"Offset"](e)})})}),d}),function(n){"function"==typeof define&&define.amd?define("datatables.net-select",["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,e&&e.fn.dataTable||(e=require("datatables.net")(t,e).$),n(e,t,t.document)}:n(jQuery,window,document)}(function(c,l,t,u){function i(a,t,e){var n;n=function(e,n){if(n<e){var t=n;n=e,e=t}var o=!1;return a.columns(":visible").indexes().filter(function(t){return t===e&&(o=!0),t===n?!(o=!1):o})};function o(e,n){var t=a.rows({search:"applied"}).indexes();if(t.indexOf(e)>t.indexOf(n)){var o=n;n=e,e=o}var r=!1;return t.filter(function(t){return t===e&&(r=!0),t===n?!(r=!1):r})}e=a.cells({selected:!0}).any()||e?(n=n(e.column,t.column),o(e.row,t.row)):(n=n(0,t.column),o(0,t.row)),e=a.cells(e,n).flatten(),a.cells(t,{selected:!0}).any()?a.cells(e).deselect():a.cells(e).select()}function r(t){var e=t.settings()[0]._select.selector;c(t.table().container()).off("mousedown.dtSelect",e).off("mouseup.dtSelect",e).off("click.dtSelect",e),c("body").off("click.dtSelect"+t.table().node().id)}function a(a){var e=c(a.table().container()),n=a.settings()[0],o=n._select.selector;e.on("mousedown.dtSelect",o,function(t){(t.shiftKey||t.metaKey||t.ctrlKey)&&e.css("-moz-user-select","none").one("selectstart.dtSelect",o,function(){return!1})}).on("mouseup.dtSelect",o,function(){e.css("-moz-user-select","")}).on("click.dtSelect",o,function(t){var e=a.select.items();if(!l.getSelection||!c.trim(l.getSelection().toString())){var n=a.settings()[0];if(c(t.target).closest("div.dataTables_wrapper")[0]==a.table().container()){var o=a.cell(c(t.target).closest("td, th"));if(o.any()){var r=c.Event("user-select.dt");s(a,r,[e,o,t]),r.isDefaultPrevented()||(r=o.index(),"row"===e?(e=r.row,p(t,a,n,"row",e)):"column"===e?(e=o.index().column,p(t,a,n,"column",e)):"cell"===e&&(e=o.index(),p(t,a,n,"cell",e)),n._select_lastCell=r)}}}}),c("body").on("click.dtSelect"+a.table().node().id,function(t){!n._select.blurable||c(t.target).parents().filter(a.table().container()).length||0===c(t.target).parents("html").length||c(t.target).parents("div.DTE").length||h(n,!0)})}function s(t,e,n,o){o&&!t.flatten().length||("string"==typeof e&&(e+=".dt"),n.unshift(t),c(t.table().node()).trigger(e,n))}function d(o){var t=o.settings()[0];if(t._select.info&&t.aanFeatures.i&&"api"!==o.select.style()){function r(t,e,n){t.append(c('<span class="select-item"/>').append(o.i18n("select."+e+"s",{_:"%d "+e+"s selected",0:"",1:"1 "+e+" selected"},n)))}var a=o.rows({selected:!0}).flatten().length,l=o.columns({selected:!0}).flatten().length,i=o.cells({selected:!0}).flatten().length;c.each(t.aanFeatures.i,function(t,e){e=c(e);
2684var n=c('<span class="select-info"/>');r(n,"row",a),r(n,"column",l),r(n,"cell",i);var o=e.children("span.select-info");o.length&&o.remove(),""!==n.text()&&e.append(n)})}}function f(t,e,n,o){var r=t[e+"s"]({search:"applied"}).indexes(),a=(o=c.inArray(o,r),c.inArray(n,r));if(t[e+"s"]({selected:!0}).any()||-1!==o){if(a<o){var l=a;a=o,o=l}r.splice(a+1,r.length),r.splice(0,o)}else r.splice(c.inArray(n,r)+1,r.length);t[e](n,{selected:!0}).any()?(r.splice(c.inArray(n,r),1),t[e+"s"](r).deselect()):t[e+"s"](r).select()}function h(t,e){if(e||"single"===t._select.style){var n=new g.Api(t);n.rows({selected:!0}).deselect(),n.columns({selected:!0}).deselect(),n.cells({selected:!0}).deselect()}}function p(t,e,n,o,r){var a=e.select.style(),l=e[o](r,{selected:!0}).any();"os"===a?t.ctrlKey||t.metaKey?e[o](r).select(!l):t.shiftKey?"cell"===o?i(e,r,n._select_lastCell||null):f(e,o,r,n._select_lastCell?n._select_lastCell[o]:null):(t=e[o+"s"]({selected:!0}),l&&1===t.flatten().length?e[o](r).deselect():(t.deselect(),e[o](r).select())):"multi+shift"==a&&t.shiftKey?"cell"===o?i(e,r,n._select_lastCell||null):f(e,o,r,n._select_lastCell?n._select_lastCell[o]:null):e[o](r).select(!l)}function n(e,n){return function(t){return t.i18n("buttons."+e,n)}}function m(t){return"draw.dt.DT"+(t=t._eventNamespace)+" select.dt.DT"+t+" deselect.dt.DT"+t}var g=c.fn.dataTable;g.select={},g.select.version="1.2.3",g.select.init=function(t){var e=t.settings()[0],n=e.oInit.select,o=g.defaults.select,r=(n=n===u?o:n,o="row","api"),a=!1,l=!0,i="td, th",s="selected",d=!1;e._select={},!0===n?(r="os",d=!0):"string"==typeof n?(r=n,d=!0):c.isPlainObject(n)&&(n.blurable!==u&&(a=n.blurable),n.info!==u&&(l=n.info),n.items!==u&&(o=n.items),n.style!==u&&(r=n.style,d=!0),n.selector!==u&&(i=n.selector),n.className!==u)&&(s=n.className),t.select.selector(i),t.select.items(o),t.select.style(r),t.select.blurable(a),t.select.info(l),e._select.className=s,c.fn.dataTable.ext.order["select-checkbox"]=function(e,t){return this.api().column(t,{order:"index"}).nodes().map(function(t){return"row"===e._select.items?c(t).parent().hasClass(e._select.className):"cell"===e._select.items&&c(t).hasClass(e._select.className)})},!d&&c(t.table().node()).hasClass("selectable")&&t.select.style("os")},c.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(t,i){g.ext.selector[i.type].push(function(t,e,n){var o,r=[];if((e=e.selected)===u)return n;for(var a=0,l=n.length;a<l;a++)o=t[i.prop][n[a]],(!0===e&&!0===o._select_selected||!1===e&&!o._select_selected)&&r.push(n[a]);return r})}),g.ext.selector.cell.push(function(t,e,n){var o,r=[];if((e=e.selected)===u)return n;for(var a=0,l=n.length;a<l;a++)o=t.aoData[n[a].row],(!0!==e||!o._selected_cells||!0!==o._selected_cells[n[a].column])&&(!1!==e||o._selected_cells&&o._selected_cells[n[a].column])||r.push(n[a]);return r});var e=g.Api.register,o=g.Api.registerPlural;e("select()",function(){return this.iterator("table",function(t){g.select.init(new g.Api(t))})}),e("select.blurable()",function(e){return e===u?this.context[0]._select.blurable:this.iterator("table",function(t){t._select.blurable=e})}),e("select.info()",function(e){return d===u?this.context[0]._select.info:this.iterator("table",function(t){t._select.info=e})}),e("select.items()",function(e){return e===u?this.context[0]._select.items:this.iterator("table",function(t){t._select.items=e,s(new g.Api(t),"selectItems",[e])})}),e("select.style()",function(e){return e===u?this.context[0]._select.style:this.iterator("table",function(o){if(o._select.style=e,!o._select_init){var n=new g.Api(o);o.aoRowCreatedCallback.push({fn:function(t,e,n){for((e=o.aoData[n])._select_selected&&c(t).addClass(o._select.className),t=0,n=o.aoColumns.length;t<n;t++)(o.aoColumns[t]._select_selected||e._selected_cells&&e._selected_cells[t])&&c(e.anCells[t]).addClass(o._select.className)},sName:"select-deferRender"}),n.on("preXhr.dt.dtSelect",function(){var t=n.rows({selected:!0}).ids(!0).filter(function(t){return t!==u}),e=n.cells({selected:!0}).eq(0).map(function(t){var e=n.row(t.row).id(!0);return e?{row:e,column:t.column}:u}).filter(function(t){return t!==u});n.one("draw.dt.dtSelect",function(){n.rows(t).select(),e.any()&&e.each(function(t){n.cells(t.row,t.column).select()})})}),n.on("draw.dtSelect.dt select.dtSelect.dt deselect.dtSelect.dt info.dt",function(){d(n)}),n.on("destroy.dtSelect",function(){r(n),n.off(".dtSelect")})}var t=new g.Api(o);r(t),"api"!==e&&a(t),s(new g.Api(o),"selectStyle",[e])})}),e("select.selector()",function(e){return e===u?this.context[0]._select.selector:this.iterator("table",function(t){r(new g.Api(t)),t._select.selector=e,"api"!==t._select.style&&a(new g.Api(t))})}),o("rows().select()","row().select()",function(t){var n=this;return!1===t?this.deselect():(this.iterator("row",function(t,e){h(t),t.aoData[e]._select_selected=!0,c(t.aoData[e].nTr).addClass(t._select.className)}),this.iterator("table",function(t,e){s(n,"select",["row",n[e]],!0)}),this)}),o("columns().select()","column().select()",function(t){var n=this;return!1===t?this.deselect():(this.iterator("column",function(t,e){h(t),t.aoColumns[e]._select_selected=!0;var n=new g.Api(t).column(e);c(n.header()).addClass(t._select.className),c(n.footer()).addClass(t._select.className),n.nodes().to$().addClass(t._select.className)}),this.iterator("table",function(t,e){s(n,"select",["column",n[e]],!0)}),this)}),o("cells().select()","cell().select()",function(t){var n=this;return!1===t?this.deselect():(this.iterator("cell",function(t,e,n){h(t),(e=t.aoData[e])._selected_cells===u&&(e._selected_cells=[]),e._selected_cells[n]=!0,e.anCells&&c(e.anCells[n]).addClass(t._select.className)}),this.iterator("table",function(t,e){s(n,"select",["cell",n[e]],!0)}),this)}),o("rows().deselect()","row().deselect()",function(){var n=this;return this.iterator("row",function(t,e){t.aoData[e]._select_selected=!1,c(t.aoData[e].nTr).removeClass(t._select.className)}),this.iterator("table",function(t,e){s(n,"deselect",["row",n[e]],!0)}),this}),o("columns().deselect()","column().deselect()",function(){var n=this;return this.iterator("column",function(o,t){o.aoColumns[t]._select_selected=!1;var e=new g.Api(o),n=e.column(t);c(n.header()).removeClass(o._select.className),c(n.footer()).removeClass(o._select.className),e.cells(null,t).indexes().each(function(t){var e=o.aoData[t.row],n=e._selected_cells;!e.anCells||n&&n[t.column]||c(e.anCells[t.column]).removeClass(o._select.className)})}),this.iterator("table",function(t,e){s(n,"deselect",["column",n[e]],!0)}),this}),o("cells().deselect()","cell().deselect()",function(){var n=this;return this.iterator("cell",function(t,e,n){(e=t.aoData[e])._selected_cells[n]=!1,e.anCells&&!t.aoColumns[n]._select_selected&&c(e.anCells[n]).removeClass(t._select.className)}),this.iterator("table",function(t,e){s(n,"deselect",["cell",n[e]],!0)}),this});var b=0;return c.extend(g.ext.buttons,{selected:{text:n("selected","Selected"),className:"buttons-selected",init:function(t,e,n){var o=this;n._eventNamespace=".select"+b++,t.on(m(n),function(){var t=o.rows({selected:!0}).any()||o.columns({selected:!0}).any()||o.cells({selected:!0}).any();o.enable(t)}
2684),this.disable()},destroy:function(t,e,n){t.off(n._eventNamespace)}},selectedSingle:{text:n("selectedSingle","Selected single"),className:"buttons-selected-single",init:function(e,t,n){var o=this;n._eventNamespace=".select"+b++,e.on(m(n),function(){var t=e.rows({selected:!0}).flatten().length+e.columns({selected:!0}).flatten().length+e.cells({selected:!0}).flatten().length;o.enable(1===t)}),this.disable()},destroy:function(t,e,n){t.off(n._eventNamespace)}},selectAll:{text:n("selectAll","Select all"),className:"buttons-select-all",action:function(){this[this.select.items()+"s"]().select()}},selectNone:{text:n("selectNone","Deselect all"),className:"buttons-select-none",action:function(){h(this.settings()[0],!0)},init:function(e,t,n){var o=this;n._eventNamespace=".select"+b++,e.on(m(n),function(){var t=e.rows({selected:!0}).flatten().length+e.columns({selected:!0}).flatten().length+e.cells({selected:!0}).flatten().length;o.enable(0<t)}),this.disable()},destroy:function(t,e,n){t.off(n._eventNamespace)}}}),c.each(["Row","Column","Cell"],function(t,e){var r=e.toLowerCase();g.ext.buttons["select"+e+"s"]={text:n("select"+e+"s","Select "+r+"s"),className:"buttons-select-"+r+"s",action:function(){this.select.items(r)},init:function(t){var o=this;t.on("selectItems.dt.DT",function(t,e,n){o.active(n===r)})}}}),c(t).on("preInit.dt.dtSelect",function(t,e){"dt"===t.namespace&&g.select.init(new g.Api(e))}),g.select}),define("mockup-patterns-datatables",["jquery","pat-base","datatables.net","datatables.net-bs","datatables.net-buttons","datatables.net-buttons-colvis","datatables.net-buttons-flash","datatables.net-buttons-html5","datatables.net-buttons-print","datatables.net-buttons-bs","datatables.net-colreorder","datatables.net-rowreorder","datatables.net-fixedcolumns","datatables.net-fixedheader","datatables.net-select"],function(t,e,n){"use strict";return e.extend({name:"datatables",trigger:".pat-datatables",parser:"mockup",table:null,defaults:{},init:function(){this.table=this.$el.DataTable(this.options)}})}),require(["mockup-patterns-datatables"],function(){}),define("/home/_thet/data/dev/plone/buildout.coredev/src/plone.staticresources/src/plone/staticresources/static/plone-datatables.js",function(){}); 2685//# sourceMappingURL=plone-datatables-compiled.min.js.map 2686/* Autotoc pattern. 2687 * 2688 * Options: 2689 * IDPrefix(string): Prefix used to generate ID. ('autotoc-item-') 2690 * classActiveName(string): Class used for active level. ('active') 2691 * classLevelPrefixName(string): Class prefix used for the TOC levels. ('autotoc-level-') 2692 * classSectionName(string): Class used for section in TOC. ('autotoc-section') 2693 * classTOCName(string): Class used for the TOC. ('autotoc-nav') 2694 * levels(string): Selectors used to find levels. ('h1,h2,h3') 2695 * scrollDuration(string): Speed of scrolling. ('slow') 2696 * scrollEasing(string): Easing to use while scrolling. ('swing') 2697 * section(string): Tag type to use for TOC. ('section') 2698 * 2699 * Documentation: 2700 * # TOC 2701 * {{ example-1 }} 2702 * 2703 * # Tabs 2704 * {{ example-2-tabs }} 2705 * 2706 * Example: example-1 2707 * <div class="pat-autotoc" 2708 * data-pat-autotoc="scrollDuration:slow;levels:h4,h5,h6;"> 2709 * <h4>Title 1</h4> 2710 * <p>Mr. Zuckerkorn, you've been warned about touching. You said 2711 * spanking. It walked on my pillow! How about a turtle? I've always 2712 * loved those leathery little snappy faces.</p> 2713 * <h5>Title 1.1</h5> 2714 * <p>Ah coodle doodle do Caw ca caw, caw ca caw. Butterscotch!</p> 2715 * <h6>Title 1.1.1</h6> 2716 * <p>Want a lick? Okay, Lindsay, are you forgetting that I was 2717 * a professional twice over - an analyst and a therapist.</p> 2718 * <h4>Title 2</h4> 2719 * <p>You boys know how to shovel coal? Don't worry, these young 2720 * beauties have been nowhere near the bananas. I thought the two of 2721 * us could talk man-on-man.</p> 2722 * </div> 2723 * 2724 * Example: example-2-tabs 2725 * <div class="pat-autotoc autotabs" 2726 * data-pat-autotoc="section:fieldset;levels:legend;"> 2727 * <fieldset> 2728 * <legend>Tab 1</legend> 2729 * <div> 2730 * Lorem ipsum dolor sit amet, ex nam odio ceteros fastidii, 2731 * id porro lorem pro, homero facilisis in cum. 2732 * At doming voluptua indoctum mel, natum noster similique ne mel. 2733 * </div> 2734 * </fieldset> 2735 * <fieldset> 2736 * <legend>Tab 2</legend> 2737 * <div> 2738 * Reque repudiare eum et. Prompta expetendis percipitur eu eam, 2739 * et graece mandamus pro, eu vim harum audire tractatos. 2740 * Ad perpetua salutandi mea, soluta delicata aliquando eam ne. 2741 * Qui nostrum lucilius perpetua ut, eum suas stet oblique ut. 2742 * </div> 2743 * </fieldset> 2744 * <fieldset> 2745 * <legend>Tab 3</legend> 2746 * <div> 2747 * Vis mazim harum deterruisset ex, duo nemore nostro civibus ad, 2748 * eros vituperata id cum. Vim at erat solet soleat, 2749 * eum et iuvaret luptatum, pro an esse dolorum maiestatis. 2750 * </div> 2751 * </fieldset> 2752 * </div> 2753 * 2754 */ 2755 2756define('mockup-patterns-autotoc',[ 2757 'jquery', 2758 'pat-base' 2759], function($, Base) { 2760 2761 2762 var AutoTOC = Base.extend({ 2763 name: 'autotoc', 2764 trigger: '.pat-autotoc', 2765 parser: 'mockup', 2766 defaults: { 2767 section: 'section', 2768 levels: 'h1,h2,h3', 2769 IDPrefix: 'autotoc-item-', 2770 classTOCName: 'autotoc-nav', 2771 classSectionName: 'autotoc-section', 2772 classLevelPrefixName: 'autotoc-level-', 2773 classActiveName: 'active', 2774 scrollDuration: 'slow', 2775 scrollEasing: 'swing' 2776 }, 2777 init: function() { 2778 var self = this; 2779 2780 self.$toc = $('<nav/>').addClass(self.options.classTOCName); 2781 2782 if (self.options.prependTo) { 2783 self.$toc.prependTo(self.options.prependTo); 2784 } else if (self.options.appendTo) { 2785 self.$toc.appendTo(self.options.appendTo); 2786 } else { 2787 self.$toc.prependTo(self.$el); 2788 } 2789 2790 if (self.options.className) { 2791 self.$el.addClass(self.options.className); 2792 } 2793 2794 $(self.options.section, self.$el).addClass(self.options.classSectionName); 2795 2796 var asTabs = self.$el.hasClass('autotabs'); 2797 2798 var activeId = null; 2799 2800 $(self.options.levels, self.$el).each(function(i) { 2801 var $level = $(this), 2802 id = $level.prop('id') ? $level.prop('id') : 2803 $level.parents(self.options.section).prop('id'); 2804 if (!id || $('#' + id).length > 0) { 2805 id = self.options.IDPrefix + self.name + '-' + i; 2806 } 2807 if(window.location.hash === '#' + id){ 2808 activeId = id; 2809 } 2810 if(activeId===null && $level.hasClass(self.options.classActiveName)){ 2811 activeId = id; 2812 } 2813 $level.data('navref', id); 2814 $('<a/>') 2815 .appendTo(self.$toc) 2816 .text($level.text()) 2817 .attr('id', id) 2818 .attr('href', '#' + id) 2819 .addClass(self.options.classLevelPrefixName + self.getLevel($level)) 2820 .on('click', function(e, options) { 2821 e.stopPropagation(); 2822 e.preventDefault(); 2823 if(!options){ 2824 options = { 2825 doScroll: true, 2826 skipHash: false 2827 }; 2828 } 2829 var $el = $(this); 2830 self.$toc.children('.' + self.options.classActiveName).removeClass(self.options.classActiveName); 2831 self.$el.children('.' + self.options.classActiveName).removeClass(self.options.classActiveName); 2832 $(e.target).addClass(self.options.classActiveName); 2833 $level.parents(self.options.section).addClass(self.options.classActiveName); 2834 if (options.doScroll !== false && 2835 self.options.scrollDuration && 2836 $level && 2837 !asTabs) { 2838 $('body,html').animate({ 2839 scrollTop: $level.offset().top 2840 }, self.options.scrollDuration, self.options.scrollEasing); 2841 } 2842 if (self.$el.parents('.plone-modal').size() !== 0) { 2843 self.$el.trigger('resize.plone-modal.patterns'); 2844 } 2845 $(this).trigger('clicked'); 2846 if(!options.skipHash){ 2847 if(window.history && window.history.pushState){ 2848 window.history.pushState({}, '', '#' + $el.attr('id')); 2849 } 2850 } 2851 }); 2852 $level.data('autotoc-trigger-id', id); 2853 }); 2854 2855 if(activeId){ 2856 $('a#' + activeId).trigger('click', { 2857 doScroll: true, 2858 skipHash: true 2859 }); 2860 }else{ 2861 self.$toc.find('a').first().trigger('click', { 2862 doScroll: false, 2863 skipHash: true}); 2864 } 2865 }, 2866 getLevel: function($el) { 2867 var elementLevel = 0; 2868 $.each(this.options.levels.split(','), function(level, levelSelector) { 2869 if ($el.filter(levelSelector).size() === 1) { 2870 elementLevel = level + 1; 2871 return false;
2872 } 2873 }); 2874 return elementLevel; 2875 } 2876 }); 2877 2878 return AutoTOC; 2879 2880}); 2881 2882/* Formautofocus pattern. 2883 * 2884 * Options: 2885 * condition(string): TODO ('div.error') 2886 * target(string): TODO ("div.error :input:not(.formTabs):visible:first') 2887 * always(string): TODO (:input:not(.formTabs):visible:first') 2888 * 2889 * Documentation: 2890 * # TODO 2891 * 2892 * Example: example-1 2893 * 2894 */ 2895 2896 2897define('mockup-patterns-formautofocus',[ 2898 'jquery', 2899 'pat-base' 2900], function($, Base, undefined) { 2901 2902 2903 var FormAutoFocus = Base.extend({ 2904 name: 'formautofocus', 2905 trigger: '.pat-formautofocus', 2906 parser: 'mockup', 2907 defaults: { 2908 condition: 'div.error', 2909 target: 'div.error :input:not(.formTabs):visible:first', 2910 always: ':input:not(.formTabs):visible:first' 2911 }, 2912 init: function() { 2913 var self = this; 2914 if ($(self.options.condition, self.$el).size() !== 0) { 2915 $(self.options.target, self.$el).focus(); 2916 } else { 2917 $(self.options.always, self.$el).focus(); 2918 } 2919 2920 } 2921 }); 2922 2923 return FormAutoFocus; 2924 2925}); 2926 2927/* Mark special links 2928 * 2929 * Options: 2930 * external_links_open_new_window(boolean): Open external links in a new window. (false) 2931 * mark_special_links(boolean): Marks external or special protocl links with class. (true) 2932 * 2933 * Documentation: 2934 * # General 2935 * 2936 * Scan all links in the container and mark external links with class 2937 * if they point outside the site, or are special protocols. 2938 * Also implements new window opening for external links. 2939 * To disable this effect for links on a one-by-one-basis, 2940 * give them a class of 'link-plain' 2941 * 2942 * # Default external link example 2943 * 2944 * {{ example-1 }} 2945 * 2946 * # Open external link in new window 2947 * 2948 * {{ example-2 }} 2949 * 2950 * # Open external link in new window, without icons 2951 * 2952 * {{ example-3 }} 2953 * 2954 * # List of all protocol icons 2955 * 2956 * {{ example-4 }} 2957 * 2958 * Example: example-1 2959 * <div class="pat-markspeciallinks"> 2960 * <ul> 2961 * <li>Find out What's new in <a href="http://www.plone.org">Plone</a>.</li> 2962 * <li>Plone is written in <a class="link-plain" href="http://www.python.org">Python</a>.</li> 2963 * <li>Plone builds on <a href="http://zope.org">Zope</a>.</li> 2964 * <li>Plone uses <a href="/">Mockup</a>.</li> 2965 * </ul> 2966 * </div> 2967 * 2968 * Example: example-2 2969 * <div class="pat-markspeciallinks" data-pat-markspeciallinks='{"external_links_open_new_window": "true"}'> 2970 * <ul> 2971 * <li>Find out What's new in <a href="http://www.plone.org">Plone</a>.</li> 2972 * <li>Plone is written in <a class="link-plain" href="http://www.python.org">Python</a>.</li> 2973 * <li>Plone builds on <a href="http://zope.org">Zope</a>.</li> 2974 * <li>Plone uses <a href="/">Mockup</a>.</li> 2975 * </ul> 2976 * </div> 2977 * 2978 * Example: example-3 2979 * <div class="pat-markspeciallinks" data-pat-markspeciallinks='{"external_links_open_new_window": "true", "mark_special_links": "false"}'> 2980 * <ul> 2981 * <li>Find out What's new in <a href="http://www.plone.org">Plone</a>.</li> 2982 * <li>Plone is written in <a class="link-plain" href="http://www.python.org">Python</a>.</li> 2983 * <li>Plone builds on <a href="http://zope.org">Zope</a>.</li> 2984 * <li>Plone uses <a href="/">Mockup</a>.</li> 2985 * </ul> 2986 * </div> 2987 * 2988 * Example: example-4 2989 * <div class="pat-markspeciallinks"> 2990 * <ul> 2991 * <li><a href="http://www.plone.org">http</a></li> 2992 * <li><a href="https://www.plone.org">https</a></li> 2993 * <li><a href="mailto:[email protected]">mailto</a></li> 2994 * <li><a href="ftp://www.plone.org">ftp</a></li> 2995 * <li><a href="news://www.plone.org">news</a></li> 2996 * <li><a href="irc://www.plone.org">irc</a></li> 2997 * <li><a href="h323://www.plone.org">h323</a></li> 2998 * <li><a href="sip://www.plone.org">sip</a></li> 2999 * <li><a href="callto://www.plone.org">callto</a></li> 3000 * <li><a href="feed://www.plone.org">feed</a></li> 3001 * <li><a href="webcal://www.plone.org">webcal</a></li> 3002 * </ul> 3003 * </div> 3004 * 3005 */ 3006 3007define('mockup-patterns-markspeciallinks',[ 3008 'pat-base', 3009 'jquery' 3010], function (Base, $) { 3011 3012 3013 var MarkSpecialLinks = Base.extend({ 3014 name: 'markspeciallinks', 3015 trigger: '.pat-markspeciallinks', 3016 parser: 'mockup', 3017 defaults: { 3018 external_links_open_new_window: false, 3019 mark_special_links: true 3020 }, 3021 init: function () { 3022 var self = this, $el = self.$el; 3023 3024 // first make external links open in a new window, afterwards do the 3025 // normal plone link wrapping in only the content area 3026 var elonw, 3027 msl, 3028 url, 3029 protocols, 3030 contentarea, 3031 res; 3032 3033 if (typeof self.options.external_links_open_new_window === 'string') { 3034 elonw = self.options.external_links_open_new_window.toLowerCase() === 'true'; 3035 } else if (typeof self.options.external_links_open_new_window === 'boolean') { 3036 elonw = self.options.external_links_open_new_window; 3037 } 3038 3039 if (typeof self.options.mark_special_links === 'string') { 3040 msl = self.options.mark_special_links.toLowerCase() === 'true'; 3041 } else if (typeof self.options.mark_special_links === 'boolean') { 3042 msl = self.options.mark_special_links; 3043 } 3044 3045 url = window.location.protocol + '//' + window.location.host; 3046 protocols = /^(mailto|ftp|news|irc|h323|sip|callto|https|feed|webcal)/; 3047 contentarea = $el; 3048 3049 if (elonw) { 3050 // all http links (without the link-plain class), not within this site 3051 contentarea.find('a[href^="http"]:not(.link-plain):not([href^="' + url + '"])') 3052 .attr('target', '_blank') 3053 .attr('rel', 'noopener'); 3054 } 3055 3056 if (msl) { 3057 // All links with an http href (without the link-plain class), not within this site, 3058 // and no img children should be wrapped in a link-external span 3059 contentarea.find( 3060 'a[href^="http:"]:not(.link-plain):not([href^="' + url + '"]):not(:has(img))') 3061 .before('<i class="glyphicon link-external"></i>'); 3062 // All links without an http href (without the link-plain class), not within this site, 3063 // and no img children should be wrapped in a link-[protocol] span 3064 contentarea.find( 3065 'a[href]:not([href^="http:"]):not(.link-plain):not([href^="' + url + '"]):not(:has(img)):not([href^="#"])') 3066 .each(function() { 3067 // those without a http link may have another interesting protocol 3068 // wrap these in a link-[protocol] span 3069 res = protocols.exec($(this).attr('href')); 3070 if (res) { 3071 var iconclass = 'glyphicon link-' + res[0]; 3072 $(this).before('<i class="' + iconclass + '"></i>'); 3073 } 3074 } 3075 ); 3076 } 3077 } 3078 }); 3079 return MarkSpecialLinks; 3080}); 3081 3082/* Cookie Trigger pattern. 3083 * 3084 * Show a DOM element if browser cookies are disabled. 3085 * 3086 * Documentation: 3087 * 3088 * {{ example-1 }} 3089 * 3090 * Example: example-1 3091 * <div class="portalMessage error pat-cookietrigger"> 3092 * Cookies are not enabled. You must enable cookies before you can log in. 3093 * </div> 3094 */ 3095 3096define('mockup-patterns-cookietrigger',[ 3097 'pat-base' 3098], function (Base) { 3099 3100 3101 var CookieTrigger = Base.extend({ 3102 name: 'cookietrigger', 3103 trigger: '.pat-cookietrigger', 3104 parser: 'mockup', 3105 3106 isCookiesEnabled: function() { 3107 /* Test whether cookies are enabled by attempting to set a cookie 3108 * and then change its value set test cookie. 3109 */ 3110 var c = "areYourCookiesEnabled=0"; 3111 document.cookie = c; 3112 var dc = document.cookie; 3113 // cookie not set? fail 3114 if (dc.indexOf(c) === -1) { 3115 return 0; 3116 } 3117 // change test cookie 3118 c = "areYourCookiesEnabled=1"; 3119 document.cookie = c; 3120 dc = document.cookie; 3121 // cookie not changed? fail 3122 if (dc.indexOf(c) === -1) { 3123 return 0; 3124 } 3125 // delete cookie 3126 document.cookie = "areYourCookiesEnabled=; expires=Thu, 01-Jan-70 00:00:01 GMT"; 3127 return 1; 3128 }, 3129 3130 showIfCookiesDisabled: function() { 3131 /* Show the element on which this pattern is defined if cookies are 3132 * disabled. 3133 */ 3134 if (this.isCookiesEnabled()) { 3135 this.$el.hide(); 3136 } else { 3137 this.$el.show(); 3138 } 3139 }, 3140 3141 init: function () { 3142 this.showIfCookiesDisabled(); 3143 }, 3144 }); 3145 return CookieTrigger; 3146}); 3147 3148/* Navigation marker pattern. 3149 * 3150 * This pattern adds ``inPath`` and ``current`` classes to the navigation to 3151 * allow a different style on selected navigation items or navigation items 3152 * which are in the current path. 3153 * 3154 * This is done in JavaScript, so that the navigation pattern can be cached 3155 * for the whole site. 3156 * 3157 */ 3158 3159define('mockup-patterns-navigationmarker',[ 3160 'jquery', 3161 'pat-base' 3162], function ($, Base) { 3163 3164 var Navigation = Base.extend({ 3165 name: 'navigationmarker', 3166 trigger: '.pat-navigationmarker', 3167 parser: 'mockup', 3168 init: function () { 3169 var self = this; 3170 var href = document.querySelector('head link[rel="canonical"]').href || window.location.href; 3171 3172 $('a', this.$el).each(function () { 3173 var navlink = this.href.replace('/view', ''); 3174 if (href.indexOf(navlink) !== -1) { 3175 var parent = $(this).parent(); 3176 3177 // check the input-openers within the path 3178 var check = parent.find('> input'); 3179 if (check.length) { 3180 check[0].checked = true; 3181 } 3182 3183 // set "inPath" to all nav items which are within the current path 3184 // check if parts of navlink are in canonical url parts 3185 var hrefParts = href.split('/');
vendor: 6,280 bytes, lines 3186-3395
3186 var navParts = navlink.split('/'); 3187 var inPath = false; 3188 for (var i = 0, size = navParts.length; i < size; i++) { 3189 // The last path-part must match. 3190 inPath = false; 3191 if (navParts[i] === hrefParts[i]) { 3192 inPath = true; 3193 } 3194 } 3195 if (inPath) { 3196 parent.addClass('inPath'); 3197 } 3198 3199 // set "current" to the current selected nav item, if it is in the navigation structure. 3200 if (href === navlink) { 3201 parent.addClass('current'); 3202 } 3203 } 3204 }); 3205 } 3206 }); 3207 3208 return Navigation; 3209}); 3210 3211(function(root) { 3212define("bootstrap-dropdown", ["jquery"], function() { 3213 return (function() { 3214/* ======================================================================== 3215 * Bootstrap: dropdown.js v3.4.1 3216 * https://getbootstrap.com/docs/3.4/javascript/#dropdowns 3217 * ======================================================================== 3218 * Copyright 2011-2019 Twitter, Inc. 3219 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3220 * ======================================================================== */ 3221 3222 3223+function ($) { 3224 3225 3226 // DROPDOWN CLASS DEFINITION 3227 // ========================= 3228 3229 var backdrop = '.dropdown-backdrop' 3230 var toggle = '[data-toggle="dropdown"]' 3231 var Dropdown = function (element) { 3232 $(element).on('click.bs.dropdown', this.toggle) 3233 } 3234 3235 Dropdown.VERSION = '3.4.1' 3236 3237 function getParent($this) { 3238 var selector = $this.attr('data-target') 3239 3240 if (!selector) { 3241 selector = $this.attr('href') 3242 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 3243 } 3244 3245 var $parent = selector !== '#' ? $(document).find(selector) : null 3246 3247 return $parent && $parent.length ? $parent : $this.parent() 3248 } 3249 3250 function clearMenus(e) { 3251 if (e && e.which === 3) return 3252 $(backdrop).remove() 3253 $(toggle).each(function () { 3254 var $this = $(this) 3255 var $parent = getParent($this) 3256 var relatedTarget = { relatedTarget: this } 3257 3258 if (!$parent.hasClass('open')) return 3259 3260 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return 3261 3262 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) 3263 3264 if (e.isDefaultPrevented()) return 3265 3266 $this.attr('aria-expanded', 'false') 3267 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) 3268 }) 3269 } 3270 3271 Dropdown.prototype.toggle = function (e) { 3272 var $this = $(this) 3273 3274 if ($this.is('.disabled, :disabled')) return 3275 3276 var $parent = getParent($this) 3277 var isActive = $parent.hasClass('open') 3278 3279 clearMenus() 3280 3281 if (!isActive) { 3282 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 3283 // if mobile we use a backdrop because click events don't delegate 3284 $(document.createElement('div')) 3285 .addClass('dropdown-backdrop') 3286 .insertAfter($(this)) 3287 .on('click', clearMenus) 3288 } 3289 3290 var relatedTarget = { relatedTarget: this } 3291 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) 3292 3293 if (e.isDefaultPrevented()) return 3294 3295 $this 3296 .trigger('focus') 3297 .attr('aria-expanded', 'true') 3298 3299 $parent 3300 .toggleClass('open') 3301 .trigger($.Event('shown.bs.dropdown', relatedTarget)) 3302 } 3303 3304 return false 3305 } 3306 3307 Dropdown.prototype.keydown = function (e) { 3308 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return 3309 3310 var $this = $(this) 3311 3312 e.preventDefault() 3313 e.stopPropagation() 3314 3315 if ($this.is('.disabled, :disabled')) return 3316 3317 var $parent = getParent($this) 3318 var isActive = $parent.hasClass('open') 3319 3320 if (!isActive && e.which != 27 || isActive && e.which == 27) { 3321 if (e.which == 27) $parent.find(toggle).trigger('focus') 3322 return $this.trigger('click') 3323 } 3324 3325 var desc = ' li:not(.disabled):visible a' 3326 var $items = $parent.find('.dropdown-menu' + desc) 3327 3328 if (!$items.length) return 3329 3330 var index = $items.index(e.target) 3331 3332 if (e.which == 38 && index > 0) index-- // up 3333 if (e.which == 40 && index < $items.length - 1) index++ // down 3334 if (!~index) index = 0 3335 3336 $items.eq(index).trigger('focus') 3337 } 3338 3339 3340 // DROPDOWN PLUGIN DEFINITION 3341 // ========================== 3342 3343 function Plugin(option) { 3344 return this.each(function () { 3345 var $this = $(this) 3346 var data = $this.data('bs.dropdown') 3347 3348 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 3349 if (typeof option == 'string') data[option].call($this) 3350 }) 3351 } 3352 3353 var old = $.fn.dropdown 3354 3355 $.fn.dropdown = Plugin 3356 $.fn.dropdown.Constructor = Dropdown 3357 3358 3359 // DROPDOWN NO CONFLICT 3360 // ==================== 3361 3362 $.fn.dropdown.noConflict = function () { 3363 $.fn.dropdown = old 3364 return this 3365 } 3366 3367 3368 // APPLY TO STANDARD DROPDOWN ELEMENTS 3369 // =================================== 3370 3371 $(document) 3372 .on('click.bs.dropdown.data-api', clearMenus) 3373 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 3374 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) 3375 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) 3376 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) 3377 3378}(jQuery); 3379 3380 3381 }).apply(root, arguments); 3382}); 3383}(this)); 3384 3385(function(root) { 3386define("bootstrap-collapse", ["jquery"], function() { 3387 return (function() { 3388/* ======================================================================== 3389 * Bootstrap: collapse.js v3.4.1 3390 * https://getbootstrap.com/docs/3.4/javascript/#collapse 3391 * ======================================================================== 3392 * Copyright 2011-2019 Twitter, Inc. 3393 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3394 * ======================================================================== */ 3395
vendor: 6,275 bytes, lines 3396-3619
3396/* jshint latedef: false */ 3397 3398+function ($) { 3399 3400 3401 // COLLAPSE PUBLIC CLASS DEFINITION 3402 // ================================ 3403 3404 var Collapse = function (element, options) { 3405 this.$element = $(element) 3406 this.options = $.extend({}, Collapse.DEFAULTS, options) 3407 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + 3408 '[data-toggle="collapse"][data-target="#' + element.id + '"]') 3409 this.transitioning = null 3410 3411 if (this.options.parent) { 3412 this.$parent = this.getParent() 3413 } else { 3414 this.addAriaAndCollapsedClass(this.$element, this.$trigger) 3415 } 3416 3417 if (this.options.toggle) this.toggle() 3418 } 3419 3420 Collapse.VERSION = '3.4.1' 3421 3422 Collapse.TRANSITION_DURATION = 350 3423 3424 Collapse.DEFAULTS = { 3425 toggle: true 3426 } 3427 3428 Collapse.prototype.dimension = function () { 3429 var hasWidth = this.$element.hasClass('width') 3430 return hasWidth ? 'width' : 'height' 3431 } 3432 3433 Collapse.prototype.show = function () { 3434 if (this.transitioning || this.$element.hasClass('in')) return 3435 3436 var activesData 3437 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') 3438 3439 if (actives && actives.length) { 3440 activesData = actives.data('bs.collapse') 3441 if (activesData && activesData.transitioning) return 3442 } 3443 3444 var startEvent = $.Event('show.bs.collapse') 3445 this.$element.trigger(startEvent) 3446 if (startEvent.isDefaultPrevented()) return 3447 3448 if (actives && actives.length) { 3449 Plugin.call(actives, 'hide') 3450 activesData || actives.data('bs.collapse', null) 3451 } 3452 3453 var dimension = this.dimension() 3454 3455 this.$element 3456 .removeClass('collapse') 3457 .addClass('collapsing')[dimension](0) 3458 .attr('aria-expanded', true) 3459 3460 this.$trigger 3461 .removeClass('collapsed') 3462 .attr('aria-expanded', true) 3463 3464 this.transitioning = 1 3465 3466 var complete = function () { 3467 this.$element 3468 .removeClass('collapsing') 3469 .addClass('collapse in')[dimension]('') 3470 this.transitioning = 0 3471 this.$element 3472 .trigger('shown.bs.collapse') 3473 } 3474 3475 if (!$.support.transition) return complete.call(this) 3476 3477 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 3478 3479 this.$element 3480 .one('bsTransitionEnd', $.proxy(complete, this)) 3481 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) 3482 } 3483 3484 Collapse.prototype.hide = function () { 3485 if (this.transitioning || !this.$element.hasClass('in')) return 3486 3487 var startEvent = $.Event('hide.bs.collapse') 3488 this.$element.trigger(startEvent) 3489 if (startEvent.isDefaultPrevented()) return 3490 3491 var dimension = this.dimension() 3492 3493 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 3494 3495 this.$element 3496 .addClass('collapsing') 3497 .removeClass('collapse in') 3498 .attr('aria-expanded', false) 3499 3500 this.$trigger 3501 .addClass('collapsed') 3502 .attr('aria-expanded', false) 3503 3504 this.transitioning = 1 3505 3506 var complete = function () { 3507 this.transitioning = 0 3508 this.$element 3509 .removeClass('collapsing') 3510 .addClass('collapse') 3511 .trigger('hidden.bs.collapse') 3512 } 3513 3514 if (!$.support.transition) return complete.call(this) 3515 3516 this.$element 3517 [dimension](0) 3518 .one('bsTransitionEnd', $.proxy(complete, this)) 3519 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) 3520 } 3521 3522 Collapse.prototype.toggle = function () { 3523 this[this.$element.hasClass('in') ? 'hide' : 'show']() 3524 } 3525 3526 Collapse.prototype.getParent = function () { 3527 return $(document).find(this.options.parent) 3528 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') 3529 .each($.proxy(function (i, element) { 3530 var $element = $(element) 3531 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) 3532 }, this)) 3533 .end() 3534 } 3535 3536 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { 3537 var isOpen = $element.hasClass('in') 3538 3539 $element.attr('aria-expanded', isOpen) 3540 $trigger 3541 .toggleClass('collapsed', !isOpen) 3542 .attr('aria-expanded', isOpen) 3543 } 3544 3545 function getTargetFromTrigger($trigger) { 3546 var href 3547 var target = $trigger.attr('data-target') 3548 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 3549 3550 return $(document).find(target) 3551 } 3552 3553 3554 // COLLAPSE PLUGIN DEFINITION 3555 // ========================== 3556 3557 function Plugin(option) { 3558 return this.each(function () { 3559 var $this = $(this) 3560 var data = $this.data('bs.collapse') 3561 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 3562 3563 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false 3564 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 3565 if (typeof option == 'string') data[option]() 3566 }) 3567 } 3568 3569 var old = $.fn.collapse 3570 3571 $.fn.collapse = Plugin 3572 $.fn.collapse.Constructor = Collapse 3573 3574 3575 // COLLAPSE NO CONFLICT 3576 // ==================== 3577 3578 $.fn.collapse.noConflict = function () { 3579 $.fn.collapse = old 3580 return this 3581 } 3582 3583 3584 // COLLAPSE DATA-API 3585 // ================= 3586 3587 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 3588 var $this = $(this) 3589 3590 if (!$this.attr('data-target')) e.preventDefault() 3591 3592 var $target = getTargetFromTrigger($this) 3593 var data = $target.data('bs.collapse') 3594 var option = data ? 'toggle' : $this.data() 3595 3596 Plugin.call($target, option) 3597 }) 3598 3599}(jQuery); 3600 3601return window.jQuery.fn.collapse.Constructor; 3602 }).apply(root, arguments); 3603}); 3604}(this)); 3605 3606(function(root) { 3607define("bootstrap-tooltip", ["jquery"], function() { 3608 return (function() { 3609/* ======================================================================== 3610 * Bootstrap: tooltip.js v3.4.1 3611 * https://getbootstrap.com/docs/3.4/javascript/#tooltip 3612 * Inspired by the original jQuery.tipsy by Jason Frame 3613 * ======================================================================== 3614 * Copyright 2011-2019 Twitter, Inc. 3615 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3616 * ======================================================================== */ 3617 3618+function ($) { 3619
vendor: 20,615 bytes, lines 3619-4286
3619 3620 3621 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'] 3622 3623 var uriAttrs = [ 3624 'background', 3625 'cite', 3626 'href', 3627 'itemtype', 3628 'longdesc', 3629 'poster', 3630 'src', 3631 'xlink:href' 3632 ] 3633 3634 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i 3635 3636 var DefaultWhitelist = { 3637 // Global attributes allowed on any supplied element below. 3638 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 3639 a: ['target', 'href', 'title', 'rel'], 3640 area: [], 3641 b: [], 3642 br: [], 3643 col: [], 3644 code: [], 3645 div: [], 3646 em: [], 3647 hr: [], 3648 h1: [], 3649 h2: [], 3650 h3: [], 3651 h4: [], 3652 h5: [], 3653 h6: [], 3654 i: [], 3655 img: ['src', 'alt', 'title', 'width', 'height'], 3656 li: [], 3657 ol: [], 3658 p: [], 3659 pre: [], 3660 s: [], 3661 small: [], 3662 span: [], 3663 sub: [], 3664 sup: [], 3665 strong: [], 3666 u: [], 3667 ul: [] 3668 } 3669 3670 /** 3671 * A pattern that recognizes a commonly useful subset of URLs that are safe. 3672 * 3673 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3674 */ 3675 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi 3676 3677 /** 3678 * A pattern that matches safe data URLs. Only matches image, video and audio types. 3679 * 3680 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3681 */ 3682 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i 3683 3684 function allowedAttribute(attr, allowedAttributeList) { 3685 var attrName = attr.nodeName.toLowerCase() 3686 3687 if ($.inArray(attrName, allowedAttributeList) !== -1) { 3688 if ($.inArray(attrName, uriAttrs) !== -1) { 3689 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)) 3690 } 3691 3692 return true 3693 } 3694 3695 var regExp = $(allowedAttributeList).filter(function (index, value) { 3696 return value instanceof RegExp 3697 }) 3698 3699 // Check if a regular expression validates the attribute. 3700 for (var i = 0, l = regExp.length; i < l; i++) { 3701 if (attrName.match(regExp[i])) { 3702 return true 3703 } 3704 } 3705 3706 return false 3707 } 3708 3709 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 3710 if (unsafeHtml.length === 0) { 3711 return unsafeHtml 3712 } 3713 3714 if (sanitizeFn && typeof sanitizeFn === 'function') { 3715 return sanitizeFn(unsafeHtml) 3716 } 3717 3718 // IE 8 and below don't support createHTMLDocument 3719 if (!document.implementation || !document.implementation.createHTMLDocument) { 3720 return unsafeHtml 3721 } 3722 3723 var createdDocument = document.implementation.createHTMLDocument('sanitization') 3724 createdDocument.body.innerHTML = unsafeHtml 3725 3726 var whitelistKeys = $.map(whiteList, function (el, i) { return i }) 3727 var elements = $(createdDocument.body).find('*') 3728 3729 for (var i = 0, len = elements.length; i < len; i++) { 3730 var el = elements[i] 3731 var elName = el.nodeName.toLowerCase() 3732 3733 if ($.inArray(elName, whitelistKeys) === -1) { 3734 el.parentNode.removeChild(el) 3735 3736 continue 3737 } 3738 3739 var attributeList = $.map(el.attributes, function (el) { return el }) 3740 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []) 3741 3742 for (var j = 0, len2 = attributeList.length; j < len2; j++) { 3743 if (!allowedAttribute(attributeList[j], whitelistedAttributes)) { 3744 el.removeAttribute(attributeList[j].nodeName) 3745 } 3746 } 3747 } 3748 3749 return createdDocument.body.innerHTML 3750 } 3751 3752 // TOOLTIP PUBLIC CLASS DEFINITION 3753 // =============================== 3754 3755 var Tooltip = function (element, options) { 3756 this.type = null 3757 this.options = null 3758 this.enabled = null 3759 this.timeout = null 3760 this.hoverState = null 3761 this.$element = null 3762 this.inState = null 3763 3764 this.init('tooltip', element, options) 3765 } 3766 3767 Tooltip.VERSION = '3.4.1' 3768 3769 Tooltip.TRANSITION_DURATION = 150 3770 3771 Tooltip.DEFAULTS = { 3772 animation: true, 3773 placement: 'top', 3774 selector: false, 3775 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 3776 trigger: 'hover focus', 3777 title: '', 3778 delay: 0, 3779 html: false, 3780 container: false, 3781 viewport: { 3782 selector: 'body', 3783 padding: 0 3784 }, 3785 sanitize : true, 3786 sanitizeFn : null, 3787 whiteList : DefaultWhitelist 3788 } 3789 3790 Tooltip.prototype.init = function (type, element, options) { 3791 this.enabled = true 3792 this.type = type 3793 this.$element = $(element) 3794 this.options = this.getOptions(options) 3795 this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) 3796 this.inState = { click: false, hover: false, focus: false } 3797 3798 if (this.$element[0] instanceof document.constructor && !this.options.selector) { 3799 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') 3800 } 3801 3802 var triggers = this.options.trigger.split(' ') 3803 3804 for (var i = triggers.length; i--;) { 3805 var trigger = triggers[i] 3806 3807 if (trigger == 'click') { 3808 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 3809 } else if (trigger != 'manual') { 3810 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 3811 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 3812 3813 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 3814 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 3815 } 3816 } 3817 3818 this.options.selector ? 3819 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 3820 this.fixTitle() 3821 } 3822 3823 Tooltip.prototype.getDefaults = function () { 3824 return Tooltip.DEFAULTS 3825 } 3826 3827 Tooltip.prototype.getOptions = function (options) { 3828 var dataAttributes = this.$element.data() 3829 3830 for (var dataAttr in dataAttributes) { 3831 if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) { 3832 delete dataAttributes[dataAttr] 3833 } 3834 } 3835 3836 options = $.extend({}, this.getDefaults(), dataAttributes, options) 3837 3838 if (options.delay && typeof options.delay == 'number') { 3839 options.delay = { 3840 show: options.delay, 3841 hide: options.delay 3842 } 3843 } 3844 3845 if (options.sanitize) { 3846 options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn) 3847 } 3848 3849 return options 3850 } 3851 3852 Tooltip.prototype.getDelegateOptions = function () { 3853 var options = {} 3854 var defaults = this.getDefaults() 3855 3856 this._options && $.each(this._options, function (key, value) { 3857 if (defaults[key] != value) options[key] = value 3858 }) 3859 3860 return options 3861 } 3862 3863 Tooltip.prototype.enter = function (obj) { 3864 var self = obj instanceof this.constructor ? 3865 obj : $(obj.currentTarget).data('bs.' + this.type) 3866 3867 if (!self) { 3868 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 3869 $(obj.currentTarget).data('bs.' + this.type, self) 3870 } 3871 3872 if (obj instanceof $.Event) { 3873 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true 3874 } 3875 3876 if (self.tip().hasClass('in') || self.hoverState == 'in') { 3877 self.hoverState = 'in' 3878 return 3879 } 3880 3881 clearTimeout(self.timeout) 3882 3883 self.hoverState = 'in' 3884 3885 if (!self.options.delay || !self.options.delay.show) return self.show() 3886 3887 self.timeout = setTimeout(function () { 3888 if (self.hoverState == 'in') self.show() 3889 }, self.options.delay.show) 3890 } 3891 3892 Tooltip.prototype.isInStateTrue = function () { 3893 for (var key in this.inState) { 3894 if (this.inState[key]) return true 3895 } 3896 3897 return false 3898 } 3899 3900 Tooltip.prototype.leave = function (obj) { 3901 var self = obj instanceof this.constructor ? 3902 obj : $(obj.currentTarget).data('bs.' + this.type) 3903 3904 if (!self) { 3905 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 3906 $(obj.currentTarget).data('bs.' + this.type, self) 3907 } 3908 3909 if (obj instanceof $.Event) { 3910 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false 3911 } 3912 3913 if (self.isInStateTrue()) return 3914 3915 clearTimeout(self.timeout) 3916 3917 self.hoverState = 'out' 3918 3919 if (!self.options.delay || !self.options.delay.hide) return self.hide() 3920 3921 self.timeout = setTimeout(function () { 3922 if (self.hoverState == 'out') self.hide() 3923 }, self.options.delay.hide) 3924 } 3925 3926 Tooltip.prototype.show = function () { 3927 var e = $.Event('show.bs.' + this.type) 3928 3929 if (this.hasContent() && this.enabled) { 3930 this.$element.trigger(e) 3931 3932 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) 3933 if (e.isDefaultPrevented() || !inDom) return 3934 var that = this 3935 3936 var $tip = this.tip() 3937 3938 var tipId = this.getUID(this.type) 3939 3940 this.setContent() 3941 $tip.attr('id', tipId) 3942 this.$element.attr('aria-describedby', tipId) 3943 3944 if (this.options.animation) $tip.addClass('fade') 3945 3946 var placement = typeof this.options.placement == 'function' ? 3947 this.options.placement.call(this, $tip[0], this.$element[0]) : 3948 this.options.placement 3949 3950 var autoToken = /\s?auto?\s?/i 3951 var autoPlace = autoToken.test(placement) 3952 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 3953 3954 $tip 3955 .detach() 3956 .css({ top: 0, left: 0, display: 'block' }) 3957 .addClass(placement) 3958 .data('bs.' + this.type, this) 3959 3960 this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element) 3961 this.$element.trigger('inserted.bs.' + this.type) 3962 3963 var pos = this.getPosition() 3964 var actualWidth = $tip[0].offsetWidth 3965 var actualHeight = $tip[0].offsetHeight 3966 3967 if (autoPlace) { 3968 var orgPlacement = placement 3969 var viewportDim = this.getPosition(this.$viewport) 3970 3971 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : 3972 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : 3973 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : 3974 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : 3975 placement 3976 3977 $tip 3978 .removeClass(orgPlacement) 3979 .addClass(placement) 3980 } 3981 3982 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 3983 3984 this.applyPlacement(calculatedOffset, placement) 3985 3986 var complete = function () { 3987 var prevHoverState = that.hoverState 3988 that.$element.trigger('shown.bs.' + that.type) 3989 that.hoverState = null 3990 3991 if (prevHoverState == 'out') that.leave(that) 3992 } 3993 3994 $.support.transition && this.$tip.hasClass('fade') ? 3995 $tip 3996 .one('bsTransitionEnd', complete) 3997 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 3998 complete() 3999 } 4000 } 4001 4002 Tooltip.prototype.applyPlacement = function (offset, placement) { 4003 var $tip = this.tip() 4004 var width = $tip[0].offsetWidth 4005 var height = $tip[0].offsetHeight 4006 4007 // manually read margins because getBoundingClientRect includes difference 4008 var marginTop = parseInt($tip.css('margin-top'), 10) 4009 var marginLeft = parseInt($tip.css('margin-left'), 10) 4010 4011 // we must check for NaN for ie 8/9 4012 if (isNaN(marginTop)) marginTop = 0 4013 if (isNaN(marginLeft)) marginLeft = 0 4014 4015 offset.top += marginTop 4016 offset.left += marginLeft 4017 4018 // $.fn.offset doesn't round pixel values 4019 // so we use setOffset directly with our own function B-0 4020 $.offset.setOffset($tip[0], $.extend({ 4021 using: function (props) { 4022 $tip.css({ 4023 top: Math.round(props.top), 4024 left: Math.round(props.left) 4025 }) 4026 } 4027 }, offset), 0) 4028 4029 $tip.addClass('in') 4030 4031 // check to see if placing tip in new offset caused the tip to resize itself 4032 var actualWidth = $tip[0].offsetWidth 4033 var actualHeight = $tip[0].offsetHeight 4034 4035 if (placement == 'top' && actualHeight != height) { 4036 offset.top = offset.top + height - actualHeight 4037 } 4038 4039 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) 4040 4041 if (delta.left) offset.left += delta.left 4042 else offset.top += delta.top 4043 4044 var isVertical = /top|bottom/.test(placement) 4045 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 4046 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 4047 4048 $tip.offset(offset) 4049 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) 4050 } 4051 4052 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { 4053 this.arrow() 4054 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 4055 .css(isVertical ? 'top' : 'left', '') 4056 } 4057 4058 Tooltip.prototype.setContent = function () { 4059 var $tip = this.tip() 4060 var title = this.getTitle() 4061 4062 if (this.options.html) { 4063 if (this.options.sanitize) { 4064 title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn) 4065 } 4066 4067 $tip.find('.tooltip-inner').html(title) 4068 } else { 4069 $tip.find('.tooltip-inner').text(title) 4070 } 4071 4072 $tip.removeClass('fade in top bottom left right') 4073 } 4074 4075 Tooltip.prototype.hide = function (callback) { 4076 var that = this 4077 var $tip = $(this.$tip) 4078 var e = $.Event('hide.bs.' + this.type) 4079 4080 function complete() { 4081 if (that.hoverState != 'in') $tip.detach() 4082 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. 4083 that.$element 4084 .removeAttr('aria-describedby') 4085 .trigger('hidden.bs.' + that.type) 4086 } 4087 callback && callback() 4088 } 4089 4090 this.$element.trigger(e) 4091 4092 if (e.isDefaultPrevented()) return 4093 4094 $tip.removeClass('in') 4095 4096 $.support.transition && $tip.hasClass('fade') ? 4097 $tip 4098 .one('bsTransitionEnd', complete) 4099 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 4100 complete() 4101 4102 this.hoverState = null 4103 4104 return this 4105 } 4106 4107 Tooltip.prototype.fixTitle = function () { 4108 var $e = this.$element 4109 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { 4110 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 4111 } 4112 } 4113 4114 Tooltip.prototype.hasContent = function () { 4115 return this.getTitle() 4116 } 4117 4118 Tooltip.prototype.getPosition = function ($element) { 4119 $element = $element || this.$element 4120 4121 var el = $element[0] 4122 var isBody = el.tagName == 'BODY' 4123 4124 var elRect = el.getBoundingClientRect() 4125 if (elRect.width == null) { 4126 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 4127 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) 4128 } 4129 var isSvg = window.SVGElement && el instanceof window.SVGElement 4130 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. 4131 // See https://github.com/twbs/bootstrap/issues/20280 4132 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) 4133 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } 4134 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null 4135 4136 return $.extend({}, elRect, scroll, outerDims, elOffset) 4137 } 4138 4139 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 4140 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 4141 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 4142 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 4143 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 4144 4145 } 4146 4147 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { 4148 var delta = { top: 0, left: 0 } 4149 if (!this.$viewport) return delta 4150 4151 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 4152 var viewportDimensions = this.getPosition(this.$viewport) 4153 4154 if (/right|left/.test(placement)) { 4155 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 4156 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 4157 if (topEdgeOffset < viewportDimensions.top) { // top overflow 4158 delta.top = viewportDimensions.top - topEdgeOffset 4159 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow 4160 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset 4161 } 4162 } else { 4163 var leftEdgeOffset = pos.left - viewportPadding 4164 var rightEdgeOffset = pos.left + viewportPadding + actualWidth 4165 if (leftEdgeOffset < viewportDimensions.left) { // left overflow 4166 delta.left = viewportDimensions.left - leftEdgeOffset 4167 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow 4168 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset 4169 } 4170 } 4171 4172 return delta 4173 } 4174 4175 Tooltip.prototype.getTitle = function () { 4176 var title 4177 var $e = this.$element 4178 var o = this.options 4179 4180 title = $e.attr('data-original-title') 4181 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 4182 4183 return title 4184 } 4185 4186 Tooltip.prototype.getUID = function (prefix) { 4187 do prefix += ~~(Math.random() * 1000000) 4188 while (document.getElementById(prefix)) 4189 return prefix 4190 } 4191 4192 Tooltip.prototype.tip = function () { 4193 if (!this.$tip) { 4194 this.$tip = $(this.options.template) 4195 if (this.$tip.length != 1) { 4196 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') 4197 } 4198 } 4199 return this.$tip 4200 } 4201 4202 Tooltip.prototype.arrow = function () { 4203 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 4204 } 4205 4206 Tooltip.prototype.enable = function () { 4207 this.enabled = true 4208 } 4209 4210 Tooltip.prototype.disable = function () { 4211 this.enabled = false 4212 } 4213 4214 Tooltip.prototype.toggleEnabled = function () { 4215 this.enabled = !this.enabled 4216 } 4217 4218 Tooltip.prototype.toggle = function (e) { 4219 var self = this 4220 if (e) { 4221 self = $(e.currentTarget).data('bs.' + this.type) 4222 if (!self) { 4223 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 4224 $(e.currentTarget).data('bs.' + this.type, self) 4225 } 4226 } 4227 4228 if (e) { 4229 self.inState.click = !self.inState.click 4230 if (self.isInStateTrue()) self.enter(self) 4231 else self.leave(self) 4232 } else { 4233 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 4234 } 4235 } 4236 4237 Tooltip.prototype.destroy = function () { 4238 var that = this 4239 clearTimeout(this.timeout) 4240 this.hide(function () { 4241 that.$element.off('.' + that.type).removeData('bs.' + that.type) 4242 if (that.$tip) { 4243 that.$tip.detach() 4244 } 4245 that.$tip = null 4246 that.$arrow = null 4247 that.$viewport = null 4248 that.$element = null 4249 }) 4250 } 4251 4252 Tooltip.prototype.sanitizeHtml = function (unsafeHtml) { 4253 return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn) 4254 } 4255 4256 // TOOLTIP PLUGIN DEFINITION 4257 // ========================= 4258 4259 function Plugin(option) { 4260 return this.each(function () { 4261 var $this = $(this) 4262 var data = $this.data('bs.tooltip') 4263 var options = typeof option == 'object' && option 4264 4265 if (!data && /destroy|hide/.test(option)) return 4266 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 4267 if (typeof option == 'string') data[option]() 4268 }) 4269 } 4270 4271 var old = $.fn.tooltip 4272 4273 $.fn.tooltip = Plugin 4274 $.fn.tooltip.Constructor = Tooltip 4275 4276 4277 // TOOLTIP NO CONFLICT 4278 // =================== 4279 4280 $.fn.tooltip.noConflict = function () { 4281 $.fn.tooltip = old 4282 return this 4283 } 4284 4285}(jQuery); 4286
4287 4288 }).apply(root, arguments); 4289}); 4290}(this)); 4291 4292/* Pattern utils 4293 */ 4294 4295 4296define('mockup-utils',[ 4297 'jquery' 4298], function($) { 4299 4300 4301 var QueryHelper = function(options) { 4302 /* if pattern argument provided, it can implement the interface of: 4303 * - browsing: boolean if currently browsing 4304 * - currentPath: string of current path to apply to search if browsing 4305 * - basePath: default path to provide if no subpath used 4306 */ 4307 4308 var self = this; 4309 var defaults = { 4310 pattern: null, // must be passed in 4311 vocabularyUrl: null, 4312 searchParam: 'SearchableText', // query string param to pass to search url 4313 pathOperator: 'plone.app.querystring.operation.string.path', 4314 attributes: ['UID', 'Title', 'Description', 'getURL', 'portal_type'], 4315 batchSize: 10, // number of results to retrive 4316 baseCriteria: [], 4317 sort_on: 'is_folderish', 4318 sort_order: 'reverse', 4319 pathDepth: 1 4320 }; 4321 self.options = $.extend({}, defaults, options); 4322 4323 self.pattern = self.options.pattern; 4324 if (self.pattern === undefined || self.pattern === null) { 4325 self.pattern = { 4326 browsing: false, 4327 basePath: '/' 4328 }; 4329 } 4330 4331 if (self.options.url && !self.options.vocabularyUrl) { 4332 self.options.vocabularyUrl = self.options.url; 4333 } else if (self.pattern.vocabularyUrl) { 4334 self.options.vocabularyUrl = self.pattern.vocabularyUrl; 4335 } 4336 self.valid = Boolean(self.options.vocabularyUrl); 4337 4338 self.getBatch = function(page) { 4339 return { 4340 page: page ? page : 1, 4341 size: self.options.batchSize 4342 }; 4343 }; 4344 4345 self.getCurrentPath = function() { 4346 var pattern = self.pattern; 4347 var currentPath; 4348 /* If currentPath is set on the QueryHelper object, use that first. 4349 * Then, check on the pattern. 4350 * Finally, see if it is a function and call it if it is. 4351 */ 4352 if (self.currentPath) { 4353 currentPath = self.currentPath; 4354 } else { 4355 currentPath = pattern.currentPath; 4356 } 4357 if (typeof currentPath === 'function') { 4358 currentPath = currentPath(); 4359 } 4360 var path = currentPath; 4361 if (!path) { 4362 if (pattern.basePath) { 4363 path = pattern.basePath; 4364 } else if (pattern.options.basePath) { 4365 path = pattern.options.basePath; 4366 } else { 4367 path = '/'; 4368 } 4369 } 4370 return path; 4371 }; 4372 4373 self.getCriterias = function(term, searchOptions) { 4374 if (searchOptions === undefined) { 4375 searchOptions = {}; 4376 } 4377 searchOptions = $.extend({}, { 4378 useBaseCriteria: true, 4379 additionalCriterias: [] 4380 }, searchOptions); 4381 4382 var criterias = []; 4383 if (searchOptions.useBaseCriteria) { 4384 criterias = self.options.baseCriteria.slice(0); 4385 } 4386 if (term) { 4387 term += '*'; 4388 criterias.push({ 4389 i: self.options.searchParam, 4390 o: 'plone.app.querystring.operation.string.contains', 4391 v: term 4392 }); 4393 } 4394 if (searchOptions.searchPath) { 4395 criterias.push({ 4396 i: 'path', 4397 o: self.options.pathOperator, 4398 v: searchOptions.searchPath + '::' + self.options.pathDepth 4399 }); 4400 } else if (self.pattern.browsing) { 4401 criterias.push({ 4402 i: 'path', 4403 o: self.options.pathOperator, 4404 v: self.getCurrentPath() + '::' + self.options.pathDepth 4405 }); 4406 } 4407 criterias = criterias.concat(searchOptions.additionalCriterias); 4408 return criterias; 4409 }; 4410 4411 self.getQueryData = function(term, page) { 4412 var data = { 4413 query: JSON.stringify({ 4414 criteria: self.getCriterias(term), 4415 sort_on: self.options.sort_on, 4416 sort_order: self.options.sort_order 4417 }), 4418 attributes: JSON.stringify(self.options.attributes) 4419 }; 4420 if (page) { 4421 data.batch = JSON.stringify(self.getBatch(page)); 4422 } 4423 return data; 4424 }; 4425 4426 self.getUrl = function() { 4427 var url = self.options.vocabularyUrl; 4428 if (url.indexOf('?') === -1) { 4429 url += '?'; 4430 } else { 4431 url += '&'; 4432 } 4433 return url + $.param(self.getQueryData()); 4434 }; 4435 4436 self.selectAjax = function() { 4437 return { 4438 url: self.options.vocabularyUrl, 4439 dataType: 'JSON', 4440 quietMillis: 100, 4441 data: function(term, page) { 4442 return self.getQueryData(term, page); 4443 }, 4444 results: function(data, page) { 4445 var more = (page * 10) < data.total; // whether or not there are more results available 4446 // notice we return the value of more so Select2 knows if more results can be loaded 4447 return { 4448 results: data.results, 4449 more: more 4450 }; 4451 } 4452 }; 4453 }; 4454 4455 self.search = function(term, operation, value, callback, useBaseCriteria, type) { 4456 if (useBaseCriteria === undefined) { 4457 useBaseCriteria = true; 4458 } 4459 if (type === undefined) { 4460 type = 'GET'; 4461 } 4462 var criteria = []; 4463 if (useBaseCriteria) { 4464 criteria = self.options.baseCriteria.slice(0); 4465 } 4466 criteria.push({ 4467 i: term, 4468 o: operation, 4469 v: value 4470 }); 4471 var data = { 4472 query: JSON.stringify({ 4473 criteria: criteria 4474 }), 4475 attributes: JSON.stringify(self.options.attributes) 4476 }; 4477 $.ajax({ 4478 url: self.options.vocabularyUrl, 4479 dataType: 'JSON', 4480 data: data, 4481 type: type, 4482 success: callback 4483 }); 4484 }; 4485 4486 return self; 4487 }; 4488 4489 var Loading = function(options) { 4490 /* 4491 * Options: 4492 * backdrop(pattern): if you want to have the progress indicator work 4493 * seamlessly with backdrop pattern 4494 * zIndex(integer or function): to override default z-index used 4495 */ 4496 var self = this; 4497 self.className = 'plone-loader'; 4498 var defaults = { 4499 backdrop: null, 4500 zIndex: 10005 // can be a function 4501 }; 4502 if (!options) { 4503 options = {}; 4504 } 4505 self.options = $.extend({}, defaults, options); 4506 4507 self.init = function() { 4508 self.$el = $('.' + self.className); 4509 if (self.$el.length === 0) { 4510 self.$el = $('<div><div></div></div>'); 4511 self.$el.addClass(self.className).hide().appendTo('body'); 4512 } 4513 }; 4514 4515 self.show = function(closable) { 4516 self.init(); 4517 self.$el.show(); 4518 var zIndex = self.options.zIndex; 4519 if (typeof(zIndex) === 'function') { 4520 zIndex = Math.max(zIndex(), 10005); 4521 } else { 4522 // go through all modals and backdrops and make sure we have a higher 4523 // z-index to use 4524 zIndex = 10005; 4525 $('.plone-modal-wrapper,.plone-modal-backdrop').each(function() { 4526 zIndex = Math.max(zIndex, $(this).css('zIndex') || 10005); 4527 }); 4528 zIndex += 1; 4529 } 4530 self.$el.css('zIndex', zIndex); 4531 4532 if (closable === undefined) { 4533 closable = true; 4534 } 4535 if (self.options.backdrop) { 4536 self.options.backdrop.closeOnClick = closable; 4537 self.options.backdrop.closeOnEsc = closable; 4538 self.options.backdrop.init(); 4539 self.options.backdrop.show(); 4540 } 4541 }; 4542 4543 self.hide = function() { 4544 self.init(); 4545 self.$el.hide(); 4546 }; 4547 4548 return self; 4549 }; 4550 4551 var getAuthenticator = function() { 4552 var $el = $('input[name="_authenticator"]'); 4553 if ($el.length === 0) { 4554 $el = $('a[href*="_authenticator"]'); 4555 if ($el.length > 0) { 4556 return $el.attr('href').split('_authenticator=')[1]; 4557 } 4558 return ''; 4559 } else { 4560 return $el.val(); 4561 } 4562 }; 4563 4564 var generateId = function(prefix) { 4565 if (prefix === undefined) { 4566 prefix = 'id'; 4567 } 4568 return prefix + (Math.floor((1 + Math.random()) * 0x10000) 4569 .toString(16).substring(1)); 4570 }; 4571 4572 var setId = function($el, prefix) { 4573 if (prefix === undefined) { 4574 prefix = 'id'; 4575 } 4576 var id = $el.attr('id'); 4577 if (id === undefined) { 4578 id = generateId(prefix); 4579 } else { 4580 /* hopefully we don't screw anything up here... changing the id 4581 * in some cases so we get a decent selector */ 4582 id = id.replace(/\./g, '-'); 4583 } 4584 $el.attr('id', id); 4585 return id; 4586 }; 4587 4588 var getWindow = function() { 4589 var win = window; 4590 if (win.parent !== window) { 4591 win = win.parent; 4592 } 4593 return win; 4594 }; 4595 4596 var parseBodyTag = function(txt) { 4597 return $((/<body[^>]*>[^]*<\/body>/im).exec(txt)[0] 4598 .replace('<body', '<div').replace('</body>', '</div>')).eq(0).html(); 4599 }; 4600 4601 var featureSupport = { 4602 /* Well tested feature support for things we use in mockup. 4603 * All gathered from: http://diveintohtml5.info/everything.html 4604 * Alternative to using some form of modernizr. 4605 */ 4606 dragAndDrop: function() { 4607 return 'draggable' in document.createElement('span'); 4608 }, 4609 fileApi: function() { 4610 return typeof FileReader != 'undefined'; // jshint ignore:line 4611 }, 4612 history: function() { 4613 return !!(window.history && window.history.pushState); 4614 } 4615 }; 4616 4617 var bool = function(val) { 4618 if (typeof val === 'string') { 4619 val = $.trim(val).toLowerCase(); 4620 } 4621 return ['false', false, '0', 0, '', undefined, null].indexOf(val) === -1; 4622 }; 4623 4624 var escapeHTML = function(val) { 4625 return $('<div/>').text(val).html(); 4626 }; 4627
4628 var removeHTML = function(val) { 4629 return val.replace(/<[^>]+>/ig, ''); 4630 }; 4631 4632 var storage = { 4633 // Simple local storage wrapper, which doesn't break down if it's not available. 4634 get: function (name) { 4635 if (window.localStorage) { 4636 var val = window.localStorage[name]; 4637 return typeof(val) === 'string' ? JSON.parse(val) : undefined; 4638 } 4639 }, 4640 4641 set: function (name, val) { 4642 if (window.localStorage) { 4643 window.localStorage[name] = JSON.stringify(val); 4644 } 4645 } 4646 }; 4647 4648 var createElementFromHTML = function(htmlString) { 4649 // From: https://stackoverflow.com/a/494348/1337474 4650 var div = document.createElement('div'); 4651 div.innerHTML = htmlString.trim(); 4652 return div.firstChild; 4653 }; 4654 4655 return { 4656 bool: bool, 4657 escapeHTML: escapeHTML, 4658 removeHTML: removeHTML, 4659 featureSupport: featureSupport, 4660 generateId: generateId, 4661 getAuthenticator: getAuthenticator, 4662 getWindow: getWindow, 4663 Loading: Loading, 4664 loading: new Loading(), // provide default loader 4665 parseBodyTag: parseBodyTag, 4666 QueryHelper: QueryHelper, 4667 setId: setId, 4668 storage: storage, 4669 createElementFromHTML: createElementFromHTML 4670 }; 4671}); 4672 4673/* Content loader pattern. 4674 * 4675 * Options: 4676 * content(string): CSS selector for content, which is going to replace the target. Can be a local element already in the DOM tree or come from an AJAX call by using the url option. 4677 * target(string): CSS selector of target element, which is being replaced. If it's empty, the pattern element will be replaced. 4678 * trigger(string): Event to trigger content loading. Defaults to "click" 4679 * url(string): To load content from remote resource. Use 'el' to use with anchor tag href. 4680 * 4681 * Documentation: 4682 * # With selector 4683 * {{ example-1 }} 4684 * 4685 * # With remote content 4686 * {{ example-2 }} 4687 * 4688 * Example: example-1 4689 * <a href="#" class="pat-contentloader" data-pat-contentloader="content:#clexample1;target:#clexample1target;">Load content</a> 4690 * <div id="clexample1target">Original Content</div> 4691 * <div id="clexample1" style="display:none">Replaced Content</div> 4692 * 4693 * Example: example-2 4694 * <a href="#" class="pat-contentloader" data-pat-contentloader="url:something.html;">Load content</a> 4695 * 4696 * 4697 */ 4698 4699 4700define('mockup-patterns-contentloader',[ 4701 'jquery', 4702 'pat-base', 4703 'pat-logger', 4704 'pat-registry', 4705 'mockup-utils', 4706 'underscore' 4707], function($, Base, logger, Registry, utils, _) { 4708 4709 var log = logger.getLogger('pat-contentloader'); 4710 4711 var ContentLoader = Base.extend({ 4712 name: 'contentloader', 4713 trigger: '.pat-contentloader', 4714 parser: 'mockup', 4715 defaults: { 4716 url: null, 4717 content: null, 4718 trigger: 'click', 4719 target: null, 4720 template: null, 4721 dataType: 'html' 4722 }, 4723 init: function() { 4724 var that = this; 4725 if(that.options.url === 'el' && that.$el[0].tagName === 'A'){ 4726 that.options.url = that.$el.attr('href'); 4727 } 4728 that.$el.removeClass('loading-content'); 4729 that.$el.removeClass('content-load-error'); 4730 if(that.options.trigger === 'immediate'){ 4731 that._load(); 4732 }else{ 4733 that.$el.on(that.options.trigger, function(e){ 4734 e.preventDefault(); 4735 that._load(); 4736 }); 4737 } 4738 }, 4739 _load: function(){ 4740 var that = this; 4741 that.$el.addClass('loading-content'); 4742 if(that.options.url){ 4743 that.loadRemote(); 4744 }else{ 4745 that.loadLocal(); 4746 } 4747 }, 4748 loadRemote: function(){ 4749 var that = this; 4750 $.ajax({ 4751 url: that.options.url, 4752 dataType: that.options.dataType, 4753 success: function(data){ 4754 var $el; 4755 if(that.options.dataType === 'html'){ 4756 if(data.indexOf('<html') !== -1){ 4757 data = utils.parseBodyTag(data); 4758 } 4759 $el = $('<div>' + data + '</div>'); // jQuery starts to search at the first child element. 4760 }else if(that.options.dataType.indexOf('json') !== -1){ 4761 // must have template defined with json 4762 if(data.constructor === Array && data.length === 1){ 4763 // normalize json if it makes sense since some json returns as array with one item 4764 data = data[0]; 4765 } 4766 try{ 4767 $el = $(_.template(that.options.template)(data)); 4768 }catch(e){ 4769 that.$el.removeClass('loading-content'); 4770 that.$el.addClass('content-load-error'); 4771 log.warn('error rendering template. pat-contentloader will not work'); 4772 return; 4773 } 4774 } 4775 if(that.options.content !== null){ 4776 $el = $el.find(that.options.content); 4777 } 4778 that.loadLocal($el); 4779 }, 4780 error: function(){ 4781 that.$el.removeClass('loading-content'); 4782 that.$el.addClass('content-load-error'); 4783 } 4784 }); 4785 }, 4786 loadLocal: function($content){ 4787 var that = this; 4788 if(!$content && that.options.content === null){ 4789 that.$el.removeClass('loading-content'); 4790 that.$el.addClass('content-load-error'); 4791 log.warn('No selector configured'); 4792 return; 4793 } 4794 var $target = that.$el; 4795 if(that.options.target !== null){ 4796 $target = $(that.options.target); 4797 if($target.size() === 0){ 4798 that.$el.removeClass('loading-content'); 4799 that.$el.addClass('content-load-error'); 4800 log.warn('No target nodes found'); 4801 return; 4802 } 4803 } 4804 4805 if(!$content){ 4806 $content = $(that.options.content).clone(); 4807 } 4808 if ($content.length) { 4809 $content.show(); 4810 $target.replaceWith($content); 4811 Registry.scan($content); 4812 } else { 4813 // empty target node instead of removing it. 4814 // allows for subsequent content loader calls to work sucessfully. 4815 $target.empty(); 4816 } 4817 4818 that.$el.removeClass('loading-content'); 4819 that.emit('loading-done'); 4820 } 4821 }); 4822 4823 return ContentLoader; 4824 4825}); 4826 4827/* Backdrop pattern. 4828 * 4829 * Options: 4830 * zIndex(integer): z-index of backdrop element. (null) 4831 * opacity(float): opacity level of backdrop element. (0.8) 4832 * className(string): class name of backdrop element. ('backdrop') 4833 * classActiveName(string): class name when backdrop is active. ('backdrop-active') 4834 * closeOnEsc(boolean): should backdrop close when ESC key is pressed. (true) 4835 * closeOnClick(boolean): should backdrop close when clicked on it. (true) 4836 * 4837 * Documentation: 4838 * # TODO: we need example or this is not pattern :) 4839 * 4840 * Example: example-1 4841 * 4842 */ 4843 4844 4845define('mockup-patterns-backdrop',[ 4846 'jquery', 4847 'pat-base' 4848], function($, Base) { 4849 4850 4851 var Backdrop = Base.extend({ 4852 name: 'backdrop', 4853 trigger: '.pat-backdrop', 4854 parser: 'mockup', 4855 defaults: { 4856 zIndex: null, 4857 opacity: 0.8, 4858 className: 'plone-backdrop', 4859 classActiveName: 'plone-backdrop-active', 4860 closeOnEsc: true, 4861 closeOnClick: true 4862 }, 4863 init: function() { 4864 var self = this; 4865 self.$backdrop = $('> .' + self.options.className, self.$el); 4866 if (self.$backdrop.size() === 0) { 4867 self.$backdrop = $('<div/>') 4868 .hide() 4869 .appendTo(self.$el) 4870 .addClass(self.options.className); 4871 if (self.options.zIndex !== null) { 4872 self.$backdrop.css('z-index', self.options.zIndex); 4873 } 4874 } 4875 if (self.options.closeOnEsc === true) { 4876 $(document).on('keydown', function(e, data) { 4877 if (self.$el.is('.' + self.options.classActiveName)) { 4878 if (e.keyCode === 27) { // ESC key pressed 4879 self.hide(); 4880 } 4881 } 4882 }); 4883 } 4884 if (self.options.closeOnClick === true) { 4885 self.$backdrop.on('click', function() { 4886 if (self.$el.is('.' + self.options.classActiveName)) { 4887 self.hide(); 4888 } 4889 }); 4890 } 4891 }, 4892 show: function() { 4893 var self = this; 4894 if (!self.$el.hasClass(self.options.classActiveName)) { 4895 self.emit('show'); 4896 self.$backdrop.css('opacity', '0').show(); 4897 self.$el.addClass(self.options.classActiveName); 4898 self.$backdrop.animate({ opacity: self.options.opacity }, 500); 4899 self.emit('shown'); 4900 } 4901 }, 4902 hide: function() { 4903 var self = this; 4904 if (self.$el.hasClass(self.options.classActiveName)) { 4905 self.emit('hide'); 4906 self.$backdrop.animate({ opacity: '0' }, 500).hide(); 4907 self.$el.removeClass(self.options.classActiveName); 4908 self.emit('hidden'); 4909 } 4910 } 4911 }); 4912 4913 return Backdrop; 4914 4915}); 4916 4917/* i18n integration. This is forked from jarn.jsi18n 4918 * 4919 * This is a singleton. 4920 * Configuration is done on the body tag data-i18ncatalogurl attribute 4921 * <body data-i18ncatalogurl="/plonejsi18n"> 4922 * 4923 * Or, it'll default to "/plonejsi18n" 4924 */ 4925define('mockup-i18n',[ 4926 'jquery' 4927], function($) { 4928 4929 4930 var I18N = function() { 4931 var self = this; 4932 self.baseUrl = $('body').attr('data-i18ncatalogurl'); 4933 self.currentLanguage = $('html').attr('lang') || 'en'; 4934 4935 // Fix for country specific languages 4936 if (self.currentLanguage.split('-').length > 1) { 4937 self.currentLanguage = self.currentLanguage.split('-')[0] + '_' + self.currentLanguage.split('-')[1].toUpperCase(); 4938 } 4939 4940 self.storage = null; 4941 self.catalogs = {}; 4942 self.ttl = 24 * 3600 * 1000; 4943 4944 // Internet Explorer 8 does not know Date.now() which is used in e.g. loadCatalog, so we "define" it 4945 if (!Date.now) { 4946 Date.now = function() { 4947 return new Date().valueOf(); 4948 }; 4949 } 4950 4951 try { 4952 if ('localStorage' in window && window.localStorage !== null && 'JSON' in window && window.JSON !== null) { 4953 self.storage = window.localStorage; 4954 } 4955 } catch (e) {} 4956 4957 self.configure = function(config) { 4958 for (var key in config){ 4959 self[key] = config[key]; 4960 } 4961 }; 4962 4963 self._setCatalog = function (domain, language, catalog) { 4964 if (domain in self.catalogs) { 4965 self.catalogs[domain][language] = catalog; 4966 } else { 4967 self.catalogs[domain] = {}; 4968 self.catalogs[domain][language] = catalog; 4969 } 4970 }; 4971 4972 self._storeCatalog = function (domain, language, catalog) { 4973 var key = domain + '-' + language; 4974 if (self.storage !== null && catalog !== null) { 4975 self.storage.setItem(key, JSON.stringify(catalog)); 4976 self.storage.setItem(key + '-updated', Date.now()); 4977 } 4978 }; 4979 4980 self.getUrl = function(domain, language) { 4981 return self.baseUrl + '?domain=' + domain + '&language=' + language; 4982 }; 4983 4984 self.loadCatalog = function (domain, language) { 4985 if (language === undefined) { 4986 language = self.currentLanguage; 4987 } 4988 if (self.storage !== null) { 4989 var key = domain + '-' + language; 4990 if (key in self.storage) { 4991 if ((Date.now() - parseInt(self.storage.getItem(key + '-updated'), 10)) < self.ttl) { 4992 var catalog = JSON.parse(self.storage.getItem(key)); 4993 self._setCatalog(domain, language, catalog); 4994 return; 4995 } 4996 } 4997 } 4998 if (!self.baseUrl) { 4999 return; 5000 } 5001 $.getJSON(self.getUrl(domain, language), function (catalog) { 5002 if (catalog === null) { 5003 return; 5004 } 5005 self._setCatalog(domain, language, catalog); 5006 self._storeCatalog(domain, language, catalog); 5007 }); 5008 }; 5009 5010 self.MessageFactory = function (domain, language) { 5011 language = language || self.currentLanguage; 5012 return function translate (msgid, keywords) { 5013 var msgstr; 5014 if ((domain in self.catalogs) && (language in self.catalogs[domain]) && (msgid in self.catalogs[domain][language])) { 5015 msgstr = self.catalogs[domain][language][msgid]; 5016 } else { 5017 msgstr = msgid; 5018 } 5019 if (keywords) { 5020 var regexp, keyword; 5021 for (keyword in keywords) { 5022 if (keywords.hasOwnProperty(keyword)) { 5023 regexp = new RegExp('\\$\\{' + keyword + '\\}', 'g'); 5024 msgstr = msgstr.replace(regexp, keywords[keyword]); 5025 } 5026 } 5027 } 5028 return msgstr; 5029 }; 5030 }; 5031 }; 5032 5033 return I18N; 5034}); 5035 5036/* i18n integration. 5037 * 5038 * This is a singleton. 5039 * Configuration is done on the body tag data-i18ncatalogurl attribute 5040 * <body data-i18ncatalogurl="/plonejsi18n"> 5041 * 5042 * Or, it'll default to "/plonejsi18n" 5043 */ 5044 5045define('translate',[ 5046 'mockup-i18n' 5047], function(I18N) { 5048 5049 5050 // we're creating a singleton here so we can potentially 5051 // delay the initialization of the translate catalog 5052 // until after the dom is available 5053 var _t = null; 5054 return function(msgid, keywords) { 5055 if (_t === null) { 5056 var i18n = new I18N(); 5057 i18n.loadCatalog('widgets'); 5058 _t = i18n.MessageFactory('widgets'); 5059 } 5060 return _t(msgid, keywords); 5061 }; 5062}); 5063 5064/* Formunloadalert pattern. 5065 * 5066 * Options: 5067 * changingEvents(string): Events on which to check for changes (space-separated). ('change keyup paste') 5068 * changingFields(string): Fields on which to check for changes (comma-separated). ('input,select,textarea,fileupload') 5069 * message(string): Confirmation message to display when dirty form is being unloaded. (Discard changes? If you click OK, any changes you have made will be lost.) 5070 * 5071 * Documentation: 5072 * # Example 5073 * 5074 * {{ example-1 }} 5075 * 5076 * Example: example-1 5077 * <form class="pat-formunloadalert" onsubmit="javascript:return false;"> 5078 * <input type="text" value="" /> 5079 * <select> 5080 * <option value="1">value 1</option> 5081 * <option value="2">value 2</option> 5082 * </select> 5083 * <input 5084 * class="btn btn-large btn-primary" 5085 * type="submit" value="Submit" /> 5086 * <br /> 5087 * <a href="/">Click here to go somewhere else</a> 5088 * </form> 5089 * 5090 */ 5091 5092 5093define('mockup-patterns-formunloadalert',[ 5094 'jquery', 5095 'pat-base', 5096 'translate' 5097], function ($, Base, _t) { 5098 5099 5100 var FormUnloadAlert = Base.extend({ 5101 name: 'formunloadalert', 5102 trigger: '.pat-formunloadalert', 5103 parser: 'mockup', 5104 _changed : false, // Stores a listing of raised changes by their key 5105 _suppressed : false, // whether or not warning should be suppressed 5106 defaults: { 5107 message : _t('Discard changes? If you click OK, ' + 5108 'any changes you have made will be lost.'), 5109 // events on which to check for changes 5110 changingEvents: 'change keyup paste', 5111 // fields on which to check for changes 5112 changingFields: 'input,select,textarea,fileupload' 5113 }, 5114 init: function () { 5115 var self = this; 5116 // if this is not a form just return 5117 if (!self.$el.is('form')) { return; } 5118 5119 $(self.options.changingFields, self.$el).on( 5120 self.options.changingEvents, 5121 function (evt) { 5122 self._changed = true; 5123 } 5124 ); 5125 5126 var $modal = self.$el.parents('.plone-modal'); 5127 if ($modal.size() !== 0) { 5128 $modal.data('patternPloneModal').on('hide', function(e) { 5129 var modal = $modal.data('patternPloneModal'); 5130 if (modal) { 5131 modal._suppressHide = self._handleUnload.call(self, e); 5132 } 5133 }); 5134 } else { 5135 $(window).on('beforeunload', function(e) { 5136 return self._handleUnload(e); 5137 }); 5138 } 5139 5140 self.$el.on('submit', function(e) { 5141 self._suppressed = true; 5142 }); 5143 5144 }, 5145 _handleUnload : function (e) { 5146 var self = this; 5147 if (self._suppressed) { 5148 self._suppressed = false;
5149 return undefined; 5150 } 5151 if (self._changed) { 5152 var msg = self.options.message; 5153 self._handleMsg(e,msg); 5154 $(window).trigger('messageset'); 5155 return msg; 5156 } 5157 }, 5158 _handleMsg: function(e,msg) { 5159 (e || window.event).returnValue = msg; 5160 } 5161 }); 5162 return FormUnloadAlert; 5163 5164}); 5165 5166/* Livesearch 5167 * 5168 * Options: 5169 * ajaxUrl(string): JSON search url 5170 * perPage(integer): results per page, defaults to 7 5171 * quietMillis: how long to wait after type stops before sending out request in milliseconds. Defaults to 350 5172 * minimumInputLength: miniumum number of letters before doing search. Defaults to 3 5173 * inputSelector: css select to input element search is done with. Defaults to input[type="text"] 5174 * itemTemplate: override template used to render item results 5175 * 5176 * Documentation: 5177 * # General 5178 * 5179 * # Default 5180 * 5181 * {{ example-1 }} 5182 * 5183 * Example: example-1 5184 * <form action="search" class="pat-livesearch" data-pat-livesearch="ajaxUrl:livesearch.json"> 5185 * <input type="text" /> 5186 * </form> 5187 * 5188 */ 5189 5190define('mockup-patterns-livesearch',[ 5191 'jquery', 5192 'pat-base', 5193 'underscore', 5194 'translate' 5195], function ($, Base, _, _t) { 5196 5197 5198 var Livesearch = Base.extend({ 5199 name: 'livesearch', 5200 trigger: '.pat-livesearch', 5201 parser: 'mockup', 5202 timeout: null, 5203 active: false, 5204 results: null, 5205 selectedItem: -1, 5206 resultsClass: 'livesearch-results', 5207 defaults: { 5208 ajaxUrl: null, 5209 defaultSortOn: '', 5210 perPage: 7, 5211 quietMillis: 350, 5212 minimumInputLength: 4, 5213 inputSelector: 'input[type="text"]', 5214 itemTemplate: '<li class="search-result <%- state %>">' + 5215 '<h4 class="title"><a href="<%- url %>"><%- title %></a></h4>' + 5216 '<p class="description"><%- description %></p>' + 5217 '</li>', 5218 }, 5219 doSearch: function(page){ 5220 var self = this; 5221 self.active = true; 5222 self.render(); 5223 self.$el.addClass('searching'); 5224 var query = self.$el.serialize(); 5225 if(page === undefined){ 5226 page = 1; 5227 } 5228 var sort_on = function(){ 5229 var parameters = location.search, 5230 sorton_position = parameters.indexOf('sort_on'); 5231 if(sorton_position === -1){ 5232 // return default sort 5233 var $searchResults = $('#search-results'); 5234 if($searchResults.length > 0){ 5235 return $searchResults.attr('data-default-sort'); 5236 } 5237 return self.options.defaultSortOn; 5238 } 5239 // cut string before sort_on parameter 5240 var sort_on = parameters.substring(sorton_position); 5241 // cut other parameters 5242 sort_on = sort_on.split('&')[0]; 5243 // get just the value 5244 sort_on = sort_on.split('=')[1]; 5245 return sort_on; 5246 }(); 5247 5248 $.ajax({ 5249 url: self.options.ajaxUrl + '?' + query + 5250 '&page=' + page + 5251 '&perPage=' + self.options.perPage + 5252 '&sort_on=' + sort_on, 5253 dataType: 'json' 5254 }).done(function(data){ 5255 self.results = data; 5256 self.page = page; 5257 // maybe odd here.. but we're checking to see if the user 5258 // has typed while a search was being performed. Perhap another search if so 5259 if(query !== self.$el.serialize()){ 5260 self.doSearch(); 5261 } 5262 }).fail(function(){ 5263 self.results = { 5264 items: [{ 5265 url: '', 5266 title: _t('Error'), 5267 description: _t('There was an error searching…'), 5268 state: 'error', 5269 error: false 5270 }], 5271 total: 1 5272 }; 5273 self.page = 1; 5274 }).always(function(){ 5275 self.active = false; 5276 self.selectedItem = -1; 5277 self.$el.removeClass('searching'); 5278 self.render(); 5279 }); 5280 }, 5281 render: function(){ 5282 var self = this; 5283 self.$results.empty(); 5284 5285 /* find a status message */ 5286 5287 if(self.active){ 5288 self.$results.append($('<li class="searching">' + _t('searching…') + '</li>')); 5289 }else if(self.results === null){ 5290 // no results gathered yet 5291 self.$results.append($('<li class="no-results no-search">' + _t('enter search phrase') + '</li>')); 5292 } else if(self.results.total === 0){ 5293 self.$results.append($('<li class="no-results">' + _t('no results found') + '</li>')); 5294 } else{ 5295 self.$results.append($('<li class="results-summary">' + _t('found') + 5296 ' ' + self.results.total + ' ' + _t('results') + '</li>')); 5297 } 5298 5299 if(self.results !== null){ 5300 var template = _.template(self.options.itemTemplate); 5301 _.each(self.results.items, function(item, index){ 5302 var $el = $(template($.extend({_t: _t}, item))); 5303 $el.attr('data-url', item.url).on('click', function(){ 5304 if(!item.error){ 5305 window.location = item.url; 5306 } 5307 }); 5308 if(index === self.selectedItem){ 5309 $el.addClass('selected'); 5310 } 5311 self.$results.append($el); 5312 }); 5313 var nav = []; 5314 if(self.page > 1){ 5315 var $prev = $('<a href="#" class="prev">' + _t('Previous') + '</a>'); 5316 $prev.click(function(e){ 5317 self.disableHiding = true; 5318 e.preventDefault(); 5319 self.doSearch(self.page - 1); 5320 }); 5321 nav.push($prev); 5322 } 5323 if((self.page * self.options.perPage) < self.results.total){ 5324 var $next = $('<a href="#" class="next">' + _t('Next') + '</a>'); 5325 $next.click(function(e){ 5326 self.disableHiding = true; 5327 e.preventDefault(); 5328 self.doSearch(self.page + 1); 5329 }); 5330 nav.push($next); 5331 } 5332 if(nav.length > 0){ 5333 var $li = $('<li class="load-more"><div class="page">' + self.page + '</div></li>'); 5334 $li.prepend(nav); 5335 self.$results.append($li); 5336 } 5337 } 5338 self.position(); 5339 }, 5340 position: function(){ 5341 /* we are positioning directly below the 5342 input box, same width */ 5343 var self = this; 5344 5345 self.$el.addClass('livesearch-active'); 5346 var pos = self.$input.position(); 5347 self.$results.width(self.$el.outerWidth()); 5348 self.$results.css({ 5349 top: pos.top + self.$input.outerHeight(), 5350 left: pos.left 5351 }); 5352 self.$results.show(); 5353 }, 5354 hide: function(){ 5355 this.$results.hide(); 5356 this.$el.removeClass('livesearch-active'); 5357 }, 5358 init: function(){ 5359 var self = this; 5360 5361 self.$input = self.$el.find(self.options.inputSelector); 5362 self.$input.off('focusout').on('focusout', function(){ 5363 /* we put this in a timer so click events still 5364 get trigger on search results */ 5365 setTimeout(function(){ 5366 /* hack, look above, to handle dealing with clicks 5367 unfocusing element */ 5368 if(!self.disableHiding){ 5369 self.hide(); 5370 }else{ 5371 self.disableHiding = false;
5372 // and refocus elemtn 5373 self.$input.focus(); 5374 } 5375 }, 200); 5376 }).off('focusin').on('focusin', function(){ 5377 if(!self.onceFocused){ 5378 /* Case: field already filled out but no reasons 5379 present yet, do ajax search and grab some results */ 5380 self.onceFocused = true; 5381 if(self.$input.val().length >= self.options.minimumInputLength){ 5382 self.doSearch(); 5383 } 5384 } else if(!self.$results.is(':visible')){ 5385 self.render(); 5386 } 5387 }).attr('autocomplete', 'off').off('keyup').on('keyup', function(e){ 5388 var code = e.keyCode || e.which; 5389 // first off, we're capturing esc presses 5390 if(code === 27){ 5391 self.$input.val(''); 5392 self.hide(); 5393 return; 5394 } 5395 // then, we're capturing up, down and enter key presses 5396 if(self.results && self.results.items && self.results.items.length > 0){ 5397 if(code === 13){ 5398 /* enter key, check to see if there is a selected item */ 5399 if(self.selectedItem !== -1){ 5400 window.location = self.results.items[self.selectedItem].url; 5401 } 5402 return; 5403 } else if(code === 38){ 5404 /* up key */ 5405 if(self.selectedItem !== -1){ 5406 self.selectedItem -= 1; 5407 self.render(); 5408 } 5409 return; 5410 } else if(code === 40){ 5411 /* down key */ 5412 if(self.selectedItem < self.results.items.length){ 5413 self.selectedItem += 1; 5414 self.render(); 5415 } 5416 return; 5417 } 5418 } 5419 5420 /* then, we handle timeouts for doing ajax search */ 5421 if(self.timeout !== null){ 5422 clearTimeout(self.timeout); 5423 self.timeout = null; 5424 } 5425 if(self.active){ 5426 return; 5427 } 5428 if(self.$input.val().length >= self.options.minimumInputLength){ 5429 self.timeout = setTimeout(function(){ 5430 self.doSearch(); 5431 }, self.options.quietMillis); 5432 }else{ 5433 self.results = null; 5434 self.render(); 5435 } 5436 }); 5437 $('#sorting-options a').click(function(e){ 5438 e.preventDefault(); 5439 self.onceFocused = false; 5440 }); 5441 5442 /* create result dom */ 5443 self.$results = $('<ul class="' + self.resultsClass + '"></ul>').hide().insertAfter(self.$input); 5444 } 5445 }); 5446 5447 return Livesearch; 5448}); 5449 5450/* PreventDoubleSubmit pattern. 5451 * 5452 * Options: 5453 * guardClassName(string): Class applied to submit button after it is clicked once. ('submitting') 5454 * optOutClassName(string): Class used to opt-out a submit button from double-submit prevention. ('allowMultiSubmit') 5455 * message(string): Message to be displayed when "opt-out" submit button is clicked a second time. ('You already clicked the submit button. Do you really want to submit this form again?') 5456 * 5457 * Documentation: 5458 * # Example 5459 * 5460 * {{ example-1 }} 5461 * 5462 * Example: example-1 5463 * <form class="pat-preventdoublesubmit" onsubmit="javascript:return false;"> 5464 * <input type="text" value="submit this value please!" /> 5465 * <input class="btn btn-large btn-primary" type="submit" value="Single submit" /> 5466 * <input class="btn btn-large btn-primary allowMultiSubmit" type="submit" value="Multi submit" /> 5467 * </form> 5468 * 5469 */ 5470 5471 5472define('mockup-patterns-preventdoublesubmit',[ 5473 'jquery', 5474 'pat-base', 5475 'translate' 5476], function($, Base, _t) { 5477 5478 5479 var PreventDoubleSubmit = Base.extend({ 5480 name: 'preventdoublesubmit', 5481 trigger: '.pat-preventdoublesubmit', 5482 parser: 'mockup', 5483 defaults: { 5484 message : _t('You already clicked the submit button. ' + 5485 'Do you really want to submit this form again?'), 5486 guardClassName: 'submitting', 5487 optOutClassName: 'allowMultiSubmit' 5488 }, 5489 init: function() { 5490 var self = this; 5491 5492 // if this is not a form just return 5493 if (!self.$el.is('form')) { 5494 return; 5495 } 5496 5497 $(':submit', self.$el).click(function(e) { 5498 5499 // mark the button as clicked 5500 $(':submit').removeAttr('clicked'); 5501 $(this).attr('clicked', 'clicked'); 5502 5503 // if submitting and no opt-out guardClassName is found 5504 // pop up confirmation dialog 5505 if ($(this).hasClass(self.options.guardClassName) && 5506 !$(this).hasClass(self.options.optOutClassName)) { 5507 return self._confirm.call(self); 5508 } 5509 5510 $(this).addClass(self.options.guardClassName); 5511 }); 5512 5513 }, 5514 5515 _confirm: function(e) { 5516 return window.confirm(this.options.message); 5517 } 5518 5519 }); 5520 5521 return PreventDoubleSubmit; 5522 5523}); 5524 5525/*! 5526 * jQuery Form Plugin 5527 * version: 4.2.2 5528 * Requires jQuery v1.7.2 or later 5529 * Project repository: https://github.com/jquery-form/form 5530 5531 * Copyright 2017 Kevin Morris 5532 * Copyright 2006 M. Alsup 5533 5534 * Dual licensed under the LGPL-2.1+ or MIT licenses 5535 * https://github.com/jquery-form/form#license 5536 5537 * This library is free software; you can redistribute it and/or 5538 * modify it under the terms of the GNU Lesser General Public
5539 * License as published by the Free Software Foundation; either 5540 * version 2.1 of the License, or (at your option) any later version. 5541 * This library is distributed in the hope that it will be useful, 5542 * but WITHOUT ANY WARRANTY; without even the implied warranty of 5543 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 5544 * Lesser General Public License for more details. 5545 */ 5546/* global ActiveXObject */ 5547 5548/* eslint-disable */ 5549(function (factory) { 5550 if (typeof define === 'function' && define.amd) { 5551 // AMD. Register as an anonymous module. 5552 define('jquery.form',['jquery'], factory); 5553 } else if (typeof module === 'object' && module.exports) { 5554 // Node/CommonJS 5555 module.exports = function( root, jQuery ) { 5556 if (typeof jQuery === 'undefined') { 5557 // require('jQuery') returns a factory that requires window to build a jQuery instance, we normalize how we use modules 5558 // that require this pattern but the window provided is a noop if it's defined (how jquery works) 5559 if (typeof window !== 'undefined') { 5560 jQuery = require('jquery'); 5561 } 5562 else { 5563 jQuery = require('jquery')(root); 5564 } 5565 } 5566 factory(jQuery); 5567 return jQuery; 5568 }; 5569 } else { 5570 // Browser globals 5571 factory(jQuery); 5572 } 5573 5574}(function ($) { 5575/* eslint-enable */ 5576 5577 5578 /* 5579 Usage Note: 5580 ----------- 5581 Do not use both ajaxSubmit and ajaxForm on the same form. These 5582 functions are mutually exclusive. Use ajaxSubmit if you want 5583 to bind your own submit handler to the form. For example, 5584 5585 $(document).ready(function() { 5586 $('#myForm').on('submit', function(e) { 5587 e.preventDefault(); // <-- important 5588 $(this).ajaxSubmit({ 5589 target: '#output' 5590 }); 5591 }); 5592 }); 5593 5594 Use ajaxForm when you want the plugin to manage all the event binding 5595 for you. For example, 5596 5597 $(document).ready(function() { 5598 $('#myForm').ajaxForm({ 5599 target: '#output' 5600 }); 5601 }); 5602 5603 You can also use ajaxForm with delegation (requires jQuery v1.7+), so the 5604 form does not have to exist when you invoke ajaxForm: 5605 5606 $('#myForm').ajaxForm({ 5607 delegation: true, 5608 target: '#output' 5609 }); 5610 5611 When using ajaxForm, the ajaxSubmit function will be invoked for you 5612 at the appropriate time. 5613 */ 5614 5615 var rCRLF = /\r?\n/g; 5616 5617 /** 5618 * Feature detection 5619 */ 5620 var feature = {}; 5621 5622 feature.fileapi = $('<input type="file">').get(0).files !== undefined; 5623 feature.formdata = (typeof window.FormData !== 'undefined'); 5624 5625 var hasProp = !!$.fn.prop; 5626 5627 // attr2 uses prop when it can but checks the return type for 5628 // an expected string. This accounts for the case where a form 5629 // contains inputs with names like "action" or "method"; in those 5630 // cases "prop" returns the element 5631 $.fn.attr2 = function() { 5632 if (!hasProp) { 5633 return this.attr.apply(this, arguments); 5634 } 5635 5636 var val = this.prop.apply(this, arguments); 5637 5638 if ((val && val.jquery) || typeof val === 'string') { 5639 return val; 5640 } 5641 5642 return this.attr.apply(this, arguments); 5643 }; 5644 5645 /** 5646 * ajaxSubmit() provides a mechanism for immediately submitting 5647 * an HTML form using AJAX. 5648 * 5649 * @param {object|string} options jquery.form.js parameters or custom url for submission 5650 * @param {object} data extraData 5651 * @param {string} dataType ajax dataType 5652 * @param {function} onSuccess ajax success callback function 5653 */ 5654 $.fn.ajaxSubmit = function(options, data, dataType, onSuccess) { 5655 // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) 5656 if (!this.length) { 5657 log('ajaxSubmit: skipping submit process - no element selected'); 5658 5659 return this; 5660 } 5661 5662 /* eslint consistent-this: ["error", "$form"] */ 5663 var method, action, url, $form = this; 5664 5665 if (typeof options === 'function') { 5666 options = {success: options}; 5667 5668 } else if (typeof options === 'string' || (options === false && arguments.length > 0)) { 5669 options = { 5670 'url' : options, 5671 'data' : data, 5672 'dataType' : dataType 5673 }; 5674 5675 if (typeof onSuccess === 'function') { 5676 options.success = onSuccess; 5677 } 5678 5679 } else if (typeof options === 'undefined') { 5680 options = {}; 5681 } 5682 5683 method = options.method || options.type || this.attr2('method'); 5684 action = options.url || this.attr2('action'); 5685 5686 url = (typeof action === 'string') ? $.trim(action) : ''; 5687 url = url || window.location.href || ''; 5688 if (url) { 5689 // clean url (don't include hash vaue) 5690 url = (url.match(/^([^#]+)/) || [])[1]; 5691 } 5692 5693 options = $.extend(true, { 5694 url : url, 5695 success : $.ajaxSettings.success, 5696 type : method || $.ajaxSettings.type, 5697 iframeSrc : /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' // eslint-disable-line no-script-url 5698 }, options); 5699 5700 // hook for manipulating the form data before it is extracted; 5701 // convenient for use with rich editors like tinyMCE or FCKEditor 5702 var veto = {}; 5703 5704 this.trigger('form-pre-serialize', [this, options, veto]); 5705 5706 if (veto.veto) { 5707 log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); 5708 5709 return this; 5710 } 5711 5712 // provide opportunity to alter form data before it is serialized 5713 if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { 5714 log('ajaxSubmit: submit aborted via beforeSerialize callback'); 5715 5716 return this; 5717 } 5718 5719 var traditional = options.traditional; 5720 5721 if (typeof traditional === 'undefined') { 5722 traditional = $.ajaxSettings.traditional; 5723 } 5724 5725 var elements = []; 5726 var qx, a = this.formToArray(options.semantic, elements, options.filtering); 5727 5728 if (options.data) { 5729 var optionsData = $.isFunction(options.data) ? options.data(a) : options.data; 5730 5731 options.extraData = optionsData; 5732 qx = $.param(optionsData, traditional); 5733 } 5734 5735 // give pre-submit callback an opportunity to abort the submit 5736 if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { 5737 log('ajaxSubmit: submit aborted via beforeSubmit callback'); 5738 5739 return this; 5740 } 5741 5742 // fire vetoable 'validate' event 5743 this.trigger('form-submit-validate', [a, this, options, veto]); 5744 if (veto.veto) { 5745 log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); 5746 5747 return this; 5748 } 5749 5750 var q = $.param(a, traditional); 5751 5752 if (qx) { 5753 q = (q ? (q + '&' + qx) : qx); 5754 } 5755 5756 if (options.type.toUpperCase() === 'GET') { 5757 options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; 5758 options.data = null; // data is null for 'get' 5759 } else { 5760 options.data = q; // data is the query string for 'post' 5761 } 5762 5763 var callbacks = []; 5764 5765 if (options.resetForm) { 5766 callbacks.push(function() { 5767 $form.resetForm(); 5768 }); 5769 } 5770 5771 if (options.clearForm) { 5772 callbacks.push(function() { 5773 $form.clearForm(options.includeHidden); 5774 }); 5775 } 5776 5777 // perform a load on the target only if dataType is not provided 5778 if (!options.dataType && options.target) { 5779 var oldSuccess = options.success || function(){}; 5780 5781 callbacks.push(function(data, textStatus, jqXHR) { 5782 var successArguments = arguments, 5783 fn = options.replaceTarget ? 'replaceWith' : 'html'; 5784 5785 $(options.target)[fn](data).each(function(){ 5786 oldSuccess.apply(this, successArguments); 5787 }); 5788 }); 5789 5790 } else if (options.success) { 5791 if ($.isArray(options.success)) { 5792 $.merge(callbacks, options.success); 5793 } else { 5794 callbacks.push(options.success); 5795 } 5796 } 5797 5798 options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg 5799 var context = options.context || this; // jQuery 1.4+ supports scope context 5800 5801 for (var i = 0, max = callbacks.length; i < max; i++) { 5802 callbacks[i].apply(context, [data, status, xhr || $form, $form]); 5803 } 5804 }; 5805 5806 if (options.error) { 5807 var oldError = options.error; 5808 5809 options.error = function(xhr, status, error) { 5810 var context = options.context || this; 5811 5812 oldError.apply(context, [xhr, status, error, $form]); 5813 }; 5814 } 5815 5816 if (options.complete) { 5817 var oldComplete = options.complete; 5818 5819 options.complete = function(xhr, status) { 5820 var context = options.context || this; 5821 5822 oldComplete.apply(context, [xhr, status, $form]); 5823 }; 5824 } 5825 5826 // are there files to upload? 5827 5828 // [value] (issue #113), also see comment: 5829 // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 5830 var fileInputs = $('input[type=file]:enabled', this).filter(function() { 5831 return $(this).val() !== ''; 5832 }); 5833 var hasFileInputs = fileInputs.length > 0; 5834 var mp = 'multipart/form-data'; 5835 var multipart = ($form.attr('enctype') === mp || $form.attr('encoding') === mp); 5836 var fileAPI = feature.fileapi && feature.formdata; 5837 5838 log('fileAPI :' + fileAPI); 5839 5840 var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; 5841 var jqxhr; 5842 5843 // options.iframe allows user to force iframe mode 5844 // 06-NOV-09: now defaulting to iframe mode if file input is detected 5845 if (options.iframe !== false && (options.iframe || shouldUseFrame)) { 5846 // hack to fix Safari hang (thanks to Tim Molendijk for this) 5847 // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d 5848 if (options.closeKeepAlive) { 5849 $.get(options.closeKeepAlive, function() { 5850 jqxhr = fileUploadIframe(a); 5851 }); 5852 5853 } else { 5854 jqxhr = fileUploadIframe(a); 5855 } 5856 5857 } else if ((hasFileInputs || multipart) && fileAPI) { 5858 jqxhr = fileUploadXhr(a); 5859 5860 } else { 5861 jqxhr = $.ajax(options); 5862 } 5863 5864 $form.removeData('jqxhr').data('jqxhr', jqxhr); 5865 5866 // clear element array 5867 for (var k = 0; k < elements.length; k++) { 5868 elements[k] = null; 5869 } 5870 5871 // fire 'notify' event 5872 this.trigger('form-submit-notify', [this, options]); 5873 5874 return this; 5875 5876 // utility fn for deep serialization 5877 function deepSerialize(extraData) { 5878 var serialized = $.param(extraData, options.traditional).split('&'); 5879 var len = serialized.length; 5880 var result = []; 5881 var i, part; 5882 5883 for (i = 0; i < len; i++) { 5884 // #252; undo param space replacement 5885 serialized[i] = serialized[i].replace(/\+/g, ' '); 5886 part = serialized[i].split('='); 5887 // #278; use array instead of object storage, favoring array serializations 5888 result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); 5889 } 5890 5891 return result; 5892 } 5893 5894 // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) 5895 function fileUploadXhr(a) { 5896 var formdata = new FormData(); 5897 5898 for (var i = 0; i < a.length; i++) { 5899 formdata.append(a[i].name, a[i].value); 5900 } 5901 5902 if (options.extraData) { 5903 var serializedData = deepSerialize(options.extraData); 5904 5905 for (i = 0; i < serializedData.length; i++) { 5906 if (serializedData[i]) { 5907 formdata.append(serializedData[i][0], serializedData[i][1]); 5908 } 5909 } 5910 } 5911 5912 options.data = null; 5913 5914 var s = $.extend(true, {}, $.ajaxSettings, options, { 5915 contentType : false, 5916 processData : false, 5917 cache : false, 5918 type : method || 'POST' 5919 }); 5920 5921 if (options.uploadProgress) { 5922 // workaround because jqXHR does not expose upload property 5923 s.xhr = function() { 5924 var xhr = $.ajaxSettings.xhr(); 5925 5926 if (xhr.upload) { 5927 xhr.upload.addEventListener('progress', function(event) { 5928 var percent = 0; 5929 var position = event.loaded || event.position; /* event.position is deprecated */ 5930 var total = event.total; 5931 5932 if (event.lengthComputable) {
5933 percent = Math.ceil(position / total * 100); 5934 } 5935 5936 options.uploadProgress(event, position, total, percent); 5937 }, false); 5938 } 5939 5940 return xhr; 5941 }; 5942 } 5943 5944 s.data = null; 5945 5946 var beforeSend = s.beforeSend; 5947 5948 s.beforeSend = function(xhr, o) { 5949 // Send FormData() provided by user 5950 if (options.formData) { 5951 o.data = options.formData; 5952 } else { 5953 o.data = formdata; 5954 } 5955 5956 if (beforeSend) { 5957 beforeSend.call(this, xhr, o); 5958 } 5959 }; 5960 5961 return $.ajax(s); 5962 } 5963 5964 // private function for handling file uploads (hat tip to YAHOO!) 5965 function fileUploadIframe(a) { 5966 var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; 5967 var deferred = $.Deferred(); 5968 5969 // #341 5970 deferred.abort = function(status) { 5971 xhr.abort(status); 5972 }; 5973 5974 if (a) { 5975 // ensure that every serialized input is still enabled 5976 for (i = 0; i < elements.length; i++) { 5977 el = $(elements[i]); 5978 if (hasProp) { 5979 el.prop('disabled', false); 5980 } else { 5981 el.removeAttr('disabled'); 5982 } 5983 } 5984 } 5985 5986 s = $.extend(true, {}, $.ajaxSettings, options); 5987 s.context = s.context || s; 5988 id = 'jqFormIO' + new Date().getTime(); 5989 var ownerDocument = form.ownerDocument; 5990 var $body = $form.closest('body'); 5991 5992 if (s.iframeTarget) { 5993 $io = $(s.iframeTarget, ownerDocument); 5994 n = $io.attr2('name'); 5995 if (!n) { 5996 $io.attr2('name', id); 5997 } else { 5998 id = n; 5999 } 6000 6001 } else { 6002 $io = $('<iframe name="' + id + '" src="' + s.iframeSrc + '" />', ownerDocument); 6003 $io.css({position: 'absolute', top: '-1000px', left: '-1000px'}); 6004 } 6005 io = $io[0]; 6006 6007 6008 xhr = { // mock object 6009 aborted : 0, 6010 responseText : null, 6011 responseXML : null, 6012 status : 0, 6013 statusText : 'n/a', 6014 getAllResponseHeaders : function() {}, 6015 getResponseHeader : function() {}, 6016 setRequestHeader : function() {}, 6017 abort : function(status) { 6018 var e = (status === 'timeout' ? 'timeout' : 'aborted'); 6019 6020 log('aborting upload... ' + e); 6021 this.aborted = 1; 6022 6023 try { // #214, #257 6024 if (io.contentWindow.document.execCommand) { 6025 io.contentWindow.document.execCommand('Stop'); 6026 } 6027 } catch (ignore) {} 6028 6029 $io.attr('src', s.iframeSrc); // abort op in progress 6030 xhr.error = e; 6031 if (s.error) { 6032 s.error.call(s.context, xhr, e, status); 6033 } 6034 6035 if (g) { 6036 $.event.trigger('ajaxError', [xhr, s, e]); 6037 } 6038 6039 if (s.complete) { 6040 s.complete.call(s.context, xhr, e); 6041 } 6042 } 6043 }; 6044 6045 g = s.global; 6046 // trigger ajax global events so that activity/block indicators work like normal 6047 if (g && $.active++ === 0) { 6048 $.event.trigger('ajaxStart'); 6049 } 6050 if (g) { 6051 $.event.trigger('ajaxSend', [xhr, s]); 6052 } 6053 6054 if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { 6055 if (s.global) { 6056 $.active--; 6057 } 6058 deferred.reject(); 6059 6060 return deferred; 6061 } 6062 6063 if (xhr.aborted) { 6064 deferred.reject(); 6065 6066 return deferred; 6067 } 6068 6069 // add submitting element to data if we know it 6070 sub = form.clk; 6071 if (sub) { 6072 n = sub.name; 6073 if (n && !sub.disabled) { 6074 s.extraData = s.extraData || {}; 6075 s.extraData[n] = sub.value; 6076 if (sub.type === 'image') { 6077 s.extraData[n + '.x'] = form.clk_x; 6078 s.extraData[n + '.y'] = form.clk_y; 6079 } 6080 } 6081 } 6082 6083 var CLIENT_TIMEOUT_ABORT = 1; 6084 var SERVER_ABORT = 2; 6085 6086 function getDoc(frame) { 6087 /* it looks like contentWindow or contentDocument do not 6088 * carry the protocol property in ie8, when running under ssl 6089 * frame.document is the only valid response document, since 6090 * the protocol is know but not on the other two objects. strange? 6091 * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy 6092 */ 6093 6094 var doc = null; 6095 6096 // IE8 cascading access check 6097 try { 6098 if (frame.contentWindow) { 6099 doc = frame.contentWindow.document; 6100 } 6101 } catch (err) { 6102 // IE8 access denied under ssl & missing protocol 6103 log('cannot get iframe.contentWindow document: ' + err); 6104 } 6105 6106 if (doc) { // successful getting content 6107 return doc; 6108 } 6109 6110 try { // simply checking may throw in ie8 under ssl or mismatched protocol 6111 doc = frame.contentDocument ? frame.contentDocument : frame.document; 6112 } catch (err) { 6113 // last attempt 6114 log('cannot get iframe.contentDocument: ' + err); 6115 doc = frame.document; 6116 } 6117 6118 return doc; 6119 } 6120 6121 // Rails CSRF hack (thanks to Yvan Barthelemy) 6122 var csrf_token = $('meta[name=csrf-token]').attr('content'); 6123 var csrf_param = $('meta[name=csrf-param]').attr('content'); 6124 6125 if (csrf_param && csrf_token) { 6126 s.extraData = s.extraData || {}; 6127 s.extraData[csrf_param] = csrf_token; 6128 } 6129 6130 // take a breath so that pending repaints get some cpu time before the upload starts 6131 function doSubmit() { 6132 // make sure form attrs are set 6133 var t = $form.attr2('target'), 6134 a = $form.attr2('action'), 6135 mp = 'multipart/form-data', 6136 et = $form.attr('enctype') || $form.attr('encoding') || mp; 6137 6138 // update form attrs in IE friendly way 6139 form.setAttribute('target', id); 6140 if (!method || /post/i.test(method)) { 6141 form.setAttribute('method', 'POST'); 6142 } 6143 if (a !== s.url) { 6144 form.setAttribute('action', s.url); 6145 } 6146 6147 // ie borks in some cases when setting encoding 6148 if (!s.skipEncodingOverride && (!method || /post/i.test(method))) { 6149 $form.attr({ 6150 encoding : 'multipart/form-data', 6151 enctype : 'multipart/form-data' 6152 }); 6153 } 6154 6155 // support timout 6156 if (s.timeout) { 6157 timeoutHandle = setTimeout(function() { 6158 timedOut = true; cb(CLIENT_TIMEOUT_ABORT); 6159 }, s.timeout); 6160 } 6161 6162 // look for server aborts 6163 function checkState() { 6164 try { 6165 var state = getDoc(io).readyState; 6166 6167 log('state = ' + state); 6168 if (state && state.toLowerCase() === 'uninitialized') { 6169 setTimeout(checkState, 50); 6170 } 6171 6172 } catch (e) { 6173 log('Server abort: ', e, ' (', e.name, ')'); 6174 cb(SERVER_ABORT); // eslint-disable-line callback-return 6175 if (timeoutHandle) { 6176 clearTimeout(timeoutHandle); 6177 } 6178 timeoutHandle = undefined; 6179 } 6180 } 6181 6182 // add "extra" data to form if provided in options 6183 var extraInputs = []; 6184 6185 try { 6186 if (s.extraData) { 6187 for (var n in s.extraData) { 6188 if (s.extraData.hasOwnProperty(n)) { 6189 // if using the $.param format that allows for multiple values with the same name 6190 if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) { 6191 extraInputs.push( 6192 $('<input type="hidden" name="' + s.extraData[n].name + '">', ownerDocument).val(s.extraData[n].value) 6193 .appendTo(form)[0]); 6194 } else { 6195 extraInputs.push( 6196 $('<input type="hidden" name="' + n + '">', ownerDocument).val(s.extraData[n]) 6197 .appendTo(form)[0]); 6198 } 6199 } 6200 } 6201 } 6202 6203 if (!s.iframeTarget) { 6204 // add iframe to doc and submit the form 6205 $io.appendTo($body); 6206 } 6207 6208 if (io.attachEvent) { 6209 io.attachEvent('onload', cb); 6210 } else { 6211 io.addEventListener('load', cb, false); 6212 } 6213 6214 setTimeout(checkState, 15); 6215 6216 try { 6217 form.submit(); 6218 6219 } catch (err) { 6220 // just in case form has element with name/id of 'submit' 6221 var submitFn = document.createElement('form').submit; 6222 6223 submitFn.apply(form); 6224 } 6225 6226 } finally { 6227 // reset attrs and remove "extra" input elements 6228 form.setAttribute('action', a); 6229 form.setAttribute('enctype', et); // #380 6230 if (t) { 6231 form.setAttribute('target', t); 6232 } else { 6233 $form.removeAttr('target'); 6234 } 6235 $(extraInputs).remove(); 6236 } 6237 } 6238 6239 if (s.forceSync) { 6240 doSubmit(); 6241 } else { 6242 setTimeout(doSubmit, 10); // this lets dom updates render 6243 } 6244 6245 var data, doc, domCheckCount = 50, callbackProcessed; 6246 6247 function cb(e) { 6248 if (xhr.aborted || callbackProcessed) { 6249 return; 6250 } 6251 6252 doc = getDoc(io); 6253 if (!doc) { 6254 log('cannot access response document'); 6255 e = SERVER_ABORT; 6256 } 6257 if (e === CLIENT_TIMEOUT_ABORT && xhr) { 6258 xhr.abort('timeout'); 6259 deferred.reject(xhr, 'timeout'); 6260 6261 return; 6262 6263 } else if (e === SERVER_ABORT && xhr) { 6264 xhr.abort('server abort'); 6265 deferred.reject(xhr, 'error', 'server abort'); 6266 6267 return; 6268 } 6269 6270 if (!doc || doc.location.href === s.iframeSrc) { 6271 // response not received yet 6272 if (!timedOut) { 6273 return; 6274 } 6275 } 6276 6277 if (io.detachEvent) { 6278 io.detachEvent('onload', cb); 6279 } else { 6280 io.removeEventListener('load', cb, false); 6281 } 6282 6283 var status = 'success', errMsg; 6284 6285 try { 6286 if (timedOut) { 6287 throw 'timeout'; 6288 } 6289 6290 var isXml = s.dataType === 'xml' || doc.XMLDocument || $.isXMLDoc(doc); 6291 6292 log('isXml=' + isXml); 6293 6294 if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) { 6295 if (--domCheckCount) { 6296 // in some browsers (Opera) the iframe DOM is not always traversable when 6297 // the onload callback fires, so we loop a bit to accommodate 6298 log('requeing onLoad callback, DOM not available'); 6299 setTimeout(cb, 250); 6300 6301 return; 6302 } 6303 // let this fall through because server response could be an empty document 6304 // log('Could not access iframe DOM after mutiple tries.'); 6305 // throw 'DOMException: not available'; 6306 } 6307 6308 // log('response detected'); 6309 var docRoot = doc.body ? doc.body : doc.documentElement; 6310 6311 xhr.responseText = docRoot ? docRoot.innerHTML : null; 6312 xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; 6313 if (isXml) { 6314 s.dataType = 'xml'; 6315 } 6316 xhr.getResponseHeader = function(header){ 6317 var headers = {'content-type': s.dataType}; 6318 6319 return headers[header.toLowerCase()]; 6320 }; 6321 // support for XHR 'status' & 'statusText' emulation : 6322 if (docRoot) { 6323 xhr.status = Number(docRoot.getAttribute('status')) || xhr.status; 6324 xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText; 6325 } 6326 6327 var dt = (s.dataType || '').toLowerCase(); 6328 var scr = /(json|script|text)/.test(dt); 6329 6330 if (scr || s.textarea) { 6331 // see if user embedded response in textarea 6332 var ta = doc.getElementsByTagName('textarea')[0]; 6333 6334 if (ta) { 6335 xhr.responseText = ta.value; 6336 // support for XHR 'status' & 'statusText' emulation : 6337 xhr.status = Number(ta.getAttribute('status')) || xhr.status; 6338 xhr.statusText = ta.getAttribute('statusText') || xhr.statusText; 6339 6340 } else if (scr) { 6341 // account for browsers injecting pre around json response 6342 var pre = doc.getElementsByTagName('pre')[0]; 6343 var b = doc.getElementsByTagName('body')[0]; 6344 6345 if (pre) { 6346 xhr.responseText = pre.textContent ? pre.textContent : pre.innerText; 6347 } else if (b) { 6348 xhr.responseText = b.textContent ? b.textContent : b.innerText; 6349 } 6350 } 6351 6352 } else if (dt === 'xml' && !xhr.responseXML && xhr.responseText) { 6353 xhr.responseXML = toXml(xhr.responseText); // eslint-disable-line no-use-before-define 6354 } 6355 6356 try { 6357 data = httpData(xhr, dt, s); // eslint-disable-line no-use-before-define 6358 6359 } catch (err) { 6360 status = 'parsererror'; 6361 xhr.error = errMsg = (err || status); 6362 } 6363 6364 } catch (err) { 6365 log('error caught: ', err); 6366 status = 'error'; 6367 xhr.error = errMsg = (err || status); 6368 } 6369 6370 if (xhr.aborted) { 6371 log('upload aborted'); 6372 status = null; 6373 } 6374 6375 if (xhr.status) { // we've set xhr.status 6376 status = ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) ? 'success' : 'error'; 6377 } 6378 6379 // ordering of these callbacks/triggers is odd, but that's how $.ajax does it 6380 if (status === 'success') { 6381 if (s.success) { 6382 s.success.call(s.context, data, 'success', xhr); 6383 } 6384 6385 deferred.resolve(xhr.responseText, 'success', xhr); 6386 6387 if (g) {
6388 $.event.trigger('ajaxSuccess', [xhr, s]); 6389 } 6390 6391 } else if (status) { 6392 if (typeof errMsg === 'undefined') { 6393 errMsg = xhr.statusText; 6394 } 6395 if (s.error) { 6396 s.error.call(s.context, xhr, status, errMsg); 6397 } 6398 deferred.reject(xhr, 'error', errMsg); 6399 if (g) { 6400 $.event.trigger('ajaxError', [xhr, s, errMsg]); 6401 } 6402 } 6403 6404 if (g) { 6405 $.event.trigger('ajaxComplete', [xhr, s]); 6406 } 6407 6408 if (g && !--$.active) { 6409 $.event.trigger('ajaxStop'); 6410 } 6411 6412 if (s.complete) { 6413 s.complete.call(s.context, xhr, status); 6414 } 6415 6416 callbackProcessed = true; 6417 if (s.timeout) { 6418 clearTimeout(timeoutHandle); 6419 } 6420 6421 // clean up 6422 setTimeout(function() { 6423 if (!s.iframeTarget) { 6424 $io.remove(); 6425 } else { // adding else to clean up existing iframe response. 6426 $io.attr('src', s.iframeSrc); 6427 } 6428 xhr.responseXML = null; 6429 }, 100); 6430 } 6431 6432 var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+) 6433 if (window.ActiveXObject) { 6434 doc = new ActiveXObject('Microsoft.XMLDOM'); 6435 doc.async = 'false'; 6436 doc.loadXML(s); 6437 6438 } else { 6439 doc = (new DOMParser()).parseFromString(s, 'text/xml'); 6440 } 6441 6442 return (doc && doc.documentElement && doc.documentElement.nodeName !== 'parsererror') ? doc : null; 6443 }; 6444 var parseJSON = $.parseJSON || function(s) { 6445 /* jslint evil:true */ 6446 return window['eval']('(' + s + ')'); // eslint-disable-line dot-notation 6447 }; 6448 6449 var httpData = function(xhr, type, s) { // mostly lifted from jq1.4.4 6450 6451 var ct = xhr.getResponseHeader('content-type') || '', 6452 xml = ((type === 'xml' || !type) && ct.indexOf('xml') >= 0), 6453 data = xml ? xhr.responseXML : xhr.responseText; 6454 6455 if (xml && data.documentElement.nodeName === 'parsererror') { 6456 if ($.error) { 6457 $.error('parsererror'); 6458 } 6459 } 6460 if (s && s.dataFilter) { 6461 data = s.dataFilter(data, type); 6462 } 6463 if (typeof data === 'string') { 6464 if ((type === 'json' || !type) && ct.indexOf('json') >= 0) { 6465 data = parseJSON(data); 6466 } else if ((type === 'script' || !type) && ct.indexOf('javascript') >= 0) { 6467 $.globalEval(data); 6468 } 6469 } 6470 6471 return data; 6472 }; 6473 6474 return deferred; 6475 } 6476 }; 6477 6478 /** 6479 * ajaxForm() provides a mechanism for fully automating form submission. 6480 * 6481 * The advantages of using this method instead of ajaxSubmit() are: 6482 * 6483 * 1: This method will include coordinates for <input type="image"> elements (if the element 6484 * is used to submit the form). 6485 * 2. This method will include the submit element's name/value data (for the element that was 6486 * used to submit the form). 6487 * 3. This method binds the submit() method to the form for you. 6488 * 6489 * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely 6490 * passes the options argument along after properly binding events for submit elements and 6491 * the form itself. 6492 */ 6493 $.fn.ajaxForm = function(options, data, dataType, onSuccess) { 6494 if (typeof options === 'string' || (options === false && arguments.length > 0)) { 6495 options = { 6496 'url' : options, 6497 'data' : data, 6498 'dataType' : dataType 6499 }; 6500 6501 if (typeof onSuccess === 'function') { 6502 options.success = onSuccess; 6503 } 6504 } 6505 6506 options = options || {}; 6507 options.delegation = options.delegation && $.isFunction($.fn.on); 6508 6509 // in jQuery 1.3+ we can fix mistakes with the ready state 6510 if (!options.delegation && this.length === 0) { 6511 var o = {s: this.selector, c: this.context}; 6512 6513 if (!$.isReady && o.s) { 6514 log('DOM not ready, queuing ajaxForm'); 6515 $(function() { 6516 $(o.s, o.c).ajaxForm(options); 6517 }); 6518 6519 return this; 6520 } 6521 6522 // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() 6523 log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); 6524 6525 return this; 6526 } 6527 6528 if (options.delegation) { 6529 $(document) 6530 .off('submit.form-plugin', this.selector, doAjaxSubmit) 6531 .off('click.form-plugin', this.selector, captureSubmittingElement) 6532 .on('submit.form-plugin', this.selector, options, doAjaxSubmit) 6533 .on('click.form-plugin', this.selector, options, captureSubmittingElement); 6534 6535 return this; 6536 } 6537 6538 return this.ajaxFormUnbind() 6539 .on('submit.form-plugin', options, doAjaxSubmit) 6540 .on('click.form-plugin', options, captureSubmittingElement); 6541 }; 6542 6543 // private event handlers 6544 function doAjaxSubmit(e) { 6545 /* jshint validthis:true */ 6546 var options = e.data; 6547 6548 if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed 6549 e.preventDefault(); 6550 $(e.target).closest('form').ajaxSubmit(options); // #365 6551 } 6552 } 6553 6554 function captureSubmittingElement(e) { 6555 /* jshint validthis:true */ 6556 var target = e.target; 6557 var $el = $(target); 6558 6559 if (!$el.is('[type=submit],[type=image]')) { 6560 // is this a child element of the submit el? (ex: a span within a button) 6561 var t = $el.closest('[type=submit]'); 6562 6563 if (t.length === 0) { 6564 return; 6565 } 6566 target = t[0]; 6567 } 6568 6569 var form = target.form; 6570 6571 form.clk = target; 6572 6573 if (target.type === 'image') { 6574 if (typeof e.offsetX !== 'undefined') { 6575 form.clk_x = e.offsetX; 6576 form.clk_y = e.offsetY; 6577 6578 } else if (typeof $.fn.offset === 'function') { 6579 var offset = $el.offset(); 6580 6581 form.clk_x = e.pageX - offset.left; 6582 form.clk_y = e.pageY - offset.top; 6583 6584 } else { 6585 form.clk_x = e.pageX - target.offsetLeft; 6586 form.clk_y = e.pageY - target.offsetTop; 6587 } 6588 } 6589 // clear form vars 6590 setTimeout(function() { 6591 form.clk = form.clk_x = form.clk_y = null; 6592 }, 100); 6593 } 6594 6595 6596 // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm 6597 $.fn.ajaxFormUnbind = function() { 6598 return this.off('submit.form-plugin click.form-plugin'); 6599 }; 6600 6601 /** 6602 * formToArray() gathers form element data into an array of objects that can 6603 * be passed to any of the following ajax functions: $.get, $.post, or load. 6604 * Each object in the array has both a 'name' and 'value' property. An example of 6605 * an array for a simple login form might be: 6606 * 6607 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] 6608 * 6609 * It is this array that is passed to pre-submit callback functions provided to the 6610 * ajaxSubmit() and ajaxForm() methods. 6611 */ 6612 $.fn.formToArray = function(semantic, elements, filtering) { 6613 var a = []; 6614 6615 if (this.length === 0) { 6616 return a; 6617 } 6618 6619 var form = this[0]; 6620 var formId = this.attr('id'); 6621 var els = (semantic || typeof form.elements === 'undefined') ? form.getElementsByTagName('*') : form.elements; 6622 var els2; 6623 6624 if (els) { 6625 els = $.makeArray(els); // convert to standard array 6626 } 6627 6628 // #386; account for inputs outside the form which use the 'form' attribute 6629 // FinesseRus: in non-IE browsers outside fields are already included in form.elements. 6630 if (formId && (semantic || /(Edge|Trident)\//.test(navigator.userAgent))) { 6631 els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet 6632 if (els2.length) { 6633 els = (els || []).concat(els2); 6634 } 6635 } 6636 6637 if (!els || !els.length) { 6638 return a; 6639 } 6640
6641 if ($.isFunction(filtering)) { 6642 els = $.map(els, filtering); 6643 } 6644 6645 var i, j, n, v, el, max, jmax; 6646 6647 for (i = 0, max = els.length; i < max; i++) { 6648 el = els[i]; 6649 n = el.name; 6650 if (!n || el.disabled) { 6651 continue; 6652 } 6653 6654 if (semantic && form.clk && el.type === 'image') { 6655 // handle image inputs on the fly when semantic == true 6656 if (form.clk === el) { 6657 a.push({name: n, value: $(el).val(), type: el.type}); 6658 a.push({name: n + '.x', value: form.clk_x}, {name: n + '.y', value: form.clk_y}); 6659 } 6660 continue; 6661 } 6662 6663 v = $.fieldValue(el, true); 6664 if (v && v.constructor === Array) { 6665 if (elements) { 6666 elements.push(el); 6667 } 6668 for (j = 0, jmax = v.length; j < jmax; j++) { 6669 a.push({name: n, value: v[j]}); 6670 } 6671 6672 } else if (feature.fileapi && el.type === 'file') { 6673 if (elements) { 6674 elements.push(el); 6675 } 6676 6677 var files = el.files; 6678 6679 if (files.length) { 6680 for (j = 0; j < files.length; j++) { 6681 a.push({name: n, value: files[j], type: el.type}); 6682 } 6683 } else { 6684 // #180 6685 a.push({name: n, value: '', type: el.type}); 6686 } 6687 6688 } else if (v !== null && typeof v !== 'undefined') { 6689 if (elements) { 6690 elements.push(el); 6691 } 6692 a.push({name: n, value: v, type: el.type, required: el.required}); 6693 } 6694 } 6695 6696 if (!semantic && form.clk) { 6697 // input type=='image' are not found in elements array! handle it here 6698 var $input = $(form.clk), input = $input[0]; 6699 6700 n = input.name; 6701 6702 if (n && !input.disabled && input.type === 'image') { 6703 a.push({name: n, value: $input.val()}); 6704 a.push({name: n + '.x', value: form.clk_x}, {name: n + '.y', value: form.clk_y}); 6705 } 6706 } 6707 6708 return a; 6709 }; 6710 6711 /** 6712 * Serializes form data into a 'submittable' string. This method will return a string 6713 * in the format: name1=value1&name2=value2 6714 */ 6715 $.fn.formSerialize = function(semantic) { 6716 // hand off to jQuery.param for proper encoding 6717 return $.param(this.formToArray(semantic)); 6718 }; 6719 6720 /** 6721 * Serializes all field elements in the jQuery object into a query string. 6722 * This method will return a string in the format: name1=value1&name2=value2 6723 */ 6724 $.fn.fieldSerialize = function(successful) { 6725 var a = []; 6726 6727 this.each(function() { 6728 var n = this.name; 6729 6730 if (!n) { 6731 return; 6732 } 6733 6734 var v = $.fieldValue(this, successful); 6735 6736 if (v && v.constructor === Array) { 6737 for (var i = 0, max = v.length; i < max; i++) { 6738 a.push({name: n, value: v[i]}); 6739 } 6740 6741 } else if (v !== null && typeof v !== 'undefined') { 6742 a.push({name: this.name, value: v}); 6743 } 6744 }); 6745 6746 // hand off to jQuery.param for proper encoding 6747 return $.param(a); 6748 }; 6749 6750 /** 6751 * Returns the value(s) of the element in the matched set. For example, consider the following form: 6752 * 6753 * <form><fieldset> 6754 * <input name="A" type="text"> 6755 * <input name="A" type="text"> 6756 * <input name="B" type="checkbox" value="B1"> 6757 * <input name="B" type="checkbox" value="B2"> 6758 * <input name="C" type="radio" value="C1"> 6759 * <input name="C" type="radio" value="C2"> 6760 * </fieldset></form> 6761 * 6762 * var v = $('input[type=text]').fieldValue(); 6763 * // if no values are entered into the text inputs 6764 * v === ['',''] 6765 * // if values entered into the text inputs are 'foo' and 'bar' 6766 * v === ['foo','bar'] 6767 * 6768 * var v = $('input[type=checkbox]').fieldValue(); 6769 * // if neither checkbox is checked 6770 * v === undefined 6771 * // if both checkboxes are checked 6772 * v === ['B1', 'B2'] 6773 * 6774 * var v = $('input[type=radio]').fieldValue(); 6775 * // if neither radio is checked 6776 * v === undefined 6777 * // if first radio is checked 6778 * v === ['C1'] 6779 * 6780 * The successful argument controls whether or not the field element must be 'successful' 6781 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). 6782 * The default value of the successful argument is true. If this value is false the value(s) 6783 * for each element is returned. 6784 * 6785 * Note: This method *always* returns an array. If no valid value can be determined the 6786 * array will be empty, otherwise it will contain one or more values. 6787 */ 6788 $.fn.fieldValue = function(successful) { 6789 for (var val = [], i = 0, max = this.length; i < max; i++) { 6790 var el = this[i]; 6791 var v = $.fieldValue(el, successful); 6792 6793 if (v === null || typeof v === 'undefined' || (v.constructor === Array && !v.length)) { 6794 continue; 6795 } 6796 6797 if (v.constructor === Array) { 6798 $.merge(val, v); 6799 } else { 6800 val.push(v); 6801 } 6802 } 6803 6804 return val; 6805 }; 6806 6807 /** 6808 * Returns the value of the field element. 6809 */ 6810 $.fieldValue = function(el, successful) { 6811 var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); 6812 6813 if (typeof successful === 'undefined') { 6814 successful = true; 6815 } 6816 6817 /* eslint-disable no-mixed-operators */ 6818 if (successful && (!n || el.disabled || t === 'reset' || t === 'button' || 6819 (t === 'checkbox' || t === 'radio') && !el.checked || 6820 (t === 'submit' || t === 'image') && el.form && el.form.clk !== el || 6821 tag === 'select' && el.selectedIndex === -1)) { 6822 /* eslint-enable no-mixed-operators */ 6823 return null; 6824 } 6825 6826 if (tag === 'select') { 6827 var index = el.selectedIndex; 6828 6829 if (index < 0) { 6830 return null; 6831 } 6832 6833 var a = [], ops = el.options; 6834 var one = (t === 'select-one'); 6835 var max = (one ? index + 1 : ops.length); 6836 6837 for (var i = (one ? index : 0); i < max; i++) { 6838 var op = ops[i]; 6839 6840 if (op.selected && !op.disabled) { 6841 var v = op.value; 6842 6843 if (!v) { // extra pain for IE... 6844 v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value; 6845 } 6846 6847 if (one) { 6848 return v; 6849 } 6850 6851 a.push(v); 6852 } 6853 } 6854 6855 return a; 6856 } 6857 6858 return $(el).val().replace(rCRLF, '\r\n'); 6859 }; 6860 6861 /** 6862 * Clears the form data. Takes the following actions on the form's input fields: 6863 * - input text fields will have their 'value' property set to the empty string 6864 * - select elements will have their 'selectedIndex' property set to -1 6865 * - checkbox and radio inputs will have their 'checked' property set to false 6866 * - inputs of type submit, button, reset, and hidden will *not* be effected 6867 * - button elements will *not* be effected 6868 */ 6869 $.fn.clearForm = function(includeHidden) { 6870 return this.each(function() { 6871 $('input,select,textarea', this).clearFields(includeHidden); 6872 }); 6873 }; 6874 6875 /** 6876 * Clears the selected form elements. 6877 */ 6878 $.fn.clearFields = $.fn.clearInputs = function(includeHidden) { 6879 var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list 6880 6881 return this.each(function() { 6882 var t = this.type, tag = this.tagName.toLowerCase(); 6883 6884 if (re.test(t) || tag === 'textarea') { 6885 this.value = ''; 6886 6887 } else if (t === 'checkbox' || t === 'radio') { 6888 this.checked = false;
6889 6890 } else if (tag === 'select') { 6891 this.selectedIndex = -1; 6892 6893 } else if (t === 'file') { 6894 if (/MSIE/.test(navigator.userAgent)) { 6895 $(this).replaceWith($(this).clone(true)); 6896 } else { 6897 $(this).val(''); 6898 } 6899 6900 } else if (includeHidden) { 6901 // includeHidden can be the value true, or it can be a selector string 6902 // indicating a special test; for example: 6903 // $('#myForm').clearForm('.special:hidden') 6904 // the above would clean hidden inputs that have the class of 'special' 6905 if ((includeHidden === true && /hidden/.test(t)) || 6906 (typeof includeHidden === 'string' && $(this).is(includeHidden))) { 6907 this.value = ''; 6908 } 6909 } 6910 }); 6911 }; 6912 6913 6914 /** 6915 * Resets the form data or individual elements. Takes the following actions 6916 * on the selected tags: 6917 * - all fields within form elements will be reset to their original value 6918 * - input / textarea / select fields will be reset to their original value 6919 * - option / optgroup fields (for multi-selects) will defaulted individually 6920 * - non-multiple options will find the right select to default 6921 * - label elements will be searched against its 'for' attribute 6922 * - all others will be searched for appropriate children to default 6923 */ 6924 $.fn.resetForm = function() { 6925 return this.each(function() { 6926 var el = $(this); 6927 var tag = this.tagName.toLowerCase(); 6928 6929 switch (tag) { 6930 case 'input': 6931 this.checked = this.defaultChecked; 6932 // fall through 6933 6934 case 'textarea': 6935 this.value = this.defaultValue; 6936 6937 return true; 6938 6939 case 'option': 6940 case 'optgroup': 6941 var select = el.parents('select'); 6942 6943 if (select.length && select[0].multiple) { 6944 if (tag === 'option') { 6945 this.selected = this.defaultSelected; 6946 } else { 6947 el.find('option').resetForm(); 6948 } 6949 } else { 6950 select.resetForm(); 6951 } 6952 6953 return true; 6954 6955 case 'select': 6956 el.find('option').each(function(i) { // eslint-disable-line consistent-return 6957 this.selected = this.defaultSelected; 6958 if (this.defaultSelected && !el[0].multiple) { 6959 el[0].selectedIndex = i; 6960 6961 return false; 6962 } 6963 }); 6964 6965 return true; 6966 6967 case 'label': 6968 var forEl = $(el.attr('for')); 6969 var list = el.find('input,select,textarea'); 6970 6971 if (forEl[0]) { 6972 list.unshift(forEl[0]); 6973 } 6974 6975 list.resetForm(); 6976 6977 return true; 6978 6979 case 'form': 6980 // guard against an input with the name of 'reset' 6981 // note that IE reports the reset function as an 'object' 6982 if (typeof this.reset === 'function' || (typeof this.reset === 'object' && !this.reset.nodeType)) { 6983 this.reset(); 6984 } 6985 6986 return true; 6987 6988 default: 6989 el.find('form,input,label,select,textarea').resetForm(); 6990 6991 return true; 6992 } 6993 }); 6994 }; 6995 6996 /** 6997 * Enables or disables any matching elements. 6998 */ 6999 $.fn.enable = function(b) { 7000 if (typeof b === 'undefined') { 7001 b = true; 7002 } 7003 7004 return this.each(function() { 7005 this.disabled = !b; 7006 }); 7007 }; 7008 7009 /** 7010 * Checks/unchecks any matching checkboxes or radio buttons and 7011 * selects/deselects and matching option elements. 7012 */ 7013 $.fn.selected = function(select) { 7014 if (typeof select === 'undefined') { 7015 select = true; 7016 } 7017 7018 return this.each(function() { 7019 var t = this.type; 7020 7021 if (t === 'checkbox' || t === 'radio') { 7022 this.checked = select; 7023 7024 } else if (this.tagName.toLowerCase() === 'option') { 7025 var $sel = $(this).parent('select'); 7026 7027 if (select && $sel[0] && $sel[0].type === 'select-one') { 7028 // deselect all other options 7029 $sel.find('option').selected(false); 7030 } 7031 7032 this.selected = select; 7033 } 7034 }); 7035 }; 7036 7037 // expose debug var 7038 $.fn.ajaxSubmit.debug = false; 7039 7040 // helper fn for console logging 7041 function log() { 7042 if (!$.fn.ajaxSubmit.debug) { 7043 return; 7044 } 7045 7046 var msg = '[jquery.form] ' + Array.prototype.join.call(arguments, ''); 7047 7048 if (window.console && window.console.log) { 7049 window.console.log(msg); 7050 7051 } else if (window.opera && window.opera.postError) { 7052 window.opera.postError(msg); 7053 } 7054 } 7055})); 7056 7057// Backbone.js 1.1.2 7058 7059// (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7060// Backbone may be freely distributed under the MIT license. 7061// For all details and documentation: 7062// http://backbonejs.org 7063 7064(function(root, factory) { 7065 7066 // Set up Backbone appropriately for the environment. Start with AMD. 7067 if (typeof define === 'function' && define.amd) { 7068 define('backbone',['underscore', 'jquery', 'exports'], function(_, $, exports
7068) { 7069 // Export global even in AMD case in case this script is loaded with 7070 // others that may still expect a global Backbone. 7071 root.Backbone = factory(root, exports, _, $); 7072 }); 7073 7074 // Next for Node.js or CommonJS. jQuery may not be needed as a module. 7075 } else if (typeof exports !== 'undefined') { 7076 var _ = require('underscore'); 7077 factory(root, exports, _); 7078 7079 // Finally, as a browser global. 7080 } else { 7081 root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$)); 7082 } 7083 7084}(this, function(root, Backbone, _, $) { 7085 7086 // Initial Setup 7087 // ------------- 7088 7089 // Save the previous value of the `Backbone` variable, so that it can be 7090 // restored later on, if `noConflict` is used. 7091 var previousBackbone = root.Backbone; 7092 7093 // Create local references to array methods we'll want to use later. 7094 var array = []; 7095 var push = array.push; 7096 var slice = array.slice; 7097 var splice = array.splice; 7098 7099 // Current version of the library. Keep in sync with `package.json`. 7100 Backbone.VERSION = '1.1.2'; 7101 7102 // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns 7103 // the `$` variable. 7104 Backbone.$ = $; 7105 7106 // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable 7107 // to its previous owner. Returns a reference to this Backbone object. 7108 Backbone.noConflict = function() { 7109 root.Backbone = previousBackbone; 7110 return this; 7111 }; 7112 7113 // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option 7114 // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and 7115 // set a `X-Http-Method-Override` header. 7116 Backbone.emulateHTTP = false;
7117 7118 // Turn on `emulateJSON` to support legacy servers that can't deal with direct 7119 // `application/json` requests ... will encode the body as 7120 // `application/x-www-form-urlencoded` instead and will send the model in a 7121 // form param named `model`. 7122 Backbone.emulateJSON = false; 7123 7124 // Backbone.Events 7125 // --------------- 7126 7127 // A module that can be mixed in to *any object* in order to provide it with 7128 // custom events. You may bind with `on` or remove with `off` callback 7129 // functions to an event; `trigger`-ing an event fires all callbacks in 7130 // succession. 7131 // 7132 // var object = {}; 7133 // _.extend(object, Backbone.Events); 7134 // object.on('expand', function(){ alert('expanded'); }); 7135 // object.trigger('expand'); 7136 // 7137 var Events = Backbone.Events = { 7138 7139 // Bind an event to a `callback` function. Passing `"all"` will bind 7140 // the callback to all events fired. 7141 on: function(name, callback, context) { 7142 if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; 7143 this._events || (this._events = {}); 7144 var events = this._events[name] || (this._events[name] = []); 7145 events.push({callback: callback, context: context, ctx: context || this}); 7146 return this; 7147 }, 7148 7149 // Bind an event to only be triggered a single time. After the first time 7150 // the callback is invoked, it will be removed. 7151 once: function(name, callback, context) { 7152 if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; 7153 var self = this; 7154 var once = _.once(function() { 7155 self.off(name, once); 7156 callback.apply(this, arguments); 7157 }); 7158 once._callback = callback; 7159 return this.on(name, once, context); 7160 }, 7161 7162 // Remove one or many callbacks. If `context` is null, removes all 7163 // callbacks with that function. If `callback` is null, removes all 7164 // callbacks for the event. If `name` is null, removes all bound 7165 // callbacks for all events. 7166 off: function(name, callback, context) { 7167 var retain, ev, events, names, i, l, j, k; 7168 if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; 7169 if (!name && !callback && !context) { 7170 this._events = void 0; 7171 return this; 7172 } 7173 names = name ? [name] : _.keys(this._events); 7174 for (i = 0, l = names.length; i < l; i++) { 7175 name = names[i]; 7176 if (events = this._events[name]) { 7177 this._events[name] = retain = []; 7178 if (callback || context) { 7179 for (j = 0, k = events.length; j < k; j++) { 7180 ev = events[j]; 7181 if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || 7182 (context && context !== ev.context)) { 7183 retain.push(ev); 7184 } 7185 } 7186 } 7187 if (!retain.length) delete this._events[name]; 7188 } 7189 } 7190 7191 return this; 7192 }, 7193 7194 // Trigger one or many events, firing all bound callbacks. Callbacks are 7195 // passed the same arguments as `trigger` is, apart from the event name 7196 // (unless you're listening on `"all"`, which will cause your callback to 7197 // receive the true name of the event as the first argument). 7198 trigger: function(name) { 7199 if (!this._events) return this; 7200 var args = slice.call(arguments, 1); 7201 if (!eventsApi(this, 'trigger', name, args)) return this; 7202 var events = this._events[name]; 7203 var allEvents = this._events.all; 7204 if (events) triggerEvents(events, args); 7205 if (allEvents) triggerEvents(allEvents, arguments); 7206 return this; 7207 }, 7208 7209 // Tell this object to stop listening to either specific events ... or 7210 // to every object it's currently listening to. 7211 stopListening: function(obj, name, callback) { 7212 var listeningTo = this._listeningTo; 7213 if (!listeningTo) return this; 7214 var remove = !name && !callback; 7215 if (!callback && typeof name === 'object') callback = this; 7216 if (obj) (listeningTo = {})[obj._listenId] = obj; 7217 for (var id in listeningTo) { 7218 obj = listeningTo[id]; 7219 obj.off(name, callback, this); 7220 if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id]; 7221 } 7222 return this; 7223 } 7224 7225 }; 7226 7227 // Regular expression used to split event strings. 7228 var eventSplitter = /\s+/; 7229 7230 // Implement fancy features of the Events API such as multiple event 7231 // names `"change blur"` and jQuery-style event maps `{change: action}` 7232 // in terms of the existing API. 7233 var eventsApi = function(obj, action, name, rest) { 7234 if (!name) return true; 7235 7236 // Handle event maps. 7237 if (typeof name === 'object') { 7238 for (var key in name) { 7239 obj[action].apply(obj, [key, name[key]].concat(rest)); 7240 } 7241 return false;
7242 } 7243 7244 // Handle space separated event names. 7245 if (eventSplitter.test(name)) { 7246 var names = name.split(eventSplitter); 7247 for (var i = 0, l = names.length; i < l; i++) { 7248 obj[action].apply(obj, [names[i]].concat(rest)); 7249 } 7250 return false; 7251 } 7252 7253 return true; 7254 }; 7255 7256 // A difficult-to-believe, but optimized internal dispatch function for 7257 // triggering events. Tries to keep the usual cases speedy (most internal 7258 // Backbone events have 3 arguments). 7259 var triggerEvents = function(events, args) { 7260 var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; 7261 switch (args.length) { 7262 case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; 7263 case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; 7264 case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; 7265 case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; 7266 default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; 7267 } 7268 }; 7269 7270 var listenMethods = {listenTo: 'on', listenToOnce: 'once'}; 7271 7272 // Inversion-of-control versions of `on` and `once`. Tell *this* object to 7273 // listen to an event in another object ... keeping track of what it's 7274 // listening to. 7275 _.each(listenMethods, function(implementation, method) { 7276 Events[method] = function(obj, name, callback) { 7277 var listeningTo = this._listeningTo || (this._listeningTo = {}); 7278 var id = obj._listenId || (obj._listenId = _.uniqueId('l')); 7279 listeningTo[id] = obj; 7280 if (!callback && typeof name === 'object') callback = this; 7281 obj[implementation](name, callback, this); 7282 return this; 7283 }; 7284 }); 7285 7286 // Aliases for backwards compatibility. 7287 Events.bind = Events.on; 7288 Events.unbind = Events.off; 7289 7290 // Allow the `Backbone` object to serve as a global event bus, for folks who 7291 // want global "pubsub" in a convenient place. 7292 _.extend(Backbone, Events); 7293 7294 // Backbone.Model 7295 // -------------- 7296 7297 // Backbone **Models** are the basic data object in the framework -- 7298 // frequently representing a row in a table in a database on your server. 7299 // A discrete chunk of data and a bunch of useful, related methods for 7300 // performing computations and transformations on that data. 7301 7302 // Create a new model with the specified attributes. A client id (`cid`) 7303 // is automatically generated and assigned for you. 7304 var Model = Backbone.Model = function(attributes, options) { 7305 var attrs = attributes || {}; 7306 options || (options = {}); 7307 this.cid = _.uniqueId('c'); 7308 this.attributes = {}; 7309 if (options.collection) this.collection = options.collection; 7310 if (options.parse) attrs = this.parse(attrs, options) || {}; 7311 attrs = _.defaults({}, attrs, _.result(this, 'defaults')); 7312 this.set(attrs, options); 7313 this.changed = {}; 7314 this.initialize.apply(this, arguments); 7315 }; 7316 7317 // Attach all inheritable methods to the Model prototype. 7318 _.extend(Model.prototype, Events, { 7319 7320 // A hash of attributes whose current and previous value differ. 7321 changed: null, 7322 7323 // The value returned during the last failed validation. 7324 validationError: null, 7325 7326 // The default name for the JSON `id` attribute is `"id"`. MongoDB and 7327 // CouchDB users may want to set this to `"_id"`. 7328 idAttribute: 'id', 7329 7330 // Initialize is an empty function by default. Override it with your own 7331 // initialization logic. 7332 initialize: function(){}, 7333 7334 // Return a copy of the model's `attributes` object. 7335 toJSON: function(options) { 7336 return _.clone(this.attributes); 7337 }, 7338 7339 // Proxy `Backbone.sync` by default -- but override this if you need 7340 // custom syncing semantics for *this* particular model. 7341 sync: function() { 7342 return Backbone.sync.apply(this, arguments); 7343 }, 7344 7345 // Get the value of an attribute. 7346 get: function(attr) { 7347 return this.attributes[attr]; 7348 }, 7349 7350 // Get the HTML-escaped value of an attribute. 7351 escape: function(attr) { 7352 return _.escape(this.get(attr)); 7353 }, 7354 7355 // Returns `true` if the attribute contains a value that is not null 7356 // or undefined. 7357 has: function(attr) { 7358 return this.get(attr) != null; 7359 }, 7360 7361 // Set a hash of model attributes on the object, firing `"change"`. This is 7362 // the core primitive operation of a model, updating the data and notifying 7363 // anyone who needs to know about the change in state. The heart of the beast. 7364 set: function(key, val, options) { 7365 var attr, attrs, unset, changes, silent, changing, prev, current; 7366 if (key == null) return this; 7367 7368 // Handle both `"key", value` and `{key: value}` -style arguments. 7369 if (typeof key === 'object') { 7370 attrs = key; 7371 options = val; 7372 } else { 7373 (attrs = {})[key] = val; 7374 } 7375
7376 options || (options = {}); 7377 7378 // Run validation. 7379 if (!this._validate(attrs, options)) return false; 7380 7381 // Extract attributes and options. 7382 unset = options.unset; 7383 silent = options.silent; 7384 changes = []; 7385 changing = this._changing; 7386 this._changing = true; 7387 7388 if (!changing) { 7389 this._previousAttributes = _.clone(this.attributes); 7390 this.changed = {}; 7391 } 7392 current = this.attributes, prev = this._previousAttributes; 7393 7394 // Check for changes of `id`. 7395 if (this.idAttribute in attrs) this.id = attrs[this.idAttribute]; 7396 7397 // For each `set` attribute, update or delete the current value. 7398 for (attr in attrs) { 7399 val = attrs[attr]; 7400 if (!_.isEqual(current[attr], val)) changes.push(attr); 7401 if (!_.isEqual(prev[attr], val)) { 7402 this.changed[attr] = val; 7403 } else { 7404 delete this.changed[attr]; 7405 } 7406 unset ? delete current[attr] : current[attr] = val; 7407 } 7408 7409 // Trigger all relevant attribute changes. 7410 if (!silent) { 7411 if (changes.length) this._pending = options; 7412 for (var i = 0, l = changes.length; i < l; i++) { 7413 this.trigger('change:' + changes[i], this, current[changes[i]], options); 7414 } 7415 } 7416 7417 // You might be wondering why there's a `while` loop here. Changes can 7418 // be recursively nested within `"change"` events. 7419 if (changing) return this; 7420 if (!silent) { 7421 while (this._pending) { 7422 options = this._pending; 7423 this._pending = false; 7424 this.trigger('change', this, options); 7425 } 7426 } 7427 this._pending = false; 7428 this._changing = false; 7429 return this; 7430 }, 7431 7432 // Remove an attribute from the model, firing `"change"`. `unset` is a noop 7433 // if the attribute doesn't exist. 7434 unset: function(attr, options) { 7435 return this.set(attr, void 0, _.extend({}, options, {unset: true})); 7436 }, 7437 7438 // Clear all attributes on the model, firing `"change"`. 7439 clear: function(options) { 7440 var attrs = {}; 7441 for (var key in this.attributes) attrs[key] = void 0; 7442 return this.set(attrs, _.extend({}, options, {unset: true})); 7443 }, 7444 7445 // Determine if the model has changed since the last `"change"` event. 7446 // If you specify an attribute name, determine if that attribute has changed. 7447 hasChanged: function(attr) { 7448 if (attr == null) return !_.isEmpty(this.changed); 7449 return _.has(this.changed, attr); 7450 }, 7451
7452 // Return an object containing all the attributes that have changed, or 7453 // false if there are no changed attributes. Useful for determining what 7454 // parts of a view need to be updated and/or what attributes need to be 7455 // persisted to the server. Unset attributes will be set to undefined. 7456 // You can also pass an attributes object to diff against the model, 7457 // determining if there *would be* a change. 7458 changedAttributes: function(diff) { 7459 if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; 7460 var val, changed = false; 7461 var old = this._changing ? this._previousAttributes : this.attributes; 7462 for (var attr in diff) { 7463 if (_.isEqual(old[attr], (val = diff[attr]))) continue; 7464 (changed || (changed = {}))[attr] = val; 7465 } 7466 return changed; 7467 }, 7468 7469 // Get the previous value of an attribute, recorded at the time the last 7470 // `"change"` event was fired. 7471 previous: function(attr) { 7472 if (attr == null || !this._previousAttributes) return null; 7473 return this._previousAttributes[attr]; 7474 }, 7475 7476 // Get all of the attributes of the model at the time of the previous 7477 // `"change"` event. 7478 previousAttributes: function() { 7479 return _.clone(this._previousAttributes); 7480 }, 7481 7482 // Fetch the model from the server. If the server's representation of the 7483 // model differs from its current attributes, they will be overridden, 7484 // triggering a `"change"` event. 7485 fetch: function(options) { 7486 options = options ? _.clone(options) : {}; 7487 if (options.parse === void 0) options.parse = true; 7488 var model = this; 7489 var success = options.success; 7490 options.success = function(resp) { 7491 if (!model.set(model.parse(resp, options), options)) return false; 7492 if (success) success(model, resp, options); 7493 model.trigger('sync', model, resp, options); 7494 }; 7495 wrapError(this, options); 7496 return this.sync('read', this, options); 7497 }, 7498 7499 // Set a hash of model attributes, and sync the model to the server. 7500 // If the server returns an attributes hash that differs, the model's 7501 // state will be `set` again. 7502 save: function(key, val, options) { 7503 var attrs, method, xhr, attributes = this.attributes; 7504 7505 // Handle both `"key", value` and `{key: value}` -style arguments. 7506 if (key == null || typeof key === 'object') { 7507 attrs = key; 7508 options = val; 7509 } else { 7510 (attrs = {})[key] = val; 7511 } 7512 7513 options = _.extend({validate: true}, options); 7514 7515 // If we're not waiting and attributes exist, save acts as 7516 // `set(attr).save(null, opts)` with validation. Otherwise, check if 7517 // the model will be valid when the attributes, if any, are set. 7518 if (attrs && !options.wait) { 7519 if (!this.set(attrs, options)) return false; 7520 } else { 7521 if (!this._validate(attrs, options)) return false; 7522 } 7523 7524 // Set temporary attributes if `{wait: true}`. 7525 if (attrs && options.wait) { 7526 this.attributes = _.extend({}, attributes, attrs); 7527 } 7528 7529 // After a successful server-side save, the client is (optionally) 7530 // updated with the server-side state. 7531 if (options.parse === void 0) options.parse = true; 7532 var model = this; 7533 var success = options.success; 7534 options.success = function(resp) { 7535 // Ensure attributes are restored during synchronous saves. 7536 model.attributes = attributes; 7537 var serverAttrs = model.parse(resp, options); 7538 if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs); 7539 if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) { 7540 return false; 7541 } 7542 if (success) success(model, resp, options); 7543 model.trigger('sync', model, resp, options); 7544 }; 7545 wrapError(this, options); 7546 7547 method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update'); 7548 if (method === 'patch') options.attrs = attrs; 7549 xhr = this.sync(method, this, options); 7550 7551 // Restore attributes. 7552 if (attrs && options.wait) this.attributes = attributes; 7553 7554 return xhr; 7555 }, 7556 7557 // Destroy this model on the server if it was already persisted. 7558 // Optimistically removes the model from its collection, if it has one. 7559 // If `wait: true` is passed, waits for the server to respond before removal. 7560 destroy: function(options) { 7561 options = options ? _.clone(options) : {}; 7562 var model = this; 7563 var success = options.success; 7564 7565 var destroy = function() { 7566 model.trigger('destroy', model, model.collection, options); 7567 }; 7568 7569 options.success = function(resp) { 7570 if (options.wait || model.isNew()) destroy(); 7571 if (success) success(model, resp, options); 7572 if (!model.isNew()) model.trigger('sync', model, resp, options); 7573 }; 7574 7575 if (this.isNew()) { 7576 options.success(); 7577 return false;
7578 } 7579 wrapError(this, options); 7580 7581 var xhr = this.sync('delete', this, options); 7582 if (!options.wait) destroy(); 7583 return xhr; 7584 }, 7585 7586 // Default URL for the model's representation on the server -- if you're 7587 // using Backbone's restful methods, override this to change the endpoint 7588 // that will be called. 7589 url: function() { 7590 var base = 7591 _.result(this, 'urlRoot') || 7592 _.result(this.collection, 'url') || 7593 urlError(); 7594 if (this.isNew()) return base; 7595 return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(this.id); 7596 }, 7597 7598 // **parse** converts a response into the hash of attributes to be `set` on 7599 // the model. The default implementation is just to pass the response along. 7600 parse: function(resp, options) { 7601 return resp; 7602 }, 7603 7604 // Create a new model with identical attributes to this one. 7605 clone: function() { 7606 return new this.constructor(this.attributes); 7607 }, 7608 7609 // A model is new if it has never been saved to the server, and lacks an id. 7610 isNew: function() { 7611 return !this.has(this.idAttribute); 7612 }, 7613 7614 // Check if the model is currently in a valid state. 7615 isValid: function(options) { 7616 return this._validate({}, _.extend(options || {}, { validate: true })); 7617 }, 7618 7619 // Run validation against the next complete set of model attributes, 7620 // returning `true` if all is well. Otherwise, fire an `"invalid"` event. 7621 _validate: function(attrs, options) { 7622 if (!options.validate || !this.validate) return true; 7623 attrs = _.extend({}, this.attributes, attrs); 7624 var error = this.validationError = this.validate(attrs, options) || null; 7625 if (!error) return true; 7626 this.trigger('invalid', this, error, _.extend(options, {validationError: error})); 7627 return false; 7628 } 7629 7630 }); 7631 7632 // Underscore methods that we want to implement on the Model. 7633 var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit']; 7634 7635 // Mix in each Underscore method as a proxy to `Model#attributes`. 7636 _.each(modelMethods, function(method) { 7637 Model.prototype[method] = function() { 7638 var args = slice.call(arguments); 7639 args.unshift(this.attributes); 7640 return _[method].apply(_, args); 7641 }; 7642 }); 7643 7644 // Backbone.Collection 7645 // ------------------- 7646 7647 // If models tend to represent a single row of data, a Backbone Collection is 7648 // more analagous to a table full of data ... or a small slice or page of that 7649 // table, or a collection of rows that belong together for a particular reason 7650 // -- all of the messages in this particular folder, all of the documents
7651 // belonging to this particular author, and so on. Collections maintain 7652 // indexes of their models, both in order, and for lookup by `id`. 7653 7654 // Create a new **Collection**, perhaps to contain a specific type of `model`. 7655 // If a `comparator` is specified, the Collection will maintain 7656 // its models in sort order, as they're added and removed. 7657 var Collection = Backbone.Collection = function(models, options) { 7658 options || (options = {}); 7659 if (options.model) this.model = options.model; 7660 if (options.comparator !== void 0) this.comparator = options.comparator; 7661 this._reset(); 7662 this.initialize.apply(this, arguments); 7663 if (models) this.reset(models, _.extend({silent: true}, options)); 7664 }; 7665 7666 // Default options for `Collection#set`. 7667 var setOptions = {add: true, remove: true, merge: true}; 7668 var addOptions = {add: true, remove: false}; 7669 7670 // Define the Collection's inheritable methods. 7671 _.extend(Collection.prototype, Events, { 7672 7673 // The default model for a collection is just a **Backbone.Model**. 7674 // This should be overridden in most cases. 7675 model: Model, 7676 7677 // Initialize is an empty function by default. Override it with your own 7678 // initialization logic. 7679 initialize: function(){}, 7680 7681 // The JSON representation of a Collection is an array of the 7682 // models' attributes. 7683 toJSON: function(options) { 7684 return this.map(function(model){ return model.toJSON(options); }); 7685 }, 7686 7687 // Proxy `Backbone.sync` by default. 7688 sync: function() { 7689 return Backbone.sync.apply(this, arguments); 7690 }, 7691 7692 // Add a model, or list of models to the set. 7693 add: function(models, options) { 7694 return this.set(models, _.extend({merge: false}, options, addOptions)); 7695 }, 7696 7697 // Remove a model, or a list of models from the set. 7698 remove: function(models, options) { 7699 var singular = !_.isArray(models); 7700 models = singular ? [models] : _.clone(models); 7701 options || (options = {}); 7702 var i, l, index, model; 7703 for (i = 0, l = models.length; i < l; i++) { 7704 model = models[i] = this.get(models[i]); 7705 if (!model) continue; 7706 delete this._byId[model.id]; 7707 delete this._byId[model.cid]; 7708 index = this.indexOf(model); 7709 this.models.splice(index, 1); 7710 this.length--; 7711 if (!options.silent) { 7712 options.index = index; 7713 model.trigger('remove', model, this, options); 7714 } 7715 this._removeReference(model, options); 7716 } 7717 return singular ? models[0] : models; 7718 }, 7719 7720 // Update a collection by `set`-ing a new list of models, adding new ones, 7721 // removing models that are no longer present, and merging models that 7722 // already exist in the collection, as necessary. Similar to **Model#set**, 7723 // the core operation for updating the data contained by the collection. 7724 set: function(models, options) { 7725 options = _.defaults({}, options, setOptions); 7726 if (options.parse) models = this.parse(models, options); 7727 var singular = !_.isArray(models); 7728 models = singular ? (models ? [models] : []) : _.clone(models); 7729 var i, l, id, model, attrs, existing, sort; 7730 var at = options.at; 7731 var targetModel = this.model; 7732 var sortable = this.comparator && (at == null) && options.sort !== false; 7733 var sortAttr = _.isString(this.comparator) ? this.comparator : null; 7734 var toAdd = [], toRemove = [], modelMap = {}; 7735 var add = options.add, merge = options.merge, remove = options.remove; 7736 var order = !sortable && add && remove ? [] : false; 7737 7738 // Turn bare objects into model references, and prevent invalid models 7739 // from being added. 7740 for (i = 0, l = models.length; i < l; i++) { 7741 attrs = models[i] || {}; 7742 if (attrs instanceof Model) { 7743 id = model = attrs; 7744 } else { 7745 id = attrs[targetModel.prototype.idAttribute || 'id']; 7746 } 7747 7748 // If a duplicate is found, prevent it from being added and 7749 // optionally merge it into the existing model. 7750 if (existing = this.get(id)) { 7751 if (remove) modelMap[existing.cid] = true; 7752 if (merge) { 7753 attrs = attrs === model ? model.attributes : attrs; 7754 if (options.parse) attrs = existing.parse(attrs, options); 7755 existing.set(attrs, options); 7756 if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true; 7757 } 7758 models[i] = existing; 7759 7760 // If this is a new, valid model, push it to the `toAdd` list. 7761 } else if (add) { 7762 model = models[i] = this._prepareModel(attrs, options); 7763 if (!model) continue; 7764 toAdd.push(model); 7765 this._addReference(model, options); 7766 } 7767
7768 // Do not add multiple models with the same `id`. 7769 model = existing || model; 7770 if (order && (model.isNew() || !modelMap[model.id])) order.push(model); 7771 modelMap[model.id] = true; 7772 } 7773 7774 // Remove nonexistent models if appropriate. 7775 if (remove) { 7776 for (i = 0, l = this.length; i < l; ++i) { 7777 if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model); 7778 } 7779 if (toRemove.length) this.remove(toRemove, options); 7780 } 7781 7782 // See if sorting is needed, update `length` and splice in new models. 7783 if (toAdd.length || (order && order.length)) { 7784 if (sortable) sort = true; 7785 this.length += toAdd.length; 7786 if (at != null) { 7787 for (i = 0, l = toAdd.length; i < l; i++) { 7788 this.models.splice(at + i, 0, toAdd[i]); 7789 } 7790 } else { 7791 if (order) this.models.length = 0; 7792 var orderedModels = order || toAdd; 7793 for (i = 0, l = orderedModels.length; i < l; i++) { 7794 this.models.push(orderedModels[i]); 7795 } 7796 } 7797 } 7798 7799 // Silently sort the collection if appropriate. 7800 if (sort) this.sort({silent: true}); 7801 7802 // Unless silenced, it's time to fire all appropriate add/sort events. 7803 if (!options.silent) { 7804 for (i = 0, l = toAdd.length; i < l; i++) { 7805 (model = toAdd[i]).trigger('add', model, this, options); 7806 } 7807 if (sort || (order && order.length)) this.trigger('sort', this, options); 7808 } 7809 7810 // Return the added (or merged) model (or models). 7811 return singular ? models[0] : models; 7812 }, 7813 7814 // When you have more items than you want to add or remove individually, 7815 // you can reset the entire set with a new list of models, without firing 7816 // any granular `add` or `remove` events. Fires `reset` when finished. 7817 // Useful for bulk operations and optimizations. 7818 reset: function(models, options) { 7819 options || (options = {}); 7820 for (var i = 0, l = this.models.length; i < l; i++) { 7821 this._removeReference(this.models[i], options); 7822 } 7823 options.previousModels = this.models; 7824 this._reset(); 7825 models = this.add(models, _.extend({silent: true}, options)); 7826 if (!options.silent) this.trigger('reset', this, options); 7827 return models; 7828 }, 7829 7830 // Add a model to the end of the collection. 7831 push: function(model, options) { 7832 return this.add(model, _.extend({at: this.length}, options)); 7833 }, 7834 7835 // Remove a model from the end of the collection. 7836 pop: function(options) { 7837 var model = this.at(this.length - 1); 7838 this.remove(model, options); 7839 return model; 7840 }, 7841 7842 // Add a model to the beginning of the collection. 7843 unshift: function(model, options) { 7844 return this.add(model, _.extend({at: 0}, options)); 7845 }, 7846 7847 // Remove a model from the beginning of the collection. 7848 shift: function(options) { 7849 var model = this.at(0); 7850 this.remove(model, options); 7851 return model; 7852 }, 7853 7854 // Slice out a sub-array of models from the collection. 7855 slice: function() { 7856 return slice.apply(this.models, arguments); 7857 }, 7858 7859 // Get a model from the set by id. 7860 get: function(obj) { 7861 if (obj == null) return void 0; 7862 return this._byId[obj] || this._byId[obj.id] || this._byId[obj.cid]; 7863 }, 7864 7865 // Get the model at the given index. 7866 at: function(index) { 7867 return this.models[index]; 7868 }, 7869 7870 // Return models with matching attributes. Useful for simple cases of 7871 // `filter`. 7872 where: function(attrs, first) { 7873 if (_.isEmpty(attrs)) return first ? void 0 : []; 7874 return this[first ? 'find' : 'filter'](function(model) { 7875 for (var key in attrs) { 7876 if (attrs[key] !== model.get(key)) return false; 7877 } 7878 return true; 7879 }); 7880 }, 7881 7882 // Return the first model with matching attributes. Useful for simple cases 7883 // of `find`. 7884 findWhere: function(attrs) { 7885 return this.where(attrs, true); 7886 }, 7887 7888 // Force the collection to re-sort itself. You don't need to call this under 7889 // normal circumstances, as the set will maintain sort order as each item 7890 // is added. 7891 sort: function(options) { 7892 if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
7893 options || (options = {}); 7894 7895 // Run sort based on type of `comparator`. 7896 if (_.isString(this.comparator) || this.comparator.length === 1) { 7897 this.models = this.sortBy(this.comparator, this); 7898 } else { 7899 this.models.sort(_.bind(this.comparator, this)); 7900 } 7901 7902 if (!options.silent) this.trigger('sort', this, options); 7903 return this; 7904 }, 7905 7906 // Pluck an attribute from each model in the collection. 7907 pluck: function(attr) { 7908 return _.invoke(this.models, 'get', attr); 7909 }, 7910 7911 // Fetch the default set of models for this collection, resetting the 7912 // collection when they arrive. If `reset: true` is passed, the response 7913 // data will be passed through the `reset` method instead of `set`. 7914 fetch: function(options) { 7915 options = options ? _.clone(options) : {}; 7916 if (options.parse === void 0) options.parse = true; 7917 var success = options.success; 7918 var collection = this; 7919 options.success = function(resp) { 7920 var method = options.reset ? 'reset' : 'set'; 7921 collection[method](resp, options); 7922 if (success) success(collection, resp, options); 7923 collection.trigger('sync', collection, resp, options); 7924 }; 7925 wrapError(this, options); 7926 return this.sync('read', this, options); 7927 }, 7928 7929 // Create a new instance of a model in this collection. Add the model to the 7930 // collection immediately, unless `wait: true` is passed, in which case we 7931 // wait for the server to agree. 7932 create: function(model, options) { 7933 options = options ? _.clone(options) : {}; 7934 if (!(model = this._prepareModel(model, options))) return false; 7935 if (!options.wait) this.add(model, options); 7936 var collection = this; 7937 var success = options.success; 7938 options.success = function(model, resp) { 7939 if (options.wait) collection.add(model, options); 7940 if (success) success(model, resp, options); 7941 }; 7942 model.save(null, options); 7943 return model; 7944 }, 7945 7946 // **parse** converts a response into a list of models to be added to the 7947 // collection. The default implementation is just to pass it through. 7948 parse: function(resp, options) { 7949 return resp; 7950 }, 7951 7952 // Create a new collection with an identical list of models as this one. 7953 clone: function() { 7954 return new this.constructor(this.models); 7955 }, 7956 7957 // Private method to reset all internal state. Called when the collection 7958 // is first initialized or reset. 7959 _reset: function() { 7960 this.length = 0; 7961 this.models = []; 7962 this._byId = {}; 7963 }, 7964 7965 // Prepare a hash of attributes (or other model) to be added to this 7966 // collection. 7967 _prepareModel: function(attrs, options) { 7968 if (attrs instanceof Model) return attrs; 7969 options = options ? _.clone(options) : {}; 7970 options.collection = this; 7971 var model = new this.model(attrs, options); 7972 if (!model.validationError) return model; 7973 this.trigger('invalid', this, model.validationError, options); 7974 return false; 7975 }, 7976 7977 // Internal method to create a model's ties to a collection. 7978 _addReference: function(model, options) { 7979 this._byId[model.cid] = model; 7980 if (model.id != null) this._byId[model.id] = model; 7981 if (!model.collection) model.collection = this; 7982 model.on('all', this._onModelEvent, this); 7983 }, 7984 7985 // Internal method to sever a model's ties to a collection. 7986 _removeReference: function(model, options) { 7987 if (this === model.collection) delete model.collection; 7988 model.off('all', this._onModelEvent, this); 7989 }, 7990 7991 // Internal method called every time a model in the set fires an event. 7992 // Sets need to update their indexes when models change ids. All other 7993 // events simply proxy through. "add" and "remove" events that originate 7994 // in other collections are ignored. 7995 _onModelEvent: function(event, model, collection, options) { 7996 if ((event === 'add' || event === 'remove') && collection !== this) return; 7997 if (event === 'destroy') this.remove(model, options); 7998 if (model && event === 'change:' + model.idAttribute) { 7999 delete this._byId[model.previous(model.idAttribute)]; 8000 if (model.id != null) this._byId[model.id] = model; 8001 } 8002 this.trigger.apply(this, arguments); 8003 } 8004 8005 }); 8006 8007 // Underscore methods that we want to implement on the Collection. 8008 // 90% of the core usefulness of Backbone Collections is actually implemented 8009 // right here: 8010 var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl', 8011 'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select', 8012 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke', 8013 'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest', 8014 'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle', 8015 'lastIndexOf', 'isEmpty', 'chain', 'sample']; 8016
8017 // Mix in each Underscore method as a proxy to `Collection#models`. 8018 _.each(methods, function(method) { 8019 Collection.prototype[method] = function() { 8020 var args = slice.call(arguments); 8021 args.unshift(this.models); 8022 return _[method].apply(_, args); 8023 }; 8024 }); 8025 8026 // Underscore methods that take a property name as an argument. 8027 var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy']; 8028 8029 // Use attributes instead of properties. 8030 _.each(attributeMethods, function(method) { 8031 Collection.prototype[method] = function(value, context) { 8032 var iterator = _.isFunction(value) ? value : function(model) { 8033 return model.get(value); 8034 }; 8035 return _[method](this.models, iterator, context); 8036 }; 8037 }); 8038 8039 // Backbone.View 8040 // ------------- 8041 8042 // Backbone Views are almost more convention than they are actual code. A View 8043 // is simply a JavaScript object that represents a logical chunk of UI in the 8044 // DOM. This might be a single item, an entire list, a sidebar or panel, or 8045 // even the surrounding frame which wraps your whole app. Defining a chunk of 8046 // UI as a **View** allows you to define your DOM events declaratively, without 8047 // having to worry about render order ... and makes it easy for the view to 8048 // react to specific changes in the state of your models. 8049 8050 // Creating a Backbone.View creates its initial element outside of the DOM, 8051 // if an existing element is not provided... 8052 var View = Backbone.View = function(options) { 8053 this.cid = _.uniqueId('view'); 8054 options || (options = {}); 8055 _.extend(this, _.pick(options, viewOptions)); 8056 this._ensureElement(); 8057 this.initialize.apply(this, arguments); 8058 this.delegateEvents(); 8059 }; 8060 8061 // Cached regex to split keys for `delegate`. 8062 var delegateEventSplitter = /^(\S+)\s*(.*)$/; 8063 8064 // List of view options to be merged as properties. 8065 var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; 8066 8067 // Set up all inheritable **Backbone.View** properties and methods. 8068 _.extend(View.prototype, Events, { 8069 8070 // The default `tagName` of a View's element is `"div"`. 8071 tagName: 'div', 8072 8073 // jQuery delegate for element lookup, scoped to DOM elements within the 8074 // current view. This should be preferred to global lookups where possible. 8075 $: function(selector) { 8076 return this.$el.find(selector); 8077 }, 8078 8079 // Initialize is an empty function by default. Override it with your own 8080 // initialization logic. 8081 initialize: function(){}, 8082 8083 // **render** is the core function that your view should override, in order 8084 // to populate its element (`this.el`), with the appropriate HTML. The 8085 // convention is for **render** to always return `this`. 8086 render: function() { 8087 return this; 8088 }, 8089 8090 // Remove this view by taking the element out of the DOM, and removing any 8091 // applicable Backbone.Events listeners. 8092 remove: function() { 8093 this.$el.remove(); 8094 this.stopListening(); 8095 return this; 8096 }, 8097 8098 // Change the view's element (`this.el` property), including event 8099 // re-delegation. 8100 setElement: function(element, delegate) { 8101 if (this.$el) this.undelegateEvents(); 8102 this.$el = element instanceof Backbone.$ ? element : Backbone.$(element); 8103 this.el = this.$el[0]; 8104 if (delegate !== false) this.delegateEvents(); 8105 return this; 8106 }, 8107 8108 // Set callbacks, where `this.events` is a hash of 8109 // 8110 // *{"event selector": "callback"}* 8111 // 8112 // { 8113 // 'mousedown .title': 'edit', 8114 // 'click .button': 'save', 8115 // 'click .open': function(e) { ... } 8116 // } 8117 // 8118 // pairs. Callbacks will be bound to the view, with `this` set properly. 8119 // Uses event delegation for efficiency. 8120 // Omitting the selector binds the event to `this.el`. 8121 // This only works for delegate-able events: not `focus`, `blur`, and 8122 // not `change`, `submit`, and `reset` in Internet Explorer. 8123 delegateEvents: function(events) { 8124 if (!(events || (events = _.result(this, 'events')))) return this; 8125 this.undelegateEvents(); 8126 for (var key in events) { 8127 var method = events[key]; 8128 if (!_.isFunction(method)) method = this[events[key]];
8129 if (!method) continue; 8130 8131 var match = key.match(delegateEventSplitter); 8132 var eventName = match[1], selector = match[2]; 8133 method = _.bind(method, this); 8134 eventName += '.delegateEvents' + this.cid; 8135 if (selector === '') { 8136 this.$el.on(eventName, method); 8137 } else { 8138 this.$el.on(eventName, selector, method); 8139 } 8140 } 8141 return this; 8142 }, 8143 8144 // Clears all callbacks previously bound to the view with `delegateEvents`. 8145 // You usually don't need to use this, but may wish to if you have multiple 8146 // Backbone views attached to the same DOM element. 8147 undelegateEvents: function() { 8148 this.$el.off('.delegateEvents' + this.cid); 8149 return this; 8150 }, 8151 8152 // Ensure that the View has a DOM element to render into. 8153 // If `this.el` is a string, pass it through `$()`, take the first 8154 // matching element, and re-assign it to `el`. Otherwise, create 8155 // an element from the `id`, `className` and `tagName` properties. 8156 _ensureElement: function() { 8157 if (!this.el) { 8158 var attrs = _.extend({}, _.result(this, 'attributes')); 8159 if (this.id) attrs.id = _.result(this, 'id'); 8160 if (this.className) attrs['class'] = _.result(this, 'className'); 8161 var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs); 8162 this.setElement($el, false); 8163 } else { 8164 this.setElement(_.result(this, 'el'), false); 8165 } 8166 } 8167 8168 }); 8169 8170 // Backbone.sync 8171 // ------------- 8172 8173 // Override this function to change the manner in which Backbone persists 8174 // models to the server. You will be passed the type of request, and the 8175 // model in question. By default, makes a RESTful Ajax request 8176 // to the model's `url()`. Some possible customizations could be: 8177 // 8178 // * Use `setTimeout` to batch rapid-fire updates into a single request. 8179 // * Send up the models as XML instead of JSON. 8180 // * Persist models via WebSockets instead of Ajax. 8181 // 8182 // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests 8183 // as `POST`, with a `_method` parameter containing the true HTTP method, 8184 // as well as all requests with the body as `application/x-www-form-urlencoded` 8185 // instead of `application/json` with the model in a param named `model`. 8186 // Useful when interfacing with server-side languages like **PHP** that make 8187 // it difficult to read the body of `PUT` requests. 8188 Backbone.sync = function(method, model, options) { 8189 var type = methodMap[method]; 8190 8191 // Default options, unless specified. 8192 _.defaults(options || (options = {}), { 8193 emulateHTTP: Backbone.emulateHTTP, 8194 emulateJSON: Backbone.emulateJSON 8195 }); 8196 8197 // Default JSON-request options. 8198 var params = {type: type, dataType: 'json'}; 8199 8200 // Ensure that we have a URL. 8201 if (!options.url) { 8202 params.url = _.result(model, 'url') || urlError(); 8203 } 8204 8205 // Ensure that we have the appropriate request data. 8206 if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { 8207 params.contentType = 'application/json'; 8208 params.data = JSON.stringify(options.attrs || model.toJSON(options)); 8209 } 8210 8211 // For older servers, emulate JSON by encoding the request into an HTML-form. 8212 if (options.emulateJSON) { 8213 params.contentType = 'application/x-www-form-urlencoded'; 8214 params.data = params.data ? {model: params.data} : {}; 8215 } 8216 8217 // For older servers, emulate HTTP by mimicking the HTTP method with `_method` 8218 // And an `X-HTTP-Method-Override` header. 8219 if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { 8220 params.type = 'POST'; 8221 if (options.emulateJSON) params.data._method = type; 8222 var beforeSend = options.beforeSend; 8223 options.beforeSend = function(xhr) { 8224 xhr.setRequestHeader('X-HTTP-Method-Override', type); 8225 if (beforeSend) return beforeSend.apply(this, arguments); 8226 }; 8227 } 8228 8229 // Don't process data on a non-GET request. 8230 if (params.type !== 'GET' && !options.emulateJSON) { 8231 params.processData = false;
8232 } 8233 8234 // If we're sending a `PATCH` request, and we're in an old Internet Explorer 8235 // that still has ActiveX enabled by default, override jQuery to use that 8236 // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8. 8237 if (params.type === 'PATCH' && noXhrPatch) { 8238 params.xhr = function() { 8239 return new ActiveXObject("Microsoft.XMLHTTP"); 8240 }; 8241 } 8242 8243 // Make the request, allowing the user to override any Ajax options. 8244 var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); 8245 model.trigger('request', model, xhr, options); 8246 return xhr; 8247 }; 8248 8249 var noXhrPatch = 8250 typeof window !== 'undefined' && !!window.ActiveXObject && 8251 !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent); 8252 8253 // Map from CRUD to HTTP for our default `Backbone.sync` implementation. 8254 var methodMap = { 8255 'create': 'POST', 8256 'update': 'PUT', 8257 'patch': 'PATCH', 8258 'delete': 'DELETE', 8259 'read': 'GET' 8260 }; 8261 8262 // Set the default implementation of `Backbone.ajax` to proxy through to `$`. 8263 // Override this if you'd like to use a different library. 8264 Backbone.ajax = function() { 8265 return Backbone.$.ajax.apply(Backbone.$, arguments); 8266 }; 8267 8268 // Backbone.Router 8269 // --------------- 8270 8271 // Routers map faux-URLs to actions, and fire events when routes are 8272 // matched. Creating a new one sets its `routes` hash, if not set statically. 8273 var Router = Backbone.Router = function(options) { 8274 options || (options = {}); 8275 if (options.routes) this.routes = options.routes; 8276 this._bindRoutes(); 8277 this.initialize.apply(this, arguments); 8278 }; 8279 8280 // Cached regular expressions for matching named param parts and splatted 8281 // parts of route strings. 8282 var optionalParam = /\((.*?)\)/g; 8283 var namedParam = /(\(\?)?:\w+/g; 8284 var splatParam = /\*\w+/g; 8285 var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; 8286 8287 // Set up all inheritable **Backbone.Router** properties and methods. 8288 _.extend(Router.prototype, Events, { 8289 8290 // Initialize is an empty function by default. Override it with your own 8291 // initialization logic. 8292 initialize: function(){}, 8293 8294 // Manually bind a single named route to a callback. For example: 8295 // 8296 // this.route('search/:query/p:num', 'search', function(query, num) { 8297 // ... 8298 // }); 8299 // 8300 route: function(route, name, callback) { 8301 if (!_.isRegExp(route)) route = this._routeToRegExp(route); 8302 if (_.isFunction(name)) { 8303 callback = name; 8304 name = ''; 8305 } 8306 if (!callback) callback = this[name]; 8307 var router = this; 8308 Backbone.history.route(route, function(fragment) { 8309 var args = router._extractParameters(route, fragment); 8310 router.execute(callback, args); 8311 router.trigger.apply(router, ['route:' + name].concat(args)); 8312 router.trigger('route', name, args); 8313 Backbone.history.trigger('route', router, name, args); 8314 }); 8315 return this; 8316 }, 8317 8318 // Execute a route handler with the provided parameters. This is an 8319 // excellent place to do pre-route setup or post-route cleanup. 8320 execute: function(callback, args) { 8321 if (callback) callback.apply(this, args); 8322 }, 8323 8324 // Simple proxy to `Backbone.history` to save a fragment into the history. 8325 navigate: function(fragment, options) { 8326 Backbone.history.navigate(fragment, options); 8327 return this; 8328 }, 8329 8330 // Bind all defined routes to `Backbone.history`. We have to reverse the 8331 // order of the routes here to support behavior where the most general 8332 // routes can be defined at the bottom of the route map. 8333 _bindRoutes: function() { 8334 if (!this.routes) return; 8335 this.routes = _.result(this, 'routes'); 8336 var route, routes = _.keys(this.routes); 8337 while ((route = routes.pop()) != null) { 8338 this.route(route, this.routes[route]); 8339 } 8340 }, 8341 8342 // Convert a route string into a regular expression, suitable for matching 8343 // against the current location hash. 8344 _routeToRegExp: function(route) { 8345 route = route.replace(escapeRegExp, '\\$&') 8346 .replace(optionalParam, '(?:$1)?') 8347 .replace(namedParam, function(match, optional) { 8348 return optional ? match : '([^/?]+)'; 8349 }) 8350 .replace(splatParam, '([^?]*?)'); 8351 return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); 8352 }, 8353 8354 // Given a route, and a URL fragment that it matches, return the array of 8355 // extracted decoded parameters. Empty or unmatched parameters will be 8356 // treated as `null` to normalize cross-browser behavior. 8357 _extractParameters: function(route, fragment) { 8358 var params = route.exec(fragment).slice(1); 8359 return _.map(params, function(param, i) { 8360 // Don't decode the search params. 8361 if (i === params.length - 1) return param || null; 8362 return param ? decodeURIComponent(param) : null; 8363 }); 8364 } 8365 8366 }); 8367 8368 // Backbone.History 8369 // ---------------- 8370 8371 // Handles cross-browser history management, based on either 8372 // [pushState](http://diveintohtml5.info/history.html) and real URLs, or 8373 // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) 8374 // and URL fragments. If the browser supports neither (old IE, natch), 8375 // falls back to polling. 8376 var History = Backbone.History = function() { 8377 this.handlers = []; 8378 _.bindAll(this, 'checkUrl'); 8379 8380 // Ensure that `History` can be used outside of the browser. 8381 if (typeof window !== 'undefined') { 8382 this.location = window.location; 8383 this.history = window.history; 8384 } 8385 }; 8386 8387 // Cached regex for stripping a leading hash/slash and trailing space. 8388 var routeStripper = /^[#\/]|\s+$/g; 8389 8390 // Cached regex for stripping leading and trailing slashes. 8391 var rootStripper = /^\/+|\/+$/g; 8392 8393 // Cached regex for detecting MSIE. 8394 var isExplorer = /msie [\w.]+/; 8395 8396 // Cached regex for removing a trailing slash. 8397 var trailingSlash = /\/$/; 8398 8399 // Cached regex for stripping urls of hash. 8400 var pathStripper = /#.*$/; 8401 8402 // Has the history handling already been started? 8403 History.started = false;
8404 8405 // Set up all inheritable **Backbone.History** properties and methods. 8406 _.extend(History.prototype, Events, { 8407 8408 // The default interval to poll for hash changes, if necessary, is 8409 // twenty times a second. 8410 interval: 50, 8411 8412 // Are we at the app root? 8413 atRoot: function() { 8414 return this.location.pathname.replace(/[^\/]$/, '$&/') === this.root; 8415 }, 8416 8417 // Gets the true hash value. Cannot use location.hash directly due to bug 8418 // in Firefox where location.hash will always be decoded. 8419 getHash: function(window) { 8420 var match = (window || this).location.href.match(/#(.*)$/); 8421 return match ? match[1] : ''; 8422 }, 8423 8424 // Get the cross-browser normalized URL fragment, either from the URL, 8425 // the hash, or the override. 8426 getFragment: function(fragment, forcePushState) { 8427 if (fragment == null) { 8428 if (this._hasPushState || !this._wantsHashChange || forcePushState) { 8429 fragment = decodeURI(this.location.pathname + this.location.search); 8430 var root = this.root.replace(trailingSlash, ''); 8431 if (!fragment.indexOf(root)) fragment = fragment.slice(root.length); 8432 } else { 8433 fragment = this.getHash(); 8434 } 8435 } 8436 return fragment.replace(routeStripper, ''); 8437 }, 8438 8439 // Start the hash change handling, returning `true` if the current URL matches 8440 // an existing route, and `false` otherwise. 8441 start: function(options) { 8442 if (History.started) throw new Error("Backbone.history has already been started"); 8443 History.started = true; 8444 8445 // Figure out the initial configuration. Do we need an iframe? 8446 // Is pushState desired ... is it available? 8447 this.options = _.extend({root: '/'}, this.options, options); 8448 this.root = this.options.root; 8449 this._wantsHashChange = this.options.hashChange !== false; 8450 this._wantsPushState = !!this.options.pushState; 8451 this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); 8452 var fragment = this.getFragment(); 8453 var docMode = document.documentMode; 8454 var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7)); 8455 8456 // Normalize root to always include a leading and trailing slash. 8457 this.root = ('/' + this.root + '/').replace(rootStripper, '/'); 8458 8459 if (oldIE && this._wantsHashChange) { 8460 var frame = Backbone.$('<iframe src="javascript:0" tabindex="-1">'); 8461 this.iframe = frame.hide().appendTo('body')[0].contentWindow; 8462 this.navigate(fragment); 8463 } 8464 8465 // Depending on whether we're using pushState or hashes, and whether 8466 // 'onhashchange' is supported, determine how we check the URL state. 8467 if (this._hasPushState) { 8468 Backbone.$(window).on('popstate', this.checkUrl); 8469 } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) { 8470 Backbone.$(window).on('hashchange', this.checkUrl); 8471 } else if (this._wantsHashChange) { 8472 this._checkUrlInterval = setInterval(this.checkUrl, this.interval); 8473 } 8474 8475 // Determine if we need to change the base url, for a pushState link 8476 // opened by a non-pushState browser. 8477 this.fragment = fragment; 8478 var loc = this.location; 8479 8480 // Transition from hashChange to pushState or vice versa if both are 8481 // requested. 8482 if (this._wantsHashChange && this._wantsPushState) { 8483 8484 // If we've started off with a route from a `pushState`-enabled 8485 // browser, but we're currently in a browser that doesn't support it... 8486 if (!this._hasPushState && !this.atRoot()) { 8487 this.fragment = this.getFragment(null, true); 8488 this.location.replace(this.root + '#' + this.fragment); 8489 // Return immediately as browser will do redirect to new url 8490 return true; 8491 8492 // Or if we've started out with a hash-based route, but we're currently 8493 // in a browser where it could be `pushState`-based instead... 8494 } else if (this._hasPushState && this.atRoot() && loc.hash) { 8495 this.fragment = this.getHash().replace(routeStripper, ''); 8496 this.history.replaceState({}, document.title, this.root + this.fragment); 8497 } 8498 8499 } 8500 8501 if (!this.options.silent) return this.loadUrl(); 8502 }, 8503 8504 // Disable Backbone.history, perhaps temporarily. Not useful in a real app, 8505 // but possibly useful for unit testing Routers. 8506 stop: function() { 8507 Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl); 8508 if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); 8509 History.started = false;
8510 }, 8511 8512 // Add a route to be tested when the fragment changes. Routes added later 8513 // may override previous routes. 8514 route: function(route, callback) { 8515 this.handlers.unshift({route: route, callback: callback}); 8516 }, 8517 8518 // Checks the current URL to see if it has changed, and if it has, 8519 // calls `loadUrl`, normalizing across the hidden iframe. 8520 checkUrl: function(e) { 8521 var current = this.getFragment(); 8522 if (current === this.fragment && this.iframe) { 8523 current = this.getFragment(this.getHash(this.iframe)); 8524 } 8525 if (current === this.fragment) return false; 8526 if (this.iframe) this.navigate(current); 8527 this.loadUrl(); 8528 }, 8529 8530 // Attempt to load the current URL fragment. If a route succeeds with a 8531 // match, returns `true`. If no defined routes matches the fragment, 8532 // returns `false`. 8533 loadUrl: function(fragment) { 8534 fragment = this.fragment = this.getFragment(fragment); 8535 return _.any(this.handlers, function(handler) { 8536 if (handler.route.test(fragment)) { 8537 handler.callback(fragment); 8538 return true; 8539 } 8540 }); 8541 }, 8542 8543 // Save a fragment into the hash history, or replace the URL state if the 8544 // 'replace' option is passed. You are responsible for properly URL-encoding 8545 // the fragment in advance. 8546 // 8547 // The options object can contain `trigger: true` if you wish to have the 8548 // route callback be fired (not usually desirable), or `replace: true`, if 8549 // you wish to modify the current URL without adding an entry to the history. 8550 navigate: function(fragment, options) { 8551 if (!History.started) return false; 8552 if (!options || options === true) options = {trigger: !!options}; 8553 8554 var url = this.root + (fragment = this.getFragment(fragment || '')); 8555 8556 // Strip the hash for matching. 8557 fragment = fragment.replace(pathStripper, ''); 8558 8559 if (this.fragment === fragment) return; 8560 this.fragment = fragment; 8561 8562 // Don't include a trailing slash on the root. 8563 if (fragment === '' && url !== '/') url = url.slice(0, -1); 8564 8565 // If pushState is available, we use it to set the fragment as a real URL. 8566 if (this._hasPushState) { 8567 this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); 8568 8569 // If hash changes haven't been explicitly disabled, update the hash 8570 // fragment to store history. 8571 } else if (this._wantsHashChange) { 8572 this._updateHash(this.location, fragment, options.replace); 8573 if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) { 8574 // Opening and closing the iframe tricks IE7 and earlier to push a 8575 // history entry on hash-tag change. When replace is true, we don't 8576 // want this. 8577 if(!options.replace) this.iframe.document.open().close(); 8578 this._updateHash(this.iframe.location, fragment, options.replace); 8579 } 8580 8581 // If you've told us that you explicitly don't want fallback hashchange- 8582 // based history, then `navigate` becomes a page refresh. 8583 } else { 8584 return this.location.assign(url); 8585 } 8586 if (options.trigger) return this.loadUrl(fragment); 8587 }, 8588 8589 // Update the hash location, either replacing the current entry, or adding 8590 // a new one to the browser history. 8591 _updateHash: function(location, fragment, replace) { 8592 if (replace) { 8593 var href = location.href.replace(/(javascript:|#).*$/, ''); 8594 location.replace(href + '#' + fragment); 8595 } else { 8596 // Some browsers require that `hash` contains a leading #. 8597 location.hash = '#' + fragment; 8598 } 8599 } 8600 8601 }); 8602 8603 // Create the default Backbone.history. 8604 Backbone.history = new History; 8605 8606 // Helpers 8607 // ------- 8608 8609 // Helper function to correctly set up the prototype chain, for subclasses. 8610 // Similar to `goog.inherits`, but uses a hash of prototype properties and 8611 // class properties to be extended. 8612 var extend = function(protoProps, staticProps) { 8613 var parent = this; 8614 var child; 8615 8616 // The constructor function for the new subclass is either defined by you 8617 // (the "constructor" property in your `extend` definition), or defaulted 8618 // by us to simply call the parent's constructor. 8619 if (protoProps && _.has(protoProps, 'constructor')) { 8620 child = protoProps.constructor; 8621 } else { 8622 child = function(){ return parent.apply(this, arguments); }; 8623 } 8624 8625 // Add static properties to the constructor function, if supplied.
8626 _.extend(child, parent, staticProps); 8627 8628 // Set the prototype chain to inherit from `parent`, without calling 8629 // `parent`'s constructor function. 8630 var Surrogate = function(){ this.constructor = child; }; 8631 Surrogate.prototype = parent.prototype; 8632 child.prototype = new Surrogate; 8633 8634 // Add prototype properties (instance properties) to the subclass, 8635 // if supplied. 8636 if (protoProps) _.extend(child.prototype, protoProps); 8637 8638 // Set a convenience property in case the parent's prototype is needed 8639 // later. 8640 child.__super__ = parent.prototype; 8641 8642 return child; 8643 }; 8644 8645 // Set up inheritance for the model, collection, router, view and history. 8646 Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend; 8647 8648 // Throw an error when a URL is needed, and none is supplied. 8649 var urlError = function() { 8650 throw new Error('A "url" property or function must be specified'); 8651 }; 8652 8653 // Wrap an optional error callback with a fallback error event. 8654 var wrapError = function(model, options) { 8655 var error = options.error; 8656 options.error = function(resp) { 8657 if (error) error(model, resp, options); 8658 model.trigger('error', model, resp, options); 8659 }; 8660 }; 8661 8662 return Backbone; 8663 8664})); 8665 8666/* Pattern router 8667 */ 8668define('mockup-router',[ 8669 'underscore', 8670 'backbone' 8671], function(_, Backbone) { 8672 8673 8674 var regexEscape = function(s) { 8675 return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 8676 }; 8677 8678 var Router = Backbone.Router.extend({ 8679 actions: [], 8680 redirects: {}, 8681 addRoute: function(patternName, id, callback, context, pathExp, expReplace) { 8682 if (_.findWhere(this.patterns, {patternName: patternName, id: id}) === undefined) { 8683 this.actions.push({patternName: patternName, id: id, callback: callback, context: context, pathExp: pathExp, expReplace: expReplace}); 8684 } 8685 var regex = new RegExp('(' + regexEscape(patternName) + ':' + regexEscape(id) + ')'); 8686 this.route(regex, 'handleRoute'); 8687 }, 8688 addRedirect: function(pathExp, destination) { 8689 this.redirects[pathExp] = destination; 8690 }, 8691 handleRoute: function(pattern) { 8692 var parts = pattern.split(':'); 8693 var patternName = parts[0]; 8694 var id = parts[1]; 8695 var action = _.findWhere(this.actions, {patternName: patternName, id: id}); 8696 if (action) { 8697 action.callback.call(action.context); 8698 } 8699 }, 8700 redirect: function() { 8701 var path = window.parent.location.pathname, 8702 newPath, 8703 regex, 8704 hash; 8705 8706 _.some(this.actions, function(action) { 8707 if (action.pathExp) { 8708 regex = new RegExp(action.pathExp); 8709 if (path.match(regex)) { 8710 hash = '!/' + action.patternName + ':' + action.id; 8711 var replaceWith = ''; 8712 if (action.expReplace) { 8713 replaceWith = action.expReplace; 8714 } 8715 newPath = path.replace(regex, replaceWith); 8716 return true; 8717 } 8718 } 8719 }, this); 8720 8721 if (hash === undefined) { 8722 for (var pathExp in this.redirects) { 8723 regex = new RegExp(pathExp); 8724 if (path.match(regex)) { 8725 hash = '!/' + this.redirects[pathExp]; 8726 newPath = path.replace(regex, ''); 8727 break; 8728 } 8729 } 8730 } 8731 8732 if (hash !== undefined) { 8733 this._changeLocation.apply(this, [newPath, hash]); 8734 } 8735 }, 8736 _changeLocation: function(path, hash) { 8737 window.parent.location.hash = hash; 8738 window.parent.location.pathname = path; 8739 }, 8740 start: function() { 8741 Backbone.history.start(); 8742 }, 8743 reset: function() { 8744 this.actions = []; 8745 } 8746 8747 }); 8748 8749 return new Router(); 8750 8751}); 8752 8753/* Modal pattern. 8754 * 8755 * Options: 8756 * height(string): Set the height of the modal, for example: 250px ('') 8757 * width(string): Set the width of the modal, for example: 80% or 500px. ('') 8758 * margin(function or integer): A function, Integer or String which will be used to set the margin of the modal in pixels. If a function is passed it must return an Integer. (20) 8759 * position(string): Position the modal relative to the window with the format: "<horizontal> <vertical>" -- allowed values: top, bottom, left, right, center, middle. ('center middle') 8760 * triggers(array): Add event listeners to elements on the page which will open the modal when triggered. Pass an Array of str
8760ings with the format ["<event> <selector>"] or ["<event>"]. For example, ["click .someButton"]. If you pass in only an event such as, ["change"], the event listener will be added to the element on which the modal was initiated, usually a link or button. ([]) 8761 * title(string): A string to place in the modal header. If title is provided, titleSelector is not used. (null) 8762 * titleSelector(string): Selector for an element to extract from the content provided to the modal and place in the modal header. ('h1:first') 8763 * content(string): Selector for an element within the content provided to the modal to use as the modal body. ('#content') 8764 * prependContent(string): Selector for elements within the content provided to the modal which will be collected and inserted, by default above, the modal content. This is useful for extracting things like alerts or status messages on forms and displaying them to the user after an AJAX response. ('.portalMessage') 8765 * backdrop(string): Selector for the element upon which the Backdrop pattern should be initiated. The Backdrop is a full width mask that will be apply above the content behind the modal which is useful for highlighting the modal dialog to the user. ('body') 8766 * backdropOptions(object): Look at options at backdrop pattern. ({ zIndex: "1040", opacity: "0.8", className: "backdrop", classActiveName: "backdrop-active", closeOnEsc: true, closeOnClick: true }) 8767 * buttons(string): Selector for matching elements, usually buttons, inputs or links, from the modal content to place in the modal footer. The original elements in the content will be hidden. ('.formControls > input[type="submit"]') 8768 * automaticallyAddButtonActions(boolean): Automatically create actions for elements matched with the buttons selector. They will use the options provided in actionOptions. (true) 8769 * loadLinksWithinModal(boolean): Automatically load links inside of the modal using AJAX. (true) 8770 * actionOptions(object): A hash of selector to options. Where options can include any of the defaults from actionOptions. Allows for the binding of events to elements in the content and provides options for handling ajax requests and displaying them in the modal. ({}) 8771 * onSuccess(Function|string): function which is called with parameters (modal, response, state, xhr, form) when form has been successfully submitted. if value is a string, this is the name of a function at window level 8772 * onFormError(Function|string): function which is called with parameters (modal, response, state, xhr, form) when backend has sent an error after form submission. if value is a string, this is the name of a function at window level 8773 * onError(Function|string): function which is called with parameters (xhr, textStatus, errorStatus) when form submission has failed. if value is a string, this is the name of a function at window level 8774 * 8775 * 8776 * Documentation: 8777 * # Example 8778 * 8779 * {{ example-basic }} 8780 * 8781 * {{ example-long }} 8782 * 8783 * {{ example-tinymce }} 8784 * 8785 * 8786 * Example: example-basic 8787 * <a href="#modal1" class="plone-btn plone-btn-large plone-btn-primary pat-plone-modal" 8788 * data-pat-plone-modal="width: 400">Modal basic</a> 8789 * <div id="modal1" style="display: none"> 8790 * <h1>Basic modal!</h1> 8791 * <p>Indeed. Whoa whoa whoa whoa. Wait.</p> 8792 * </div> 8793 * 8794 * Example: example-long 8795 * <a href="#modal2" class="plone-btn plone-btn-lg plone-btn-primary pat-plone-modal" 8796 * data-pat-plone-modal="width: 500">Modal long scrolling</a> 8797 * <div id="modal2" style="display: none"> 8798 * <h1>Basic with scrolling</h1> 8799 * <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> 8800 * <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 8801 * <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> 8802 * <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 8803 * <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> 8804 * <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 8805 * <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> 8806 * <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 8807 * <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> 8808 * <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 8809 * <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p> 8810 * </div> 8811 * 8812 * 8813 * Example: example-tinymce 8814 * <a href="#modaltinymce" class="btn btn-lg btn-primary pat-plone-modal" 8815 * data-pat-plone-modal="height: 600px; 8816 * width: 80%"> 8817 * Modal with TinyMCE</a> 8818 * <div id="modaltinymce" style="display:none"> 8819 * <textarea class="pat-tinymce"></textarea> 8820 * </div> 8821 * 8822 */ 8823 8824define('mockup-patterns-modal',[ 8825 'jquery', 8826 'underscore', 8827 'pat-base', 8828 'mockup-patterns-backdrop', 8829 'pat-registry', 8830 'mockup-router', 8831 'mockup-utils', 8832 'translate', 8833 'jquery.form' 8834], function($, _, Base, Backdrop, registry, Router, utils, _t) { 8835 8836 8837 var Modal = Base.extend({ 8838 name: 'plone-modal', 8839 trigger: '.pat-plone-modal', 8840 parser: 'mockup', 8841 createModal: null, 8842 $model: null, 8843 defaults: { 8844 width: '', 8845 height: '', 8846 margin: 20, 8847 position: 'center middle', // format: '<horizontal> <vertical>' -- allowed values: top, bottom, left, right, center, middle 8848 triggers: [], 8849 zIndexSelector: '.plone-modal-wrapper,.plone-modal-backdrop', 8850 backdrop: 'body', // Element to initiate the Backdrop on. 8851 backdropOptions: { 8852 zIndex: '1040', 8853 opacity: '0.85', 8854 className: 'plone-modal-backdrop', 8855 classActiveName: 'plone-backdrop-active', 8856 closeOnEsc: true, 8857 closeOnClick: true 8858 }, 8859 title: null, 8860 titleSelector: 'h1:first', 8861 buttons: '.formControls > input[type="submit"], .formControls > button', 8862 content: '#content', 8863 automaticallyAddButtonActions: true, 8864 loadLinksWithinModal: true, 8865 prependContent: '.portalMessage, #global_statusmessage', 8866 onRender: null, 8867 templateOptions: { 8868 className: 'plone-modal fade', 8869 classDialog: 'plone-modal-dialog', 8870 classModal: 'plone-modal-content', 8871 classHeaderName: 'plone-modal-header', 8872 classBodyName: 'plone-modal-body', 8873 classFooterName: 'plone-modal-footer', 8874 classWrapperName: 'plone-modal-wrapper', 8875 classWrapperInnerName: 'modal-wrapper-inner', 8876 classActiveName: 'in', 8877 classPrependName: '', // String, css class to be applied to the wrapper of the prepended content 8878 classContentName: '', // String, class name to be applied to the content of the modal, useful for modal specific styling 8879 template: '' + 8880 '<div class="<%= options.className %>">' +
8881 ' <div class="<%= options.classDialog %>">' + 8882 ' <div class="<%= options.classModal %>">' + 8883 ' <div class="<%= options.classHeaderName %>">' + 8884 ' <a class="plone-modal-close">×</a>' + 8885 ' <% if (title) { %><h2 class="plone-modal-title"><%= title %></h2><% } %>' + 8886 ' </div>' + 8887 ' <div class="<%= options.classBodyName %>">' + 8888 ' <div class="<%= options.classPrependName %>"><%= prepend %></div> ' + 8889 ' <div class="<%= options.classContentName %>"><%= content %></div>' + 8890 ' </div>' + 8891 ' <div class="<%= options.classFooterName %>"> ' + 8892 ' <% if (buttons) { %><%= buttons %><% } %>' + 8893 ' </div>' + 8894 ' </div>' + 8895 ' </div>' + 8896 '</div>' 8897 }, 8898 actions: {}, 8899 actionOptions: { 8900 eventType: 'click', 8901 disableAjaxFormSubmit: false, 8902 target: null, 8903 ajaxUrl: null, // string, or function($el, options) that returns a string 8904 modalFunction: null, // String, function name on self to call 8905 isForm: false, 8906 timeout: 5000, 8907 displayInModal: true, 8908 reloadWindowOnClose: true, 8909 error: '.portalMessage.error, .alert-danger', 8910 formFieldError: '.field.error', 8911 onSuccess: null, 8912 onError: null, 8913 onFormError: null, 8914 onTimeout: null, 8915 redirectOnResponse: false, 8916 redirectToUrl: function($action, response, options) { 8917 var reg; 8918 reg = /<body.*data-view-url=[\"'](.*)[\"'].*/im.exec(response); 8919 if (reg && reg.length > 1) { 8920 // view url as data attribute on body (Plone 5) 8921 return reg[1].split('"')[0]; 8922 } 8923 reg = /<body.*data-base-url=[\"'](.*)[\"'].*/im.exec(response); 8924 if (reg && reg.length > 1) { 8925 // Base url as data attribute on body (Plone 5) 8926 return reg[1].split('"')[0]; 8927 } 8928 reg = /<base.*href=[\"'](.*)[\"'].*/im.exec(response); 8929 if (reg && reg.length > 1) { 8930 // base tag available (Plone 4) 8931 return reg[1]; 8932 } 8933 return ''; 8934 } 8935 }, 8936 routerOptions: { 8937 id: null, 8938 pathExp: null 8939 }, 8940 form: function(actions) { 8941 var self = this; 8942 var $modal = self.$modal; 8943 8944 if (self.options.automaticallyAddButtonActions) { 8945 actions[self.options.buttons] = {}; 8946 } 8947 actions.a = {}; 8948 8949 $.each(actions, function(action, options) { 8950 var actionKeys = _.union(_.keys(self.options.actionOptions), ['templateOptions']); 8951 var actionOptions = $.extend(true, {}, self.options.actionOptions, _.pick(options, actionKeys)); 8952 options.templateOptions = $.extend(true, options.templateOptions, self.options.templateOptions); 8953 8954 var patternKeys = _.union(_.keys(self.options.actionOptions), ['actions', 'actionOptions']); 8955 var patternOptions = $.extend(true, _.omit(options, patternKeys), self.options); 8956 8957 $(action, $('.' + options.templateOptions.classBodyName, $modal)).each(function(action) { 8958 var $action = $(this); 8959 $action.on(actionOptions.eventType, function(e) { 8960 e.stopPropagation(); 8961 e.preventDefault(); 8962 8963 self.loading.show(false); 8964 8965 // handle event on $action using a function on self 8966 if (actionOptions.modalFunction !== null) { 8967 self[actionOptions.modalFunction](); 8968 // handle event on input/button using jquery.form library 8969 } else if ($.nodeName($action[0], 'input') || $.nodeName($action[0], 'button') || options.isForm === true) { 8970 self.options.handleFormAction.apply(self, [$action, actionOptions, patternOptions]); 8971 // handle event on link with jQuery.ajax 8972 } else if (options.ajaxUrl !== null || $.nodeName($action[0], 'a')) { 8973 self.options.handleLinkAction.apply(self, [$action, actionOptions, patternOptions]); 8974 } 8975 8976 }); 8977 }); 8978 }); 8979 }, 8980 handleFormAction: function($action, options, patternOptions) { 8981 var self = this; 8982 8983 // pass action that was clicked when submiting form 8984 var extraData = {}; 8985 extraData[$action.attr('name')] = $action.attr('value'); 8986 8987 var $form; 8988 8989 if ($.nodeName($action[0], 'form')) { 8990 $form = $action; 8991 } else { 8992 $form = $action.parents('form:not(.disableAutoSubmit)'); 8993 } 8994 8995 var url; 8996 if (options.ajaxUrl !== null) { 8997 if (typeof options.ajaxUrl === 'function') {
8998 url = options.ajaxUrl.apply(self, [$action, options]); 8999 } else { 9000 url = options.ajaxUrl; 9001 } 9002 } else { 9003 url = $action.parents('form').attr('action'); 9004 } 9005 9006 if(options.disableAjaxFormSubmit){ 9007 if($action.attr('name') && $action.attr('value')){ 9008 $form.append($('<input type="hidden" name="' + $action.attr('name') + '" value="' + $action.attr('value') + '" />')); 9009 } 9010 $form.trigger('submit'); 9011 return; 9012 } 9013 // We want to trigger the form submit event but NOT use the default 9014 $form.on('submit', function(e) { 9015 e.preventDefault(); 9016 }); 9017 $form.trigger('submit'); 9018 9019 self.loading.show(false); 9020 $form.ajaxSubmit({ 9021 timeout: options.timeout, 9022 data: extraData, 9023 url: url, 9024 error: function(xhr, textStatus, errorStatus) { 9025 self.loading.hide(); 9026 if (textStatus === 'timeout' && options.onTimeout) { 9027 options.onT
9027imeout.apply(self, xhr, errorStatus); 9028 // on "error", "abort", and "parsererror" 9029 } else if (options.onError) { 9030 if (typeof options.onError === 'string') { 9031 window[options.onError](xhr, textStatus, errorStatus); 9032 } else { 9033 options.onError(xhr, textStatus, errorStatus); 9034 } 9035 } else { 9036 // window.alert(_t('There was an error submitting the form.')); 9037 console.log('error happened', textStatus, ' do something'); 9038 } 9039 self.emit('formActionError', [xhr, textStatus, errorStatus]); 9040 }, 9041 success: function(response, state, xhr, form) { 9042 self.loading.hide(); 9043 // if error is found (NOTE: check for both the portal errors 9044 // and the form field-level errors) 9045 if ($(options.error, response).size() !== 0 || 9046 $(options.formFieldError, response).size() !== 0) { 9047 if (options.onFormError) { 9048 if (typeof options.onFormError === 'string') { 9049 window[options.onFormError](self, response, state, xhr, form); 9050 } else { 9051 options.onFormError(self, response, state, xhr, form); 9052 } 9053 } else { 9054 self.redraw(response, patternOptions); 9055 } 9056 return; 9057 } 9058 9059 if (options.redirectOnResponse === true) { 9060 if (typeof options.redirectToUrl === 'function') { 9061 window.parent.location.href = options.redirectToUrl.apply(self, [$action, response, options]); 9062 } else { 9063 window.parent.location.href = options.redirectToUrl; 9064 } 9065 return; // cut out right here since we're changing url 9066 } 9067 9068 if (options.onSuccess) { 9069 if (typeof options.onSuccess === 'string') { 9070 window[options.onSuccess](self, response, state, xhr, form); 9071 } else { 9072 options.onSuccess(self, response, state, xhr, form); 9073 } 9074 } 9075 9076 if (options.displayInModal === true) { 9077 self.redraw(response, patternOptions); 9078 } else { 9079 $action.trigger('destroy.plone-modal.patterns'); 9080 // also calls hide 9081 if (options.reloadWindowOnClose) { 9082 self.reloadWindow(); 9083 } 9084 } 9085 self.emit('formActionSuccess', [response, state, xhr, form]); 9086 } 9087 }); 9088 }, 9089 handleLinkAction: function($action, options, patternOptions) { 9090 var self = this; 9091 var url; 9092 if ($action.hasClass('pat-plone-modal')) { 9093 // if link is a modal pattern, do not reload the page 9094 return ; 9095 } 9096 9097 // Figure out URL 9098 if (options.ajaxUrl) { 9099 if (typeof options.ajaxUrl === 'function') { 9100 url = options.ajaxUrl.apply(self, [$action, options]); 9101 } else { 9102 url = options.ajaxUrl; 9103 } 9104 } else { 9105 url = $action.attr('href'); 9106 } 9107 9108 // Non-ajax link (I know it says "ajaxUrl" ...) 9109 if (options.displayInModal === false) { 9110 if($action.attr('target') === '_blank'){ 9111 window.open(url, '_blank'); 9112 self.loading.hide(); 9113 }else{ 9114 window.location = url; 9115 } 9116 return; 9117 } 9118 9119 // ajax version 9120 $.ajax({ 9121 url: url 9122 }).fail(function(xhr, textStatus, errorStatus) {
9123 if (textStatus === 'timeout' && options.onTimeout) { 9124 options.onTimeout(self.$modal, xhr, errorStatus); 9125 9126 // on "error", "abort", and "parsererror" 9127 } else if (options.onError) { 9128 options.onError(xhr, textStatus, errorStatus); 9129 } else { 9130 window.alert(_t('There was an error loading modal.')); 9131 } 9132 self.emit('linkActionError', [xhr, textStatus, errorStatus]); 9133 }).done(function(response, state, xhr) { 9134 self.redraw(response, patternOptions); 9135 if (options.onSuccess) { 9136 if (typeof options.onSuccess === 'string') { 9137 window[options.onSuccess](self, response, state, xhr); 9138 } else { 9139 options.onSuccess(self, response, state, xhr); 9140 } 9141 } 9142 9143 self.emit('linkActionSuccess', [response, state, xhr]); 9144 }).always(function(){ 9145 self.loading.hide(); 9146 }); 9147 }, 9148 render: function(options) { 9149 var self = this; 9150 9151 self.emit('before-render'); 9152 9153 if (!self.$raw) { 9154 return; 9155 } 9156 var $raw = self.$raw.clone(); 9157 // fix for IE9 bug (see http://bugs.jquery.com/ticket/10550) 9158 $('input:checked', $raw).each(function() { 9159 if (this.setAttribute) { 9160 this.setAttribute('checked', 'checked'); 9161 } 9162 }); 9163 9164 // Object that will be passed to the template 9165 var tplObject = { 9166 title: '', 9167 prepend: '<div />', 9168 content: '', 9169 buttons: '<div class="pattern-modal-buttons"></div>', 9170 options: options.templateOptions 9171 }; 9172 9173 // setup the Title 9174 if (options.title === null) { 9175 var $title = $(options.titleSelector, $raw); 9176 tplObject.title = $title.html(); 9177 $(options.titleSelector, $raw).remove(); 9178 } else { 9179 tplObject.title = options.title; 9180 } 9181 9182 // Grab items to to insert into the prepend area 9183 if (options.prependContent) { 9184 tplObject.prepend = $('<div />').append($(options.prependContent, $raw).clone()).html(); 9185 $(options.prependContent, $raw).remove(); 9186 } 9187 9188 // Filter out the content if there is a selector provided 9189 if (options.content) { 9190 tplObject.content = $(options.content, $raw).html(); 9191 } else { 9192 tplObject.content = $raw.html(); 9193 } 9194 9195 // Render html 9196 self.$modal = $(_.template(self.options.templateOptions.template)(tplObject)); 9197 self.$modalDialog = $('> .' + self.options.templateOptions.classDialog, self.$modal); 9198 self.$modalContent = $('> .' + self.options.templateOptions.classModal, self.$modalDialog); 9199 9200 // In most browsers, when you hit the enter key while a form element is focused 9201 // the browser will trigger the form 'submit' event. Google Chrome also does this, 9202 // but not when when the default submit button is hidden with 'display: none'. 9203 // The following code will work around this issue: 9204 $('form', self.$modal).on ('keydown', function (event) { 9205 // ignore keys which are not enter, and ignore enter inside a textarea. 9206 if (event.keyCode !== 13 || event.target.nodeName === 'TEXTAREA') { 9207 return; 9208 } 9209 event.preventDefault(); 9210 $('input[type=submit], button[type=submit], button:not(type)', this).eq(0).trigger('click'); 9211 }); 9212 9213 // Setup buttons 9214 $(options.buttons, self.$modal).each(function() { 9215 var $button = $(this); 9216 $button 9217 .on('click', function(e) { 9218 e.stopPropagation(); 9219 e.preventDefault(); 9220 }) 9221 .clone() 9222 .appendTo($('.pattern-modal-buttons', self.$modal)) 9223 .off('click').on('click', function(e) { 9224 e.stopPropagation(); 9225 e.preventDefault(); 9226 $button.trigger('click'); 9227 }); 9228 $button.hide(); 9229 }); 9230 9231 self.emit('before-events-setup'); 9232 9233 // Wire up events 9234 $('.plone-modal-header > a.plone-modal-close, .plone-modal-footer > a.plone-modal-close', self.$modal) 9235 .off('click') 9236 .on('click', function(e) { 9237 e.stopPropagation(); 9238 e.preventDefault(); 9239 $(e.target).trigger('destroy.plone-modal.patterns'); 9240 }); 9241 9242 // form 9243 if (options.form) { 9244 options.form.apply(self, [options.actions]); 9245 } 9246 9247 self.$modal 9248 .addClass(self.options.templateOptions.className) 9249 .on('destroy.plone-modal.patterns', function(e) { 9250 e.stopPropagation(); 9251 self.hide(); 9252 }) 9253 .on('resize.plone-modal.patterns', function(e) { 9254 e.stopPropagation(); 9255 e.preventDefault(); 9256 self.positionModal(); 9257 }) 9258 .appendTo(self.$wrapperInner); 9259 9260 if (self.options.loadLinksWithinModal) { 9261 self.$modal.on('click', function(e) { 9262 e.stopPropagation(); 9263 if ($.nodeName(e.target, 'a')) { 9264 e.preventDefault(); 9265 // TODO: open links inside modal 9266 // and slide modal body 9267 } 9268 self.$modal.trigger('modal-click'); 9269 }); 9270 } 9271 self.$modal.data('pattern-' + self.name, self); 9272 self.emit('after-render'); 9273 if (options.onRender) { 9274 if (typeof options.onRender === 'string') { 9275 window[options.onRender](self); 9276 } else { 9277 options.onRender(self); 9278 } 9279 } 9280 9281 } 9282 }, 9283 reloadWindow: function() { 9284 window.parent.location.reload(); 9285 }, 9286 init: function() { 9287 var self = this; 9288 self.options.loadLinksWithinModal = $.parseJSON(self.options.loadLinksWithinModal); 9289 9290 // Router 9291 if (self.options.routerOptions.id !== null) { 9292 Router.addRoute('modal', self.options.routerOptions.id, function() { 9293 this.show(); 9294 }, self, self.options.routerOptions.pathExp, self.options.routerOptions.expReplace); 9295 } 9296 9297 if (self.options.backdropOptions.closeOnEsc === true) { 9298 $(document).on('keydown', function(e, data) { 9299 if (self.$el.is('.' + self.options.templateOptions.classActiveName)) { 9300 if (e.keyCode === 27) { // ESC key pressed 9301 self.hide(); 9302 } 9303 } 9304 }); 9305 } 9306 9307 9308 9309 9310 $(window.parent).resize(function() { 9311 self.positionModal(); 9312 }); 9313 9314 if (self.options.triggers) { 9315 $.each(self.options.triggers, function(i, item) { 9316 var e = item.substring(0, item.indexOf(' ')); 9317 var selector = item.substring(item.indexOf(' '), item.length); 9318 $(selector || self.$el).on(e, function(e) { 9319 e.stopPropagation(); 9320 e.preventDefault(); 9321 self.show(); 9322 }); 9323 }); 9324 } 9325 9326 if (self.$el.is('a')) { 9327 if (self.$el.attr('href') && !self.options.image) { 9328 if (!self.options.target && self.$el.attr('href').substr(0, 1) === '#') { 9329 self.options.target = self.$el.attr('href'); 9330 self.options.content = ''; 9331 } 9332 if (!self.options.ajaxUrl && self.$el.attr('href').substr(0, 1) !== '#') { 9333 self.options.ajaxUrl = function () { 9334 // Resolve ``href`` attribute later, when modal is shown.
9335 return self.$el.attr('href'); 9336 }; 9337 } 9338 } 9339 self.$el.on('click', function(e) { 9340 e.stopPropagation(); 9341 e.preventDefault(); 9342 self.show(); 9343 }); 9344 } 9345 self.initModal(); 9346 }, 9347 9348 createAjaxModal: function() { 9349 var self = this; 9350 self.emit('before-ajax'); 9351 self.loading.show(); 9352 9353 var ajaxUrl = self.options.ajaxUrl; 9354 if (typeof ajaxUrl === 'function') { 9355 ajaxUrl = ajaxUrl.apply(self, [self.options]); 9356 } 9357 9358 self.ajaxXHR = $.ajax({ 9359 url: ajaxUrl, 9360 type: self.options.ajaxType 9361 }).done(function(response, textStatus, xhr) { 9362 self.ajaxXHR = undefined; 9363 self.$raw = $('<div />').append($(utils.parseBodyTag(response))); 9364 self.emit('after-ajax', self, textStatus, xhr); 9365 self._show(); 9366 }).fail(function(xhr, textStatus, errorStatus){ 9367 var options = self.options.actionOptions; 9368 if (textStatus === 'timeout' && options.onTimeout) { 9369 options.onT
9369imeout(self.$modal, xhr, errorStatus); 9370 } else if (options.onError) { 9371 options.onError(xhr, textStatus, errorStatus); 9372 } else { 9373 window.alert(_t('There was an error loading modal.')); 9374 self.hide(); 9375 } 9376 self.emit('linkActionError', [xhr, textStatus, errorStatus]); 9377 }).always(function(){ 9378 self.loading.hide(); 9379 }); 9380 }, 9381 9382 createTargetModal: function() { 9383 var self = this; 9384 self.$raw = $(self.options.target).clone(); 9385 self._show(); 9386 }, 9387 9388 createBasicModal: function() { 9389 var self = this; 9390 self.$raw = $('<div/>').html(self.$el.clone()); 9391 self._show(); 9392 }, 9393 9394 createHtmlModal: function() { 9395 var self = this; 9396 var $el = $(self.options.html); 9397 self.$raw = $el; 9398 self._show(); 9399 }, 9400 9401 createImageModal: function(){ 9402 var self = this; 9403 self.$wrapper.addClass('image-modal'); 9404 var src = self.$el.attr('href'); 9405 var srcset = self.$el.attr('data-modal-srcset') || ''; 9406 var title = $.trim(self.$el.context.innerText) || 'Image'; 9407 // XXX aria? 9408 self.$raw = $('<div><h1>' + title + '</h1><div id="content"><div class="modal-image"><img src="' + src + '" srcset="' + srcset + '" /></div></div></div>'); 9409 self._show(); 9410 }, 9411 9412 initModal: function() { 9413 var self = this; 9414 if (self.options.ajaxUrl) { 9415 self.createModal = self.createAjaxModal; 9416 } else if (self.options.target) { 9417 self.createModal = self.createTargetModal; 9418 } else if (self.options.html) { 9419 self.createModal = self.createHtmlModal; 9420 } else if (self.options.image){ 9421 self.createModal = self.createImageModal; 9422 } else { 9423 self.createModal = self.createBasicModal; 9424 } 9425 }, 9426 9427 findPosition: function(horpos, vertpos, margin, modalWidth, modalHeight, 9428 wrapperInnerWidth, wrapperInnerHeight) { 9429 var returnpos = {}; 9430 var absTop, absBottom, absLeft, absRight; 9431 absRight = absLeft = absTop = absLeft = 'auto'; 9432 9433 // -- HORIZONTAL POSITION ----------------------------------------------- 9434 if (horpos === 'left') { 9435 absLeft = margin + 'px'; 9436 // if the width of the wrapper is smaller than the modal, and thus the 9437 // screen is smaller than the modal, force the left to simply be 0 9438 if (modalWidth > wrapperInnerWidth) { 9439 absLeft = '0px'; 9440 } 9441 returnpos.left = absLeft; 9442 } 9443 else if (horpos === 'right') { 9444 absRight = margin + 'px'; 9445 // if the width of the wrapper is smaller than the modal, and thus the 9446 // screen is smaller than the modal, force the right to simply be 0 9447 if (modalWidth > wrapperInnerWidth) { 9448 absRight = '0px'; 9449 } 9450 returnpos.right = absRight; 9451 returnpos.left = 'auto'; 9452 } 9453 // default, no specified location, is to center 9454 else { 9455 absLeft = ((wrapperInnerWidth / 2) - (modalWidth / 2) - margin) + 'px'; 9456 // if the width of the wrapper is smaller than the modal, and thus the 9457 // screen is smaller than the modal, force the left to simply be 0 9458 if (modalWidth > wrapperInnerWidth) { 9459 absLeft = '0px'; 9460 } 9461 returnpos.left = absLeft; 9462 } 9463 9464 // -- VERTICAL POSITION ------------------------------------------------- 9465 if (vertpos === 'top') { 9466 absTop = margin + 'px'; 9467 // if the height of the wrapper is smaller than the modal, and thus the 9468 // screen is smaller than the modal, force the top to simply be 0 9469 if (modalHeight > wrapperInnerHeight) { 9470 absTop = '0px'; 9471 } 9472 returnpos.top = absTop; 9473 } 9474 else if (vertpos === 'bottom') { 9475 absBottom = margin + 'px'; 9476 // if the height of the wrapper is smaller than the modal, and thus the 9477 // screen is smaller than the modal, force the bottom to simply be 0 9478 if (modalHeight > wrapperInnerHeight) { 9479 absBottom = '0px'; 9480 } 9481 returnpos.bottom = absBottom; 9482 returnpos.top = 'auto'; 9483 } 9484 else { 9485 // default case, no specified location, is to center 9486 absTop = ((wrapperInnerHeight / 2) - (modalHeight / 2) - margin) + 'px'; 9487 // if the height of the wrapper is smaller than the modal, and thus the
9488 // screen is smaller than the modal, force the top to simply be 0 9489 if (modalHeight > wrapperInnerHeight) { 9490 absTop = '0px'; 9491 } 9492 returnpos.top = absTop; 9493 } 9494 return returnpos; 9495 }, 9496 9497 modalInitialized: function() { 9498 var self = this; 9499 return self.$modal !== null && self.$modal !== undefined; 9500 }, 9501 9502 positionModal: function() { 9503 /* re-position modal at any point. 9504 * 9505 * Uses: 9506 * options.margin 9507 * options.width 9508 * options.height 9509 * options.position 9510 */ 9511 var self = this; 9512 // modal isn't initialized 9513 if (!self.modalInitialized()) { return; } 9514 // clear out any previously set styling 9515 self.$modal.removeAttr('style'); 9516 9517 // if backdrop wrapper is set on body, then wrapper should have height of 9518 // the window, so we can do scrolling of inner wrapper 9519 if (self.$wrapper.parent().is('body')) { 9520 self.$wrapper.height($(window.parent).height()); 9521 } 9522 9523 var margin = typeof self.options.margin === 'function' ? self.options.margin() : self.options.margin; 9524 self.$modal.css({ 9525 'position': 'absolute', 9526 'padding': margin 9527 }); 9528 self.$modalDialog.css({ 9529 margin: '0', 9530 padding: '0', 9531 width: self.options.width, // defaults to "", which doesn't override other css 9532 height: self.options.height // defaults to "", which doesn't override other css 9533 }); 9534 self.$modalContent.css({ 9535 width: self.options.width, // defaults to "", which doesn't override other css 9536 }); 9537 9538 var posopt = self.options.position.split(' '), 9539 horpos = posopt[0], 9540 vertpos = posopt[1]; 9541 var modalWidth = self.$modalDialog.outerWidth(true); 9542 var modalHeight = self.$modalDialog.outerHeight(true); 9543 var wrapperInnerWidth = self.$wrapperInner.width(); 9544 var wrapperInnerHeight = self.$wrapperInner.height(); 9545 var pos = self.findPosition( 9546 horpos, vertpos, margin, modalWidth, modalHeight, 9547 wrapperInnerWidth, wrapperInnerHeight 9548 ); 9549 for (var key in pos) { 9550 self.$modalDialog.css(key, pos[key]); 9551 } 9552 }, 9553 9554 render: function(options) { 9555 var self = this; 9556 self.emit('render'); 9557 self.options.render.apply(self, [options]); 9558 self.emit('rendered'); 9559 }, 9560 9561 show: function() { 9562 var self = this; 9563 self.backdrop = self.createBackdrop(); 9564 self.createModal(); 9565 }, 9566 9567 createBackdrop: function() { 9568 var self = this, 9569 backdrop = new Backdrop( 9570 self.$el.parents(self.options.backdrop), 9571 self.options.backdropOptions 9572 ), 9573 zIndex = 1041; 9574 9575 $(self.options.zIndexSelector).each(function(){ 9576 zIndex = Math.max(zIndex, parseInt($(this).css('zIndex')) + 1 || 1041); 9577 }); 9578 9579 self.$wrapper = $('<div/>') 9580 .hide() 9581 .css({ 9582 'z-index': zIndex, 9583 'overflow-y': 'auto', 9584 'position': 'fixed', 9585 'height': '100%', 9586 'width': '100%', 9587 'bottom': '0', 9588 'left': '0', 9589 'right': '0', 9590 'top': '0' 9591 }) 9592 .addClass(self.options.templateOptions.classWrapperName) 9593 .insertBefore(backdrop.$backdrop) 9594 .on('click', function(e) { 9595 if (self.options.backdropOptions.closeOnClick) { 9596 e.stopPropagation(); 9597 e.preventDefault(); 9598 backdrop.hide(); 9599 } 9600 }); 9601 backdrop.on('hidden', function(e) { 9602 if (self.$modal !== undefined && self.$modal.hasClass(self.options.templateOptions.classActiveName)) { 9603 self.hide(); 9604 } 9605 }); 9606 self.loading = new utils.Loading({ 9607 'backdrop': backdrop 9608 });
9609 self.$wrapperInner = $('<div/>') 9610 .addClass(self.options.classWrapperInnerName) 9611 .css({ 9612 'position': 'absolute', 9613 'bottom': '0', 9614 'left': '0', 9615 'right': '0', 9616 'top': '0' 9617 }) 9618 .appendTo(self.$wrapper); 9619 return backdrop; 9620 }, 9621 9622 _show: function() { 9623 var self = this; 9624 self.render.apply(self, [ self.options ]); 9625 self.emit('show'); 9626 self.backdrop.show(); 9627 self.$wrapper.show(); 9628 self.loading.hide(); 9629 self.$el.addClass(self.options.templateOptions.classActiveName); 9630 self.$modal.addClass(self.options.templateOptions.classActiveName); 9631 registry.scan(self.$modal); 9632 self.positionModal(); 9633 $(window.parent).on('resize.plone-modal.patterns', function() { 9634 self.positionModal(); 9635 }); 9636 $('body').addClass('plone-modal-open'); 9637 self.emit('shown'); 9638 }, 9639 hide: function() { 9640 var self = this; 9641 if (self.ajaxXHR) { 9642 self.ajaxXHR.abort(); 9643 } 9644 self.emit('hide'); 9645 if (self._suppressHide) { 9646 if (!window.confirm(self._suppressHide)) { 9647 return; 9648 } 9649 } 9650 self.loading.hide(); 9651 self.$el.removeClass(self.options.templateOptions.classActiveName); 9652 if (self.$modal !== undefined) { 9653 self.$modal.remove(); 9654 self.initModal(); 9655 } 9656 self.$wrapper.remove(); 9657 if ($('.plone-modal', $('body')).size() < 1) { 9658 self._suppressHide = undefined; 9659 self.backdrop.hide(); 9660 $('body').removeClass('plone-modal-open'); 9661 $(window.parent).off('resize.plone-modal.patterns'); 9662 } 9663 self.emit('hidden'); 9664 }, 9665 9666 redraw: function(response, options) { 9667 var self = this; 9668 self.emit('beforeDraw'); 9669 self.$modal.remove(); 9670 self.$raw = $('<div />').append($(utils.parseBodyTag(response))); 9671 self.render.apply(self, [options || self.options]); 9672 self.$modal.addClass(self.options.templateOptions.classActiveName); 9673 self.positionModal(); 9674 registry.scan(self.$modal); 9675 self.emit('afterDraw'); 9676 } 9677 }); 9678 9679 return Modal; 9680}); 9681 9682// Copyright (C) 2010 Plone Foundation 9683// 9684// This program is free software; you can redistribute it and/or modify it 9685// under the terms of the GNU General Public License as published by the Free 9686// Software Foundation; either version 2 of the License. 9687// 9688// This program is distributed in the hope that it will be useful, but WITHOUT 9689// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9690// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 9691// more details. 9692// 9693// You should have received a copy of the GNU General Public License along with 9694// this program; if not, write to the Free Software Foundation, Inc., 51 9695// Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 9696// 9697 9698require([ 9699 'mockup-patterns-autotoc', 9700 'mockup-patterns-contentloader', 9701 'mockup-patterns-cookietrigger', 9702 'mockup-patterns-formautofocus', 9703 'mockup-patterns-formunloadalert', 9704 'mockup-patterns-livesearch', 9705 'mockup-patterns-markspeciallinks', 9706 'mockup-patterns-modal', 9707 'mockup-patterns-navigationmarker', 9708 'mockup-patterns-preventdoublesubmit', 9709 'bootstrap-collapse', 9710 'bootstrap-dropdown', 9711 'bootstrap-tooltip', 9712], function () { 9713 9714}); 9715 9716define("plone", function(){}); 9717 9718
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.