vendor: 89,501 bytes, lines 1-2
1/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,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":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
vendor: 4,458 bytes, lines 3-135
3/*! 4 * jQuery UI Widget 1.13.2 5 * http://jqueryui.com 6 * 7 * Copyright jQuery Foundation and other contributors 8 * Released under the MIT license. 9 * http://jquery.org/license 10 */ 11 12//>>label: Widget 13//>>group: Core 14//>>description: Provides a factory for creating stateful widgets with a common API. 15//>>docs: http://api.jqueryui.com/jQuery.widget/ 16//>>demos: http://jqueryui.com/widget/ 17 18( function( factory ) { 19 if ( typeof define === "function" && define.amd ) { 20 21 // AMD. Register as an anonymous module. 22 define( [ "jquery" ], factory ); 23 } else { 24 25 // Browser globals 26 factory( jQuery ); 27 } 28}( function( $ ) { 29 "use strict"; 30 31 $.ui = $.ui || {}; 32 33 var version = $.ui.version = "1.13.2"; 34 35 var widgetUuid = 0; 36 var widgetHasOwnProperty = Array.prototype.hasOwnProperty; 37 var widgetSlice = Array.prototype.slice; 38 39 $.cleanData = ( function( orig ) { 40 return function( elems ) { 41 var events, elem, i; 42 for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { 43 44 // Only trigger remove when necessary to save time 45 events = $._data( elem, "events" ); 46 if ( events && events.remove ) { 47 $( elem ).triggerHandler( "remove" ); 48 } 49 } 50 orig( elems ); 51 }; 52 } )( $.cleanData ); 53 54 $.widget = function( name, base, prototype ) { 55 var existingConstructor, constructor, basePrototype; 56 57 // ProxiedPrototype allows the provided prototype to remain unmodified 58 // so that it can be used as a mixin for multiple widgets (#8876) 59 var proxiedPrototype = {}; 60 61 var namespace = name.split( "." )[ 0 ]; 62 name = name.split( "." )[ 1 ]; 63 var fullName = namespace + "-" + name; 64 65 if ( !prototype ) { 66 prototype = base; 67 base = $.Widget; 68 } 69 70 if ( Array.isArray( prototype ) ) { 71 prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); 72 } 73 74 // Create selector for plugin 75 $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { 76 return !!$.data( elem, fullName ); 77 }; 78 79 $[ namespace ] = $[ namespace ] || {}; 80 existingConstructor = $[ namespace ][ name ]; 81 constructor = $[ namespace ][ name ] = function( options, element ) { 82 83 // Allow instantiation without "new" keyword 84 if ( !this || !this._createWidget ) { 85 return new constructor( options, element ); 86 } 87 88 // Allow instantiation without initializing for simple inheritance 89 // must use "new" keyword (the code above always passes args) 90 if ( arguments.length ) { 91 this._createWidget( options, element ); 92 } 93 }; 94 95 // Extend with the existing constructor to carry over any static properties 96 $.extend( constructor, existingConstructor, { 97 version: prototype.version, 98 99 // Copy the object used to create the prototype in case we need to 100 // redefine the widget later 101 _proto: $.extend( {}, prototype ), 102 103 // Track widgets that inherit from this widget in case this widget is 104 // redefined after a widget inherits from it 105 _childConstructors: [] 106 } ); 107 108 basePrototype = new base(); 109 110 // We need to make the options hash a property directly on the new instance 111 // otherwise we'll modify the options hash on the prototype that we're 112 // inheriting from 113 basePrototype.options = $.widget.extend( {}, basePrototype.options ); 114 $.each( prototype, function( prop, value ) { 115 if ( typeof value !== "function" ) { 116 proxiedPrototype[ prop ] = value; 117 return; 118 } 119 proxiedPrototype[ prop ] = ( function() { 120 function _super() { 121 return base.prototype[ prop ].apply( this, arguments ); 122 } 123 124 function _superApply( args ) { 125 return base.prototype[ prop ].apply( this, args ); 126 } 127 128 return function() { 129 var __super = this._super; 130 var __superApply = this._superApply; 131 var returnValue; 132 133 this._super = _super; 134 this._superApply = _superApply; 135
vendor: 22,518 bytes, lines 136-744
136 returnValue = value.apply( this, arguments ); 137 138 this._super = __super; 139 this._superApply = __superApply; 140 141 return returnValue; 142 }; 143 } )(); 144 } ); 145 constructor.prototype = $.widget.extend( basePrototype, { 146 147 // TODO: remove support for widgetEventPrefix 148 // always use the name + a colon as the prefix, e.g., draggable:start 149 // don't prefix for widgets that aren't DOM-based 150 widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name 151 }, proxiedPrototype, { 152 constructor: constructor, 153 namespace: namespace, 154 widgetName: name, 155 widgetFullName: fullName 156 } ); 157 158 // If this widget is being redefined then we need to find all widgets that 159 // are inheriting from it and redefine all of them so that they inherit from 160 // the new version of this widget. We're essentially trying to replace one 161 // level in the prototype chain. 162 if ( existingConstructor ) { 163 $.each( existingConstructor._childConstructors, function( i, child ) { 164 var childPrototype = child.prototype; 165 166 // Redefine the child widget using the same prototype that was 167 // originally used, but inherit from the new version of the base 168 $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, 169 child._proto ); 170 } ); 171 172 // Remove the list of existing child constructors from the old constructor 173 // so the old child constructors can be garbage collected 174 delete existingConstructor._childConstructors; 175 } else { 176 base._childConstructors.push( constructor ); 177 } 178 179 $.widget.bridge( name, constructor ); 180 181 return constructor; 182 }; 183 184 $.widget.extend = function( target ) { 185 var input = widgetSlice.call( arguments, 1 ); 186 var inputIndex = 0; 187 var inputLength = input.length; 188 var key; 189 var value; 190 191 for ( ; inputIndex < inputLength; inputIndex++ ) { 192 for ( key in input[ inputIndex ] ) { 193 value = input[ inputIndex ][ key ]; 194 if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) { 195 196 // Clone objects 197 if ( $.isPlainObject( value ) ) { 198 target[ key ] = $.isPlainObject( target[ key ] ) ? 199 $.widget.extend( {}, target[ key ], value ) : 200 201 // Don't extend strings, arrays, etc. with objects 202 $.widget.extend( {}, value ); 203 204 // Copy everything else by reference 205 } else { 206 target[ key ] = value; 207 } 208 } 209 } 210 } 211 return target; 212 }; 213 214 $.widget.bridge = function( name, object ) { 215 var fullName = object.prototype.widgetFullName || name; 216 $.fn[ name ] = function( options ) { 217 var isMethodCall = typeof options === "string"; 218 var args = widgetSlice.call( arguments, 1 ); 219 var returnValue = this; 220 221 if ( isMethodCall ) { 222 223 // If this is an empty collection, we need to have the instance method 224 // return undefined instead of the jQuery instance 225 if ( !this.length && options === "instance" ) { 226 returnValue = undefined; 227 } else { 228 this.each( function() { 229 var methodValue; 230 var instance = $.data( this, fullName ); 231 232 if ( options === "instance" ) { 233 returnValue = instance; 234 return false; 235 } 236 237 if ( !instance ) { 238 return $.error( "cannot call methods on " + name + 239 " prior to initialization; " + 240 "attempted to call method '" + options + "'" ); 241 } 242 243 if ( typeof instance[ options ] !== "function" || 244 options.charAt( 0 ) === "_" ) { 245 return $.error( "no such method '" + options + "' for " + name + 246 " widget instance" ); 247 } 248 249 methodValue = instance[ options ].apply( instance, args ); 250 251 if ( methodValue !== instance && methodValue !== undefined ) { 252 returnValue = methodValue && methodValue.jquery ? 253 returnValue.pushStack( methodValue.get() ) : 254 methodValue; 255 return false; 256 } 257 } ); 258 } 259 } else { 260 261 // Allow multiple hashes to be passed on init 262 if ( args.length ) { 263 options = $.widget.extend.apply( null, [ options ].concat( args ) ); 264 } 265 266 this.each( function() { 267 var instance = $.data( this, fullName ); 268 if ( instance ) { 269 instance.option( options || {} ); 270 if ( instance._init ) { 271 instance._init(); 272 } 273 } else { 274 $.data( this, fullName, new object( options, this ) ); 275 } 276 } ); 277 } 278 279 return returnValue; 280 }; 281 }; 282 283 $.Widget = function( /* options, element */ ) {}; 284 $.Widget._childConstructors = []; 285 286 $.Widget.prototype = { 287 widgetName: "widget", 288 widgetEventPrefix: "", 289 defaultElement: "<div>", 290 291 options: { 292 classes: {}, 293 disabled: false, 294 295 // Callbacks 296 create: null 297 }, 298 299 _createWidget: function( options, element ) { 300 element = $( element || this.defaultElement || this )[ 0 ]; 301 this.element = $( element ); 302 this.uuid = widgetUuid++; 303 this.eventNamespace = "." + this.widgetName + this.uuid; 304 305 this.bindings = $(); 306 this.hoverable = $(); 307 this.focusable = $(); 308 this.classesElementLookup = {}; 309 310 if ( element !== this ) { 311 $.data( element, this.widgetFullName, this ); 312 this._on( true, this.element, { 313 remove: function( event ) { 314 if ( event.target === element ) { 315 this.destroy(); 316 } 317 } 318 } ); 319 this.document = $( element.style ? 320 321 // Element within the document 322 element.ownerDocument : 323 324 // Element is window or document 325 element.document || element ); 326 this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); 327 } 328 329 this.options = $.widget.extend( {}, 330 this.options, 331 this._getCreateOptions(), 332 options ); 333 334 this._create(); 335 336 if ( this.options.disabled ) { 337 this._setOptionDisabled( this.options.disabled ); 338 } 339 340 this._trigger( "create", null, this._getCreateEventData() ); 341 this._init(); 342 }, 343 344 _getCreateOptions: function() { 345 return {}; 346 }, 347 348 _getCreateEventData: $.noop, 349 350 _create: $.noop, 351 352 _init: $.noop, 353 354 destroy: function() { 355 var that = this; 356 357 this._destroy(); 358 $.each( this.classesElementLookup, function( key, value ) { 359 that._removeClass( value, key ); 360 } ); 361 362 // We can probably remove the unbind calls in 2.0 363 // all event bindings should go through this._on() 364 this.element 365 .off( this.eventNamespace ) 366 .removeData( this.widgetFullName ); 367 this.widget() 368 .off( this.eventNamespace ) 369 .removeAttr( "aria-disabled" ); 370 371 // Clean up events and states 372 this.bindings.off( this.eventNamespace ); 373 }, 374 375 _destroy: $.noop, 376 377 widget: function() { 378 return this.element; 379 }, 380 381 option: function( key, value ) { 382 var options = key; 383 var parts; 384 var curOption; 385 var i; 386 387 if ( arguments.length === 0 ) { 388 389 // Don't return a reference to the internal hash 390 return $.widget.extend( {}, this.options ); 391 } 392 393 if ( typeof key === "string" ) { 394 395 // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 396 options = {}; 397 parts = key.split( "." ); 398 key = parts.shift(); 399 if ( parts.length ) { 400 curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 401 for ( i = 0; i < parts.length - 1; i++ ) { 402 curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 403 curOption = curOption[ parts[ i ] ]; 404 } 405 key = parts.pop(); 406 if ( arguments.length === 1 ) { 407 return curOption[ key ] === undefined ? null : curOption[ key ]; 408 } 409 curOption[ key ] = value; 410 } else { 411 if ( arguments.length === 1 ) { 412 return this.options[ key ] === undefined ? null : this.options[ key ]; 413 } 414 options[ key ] = value; 415 } 416 } 417 418 this._setOptions( options ); 419 420 return this; 421 }, 422 423 _setOptions: function( options ) { 424 var key; 425 426 for ( key in options ) { 427 this._setOption( key, options[ key ] ); 428 } 429 430 return this; 431 }, 432 433 _setOption: function( key, value ) { 434 if ( key === "classes" ) { 435 this._setOptionClasses( value ); 436 } 437 438 this.options[ key ] = value; 439 440 if ( key === "disabled" ) { 441 this._setOptionDisabled( value ); 442 } 443 444 return this; 445 }, 446 447 _setOptionClasses: function( value ) { 448 var classKey, elements, currentElements; 449 450 for ( classKey in value ) { 451 currentElements = this.classesElementLookup[ classKey ]; 452 if ( value[ classKey ] === this.options.classes[ classKey ] || 453 !currentElements || 454 !currentElements.length ) { 455 continue; 456 } 457 458 // We are doing this to create a new jQuery object because the _removeClass() call 459 // on the next line is going to destroy the reference to the current elements being 460 // tracked. We need to save a copy of this collection so that we can add the new classes 461 // below. 462 elements = $( currentElements.get() ); 463 this._removeClass( currentElements, classKey ); 464 465 // We don't use _addClass() here, because that uses this.options.classes 466 // for generating the string of classes. We want to use the value passed in from 467 // _setOption(), this is the new value of the classes option which was passed to 468 // _setOption(). We pass this value directly to _classes(). 469 elements.addClass( this._classes( { 470 element: elements, 471 keys: classKey, 472 classes: value, 473 add: true 474 } ) ); 475 } 476 }, 477 478 _setOptionDisabled: function( value ) { 479 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); 480 481 // If the widget is becoming disabled, then nothing is interactive 482 if ( value ) { 483 this._removeClass( this.hoverable, null, "ui-state-hover" ); 484 this._removeClass( this.focusable, null, "ui-state-focus" ); 485 } 486 }, 487 488 enable: function() { 489 return this._setOptions( { disabled: false } ); 490 }, 491 492 disable: function() { 493 return this._setOptions( { disabled: true } ); 494 }, 495 496 _classes: function( options ) { 497 var full = []; 498 var that = this; 499 500 options = $.extend( { 501 element: this.element, 502 classes: this.options.classes || {} 503 }, options ); 504 505 function bindRemoveEvent() { 506 var nodesToBind = []; 507 508 options.element.each( function( _, element ) { 509 var isTracked = $.map( that.classesElementLookup, function( elements ) { 510 return elements; 511 } ) 512 .some( function( elements ) { 513 return elements.is( element ); 514 } ); 515 516 if ( !isTracked ) { 517 nodesToBind.push( element ); 518 } 519 } ); 520 521 that._on( $( nodesToBind ), { 522 remove: "_untrackClassesElement" 523 } ); 524 } 525 526 function processClassString( classes, checkOption ) { 527 var current, i; 528 for ( i = 0; i < classes.length; i++ ) { 529 current = that.classesElementLookup[ classes[ i ] ] || $(); 530 if ( options.add ) { 531 bindRemoveEvent(); 532 current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) ); 533 } else { 534 current = $( current.not( options.element ).get() ); 535 } 536 that.classesElementLookup[ classes[ i ] ] = current; 537 full.push( classes[ i ] ); 538 if ( checkOption && options.classes[ classes[ i ] ] ) { 539 full.push( options.classes[ classes[ i ] ] ); 540 } 541 } 542 } 543 544 if ( options.keys ) { 545 processClassString( options.keys.match( /\S+/g ) || [], true ); 546 } 547 if ( options.extra ) { 548 processClassString( options.extra.match( /\S+/g ) || [] ); 549 } 550 551 return full.join( " " ); 552 }, 553 554 _untrackClassesElement: function( event ) { 555 var that = this; 556 $.each( that.classesElementLookup, function( key, value ) { 557 if ( $.inArray( event.target, value ) !== -1 ) { 558 that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); 559 } 560 } ); 561 562 this._off( $( event.target ) ); 563 }, 564 565 _removeClass: function( element, keys, extra ) { 566 return this._toggleClass( element, keys, extra, false ); 567 }, 568 569 _addClass: function( element, keys, extra ) { 570 return this._toggleClass( element, keys, extra, true ); 571 }, 572 573 _toggleClass: function( element, keys, extra, add ) { 574 add = ( typeof add === "boolean" ) ? add : extra; 575 var shift = ( typeof element === "string" || element === null ), 576 options = { 577 extra: shift ? keys : extra, 578 keys: shift ? element : keys, 579 element: shift ? this.element : element, 580 add: add 581 }; 582 options.element.toggleClass( this._classes( options ), add ); 583 return this; 584 }, 585 586 _on: function( suppressDisabledCheck, element, handlers ) { 587 var delegateElement; 588 var instance = this; 589 590 // No suppressDisabledCheck flag, shuffle arguments 591 if ( typeof suppressDisabledCheck !== "boolean" ) { 592 handlers = element; 593 element = suppressDisabledCheck; 594 suppressDisabledCheck = false; 595 } 596 597 // No element argument, shuffle and use this.element 598 if ( !handlers ) { 599 handlers = element; 600 element = this.element; 601 delegateElement = this.widget(); 602 } else { 603 element = delegateElement = $( element ); 604 this.bindings = this.bindings.add( element ); 605 } 606 607 $.each( handlers, function( event, handler ) { 608 function handlerProxy() { 609 610 // Allow widgets to customize the disabled handling 611 // - disabled as an array instead of boolean 612 // - disabled class as method for disabling individual parts 613 if ( !suppressDisabledCheck && 614 ( instance.options.disabled === true || 615 $( this ).hasClass( "ui-state-disabled" ) ) ) { 616 return; 617 } 618 return ( typeof handler === "string" ? instance[ handler ] : handler ) 619 .apply( instance, arguments ); 620 } 621 622 // Copy the guid so direct unbinding works 623 if ( typeof handler !== "string" ) { 624 handlerProxy.guid = handler.guid = 625 handler.guid || handlerProxy.guid || $.guid++; 626 } 627 628 var match = event.match( /^([\w:-]*)\s*(.*)$/ ); 629 var eventName = match[ 1 ] + instance.eventNamespace; 630 var selector = match[ 2 ]; 631 632 if ( selector ) { 633 delegateElement.on( eventName, selector, handlerProxy ); 634 } else { 635 element.on( eventName, handlerProxy ); 636 } 637 } ); 638 }, 639 640 _off: function( element, eventName ) { 641 eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + 642 this.eventNamespace; 643 element.off( eventName ); 644 645 // Clear the stack to avoid memory leaks (#10056) 646 this.bindings = $( this.bindings.not( element ).get() ); 647 this.focusable = $( this.focusable.not( element ).get() ); 648 this.hoverable = $( this.hoverable.not( element ).get() ); 649 }, 650 651 _delay: function( handler, delay ) { 652 function handlerProxy() { 653 return ( typeof handler === "string" ? instance[ handler ] : handler ) 654 .apply( instance, arguments ); 655 } 656 var instance = this; 657 return setTimeout( handlerProxy, delay || 0 ); 658 }, 659 660 _hoverable: function( element ) { 661 this.hoverable = this.hoverable.add( element ); 662 this._on( element, { 663 mouseenter: function( event ) { 664 this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); 665 }, 666 mouseleave: function( event ) { 667 this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); 668 } 669 } ); 670 }, 671 672 _focusable: function( element ) { 673 this.focusable = this.focusable.add( element ); 674 this._on( element, { 675 focusin: function( event ) { 676 this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); 677 }, 678 focusout: function( event ) { 679 this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); 680 } 681 } ); 682 }, 683 684 _trigger: function( type, event, data ) { 685 var prop, orig; 686 var callback = this.options[ type ]; 687 688 data = data || {}; 689 event = $.Event( event ); 690 event.type = ( type === this.widgetEventPrefix ? 691 type : 692 this.widgetEventPrefix + type ).toLowerCase(); 693 694 // The original event may come from any element 695 // so we need to reset the target on the new event 696 event.target = this.element[ 0 ]; 697 698 // Copy original event properties over to the new event 699 orig = event.originalEvent; 700 if ( orig ) { 701 for ( prop in orig ) { 702 if ( !( prop in event ) ) { 703 event[ prop ] = orig[ prop ]; 704 } 705 } 706 } 707 708 this.element.trigger( event, data ); 709 return !( typeof callback === "function" && 710 callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || 711 event.isDefaultPrevented() ); 712 } 713 }; 714 715 $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 716 $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 717 if ( typeof options === "string" ) { 718 options = { effect: options }; 719 } 720 721 var hasOptions; 722 var effectName = !options ? 723 method : 724 options === true || typeof options === "number" ? 725 defaultEffect : 726 options.effect || defaultEffect; 727 728 options = options || {}; 729 if ( typeof options === "number" ) { 730 options = { duration: options }; 731 } else if ( options === true ) { 732 options = {}; 733 } 734 735 hasOptions = !$.isEmptyObject( options ); 736 options.complete = callback; 737 738 if ( options.delay ) { 739 element.delay( options.delay ); 740 } 741 742 if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 743 element[ method ]( options ); 744 } else if ( effectName !== method && element[ effectName ] ) {
vendor: 5,674 bytes, lines 745-765
745 element[ effectName ]( options.duration, options.easing, callback ); 746 } else { 747 element.queue( function( next ) { 748 $( this )[ method ](); 749 if ( callback ) { 750 callback.call( element[ 0 ] ); 751 } 752 next(); 753 } ); 754 } 755 }; 756 } ); 757 758 var widget = $.widget; 759})); 760!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ 761// Underscore.js 1.13.6 762// https://underscorejs.org 763// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors 764// Underscore may be freely distributed under the MIT license. 765var n="1.13.6",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u<t;u++)e[u]=arguments[u+r];switch(r){case 0:return n.call(this,e);case 1:return n.call(this,arguments[0],e);case 2:return n.call(this,arguments[0],arguments[1],e)}var o=Array(r+1);for(u=0;u<r;u++)o[u]=arguments[u];return o[r]=e,n.apply(this,o)}}function _(n){var r=typeof n;return"function"===r||"object"===r&&!!n}function w(n){return void 0===n}function A(n){return!0===n||!1===n||"[object Boolean]"===a.call(n)}function x(n){var r="[object "+n+"]";return function(n){return a.call(n)===r}}var S=x("String"),O=x("Number"),M=x("Date"),E=x("RegExp"),B=x("Error"),N=x("Symbol"),I=x("ArrayBuffer"),T=x("Function"),k=r.document&&r.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof k&&(T=function(n){return"function"==typeof n||!1});var D=T,R=x("Object"),F=l&&R(new DataView(new ArrayBuffer(8))),V="undefined"!=typeof Map&&R(new Map),P=x("DataView");var q=F?function(n){return null!=n&&D(n.getInt8)&&I(n.buffer)}:P,U=s||x("Array");function W(n,r){return null!=n&&f.call(n,r)}var z=x("Arguments");!function(){z(arguments)||(z=function(n){return W(n,"callee")})}();var L=z;function $(n){return O(n)&&y(n)}function C(n){return function(){return n}}function K(n){return function(r){var t=n(r);return"number"==typeof t&&t>=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e<t;++e)r[n[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(t){return r[t]=!0,n.push(t)}}}(r);var t=b.length,u=n.constructor,o=D(u)&&u.prototype||e,i="constructor";for(W(n,i)&&!r.contains(i)&&r.push(i);t--;)(i=b[t])in n&&n[i]!==o[i]&&!r.contains(i)&&r.push(i)}function nn(n){if(!_(n))return[];if(p)return p(n);var r=[];for(var t in n)W(n,t)&&r.push(t);return g&&Z(n,r),r}function rn(n,r){var t=nn(r),e=t.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=t[o];if(r[i]!==u[i]||!(i in u))return!1}return!0}function tn(n){return n instanceof tn?n:this instanceof tn?void(this._wrapped=n):new tn(n)}function en(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,G(n))}tn.VERSION=n,tn.prototype.value=function(){return this._wrapped},tn.prototype.valueOf=tn.prototype.toJSON=tn.prototype.value,tn.prototype.toString=function(){return String(this._wrapped)};var un="[object DataView]";function on(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(null==n||null==r)return!1;if(n!=n)return r!=r;var o=typeof n;return("function"===o||"object"===o||"object"==typeof r)&&function n(r,t,e,o){r instanceof tn&&(r=r._wrapped);t instanceof tn&&(t=t._wrapped);var i=a.call(r);if(i!==a.call(t))return!1;if(F&&"[object Object]"==i&&q(r)){if(!q(t))return!1;i=un}switch(i){case"[object RegExp]":case"[object String]":return""+r==""+t;case"[object Number]":return+r!=+r?+t!=+t:0==+r?1/+r==1/t:+r==+t;case"[object Date]":case"[object Boolean]":return+r==+t;case"[object Symbol]":return u.valueOf.call(r)===u.valueOf.call(t);case"[object ArrayBuffer]":case un:return n(en(r),en(t),e,o)}var f="[object Array]"===i;if(!f&&X(r)){if(G(r)!==G(t))return!1;if(r.buffer===t.buffer&&r.byteOffset===t.byteOffset)return!0;f=!0}if(!f){if("object"!=typeof r||"object"!=typeof t)return!1;var c=r.constructor,l=t.constructor;if(c!==l&&!(D(c)&&c instanceof c&&D(l)&&l instanceof l)&&"constructor"in r&&"constructor"in t)return!1}o=o||[];var s=(e=e||[]).length;for(;s--;)if(e[s]===r)return o[s]===t;if(e.push(r),o.push(t),f){if((s=r.length)!==t.length)return!1;for(;s--;)if(!on(r[s],t[s],e,o))return!1}else{var p,v=nn(r);if(s=v.length,nn(t).length!==s)return!1;for(;s--;)if(p=v[s],!W(t,p)||!on(r[p],t[p],e,o))return!1}return e.pop(),o.pop(),!0}(n,r,t,e)}function an(n){if(!_(n))return[];var r=[];for(var t in n)r.push(t);return g&&Z(n,r),r}function fn(n){var r=Y(n);return function(t){if(null==t)return!1;var e=an(t);
vendor: 16,824 bytes, lines 765-823
765if(Y(e))return!1;for(var u=0;u<r;u++)if(!D(t[n[u]]))return!1;return n!==hn||!D(t[cn])}}var cn="forEach",ln="has",sn=["clear","delete"],pn=["get",ln,"set"],vn=sn.concat(cn,pn),hn=sn.concat(pn),yn=["add"].concat(sn,cn,ln),dn=V?fn(vn):x("Map"),gn=V?fn(hn):x("WeakMap"),bn=V?fn(yn):x("Set"),mn=x("WeakSet");function jn(n){for(var r=nn(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=n[r[u]];return e}function _n(n){for(var r={},t=nn(n),e=0,u=t.length;e<u;e++)r[n[t[e]]]=t[e];return r}function wn(n){var r=[];for(var t in n)D(n[t])&&r.push(t);return r.sort()}function An(n,r){return function(t){var e=arguments.length;if(r&&(t=Object(t)),e<2||null==t)return t;for(var u=1;u<e;u++)for(var o=arguments[u],i=n(o),a=i.length,f=0;f<a;f++){var c=i[f];r&&void 0!==t[c]||(t[c]=o[c])}return t}}var xn=An(an),Sn=An(nn),On=An(an,!0);function Mn(n){if(!_(n))return{};if(v)return v(n);var r=function(){};r.prototype=n;var t=new r;return r.prototype=null,t}function En(n){return U(n)?n:[n]}function Bn(n){return tn.toPath(n)}function Nn(n,r){for(var t=r.length,e=0;e<t;e++){if(null==n)return;n=n[r[e]]}return t?n:void 0}function In(n,r,t){var e=Nn(n,Bn(r));return w(e)?t:e}function Tn(n){return n}function kn(n){return n=Sn({},n),function(r){return rn(r,n)}}function Dn(n){return n=Bn(n),function(r){return Nn(r,n)}}function Rn(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:return function(t){return n.call(r,t)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return function(){return n.apply(r,arguments)}}function Fn(n,r,t){return null==n?Tn:D(n)?Rn(n,r,t):_(n)&&!U(n)?kn(n):Dn(n)}function Vn(n,r){return Fn(n,r,1/0)}function Pn(n,r,t){return tn.iteratee!==Vn?tn.iteratee(n,r):Fn(n,r,t)}function qn(){}function Un(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r-n+1))}tn.toPath=En,tn.iteratee=Vn;var Wn=Date.now||function(){return(new Date).getTime()};function zn(n){var r=function(r){return n[r]},t="(?:"+nn(n).join("|")+")",e=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,r):n}}var Ln={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$n=zn(Ln),Cn=zn(_n(Ln)),Kn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Jn=/(.)^/,Gn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Hn=/\\|'|\r|\n|\u2028|\u2029/g;function Qn(n){return"\\"+Gn[n]}var Xn=/^\s*(\w|\$)+\s*$/;var Yn=0;function Zn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var nr=j((function(n,r){var t=nr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a<o;a++)i[a]=r[a]===t?arguments[u++]:r[a];for(;u<arguments.length;)i.push(arguments[u++]);return Zn(n,e,this,this,i)};return e}));nr.placeholder=tn;var rr=j((function(n,r,t){if(!D(n))throw new TypeError("Bind must be called on a function");var e=j((function(u){return Zn(n,e,r,this,t.concat(u))}));return e})),tr=K(Y);function er(n,r,t,e){if(e=e||[],r||0===r){if(r<=0)return e.concat(n)}else r=1/0;for(var u=e.length,o=0,i=Y(n);o<i;o++){var a=n[o];if(tr(a)&&(U(a)||L(a)))if(r>1)er(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else t||(e[u++]=a)}return e}var ur=j((function(n,r){var t=(r=er(r,!1,!1)).length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var e=r[t];n[e]=rr(n[e],n)}return n}));var or=j((function(n,r,t){return setTimeout((function(){return n.apply(null,t)}),r)})),ir=nr(or,tn,1);function ar(n){return function(){return!n.apply(this,arguments)}}function fr(n,r){var t;return function(){return--n>0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var cr=nr(fr,2);function lr(n,r,t){r=Pn(r,t);for(var e,u=nn(n),o=0,i=u.length;o<i;o++)if(r(n[e=u[o]],e,n))return e}function sr(n){return function(r,t,e){t=Pn(t,e);for(var u=Y(r),o=n>0?0:u-1;o>=0&&o<u;o+=n)if(t(r[o],o,r))return o;return-1}}var pr=sr(1),vr=sr(-1);function hr(n,r,t,e){for(var u=(t=Pn(t,e,1))(r),o=0,i=Y(n);o<i;){var a=Math.floor((o+i)/2);t(n[a])<u?o=a+1:i=a}return o}function yr(n,r,t){return function(e,u,o){var a=0,f=Y(e);if("number"==typeof o)n>0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o<f;o+=n)if(e[o]===u)return o;return-1}}var dr=yr(1,pr,hr),gr=yr(-1,vr);function br(n,r,t){var e=(tr(n)?pr:lr)(n,r,t);if(void 0!==e&&-1!==e)return n[e]}function mr(n,r,t){var e,u;if(r=Rn(r,t),tr(n))for(e=0,u=n.length;e<u;e++)r(n[e],e,n);else{var o=nn(n);for(e=0,u=o.length;e<u;e++)r(n[o[e]],o[e],n)}return n}function jr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=r(n[a],a,n)}return o}function _r(n){var r=function(r,t,e,u){var o=!tr(r)&&nn(r),i=(o||r).length,a=n>0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a<i;a+=n){var f=o?o[a]:a;e=t(e,r[f],f,r)}return e};return function(n,t,e,u){var o=arguments.length>=3;return r(n,Rn(t,u,4),e,o)}}var wr=_r(1),Ar=_r(-1);function xr(n,r,t){var e=[];return r=Pn(r,t),mr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Sr(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!r(n[i],i,n))return!1}return!0}function Or(n,r,t){r=Pn(r,t);for(var e=!tr(n)&&nn(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(r(n[i],i,n))return!0}return!1}function Mr(n,r,t,e){return tr(n)||(n=jn(n)),("number"!=typeof t||e)&&(t=0),dr(n,r,t)>=0}var Er=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Bn(r),e=r.slice(0,-1),r=r[r.length-1]),jr(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=Nn(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Br(n,r){return jr(n,Dn(r))}function Nr(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;a<f;a++)null!=(e=n[a])&&e>o&&(o=e);else r=Pn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}var Ir=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Tr(n){return n?U(n)?i.call(n):S(n)?n.match(Ir):tr(n)?jr(n,Tn):jn(n):[]}function kr(n,r,t){if(null==r||t)return tr(n)||(n=jn(n)),n[Un(n.length-1)];var e=Tr(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i<r;i++){var a=Un(i,o),f=e[i];e[i]=e[a],e[a]=f}return e.slice(0,r)}function Dr(n,r){return function(t,e,u){var o=r?[[],[]]:{};return e=Pn(e,u),mr(t,(function(r,u){var i=e(r,u,t);n(o,r,i)})),o}}var Rr=Dr((function(n,r,t){W(n,t)?n[t].push(r):n[t]=[r]})),Fr=Dr((function(n,r,t){n[t]=r})),Vr=Dr((function(n,r,t){W(n,t)?n[t]++:n[t]=1})),Pr=Dr((function(n,r,t){n[t?0:1].push(r)}),!0);function qr(n,r,t){return r in t}var Ur=j((function(n,r){var t={},e=r[0];if(null==n)return t;D(e)?(r.length>1&&(e=Rn(e,r[1])),r=an(n)):(e=qr,r=er(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u<o;u++){var i=r[u],a=n[i];e(a,i,n)&&(t[i]=a)}return t})),Wr=j((function(n,r){var t,e=r[0];return D(e)?(e=ar(e),r.length>1&&(t=r[1])):(r=jr(er(r,!1,!1),String),e=function(n,t){return!Mr(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=er(r,!0,!0),xr(n,(function(n){return!Mr(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=Pn(t,e));for(var u=[],o=[],i=0,a=Y(n);i<a;i++){var f=n[i],c=t?t(f,i,n):f;r&&!t?(i&&o===c||u.push(f),o=c):t?Mr(o,c)||(o.push(c),u.push(f)):Mr(u,f)||u.push(f)}return u}var Gr=j((function(n){return Jr(er(n,!0,!0))}));function Hr(n){for(var r=n&&Nr(n,Y).length||0,t=Array(r),e=0;e<r;e++)t[e]=Br(n,e);return t}var Qr=j(Hr);function Xr(n,r){return n._chain?tn(r).chain():r}function Yr(n){return mr(wn(n),(function(r){var t=tn[r]=n[r];tn.prototype[r]=function(){var n=[this._wrapped];return o.apply(n,arguments),Xr(this,t.apply(tn,n))}})),tn}mr(["pop","push","reverse","shift","sort","splice","unshift"],(function(n){var r=t[n];tn.prototype[n]=function(){var t=this._wrapped;return null!=t&&(r.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0]),Xr(this,t)}})),mr(["concat","join","slice"],(function(n){var r=t[n];tn.prototype[n]=function(){var n=this._wrapped;return null!=n&&(n=r.apply(n,arguments)),Xr(this,n)}}));var Zr=Yr({__proto__:null,VERSION:n,restArguments:j,isObject:_,isNull:function(n){return null===n},isUndefined:w,isBoolean:A,isElement:function(n){return!(!n||1!==n.nodeType)},isString:S,isNumber:O,isDate:M,isRegExp:E,isError:B,isSymbol:N,isArrayBuffer:I,isDataView:q,isArray:U,isFunction:D,isArguments:L,isFinite:function(n){return!N(n)&&d(n)&&!isNaN(parseFloat(n))},isNaN:$,isTypedArray:X,isEmpty:function(n){if(null==n)return!0;var r=Y(n);return"number"==typeof r&&(U(n)||S(n)||L(n))?0===r:0===Y(nn(n))},isMatch:rn,isEqual:function(n,r){return on(n,r)},isMap:dn,isWeakMap:gn,isSet:bn,isWeakSet:mn,keys:nn,allKeys:an,values:jn,pairs:function(n){for(var r=nn(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=[r[u],n[r[u]]];return e},invert:_n,functions:wn,methods:wn,extend:xn,extendOwn:Sn,assign:Sn,defaults:On,create:function(n,r){var t=Mn(n);return r&&Sn(t,r),t},clone:function(n){return _(n)?U(n)?n.slice():xn({},n):n},tap:function(n,r){return r(n),n},get:In,has:function(n,r){for(var t=(r=Bn(r)).length,e=0;e<t;e++){var u=r[e];if(!W(n,u))return!1;n=n[u]}return!!t},mapObject:function(n,r,t){r=Pn(r,t);for(var e=nn(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=r(n[a],a,n)}return o},identity:Tn,constant:C,noop:qn,toPath:En,property:Dn,propertyOf:function(n){return null==n?qn:function(r){return In(n,r)}},matcher:kn,matches:kn,times:function(n,r,t){var e=Array(Math.max(0,n));r=Rn(r,t,1);for(var u=0;u<n;u++)e[u]=r(u);return e},random:Un,now:Wn,escape:$n,unescape:Cn,templateSettings:Kn,template:function(n,r,t){!r&&t&&(r=t),r=On({},r,tn.templateSettings);var e=RegExp([(r.escape||Jn).source,(r.interpolate||Jn).source,(r.evaluate||Jn).source].join("|")+"|$","g"),u=0,o="__p+='";n.replace(e,(function(r,t,e,i,a){return o+=n.slice(u,a).replace(Hn,Qn),u=a+r.length,t?o+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":e?o+="'+\n((__t=("+e+"))==null?'':__t)+\n'":i&&(o+="';\n"+i+"\n__p+='"),r})),o+="';\n";var i,a=r.variable;if(a){if(!Xn.test(a))throw new Error("variable is not a bare identifier: "+a)}else o="with(obj||{}){\n"+o+"}\n",a="obj";o="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{i=new Function(a,"_",o)}catch(n){throw n.source=o,n}var f=function(n){return i.call(this,n,tn)};return f.source="function("+a+"){\n"+o+"}",f},result:function(n,r,t){var e=(r=Bn(r)).length;if(!e)return D(t)?t.call(n):t;for(var u=0;u<e;u++){var o=null==n?void 0:n[r[u]];void 0===o&&(o=t,u=e),n=D(o)?o.call(n):o}return n},uniqueId:function(n){var r=++Yn+"";return n?n+r:r},chain:function(n){var r=tn(n);return r._chain=!0,r},iteratee:Vn,partial:nr,bind:rr,bindAll:ur,memoize:function(n,r){var t=function(e){var u=t.cache,o=""+(r?r.apply(this,arguments):e);return W(u,o)||(u[o]=n.apply(this,arguments)),u[o]};return t.cache={},t},delay:or,defer:ir,throttle:function(n,r,t){var e,u,o,i,a=0;t||(t={});var f=function(){a=!1===t.leading?0:Wn(),e=null,i=n.apply(u,o),e||(u=o=null)},c=function(){var c=Wn();a||!1!==t.leading||(a=c);var l=r-(c-a);return u=this,o=arguments,l<=0||l>r?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=Wn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=Wn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return nr(r,n)},negate:ar,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}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:fr,once:cr,findKey:lr,findIndex:pr,findLastIndex:vr,sortedIndex:hr,indexOf:dr,lastIndexOf:gr,find:br,detect:br,findWhere:function(n,r){return br(n,kn(r))},each:mr,forEach:mr,map:jr,collect:jr,reduce:wr,foldl:wr,inject:wr,reduceRight:Ar,foldr:Ar,filter:xr,select:xr,reject:function(n,r,t){return xr(n,ar(Pn(r)),t)},every:Sr,all:Sr,some:Or,any:Or,contains:Mr,includes:Mr,include:Mr,invoke:Er,pluck:Br,where:function(n,r){return xr(n,kn(r))},max:Nr,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=tr(n)?n:jn(n)).length;a<f;a++)null!=(e=n[a])&&e<o&&(o=e);else r=Pn(r,t),mr(n,(function(n,t,e){((u=r(n,t,e))<i||u===1/0&&o===1/0)&&(o=n,i=u)}));return o},shuffle:function(n){return kr(n,1/0)},sample:kr,sortBy:function(n,r,t){var e=0;return r=Pn(r,t),Br(jr(n,(function(n,t,u){return{value:n,index:e++,criteria:r(n,t,u)}})).sort((function(n,r){var t=n.criteria,e=r.criteria;if(t!==e){if(t>e||void 0===t)return 1;if(t<e||void 0===e)return-1}return n.index-r.index})),"value")},groupBy:Rr,indexBy:Fr,countBy:Vr,partition:Pr,toArray:Tr,size:function(n){return null==n?0:tr(n)?n.length:nn(n).length},pick:Ur,omit:Wr,first:Lr,head:Lr,take:Lr,initial:zr,last:function(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[n.length-1]:$r(n,Math.max(0,n.length-r))},rest:$r,tail:$r,drop:$r,compact:function(n){return xr(n,Boolean)},flatten:function(n,r){return er(n,r,!1)},without:Kr,uniq:Jr,unique:Jr,union:Gr,intersection:function(n){for(var r=[],t=arguments.length,e=0,u=Y(n);e<u;e++){var o=n[e];if(!Mr(r,o)){var i;for(i=1;i<t&&Mr(arguments[i],o);i++);i===t&&r.push(o)}}return r},difference:Cr,unzip:Hr,transpose:Hr,zip:Qr,object:function(n,r){for(var t={},e=0,u=Y(n);e<u;e++)r?t[n[e]]=r[e]:t[n[e][0]]=n[e][1];return t},range:function(n,r,t){null==r&&(r=n||0,n=0),t||(t=r<n?-1:1);for(var e=Math.max(Math.ceil((r-n)/t),0),u=Array(e),o=0;o<e;o++,n+=t)u[o]=n;return u},chunk:function(n,r){if(null==r||r<1)return[];for(var t=[],e=0,u=n.length;e<u;)t.push(i.call(n,e,e+=r));return t},mixin:Yr,default:tn});return Zr._=Zr,Zr})); 766/** 767 * xbe4x is javascript implementation of the original ECMAScript for XML (E4X) 768 * Specification (ECMA-357) December 2005. This implementation is designed to emulate 769 * the implementation that is used in SpiderMonkey (Mozilla's JavaScript(TM) Engine) 770 * and therefore Firefox, Thunderbird, and most other Gecko based applications. 771 * Because the Mozilla implementation leaves out certain features of the 772 * specification, so does xbe4x. Please read the README file for a further 773 * explanation of these issues. 774 * 775 * 776 * @author Sam Shull <http://samshull.blogspot.com/> 777 * @version 0.1 778 * 779 * @copyright Copyright (c) 2009 Sam Shull <http://samshull.blogspot.com/> 780 * @license <http://www.opensource.org/licenses/mit-license.html> 781 * 782 * Permission is hereby granted, free of charge, to any person obtaining a copy 783 * of this software and associated documentation files (the "Software"), to deal 784 * in the Software without restriction, including without limitation the rights 785 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 786 * copies of the Software, and to permit persons to whom the Software is 787 * furnished to do so, subject to the following conditions: 788 * 789 * The above copyright notice and this permission notice shall be included in 790 * all copies or substantial portions of the Software. 791 * 792 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 793 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 794 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 795 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 796 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 797 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 798 * THE SOFTWARE. 799 * 800 * 801 * CHANGES: 802 */ 803 804//this doesn't load if window.XML is already defined 805if (!this.XML) 806{ 807 (function () 808 { 809 /* 810 * 811 * 812 */ 813 var undefined, p, 814 window = this, 815 dns = [], 816 defaultNamespace = "", 817 ELEMENT_NODE = 1, 818 ATTRIBUTE_NODE = 2, 819 TEXT_NODE = 3, 820 CDATA_SECTION_NODE = 4, 821 ENTITY_REFERENCE_NODE = 5, 822 ENTITY_NODE = 6, 823 PROCESSING_INSTRUCTION_NODE = 7,
824 COMMENT_NODE = 8, 825 DOCUMENT_NODE = 9, 826 DOCUMENT_TYPE_NODE = 10, 827 DOCUMENT_FRAGMENT_NODE = 11, 828 NOTATION_NODE = 12, 829 isNSDef = /^xmlns:([\w\-]+)/i, 830 toString = ({}).toString, 831 propertyIsEnumerable = ({}).propertyIsEnumerable, 832 hasOwnProperty = ({}).hasOwnProperty, 833 defaultXMLProperties = ",prototype,ignoreComments,ignoreProcessingInstructions,ignoreWhitespace," + 834 "prettyPrinting,prettyIndent,settings,defaultSettings,setSettings,settings," + 835 "propertyIsEnumerable,hasOwnProperty,_setDefaultNamespace,", 836 defaultXMLPrototype = ",_Class,_Name,_Parent,_Value,_InScopeNamespaces,_Attributes,_Children,_Node", 837 defaultXMLListPrototype = ",_Class,_Value,_Children,_TargetObject,_TargetProperty", 838 xmlDoc = parse("<x/>"), 839 piName = /^[\w\-]+\s*/, 840 XSLT_NS = "http://www.w3.org/1999/XSL/Transform"; 841 842 /** 843 * 844 * 845 * @param String | XML $string 846 * @returns XML 847 * @throws SyntaxError 848 */ 849 function XML ($string) 850 { 851 if (!(this instanceof XML)) 852 { 853 return ToXML($string); 854 } 855 856 var x, i, l; 857 858 this._Class = "text"; 859 860 this._Name = null; 861 862 this._Value = null; 863 864 this._Parent = null; 865 866 this._InScopeNamespaces = {}; 867 868 this._DefaultNamespace = null; 869 870 this._Attributes = {}; 871 872 this._Children = []; 873 874 this[0] = this; 875 876 /** 877 * 878 * 879 * 880 */ 881 switch (typeof($string)) 882 { 883 case "undefined": 884 case "null": 885 break; 886 case "number": 887 case "boolean": $string = ToString($string); 888 case "string": 889 890 x = ToXML(trim($string)); 891 if (x) 892 { 893 if (x.length() ===1) 894 { 895 this._Class = x._Class; 896 this._Name = x._Name; 897 this._Value = x._Value; 898 this._InScopeNamespaces = x._InScopeNamespaces; 899 this._DefaultNamespace = x._DefaultNamespace; 900 this._Attributes = x._Attributes; 901 902 for (i = 0, l = x._Children.length; i < l; ++i) 903 { 904 this._Children[i] = x._Children[i]; 905 this._Children[i]._Parent = this; 906 } 907 908 break; 909 } 910 } 911 912 throw new SyntaxError(); 913 break; 914 default: 915 if ($string instanceof XML) 916 { 917 if ($string.length() ===1) 918 { 919 x = $string; 920 this._Class = x._Class; 921 this._Name = x._Name; 922 this._Value = x._Value; 923 this._InScopeNamespaces = x._InScopeNamespaces; 924 this._DefaultNamespace = x._DefaultNamespace; 925 this._Attributes = x._Attributes; 926 927 for (i = 0, l = x._Children.length; i < l; ++i) 928 { 929 this._Children[i] = x._Children[i]; 930 this._Children[i]._Parent = this; 931 } 932 } 933 } 934 break; 935 } 936 } 937 938 /** 939 * Ignore XML comments. (Default: true.) 940 * 941 * @static 942 * @param Namespace ns 943 * @returns void 944 */ 945 XML.setDefaultNamespace = function (ns) 946 { 947 dns.unshift(defaultNamespace || ""); 948 defaultNamespace = Namespace(ns); 949 return null; 950 }; 951 952 /** 953 * Use this function to restore the default namespace 954 * to the previous namespace 955 * 956 */ 957 XML.restoreDefaultNamespace = function () 958 { 959 defaultNamespace = dns.shift() || ""; 960 return null; 961 }; 962 963 /** 964 * 965 * 966 * 967 */ 968 XML.load = function (pathToFile, onload) 969 { 970 var xhr = isActiveXSupported("Microsoft.XMLHTTP") && new ActiveXObject("Microsoft.XMLHTTP") || new XMLHttpRequest(), 971 async = ({}).toString.call(onload || {}) == "[object Function]"; 972 973 xhr.open("GET", pathToFile, async); 974 975 if (async) 976 { 977 if (!!xhr.addEventListener) 978 { 979 xhr.addEventListener("load", loaded, false); 980 } 981 else 982 { 983 xhr.onreadystatechange = function () 984 { 985 if (xhr.readyState == 4 && xhr.status == 200) 986 { 987 loaded(); 988 } 989 }; 990 } 991 } 992 993 xhr.send(null); 994 995 return async ? xhr : loaded(1); 996 997 function loaded (ret) 998 { 999 var x = new XML((xhr.responseText||"").replace(/\s*<\?xml.*?\?>/,"")); 1000 return ret ? x : onload(x); 1001 } 1002 }; 1003 1004 /** 1005 * Ignore XML comments. (Default: true.) 1006 * 1007 * @static 1008 * @var Boolean 1009 */ 1010 XML.ignoreComments = true; 1011 1012 /** 1013 * Ignore XML processing instructions. (Default: true.) 1014 * 1015 * @static 1016 * @var Boolean 1017 */ 1018 XML.ignoreProcessingInstructions = true; 1019 1020 /** 1021 * Ignore whitespace. (Default: true.) 1022 * 1023 * @static 1024 * @var Boolean 1025 */ 1026 XML.ignoreWhitespace = true; 1027 1028 /** 1029 * Pretty-print XML output with toXMLString() etc. (Default: true.) 1030 * 1031 * @static 1032 * @var Boolean 1033 */ 1034 XML.prettyPrinting = true; 1035 1036 /** 1037 * Pretty indent level for child nodes. (Default: 2.) 1038 * 1039 * @static 1040 * @var Number 1041 */ 1042 XML.prettyIndent = 2; 1043 1044 //There are also three methods to more easily apply and restore settings for use, say, within a function. 1045 1046 /** 1047 * Get an Object containing the above settings. 1048 * 1049 * @static 1050 * @returns Object 1051 */ 1052 XML.settings = function () 1053 { 1054 return { 1055 ignoreComments: XML.ignoreComments, 1056 ignoreProcessingInstructions: XML.ignoreProcessingInstructions, 1057 ignoreWhitespace: XML.ignoreWhitespace, 1058 prettyPrinting: XML.prettyPrinting, 1059 prettyIndent: XML.prettyIndent 1060 }; 1061 }; 1062 1063 /**
1064 * Get an object containing the default settings. 1065 * 1066 * @static 1067 * @returns Object 1068 */ 1069 XML.defaultSettings = function () 1070 { 1071 return { 1072 ignoreComments: true, 1073 ignoreProcessingInstructions: true, 1074 ignoreWhitespace: true, 1075 prettyPrinting: true, 1076 prettyIndent: 2 1077 }; 1078 }; 1079 1080 /** 1081 * Set XML settings from, e.g., an object returned by XML.settings(). 1082 * 1083 * 1084 * @static 1085 * @param Object settings 1086 * @returns void 1087 */ 1088 XML.setSettings = function (settings) 1089 { 1090 var p; 1091 settings = settings || XML.settings(); 1092 for (p in settings) 1093 { 1094 switch (p) 1095 { 1096 case "ignoreComments": XML.ignoreComments = !!settings[p]; 1097 case "ignoreProcessingInstructions": XML.ignoreProcessingInstructions = !!settings[p]; 1098 case "ignoreWhitespace": XML.ignoreWhitespace = !!settings[p]; 1099 case "prettyPrinting": XML.prettyPrinting = !!settings[p]; 1100 case "prettyIndent": XML.prettyIndent = parseInt(settings[p]) || 0; 1101 } 1102 } 1103 return null; 1104 }; 1105 1106 /** 1107 * 1108 * 1109 * @static 1110 * @param String name 1111 * @returns Boolean 1112 */ 1113 XML.hasOwnProperty = function (name) 1114 { 1115 return defaultXMLProperties.indexOf("," + name + ",") ===-1 1116 && hasOwnProperty.call(XML, name); 1117 }; 1118 1119 /** 1120 * 1121 * 1122 * @static 1123 * @param String name 1124 * @returns Boolean 1125 */ 1126 XML.propertyIsEnumerable = function (name) 1127 { 1128 return name !== "prototype" 1129 && name in XML 1130 && toString.call(XML[name]) != "[object Function]" 1131 && propertyIsEnumerable.call(XML, name); 1132 }; 1133 1134 /** 1135 * 1136 * 1137 * @static 1138 * @returns String 1139 */ 1140 XML.toString = function () 1141 { 1142 return "function XML() {\n [native code] \n}"; 1143 }; 1144 1145 /** 1146 * 1147 * 1148 * @param String | Namespace namespace 1149 * @returns XML 1150 */ 1151 XML.prototype.addNamespace = function (namespace) 1152 { 1153 AddInScopeNamespace.call(this, Namespace(namespace)); 1154 return this; 1155 }; 1156 1157 /** 1158 * 1159 * 1160 * @param String child 1161 * @returns XML 1162 */ 1163 XML.prototype.appendChild = function (child,isChildElement) 1164 { 1165 isChildElement = isChildElement !== undefined ? isChildElement : false; 1166 var children = Get.call(this, "*"); 1167 children.Put(children.length(), child,isChildElement); 1168 return this; 1169 }; 1170 1171 /** 1172 * 1173 * 1174 * @param String | AttributeName | QName attributeName 1175 * @returns XML 1176 */ 1177 XML.prototype.attribute = function (attributeName) 1178 { 1179 return Get.call(this, ToAttributeName(attributeName), true); 1180 }; 1181 1182 /** 1183 * 1184 * 1185 * @returns XMLList 1186 */ 1187 XML.prototype.attributes = function () 1188 { 1189 return Get.call(this, ToAttributeName("*")); 1190 }; 1191 1192 /** 1193 * 1194 * 1195 * @param String propertyName 1196 * @returns XMLList 1197 */ 1198 XML.prototype.child = function (propertyName) 1199 { 1200 var temporary; 1201 1202 if (parseInt(propertyName)+"" == propertyName) 1203 { 1204 temporary = Get.call(this, "*"); 1205 temporary = GetList.call(temporary, propertyName); 1206 return temporary || new XMLList(); 1207 } 1208 1209 temporary = ToXMLList( Get.call(this, propertyName) ); 1210 1211 return temporary; 1212 }; 1213 1214 /** 1215 * 1216 * 1217 * @returns Number 1218 */ 1219 XML.prototype.childIndex = function () 1220 { 1221 var parent = this._Parent, q, l; 1222 1223 if (!parent || this._Class === "attribute") 1224 { 1225 return -1; 1226 } 1227 1228 for (q = 0, l = parent._Children.length; q < l; ++q) 1229 { 1230 if (parent._Children[q] === this) 1231 { 1232 return q; 1233 } 1234 } 1235 1236 return -1; 1237 }; 1238 1239 /** 1240 * 1241 * 1242 * @returns XMLList 1243 */ 1244 XML.prototype.children = function () 1245 { 1246 return Get.call(this, "*"); 1247 }; 1248 1249 /** 1250 * 1251 * 1252 * @returns XMLList 1253 */ 1254 XML.prototype.comments = function () 1255 { 1256 var list = new XMLList(), i = 0, l = this._Children.length; 1257 list._TargetObject = this; 1258 list._TargetProperty = null; 1259 1260 for (; i < l; ++i) 1261 { 1262 if (this._Children[i]._Class === "comment") 1263 { 1264 list.Append(this._Children[i]); 1265 } 1266 } 1267 1268 return list; 1269 }; 1270 1271 /** 1272 * 1273 * 1274 * @param XML value 1275 * @returns Boolean 1276 */ 1277 XML.prototype.contains = function (value) 1278 { 1279 return this == value; 1280 }; 1281 1282 /** 1283 * 1284 * 1285 * @returns XML 1286 */ 1287 XML.prototype.copy = function () 1288 { 1289 return DeepCopy.call(this); 1290 }; 1291 1292 /** 1293 * 1294 * 1295 * @param String | QName name 1296 * @returns XMLList 1297 */ 1298 XML.prototype.descendants = function (name) 1299 { 1300 return Descendants.call(this, name || "*"); 1301 }; 1302 1303 /** 1304 * 1305 * 1306 * @param String | QName | AttributeName name 1307 * @returns XMLList 1308 */ 1309 XML.prototype.elements = function (name) 1310 { 1311 name = ToXMLName(name || "*"); 1312 var list = new XMLList(), i = 0, l = this._Children.length; 1313 list._TargetObject = this; 1314 list._TargetProperty = name; 1315 1316 for (; i < l; ++i) 1317 { 1318 if ( 1319 this._Children[i]._Class === "element" 1320 && (name.localName === "*" || name.localName === this._Children[i]._Name.localName) 1321 && (name.uri == null || name.uri === this._Children[i]._Name.uri) 1322 ) 1323 { 1324 list.Append(this._Children[i]); 1325 } 1326 } 1327 1328 return list; 1329 }; 1330 1331 /** 1332 * 1333 * 1334 * @param String name 1335 * @returns Boolean 1336 */ 1337 XML.prototype.hasOwnProperty = function (name) 1338 { 1339 return HasProperty.call(this, name) || (defaultXMLPrototype.indexOf("," + name +",") === -1 && hasOwnProperty.call(this, name)); 1340 }; 1341 1342 /** 1343 * 1344 * 1345 * @returns Boolean 1346 */ 1347 XML.prototype.hasComplexContent = function () 1348 { 1349 if ((",attribute,comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1350 { 1351 return false;
1352 } 1353 1354 for (var i = 0, l = this._Children.length; i < l; ++i) 1355 { 1356 if (this._Children[i]._Class === "element") 1357 { 1358 return true; 1359 } 1360 } 1361 1362 return false; 1363 }; 1364 1365 /** 1366 * 1367 * 1368 * @returns Boolean 1369 */ 1370 XML.prototype.hasSimpleContent = function () 1371 { 1372 if ((",comment,processing-instruction,").indexOf("," + this._Class + ",") > -1) 1373 { 1374 return false; 1375 } 1376 1377 for (var i = 0, l = this._Children.length; i < l; ++i) 1378 { 1379 if (this._Children[i]._Class === "element") 1380 { 1381 return false; 1382 } 1383 } 1384 1385 return true; 1386 }; 1387 1388 /** 1389 * 1390 * 1391 * @returns Array 1392 */ 1393 XML.prototype.inScopeNamespaces = function () 1394 { 1395 var y = this, inScopeNS = {}, p, a = []; 1396 1397 while (y) 1398 { 1399 for (p in y._InScopeNamespaces) 1400 { 1401 if (!inScopeNS[p]) 1402 { 1403 inScopeNS[p] = y._InScopeNamespaces[p]; 1404 } 1405 } 1406 1407 y = y.parent(); 1408 } 1409 1410 if (this._DefaultNamespace) 1411 { 1412 inScopeNS[""] = this._DefaultNamespace; 1413 } 1414 1415 for (p in inScopeNS) 1416 { 1417 a[a.length] = inScopeNS[p]; 1418 } 1419 1420 return a; 1421 }; 1422 1423 /** 1424 * 1425 * 1426 * @param XML child1 1427 * @param XML child2 1428 * @returns XML | null 1429 */ 1430 XML.prototype.insertChildAfter = function (child1, child2) 1431 { 1432 if ((",attribute,comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1433 { 1434 return null; 1435 } 1436 1437 /* 1438 //this is disabled, because it doesn't work in 1439 //Firefox according to the spec 1440 if (!child2) 1441 { 1442 Insert.call(this, 0, child1); 1443 return this; 1444 } 1445 else if (!child1) 1446 { 1447 Insert.call(this, 0, child2); 1448 return this; 1449 } 1450 else 1451 */ 1452 1453 if (!child1){ 1454 Insert.call(this, 0, child2); 1455 return this; 1456 } 1457 if (!child2){ 1458 Insert.call(this, 0, child1); 1459 return this; 1460 } 1461 1462 if (child1 instanceof XML) 1463 { 1464 Insert.call(this, child1.childIndex() + 1, child2); 1465 return this; 1466 } 1467 1468 return null; 1469 }; 1470 1471 /** 1472 * 1473 * 1474 * 1475 * @param XML child1 1476 * @param XML child2 1477 * @returns XML | null 1478 */ 1479 XML.prototype.insertChildBefore = function (child1, child2) 1480 { 1481 if ((",attribute,comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1482 { 1483 return null; 1484 } 1485 1486 /* 1487 //this is disabled, because it doesn't work in 1488 //Firefox according to the spec 1489 if (!child1) 1490 { 1491 Insert.call(this, this._Children.length, child2); 1492 return this; 1493 } 1494 else if (!child2) 1495 { 1496 Insert.call(this, this._Children.length, child1); 1497 return this; 1498 } 1499 else 1500 */ 1501 1502 if (child1 instanceof XML) 1503 { 1504 Insert.call(this, child1.childIndex(), child2); 1505 return this; 1506 } 1507 1508 return null; 1509 }; 1510 1511 /** 1512 * 1513 * 1514 * @returns Number 1515 */ 1516 XML.prototype.length = function () 1517 { 1518 return 1; 1519 }; 1520 1521 /** 1522 * 1523 * 1524 * @returns String | null 1525 */ 1526 XML.prototype.localName = function () 1527 { 1528 return this._Name === null ? null : this._Name.localName; 1529 }; 1530 1531 /** 1532 * 1533 * 1534 * return QName 1535 */ 1536 XML.prototype.name = function () 1537 { 1538 return this._Name; 1539 }; 1540 1541 /** 1542 * 1543 * 1544 * @param String prefix 1545 * @returns Namespace 1546 */ 1547 XML.prototype.namespace = function (prefix) 1548 { 1549 var y = this, inScopeNS = {}, p; 1550 1551 while (y) 1552 { 1553 for (p in y._InScopeNamespaces) 1554 { 1555 if (!inScopeNS[p]) 1556 { 1557 inScopeNS[p] = y._InScopeNamespaces[p]; 1558 } 1559 } 1560 1561 y = y.parent(); 1562 } 1563 1564 if (prefix === undefined) 1565 { 1566 if ((",comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1567 { 1568 return null; 1569 } 1570 1571 return GetNamespace(this._Name, inScopeNS); 1572 } 1573 1574 prefix = ToString(prefix); 1575 1576 for (p in inScopeNS) 1577 { 1578 if (inScopeNS[p].prefix === prefix) 1579 { 1580 return inScopeNS[p]; 1581 } 1582 } 1583 1584 return null; 1585 }; 1586 1587 /** 1588 * 1589 * 1590 * @returns Array 1591 */ 1592 XML.prototype.namespaceDeclarations = function () 1593 { 1594 if ((",attribute,comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1595 { 1596 return []; 1597 } 1598 1599 var a = [], y = this._Parent, ancestorNS = {}, p; 1600 1601 while (y) 1602 { 1603 for (p in y._InScopeNamespaces) 1604 { 1605 if (!ancestorNS[p]) 1606 { 1607 ancestorNS[p] = y._InScopeNamespaces[p]; 1608 } 1609 } 1610 1611 y = y._Parent; 1612 } 1613 1614 for (p in this._InScopeNamespaces) 1615 { 1616 if (p != "" && (!ancestorNS[p] || ancestorNS[p].uri != this._InScopeNamespaces[p])) 1617 { 1618 a[a.length] = this._InScopeNamespaces[p]; 1619 } 1620 else if(p === "" && !this._Parent) 1621 { 1622 a[a.length] = this._InScopeNamespaces[p]; 1623 } 1624 } 1625 1626 return a; 1627 }; 1628 1629 /** 1630 * 1631 * 1632 * @returns String 1633 */ 1634 XML.prototype.nodeKind = function () 1635 { 1636 return this._Class; 1637 }; 1638 1639 /** 1640 * 1641 * 1642 * @returns XML 1643 */ 1644 XML.prototype.normalize = function () 1645 { 1646 for (var i = 0, l = this._Children.length; i < l;) 1647 { 1648 if (this._Children[i]._Class === "element") 1649 { 1650 this._Children[i].normalize(); 1651 ++i; 1652 } 1653 else if (this._Children[i]._Class === "text") 1654 { 1655 while (i+1 < this._Children.length && this._Children[i+1]._Class === "text") 1656 { 1657 this._Children[i]._Value = (this._Children[i]._Value || "") + (this._Children[i+1]._Value || ""); 1658 DeleteByIndex.call(this, i+1); 1659 } 1660 1661 if (this._Children[i]._Value.length === 0) 1662 { 1663 DeleteByIndex.call(this, i); 1664 } 1665 else 1666 { 1667 ++i; 1668 } 1669 } 1670 else 1671 { 1672 ++i; 1673 } 1674 } 1675 1676 return this; 1677 }; 1678 1679 /** 1680 * 1681 * 1682 * @returns XML | null 1683 */ 1684 XML.prototype.parent = function () 1685 { 1686 return this._Parent; 1687 }; 1688 1689 /** 1690 * 1691 * 1692 * @param String name 1693 * @returns XMLList 1694 */ 1695 XML.prototype.processingInstructions = function (name) 1696 { 1697 name = ToXMLName(name || "*"); 1698 1699 var list = new XMLList(), i = 0, l = this._Children.length; 1700 list._TargetObject = this; 1701 list._TargetProperty = null; 1702 1703 for (; i < l; ++i) 1704 { 1705 if (this._Children[i]._Class === "processing-instruction" 1706 && (name.localName === "*" || name.localName === this._Children[i]._Name.localName) 1707 ) 1708 { 1709 list.Append(this._Children[i]); 1710 } 1711 } 1712 1713 return list; 1714 }; 1715 1716 /** 1717 * 1718 * 1719 * @param XML value 1720 * @returns XML 1721 */ 1722 XML.prototype.prependChild = function (value) 1723 { 1724 Insert.call(this, 0, value); 1725 return this; 1726 }; 1727 1728 1729 XML.prototype.findFirstElement = function (value) 1730 { 1731 var list = []; 1732 list = this.elements(value)._Children; 1733 if(list.length == 0){ 1734 var children = this.children(); 1735 var xml; 1736 for(var i=0;i<children.length();i++){ 1737 xml = children[i]; 1738 var sublist = xml.findFirstElement(value); 1739 if(sublist.length>0) 1740 return sublist; 1741 } 1742 } 1743 return list; 1744 }; 1745 1746 1747 /** 1748 * 1749 * 1750 * @param String name 1751 * @returns Boolean 1752 */ 1753 XML.prototype.propertyIsEnumerable = function (name) 1754 { 1755 return name == "0"; 1756 }; 1757 1758 /** 1759 * 1760 * 1761 * @param Namespace | String namespace 1762 * @returns XML 1763 */ 1764 XML.prototype.removeNamespace = function (namespace) 1765 { 1766 if ((",attribute,comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1767 { 1768 return this; 1769 } 1770 1771 var ns = Namespace(namespace), thisNS = GetNamespace(this._Name, this._InScopeNamespaces), p, l; 1772 1773 if (thisNS == ns) 1774 { 1775 return this; 1776 } 1777 1778 /* 1779 //firefox does not remove the references to the 1780 //namespaces in attributes -- so we wont either 1781 for (p in this._Attributes) 1782 { 1783 if (GetNamespace(this._Attributes[p]._Name, this._InScopeNamespaces).uri == ns.uri) 1784 { 1785 this._Attributes[p]._Name = new QName(ns, this._Attributes[p].localName()); 1786 } 1787 } 1788 //*/ 1789 1790 if (ns.prefix == undefined) 1791 { 1792 for (p in this._InScopeNamespaces) 1793 { 1794 if (this._InScopeNamespaces[p].uri === ns.uri) 1795 { 1796 try{ 1797 this._InScopeNamespaces[p] = null; 1798 delete this._InScopeNamespaces[p]; 1799 }catch(e){} 1800 } 1801 } 1802 } 1803 else if (this._InScopeNamespaces[ns.prefix] && this._InScopeNamespaces[ns.prefix].uri === ns.uri) 1804 { 1805 try{ 1806 this._InScopeNamespaces[ns.prefix] = null; 1807 delete this._InScopeNamespaces[ns.prefix]; 1808 }catch(e){} 1809 } 1810 1811 for (p = 0, l = this._Children.length; p < l; ++p) 1812 { 1813 if (this._Children[p]._Class === "element") 1814 { 1815 this._Children[p].removeNamespace(ns); 1816 } 1817 } 1818 1819 return this; 1820 }; 1821 1822 /** 1823 * 1824 * 1825 * @param String propertyName 1826 * @param XML value 1827 * @returns XML 1828 */ 1829 XML.prototype.replace = function (propertyName, value) 1830 { 1831 if ((",attribute,comment,processing-instruction,text,").indexOf("," + this._Class + ",") > -1) 1832 { 1833 return this; 1834 } 1835 1836 var c = value instanceof XML ? DeepCopy.call(value) : ToString(value), n, i, k; 1837 1838 if (parseInt(propertyName)+"" == propertyName) 1839 { 1840 Replace.call(this, propertyName, c); 1841 return this; 1842 } 1843 1844 /* 1845 Basically Firefox does not appear to follow the rules set forth in the spec
1846 so, we are just going to fix this so that we do what firefox does 1847 if the propertyName is not an integer: 1848 if value is a XMLList setChildren 1849 otherwise do nothing 1850 */ 1851 1852 if (c instanceof XMLList) 1853 { 1854 this.setChildren(c); 1855 } 1856 1857 return this; 1858 1859 /* 1860 Leave the rest of these rules in place, just in case 1861 */ 1862 1863 n = QName(propertyName); 1864 k = this._Children.length; 1865 1866 while (--k > -1) 1867 { 1868 if ( 1869 (n.localName === "*" || (this._Children[k]._Class === "element" && this._Children[k]._Name.localName===n.localName)) 1870 && (n.uri == null || (this._Children[k]._Class === "element" && n.uri === this._Children[k]._Name.uri )) 1871 ) 1872 { 1873 if (i !== undefined) 1874 { 1875 DeleteByIndex.call(this, i); 1876 } 1877 1878 i = k; 1879 } 1880 } 1881 1882 if (i !== undefined) 1883 { 1884 Replace.call(this, i, c); 1885 } 1886 1887 return this; 1888 }; 1889 1890 /** 1891 * 1892 * 1893 * @param XML value 1894 * @returns XML 1895 */ 1896 XML.prototype.setChildren = function (value) 1897 { 1898 this.Put("*", value); 1899 return this; 1900 }; 1901 1902 /** 1903 * 1904 * 1905 * @param String name 1906 * @returns void 1907 */ 1908 XML.prototype.setLocalName = function (name) 1909 { 1910 if ((",comment,text,").indexOf("," + this._Class + ",") > -1) 1911 { 1912 return null; 1913 } 1914 1915 this._Name.localName = name instanceof QName ? name.localName : ToString(name); 1916 }; 1917 1918 /** 1919 * 1920 * 1921 * @param QName | String name 1922 * @returns null 1923 */ 1924 XML.prototype.setName = function (name) 1925 { 1926 if ((",comment,text,").indexOf("," + this._Class + ",") > -1) 1927 { 1928 return null; 1929 } 1930 1931 if (name instanceof QName && name.uri == null) 1932 { 1933 name = name.localName; 1934 } 1935 1936 var n = QName(name); 1937 1938 if (this._Class === "processing-instruction") 1939 { 1940 n.uri = ""; 1941 } 1942 1943 this._DefaultNamespace = new Namespace(n.prefix, n.uri); 1944 1945 this._Name = n; 1946 1947 if (this._Class === "attribute") 1948 { 1949 if (this._Parent) 1950 { 1951 AddInScopeNamespace.call(this._Parent, this._DefaultNamespace); 1952 } 1953 } 1954 else if (this._Class === "element") 1955 { 1956 AddInScopeNamespace.call(this, this._DefaultNamespace); 1957 } 1958 else if ((",comment,text,processing-instruction,").indexOf("," + this._Class + ",") > -1) 1959 { 1960 return null; 1961 } 1962 1963 this._Name = new QName(this._DefaultNamespace, this._Name.localName); 1964 1965 return null; 1966 }; 1967 1968 /** 1969 * 1970 * 1971 * @param Namespace | String ns 1972 * @returns null 1973 */ 1974 XML.prototype.setNamespace = function (ns) 1975 { 1976 //processing-instruction, 1977 if ((",comment,text,").indexOf("," + this._Class + ",") > -1) 1978 { 1979 return null; 1980 } 1981 1982 this._DefaultNamespace = Namespace(ns); 1983 1984 this._Name = new QName(this._DefaultNamespace, this._Name.localName); 1985 1986 if (this._Class === "attribute") 1987 { 1988 if (this._Parent) 1989 { 1990 AddInScopeNamespace.call(this._Parent, this._DefaultNamespace); 1991 } 1992 } 1993 else if (this._Class === "element") 1994 { 1995 AddInScopeNamespace.call(this, this._DefaultNamespace); 1996 } 1997 1998 return null; 1999 }; 2000 2001 /** 2002 * 2003 * 2004 * @returns XMLList 2005 */ 2006 XML.prototype.text = function () 2007 { 2008 var list = new XMLList(), i = 0, l = this._Children.length; 2009 list._TargetObject = this; 2010 list._TargetProperty = null; 2011 2012 for (; i < l; ++i) 2013 { 2014 if (this._Children[i]._Class === "text") 2015 { 2016 list.Append(this._Children[i]); 2017 } 2018 } 2019 2020 return list; 2021 }; 2022 2023 /** 2024 * 2025 * 2026 * @returns String 2027 */ 2028 XML.prototype.toString = function () 2029 { 2030 return ToString(this); 2031 }; 2032 2033 /** 2034 * 2035 * 2036 * @returns String 2037 */ 2038 XML.prototype.toXMLString = function () 2039 { 2040 return ToXMLString(this); 2041 }; 2042 2043 /** 2044 * 2045 * 2046 * @returns XML 2047 */ 2048 XML.prototype.valueOf = function () 2049 { 2050 return this; 2051 }; 2052 2053 /** 2054 * 2055 * 2056 * 2057 * @access private 2058 * @param String | QName PropertyName 2059 * @param XML | String Value 2060 * @returns null 2061 * @throws TypeError 2062 */ 2063 XML.prototype.Put = function (PropertyName, Value) 2064 { 2065 if (parseInt(PropertyName)+"" == PropertyName) 2066 { 2067 throw new TypeError(); 2068 } 2069 2070 if ((",text,comment,processing-instruction,attribute,").indexOf("," + this._Class + ",") > -1) 2071 { 2072 return null; 2073 } 2074 2075 var c = (!(Value instanceof XML) || (",text,attribute,").indexOf("," + Value._Class+",") > -1) 2076 ? ToString(Value) 2077 : DeepCopy.call(Value), 2078 n = ToXMLName(PropertyName), 2079 s, i, l, a = null, primitiveAssign, k; 2080 2081 if (n instanceof AttributeName) 2082 { 2083 if (!isXMLName(n._Name)) 2084 { 2085 return false;
2086 } 2087 2088 if (c instanceof XMLList) 2089 { 2090 if (c._Children.length === 0) 2091 { 2092 c = ""; 2093 } 2094 else 2095 { 2096 s = ToString(c[0]); 2097 2098 for (i = 1, l = c._Children.length; i < l; ++i) 2099 { 2100 s += " " + ToString(c[i]); 2101 } 2102 2103 c = s; 2104 } 2105 } 2106 else 2107 { 2108 c = ToString(c); 2109 } 2110 2111 for (i in this._Attributes) 2112 { 2113 if ( 2114 (n._Name.localName === this._Attributes[i]._Name.localName) 2115 && (n._Name.uri === null || n._Name.uri === this._Attributes[i]._Name.uri) 2116 ) 2117 { 2118 if (a == null) 2119 { 2120 a = this._Attributes[i]; 2121 } 2122 else 2123 { 2124 this.Delete(this._Attributes[i]._Name); 2125 } 2126 } 2127 } 2128 2129 if (a == null) 2130 { 2131 a = new XML(); 2132 a._Parent = this; 2133 a._Class = "attribute"; 2134 a._Name = n._Name.uri == null 2135 ? new QName(new Namespace(), n._Name) 2136 : new QName(new Namespace(n._Name.uri), n._Name.localName); 2137 2138 this._Attributes[(a._Name._Prefix ? a._Name._Prefix + ":" : "") + a._Name.localName] = a; 2139 2140 AddInScopeNamespace.call(this, GetNamespace(a._Name)); 2141 } 2142 2143 a._Value = c; 2144 2145 return null; 2146 } 2147 2148 if (!isXMLName(n) && n.localName != "*") 2149 { 2150 return null; 2151 } 2152 2153 i = undefined; 2154 2155 primitiveAssign = !(c instanceof XML) && n.localName != "*"; 2156 2157 for (k = 0, l = this._Children.length; k < l; ++k) 2158 { 2159 if ( 2160 (n.localName === "*" || (this._Children[k]._Class === "element" && this._Children[k]._Name.localName===n.localName)) 2161 && 2162 (n.uri == null || (this._Children[k]._Class === "element" && n.uri === this._Children[k]._Name.uri)) 2163 ) 2164 { 2165 if (i != undefined) 2166 { 2167 DeleteByIndex.call(this, ToString(i)); 2168 } 2169 else 2170 { 2171 i = k; 2172 } 2173 } 2174 } 2175 2176 if (i == undefined) 2177 { 2178 i = this._Children.length; 2179 2180 if (primitiveAssign) 2181 { 2182 a = new XML(); 2183 a._Class = "element"; 2184 a._Parent = this; 2185 a._Name = n.uri == null 2186 ? new QName(GetDefaultNamespace(), n) 2187 : new QName(n); 2188 2189 Replace.call(this, ToString(i), a); 2190 2191 AddInScopeNamespace.call(a, GetNamespace(a._Name)); 2192 } 2193 } 2194 2195 if (primitiveAssign) 2196 { 2197 s = ToString(c); 2198 2199 if (s != "") 2200 { 2201 Replace.call(this._Children[i], "0", s); 2202 } 2203 } 2204 else 2205 { 2206 Replace.call(this, ToString(i), c); 2207 } 2208 2209 return null; 2210 }; 2211 2212 /** 2213 * 2214 * 2215 * 2216 * @access private 2217 * @param String | QName PropertyName 2218 * @returns null 2219 * @throws TypeError 2220 */ 2221 XML.prototype.Delete = function (PropertyName) 2222 { 2223 if (parseInt(PropertyName)+"" == PropertyName) 2224 { 2225 throw new TypeError(); 2226 } 2227 2228 var n = ToXMLName(PropertyName), k, dp = 0, q = 0, l; 2229 2230 if (n instanceof AttributeName) 2231 { 2232 for (k in this._Attributes) 2233 { 2234 if ( 2235 (n._Name.localName === "*" || n._Name.localName === this._Attributes[k]._Name.localName) 2236 && 2237 (n._Name.uri == null || n._Name.uri === this._Attributes[k]._Name.uri) 2238 ) 2239 { 2240 this._Attributes[k]._Parent = null; 2241 try{ 2242 delete this._Attributes[k]; 2243 }catch(e){} 2244 } 2245 } 2246 2247 return true; 2248 } 2249 2250 for (l = this._Children.length; q < l; ++q) 2251 { 2252 if ( 2253 (n.localName === "*" || (this._Children[q]._Class === "element" && this._Children[q]._Name.localName === n.localName)) 2254 && 2255 (n.uri == null || (this._Children[q]._Class === "element" && n.uri === this._Children[q]._Name.uri)) 2256 ) 2257 { 2258 DeleteByIndex.call(this, q); 2259 ++dp; 2260 } 2261 else if (dp > 0) 2262 { 2263 this._Children[q - dp] = this._Children[q]; 2264 } 2265 } 2266 2267 2268 return true; 2269 }; 2270 2271 /** 2272 * 2273 * 2274 * 2275 * @access private 2276 * @param XML Value 2277 * @returns Boolean 2278 */ 2279 XML.prototype.Equals = function (Value) 2280 { 2281 if (!(Value instanceof XML)) 2282 { 2283 return false;
2284 } 2285 if (this._Class !== Value._Class) 2286 { 2287 return false; 2288 } 2289 if (this._Children.length !== Value._Children.length) 2290 { 2291 return false; 2292 } 2293 if (this._Value !== Value._Value) 2294 { 2295 return false; 2296 } 2297 if (this._Name !== null) 2298 { 2299 if (Value._Name === null) 2300 { 2301 return false; 2302 } 2303 if (Value._Name.localName !== this._Name.localName) 2304 { 2305 return false; 2306 } 2307 if (Value._Name.uri !== this._Name.uri) 2308 { 2309 return false; 2310 } 2311 } 2312 else if (Value._Name !== null) 2313 { 2314 return false; 2315 } 2316 2317 if (count(this._Attributes) !== count(Value._Attributes)) 2318 { 2319 return false; 2320 } 2321 2322 var a, b, k, l; 2323 2324 for (k in this._Attributes) 2325 { 2326 a = this._Attributes[k]; 2327 2328 b = Value._Attributes[k]; 2329 2330 if (!b || b._Name.localName !== a._Name.localName || b._Name.uri !== a._Name.uri || b._Value !== a._Value) 2331 { 2332 return false; 2333 } 2334 } 2335 2336 for (k = 0, l = this._Children.length; k < l; ++k) 2337 { 2338 a = this._Children[k]; 2339 2340 b = Value._Children[k]; 2341 2342 if (!arguments.callee.call(a, b)) 2343 { 2344 return false; 2345 } 2346 } 2347 2348 return true; 2349 }; 2350 2351 //extensions 2352 2353 /* 2354 * e4x.js 2355 * 2356 * A JavaScript library that implements the optional E4X features described in 2357 * ECMA-357 2nd Edition Annex A if they are not already implemented. 2358 * 2359 * 2010-03-13 2360 * 2361 * By Elijah Grey, http://eligrey.com 2362 * License: The X11/MIT license (see COPYING.md) 2363 * 2364 * Changes: 2365 * By Sam Shull, http://samshull.blogspot.com 2366 * Just a litlle simplifying for implementation 2367 */ 2368 2369 /*global document, XML, XMLList, DOMParser, XMLSerializer, XPathResult */ 2370 2371 /*jslint undef: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, 2372 newcap: true, immed: true, maxerr: 1000, maxlen: 90 */ 2373 2374 /** 2375 * 2376 * 2377 * 2378 */ 2379 XML.prototype.domNode = function () 2380 { 2381 return adoptNode(document, xmlToDomNode(this)); 2382 }; 2383 2384 /** 2385 * 2386 * 2387 * 2388 */ 2389 XML.prototype.domNodeList = function () 2390 { 2391 if (this.length() < 0) 2392 { 2393 throw new Error(); 2394 } 2395 2396 return adoptNode(document, createDocumentFrom(this).documentElement).childNodes; 2397 }; 2398 2399 /** 2400 * 2401 * 2402 * 2403 */ 2404 XML.prototype.xpath = function (xpathExp) 2405 { 2406 var res = new XMLList, 2407 i = 0, l = this.length(), 2408 xpr; 2409 2410 if (l !== 1) 2411 { 2412 for (; i < l; ++i) 2413 { 2414 res.Append(this[i].xpath(xpathExp)); 2415 } 2416 2417 return res; 2418 } 2419 2420 xpr = evaluate(createDocumentFrom(this), xpathExp, this); 2421 2422 for (l=xpr.length; i < l; ++i) 2423 { 2424 res.Append(ToXML(xpr[i])); 2425 } 2426 2427 return res; 2428 }; 2429 2430 /** 2431 * 2432 * 2433 * 2434 */ 2435 XML.prototype.transform = function (xslt, params) 2436 { 2437 if (!xslt instanceof XML) 2438 { 2439 throw new TypeError(); 2440 } 2441 2442 var doc, res, i, l = this.length(), c; 2443 2444 if (l > 1) 2445 { 2446 res = new XMLList(); 2447 for (i = 0; i < l; ++i) 2448 { 2449 res.Append(this[i].transform(xslt, params)); 2450 } 2451 return res; 2452 } 2453 2454 return transform(this, xslt, params); 2455 }; 2456 2457 /** 2458 * 2459 * 2460 * @returns XMLList 2461 */ 2462 function XMLList ($string) 2463 { 2464 if (!(this instanceof XMLList)) 2465 { 2466 return ToXMLList($string || ""); 2467 } 2468 2469 this._Class = "XMLList"; 2470 2471 this._Value = undefined; 2472 2473 2474 this._TargetObject = null; 2475 2476 this._TargetProperty = null; 2477 2478 this._Children = []; 2479 2480 this[0] = null; 2481 2482 if ($string) 2483 { 2484 var list = ToXMLList($string), i = 0, l = list._Children.length; 2485 this._Value = list._Value; 2486 2487 for (;i < l; ++i) 2488 { 2489 this._Children[i] = this[i] = list._Children[i]; 2490 } 2491 } 2492 } 2493 2494 /** 2495 * 2496 * 2497 * @static 2498 * @returns String 2499 * @throws TypeError 2500 */ 2501 XMLList.toString = function () 2502 { 2503 return "function XMLList() {\n [native code] \n}"; 2504 }; 2505 2506 XMLList.prototype = new XML(); 2507 2508 var ignore = {xpath:1,domNodeList:1,transform:1}; 2509 2510 for (p in XMLList.prototype) 2511 { 2512 if (ignore[p]) 2513 { 2514 continue; 2515 } 2516 2517 XMLList.prototype[p] = (function(p) 2518 { 2519 return function () 2520 { 2521 if (this._Children.length != 1) 2522 { 2523 throw new TypeError("cannot call " + p + " method on an XML list with " + this._Children.length + " elements"); 2524 } 2525 2526 return XML.prototype[p].apply(this[0], arguments); 2527 }; 2528 })(p); 2529 } 2530 2531 try{ 2532 delete XMLList.prototype._Attributes; 2533 delete XMLList.prototype._InScopeNamespaces; 2534 }catch(e){} 2535 2536 /** 2537 * 2538 * 2539 * @param String | AttributeName attributeName 2540 * @returns XMLList 2541 */ 2542 XMLList.prototype.attribute = function (attributeName) 2543 { 2544 return GetList.call(this, ToAttributeName(attributeName)); 2545 }; 2546 2547 /** 2548 * 2549 * 2550 * @returns XMLList 2551 */ 2552 XMLList.prototype.attributes = function () 2553 { 2554 return GetList.call(this, ToAttributeName("*")); 2555 }; 2556 2557 /** 2558 * 2559 * 2560 * @param String | QName propertyName 2561 * @returns XMLList 2562 */ 2563 XMLList.prototype.child = function (propertyName) 2564 { 2565 var list = new XMLList(), i = 0, l = this._Children.length, r; 2566 list._TargetObject = this; 2567 2568 for (; i < l; ++i) 2569 { 2570 r = this[i].child(propertyName); 2571 2572 if (r._Children.length > 0) 2573 { 2574 list.Append(r); 2575 } 2576 } 2577 2578 return list; 2579 }; 2580 2581 /** 2582 * 2583 * 2584 * @returns XMLList 2585 */ 2586 XMLList.prototype.children = function () 2587 { 2588 return GetList.call(this, "*"); 2589 }; 2590 2591 /** 2592 * 2593 * 2594 * @returns XMLList 2595 */ 2596 XMLList.prototype.comments = function () 2597 { 2598 var list = new XMLList(), i = 0, l = this._Children.length, r; 2599 list._TargetObject = this; 2600 2601 for (; i < l; ++i) 2602 { 2603 if (this[i]._Class === "element") 2604 { 2605 r = this[i].comments(); 2606 2607 if (r._Children.length > 0) 2608 { 2609 list.Append(r); 2610 } 2611 } 2612 } 2613 2614 return list; 2615 }; 2616 2617 /** 2618 * 2619 * 2620 * @param XML value 2621 * @returns Boolean 2622 */ 2623 XMLList.prototype.contains = function (value) 2624 { 2625 for (var i = 0, l = this._Children.length; i < l; ++i) 2626 { 2627 if (this[i] == value) 2628 { 2629 return true; 2630 } 2631 } 2632 2633 return false;
2634 }; 2635 2636 /** 2637 * 2638 * 2639 * @returns XMLList 2640 */ 2641 XMLList.prototype.copy = function () 2642 { 2643 return DeepCopyList.call(this); 2644 }; 2645 2646 /** 2647 * 2648 * 2649 * @param String | QName name 2650 * @returns XMLList 2651 */ 2652 XMLList.prototype.descendants = function (name) 2653 { 2654 return DescendantsList.call(this, name || "*"); 2655 }; 2656 2657 /** 2658 * 2659 * 2660 * @param String | QName name 2661 * @returns XMLList 2662 */ 2663 XMLList.prototype.elements = function (name) 2664 { 2665 name = ToXMLName(name || "*"); 2666 var list = new XMLList(), i = 0, l = this._Children.length, r; 2667 list._TargetObject = this; 2668 list._TargetProperty = name; 2669 2670 for (; i < l; ++i) 2671 { 2672 if (this[i]._Class === "element") 2673 { 2674 r = this[i].elements(name); 2675 2676 if (r._Children.length > 0) 2677 { 2678 list.Append(r); 2679 } 2680 } 2681 } 2682 2683 return list; 2684 }; 2685 2686 /** 2687 * 2688 * 2689 * @param String name 2690 * @returns Boolean 2691 */ 2692 XMLList.prototype.hasOwnProperty = function (name) 2693 { 2694 return HasProperty.call(this, name) 2695 || (defaultXMLListProperties.indexOf("," + name + ",") === -1 && hasOwnProperty.call(this, name)); 2696 }; 2697 2698 /** 2699 * 2700 * 2701 * @returns Boolean 2702 */ 2703 XMLList.prototype.hasComplexContent = function () 2704 { 2705 if (this._Children.length === 0) 2706 { 2707 return false; 2708 } 2709 2710 if (this._Children.length === 1) 2711 { 2712 return this[0].hasComplexContent(); 2713 } 2714 2715 for (var i = 0, l = this._Children.length; i < l; ++i) 2716 { 2717 if (this._Children[i]._Class === "element") 2718 { 2719 return true; 2720 } 2721 } 2722 2723 return false; 2724 }; 2725 2726 /** 2727 * 2728 * 2729 * @returns Boolean 2730 */ 2731 XMLList.prototype.hasSimpleContent = function () 2732 { 2733 if (this._Children.length === 1) 2734 { 2735 return this[0].hasSimpleContent(); 2736 } 2737 2738 for (var i = 0, l = this._Children.length; i < l; ++i) 2739 { 2740 if (this._Children[i]._Class === "element") 2741 { 2742 return false; 2743 } 2744 } 2745 2746 return true; 2747 }; 2748 2749 /** 2750 * 2751 * 2752 * @returns Number 2753 */ 2754 XMLList.prototype.length = function () 2755 { 2756 return this._Children.length; 2757 }; 2758 2759 /** 2760 * 2761 * 2762 * @returns XMLList 2763 */ 2764 XMLList.prototype.normalize = function () 2765 { 2766 for (var i = 0, l = this._Children.length; i < l;) 2767 { 2768 if (this[i]._Class === "element") 2769 { 2770 this[i].normalize(); 2771 ++i; 2772 } 2773 else if (this[i]._Class === "text") 2774 { 2775 while (i+1 < this._Children.length && this[i+1]._Class === "text") 2776 { 2777 this[i]._Value = (this[i]._Value || "") + (this[i+1]._Value || ""); 2778 this.Delete(i+1); 2779 } 2780 2781 if (this[i]._Value.length === 0) 2782 { 2783 this.Delete(i); 2784 } 2785 else 2786 { 2787 ++i; 2788 } 2789 } 2790 else 2791 { 2792 ++i; 2793 } 2794 } 2795 2796 return this; 2797 }; 2798 2799 /** 2800 * 2801 * 2802 * @returns XML | undefined 2803 */ 2804 XMLList.prototype.parent = function () 2805 { 2806 if (this._Children.length === 0) 2807 { 2808 return undefined; 2809 } 2810 2811 for (var parent = this[0]._Parent, i = 1, l = this._Children.length; i < l; ++i) 2812 { 2813 if (this[i]._Parent != parent) 2814 { 2815 return undefined; 2816 } 2817 } 2818 2819 return parent; 2820 }; 2821 2822 /** 2823 * 2824 * 2825 * @param String | QName name 2826 * @returns XMLList 2827 */ 2828 XMLList.prototype.processingInstructions = function (name) 2829 { 2830 name = ToXMLName(name || "*"); 2831 var list = new XMLList(), i = 0, l = this._Children.length, r; 2832 list._TargetObject = this; 2833 2834 for (; i < l; ++i) 2835 { 2836 if (this[i]._Class === "element") 2837 { 2838 r = this[i].processingInstructions(name); 2839 2840 if (r._Children.length > 0) 2841 { 2842 list.Append(r); 2843 } 2844 } 2845 } 2846 2847 return list; 2848 }; 2849 2850 /** 2851 * 2852 * 2853 * @param String | Number name 2854 * @returns Boolean 2855 */ 2856 XMLList.prototype.propertyIsEnumerable = function (name) 2857 { 2858 return parseInt(name) > 0 && parseInt(name) < this._Children.length; 2859 }; 2860 2861 /** 2862 * 2863 * 2864 * @returns XMLList 2865 */ 2866 XMLList.prototype.text = function () 2867 { 2868 var list = new XMLList(), i = 0, l = this._Children.length, r; 2869 list._TargetObject = this; 2870 2871 for (; i < l; ++i) 2872 { 2873 if (this[i]._Class === "element") 2874 { 2875 r = this[i].text(); 2876 2877 if (r._Children.length > 0) 2878 { 2879 list.Append(r); 2880 } 2881 } 2882 } 2883 2884 return list; 2885 }; 2886 2887 /** 2888 * 2889 * 2890 * @returns String 2891 */ 2892 XMLList.prototype.toString = function () 2893 { 2894 return ToString(this); 2895 }; 2896 2897 /** 2898 * 2899 * 2900 * @returns String 2901 */ 2902 XMLList.prototype.toXMLString = function () 2903 { 2904 return ToXMLString(this); 2905 }; 2906 2907 /** 2908 * 2909 * 2910 * @returns XMLList 2911 */ 2912 XMLList.prototype.valueOf = function () 2913 { 2914 return this; 2915 }; 2916 2917 /** 2918 * 2919 * 2920 * 2921 * @access private 2922 * @param String | Number | QName PropertyName 2923 * @param XML Value 2924 * @param isElement 2925 * @returns null 2926 */ 2927 XMLList.prototype.Put = function (PropertyName, Value,isChildElement) 2928 { 2929 isChildElement = isChildElement !== undefined ? isChildElement : false;
2930 var i = parseInt(PropertyName), r, y, l, z, parent, c, j = 0, q, t; 2931 2932 if (i+"" == PropertyName) 2933 { 2934 r = ResolveValue.call(this._TargetObject); 2935 /* Firefox doesn't do this 2936 if (r == null) 2937 { 2938 return null; 2939 } 2940 */ 2941 if (i >= this._Children.length) 2942 { 2943 if (r instanceof XMLList) 2944 { 2945 if (r.length() != 1) 2946 { 2947 return null; 2948 } 2949 2950 r = r[0]; 2951 } 2952 2953 /* Firefox doesn't do this 2954 if (r._Class != "element") 2955 { 2956 return null; 2957 } 2958 */ 2959 y = new XML(); 2960 y._Parent = r; 2961 y._Name = this._TargetProperty; 2962 y._Attributes = {}; 2963 2964 if (this._TargetProperty instanceof AttributeName) 2965 { 2966 if (!!r && Get.call(r, y._Name).length() > 0) 2967 { 2968 return null; 2969 } 2970 2971 y._Class = "attribute"; 2972 } 2973 else if (!isChildElement && (this._TargetProperty == null || this._TargetProperty.localName === "*")) 2974 { 2975 y._Name = null; 2976 y._Class = "text"; 2977 } 2978 else 2979 { 2980 y._Class = "element"; 2981 } 2982 2983 if (y._Class != "attribute") 2984 { 2985 if (r) 2986 { 2987 j = 0; 2988 2989 if (i > 0) 2990 { 2991 while (j < r._Children.length-1 && r[j] !== this[i-1]) 2992 { 2993 ++j; 2994 } 2995 } 2996 else 2997 { 2998 j = r._Children.length - 1; 2999 } 3000 3001 Insert.call(r, j+1, y); 3002 } 3003 3004 if (Value instanceof XMLList) 3005 { 3006 y._Name = Value._TargetProperty; 3007 } 3008 else if (Value instanceof XML) 3009 { 3010 y._Name = Value._Name; 3011 } 3012 } 3013 3014 this.Append(y); 3015 } 3016 3017 if (!(Value instanceof XML) || Value._Class === "text" || Value._Class === "attribute") 3018 { 3019 Value = ToString(Value); 3020 } 3021 3022 if (this[i]._Class === "attribute") 3023 { 3024 z = ToAttributeName(this[i]._Name); 3025 this[i]._Parent.Put(z, Value); 3026 this[i] = this[i]._Parent.attribute(z)[0]; 3027 } 3028 else if (Value instanceof XMLList) 3029 { 3030 //shallow copy? 3031 c = Value; 3032 parent = this[i]._Parent; 3033 3034 if (parent) 3035 { 3036 q = this[i].childIndex(); 3037 Replace.call(parent, q, c); 3038 for (j = 0, l = c._Children.length; j < l; ++j) 3039 { 3040 c._Children[j] = c[j] = parent._Children[q+j]; 3041 } 3042 } 3043 3044 if (c._Children.length === 0) 3045 { 3046 for (j = i + 1, l = this._Children.length; j < l; ++j) 3047 { 3048 this._Children[j-1] = this[j-1] = this[j] 3049 } 3050 } 3051 else 3052 { 3053 for (j = this._Children.length; j > i; --j) 3054 { 3055 z = ToString(j + c._Children.length - 1); 3056 this._Children[z] = this[z] = this[j]; 3057 } 3058 } 3059 3060 for (j = 0, l = c._Children.length; j < l; ++j) 3061 { 3062 this._Children[i+j] = this[i+j] = c[j]; 3063 } 3064 3065 } 3066 else if (Value instanceof XML || (",text,comment,processing-instruction").indexOf("," + this[i]._Class+",") > -1) 3067 { 3068 parent = !!this[i] && this[i]._Parent; 3069 3070 if(parent) 3071 { 3072 q = this[i].childIndex(); 3073 Replace.call(parent, q, Value); 3074 Value = parent._Children[q]; 3075 } 3076 3077 if (toString.call(Value) === "[object String]") 3078 { 3079 t = ToXML(Value); 3080 t._Parent = this; 3081 this._Children[i] = this[i] = t; 3082 } 3083 else 3084 { 3085 3086 } 3087 } 3088 else 3089 {
3090 this.Append(XMLList(Value)); 3091 } 3092 } 3093 /* Firefox doesn't do this 3094 else if (this.length() <= 1) 3095 { 3096 if (this.length() === 0) 3097 { 3098 r = ResolveValueList.call(this); 3099 3100 if (r == null || r.length() != 1) 3101 { 3102 return null; 3103 } 3104 3105 this.Append(r); 3106 } 3107 else 3108 { 3109 this[0].Put(PropertyName, Value); 3110 } 3111 }*/ 3112 3113 return null; 3114 }; 3115 3116 /** 3117 * 3118 * 3119 * 3120 * @access private 3121 * @param String | Number | QName PropertyName 3122 * @returns null 3123 */ 3124 XMLList.prototype.Delete = function (PropertyName) 3125 { 3126 var i = parseInt(PropertyName), parent, q, l; 3127 3128 if (i+"" == PropertyName) 3129 { 3130 if (i >= this._Children.length) 3131 { 3132 return true; 3133 } 3134 3135 parent = this[i]._Parent; 3136 3137 if (parent) 3138 { 3139 if (this[i]._Class = "attribute") 3140 { 3141 parent.Delete(ToAttributeName(this[i]._Name)); 3142 } 3143 else 3144 { 3145 DeleteByIndex.call(parent, this[i].childIndex()); 3146 } 3147 } 3148 3149 try{ 3150 this._Children.splice(PropertyName,1); 3151 delete this[PropertyName]; 3152 }catch(e){} 3153 3154 for (q = i + 1, l = this._Children.length; q < l; ++q) 3155 { 3156 this._Children[q-1] = this[q-1] = this[q]; 3157 } 3158 return true; 3159 } 3160 /* Firefox won't do this 3161 for (q = 0, l = this._Children.length; q < l; ++q) 3162 { 3163 if (this[q]._Class === "element") 3164 { 3165 this[q].Delete(PropertyName); 3166 } 3167 } 3168 */ 3169 return true; 3170 }; 3171 3172 /** 3173 * 3174 * 3175 * 3176 * @access private 3177 * @param XML Value 3178 * @returns null 3179 */ 3180 XMLList.prototype.Append = function (Value) 3181 { 3182 if (!(Value instanceof XML)) 3183 { 3184 return null; 3185 } 3186 3187 var i = this._Children.length, n = 1, j = 0; 3188 3189 if (Value instanceof XMLList) 3190 { 3191 n = Value._Children.length; 3192 3193 if (n == 0) 3194 { 3195 return null; 3196 } 3197 3198 this._TargetObject = Value._TargetObject; 3199 this._TargetProperty = Value._TargetProperty; 3200 3201 for (;j < n; ++j) 3202 { 3203 this._Children[i+j] = this[i+j] = Value[j]; 3204 } 3205 } 3206 else 3207 { 3208 this._Children[i] = this[i] = Value; 3209 } 3210 3211 return null; 3212 }; 3213 3214 /** 3215 * 3216 * 3217 * 3218 * @access private 3219 * @param XML Value 3220 * @returns Boolean 3221 */ 3222 XMLList.prototype.Equals = function (Value) 3223 { 3224 if (Value == undefined && this._Children.length === 0) 3225 { 3226 return true; 3227 } 3228 else if (Value instanceof XMLList && Value._Children.length === this._Children.length) 3229 { 3230 for (var i = 0, l = this._Children.length; i < l; ++i) 3231 { 3232 if (!this[i].Equals(Value[i])) 3233 { 3234 return false; 3235 } 3236 } 3237 } 3238 else if (this._Children.length === 1) 3239 { 3240 return this[0].Equals(Value); 3241 } 3242 3243 return false; 3244 }; 3245 3246 /** 3247 * 3248 * 3249 * 3250 * @access private 3251 * @returns XMLList 3252 */ 3253 function ResolveValueList () 3254 { 3255 if (this._Children.length > 0) 3256 { 3257 return this; 3258 } 3259 3260 if (this._TargetObject == null 3261 || this._TargetProperty == null 3262 || this._TargetProperty instanceof AttributeName 3263 || this._TargetProperty.localName === "*" 3264 ) 3265 { 3266 return null; 3267 } 3268 3269 var base = ResolveValue.call(this._TargetObject), target; 3270 3271 if (base == null) 3272 { 3273 return null; 3274 } 3275 3276 target = Get.call(base, this._TargetProperty); 3277 3278 if (target._Children.length === 0) 3279 { 3280 if (base instanceof XMLList && base._Children.length > 1) 3281 { 3282 return null; 3283 } 3284 3285 base.Put(this._TargetProperty, ""); 3286 3287 target = Get.call(base, this._TargetProperty); 3288 } 3289 3290 return target; 3291 }; 3292 3293 /** 3294 * 3295 * 3296 * @param String | Namespace | QName prefix 3297 * @param String uri 3298 * @returns Namespace 3299 * @throws TypeError 3300 */ 3301 function Namespace (prefix, uri) 3302 { 3303 if (!(this instanceof Namespace)) 3304 { 3305 return prefix && prefix instanceof Namespace 3306 ? prefix
3307 : new Namespace(prefix, uri); 3308 } 3309 3310 if (uri === undefined && prefix === undefined) 3311 { 3312 this.prefix = ""; 3313 this.uri = ""; 3314 } 3315 else if (uri === undefined) 3316 { 3317 uri = prefix; 3318 prefix = undefined; 3319 3320 if (uri instanceof Namespace) 3321 { 3322 this.prefix = uri.prefix; 3323 this.uri = uri.uri; 3324 } 3325 else if (uri instanceof QName && uri.uri !== null) 3326 { 3327 this.uri = uri.uri; 3328 } 3329 else 3330 { 3331 this.uri = ToString(uri); 3332 3333 if (this.uri == "") 3334 { 3335 this.prefix = ""; 3336 } 3337 } 3338 } 3339 else 3340 { 3341 if (uri instanceof QName) 3342 { 3343 this.uri = uri.uri; 3344 } 3345 else 3346 { 3347 this.uri = ToString(uri); 3348 } 3349 3350 if (this.uri === "") 3351 { 3352 if (prefix === undefined || ToString(prefix) === "") 3353 { 3354 this.prefix = ""; 3355 } 3356 else 3357 { 3358 throw new TypeError("cannot define the prefix for an empty uri"); 3359 } 3360 } 3361 else if (prefix === undefined) 3362 { 3363 this.prefix = undefined; 3364 } 3365 else 3366 { 3367 this.prefix = ToString(prefix); 3368 } 3369 } 3370 } 3371 3372 /** 3373 * 3374 * 3375 * @var String 3376 */ 3377 Namespace.prototype.prefix = undefined; 3378 3379 /** 3380 * 3381 * 3382 * @var String 3383 */ 3384 Namespace.prototype.uri = undefined; 3385 3386 /** 3387 * 3388 * 3389 * @returns String 3390 */ 3391 Namespace.prototype.toString = function () 3392 { 3393 return this.uri; 3394 }; 3395 3396 /** 3397 * 3398 * 3399 * @param Namespace | String | QName NameSpace 3400 * @param String 3401 * @returns QName 3402 */ 3403 function QName (NameSpace, Name) 3404 { 3405 if (!(this instanceof QName)) 3406 { 3407 return NameSpace instanceof QName 3408 ? NameSpace 3409 : new QName(NameSpace, Name); 3410 } 3411 3412 if (Name === undefined) 3413 { 3414 Name = NameSpace; 3415 NameSpace = undefined; 3416 } 3417 3418 if (Namespace instanceof QName) 3419 { 3420 if (Name === undefined) 3421 { 3422 Name = Name.localName; 3423 } 3424 } 3425 3426 Name = Name === undefined || Name === null 3427 ? "" 3428 : ToString(Name); 3429 3430 if (NameSpace === undefined) 3431 { 3432 NameSpace = Name === "*" ? null : GetDefaultNamespace(); 3433 } 3434 3435 this.localName = Name; 3436 3437 if (NameSpace == null) 3438 { 3439 this.uri = null; 3440 } 3441 else 3442 { 3443 NameSpace = Namespace(NameSpace); 3444 this.uri = NameSpace.uri; 3445 this._Prefix = NameSpace.prefix; 3446 } 3447 } 3448 3449 /** 3450 * 3451 * 3452 * @var String 3453 */ 3454 QName.prototype.localName = undefined; 3455 3456 /** 3457 * 3458 * 3459 * @var String 3460 */ 3461 QName.prototype.uri = undefined; 3462 3463 /** 3464 * 3465 * 3466 * @param Object InScopeNamespaces 3467 * @returns Namespace 3468 * @throws TypeError 3469 */ 3470 function GetNamespace (q, InScopeNamespaces) 3471 { 3472 if(!q) 3473 return new Namespace(); 3474 if (q.uri === null) 3475 { 3476 throw new TypeError(); 3477 } 3478 3479 InScopeNamespaces = InScopeNamespaces || {}; 3480 3481 var ns, p; 3482 3483 for (p in InScopeNamespaces) 3484 { 3485 if (q.uri === InScopeNamespaces[p].uri) 3486 { 3487 ns = InScopeNamespaces[p]; 3488 3489 if (!!q._Prefix && q._Prefix === ns.prefix) 3490 { 3491 return ns; 3492 } 3493 } 3494 } 3495 3496 if (!ns) 3497 { 3498 ns = !!q._Prefix 3499 ? new Namespace(q._Prefix, q.uri)
3500 : new Namespace(q.uri); 3501 } 3502 3503 return ns; 3504 }; 3505 3506 /** 3507 * 3508 * 3509 * @returns String 3510 */ 3511 QName.prototype.toString = function () 3512 { 3513 return !!this.uri 3514 ? this.uri + "::" + this.localName 3515 : this.localName; 3516 }; 3517 3518 /** 3519 * 3520 * 3521 * @param AttributeName | QName | String name 3522 * @returns AttributeName 3523 */ 3524 function AttributeName (name) 3525 { 3526 if (!(this instanceof AttributeName)) 3527 { 3528 return name && (name instanceof AttributeName || name instanceof QName) 3529 ? name 3530 : new AttributeName(name); 3531 } 3532 3533 this._Name = name instanceof QName 3534 ? name 3535 : new QName(new Namespace(GetDefaultNamespace()||undefined), name); 3536 } 3537 3538 /** 3539 * 3540 * 3541 * @var String 3542 */ 3543 AttributeName.prototype.localName = undefined; 3544 3545 /** 3546 * 3547 * 3548 * @var String 3549 */ 3550 AttributeName.prototype.uri = undefined; 3551 3552 /** 3553 * 3554 * 3555 * @returns String 3556 */ 3557 AttributeName.prototype.toString = function () 3558 { 3559 return "@" + (!!this._Name.uri 3560 ? this._Name.uri + "::" + this._Name.localName 3561 : this._Name.localName 3562 ); 3563 }; 3564 3565 /** 3566 * 3567 * 3568 * 3569 */ 3570 function AnyName () 3571 { 3572 3573 } 3574 3575 /** 3576 * 3577 * 3578 * @param mixed value 3579 * @returns Boolean 3580 */ 3581 function isXMLName (value) 3582 { 3583 if (value instanceof AttributeName) 3584 { 3585 return true; 3586 } 3587 3588 try{ 3589 var q = QName(value); 3590 } 3591 catch (e) 3592 { 3593 return false; 3594 } 3595 3596 return !!q.localName && (!!q.localName.match(/^[\w\-]+$/i) || !!q.localName.match(/^[\w\-\:]+$/i)); 3597 } 3598 3599 /** 3600 * 3601 * 3602 * @param mixed value 3603 * @returns String 3604 * @throws TypeError 3605 */ 3606 function ToString (value) 3607 { 3608 var i = 0, l, s; 3609 3610 if (value instanceof XMLList) 3611 { 3612 if (value.hasSimpleContent()) 3613 { 3614 s = ""; 3615 3616 for (l = value.length(); i < l; ++i) 3617 { 3618 if (value[i]._Class != "comment" && value[i]._Class != "processing-instruction") 3619 { 3620 s += ToString(value[i]); 3621 } 3622 } 3623 3624 return s; 3625 } 3626 3627 return ToXMLString(value); 3628 } 3629 else if (value instanceof XML) 3630 { 3631 if (value._Class === "attribute" || value._Class === "text") 3632 { 3633 return value._Value; 3634 } 3635 3636 if (value.hasSimpleContent()) 3637 { 3638 s = ""; 3639 3640 for (l = value.length(); i < l; ++i) 3641 { 3642 if (value.child(i)._Class != "comment" && value.child(i)._Class != "processing-instruction") 3643 { 3644 s += ToString(value.child(i)); 3645 } 3646 } 3647 3648 return s; 3649 } 3650 3651 return ToXMLString(value); 3652 } 3653 else if (value instanceof AttributeName) 3654 { 3655 return "@" + ToString(value._Name); 3656 } 3657 3658 return value === null || value === undefined 3659 ? "" 3660 : "" + value; 3661 } 3662 3663 /** 3664 * 3665 * 3666 * @param XML input 3667 * @param Object AncestorNamespaces 3668 * @param Number IndentLevel 3669 * @returns String 3670 */ 3671 function ToXMLString (input, AncestorNamespaces, IndentLevel) 3672 { 3673 var s = "", p = 0, temp, temp2, namespace, namespaceUnion, 3674 namespaceDeclarations = {}, attrAndNamespaces, prefixes, defaultSet; 3675 3676 AncestorNamespaces = AncestorNamespaces || {}; 3677 3678 IndentLevel = Number(IndentLevel || 0); 3679 3680 if (input instanceof XMLList) 3681 { 3682 temp = input.hasSimpleContent(); 3683 3684 temp2 = input.length(); 3685 3686 for (; p < temp2; ++p) 3687 { 3688 if (p > 0) 3689 { 3690 s += "\r\n"; 3691 } 3692 3693 s += ToXMLString(input[p], AncestorNamespaces); 3694 } 3695 3696 return s; 3697 } 3698 else if (input instanceof XML) 3699 { 3700 if (XML.prettyPrinting) 3701 { 3702 //s += new Array(IndentLevel+1).join(" "); 3703 for (; p < IndentLevel; ++p) 3704 { 3705 s += " "; 3706 } 3707 } 3708 3709 switch (input._Class) 3710 { 3711 case "text": 3712 return s + EscapeElementValue(XML.prettyPrinting ? trim(input._Value) : input._Value); 3713 3714 case "attribute": 3715 return s + EscapeAttributeValue(input._Value); 3716 3717 case "comment": 3718 return s + "<!--" + input._Value + "-->"; 3719 3720 case "processing-instruction": 3721 return s + "<?" + input._Name.localName + " " + input._Value + "?>"; 3722 3723 default: 3724 namespaceUnion = extend({}, AncestorNamespaces); 3725 3726 for (p in input._InScopeNamespaces) 3727 { 3728 temp = input._InScopeNamespaces[p]; 3729 3730 if (!AncestorNamespaces[(temp.prefix||"")] || AncestorNamespaces[(temp.prefix||"")].uri != temp.uri) 3731 { 3732 namespaceUnion[(temp.prefix||"")] = namespaceDeclarations[(temp.prefix||"")] = new Namespace(temp); 3733 } 3734 } 3735 3736 if (!input._Parent) 3737 { 3738 namespaceUnion[(input._DefaultNamespace.prefix||"")] = 3739 namespaceDeclarations[(input._DefaultNamespace.prefix||"")] = new Namespace(input._DefaultNamespace); 3740 } 3741 /* 3742 //firefox doesn't do this 3743 for (p in input._Attributes) 3744 { 3745 namespace = GetNamespace(input._Attributes[p]._Name, namespaceUnion); 3746 3747 if (namespace.prefix === undefined) 3748 { 3749 do { 3750 namespace.prefix = !namespaceUnion[""] ? "" : newPrefix(); 3751 } 3752 while(!!namespaceUnion[namespace.prefix]); 3753 } 3754 3755 namespaceUnion[namespace.prefix] = namespaceDeclarations[namespace.prefix] = namespace; 3756 } 3757 */ 3758 3759 s += "<"; 3760 3761 namespace = GetNamespace(input._Name, namespaceDeclarations); 3762 3763 if (namespace.prefix) 3764 { 3765 s += namespace.prefix + ":"; 3766 } 3767 3768 s += input._Name ? input._Name.localName : ""; 3769 3770 attrAndNamespaces = extend({}, input._Attributes, namespaceDeclarations); 3771 3772 defaultSet = false;
3773 3774 for (p in attrAndNamespaces) 3775 { 3776 s += " "; 3777 3778 if (attrAndNamespaces[p] instanceof XML) 3779 { 3780 temp = GetNamespace(attrAndNamespaces[p]._Name, AncestorNamespaces); 3781 3782 if (temp.prefix === undefined && !namespaceUnion[""]) 3783 { 3784 do{ 3785 temp.prefix = !namespaceUnion[""] ? "" : newPrefix(); 3786 } 3787 while(namespaceUnion[temp.prefix]); 3788 3789 namespaceUnion[temp.prefix] = namespaceDeclarations[temp.prefix] = new Namespace(temp); 3790 } 3791 3792 if (temp.prefix) 3793 { 3794 s += temp.prefix + ":"; 3795 } 3796 3797 s += attrAndNamespaces[p].localName() + '="' + EscapeAttributeValue(attrAndNamespaces[p]._Value) + '"'; 3798 } 3799 else 3800 { 3801 s += "xmlns"; 3802 3803 if (!attrAndNamespaces[p].prefix && defaultSet) 3804 { 3805 do{ 3806 attrAndNamespaces[p].prefix = newPrefix(); 3807 } 3808 while(!!namespaceUnion[attrAndNamespaces[p].prefix]); 3809 3810 namespaceUnion[attrAndNamespaces[p].prefix] = 3811 namespaceDeclarations[attrAndNamespaces[p].prefix] = 3812 new Namespace(attrAndNamespaces[p]); 3813 3814 s += ":" + attrAndNamespaces[p].prefix; 3815 } 3816 else if (!attrAndNamespaces[p].prefix && !defaultSet) 3817 { 3818 defaultSet = true; 3819 } 3820 else if (attrAndNamespaces[p].prefix) 3821 { 3822 s += ":" + attrAndNamespaces[p].prefix; 3823 } 3824 3825 s += '="' + EscapeAttributeValue(attrAndNamespaces[p].uri) + '"'; 3826 } 3827 } 3828 3829 temp = input._Children.length; 3830 3831 if (!temp) 3832 { 3833 return s + "/>"; 3834 } 3835 3836 s += ">"; 3837 3838 temp2 = temp > 1 || (temp == 1 && input._Class !== "text"); 3839 3840 names = (!!XML.prettyPrinting && !!temp2) ? IndentLevel + Number(XML.prettyIndent) : 0; 3841 3842 prefixes = !!XML.prettyPrinting && !!temp2; 3843 3844 for (p = 0; p < temp; ++p) 3845 { 3846 if (prefixes) 3847 { 3848 s += "\r\n"; 3849 } 3850 3851 if (input._Children[p]) 3852 { 3853 s += ToXMLString(input._Children[p], namespaceDeclarations, names); 3854 } 3855 } 3856 3857 if (prefixes) 3858 { 3859 s += "\r\n"; 3860 3861 for (p = 0; p < IndentLevel; ++p) 3862 { 3863 s += " "; 3864 } 3865 } 3866 3867 return s + "</" + (namespace.prefix ? namespace.prefix + ":" : "") + input._Name.localName + ">"; 3868 } 3869 3870 throw new TypeError(); 3871 } 3872 else if (input === undefined || input === null) 3873 { 3874 throw new TypeError(); 3875 } 3876 else if (toString.call(input) === "[object Object]") 3877 { 3878 return EscapeElementValue( input.valueOf().toString() ); 3879 } 3880 3881 return ToString(input); 3882 } 3883 3884 /** 3885 * 3886 * 3887 * @param mixed s 3888 * @returns XML 3889 * @throws SyntaxError | TypeError 3890 */ 3891 function ToXML (s) 3892 { 3893 var x, div; 3894 3895 if (s instanceof XMLList) 3896 { 3897 if (s.length() == 1) 3898 { 3899 return s[0]; 3900 } 3901 } 3902 else if (s instanceof XML) 3903 { 3904 return s; 3905 } 3906 else if ((",string,number,boolean,").indexOf("," + typeof(s)+",") > -1) 3907 { 3908 3909 div = parse('<parent xmlns="' + GetDefaultNamespace() + '">' + s + '</parent>'); 3910 3911 x = ToXML(div.documentElement) 3912 3913 if (x) 3914 { 3915 if (x.length() == 0) 3916 { 3917 return new XML(); 3918 } 3919 else if (x.length() == 1) 3920 { 3921 x.child(0)._Parent = null; 3922 return x.child(0); 3923 } 3924 } 3925 3926 3927 throw new SyntaxError("Failed to convert DOM object to XML"); 3928 } 3929 else if (s.nodeType && !isNaN(s.nodeType)) 3930 { 3931 return MapInfoItemToXML(s); 3932 } 3933 3934 throw new TypeError(); 3935 } 3936 3937 /** 3938 * 3939 * 3940 * @param DOMNode i 3941 * @returns XML 3942 * @throws TypeError 3943 */ 3944 function MapInfoItemToXML (i,n) 3945 { 3946 var x = new XML(), temp, temp2, temp3, isNScheck = isNSDef, j, l, xmlChild; 3947 3948 x._Parent = null; 3949 3950 switch (i.nodeType) 3951 { 3952 case TEXT_NODE: 3953 case CDATA_SECTION_NODE: 3954 x._Class = "text"; 3955 x._Value = ""; 3956 temp = i; 3957 3958 while (temp && (temp.nodeType === TEXT_NODE || temp.nodeType === CDATA_SECTION_NODE)) 3959 { 3960 x._Value += temp.textContent || temp.text || temp.data; 3961 temp = temp.nextSibling; 3962 if (n && (n.n || n.n == 0)) 3963 { 3964 ++n.n; 3965 } 3966 } 3967 3968 3969 if (XML.ignoreWhitespace && !x._Value.match(/\S+/)) 3970 { 3971 return null; 3972 } 3973 3974 return x; 3975 3976 break; 3977 case COMMENT_NODE: 3978 if (XML.ignoreComments) 3979 { 3980 return null; 3981 } 3982 3983 x._Class = "comment"; 3984 x._Value = i.data || i.textContent || i.text || ""; 3985 3986 return x; 3987 3988 break; 3989 case PROCESSING_INSTRUCTION_NODE: 3990 if (XML.ignoreProcessingInstructions) 3991 { 3992 return null; 3993 } 3994 3995 x._Class = "processing-instruction"; 3996 x._Name = new QName("", i.target); 3997 x._Value = i.data || i.textContent || i.text || ""; 3998 3999 return x; 4000 4001 break; 4002 case ATTRIBUTE_NODE: 4003 x._Class = "attribute"; 4004 4005 temp = i.nodeName.match(/(([\w\-]+):)?([\w\-]+)/); 4006 4007 if ( temp[1] ) 4008 { 4009 temp2 = undefined; 4010 4011 if (!!i.lookupNamespace) 4012 { 4013 temp2 = i.lookupNamespace(temp[2]); 4014 } 4015 else 4016 { 4017 temp3 = n;//hack for ie -- stupid ie 4018 4019 while (!temp2 && !!temp3 && !!temp3.attributes) 4020 { 4021 for (j = 0, l = temp3.attributes.length; j < l; ++j) 4022 { 4023 if (temp3.attributes[j].nodeName == ("xmlns:" + temp[2])) 4024 { 4025 temp2 = temp3.attributes[j].value || temp3.attributes[j].nodeValue; 4026 break; 4027 } 4028 } 4029 4030 temp3 = temp3.parentNode; 4031 } 4032 } 4033 x._DefaultNamespace = new Namespace( temp[2], temp2 ); 4034 x._Name = new QName( x._DefaultNamespace, temp[3] ); 4035 } 4036 else 4037 { 4038 temp2 = undefined; 4039 4040 if (!!i.lookupNamespace) 4041 { 4042 temp2 = i.lookupNamespace(""); 4043 } 4044 else 4045 { 4046 temp3 = i.parentNode; 4047 4048 while (!temp2 && !!temp3 && !!temp3.attributes) 4049 { 4050 for (j = 0, l = temp3.attributes.length; j < l; ++j) 4051 { 4052 if (temp3.attributes[j].nodeName == "xmlns") 4053 { 4054 temp2 = temp3.attributes[j].value || temp3.attributes[j].nodeValue; 4055 break; 4056 } 4057 } 4058 4059 temp3 = temp3.parentNode; 4060 } 4061 } 4062 4063 x._DefaultNamespace = new Namespace("", temp2); 4064 x._Name = new QName( x._DefaultNamespace, temp[3] ); 4065 } 4066 4067 x._Value = i.value || null; 4068 4069 return x; 4070 4071 break; 4072 case ELEMENT_NODE: 4073 x._Class = "element";
4074 temp = i.nodeName.match(/(([\w\-]+):)?([\w\-]+)/); 4075 4076 if ( temp[1] ) 4077 { 4078 temp2 = undefined; 4079 4080 if (!!i.lookupNamespace) 4081 { 4082 temp2 = i.lookupNamespace(temp[2]); 4083 } 4084 else 4085 { 4086 temp3 = i; 4087 4088 while (!temp2 && !!temp3 && !!temp3.attributes) 4089 { 4090 for (j = 0, l = temp3.attributes.length; j < l; ++j) 4091 { 4092 if (temp3.attributes[j].nodeName == ("xmlns:" + temp[2])) 4093 { 4094 temp2 = temp3.attributes[j].value || temp3.attributes[j].nodeValue; 4095 break; 4096 } 4097 } 4098 4099 temp3 = temp3.parentNode; 4100 } 4101 } 4102 x._DefaultNamespace = new Namespace( temp[2], temp2 ); 4103 x._Name = new QName( x._DefaultNamespace, temp[3] ); 4104 } 4105 else 4106 { 4107 temp2 = undefined; 4108 4109 if (!!i.lookupNamespace) 4110 { 4111 temp2 = i.lookupNamespace(""); 4112 } 4113 else 4114 { 4115 temp3 = i; 4116 4117 while (!temp2 && !!temp3 && !!temp3.attributes) 4118 { 4119 for (j = 0, l = temp3.attributes.length; j < l; ++j) 4120 { 4121 if (temp3.attributes[j].nodeName == "xmlns") 4122 { 4123 temp2 = temp3.attributes[j].value || temp3.attributes[j].nodeValue; 4124 break; 4125 } 4126 } 4127 4128 temp3 = temp3.parentNode; 4129 } 4130 } 4131 4132 x._DefaultNamespace = new Namespace("", temp2); 4133 4134 x._Name = new QName( x._DefaultNamespace, temp[3] ); 4135 } 4136 4137 for (temp = 0, temp2 = i.attributes.length; temp < temp2; ++temp) 4138 { 4139 if (temp3 = isNScheck.exec(i.attributes[temp].nodeName)) 4140 { 4141 x._InScopeNamespaces[temp3[1]] = new Namespace(temp3[1], i.attributes[temp].value); 4142 } 4143 else if (i.attributes[temp].nodeName === "xmlns") 4144 { 4145 x._InScopeNamespaces[""] = new Namespace(i.attributes[temp].value); 4146 } 4147 else 4148 { 4149 x._Attributes[i.attributes[temp].nodeName] = MapInfoItemToXML(i.attributes[temp], i); 4150 } 4151 } 4152 4153 j = 0; 4154 xmlChild = 0; 4155 temp = i.childNodes.length; 4156 4157 while (j < temp) 4158 { 4159 n = {n:-1}; 4160 if (temp3 = MapInfoItemToXML(i.childNodes[j], n)) 4161 { 4162 //even though it is not written this way in the spec 4163 //this is how it works in Firefox 4164 x._Children[xmlChild] = temp3; 4165 x._Children[xmlChild]._Parent = x; 4166 4167 if (temp3._Class === "text" && n.n > 0) 4168 { 4169 j = j + n.n; 4170 } 4171 4172 ++xmlChild; 4173 } 4174 4175 ++j; 4176 } 4177 4178 x._Value = i.textContent || i.text || i.data || ""; 4179 4180 x._Length = xmlChild; 4181 4182 return x; 4183 4184 break; 4185 case DOCUMENT_NODE: 4186 //firefox won't do this 4187 //return MapInfoItemToXML(document.documentElement); 4188 //break; 4189 case ENTITY_REFERENCE_NODE: 4190 throw new TypeError(); 4191 break; 4192 default: 4193 return null; 4194 break; 4195 } 4196 } 4197 4198 /** 4199 * 4200 * 4201 * @param mixed s 4202 * @returns XML 4203 * @throws TypeError 4204 */ 4205 function ToXMLList (s) 4206 { 4207 var e,x,list,i,l; 4208 4209 if (s instanceof XMLList) 4210 { 4211 return s; 4212 } 4213 else if (s instanceof XML) 4214 { 4215 list = new XMLList(); 4216 list._Children[0] = list[0] = s; 4217 list._TargetObject = x._Parent; 4218 list._TargetProperty = x._Name; 4219 4220 return list; 4221 } 4222 else if ((",string,boolean,number,").indexOf("," + typeof(s)+",") === -1) 4223 { 4224 throw new TypeError(); 4225 } 4226 4227 e = parse('<parent xmlns="' + GetDefaultNamespace() + '">' + s + '</parent>'); 4228 x = ToXML(e.documentElement); 4229 list = new XMLList(); 4230 i = 0; 4231 l = x._Children.length; 4232 4233 list._TargetObject = null; 4234 4235 for (;i < l; ++i) 4236 { 4237 x._Children[i]._Parent = null; 4238 list._Children[i] = list[i] = x._Children[i]; 4239 } 4240 4241 4242 return list; 4243 } 4244 4245 /** 4246 * 4247 * 4248 * @param mixed s 4249 * @returns XMLList 4250 * @throws TypeError 4251 */ 4252 function ToAttributeName (s) 4253 { 4254 if (s === "*") 4255 { 4256 return new AttributeName(new QName(null, "*")); 4257 } 4258 else if (s instanceof QName) 4259 { 4260 return new AttributeName(s); 4261 } 4262 else if (s instanceof AttributeName) 4263 { 4264 return s; 4265 } 4266 4267 switch (typeof(s)) 4268 { 4269 case "undefined": 4270 case "null": 4271 case "boolean": 4272 case "number": 4273 throw new TypeError(); 4274 break; 4275 case "string": 4276 return new AttributeName(new QName(null, (s + "").replace(/^@/,""))); 4277 break; 4278 case "object": 4279 return new AttributeName(new QName(null, ToString(s))); 4280 break; 4281 } 4282 } 4283 4284 /** 4285 * 4286 * 4287 * @param mixed s 4288 * @returns QName | AttributeName 4289 * @throws TypeError 4290 */ 4291 function ToXMLName (s) 4292 { 4293 if (s instanceof QName || s instanceof AttributeName) 4294 { 4295 return s; 4296 } 4297 else if (s === "*") 4298 { 4299 return new QName("*"); 4300 } 4301 4302 switch (typeof(s)) 4303 { 4304 case "undefined": 4305 case "null": 4306 case "boolean": 4307 case "number": 4308 throw new TypeError(); 4309 break; 4310 case "string": 4311 if (s.charAt(0) === "@") 4312 { 4313 return ToAttributeName( s.substr(0) ); 4314 } 4315 4316 return new QName(s); 4317 4318 break; 4319 case "object": 4320 return ToXMLName( ToString(s) ); 4321 break; 4322 } 4323 } 4324 4325 /** 4326 * 4327 * 4328 * @returns String 4329 */ 4330 function GetDefaultNamespace () 4331 { 4332 return !!defaultNamespace && defaultNamespace.uri || ""; 4333 } 4334 4335 /** 4336 * 4337 * 4338 * @param String s 4339 * @returns String 4340 */ 4341 function EscapeElementValue (s) 4342 { 4343 return ((s||"")+"").replace(/./g, function (c) 4344 { 4345 switch (c) 4346 { 4347 case "<": 4348 return "<"; 4349 case ">": 4350 return ">"; 4351 case "&": 4352 return "&"; 4353 default: 4354 return c; 4355 } 4356 }); 4357 } 4358 4359 /** 4360 * 4361 * 4362 * 4363 * @param String s 4364 * @returns String 4365 */ 4366 function EscapeAttributeValue (s) 4367 { 4368 return ((s||"")+"").replace(/./g, function (c) 4369 { 4370 switch (c) 4371 { 4372 case '"': 4373 return """; 4374 case "<": 4375 return "<"; 4376 case ">": 4377 return ">"; 4378 case "&": 4379 return "&"; 4380 case "\r": 4381 return "
"; 4382 case "\n": 4383 return "
"; 4384 case "\t": 4385 return "	"; 4386 default: 4387 return c; 4388 } 4389 }); 4390 } 4391 4392 /** 4393 * 4394 * 4395 * @access private 4396 * @param String | QName PropertyName 4397 * @returns XMLList 4398 */ 4399 function Get (PropertyName) 4400 { 4401 if (this instanceof XMLList) 4402 { 4403 return GetList.call(this, PropertyName); 4404 } 4405 4406 if (parseInt(PropertyName)+"" == PropertyName) 4407 { 4408 return GetList.call(ToXMLList(this), PropertyName ); 4409 } 4410 4411 var n = ToXMLName(PropertyName), 4412 list = new XMLList(), p, l; 4413 4414 list._TargetObject = this; 4415 list._TargetProperty = n; 4416 4417 if (n instanceof AttributeName) 4418 { 4419 for (p in this._Attributes) 4420 { 4421 if ( 4422 (n._Name.localName === "*" || n._Name.localName === this._Attributes[p]._Name.localName) 4423 && 4424 (n._Name.uri == null || n._Name.uri === this._Attributes[p]._Name.uri) 4425 ) 4426 { 4427 list.Append(this._Attributes[p]); 4428 } 4429 } 4430 } 4431 else 4432 { 4433 for (p = 0, l = this._Children.length; p < l; ++p) 4434 { 4435 if ( 4436 (n.localName === "*" || (this._Children[p]._Class === "element" && this._Children[p]._Name.localName === n.localName)) 4437 && 4438 (n.uri == null || (this._Children[p]._Class === "element" && n.uri === this._Children[p]._Name.uri)) 4439 ) 4440 { 4441 list.Append(this._Children[p]); 4442 } 4443 } 4444 } 4445 4446 return list; 4447 } 4448 4449 /** 4450 * 4451 * 4452 * 4453 * @access private 4454 * @param String | QName P 4455 * @returns Boolean 4456 */ 4457 function HasProperty (P) 4458 { 4459 if (this instanceof XMLList) 4460 { 4461 return HasPropertyList.call(this, P); 4462 } 4463 4464 if (parseInt(P) == P) 4465 { 4466 return P == "0"; 4467 } 4468 4469 var n = ToXMLName(P), k, l; 4470 4471 if (n instanceof AttributeName) 4472 { 4473 for (k in this._Attributes) 4474 { 4475 if ( 4476 ( 4477 n._Name.localName === "*" || n._Name.localName === this._Attributes[k]._Name.localName 4478 ) && 4479 ( 4480 n._Name.uri == null || n._Name.uri === this._Attributes[k]._Name.uri 4481 ) 4482 ) 4483 { 4484 return true; 4485 } 4486 } 4487 4488 return false;
4489 } 4490 4491 for (k = 0, l = this._Children.length; k < l; ++k) 4492 { 4493 if ( 4494 (n.localName === "*" || (this._Children[k]._Class === "element" && this._Children[k]._Name.localName === n.localName)) 4495 && 4496 (n.uri == null || (this._Children[k]._Class === "element" && n.uri === this._Children[k]._Name.uri)) 4497 ) 4498 { 4499 return true; 4500 } 4501 } 4502 4503 return false; 4504 } 4505 4506 /** 4507 * 4508 * 4509 * 4510 * @access private 4511 * @param String | QName PropertyName 4512 * @returns Boolean 4513 * @throws TypeError 4514 */ 4515 function DeleteByIndex (PropertyName) 4516 { 4517 var i = parseInt(PropertyName);//, q = i + 1, l = this._Children.length; 4518 4519 if (i == PropertyName) 4520 { 4521 if (!!this._Children[i]) 4522 { 4523 this._Children[i]._Parent = null; 4524 4525 this._Children[i] = null; 4526 4527 this._Children.splice(i, 1); 4528 4529 /* 4530 for (;q < l;++q) 4531 { 4532 this._Children[q-1] = this._Children[q]; 4533 } 4534 */ 4535 } 4536 4537 return true; 4538 } 4539 4540 throw new TypeError(); 4541 } 4542 4543 /** 4544 * 4545 * 4546 * 4547 * @access private 4548 * @returns XML 4549 */ 4550 function DeepCopy () 4551 { 4552 if (this instanceof XMLList) 4553 { 4554 return DeepCopyList.call(this); 4555 } 4556 4557 var y = new XML(), i, l;//, c, t; 4558 4559 y._Class = this._Class; 4560 y._Name = this._Name; 4561 y._DefaultNamespace = this._DefaultNamespace ? new Namespace(this._DefaultNamespace) : null; 4562 y._Value = this._Value; 4563 y._Parent = null; 4564 4565 for (i in this._InScopeNamespaces) 4566 { 4567 y._InScopeNamespaces[i] = new Namespace(this._InScopeNamespaces.prefix, this._InScopeNamespaces.uri); 4568 } 4569 4570 for (l in this._Attributes) 4571 { 4572 //y._Attributes[i] = arguments.callee.call(this._Attributes[i]); 4573 //not part of the spec 4574 y._Attributes[i] = this._Attributes[l].copy(); 4575 y._Attributes[i]._Parent = y; 4576 } 4577 4578 for (i = 0, l = this._Children.length; i < l; ++i) 4579 { 4580 y._Children[i] = this._Children[i].copy(); 4581 y._Children[i]._Parent = y; 4582 } 4583 4584 return y; 4585 } 4586 4587 /** 4588 * 4589 * 4590 * 4591 * @access private 4592 * @returns XML 4593 */ 4594 function ResolveValue () 4595 { 4596 if (this instanceof XMLList) 4597 { 4598 return ResolveValueList.call(this); 4599 } 4600 return this instanceof XML ? this : null; 4601 } 4602 4603 /** 4604 * 4605 * 4606 * 4607 * @access private 4608 * @param String | QName PropertyName 4609 * @returns XMLList 4610 */ 4611 function Descendants (PropertyName) 4612 { 4613 if (this instanceof XMLList) 4614 { 4615 return DescendantsList.call(this, PropertyName); 4616 } 4617 4618 var n = ToXMLName(PropertyName), 4619 list = new XMLList(), 4620 k, l, dq; 4621 4622 list._TargetObject = null; 4623 4624 if (n instanceof AttributeName) 4625 { 4626 for (k in this._Attributes) 4627 { 4628 if ( 4629 (n._Name.localName === "*" || n._Name.localName === this._Attributes[k]._Name.localName) 4630 && 4631 (n._Name.uri == null || n._Name.uri === this._Attributes[k]._Name.uri) 4632 ) 4633 { 4634 list.Append(this._Attributes[k]); 4635 } 4636 } 4637 } 4638 4639 for (k = 0, l = this._Children.length; k < l; ++k) 4640 { 4641 if ( 4642 (n.localName === "*" || (this._Children[k]._Class === "element" && this._Children[k]._Name.localName === n.localName)) 4643 && 4644 (n.uri == null || (this._Children[k]._Class === "element" && n.uri === this._Children[k]._Name.uri)) 4645 ) 4646 { 4647 list.Append(this._Children[k]); 4648 } 4649 4650 dq = this._Children[k].descendants(n); 4651 4652 if (dq.length() > 0) 4653 { 4654 list.Append(dq); 4655 } 4656 } 4657 4658 return list; 4659 } 4660 4661 /** 4662 * 4663 * 4664 * 4665 * @access private 4666 * @param String | QName PropertyName 4667 * @param XML Value 4668 * @returns null 4669 * @throws TypeError | Error 4670 */ 4671 function Insert (PropertyName, Value) 4672 { 4673 if ((",text,comment,processing-instruction,attribute,").indexOf("," + this._Class + ",") > -1) 4674 { 4675 return false;
4676 } 4677 4678 var i = parseInt(PropertyName), n, j; 4679 4680 if (i+"" != PropertyName) 4681 { 4682 throw new TypeError("'" + i + "' != '" + PropertyName + "'"); 4683 } 4684 4685 if (Value === this || indexOf("," + this, Value.descendants("*")) > -1) 4686 { 4687 throw new Error(); 4688 } 4689 4690 n = Value.length(); 4691 4692 for (j = this._Children.length - 1; j >= i; --j) 4693 { 4694 this._Children[ j + n ] = this._Children[j]; 4695 } 4696 4697 4698 if (Value instanceof XMLList) 4699 { 4700 for (j = 0; j < n; ++j) 4701 { 4702 Value[j]._Parent = this; 4703 this._Children[i + j] = Value[j]; 4704 } 4705 } 4706 else 4707 { 4708 Replace.call(this, i, Value); 4709 } 4710 4711 return null; 4712 } 4713 4714 /** 4715 * 4716 * 4717 * 4718 * @access private 4719 * @param String | QName PropertyName 4720 * @param XML Value 4721 * @returns null 4722 * @throws TypeError 4723 */ 4724 function Replace (PropertyName, Value) 4725 { 4726 if ((",text,comment,processing-instruction,attribute,").indexOf("," + this._Class + ",") > -1) 4727 { 4728 return null; 4729 } 4730 4731 var i = parseInt(PropertyName), t; 4732 4733 if (i+"" != PropertyName) 4734 { 4735 throw new TypeError("'" + i + "' != '" + PropertyName + "'"); 4736 } 4737 4738 if (i >= this._Children.length) 4739 { 4740 PropertyName = this._Children.length; 4741 } 4742 4743 if (Value instanceof XMLList) 4744 { 4745 DeleteByIndex.call(this, PropertyName); 4746 Insert.call(this, PropertyName, Value); 4747 } 4748 else if (Value instanceof XML 4749 && Value._Class === "element" 4750 && (",element,comment,processing-instruction,text").indexOf("," + Value._Class + ",") > -1 4751 ) 4752 { 4753 Value._Parent = this; 4754 4755 if (this._Children[PropertyName]) 4756 { 4757 this._Children[PropertyName]._Parent = null; 4758 } 4759 4760 this._Children[PropertyName] = Value; 4761 } 4762 else 4763 { 4764 t = new XML(); 4765 t._Parent = this; 4766 t._Value = ToString(Value); 4767 4768 if (this._Children[PropertyName]) 4769 { 4770 this._Children[PropertyName]._Parent = null; 4771 } 4772 4773 this._Children[PropertyName] = t; 4774 } 4775 }; 4776 4777 /** 4778 * 4779 * 4780 * 4781 * @access private 4782 * @param String | Namespace NameSpace 4783 * @returns null 4784 */ 4785 function AddInScopeNamespace (NameSpace) 4786 { 4787 if ((",text,comment,processing-instruction,attribute,").indexOf("," + this._Class + ",") > -1) 4788 { 4789 return null; 4790 } 4791 4792 var match = null, p; 4793 4794 if (NameSpace.prefix == "" && this._Name.uri == "") 4795 { 4796 return null; 4797 } 4798 4799 for (p in this._InScopeNamespaces) 4800 { 4801 if (NameSpace.prefix === this._InScopeNamespaces[p].prefix) 4802 { 4803 match = this._InScopeNamespaces[p]; 4804 } 4805 } 4806 4807 if (match && match.uri != NameSpace.uri) 4808 { 4809 this._InScopeNamespaces[match.prefix] = null; 4810 try{ 4811 delete this._InScopeNamespaces[match.prefix]; 4812 }catch(e){} 4813 } 4814 4815 this._InScopeNamespaces[NameSpace.prefix] = NameSpace; 4816 4817 if (this._Name.prefix === NameSpace.prefix) 4818 { 4819 this._Name.prefix = undefined; 4820 } 4821 4822 for (p in this._Attributes) 4823 { 4824 if (this._Attributes[p]._Name.prefix = NameSpace.prefix) 4825 { 4826 this._Attributes[p]._Name.prefix = undefined; 4827 } 4828 } 4829 4830 //do this in order to ensure namespace integrity 4831 /*match = parse(this.toXMLString()); 4832 this._Node = !!this._Node.parentNode 4833 ? this._Node.parentNode.replaceChild(match.documentElement, this._Node) 4834 : match;*/ 4835 } 4836 4837 /** 4838 * 4839 * 4840 * @access private 4841 * @param String | Number name 4842 * @returns Boolean 4843 */ 4844 function HasPropertyList (name) 4845 { 4846 if (ToString( parseInt(name) ) === name) 4847 { 4848 return parseInt(name) < this._Children.length; 4849 } 4850 4851 for (var i = 0, l = this._Children.length; i < l; ++i) 4852 { 4853 if (this[i]._Class === "element" && this[i].hasOwnProperty(name)) 4854 { 4855 return true; 4856 } 4857 } 4858 4859 return false;
4860 } 4861 4862 /** 4863 * 4864 * 4865 * 4866 * @access private 4867 * @param String | Number | QName PropertyName 4868 * @returns XMLList 4869 */ 4870 function GetList (PropertyName) 4871 { 4872 if (parseInt(PropertyName)+"" == PropertyName) 4873 { 4874 return this[PropertyName]; 4875 } 4876 4877 var list = new XMLList(), i = 0, l = this._Children.length, temp; 4878 list._TargetObject = this; 4879 list._TargetProperty = PropertyName; 4880 4881 for (;i < l; ++i) 4882 { 4883 if (this._Children[i]._Class === "element") 4884 { 4885 temp = Get.call(this._Children[i], PropertyName); 4886 4887 if (temp._Children.length > 0) 4888 { 4889 list.Append(temp); 4890 } 4891 } 4892 } 4893 4894 return list; 4895 } 4896 4897 /** 4898 * 4899 * 4900 * 4901 * @access private 4902 * @returns XMLList 4903 */ 4904 function DeepCopyList () 4905 { 4906 var list = new XMLList(), i = 0, l = this._Children.length; 4907 4908 list._TargetObject = this._TargetObject; 4909 list._TargetProperty = this._TargetProperty; 4910 list._Class = this._Class; 4911 list._Value = this._Value; 4912 4913 for (;i < l; ++i) 4914 { 4915 list.Append(DeepCopy.call(this[i])); 4916 } 4917 4918 return list; 4919 } 4920 4921 /** 4922 * 4923 * 4924 * 4925 * @access private 4926 * @param String | QName PropertyName 4927 * @returns XMLList 4928 */ 4929 function DescendantsList (PropertyName) 4930 { 4931 var list = new XMLList(), i = 0, l = this._Children.length, temp; 4932 4933 for (; i < l; ++i) 4934 { 4935 if (this[i]._Class === "element") 4936 { 4937 if ((temp = Descendants.call(this[i], "*")) && temp.length() > 0) 4938 { 4939 list.Append(temp); 4940 } 4941 } 4942 } 4943 4944 return list; 4945 } 4946 4947 /** 4948 * http://blog.stevenlevithan.com/archives/faster-trim-javascript 4949 * 4950 * 4951 * @param String s 4952 * @returns String 4953 */ 4954 function trim (str) 4955 { 4956 if(!str) 4957 return str; 4958 var str = str.replace(/^\s\s*/, ""), 4959 ws = /\s/, 4960 i = str.length; 4961 while (ws.test(str.charAt(--i))); 4962 return str.slice(0, i + 1); 4963 } 4964 4965 /** 4966 * Generates a prefix for a QName that is not already 4967 * a property of the optional argument 4968 * 4969 * @param Object prefixes 4970 * @returns String 4971 */ 4972 function newPrefix (prefixes) 4973 { 4974 prefixes = prefixes || {}; 4975 4976 var num = Math.random() 4977 .toString() 4978 .substr(2) 4979 .replace(/.{2}/g, function (a) 4980 { 4981 a = Number(a); 4982 return (a > 90 ? 90 : (a < 65 ? 65 : a)) + ""; 4983 }); 4984 4985 num = String.fromCharCode( 4986 Number(num.substr(0, 2)) & 0xFF, 4987 Number(num.substr(2, 2)) & 0xFF, 4988 Number(num.substr(4, 2)) & 0xFF, 4989 Number(num.substr(6, 2)) & 0xFF, 4990 Number(num.substr(8, 2)) & 0xFF, 4991 Number(num.substr(10, 2)) & 0xFF 4992 ).toLowerCase(); 4993 4994 while (num in prefixes) 4995 { 4996 num = arguments.callee(prefixes); 4997 } 4998 4999 return num; 5000 } 5001 5002 /** 5003 * 5004 * 5005 * @param String str 5006 * @returns DOMNode 5007 * @throws SyntaxError 5008 */ 5009 function parse (str) 5010 { 5011 var xmlDoc, success = true; 5012 5013 if (isActiveXSupported("Microsoft.XMLDOM")) //Internet Explorer 5014 { 5015 try{ 5016 xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 5017 xmlDoc.async = 'false'; 5018 xmlDoc.preserveWhiteSpace = true;
5019 xmlDoc.resolveExternals = false; 5020 xmlDoc.validateOnParse = false; 5021 xmlDoc.setProperty('ProhibitDTD', false); 5022 success = xmlDoc.loadXML(str); 5023 }catch(e){} 5024 } 5025 else 5026 { 5027 try{//Firefox, Mozilla, Opera, etc. 5028 xmlDoc = new DOMParser(); 5029 xmlDoc = xmlDoc.parseFromString(str, "text/xml"); 5030 }catch(e){} 5031 } 5032 5033 if (!success || !xmlDoc || xmlDoc.documentElement.nodeName == "parsererror") 5034 { 5035 throw new SyntaxError(!!xmlDoc && xmlDoc.documentElement.childNodes[0].nodeValue); 5036 } 5037 5038 return xmlDoc; 5039 } 5040 5041 /** 5042 * 5043 * 5044 * @param Object obj 5045 * @returns Number 5046 */ 5047 function count (obj) 5048 { 5049 if ("__count__" in obj) 5050 { 5051 return obj.__count__; 5052 } 5053 5054 var i = 0, k; 5055 5056 for (k in obj) 5057 { 5058 if (obj.hasOwnProperty(k)) 5059 { 5060 ++i; 5061 } 5062 } 5063 5064 return i; 5065 } 5066 5067 /** 5068 * 5069 * 5070 * @param Object obj 5071 * @param XMLList list 5072 * @returns Number 5073 */ 5074 function indexOf (obj, list) 5075 { 5076 for (var i = 0, l = list.length(); i < l; ++i) 5077 { 5078 if (list[i].Equals(obj)) 5079 { 5080 return i; 5081 } 5082 } 5083 5084 return -1; 5085 } 5086 5087 /** 5088 * 5089 * 5090 * @param mixed obj 5091 * @param mixed ... 5092 * @returns mixed 5093 */ 5094 function extend (obj) 5095 { 5096 for (var p, i = 1, l = arguments.length; i < l; ++i) 5097 { 5098 for (p in arguments[i]) 5099 { 5100 obj[p] = arguments[i][p]; 5101 } 5102 } 5103 5104 return obj; 5105 } 5106 5107 /** 5108 * 5109 * 5110 * 5111 */ 5112 function createDocumentFrom (xml) 5113 { 5114 return parse(xml.length() == 1 ? xml.toXMLString() : "<x>" + xml.toXMLString() + "</x>"); 5115 } 5116 5117 /** 5118 * 5119 * 5120 * 5121 */ 5122 function xmlToDomNode (xml) 5123 { 5124 switch (xml.nodeKind()) 5125 { 5126 case "element": 5127 return createDocumentFrom(xml).documentElement; 5128 5129 case "text": 5130 return xmlDoc.createTextNode(xml.toString()); 5131 5132 case "comment": 5133 return xmlDoc.createComment(xml.toString().slice(4, -3)); 5134 5135 case "processing-instruction": 5136 return xmlDoc.createProcessingInstruction( 5137 xml.localName(), 5138 xml.toString().slice(2, -2).replace(piName, "") 5139 ); 5140 5141 case "attribute": 5142 return createAttributeNS(xml); 5143 } 5144 return null; 5145 } 5146 5147 function adoptNode (doc, node) 5148 { 5149 if (!!doc.adoptNode) 5150 { 5151 return doc.adoptNode(node); 5152 } 5153 5154 var b = doc.documentElement || doc.body; 5155 return b.removeChild(b.appendChild(node)); 5156 } 5157 5158 function evaluate (doc, expr, xml) 5159 { 5160 var res, l, n = ""; 5161 5162 if (!!doc.evaluate) 5163 { 5164 res = doc.evaluate( 5165 expr, 5166 doc, 5167 doc.createNSResolver(doc), 5168 XPathResult.ORDERED_NODE_ITERATOR_TYPE, 5169 null 5170 ); 5171 5172 l = []; 5173 5174 while(n = res.iterateNext()) 5175 { 5176 l[l.length] = n; 5177 } 5178 5179 return l; 5180 } 5181 5182 if ("setProperty" in doc){ 5183 5184 res = allNamespaces(xml); 5185 5186 if (count(res)) 5187 { 5188 for (l in res) 5189 { 5190 n += " xmlns:" + l + '="' + EscapeAttributeValue(res[l]) + '"'; 5191 } 5192 5193 doc.setProperty('SelectionNamespaces', n.substr(1)); 5194 } 5195 5196 doc.setProperty("SelectionLanguage", "XPath"); 5197 } 5198 5199 return isActiveXSupported("Microsoft.XMLDOM") && doc.selectNodes(expr); 5200 } 5201 5202 function isActiveXSupported(type) { 5203 try { 5204 new ActiveXObject(type); 5205 return true; 5206 } catch (e) { 5207 return false;
5208 } 5209 } 5210 5211 function allNamespaces (xml, un) 5212 { 5213 var ns = un || {}, 5214 i = 0, 5215 c = xml.children(), 5216 l = c.length(), 5217 n = un == undefined 5218 ? inscope(xml) 5219 : xml._InScopeNamespaces, 5220 p; 5221 5222 for (;i < l; ++i) 5223 { 5224 ns = arguments.callee(c[i], ns); 5225 } 5226 5227 for (p in n) 5228 { 5229 if (n[p].prefix) 5230 { 5231 ns[n[p].prefix] = n[p].uri; 5232 } 5233 } 5234 5235 return ns; 5236 } 5237 5238 function inscope (xml) 5239 { 5240 var ns = {}, 5241 i = 0, 5242 n = xml.inScopeNamespaces(), 5243 l = n.length; 5244 5245 for (;i < l; ++i) 5246 { 5247 if (n[i].prefix) 5248 { 5249 ns[n[i].prefix] = n[i].uri; 5250 } 5251 } 5252 5253 return ns; 5254 } 5255 5256 function createAttributeNS (xml) 5257 { 5258 var ns = xml.namespace(), 5259 node = !!xmlDoc.createAttributeNS 5260 ? xmlDoc.createAttributeNS(ns.uri, xml.localName()) 5261 : xmlDoc.createAttribute((ns.prefix ? ns.prefix + ":" : "" ) + xml.localName()); 5262 5263 node.nodeValue = xml.toString(); 5264 return node; 5265 } 5266 5267 function transform (xml, style, params) 5268 { 5269 var xsl, res, i = 0, l = (params||[]).length; 5270 5271 if (!window.XSLTProcessor) 5272 { 5273 //TODO: Need to create a way to set parameters on an IE stylesheet 5274 //XSLProcessor 5275 //http://msdn.microsoft.com/en-us/library/ms757015%28v=VS.85%29.aspx 5276 //http://msdn.microsoft.com/en-us/library/ms763679%28VS.85%29.aspx 5277 //http://msdn.microsoft.com/en-us/library/ms754594%28v=VS.85%29.aspx 5278 5279 res = createDocumentFrom(xml).transformNode(createDocumentFrom(style)); 5280 5281 return !!res && ToXML(res) || null; 5282 } 5283 5284 xsl = new XSLTProcessor(); 5285 5286 xsl.importStyleSheet(createDocumentFrom(style)); 5287 5288 for (; i < l; ++i) 5289 { 5290 res = params[i]; 5291 xsl.setParameter(res.namespaceURI, res.localName, res.value); 5292 } 5293 5294 res = xsl.transformToDocument(createDocumentFrom(doc)) 5295 5296 return !!res && ToXML(res) || null; 5297 } 5298 5299 for (p in XML.prototype) 5300 { 5301 defaultXMLPrototype += p + ","; 5302 } 5303 5304 for (p in XMLList.prototype) 5305 { 5306 defaultXMLListPrototype += p + ","; 5307 } 5308 5309 /** 5310 * 5311 * 5312 * 5313 */ 5314 window.XML = XML; 5315 window.XMLList = XMLList; 5316 window.QName = QName; 5317 window.Namespace = Namespace; 5318 window.isXMLName = isXMLName; 5319 window.AttributeName = AttributeName; 5320 5321 })(); 5322} 5323(function(){var h=this; 5324function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"== 5325b&&"undefined"==typeof a.call)return"object";return b}function k(a){return"string"==typeof a}function ba(a,b,c){return a.call.apply(a.bind,arguments)}function ca(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}} 5326function da(a,b,c){da=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ba:ca;return da.apply(null,arguments)}
5326function ea(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}} 5327function m(a){var b=n;function c(){}c.prototype=b.prototype;a.u=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.t=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};var fa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function ga(a,b){return a<b?-1:a>b?1:0};var q;a:{var ha=h.navigator;if(ha){var ia=ha.userAgent;if(ia){q=ia;break a}}q=""}function r(a){return-1!=q.indexOf(a)};var s=Array.prototype,ja=s.indexOf?function(a,b,c){return s.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(k(a))return k(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},t=s.forEach?function(a,b,c){s.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=k(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},ka=s.filter?function(a,b,c){return s.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=k(a)? 5328a.split(""):a,l=0;l<d;l++)if(l in g){var p=g[l];b.call(c,p,l,a)&&(e[f++]=p)}return e},u=s.reduce?function(a,b,c,d){d&&(b=da(b,d));return s.reduce.call(a,b,c)}:function(a,b,c,d){var e=c;t(a,function(c,g){e=b.call(d,e,c,g,a)});return e},la=s.some?function(a,b,c){return s.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=k(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1}; 5329function ma(a,b){var c;a:{c=a.length;for(var d=k(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:k(a)?a.charAt(c):a[c]}function na(a){return s.concat.apply(s,arguments)}function oa(a,b,c){return 2>=arguments.length?s.slice.call(a,b):s.slice.call(a,b,c)};var pa=r("Opera")||r("OPR"),v=r("Trident")||r("MSIE"),qa=r("Gecko")&&-1==q.toLowerCase().indexOf("webkit")&&!(r("Trident")||r("MSIE")),ra=-1!=q.toLowerCase().indexOf("webkit");function sa(){var a=h.document;return a?a.documentMode:void 0} 5330var ta=function(){var a="",b;if(pa&&h.opera)return a=h.opera.version,"function"==aa(a)?a():a;qa?b=/rv\:([^\);]+)(\)|;)/:v?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:ra&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(q))?a[1]:"");return v&&(b=sa(),b>parseFloat(a))?String(b):a}(),ua={};
vendor: 19,492 bytes, lines 5331-5364
5331function va(a){if(!ua[a]){for(var b=0,c=fa(String(ta)).split("."),d=fa(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",l=d[f]||"",p=RegExp("(\\d*)(\\D*)","g"),x=RegExp("(\\d*)(\\D*)","g");do{var C=p.exec(g)||["","",""],X=x.exec(l)||["","",""];if(0==C[0].length&&0==X[0].length)break;b=ga(0==C[1].length?0:parseInt(C[1],10),0==X[1].length?0:parseInt(X[1],10))||ga(0==C[2].length,0==X[2].length)||ga(C[2],X[2])}while(0==b)}ua[a]=0<=b}} 5332var wa=h.document,xa=wa&&v?sa()||("CSS1Compat"==wa.compatMode?parseInt(ta,10):5):void 0;!qa&&!v||v&&v&&9<=xa||qa&&va("1.9.1");v&&va("9");function ya(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} 5333function za(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(v&&!(v&&9<=xa)){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Aa(a,b):!c&&ya(e,b)?-1*Ba(a,b):!d&&ya(f,a)?Ba(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?a: 5334a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(h.Range.START_TO_END,d)}function Ba(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Aa(d,a)}function Aa(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};function w(a,b,c){this.a=a;this.b=b||1;this.d=c||1};function Ca(a){this.b=a;this.a=0}function Da(a){a=a.match(Ea);for(var b=0;b<a.length;b++)Fa.test(a[b])&&a.splice(b,1);return new Ca(a)}var Ea=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),Fa=/^\s/;function y(a,b){return a.b[a.a+(b||0)]}function z(a){return a.b[a.a++]}function Ga(a){return a.b.length<=a.a};function A(a,b){this.h=a.toLowerCase();this.c=b?b.toLowerCase():"http://www.w3.org/1999/xhtml"}A.prototype.a=function(a){var b=a.nodeType;return 1!=b&&2!=b?!1:"*"!=this.h&&this.h!=a.nodeName.toLowerCase()?!1:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};A.prototype.d=function(){return this.h};A.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.h};function B(a,b){this.f=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ha(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}B.prototype.a=function(a){return null===this.b||this.b==a.nodeType};B.prototype.d=function(){return this.f}; 5335B.prototype.toString=function(){var a="Kind Test: "+this.f;null===this.c||(a+=D(this.c));return a};function Ia(a){switch(a.nodeType){case 1:return ea(Ja,a);case 9:return Ia(a.documentElement);case 11:case 10:case 6:case 12:return Ka;default:return a.parentNode?Ia(a.parentNode):Ka}}function Ka(){return null}function Ja(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Ja(a.parentNode,b):null};var E=v&&!(v&&9<=xa),La=v&&!(v&&8<=xa);function F(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Ma(a,b){var c=La&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new F(b,a,b.nodeName,c)};function G(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(E&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),E&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} 5336function H(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}La&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function I(a,b,c,d,e){return(E?Na:Oa).call(null,a,b,k(c)?c:null,k(d)?d:null,e||new J)} 5337function Na(a,b,c,d,e){if(a instanceof A||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Pa(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],l=0;b=f[l++];)H(b,c,d)&&g.push(b);f=g}for(l=0;b=f[l++];)"*"==a&&"!"==b.tagName||K(e,b);return e}Qa(a,b,c,d,e);return e} 5338function Oa(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!v?(b=b.getElementsByName(d),t(b,function(b){a.a(b)&&K(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),t(b,function(b){b.className==d&&a.a(b)&&K(e,b)})):a instanceof B?Qa(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.d()),t(b,function(a){H(a,c,d)&&K(e,a)}));return e} 5339function Ra(a,b,c,d,e){var f;if((a instanceof A||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Pa(a);if("*"!=g&&(f=ka(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ka(f,function(a){return H(a,c,d)}));t(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||K(e,a)});return e}return Sa(a,b,c,d,e)}function Sa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)H(b,c,d)&&a.a(b)&&K(e,b);return e} 5340function Qa(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)H(b,c,d)&&a.a(b)&&K(e,b),Qa(a,b,c,d,e)}function Pa(a){if(a instanceof B){if(8==a.b)return"!";if(null===a.b)return"*"}return a.d()};function J(){this.b=this.a=null;this.i=0}function Ta(a){this.d=a;this.a=this.b=null}function Ua(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.d,l=d.d;f==l||f instanceof F&&l instanceof F&&f.a==l.a?(f=c,c=c.a,d=d.a):0<za(c.d,d.d)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.i=g;return a}function Va(a,b){var c=new Ta(b);c.a=a.a;a.b?a.a.b=c:a.a=a.b=c;a.a=c;a.i++} 5341function K(a,b){var c=new Ta(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.i++}function Wa(a){return(a=a.a)?a.d:null}function Xa(a){return(a=Wa(a))?G(a):""}function L(a,b){return new Ya(a,!!b)}function Ya(a,b){this.d=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function M(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.d};function n(a){this.g=a;this.b=this.e=!1;this.d=null}function D(a){return"\n "+a.toString().split("\n").join("\n ")}function Za(a,b){a.e=b}function $a(a,b){a.b=b}function N(a,b){var c=a.a(b);return c instanceof J?+Xa(c):+c}function O(a,b){var c=a.a(b);return c instanceof J?Xa(c):""+c}function P(a,b){var c=a.a(b);return c instanceof J?!!c.i:!!c};function Q(a,b,c){n.call(this,a.g);this.c=a;this.f=b;this.k=c;this.e=b.e||c.e;this.b=b.b||c.b;this.c==ab&&(c.b||c.e||4==c.g||0==c.g||!b.d?b.b||b.e||4==b.g||0==b.g||!c.d||(this.d={name:c.d.name,l:b}):this.d={name:b.d.name,l:c})}m(Q); 5342function R(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof J&&c instanceof J){e=L(b);for(d=M(e);d;d=M(e))for(b=L(c),f=M(b);f;f=M(b))if(a(G(d),G(f)))return!0;return!1}if(b instanceof J||c instanceof J){b instanceof J?e=b:(e=c,c=b);e=L(e);b=typeof c;for(d=M(e);d;d=M(e)){switch(b){case "number":d=+G(d);break;case "boolean":d=!!G(d);break;case "string":d=G(d);break;default:throw Error("Illegal primitive type for comparison.");}if(a(d,c))return!0}return!1}return e?"boolean"==typeof b||"boolean"==typeof c? 5343a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Q.prototype.a=function(a){return this.c.j(this.f,this.k,a)};Q.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+D(this.f);return a+=D(this.k)};function bb(a,b,c,d){this.a=a;this.p=b;this.g=c;this.j=d}bb.prototype.toString=function(){return this.a};var cb={};function S(a,b,c,d){if(cb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new bb(a,b,c,d);return cb[a.toString()]=a} 5344S("div",6,1,function(a,b,c){return N(a,c)/N(b,c)});S("mod",6,1,function(a,b,c){return N(a,c)%N(b,c)});S("*",6,1,function(a,b,c){return N(a,c)*N(b,c)});S("+",5,1,function(a,b,c){return N(a,c)+N(b,c)});S("-",5,1,function(a,b,c){return N(a,c)-N(b,c)});S("<",4,2,function(a,b,c){return R(function(a,b){return a<b},a,b,c)});S(">",4,2,function(a,b,c){return R(function(a,b){return a>b},a,b,c)});S("<=",4,2,function(a,b,c){return R(function(a,b){return a<=b},a,b,c)}); 5345S(">=",4,2,function(a,b,c){return R(function(a,b){return a>=b},a,b,c)});var ab=S("=",3,2,function(a,b,c){return R(function(a,b){return a==b},a,b,c,!0)});S("!=",3,2,function(a,b,c){return R(function(a,b){return a!=b},a,b,c,!0)});S("and",2,2,function(a,b,c){return P(a,c)&&P(b,c)});S("or",1,2,function(a,b,c){return P(a,c)||P(b,c)});function db(a,b){if(b.a.length&&4!=a.g)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");n.call(this,a.g);this.c=a;this.f=b;this.e=a.e;this.b=a.b}m(db);db.prototype.a=function(a){a=this.c.a(a);return eb(this.f,a)};db.prototype.toString=function(){var a;a="Filter:"+D(this.c);return a+=D(this.f)};function fb(a,b){if(b.length<a.o)throw Error("Function "+a.h+" expects at least"+a.o+" arguments, "+b.length+" given");if(null!==a.n&&b.length>a.n)throw Error("Function "+a.h+" expects at most "+a.n+" arguments, "+b.length+" given");a.s&&t(b,function(b,d){if(4!=b.g)throw Error("Argument "+d+" to function "+a.h+" is not of type Nodeset: "+b);});n.call(this,a.g);this.f=a;this.c=b;Za(this,a.e||la(b,function(a){return a.e}));$a(this,a.r&&!b.length||a.q&&!!b.length||la(b,function(a){return a.b}))}m(fb); 5346fb.prototype.a=function(a){return this.f.j.apply(null,na(a,this.c))};fb.prototype.toString=function(){var a="Function: "+this.f;if(this.c.length)var b=u(this.c,function(a,b){return a+D(b)},"Arguments:"),a=a+D(b);return a};function gb(a,b,c,d,e,f,g,l,p){this.h=a;this.g=b;this.e=c;this.r=d;this.q=e;this.j=f;this.o=g;this.n=void 0!==l?l:g;this.s=!!p}gb.prototype.toString=function(){return this.h};var hb={}; 5347function T(a,b,c,d,e,f,g,l){if(hb.hasOwnProperty(a))throw Error("Function already created: "+a+".");hb[a]=new gb(a,b,c,d,!1,e,f,g,l)}T("boolean",2,!1,!1,function(a,b){return P(b,a)},1);T("ceiling",1,!1,!1,function(a,b){return Math.ceil(N(b,a))},1);T("concat",3,!1,!1,function(a,b){return u(oa(arguments,1),function(b,d){return b+O(d,a)},"")},2,null);T("contains",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return-1!=b.indexOf(a)},2);T("count",1,!1,!1,function(a,b){return b.a(a).i},1,1,!0); 5348T("false",2,!1,!1,function(){return!1},0);T("floor",1,!1,!1,function(a,b){return Math.floor(N(b,a))},1);T("id",4,!1,!1,function(a,b){function c(a){if(E){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ma(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=O(b,a).split(/\s+/),f=[];t(d,function(a){a=c(a);!a||0<=ja(f,a)||f.push(a)});f.sort(za);var g=new J;t(f,function(a){K(g,a)});return g},1); 5349T("lang",2,!1,!1,function(){return!1},1);T("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.d},0);T("local-name",3,!1,!0,function(a,b){var c=b?Wa(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);T("name",3,!1,!0,function(a,b){var c=b?Wa(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);T("namespace-uri",3,!0,!1,function(){return""},0,1,!0); 5350T("normalize-space",3,!1,!0,function(a,b){return(b?O(b,a):G(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);T("not",2,!1,!1,function(a,b){return!P(b,a)},1);T("number",1,!1,!0,function(a,b){return b?N(b,a):+G(a.a)},0,1);T("position",1,!0,!1,function(a){return a.b},0);T("round",1,!1,!1,function(a,b){return Math.round(N(b,a))},1);T("starts-with",2,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);return 0==b.lastIndexOf(a,0)},2);T("string",3,!1,!0,function(a,b){return b?O(b,a):G(a.a)},0,1); 5351T("string-length",1,!1,!0,function(a,b){return(b?O(b,a):G(a.a)).length},0,1);T("substring",3,!1,!1,function(a,b,c,d){c=N(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?N(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=O(b,a);if(Infinity==d)return a.substring(e);b=Math.round(d);return a.substring(e,c+b)},2,3);T("substring-after",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); 5352T("substring-before",3,!1,!1,function(a,b,c){b=O(b,a);a=O(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);T("sum",1,!1,!1,function(a,b){for(var c=L(b.a(a)),d=0,e=M(c);e;e=M(c))d+=+G(e);return d},1,1,!0);T("translate",3,!1,!1,function(a,b,c,d){b=O(b,a);c=O(c,a);var e=O(d,a);a=[];for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);T("true",2,!1,!1,function(){return!0},0);function ib(a){n.call(this,3);this.c=a.substring(1,a.length-1)}m(ib);ib.prototype.a=function(){return this.c};ib.prototype.toString=function(){return"Literal: "+this.c};function jb(a){n.call(this,1);this.c=a}m(jb);jb.prototype.a=function(){return this.c};jb.prototype.toString=function(){return"Number: "+this.c};function kb(a,b){n.call(this,a.g);this.f=a;this.c=b;this.e=a.e;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.m||c.c!=lb||(c=c.k,"*"!=c.d()&&(this.d={name:c.d(),l:null}))}}m(kb);function U(){n.call(this,4)}m(U);U.prototype.a=function(a){var b=new J;a=a.a;9==a.nodeType?K(b,a):K(b,a.ownerDocument);return b};U.prototype.toString=function(){return"Root Helper Expression"};function mb(){n.call(this,4)}m(mb);mb.prototype.a=function(a){var b=new J;K(b,a.a);return b};mb.prototype.toString=function(){return"Context Helper Expression"}; 5353function nb(a){return"/"==a||"//"==a}kb.prototype.a=function(a){var b=this.f.a(a);if(!(b instanceof J))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.i;c++){var e=a[c],f=L(b,e.c.a),g;if(e.e||e.c!=ob)if(e.e||e.c!=pb)for(g=M(f),b=e.a(new w(g));null!=(g=M(f));)g=e.a(new w(g)),b=Ua(b,g);else g=M(f),b=e.a(new w(g));else{for(g=M(f);(b=M(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new w(g))}}return b}; 5354kb.prototype.toString=function(){var a;a="Path Expression:"+D(this.f);if(this.c.length){var b=u(this.c,function(a,b){return a+D(b)},"Steps:");a+=D(b)}return a};function qb(a,b){this.a=a;this.b=!!b} 5355function eb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=L(b),f=b.i,g,l=0;g=M(e);l++){var p=a.b?f-l:l+1;g=d.a(new w(g,p,f));if("number"==typeof g)p=p==g;else if("string"==typeof g||"boolean"==typeof g)p=!!g;else if(g instanceof J)p=0<g.i;else throw Error("Predicate.evaluate returned an unexpected type.");if(!p){p=e;g=p.d;var x=p.a;if(!x)throw Error("Next must be called at least once before remove.");var C=x.b,x=x.a;C?C.a=x:g.a=x;x?x.b=C:g.b=C;g.i--;p.a=null}}return b} 5356qb.prototype.toString=function(){return u(this.a,function(a,b){return a+D(b)},"Predicates:")};function V(a,b,c,d){n.call(this,4);this.c=a;this.k=b;this.f=c||new qb([]);this.m=!!d;b=this.f;b=0<b.a.length?b.a[0].d:null;a.b&&b&&(a=b.name,a=E?a.toLowerCase():a,this.d={name:a,l:b.l});a:{a=this.f;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.e||1==c.g||0==c.g){a=!0;break a}a=!1}this.e=a}m(V); 5357V.prototype.a=function(a){var b=a.a,c=null,c=this.d,d=null,e=null,f=0;c&&(d=c.name,e=c.l?O(c.l,a):null,f=1);if(this.m)if(this.e||this.c!=rb)if(a=L((new V(sb,new B("node"))).a(a)),b=M(a))for(c=this.j(b,d,e,f);null!=(b=M(a));)c=Ua(c,this.j(b,d,e,f));else c=new J;else c=I(this.k,b,d,e),c=eb(this.f,c,f);else c=this.j(a.a,d,e,f);return c};V.prototype.j=function(a,b,c,d){a=this.c.d(this.k,a,b,c);return a=eb(this.f,a,d)}; 5358V.prototype.toString=function(){var a;a="Step:"+D("Operator: "+(this.m?"//":"/"));this.c.h&&(a+=D("Axis: "+this.c));a+=D(this.k);if(this.f.a.length){var b=u(this.f.a,function(a,b){return a+D(b)},"Predicates:");a+=D(b)}return a};function tb(a,b,c,d){this.h=a;this.d=b;this.a=c;this.b=d}tb.prototype.toString=function(){return this.h};var ub={};function W(a,b,c,d){if(ub.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new tb(a,b,c,!!d);return ub[a]=b} 5359W("ancestor",function(a,b){for(var c=new J,d=b;d=d.parentNode;)a.a(d)&&Va(c,d);return c},!0);W("ancestor-or-self",function(a,b){var c=new J,d=b;do a.a(d)&&Va(c,d);while(d=d.parentNode);return c},!0); 5360var lb=W("attribute",function(a,b){var c=new J,d=a.d();if("style"==d&&b.style&&E)return K(c,new F(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof B&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)E?f.nodeValue&&K(c,Ma(b,f)):K(c,f);else(f=e.getNamedItem(d))&&(E?f.nodeValue&&K(c,Ma(b,f)):K(c,f));return c},!1),rb=W("child",function(a,b,c,d,e){return(E?Ra:Sa).call(null,a,b,k(c)?c:null,k(d)?d:null,e||new J)},!1,!0);W("descendant",I,!1,!0); 5361var sb=W("descendant-or-self",function(a,b,c,d){var e=new J;H(b,c,d)&&a.a(b)&&K(e,b);return I(a,b,c,d,e)},!1,!0),ob=W("following",function(a,b,c,d){var e=new J;do for(var f=b;f=f.nextSibling;)H(f,c,d)&&a.a(f)&&K(e,f),e=I(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);W("following-sibling",function(a,b){for(var c=new J,d=b;d=d.nextSibling;)a.a(d)&&K(c,d);return c},!1);W("namespace",function(){return new J},!1); 5362var vb=W("parent",function(a,b){var c=new J;if(9==b.nodeType)return c;if(2==b.nodeType)return K(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&K(c,d);return c},!1),pb=W("preceding",function(a,b,c,d){var e=new J,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,l=f.length;g<l;g++){var p=[];for(b=f[g];b=b.previousSibling;)p.unshift(b);for(var x=0,C=p.length;x<C;x++)b=p[x],H(b,c,d)&&a.a(b)&&K(e,b),e=I(a,b,c,d,e)}return e},!0,!0); 5363W("preceding-sibling",function(a,b){for(var c=new J,d=b;d=d.previousSibling;)a.a(d)&&Va(c,d);return c},!0);var wb=W("self",function(a,b){var c=new J;a.a(b)&&K(c,b);return c},!1);function xb(a){n.call(this,1);this.c=a;this.e=a.e;this.b=a.b}m(xb);xb.prototype.a=function(a){return-N(this.c,a)};xb.prototype.toString=function(){return"Unary Expression: -"+D(this.c)};function yb(a){n.call(this,4);this.c=a;Za(this,la(this.c,function(a){return a.e}));$a(this,la(this.c,function(a){return a.b}))}m(yb);yb.prototype.a=function(a){var b=new J;t(this.c,function(c){c=c.a(a);if(!(c instanceof J))throw Error("Path expression must evaluate to NodeSet.");b=Ua(b,c)});return b};yb.prototype.toString=function(){return u(this.c,function(a,b){return a+D(b)},"Union Expression:")};function zb(a,b){this.a=a;this.b=b}function Ab(a){for(var b,c=[];;){Y(a,"Missing right hand side of binary expression.");b=Bb(a);var d=z(a.a);if(!d)break;var e=(d=cb[d]||null)&&d.p;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].p;)b=new Q(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Q(c.pop(),c.pop(),b);return b}function Y(a,b){if(Ga(a.a))throw Error(b);}function Cb(a,b){var c=z(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);} 5364function Db(a){a=z(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Eb(a){a=z(a.a);if(2>a.length)throw Error("Unclosed literal string");return new ib(a)}function Fb(a){var b=z(a.a),c=b.indexOf(":");if(-1==c)return new A(b);var d=b.substring(0,c);a=a.b(d);if(!a)throw Error("Namespace prefix not declared: "+d);b=b.substr(c+1);return new A(b,a)}
vendor: 4,516 bytes, lines 5365-5381
5365function Gb(a){var b,c=[],d;if(nb(y(a.a))){b=z(a.a);d=y(a.a);if("/"==b&&(Ga(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new U;d=new U;Y(a,"Missing next location step.");b=Hb(a,b);c.push(b)}else{a:{b=y(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":z(a.a);b=Ab(a);Y(a,'unclosed "("');Cb(a,")");break;case '"':case "'":b=Eb(a);break;default:if(isNaN(+b))if(!Ha(b)&&/(?![0-9])[\w]/.test(d)&&"("==y(a.a,1)){b=z(a.a);b= 5366hb[b]||null;z(a.a);for(d=[];")"!=y(a.a);){Y(a,"Missing function argument list.");d.push(Ab(a));if(","!=y(a.a))break;z(a.a)}Y(a,"Unclosed function argument list.");Db(a);b=new fb(b,d)}else{b=null;break a}else b=new jb(+z(a.a))}"["==y(a.a)&&(d=new qb(Ib(a)),b=new db(b,d))}if(b)if(nb(y(a.a)))d=b;else return b;else b=Hb(a,"/"),d=new mb,c.push(b)}for(;nb(y(a.a));)b=z(a.a),Y(a,"Missing next location step."),b=Hb(a,b),c.push(b);return new kb(d,c)} 5367function Hb(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==y(a.a))return d=new V(wb,new B("node")),z(a.a),d;if(".."==y(a.a))return d=new V(vb,new B("node")),z(a.a),d;var f;if("@"==y(a.a))f=lb,z(a.a),Y(a,"Missing attribute name");else if("::"==y(a.a,1)){if(!/(?![0-9])[\w]/.test(y(a.a).charAt(0)))throw Error("Bad token: "+z(a.a));c=z(a.a);f=ub[c]||null;if(!f)throw Error("No axis with name: "+c);z(a.a);Y(a,"Missing node name")}else f=rb;c=y(a.a);if(/(?![0-9])[\w]/.test(c.charAt(0)))if("("== 5368y(a.a,1)){if(!Ha(c))throw Error("Invalid node type: "+c);c=z(a.a);if(!Ha(c))throw Error("Invalid type name: "+c);Cb(a,"(");Y(a,"Bad nodetype");e=y(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Eb(a);Y(a,"Bad nodetype");Db(a);c=new B(c,g)}else c=Fb(a);else if("*"==c)c=Fb(a);else throw Error("Bad token: "+z(a.a));e=new qb(Ib(a),f.a);return d||new V(f,c,e,"//"==b)} 5369function Ib(a){for(var b=[];"["==y(a.a);){z(a.a);Y(a,"Missing predicate expression.");var c=Ab(a);b.push(c);Y(a,"Unclosed predicate expression.");Cb(a,"]")}return b}function Bb(a){if("-"==y(a.a))return z(a.a),new xb(Bb(a));var b=Gb(a);if("|"!=y(a.a))a=b;else{for(b=[b];"|"==z(a.a);)Y(a,"Missing next union location path."),b.push(Gb(a));a.a.a--;a=new yb(b)}return a};function Jb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=Da(a);if(Ga(c))throw Error("Invalid XPath expression.");b?"function"==aa(b)||(b=da(b.lookupNamespaceURI,b)):b=function(){return null};var d=Ab(new zb(c,b));if(!Ga(c))throw Error("Bad token: "+z(c));this.evaluate=function(a,b){var c=d.a(new w(a));return new Z(c,b)}} 5370function Z(a,b){if(0==b)if(a instanceof J)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof J))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof J?Xa(a):""+a;break;case 1:this.numberValue=a instanceof J?+Xa(a):+a;break;case 3:this.booleanValue=a instanceof J?0<a.i:!!a;break;case 4:case 5:case 6:case 7:var d= 5371L(a);c=[];for(var e=M(d);e;e=M(d))c.push(e instanceof F?e.a:e);this.snapshotLength=a.i;this.invalidIteratorState=!1;break;case 8:case 9:d=Wa(a);this.singleNodeValue=d instanceof F?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| 53720>a?null:c[a]}}Z.ANY_TYPE=0;Z.NUMBER_TYPE=1;Z.STRING_TYPE=2;Z.BOOLEAN_TYPE=3;Z.UNORDERED_NODE_ITERATOR_TYPE=4;Z.ORDERED_NODE_ITERATOR_TYPE=5;Z.UNORDERED_NODE_SNAPSHOT_TYPE=6;Z.ORDERED_NODE_SNAPSHOT_TYPE=7;Z.ANY_UNORDERED_NODE_TYPE=8;Z.FIRST_ORDERED_NODE_TYPE=9;function Kb(a){this.lookupNamespaceURI=Ia(a)} 5373function Lb(a){a=a||h;var b=a.document;b.evaluate||(a.XPathResult=Z,b.evaluate=function(a,b,e,f){return(new Jb(a,e)).evaluate(b,f)},b.createExpression=function(a,b){return new Jb(a,b)},b.createNSResolver=function(a){return new Kb(a)})}var Mb=["wgxpath","install"],$=h;Mb[0]in $||!$.execScript||$.execScript("var "+Mb[0]);for(var Nb;Mb.length&&(Nb=Mb.shift());)Mb.length||void 0===Lb?$[Nb]?$=$[Nb]:$=$[Nb]={}:$[Nb]=Lb;})() 5374 5375/************************************************************************* 5376 * ADOBE CONFIDENTIAL 5377 * ___________________ 5378 * 5379 * Copyright 2013 Adobe Systems Incorporated 5380 * All Rights Reserved. 5381 *
5382 * NOTICE: All information contained herein is, and remains 5383 * the property of Adobe Systems Incorporated and its suppliers, 5384 * if any. The intellectual and technical concepts contained 5385 * herein are proprietary to Adobe Systems Incorporated and its 5386 * suppliers and are protected by all applicable intellectual property 5387 * laws, including trade secret and copyright laws. 5388 * Dissemination of this information or reproduction of this material 5389 * is strictly forbidden unless prior written permission is obtained 5390 * from Adobe Systems Incorporated. 5391 **************************************************************************/ 5392 5393 5394 5395;(function() { 5396 xfalib = { 5397 ut : {}, 5398 script : { 5399 mixin : {}, 5400 dom : {} 5401 }, 5402 view : { 5403 util:{}, 5404 layout:{} 5405 }, 5406 runtime: { 5407 _private: {} 5408 }, 5409 locale : {}, 5410 acrobat: {}, //added for acrobat specific scripts 5411 template: {}, 5412 globals: { 5413 highlight : false // flag for "Highlight Existing Fields" 5414 } 5415 }; 5416 window.xfalib = xfalib; 5417})(); 5418 5419/******************************************************************************* 5420 * ADOBE CONFIDENTIAL 5421 * ___________________ 5422 * 5423 * Copyright 2013 Adobe Systems Incorporated 5424 * All Rights Reserved. 5425 *
5426 * NOTICE: All information contained herein is, and remains 5427 * the property of Adobe Systems Incorporated and its suppliers, 5428 * if any. The intellectual and technical concepts contained 5429 * herein are proprietary to Adobe Systems Incorporated and its 5430 * suppliers and are protected by all applicable intellectual property 5431 * laws, including trade secret and copyright laws. 5432 * Dissemination of this information or reproduction of this material 5433 * is strictly forbidden unless prior written permission is obtained 5434 * from Adobe Systems Incorporated. 5435 ******************************************************************************/ 5436 5437(function(xfalib){ 5438xfalib.locale.Strings = 5439{ 5440 "pleaseTapText" : "Please tap here to sign", 5441 "pleaseClickText" : "Please click here to sign", 5442 "clearSignature" : "Clear Signature Confirmation", 5443 "clearSignatureConfirm" : "Are you sure you want to clear signature?", 5444 "fetchGeoLocation" : "Fetching Geo Location info...", 5445 "errorFetchGeoLocation" : "Error fetching geolocation info", 5446 "pleaseSignText" : "Please sign here", 5447 "latitude" : "Latitude", 5448 "longitude" : "Longitude", 5449 "time" : "Time", 5450 "clearText" : "Clear", 5451 "validationIssue" : "Validation Error in the field", 5452 "warning" : "Warnings", 5453 "errors" : "Errors", 5454 "errorServerScript" : "Error in running server script", 5455 "unableToConnectText" : "Couldn't connect to the server", 5456 "errorSubmittingForm" : "Error submitting form to internal url", 5457 "ok" : "OK", 5458 "cancel" : "Cancel", 5459 "yes" : "Yes", 5460 "no" : "No", 5461 "clear" : "Clear", 5462 "brushes" : "Brushes", 5463 "geolocation" : "Geolocation", 5464 "FileCloseAccessText" : "Press Enter to delete the file ", 5465 "FileSizeGreater" : "File(s) {0} are greater than the expected size: {1}MB.", 5466 "FileNameInvalid" : "Do not attach files where filename starts with (.), contains \\ / : * ? \" < > | ; % $, or is a reserved keyword like nul, prn, con, lpt, or com.", 5467 "FileMimeTypeInvalid" : "File(s) {0} are unsupported file types", 5468 "UnableToSave" : "Unable to save", 5469 "SavedSuccessfully" : "Saved Successfully", 5470 "Attach" : "Attach", 5471 "datePickerAriaLabel" : "Please Enter date in {0} format only", 5472 "typeYourSignatureHere" : "Type Your Signature Here", 5473 "typeYourName" : "Type Your Name" 5474} 5475})(xfalib); 5476 5477/************************************************************************* 5478 * ADOBE CONFIDENTIAL 5479 * ___________________ 5480 * 5481 * Copyright 2013 Adobe Systems Incorporated 5482 * All Rights Reserved. 5483 *
5484 * NOTICE: All information contained herein is, and remains 5485 * the property of Adobe Systems Incorporated and its suppliers, 5486 * if any. The intellectual and technical concepts contained 5487 * herein are proprietary to Adobe Systems Incorporated and its 5488 * suppliers and are protected by all applicable intellectual property 5489 * laws, including trade secret and copyright laws. 5490 * Dissemination of this information or reproduction of this material 5491 * is strictly forbidden unless prior written permission is obtained 5492 * from Adobe Systems Incorporated. 5493 **************************************************************************/ 5494 5495 5496 5497 5498(function(xfalib){ 5499xfalib.locale.LogMessages = 5500{ 5501 "ALC-FRM-901-001" : "[ALC-FRM-901-001] : "+xfalib.locale.Strings.errorServerScript, 5502 "ALC-FRM-901-002" : "[ALC-FRM-901-002] : Exception occurred while executing {0} script for {1} : {2}.", 5503 "ALC-FRM-901-003" : "[ALC-FRM-901-003] : Error: xfa is not initialized.", 5504 "ALC-FRM-901-004" : "[ALC-FRM-901-004] : NullPointer Exception: {0} child {1} is null.", 5505 "ALC-FRM-901-005" : "[ALC-FRM-901-005] : exception {0} in parsing user script. script:{1}.", 5506 "ALC-FRM-901-006" : "[ALC-FRM-901-006] : Unsupported operation : {0}.", 5507 "ALC-FRM-901-007" : "[ALC-FRM-901-007] : Error in running server scripts. Type mismatch old: {0}, new: {1}.", 5508 "ALC-FRM-901-008" : "[ALC-FRM-901-008] : "+xfalib.locale.Strings.unableToConnectText, 5509 "ALC-FRM-901-009" : "[ALC-FRM-901-009] : Message Box with Yes/No are not supported and converted to Ok/Cancel message box but the return values are correct i.e for Yes/No", 5510 "ALC-FRM-901-010" : "[ALC-FRM-901-010] : Message Box with 3 buttons are not supported", 5511 "ALC-FRM-901-011" : "[ALC-FRM-901-011] : Geo Location not supported", 5512 "ALC-FRM-901-012" : "[ALC-FRM-901-012] : Mixed mode data binding is not supported", 5513 "ALC-FRM-901-013" : "[ALC-FRM-901-013] : Calculations failed after {0}", 5514 "ALC-FRM-901-014" : "[ALC-FRM-901-014] : Validation failed for the object: {0}. Validate Script is {1}", 5515 "ALC-FRM-901-015" : "[ALC-FRM-901-015] : exception {0} in creating user script object. user script:{1}, initialized from event: {2}, object : {3}", 5516 "ALC-FRM-901-016" : "[ALC-FRM-901-016] : "+xfalib.locale.Strings.errorSubmittingForm, 5517 "ALC-FRM-901-017" : "[ALC-FRM-901-017] : Exception occurred {0} while accessing property {1} of {2}" , 5518 "ALC-FRM-901-018" : "[ALC-FRM-901-018] : This form may not render correctly as you are using an unsupported browser.", 5519 "ALC-FRM-901-019" : "[ALC-FRM-901-019] : Exception occurred while resolving floating fields for : {0}.", 5520 "ALC-FRM-901-020" : "[ALC-FRM-901-020] : Exception while Initializing Logger. Invalid Configuration {0} in {1}", 5521 "ALC-FRM-901-021" : "[ALC-FRM-901-021] : Failed to parse dataPattern {0} for the value {1}: {2}", 5522 "ALC-FRM-901-022" : "[ALC-FRM-901-022] : Skipped parsing Multiple dataPatterns pattern {0} value {1}", 5523 "ALC-FRM-901-023" : "[ALC-FRM-901-023] : Numeric Patterns having the format (pattern) are not supported. " + 5524 "Skipping pattern {0} value {1}" 5525} 5526})(xfalib); 5527 5528/* 5529 * *********************************************************************** 5530 * ADOBE CONFIDENTIAL 5531 * __________________ 5532 * 5533 * Copyright 2015 Adobe Systems Incorporated 5534 * All Rights Reserved. 5535 *
5536 * NOTICE: All information contained herein is, and remains 5537 * the property of Adobe Systems Incorporated and its suppliers, 5538 * if any. The intellectual and technical concepts contained 5539 * herein are proprietary to Adobe Systems Incorporated and its 5540 * suppliers and may be covered by U.S. and Foreign Patents, 5541 * patents in process, and are protected by trade secret or copyright law. 5542 * Dissemination of this information or reproduction of this material 5543 * is strictly forbidden unless prior written permission is obtained 5544 * from Adobe Systems Incorporated. 5545 * *********************************************************************** 5546 */ 5547 5548window.xfalib = window.xfalib || { 5549 ut : {}, 5550 view : { 5551 util : { 5552 5553 } 5554 } 5555}; 5556window.xfalib.$ = window.$; 5557window.xfalib.jQuery = window.jQuery; 5558window.xfalib._ = window._; 5559 5560/************************************************************************* 5561 * 5562 * ADOBE CONFIDENTIAL 5563 * __________________ 5564 * 5565 * Copyright 2014 Adobe Systems Incorporated 5566 * All Rights Reserved. 5567 *
5568 * NOTICE: All information contained herein is, and remains 5569 * the property of Adobe Systems Incorporated and its suppliers, 5570 * if any. The intellectual and technical concepts contained 5571 * herein are proprietary to Adobe Systems Incorporated and its 5572 * suppliers and may be covered by U.S. and Foreign Patents, 5573 * patents in process, and are protected by trade secret or copyright law. 5574 * Dissemination of this information or reproduction of this material 5575 * is strictly forbidden unless prior written permission is obtained 5576 * from Adobe Systems Incorporated. 5577 **************************************************************************/ 5578 5579/** 5580 * @package guidelib.util.Namespace 5581 * @version 0.0.1 5582 */ 5583 5584(function (window) { 5585 this.guidelib = $.extend({},{ 5586 util : {}, 5587 event : {}, 5588 model : { 5589 util : {}, 5590 mixin : {} 5591 }, 5592 view : { 5593 util : {}, 5594 ad : { 5595 layout : {} 5596 } 5597 }, 5598 __runtime__ : { 5599 _private : {}, 5600 af : {}, 5601 guideContext : {} 5602 }, 5603 author : { 5604 instances : {}, 5605 editConfigListeners : {} 5606 }, 5607 __internal__ : { 5608 liveModel : {}, 5609 liveXmlUtils : {}, 5610 liveDataUtils : {}, 5611 GuideDirtyMarkerAndVisitor : {} 5612 } 5613 }, this.guidelib); 5614 5615 // access to runtime would fail server side re-validation 5616 Object.defineProperty(guidelib, "runtime", { 5617 get : function () { 5618 console.warn("Access to guidelib.runtime would fail server side re-validation. Please correct your scripts."); 5619 return guidelib.__runtime__; 5620 } 5621 }); 5622 5623 // access to internal would fail server side re-validation 5624 Object.defineProperty(guidelib, "internal", { 5625 get : function () { 5626 console.warn("Access to guidelib.internal would fail server side re-validation. Please correct your scripts."); 5627 return guidelib.__internal__; 5628 } 5629 }); 5630 5631 // We are using this NS in API in guideBridge.getSignedDocLink 5632 window.FD = window.FD || {}; 5633})(window); 5634 5635 5636// jscs:disable requireDotNotation 5637/************************************************************************* 5638 * 5639 * ADOBE CONFIDENTIAL 5640 * __________________ 5641 * 5642 * Copyright 2014 Adobe Systems Incorporated 5643 * All Rights Reserved. 5644 *
5645 * NOTICE: All information contained herein is, and remains 5646 * the property of Adobe Systems Incorporated and its suppliers, 5647 * if any. The intellectual and technical concepts contained 5648 * herein are proprietary to Adobe Systems Incorporated and its 5649 * suppliers and may be covered by U.S. and Foreign Patents, 5650 * patents in process, and are protected by trade secret or copyright law. 5651 * Dissemination of this information or reproduction of this material 5652 * is strictly forbidden unless prior written permission is obtained 5653 * from Adobe Systems Incorporated. 5654 **************************************************************************/ 5655 5656/** 5657 * @package guidelib.util.GuideUtil 5658 * @version 0.0.1 5659 * 5660 * Created with IntelliJ IDEA. 5661 * User: bsirivel 5662 * Date: 29/11/13 5663 * Time: 2:52 PM 5664 * To change this template use File | Settings | File Templates. 5665 */ 5666(function (window, $, guidelib, _) { 5667 var guideLoadingDiv = null, 5668 gd = function () { 5669 if (guideLoadingDiv == null) { 5670 guideLoadingDiv = $("#loadingPage"); 5671 } 5672 return guideLoadingDiv; 5673 }; 5674 var GuideUtil = guidelib.util.GuideUtil = { 5675 GUIDE_ITEM_CONTAINER_SUFFIX : "_guide-item-container", 5676 DATA_GUIDE_ITEM_CONTAINER : "data-guide-item-container", 5677 GUIDE_ITEM_NAV_CONTAINER_SUFFIX : "_guide-item-nav-container", 5678 GUIDE_ITEM_SUFFIX : "_guide-item", 5679 DATA_GUIDE_ITEM : "data-guide-item", 5680 GUIDE_ITEM_NAV_SUFFIX : "_guide-item-nav", 5681 GUIDE_NODE_ID_SUFFIX : "__", 5682 GUIDE_VIEW_BIND_ATTR : "data-guide-view-bind", 5683 GUIDE_LAYOUT_CLASS : ".guideLayout", 5684 GUIDE_WIZARD_LAYOUT : "guideWizardLayout", 5685 GUIDE_TABBED_PANEL_LAYOUT : "guideTabbedPanelLayout", 5686 GUIDE_VERTICAL_TABBED_PANEL_LAYOUT : "guideVerticalTabbedPanelLayout", 5687 DATA_LAYOUT_ITEM_INDEX : "data-layout-item-index", 5688 SCRIBBLE_RESIZE_TIME_INTERVAL : 1000, //--to set time-interval for setTimeout 5689 MANDATORY_TEST : "nullTest", // string to signify the reason for failed test being mandatory 5690 FORMAT_TEST : "formatTest", // string to signify the reason for failed test being validate picture clause test 5691 SCRIPT_TEST : "scriptTest", // string to signify the reason for failed test being validate script test 5692 MAXIMUM_VALUE_TEST : "maximumValueTest", // string to signify the reason for failed test being maximum value test 5693 MINIMUM_VALUE_TEST : "minimumValueTest", // string to signify the reason for failed test being minimum value test 5694 TOTAL_DIGITS_TEST : "totalDigitTest", // string to signify the reason for failed test being total digit test 5695 MINIMUM_LENGTH_TEST : "minimumLengthTest", // string to signify the reason for failed test being minimum length test 5696 LENGTH_TEST : "totalLengthTest", // string to signify the reason for failed test being total length test 5697 FM_DAM_ROOT : "/content/dam/formsanddocuments/", 5698 FM_AF_ROOT : "/content/forms/af/", 5699 GUIDE_CONTAINER_FORM_CLASS : "#guideContainerForm", 5700 GUIDE_CONTAINER_THEME_CLASS : "#guideContainerTheme", 5701 EVENT_PROPERTY_MAPPING : { 5702 "Calculate" : "calcExp", 5703 "Visibility" : "visibleExp", 5704 "Initialize" : "initScript", 5705 "Click" : "clickExp", 5706 "Value Commit" : "valueCommitScript", 5707 "Enabled" : "enabledExp", 5708 "Validate" : "validateExp", 5709 "Completion" : "completionExp", 5710 "Summary" : "summaryExp", 5711 "Options" : "optionsExp", 5712 "Navigation" : "navigationChangeExp" 5713 }, 5714 5715 /** 5716 * Types of chart available 5717 */ 5718 chartType : { 5719 LINE : "line", 5720 POINT : "point", 5721 LINE_POINT : "linepoint", 5722 AREA : "area", 5723 BAR : "bar", 5724 COLUMN : "column", 5725 PIE : "pie", 5726 DONUT : "donut" 5727 }, 5728 5729 xfaExprMap : { 5730 "clickExp" : "click", 5731 "enabledExp" : null, 5732 "visibleExp" : null 5733 }, 5734 5735 _globalUniqueId : (new Date()).getTime(), 5736 5737 generateUID : function () { 5738 return "GUID" + (++this._globalUniqueId); 5739 }, 5740 5741 replaceAll : function (stringToReplaceIn, textToReplace, replacementString) { 5742 return stringToReplaceIn.split(textToReplace).join(replacementString); 5743 }, 5744 5745 includes : function (stringToSearch, searchString, start) { 5746 start = typeof start === 'number' ? start : 0; 5747 return (start + searchString.length <= this.length) && (stringToSearch.indexOf(searchString, start) !== -1); 5748 }, 5749 5750 getId : function (myid) { 5751 return "#" + myid.replace(/(:|\.|\[|\])/g, "\\$1"); 5752 }, 5753 /** 5754 * Utility method to compare version 5755 * @param version1 5756 * @param version2 5757 */ 5758 compareVersion : function (version1, version2) { 5759 if (!_.isEmpty(version1) && !_.isEmpty(version2)) { 5760 var ver1Array = version1.split("."), 5761 ver2Array = version2.split("."),
5762 ver1MajorVersion, 5763 ver1MinorVersion, 5764 ver2MajorVersion, 5765 ver2MinorVersion; 5766 // check if array length is 2 to validate the version value 5767 if (ver1Array.length === 2 && ver2Array.length === 2) { 5768 ver1MajorVersion = parseInt(ver1Array[0], 10); 5769 ver1MinorVersion = parseInt(ver1Array[1], 10); 5770 ver2MajorVersion = parseInt(ver2Array[0], 10); 5771 ver2MinorVersion = parseInt(ver2Array[1], 10); 5772 // do the comparison 5773 return (ver1MajorVersion == ver2MajorVersion) 5774 ? ver1MinorVersion - ver2MinorVersion 5775 : ver1MajorVersion - ver2MajorVersion; 5776 } 5777 } 5778 }, 5779 5780 /** 5781 * Reformats the date of formats like 2018-02-06T16:21:41.240Z or 5782 * Sun May 06 00:00:00 IST 2001 into ISO format. This utility is useful 5783 * to convert date present in database or any other data source into a format which AF understands 5784 * @param value 5785 * @returns {*} 5786 * @private 5787 */ 5788 _reformatDate : function (value, validateWithDefaultPatterns) { 5789 var retVal = value, 5790 year = null, 5791 month = null, 5792 day = null, 5793 parsedDate = null, 5794 isInvalidDate = xfalib.ut.DateInfo.Parse(value, undefined, validateWithDefaultPatterns) == null; 5795 if (isInvalidDate && value) { 5796 // date send by FDM layer is always in ISO format 5797 parsedDate = Date.parse(value); 5798 if (!isNaN(parsedDate)) { 5799 // the code below is for the following date formats, "2018-02-06T16:21:41.240Z" 5800 var tmp = value.substr(0, 10); 5801 // tmp is expected to contain things like 2018-02-06 5802 // if it contains anything else, bail out 5803 // need this to avoid regression 5804 if (/^[0-9\-]+$/.test(tmp)) { 5805 retVal = tmp; 5806 } 5807 } else { 5808 // the code below is for the following date formats, "Sun May 06 00:00:00 IST 2001" 5809 // these date formats are generally present in data base etc 5810 year = value.slice(-4); 5811 // check if the value has a valid year before proceeding further 5812 if (/^[0-9]+$/.test(year)) { 5813 month = guidelib.i18n.calendarSymbols.abbrmonthNames.indexOf(value.substr(4, 3)) + 1; 5814 // month == 0, means indexOf returned -1, i.e not found. 5815 if (month > 0) { 5816 day = value.substr(8, 2); 5817 // since this format can only contain days in numeric, check for numeric 5818 if (/^[0-9]+$/.test(day)) { 5819 retVal = year + '-' + (month < 10 ? '0' : '') + month + '-' + day; 5820 } 5821 } 5822 } 5823 } 5824 } 5825 return retVal; 5826 }, 5827 5828 /** 5829 * Formats the given value in given pattern. 5830 * @param value 5831 * @param formatPattern pattern defined via picture cluase 5832 * @returns {*} 5833 */ 5834 formatValue : function (value, formatPattern, dataType) { 5835 var formattedValue; 5836 // in case of data-time, we additionally format the date before passing on to xfa utility 5837 if (dataType === 'date-time' || dataType === 'date') { 5838 value = guidelib.util.GuideUtil._reformatDate(value); 5839 } 5840 try { 5841 formattedValue = xfalib.ut.PictureFmt.format(value + "", formatPattern, null, true); 5842 } catch (exception) { 5843 window.guideBridge._guide.logger().error("Cannot format value " + value + " with " + formatPattern, exception); 5844 } 5845 return formattedValue ? formattedValue : value; 5846 }, 5847 guideSomToId : function (som) { 5848 //Note: If you change the som versus id logic than make sure you also take care of GuideBridge.setFocus and 5849 //AuthoringUtils.setAuthoringFocus which unfortunately based on this specially(AuthoringUtils.setAuthoringFocus). 5850 if (som) { 5851 return ("" + som).replace(/\./g, "-"); 5852 } 5853 return null; 5854 }, 5855 5856 /** 5857 * This API returns the name of the component from the given som expression. 5858 * Eg - If som = guide[0].guide1[0].guideRootPanel[0].numericbox[0], 5859 * then this API will return numericbox. 5860 * @param som 5861 * @returns {*} 5862 */ 5863 guideSomToComponentName : function (som) { 5864 if (som) { 5865 return som.substring(som.lastIndexOf(".") + 1, som.lastIndexOf("[")); 5866 } 5867 return null; 5868 }, 5869 5870 /** 5871 * Utility API to extract key value strings from options 5872 * @param keyValueString 5873 * @public 5874 */ 5875 getOptionsKeyValue: function (keyValueString) { 5876 var splitValues = []; 5877 var value = keyValueString.trim(); 5878 if (value.length > 0) { 5879 var endLoop = true; 5880 var pos = -1; 5881 var start = 0; 5882 do { 5883 pos = value.indexOf('=', start); 5884 // check for escaping 5885 if (pos > 0 && value.charAt(pos - 1) == '\\') { 5886 start = pos + 1; 5887 endLoop = false;
5888 } else { 5889 endLoop = true; 5890 } 5891 } while (!endLoop); 5892 var optionKey, optionValue; 5893 if (pos == -1) { 5894 optionKey = value; 5895 optionValue = value; 5896 } else { 5897 optionKey = value.substring(0, pos); 5898 optionValue = value.substring(pos + 1); 5899 } 5900 splitValues.push(optionKey.replace("\\=", "=")); 5901 splitValues.push(optionValue.replace("\\=", "=")); 5902 } else { 5903 splitValues.push(""); 5904 splitValues.push(""); 5905 } 5906 return splitValues; 5907 }, 5908 5909 /** 5910 * Returns whether the chart type supports legends or not. 5911 * Legend is not available for Line / Point / Line and Point / Area chart types. 5912 * @param chartType 5913 * @returns {boolean} 5914 */ 5915 isChartLegendApplicable : function (chartType) { 5916 return !(chartType === GuideUtil.chartType.LINE || chartType === GuideUtil.chartType.POINT 5917 || chartType === GuideUtil.chartType.LINE_POINT || chartType === GuideUtil.chartType.AREA); 5918 }, 5919 5920 /** 5921 * Returns whether the chart type supports tooltip or not. 5922 * Tooltip is not available for Line / Area chart types. 5923 * @param chartType 5924 * @returns {boolean} 5925 */ 5926 isChartTooltipApplicable : function (chartType) { 5927 return !(chartType === GuideUtil.chartType.LINE || chartType === GuideUtil.chartType.AREA); 5928 }, 5929 5930 /** 5931 * Returns whether the chart type supports Axis title or not. 5932 * Axis Title is not available for Pie / Area chart types. 5933 * @param chartType 5934 * @returns {boolean} 5935 */ 5936 isChartAxisTitleApplicable : function (chartType) { 5937 return !(chartType === GuideUtil.chartType.PIE || chartType === GuideUtil.chartType.DONUT); 5938 }, 5939 5940 modelElSelector : function (id) { 5941 var modelSelector = '[' + GuideUtil.GUIDE_VIEW_BIND_ATTR + ']'; 5942 if (id) { 5943 modelSelector = '[' + GuideUtil.GUIDE_VIEW_BIND_ATTR + '="' + id + '"]'; 5944 } 5945 return modelSelector; 5946 }, 5947 5948 /** 5949 * Checks if the given child model is part of sub tree of container model. 5950 * @param {?Object} container container model 5951 * @param {?Object} child child model 5952 * @returns {boolean} true, if child belongs to sub tree of container, false otherwise 5953 */ 5954 isChildPartOfContainer : function (container, child) { 5955 if (child != null && container != null) { 5956 return child.somExpression.lastIndexOf(container.somExpression, 0) === 0; 5957 } 5958 return false; 5959 }, 5960 5961 relativeSom : function (relativeTo, fullSom) { 5962 if (!relativeTo || !fullSom) { 5963 return fullSom; 5964 } else { 5965 if (fullSom.indexOf("guide[0].") == 0) { 5966 fullSom = fullSom.substring(9); 5967 } 5968 if (relativeTo.indexOf("guide[0].") == 0) { 5969 relativeTo = relativeTo.substring(9); 5970 } 5971 5972 if (fullSom.indexOf(relativeTo) == 0) { 5973 return fullSom.substring(relativeTo.length + 1); 5974 } else { 5975 return fullSom; 5976 } 5977 } 5978 }, 5979 5980 evalSom : function (som, obj) { 5981 if (som && obj) { 5982 return som.split('.').reduce( 5983 function (obj, i) { 5984 return obj[i]; 5985 }, 5986 obj 5987 ); 5988 } else { 5989 return null; 5990 } 5991 }, 5992 5993 itemContainerSelector : function (id) { 5994 return "#" + id + GuideUtil.GUIDE_ITEM_CONTAINER_SUFFIX; 5995 }, 5996 5997 alternateItemContainerSelector : function (id) { 5998 return "[" + GuideUtil.DATA_GUIDE_ITEM_CONTAINER + "=" + (id + GuideUtil.GUIDE_ITEM_CONTAINER_SUFFIX) + "]"; 5999 }, 6000 6001 itemNavContainerSelector : function (id) {
6002 var navContainerId = id + GuideUtil.GUIDE_ITEM_NAV_CONTAINER_SUFFIX; 6003 return ("#" + navContainerId + ", [data-guide-id=" + navContainerId + "]"); 6004 }, 6005 6006 checkIfTableRow : function (model) { 6007 return model && model instanceof guidelib.model.GuideTableRow; 6008 }, 6009 6010 itemSelector : function (id, model) { 6011 if (GuideUtil.checkIfTableRow(model)) { 6012 return "[" + GuideUtil.DATA_GUIDE_ITEM + "=" + id + GuideUtil.GUIDE_ITEM_SUFFIX + "]"; 6013 } else { 6014 return "#" + id + GuideUtil.GUIDE_ITEM_SUFFIX; 6015 } 6016 }, 6017 6018 itemNavSelector : function (id) { 6019 var navId = id + GuideUtil.GUIDE_ITEM_NAV_SUFFIX; 6020 return ("#" + navId + ", [data-guide-id=" + navId + "]"); 6021 }, 6022 6023 summarySelector : function (id) { 6024 return ".guideSummary[data-guide-id='" + id + "']"; 6025 }, 6026 6027 propSelector : function (prop, id) { 6028 return "[data-guide-prop=" + prop + "][data-guide-id='" + id + "']"; 6029 }, 6030 6031 getLocalizedMessage : function (category, message, snippets) { 6032 var resolvedMessage = message; 6033 if (snippets) { 6034 //resolve message with snippet 6035 resolvedMessage = resolvedMessage.replace(/{(\d+)}/g, function (match, number) { 6036 return typeof snippets[number] != 'undefined' 6037 ? snippets[number] 6038 : match; 6039 }); 6040 } 6041 var text = ""; 6042 if (category) { 6043 text += " [" + category + "]"; 6044 } 6045 text += " " + resolvedMessage + "\r\n"; 6046 return text; 6047 }, 6048 6049 elIdWithoutNodeIdSuffix : function (id) { 6050 var nodeIdSuffix = GuideUtil.GUIDE_NODE_ID_SUFFIX; 6051 if (id && (id.indexOf(GuideUtil.GUIDE_NODE_ID_SUFFIX) == (id.length - nodeIdSuffix.length))) { 6052 id = id.substring(0, (id.length - nodeIdSuffix.length)); // remove id suffix 6053 return id; 6054 } else { 6055 return ""; 6056 } 6057 }, 6058 6059 loadCSS : function (filename) { 6060 if (!filename) { 6061 return; 6062 } 6063 //Needs to be loaded in both authoring and runtime so not using ClientLibraryManager. Need better way to do that 6064 var file = window.document.createElement("link"); 6065 file.setAttribute("rel", "stylesheet"); 6066 file.setAttribute("type", "text/css"); 6067 file.setAttribute("href", filename); 6068 6069 if (typeof file !== "undefined") { 6070 window.document.getElementsByTagName("head")[0].appendChild(file); 6071 } 6072 }, 6073 /** 6074 * This API sets focus on first element of the Table Row. First element can consists of add,edit,delete control and a field. 6075 * This API auto computes the presence of these elements and set's focus on the field. 6076 * @param $row HTML element of the row to be created 6077 * @memberof GuideUtil 6078 * @since 6.3 6079 * @private 6080 */ 6081 setFocusOnFirstItemOfTableRow : function ($row) { 6082 var $editControl = $row.find(".guideTableRuntimeEditControl"), 6083 id = null, 6084 bIsEditControlMadeVisible = false, 6085 model = null; 6086 // Setting focus on field, since td is not focusable 6087 if ($editControl.length > 0) { 6088 $editControl.each(function () { 6089 if ($(this).is(":visible")) { 6090 // Only one edit control can be visible 6091 // we dont support two 6092 bIsEditControlMadeVisible = true; 6093 $editControl.eq(0).focus(); 6094 } 6095 }); 6096 } 6097 if (!bIsEditControlMadeVisible) { 6098 // Find the field and use guidebridge to set focus on the first field 6099 id = $row.find("td:first-child").find(".guideFieldNode").data("guideViewBind"); 6100 model = (id != null) ? guideBridge._resolveId(id) : null; 6101 if (model != null) { 6102 guideBridge.setFocus(model.somExpression); 6103 } 6104 } 6105 }, 6106 6107 // selector points to wrapper div since it has a unique id 6108 adjustElementHeight : function (selector, isPopUp) { 6109 if (!isPopUp) { 6110 var self = $("#" + selector).find(".guideFieldWidget"), 6111 maxHeight, 6112 clientHeight = self.css("height"), 6113 childrenTotalHeight = 0, 6114 parentHeight = 0, 6115 $child = null, 6116 clone = self.clone()[0],
6117 $clonedChild = null; 6118 6119 // Create a dummy element to get the height 6120 $(clone).css({ 6121 'visibility' : 'hidden', 6122 'max-height' : self.css("max-height"), 6123 'top' : '-2000px', 6124 'left' : '-2000px', 6125 'position' : 'absolute', 6126 'height' : (clientHeight !== "0px") ? clientHeight : "auto" 6127 }).appendTo('body'); 6128 parentHeight = $(clone).height(); 6129 // Walk through the children and adjust their height 6130 self.children().each(function (index) { 6131 $clonedChild = $(clone).children().eq(index); 6132 if ($clonedChild.height() >= parentHeight && ($child === null)) { 6133 $child = $(this); 6134 } else { 6135 childrenTotalHeight += $clonedChild.height(); 6136 } 6137 }); 6138 if ($child && (parentHeight - childrenTotalHeight) > 0) { 6139 $child.height((parentHeight - childrenTotalHeight) + "px"); 6140 } else if (parentHeight - childrenTotalHeight <= 0) { 6141 self.children().first().css("height", "auto"); 6142 } 6143 $(clone).remove(); 6144 } else { 6145 var modalBody = $("#" + selector).find(".guide-modal-body"), 6146 guideTnCContent = $("#" + selector).find(".guide-tnc-content"), 6147 paddingTop = modalBody.innerHeight() - modalBody.height(); 6148 // Adjust the max height of the modal body equal to window's height 6149 // in case of pop up enabled 6150 modalBody.css("max-height", $(window).height()); 6151 // Since modal-body can have a padding, calculate the total padding 6152 // Subtract the padding and set max-height for tnc content 6153 guideTnCContent.css("max-height", $(window).height() - paddingTop); 6154 6155 } 6156 }, 6157 6158 _resizeScribbleField : function () { 6159 var self = $('.guidescribble').find('.guideFieldWidget'), 6160 that = this; 6161 _.each(self, function (fieldWidget, index) { 6162 guidelib.util.GuideUtil._computeHeightAndWidthForScribble(fieldWidget); 6163 }); 6164 }, 6165 6166 _computeHeightAndWidthForScribble : function (fieldWidget) { 6167 var fieldWidthInPx, 6168 fieldHeightInPx, 6169 ratio; 6170 fieldWidget = $(fieldWidget); 6171 fieldWidthInPx = fieldWidget.innerWidth(); 6172 ratio = fieldWidget.data('guideAspectRatio'); 6173 fieldHeightInPx = fieldWidthInPx / ratio; 6174 fieldHeightInPx = (fieldHeightInPx < 34) ? 34 : fieldHeightInPx; 6175 fieldWidget.css('height', fieldHeightInPx + "px"); 6176 fieldWidget.find("img").css('height', fieldHeightInPx + "px"); 6177 }, 6178 6179 updateContainer : function (path, data) { 6180 $.ajax({ 6181 url : path, 6182 type : "POST", 6183 data : {"wcmmode" : "disabled", "data" : data, "targetMode" : "true"}, 6184 sync : true, 6185 success : function (result) { 6186 if (!window.guidelib.guideReplaced) { 6187 //NOCHECKMARX - result is coming from server side preventing Reflective XSS All Clients. 6188 var $result = $(result); 6189 $(GuideUtil.GUIDE_CONTAINER_FORM_CLASS).replaceWith($result.filter(GuideUtil.GUIDE_CONTAINER_FORM_CLASS)); 6190 $(GuideUtil.GUIDE_CONTAINER_THEME_CLASS).replaceWith($result.filter(GuideUtil.GUIDE_CONTAINER_THEME_CLASS)); 6191 } 6192 }, 6193 error : function (error) { 6194 if (window.console) { 6195 window.console.log(error); 6196 } 6197 } 6198 }); 6199 }, 6200 6201 fetchDataXml : function (initialGuideJsonData) { 6202 var data = "", initialGuideMergedJson; 6203 if (initialGuideJsonData) { 6204 initialGuideMergedJson = JSON.parse(initialGuideJsonData["guidemergedjson"] || "null"); 6205 } 6206 if (initialGuideMergedJson) { 6207 data = initialGuideMergedJson.guideState.completeDataXML; 6208 } 6209 return data; 6210 }, 6211 6212 detectContextPath : function () { 6213 var SCRIPT_URL_REGEXP = /^(?:http|https):\/\/[^\/]+(\/.*)\/(?:etc(\/.*)*\/clientlibs|libs(\/.*)*\/clientlibs|apps(\/.*)*\/clientlibs).*\.js(\?.*)?$/; 6214 var contextPath, scripts, result; 6215 try { 6216 if (window.CQURLInfo) { 6217 contextPath = window.CQURLInfo.contextPath || ""; 6218 } else { 6219 scripts = window.document.getElementsByTagName("script"); 6220 for (var i = 0; i < scripts.length; i++) { 6221 // in IE the first script is not the expected widgets js: loop 6222 // until it is found 6223 result = SCRIPT_URL_REGEXP.exec(scripts[i].src); 6224 if (result) { 6225 contextPath = result[1]; 6226 return contextPath; 6227 } 6228 } 6229 contextPath = ""; 6230 return contextPath; 6231 } 6232 } catch (e) { 6233 if (window.console) { 6234 window.console.log(error); 6235 } 6236 } 6237 }, 6238 6239 /** 6240 * Util for getting HTML Id 6241 * @param myid 6242 * @returns {*} 6243 * @private 6244 */ 6245 _getId : function (myid) { 6246 return guidelib.util.GuideUtil.getId(myid); 6247 }, 6248 6249 initializeHelp : function () { 6250 var shortVisible, getId; 6251 shortVisible = false;
6252 getId = GuideUtil._getId; 6253 6254 // Note: Using delegated event here to fix issue LC-3911686 6255 // This is done because we have to add this listener every time a new repeatable instance is created 6256 // Which means initialize help should be called everytime after add instance and the selector written below 6257 // should be made more generic. This has to be done later, else it may impact performance of AF. Ticket - CQ-4205246 6258 $(window.document).on("click.longDescription keypress.longDescription", "[data-guide-longDescription]", function (event) { 6259 if (event.type == "keypress" && !GuideUtil.isEnterKeyPressed(event) && !GuideUtil.isSpaceBarPressed(event)) { 6260 return; 6261 } 6262 event.preventDefault(); 6263 var index, longDescId, shortDescId, fieldId, longVisible, longDescDiv, shortDescDiv, fieldModel, fieldView; 6264 longDescId = $(this).data('guide-longdescription'); 6265 index = longDescId.indexOf('_guideFieldLongDescription'); 6266 if (index === -1) { 6267 index = longDescId.indexOf('_guidePanelLongDescription'); 6268 } 6269 fieldId = $(this).data('guide-longdescription').substring(0, index); 6270 shortDescId = fieldId + '_guideFieldShortDescription'; 6271 /* get the divs*/ 6272 longDescDiv = $(getId(longDescId)); 6273 shortDescDiv = $(getId(shortDescId)); 6274 longDescDiv.toggle(); 6275 longVisible = longDescDiv.is(':visible'); 6276 fieldModel = window.guideBridge._resolveId(fieldId); 6277 fieldView = window.guideBridge._guideView.getView(fieldModel.somExpression); 6278 /*hiding shortDesc since longDesc is visible */ 6279 if (longVisible) { 6280 shortDescDiv.hide(); 6281 } else { 6282 if (fieldView != null) { 6283 fieldView.setActive(null, true); 6284 } 6285 if ($(this).data('guide-alwaysshow')) { 6286 shortDescDiv.show(); 6287 } 6288 } 6289 6290 fieldView.visibleHelpElement = longVisible ? "longDescription" : shortDescDiv.is(":visible") ? "shortDescription" : "none"; 6291 6292 fieldModel._triggerOnBridge("elementHelpShown", fieldModel, fieldView.visibleHelpElement, "", { 6293 help : $(xfalib.ut.XfaUtil.prototype.encodeScriptableTags(fieldModel[fieldView.visibleHelpElement])).html() 6294 }); 6295 }); 6296 6297 GuideUtil._initializeShortDescription(); 6298 }, 6299 _initializeShortDescription : function ($html) { 6300 if (_.isUndefined($html)) { 6301 $html = window.document; 6302 } 6303 var getId = GuideUtil._getId, 6304 tooltipContent = function (element) { 6305 var longVisible, alwaysShow, guideFieldNode, elem; 6306 guideFieldNode = $(element).parents('.guideFieldNode').eq(0); 6307 longVisible = $(getId(guideFieldNode.attr('id') + '_guideFieldLongDescription')).is(':visible'); 6308 alwaysShow = $(guideFieldNode.find('[data-guide-longDescription]')).data('guide-alwaysshow'); 6309 elem = guideFieldNode.find('.short'); 6310 if (elem !== undefined && elem !== null && !longVisible && !alwaysShow) { 6311 return elem.html(); 6312 } 6313 return ''; 6314 }; 6315 6316 var $guideFieldWidget = $('.guideFieldWidget', $html); 6317 if (_.isFunction($.prototype.tooltip) && $guideFieldWidget.length > 0) { 6318 $guideFieldWidget.tooltip({ 6319 title : function () { 6320 var button = $(this).find('button'), 6321 checkbox = $(this).parents('.guideCheckBoxItem').eq(0), 6322 radiobutton = $(this).parents('.guideRadioButtonItem').eq(0); 6323 if (!(button !== undefined && button.length > 0) && !(checkbox !== undefined && checkbox.length > 0) && !(radiobutton !== undefined && radiobutton.length > 0)) { 6324 return tooltipContent(this); 6325 } 6326 return ''; 6327 }, 6328 placement : 'bottom', 6329 container : '.guideContainerWrapperNode', 6330 html : true, 6331 trigger : 'hover' 6332 }); 6333 } 6334 6335 var $guideButtonAndCheckBox = $('button, .guideRadioButtonItem, .guideCheckBoxItem', $html); 6336 if (_.isFunction($.prototype.tooltip) && $guideButtonAndCheckBox.length > 0) { 6337 $guideButtonAndCheckBox.tooltip({ 6338 title : function () { 6339 return tooltipContent(this); 6340 }, 6341 placement : 'bottom', 6342 container : '.guideContainerWrapperNode', 6343 html : true, 6344 trigger : 'hover' 6345 }); 6346 6347 } 6348 }, 6349 6350 /** 6351 * Bring the HTML from server and embed it 6352 * @todo: Id logic must change 6353 * Problems if we don't change logic of ID 6354 * a) Som resolve won't work 6355 * b) Also, may be there are two field's present inside different fragments having the same id 6356 * @private 6357 */ 6358 _embedHtml : function (model, referredHtml, uniquePrefix) { 6359 var bIsSuccess = false;
6360 if (referredHtml) { 6361 // need to add the children of of the given HTML div only so extracting out by regex and string manipulation 6362 // so that script tag do remain intact 6363 var parentIdSelector = "#" + model.id, 6364 // try non greedy matching of first div 6365 re = /<div .*?>/, 6366 // this would be <div data-guide-asset-path="bla" > 6367 openingDiv = referredHtml.match(re), 6368 parentUniquePrefix = model.id.substring(0, model.id.indexOf("__" + model.templateId)); 6369 // cut out the first div and inset rest 6370 referredHtml = referredHtml.substring(openingDiv[0].length, referredHtml.lastIndexOf("</div>")); 6371 $(parentIdSelector).html(referredHtml); 6372 if (window.guideBridge._guideView) { 6373 // Add the HTML to our template cache 6374 window.guideBridge._guideView._domTemplateCacheStore.putDomElement("#" + model.templateId, $(parentIdSelector).clone()); 6375 } 6376 // now if parent is repeatable , then change ids 6377 // if repeatable change all IDs 6378 if (model.repeatable || model._ancestorRepeatable) { 6379 $(parentIdSelector).find('[id^="guideContainer"]').each(function (i, el) { 6380 var $el = $(el), 6381 id = el.id; 6382 if (id.indexOf(model.templateId + "_") != 0) { 6383 // we do not want to change the id of items_container and nav container 6384 $el.attr('id', uniquePrefix + "__" + $el.attr('id')); 6385 } else if (parentUniquePrefix) { 6386 $el.attr('id', parentUniquePrefix + "__" + id); 6387 } 6388 }); 6389 } 6390 6391 // Now let's create view for this HTML 6392 // Call post initialize to create child view 6393 //this.postInitialize(); 6394 bIsSuccess = true; 6395 } 6396 return bIsSuccess; 6397 }, 6398 6399 isIphoneOrIpad : function () { 6400 var IS_IPAD = window.navigator.userAgent.match(/iPad/i) !== null, 6401 IS_IPHONE = (window.navigator.userAgent.match(/iPhone/i) !== null) 6402 || (window.navigator.userAgent.match(/iPod/i) !== null); 6403 return IS_IPAD || IS_IPHONE; 6404 }, 6405 6406 commonPrefixLen : function (str1, str2) { 6407 if (_.isString(str1) && _.isString(str2)) { 6408 var i, 6409 length = Math.min(str1.length, str2.length); 6410 6411 for (i = 0; i < length; ++i) { 6412 if (str1.charAt(i) !== str2.charAt(i)) { 6413 break; 6414 } 6415 } 6416 return i; 6417 } 6418 return 0; 6419 }, 6420 6421 /** 6422 * Returns true if the bindref is an xpath ending with and attribute 6423 */ 6424 isAttributeBound : function (bindRef) { 6425 return _.isString(bindRef) && bindRef.split('/@').length === 2; 6426 }, 6427 6428 /** 6429 * Returns the hops to rootPanel 6430 * @param node 6431 * @returns {number} 6432 * @private 6433 */ 6434 _countHopsToRootPanel : function (node) { 6435 var count = 0; 6436 while (node && node.parent) { 6437 count = count + 1; 6438 if (node.parent.className === "rootPanelNode") { 6439 return count; 6440 } 6441 node = node.parent; 6442 } 6443 }, 6444 6445 /** 6446 * Check if ancestor is reference 6447 * @param model 6448 * @returns {boolean} 6449 * @private 6450 */ 6451 _checkIfAncestorIsALazyReference : function (model) { 6452 // Walk through the parent hierarchy 6453 var par = model.parent; 6454 while (par && !(par instanceof guidelib.model.GuideContainerNode)) { 6455 if (par._lazyReference) { 6456 return true; 6457 } 6458 par = par.parent; 6459 } 6460 return false;
6461 }, 6462 6463 /** 6464 * Check if supplied template jason is in lazy state. 6465 * @param templateJson 6466 * @returns {boolean} 6467 * @private 6468 */ 6469 isLazyJson : function (templateJson) { 6470 if (_.isUndefined(templateJson) || _.isEmpty(templateJson.items)) { 6471 return true; 6472 } 6473 return false; 6474 }, 6475 6476 showGuideLoading : function (bShow) { 6477 if (bShow) { 6478 gd().addClass("guideLoading"); 6479 window.document.body.classList.add("af-freezeBody"); 6480 } else { 6481 gd().attr("class", ""); 6482 window.document.body.classList.remove("af-freezeBody"); 6483 } 6484 return this; 6485 }, 6486 6487 removeAllMessages : function () { 6488 gd().empty().removeClass("guideMessage"); 6489 return this; 6490 }, 6491 6492 showMessages : function (bMessages) { 6493 if (!_.isArray(bMessages)) { 6494 bMessages = [bMessages]; 6495 } 6496 var $messages = bMessages.map(function (bMessage) { 6497 return $("<h1></h1>").text(bMessage); 6498 }); 6499 gd().empty().addClass("guideMessage").append($messages); 6500 return this; 6501 }, 6502 6503 /** 6504 * returns the node value from the prefillXML 6505 * @param prefillXML 6506 * @returns {String} 6507 * @private 6508 */ 6509 fetchXMLNodeValue : function (prefillXML, targetNode) { 6510 if (!_.isUndefined(prefillXML)) { 6511 var XMLModel = $.parseXML(prefillXML); 6512 if (XMLModel && targetNode) { 6513 var elements = XMLModel.getElementsByTagName(targetNode); 6514 if (elements && elements.length > 0) { 6515 var element = elements[0]; 6516 } 6517 if (!_.isUndefined(element)) { 6518 return element.textContent; 6519 } 6520 } 6521 } 6522 }, 6523 6524 /** 6525 * returns the value of the object at a specified path in prefillJson. 6526 * @param prefillJson 6527 * @param targetPath 6528 * @private 6529 */ 6530 _fetchJSONNodeValue : function (prefillJson, targetPath) { 6531 if (!_.isUndefined(prefillJson)) { 6532 var JSONObject = JSON.parse(prefillJson); 6533 if (JSONObject && targetPath) { 6534 return xfalib.ut.XfaUtil.prototype.getOrElse(JSONObject, "afData." + targetPath, undefined); 6535 } 6536 } 6537 }, 6538 6539 isEnterKeyPressed : function (event) { 6540 return (event.key || event.keyIdentifier) == "Enter" || event.keyCode == 13; 6541 }, 6542 6543 isSpaceBarPressed : function (event) { 6544 return (event.key || event.keyIdentifier) == " " || event.keyCode == 32; 6545 }, 6546 6547 /** 6548 * This function updates the loaded file upload models with the uploaded file paths 6549 * and also updates the lazy attachment map(map for unloaded file upload components) 6550 * @param options 6551 * @private 6552 */ 6553 _updateFileModelsAndLazyMap : function (options) { 6554 var listIndex = 0, 6555 fileUrlList = options.fileUrlList, 6556 lazyAttachmentMap = options.lazyAttachmentMap; 6557 6558 // first iterate over the loaded fileAttachment models and update their model 6559 _.each(options.fileUploadModelsList, function (fileUploadModel) { 6560 var fileAttachmentModel = fileUploadModel["fileAttachment"], 6561 value = []; 6562 var fileList = fileUploadModel.fileList; 6563 _.each(fileList, function (fileListValue) { 6564 var isFileListObject = (_.isObject(fileListValue) && fileListValue.val().length > 0), 6565 isFileListString = (_.isString(fileListValue) && fileListValue.length > 0); 6566 if (isFileListString) { 6567 value.push(fileUrlList[listIndex++]); 6568 } else if (isFileListObject) { 6569 // processing of each file inside fileListObject is done 6570 _.each(fileListValue[0].files, function () { 6571 value.push(fileUrlList[listIndex++]); 6572 }); 6573 } 6574 }); 6575 fileAttachmentModel.value = value.join("\n"); 6576 }); 6577 6578 // now iterate over the unloaded fileAttachment models and update the lazyAttachmentMap. 6579 var i = listIndex; 6580 _.each(lazyAttachmentMap, function (mapObject) { 6581 var fileList = mapObject.fileList; 6582 var valueArray = []; 6583 for (var j = 0; j < fileList.length; j++) { 6584 if (!_.isString(fileList[j])) { 6585 // setting fileList to the uploaded path value(just like it would've been getting set in case the model was loaded) 6586 fileList[j] = fileUrlList[i]; 6587 valueArray.push(fileUrlList[i++]); 6588 } else { 6589 valueArray.push(fileUrlList[i++]); 6590 } 6591 } 6592 mapObject.value = valueArray.join("\n"); 6593 }); 6594 }, 6595 6596 /**
6597 * Returns whether the given bindRef is of schema JSON/XSD/FDM or not 6598 * @param bindRef {String} 6599 * @returns {boolean} 6600 * @private 6601 */ 6602 _isSchemaBindRef : function (bindRef) { 6603 var isSchemaBindRef = false; 6604 if (bindRef && bindRef.indexOf('/') > -1) { 6605 isSchemaBindRef = true; 6606 } 6607 return isSchemaBindRef; 6608 }, 6609 6610 /** 6611 * Returns whether the given bindRef is of XDP or not 6612 * @param bindRef {String} 6613 * @returns {boolean} 6614 * @private 6615 */ 6616 _isFormTemplateBindRef : function (bindRef) { 6617 var isFormTemplateBindRef = false; 6618 if (bindRef && bindRef.indexOf("[") > -1) { 6619 isFormTemplateBindRef = true; 6620 } 6621 return isFormTemplateBindRef; 6622 }, 6623 6624 /** 6625 * This function is useful to define the add operation different from javascript. 6626 * Ignore first or second operand if it's null, 6627 * else it'll be treated normally. 6628 * @param operand1 6629 * @param operand2 6630 * @returns {*} 6631 * @private 6632 */ 6633 _addValues : function (operand1, operand2) { 6634 if (_.isNull(operand1)) { 6635 return operand2; 6636 } else if (_.isNull(operand2)) { 6637 return operand1; 6638 } 6639 return operand1 + operand2; 6640 }, 6641 6642 /** 6643 * Returns the value of the field with the given bindRef, if no Adaptive Form field is found 6644 * then, it tries to fetch the value of given bindRef from prefill XML 6645 * @param bindRef - bindRef {string} associated with the field whose value needs to be fetched 6646 * @param contextSom - optional contextSom {String}, som of the field for which this value is needed 6647 * @returns {string} value of the field with the given bindRef 6648 */ 6649 getValueForBindRefField : function (bindRef, contextSom, guide) { 6650 var value, 6651 // candidateModels = guidelib.internal.liveModel.getAllFieldModels([bindRef]), 6652 winnerModel; 6653 6654 /* Commenting below as recomputation is not going to be supported 6655 // check for abstract field first, i.e, if there is a global field 6656 for (var i = 0; i < candidateModels.length; i++) { 6657 var fieldModel = candidateModels[i]; 6658 if (fieldModel) { 6659 if (fieldModel instanceof guidelib.model.AbstractField) { 6660 winnerModel = fieldModel; 6661 break; 6662 } else if (!winnerModel) { 6663 winnerModel = fieldModel; 6664 } 6665 } 6666 }*/ 6667 6668 //TODO: Use som to derive dataSOM, and get correct instance data value from prefill data 6669 6670 // if no loaded field is found check prefill data 6671 if (!winnerModel) { 6672 var dataSection = guide.internal.liveDataUtils.constants.UNBOUND_TAG; 6673 if (GuideUtil._isSchemaBindRef(bindRef)) { 6674 dataSection = guide.internal.liveDataUtils.constants.BOUND_TAG; 6675 } 6676 if (GuideUtil._isFormTemplateBindRef(bindRef)) { 6677 dataSection = guide.internal.liveDataUtils.constants.XFA_TAG; 6678 } 6679 value = guide.internal.liveDataUtils.getDataValue(bindRef, dataSection); 6680 } else { 6681 // accessing value from the model in the end injects the correct dependency 6682 value = winnerModel.value; 6683 } 6684 return value; 6685 }, 6686 6687 /** 6688 * This API checks if file is accessible, file could not be accessible for multiple reasons, 6689 * a) Removed from file system, since attaching a file and submitting the form could have a big time gap 6690 * b) User attached a file to which browser does not have access 6691 * @param fileName 6692 * @param file 6693 * @returns Promise, promise is resolved, if file is accessible, rejected with file name, if file is not accessible 6694 * @private 6695 */ 6696 _checkIfFileIsAccessible : function(fileName, file) { 6697 var msg = file.name, 6698 timeOutId = null, 6699 rejectAfter = function(ms, pmsg, pfileName) { 6700 return new Promise(function(resolve, reject) { 6701 timeOutId = setTimeout(function() { 6702 console.log("Read timeout for file " + pfileName); 6703 reject(pmsg); 6704 }, ms); 6705 }); 6706 },
6707 fileAccessCheck = function (pmsg, pfileName, pfile, timeOutId) { 6708 return new Promise(function(resolve, reject) { 6709 var chunk_size = 50, // just reading small chunk to validate if disk access is there 6710 offset = 0, 6711 retVal = { 6712 fileName: pfileName, 6713 file: pfile 6714 }, 6715 blob = pfile.slice(offset, offset + chunk_size); //slice the file by specifying the index(chunk size) 6716 var reader = new FileReader(); 6717 reader.onerror = function (e) { 6718 clearTimeout(timeOutId); 6719 console.log("Unable to read file " + pfileName, e); 6720 reject(pmsg); 6721 }; 6722 reader.onload = function (e) { 6723 clearTimeout(timeOutId); 6724 if (e.target.result === 0) { 6725 console.log("File has zero bytes " + pfileName); 6726 reject(pmsg); 6727 6728 } 6729 resolve(retVal); 6730 }; 6731 // readAsBinaryString works in firefox and not IE 6732 // readAsArrayBuffer works in IE but not firefox 6733 // hence readAsBinaryString is still being used 6734 reader.readAsBinaryString(blob); 6735 }); 6736 }; 6737 // wait for 10 seconds, in some browsers like chrome, onload or onerror is not called in some edge cases 6738 // if fileAccessCheck does not resolve or reject a promise in 10 seconds, we reject the promise 6739 return Promise.race([rejectAfter(10000, msg, fileName), fileAccessCheck(msg, fileName, file, timeOutId)]) 6740 }, 6741 6742 _createGetterSetter : function (container, name, ref) { 6743 var iName = "_" + name + "_"; 6744 if (!container.hasOwnProperty(name)) { 6745 Object.defineProperty(container, name, { 6746 get : function () { 6747 if (this._private[iName]) { 6748 return this._private[iName]._getNakedThis(); 6749 } 6750 return undefined; 6751 }, 6752 set : function (val) { 6753 var curRef = this._private[iName]; 6754 if (_.isObject(curRef)) { 6755 curRef[curRef._default] = val; 6756 } else { 6757 this.logger().warn("AF", "Trying to set unloaded field's model <" + name + ">"); 6758 } 6759 } 6760 }); 6761 } 6762 container._private[iName] = ref; 6763 }, 6764 6765 _setGuideDataHeader : function ($this, $tableElement) { 6766 // get the headers associated with cell 6767 // note: we always use the first header in mobile layout 6768 var headerText = $this.attr("headers"), 6769 headerId = !_.isEmpty(headerText) ? headerText.split(" ")[0] : undefined; 6770 if (headerId) { 6771 // get the header 6772 var $firstHeader = $tableElement.find("#" + headerId); 6773 $this.attr("guide-data-header", $.trim($firstHeader.text())); 6774 } 6775 }, 6776 6777 _isIOS : function() { 6778 // includes not supported in IE11, hence not using it 6779 var arrayContainsString = function(array, string) { 6780 // using underscore as ecma script 4 does not support filter in array yet 6781 if (string) { 6782 var newArr = _.filter(array, function (el) { 6783 return string.indexOf(el) >= 0; 6784 }); 6785 return newArr.length > 0; 6786 } else { 6787 return false; 6788 } 6789 }; 6790 return arrayContainsString([ 6791 'iPad Simulator', 6792 'iPhone Simulator', 6793 'iPod Simulator', 6794 'iPad', 6795 'iPhone', 6796 'iPod' 6797 ], navigator.platform) 6798 // iPad on iOS 13 detection 6799 || (navigator.userAgent.indexOf("Mac") >= 0 && "ontouchend" in document) 6800 }, 6801 6802 validateURL : function(url) { 6803 if(url.charAt(0) == '/') { 6804 url = window.location.origin + Granite.HTTP.externalize(url); 6805 } 6806 try { 6807 // IE 11 doesn't support javascript URL api 6808 var link = document.createElement('a'); 6809 link.setAttribute('href', url); 6810 return (link.protocol === 'http:' || link.protocol === 'https:'); 6811 } 6812 catch (err) { 6813 return false;
6814 } 6815 }, 6816 6817 6818 navigateToURL : function (destinationURL, destinationType) { 6819 var param, arg, 6820 windowParam = window; 6821 switch (destinationType){ 6822 case "SAME_TAB": 6823 param = "_self"; 6824 windowParam = window.parent; 6825 break; 6826 case "NEW_WINDOW": 6827 param = "newwindow"; 6828 arg = "width=1000,height=800"; 6829 break; 6830 } 6831 if (guidelib.util.GuideUtil.validateURL(destinationURL)){ 6832 windowParam.open(Granite.HTTP.externalize(destinationURL), param, arg); 6833 } 6834 } 6835 }; 6836})(window, $, guidelib, window._); 6837 6838/************************************************************************* 6839 * 6840 * ADOBE CONFIDENTIAL 6841 * __________________ 6842 * 6843 * Copyright 2014 Adobe Systems Incorporated 6844 * All Rights Reserved. 6845 * 6846 * NOTICE: All information contained herein is, and remains 6847 * the property of Adobe Systems Incorporated and its suppliers, 6848 * if any. The intellectual and technical concepts contained 6849 * herein are proprietary to Adobe Systems Incorporated and its 6850 * suppliers and may be covered by U.S. and Foreign Patents, 6851 * patents in process, and are protected by trade secret or copyright law. 6852 * Dissemination of this information or reproduction of this material 6853 * is strictly forbidden unless prior written permission is obtained 6854 * from Adobe Systems Incorporated. 6855 **************************************************************************/ 6856 6857(function (window, $, guidelib) { 6858 6859 /* Function to set aria attributes of accordion titles based on current state 6860 of accordion tab i.e. active or not. */ 6861 6862 function handleAccordionAccessibility() { 6863 $("a[data-guide-toggle='accordion-tab']").each(function (index, element) { // Select all accordion tab headers 6864 var panelId = $(element).attr("data-guide-id"), 6865 isPanelActive = $("#" + panelId + "_guide-item").hasClass("active"); 6866 $(element).attr("aria-pressed", isPanelActive) 6867 .attr("aria-expanded", isPanelActive); 6868 }); 6869 }; 6870 6871 // GUIDE TAB CLASS DEFINITION 6872 // ==================== 6873 6874 var GuideTab = function (element) { 6875 this.element = $(element); 6876 }, 6877 editWindow = window.parent, 6878 old = $.fn.guidetab; 6879 6880 GuideTab.prototype.show = function () { 6881 var $this = this.element, 6882 tabType = $this.data("guide-toggle"), 6883 $ul = $this.closest('ul:not(.dropdown-menu)'), 6884 id = $this.attr("data-guide-id"), 6885 tabEnable = (tabType === "tab" || tabType === "accordion-tab"), 6886 parentPanel = $this.parents("[id='" + id + "_guide-item']"),
6887 editPath = null, 6888 isPanelActive = parentPanel.hasClass("active"), 6889 $li, 6890 guideNode; 6891 6892 if (!id) { 6893 $li = $this.parent('li'); 6894 tabEnable = tabEnable || $li.hasClass("stepped"); 6895 id = $li.attr("id") || $li.attr("data-guide-id"); 6896 if (id) { 6897 id = id.substring(0, id.length - guidelib.util.GuideUtil.GUIDE_ITEM_NAV_SUFFIX.length); 6898 } 6899 } 6900 6901 if (id && tabEnable) { 6902 if (window.guideBridge) { 6903 guideNode = window.guideBridge._resolveId(id); 6904 if (guideNode) { 6905 window.guideBridge.setFocus(guideNode.somExpression); 6906 } 6907 } 6908 // for touch authoring, we have AuthorUtils in parent, this is a special handling done for touch authoring 6909 // todo: have to change this 6910 else if (window.parent._afAuthorHook && window.parent.guidelib.author.AuthorUtils) { 6911 //Checking CQ.WCM.getMode() is returning inconsistent results with cf#. So this fallback implementation. 6912 window.parent.guidelib.author.AuthorUtils.setAuthoringFocus(id, window.document); //Use alternate API in authoring for setFocus 6913 } else if (guidelib.author.AuthorUtils) { 6914 // In classic authoring do as usual 6915 guidelib.author.AuthorUtils.setAuthoringFocus(id, window.document); //Use alternate API in authoring for setFocus 6916 } 6917 if (tabType === "accordion-tab") { 6918 parentPanel.toggleClass("active", !isPanelActive); 6919 handleAccordionAccessibility(); 6920 } 6921 } else if (tabEnable) { 6922 //TODO: JIRA ISSUE 6923 if (console && console.log) { 6924 console.log("could not execute setFocus for:" + id); 6925 } 6926 } 6927 }; 6928 6929 // GUIDE TAB PLUGIN DEFINITION 6930 // ===================== 6931 6932 $.fn.guidetab = function (option) { 6933 return this.each(function () { 6934 var $this = $(this), 6935 instance = $this.data('guidetab'); 6936 6937 if (!instance) { 6938 $this.data('guidetab', (instance = new GuideTab(this))); 6939 } 6940 if (typeof option === 'string') { 6941 instance[option](); 6942 } 6943 }); 6944 }; 6945 6946 $.fn.guidetab.Constructor = GuideTab(); 6947 6948 // TAB NO CONFLICT 6949 // =============== 6950 6951 $.fn.guidetab.noConflict = function () { 6952 $.fn.guidetab = old; 6953 return this; 6954 }; 6955 6956 // TAB DATA-API 6957 // ============ 6958 6959 $(window.document).on('click.guidetab.data-api', '[data-guide-toggle$="tab"]', 6960 function (e) { 6961 e.preventDefault(); 6962 $(this).guidetab('show'); 6963 }).on('keydown.guidetab.data-api', '[data-guide-toggle$="tab"], [id$="' + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_SUFFIX + '"]', 6964 function (e) { 6965 if (guidelib.util.GuideUtil.isSpaceBarPressed(e)) { 6966 e.preventDefault(); 6967 e.stopPropagation(); 6968 if ($(e.target).find('[data-guide-toggle$="tab"]').length > 0) { 6969 $(this).find('[data-guide-toggle$="tab"]').guidetab("show"); 6970 } else { 6971 $(this).guidetab('show'); 6972 } 6973 } 6974 }); 6975 6976 /* Set the aria-attributes for accordion header when form 6977 is initialized. */ 6978 6979 window.addEventListener("bridgeInitializeStart", function (event) { 6980 var gb = event.detail.guideBridge; 6981 gb.on(gb.GUIDE_BRIDGE_INITIALIZE_COMPLETE, handleAccordionAccessibility); 6982 }); 6983 6984}(window, $, guidelib)); 6985 6986 6987/************************************************************************* 6988 * 6989 * ADOBE CONFIDENTIAL 6990 * __________________ 6991 * 6992 * Copyright 2014 Adobe Systems Incorporated 6993 * All Rights Reserved. 6994 *
6995 * NOTICE: All information contained herein is, and remains 6996 * the property of Adobe Systems Incorporated and its suppliers, 6997 * if any. The intellectual and technical concepts contained 6998 * herein are proprietary to Adobe Systems Incorporated and its 6999 * suppliers and may be covered by U.S. and Foreign Patents, 7000 * patents in process, and are protected by trade secret or copyright law. 7001 * Dissemination of this information or reproduction of this material 7002 * is strictly forbidden unless prior written permission is obtained 7003 * from Adobe Systems Incorporated. 7004 **************************************************************************/ 7005 7006(function (window, $, guidelib) { 7007 guidelib.util.GuideUtil.showHideNavScroll = function () { 7008 var scrollControls = $('[data-guide-nav-scroll]'); 7009 if (scrollControls !== undefined && scrollControls !== null) { 7010 _.each(scrollControls, function (scrollControl) { 7011 var $scrollControl = $(scrollControl), 7012 isModuleScroller, 7013 listArray; 7014 isModuleScroller = $scrollControl.hasClass('adTabScroller'); 7015 if (isModuleScroller) { 7016 listArray = $scrollControl.parent().find('.adTabbedItemTitleContainer'); 7017 } else { 7018 // using query selector all here, since sizzle of jquery is manipulating dom 7019 // which is causing infinite loop due to dom mutation observer set in parent frame in touch ui 7020 listArray = $scrollControl.parent()[0].querySelectorAll('[id*="' + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_CONTAINER_SUFFIX + '"]'); 7021 } 7022 if (listArray !== undefined && listArray !== null && listArray[0] !== undefined && listArray[0] !== null) { 7023 //Don't expect element.offsetWidth to get the same value in all browsers, same issue was faced for TnC in IE. 7024 if (listArray[0].scrollWidth <= listArray[0].offsetWidth) { 7025 $scrollControl.addClass('hide-tab-scroll'); 7026 } else { 7027 $scrollControl.removeClass('hide-tab-scroll'); 7028 } 7029 } 7030 }); 7031 } 7032 }; 7033 7034 guidelib.util.GuideUtil.navScroll = function (itemNavContainerDiv, scrollDirection, scrollStep, navSelector) { 7035 var $itemNavContainerDiv = $(itemNavContainerDiv), 7036 itemNavs, 7037 scrollWidth = 0, 7038 maxScroll, 7039 currWidth, 7040 currPos; 7041 if (!(scrollStep)) { 7042 scrollStep = 1; 7043 } 7044 if ($itemNavContainerDiv !== undefined && $itemNavContainerDiv !== null) { 7045 itemNavs = $itemNavContainerDiv.find(navSelector); 7046 if (itemNavs.length > 0) { 7047 maxScroll = Math.ceil(itemNavContainerDiv.scrollWidth - itemNavContainerDiv.offsetWidth); 7048 if ($itemNavContainerDiv.attr("data-guide-nav-scroll-pos") === undefined) { 7049 $itemNavContainerDiv.attr("data-guide-nav-scroll-pos", 0); 7050 } 7051 var navPos = parseInt($itemNavContainerDiv.attr("data-guide-nav-scroll-pos"), 10); 7052 if ('left' === scrollDirection) { 7053 if (navPos - scrollStep >= 0) { 7054 navPos = navPos - scrollStep; 7055 } 7056 } else if ('right' === scrollDirection) { 7057 if (navPos + scrollStep < itemNavs.length) { 7058 navPos = navPos + scrollStep; 7059 } 7060 } 7061 _.each(itemNavs, function (item, pos) { 7062 if (pos < navPos) { 7063 scrollWidth += $(item).outerWidth(true); 7064 } 7065 }); 7066 if (scrollWidth > maxScroll) { 7067 currWidth = 0; 7068 _.each(itemNavs, function (item, pos) { 7069 if (pos <= navPos && currWidth <= maxScroll) { 7070 currPos = pos; 7071 currWidth += $(item).outerWidth(true); 7072 } 7073 }); 7074 navPos = currPos; 7075 scrollWidth = currWidth; 7076 } 7077 $itemNavContainerDiv.attr("data-guide-nav-scroll-pos", navPos); 7078 $itemNavContainerDiv.scrollLeft(scrollWidth); 7079 } 7080 } 7081 }; 7082})(window, $, guidelib); 7083 7084/*handle scrolling of navigator*/ 7085$(function ($) { 7086 $('body').on('click', '[data-guide-nav-scroll]', function () { 7087 var scrollDirection = $(this).data("guideNavScroll"), 7088 isModuleScroller = $(this).hasClass('adTabScroller'), 7089 listArray; 7090 if (isModuleScroller) { 7091 listArray = $(this).parent().find('.adTabbedItemTitleContainer'); 7092 } else { 7093 listArray = $(this).parent().find('[id*="' + guidelib.util.GuideUtil.GUIDE_ITEM_
7093NAV_CONTAINER_SUFFIX + '"]'); 7094 } 7095 if (!_.isUndefined(listArray) && !_.isNull(listArray) && listArray.length > 0) { 7096 if (isModuleScroller) { 7097 guidelib.util.GuideUtil.navScroll(listArray[0], scrollDirection, 0, '.adTabbedItemTitle'); 7098 } else { 7099 guidelib.util.GuideUtil.navScroll(listArray[0], scrollDirection, 0, '[id*="' + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_SUFFIX + '"]:not(.hidden)'); 7100 } 7101 } 7102 }); 7103 7104 //this should be changed back to $(document).ready(showHideNavScroll) instead of windows onload, 7105 //once jquery version is bumped 7106 $(window).on('load resize', guidelib.util.GuideUtil.showHideNavScroll); 7107 7108}); 7109 7110/** 7111 * @package guidelib.util.Namespace 7112 * @version 0.0.1 7113 */ 7114(function (guidelib) { 7115 guidelib.log = { 7116 /* put the Strings that need logging here. The key for the string should be 7117 * AEM-AF-901-XXX, where XXX is a three digit number with trailing zeroes. 7118 * Start with AEM-AF-901-020 7119 */ 7120 LogStrings : { 7121 7122 } 7123 }; 7124}(guidelib)); 7125 7126 7127/************************************************************************* 7128 * 7129 * ADOBE CONFIDENTIAL 7130 * __________________ 7131 * 7132 * Copyright 2014 Adobe Systems Incorporated 7133 * All Rights Reserved. 7134 *
7135 * NOTICE: All information contained herein is, and remains 7136 * the property of Adobe Systems Incorporated and its suppliers, 7137 * if any. The intellectual and technical concepts contained 7138 * herein are proprietary to Adobe Systems Incorporated and its 7139 * suppliers and may be covered by U.S. and Foreign Patents, 7140 * patents in process, and are protected by trade secret or copyright law. 7141 * Dissemination of this information or reproduction of this material 7142 * is strictly forbidden unless prior written permission is obtained 7143 * from Adobe Systems Incorporated. 7144 **************************************************************************/ 7145 7146 7147(function ($, _, guidelib) { 7148 var LayoutBase = guidelib.view.ad.layout.LayoutBase = function (options) { 7149 this.options = _.extend({}, this.options, options); 7150 this.initialize.apply(this, arguments); 7151 }; 7152 7153 _.extend(LayoutBase.prototype, { 7154 initialize : function () { 7155 } 7156 }); 7157 7158 _.extend(LayoutBase, { 7159 extend : function (props) { 7160 var child = inherits(this, props); 7161 child.extend = this.extend; 7162 return child; 7163 } 7164 }); 7165 7166 7167 var ctor = function () {}; 7168 7169 7170 7171 7172 function inherits(parent, protoProps, staticProps) { 7173 var child; 7174 var _super = parent.prototype; 7175 7176 7177 7178 if (protoProps && protoProps.hasOwnProperty('constructor')) { 7179 child = protoProps.constructor; 7180 } else { 7181 child = function () { parent.apply(this, arguments); }; 7182 } 7183 7184 7185 _.extend(child, parent); 7186 7187 7188 7189 ctor.prototype = parent.prototype; 7190 child.prototype = new ctor(); 7191 child._super = parent.prototype; 7192 child._superClass = parent; 7193 7194 7195 7196 if (protoProps) { 7197 7198 for (var name in protoProps) { 7199 if (name == "_defaults") { 7200 protoProps[name] = _.extend({}, _super[name], protoProps[name]); 7201 } 7202 child.prototype[name] = protoProps[name]; 7203 } 7204 } 7205 7206 7207 if (staticProps) { 7208 _.extend(child, staticProps); 7209 } 7210 7211 7212 child.prototype.constructor = child; 7213 7214 7215 child.__super__ = parent.prototype; 7216 7217 return child; 7218 }; 7219 7220}($, _, window.guidelib)); 7221(function ($, _, guidelib) { 7222 var LayoutPlugin = guidelib.view.ad.layout.LayoutPlugin = guidelib.view.ad.layout.LayoutBase.extend({ 7223 7224 layoutName : "", 7225 7226 initialize : function () { 7227 this.options = this.options || {}; 7228 7229 7230 this.$element = this.options.$element; 7231 7232 7233 this.itemAndTitleArray = this.options.itemAndTitleArray; 7234 7235 7236 this.$container = this.getContainer(this.options.$container); 7237 this.$container.addClass(this.layoutName); 7238 7239 7240 this.containerId = this.options.containerId; 7241 7242 this.itemClass = this.layoutName + 'Item'; 7243 this.titleClass = this.layoutName + 'Title'; 7244 this.itemTitleClass = this.layoutName + 'ItemTitle'; 7245 7246 this.$parentNavMenu = this.constructNavMenuContainer(); 7247 7248 this.addItemTitle(); 7249 }, 7250 7251 7252 done : function () { 7253 7254 }, 7255 7256 7257 getContainer : function ($optionsContainer) { 7258 return $optionsContainer; 7259 }, 7260 7261 7262 constructNavMenuContainer : function () { 7263 var $parentContainer = this.$container.closest('[' + guidelib.util.GuideUtil.DATA_LAYOUT_ITEM_INDEX + ']'), 7264 parentContainerId, 7265 $parentListItem, 7266 itemNavId, 7267 itemNavContainerId, 7268 $parentNavMenu, 7269 $parentModule, 7270 parentModuleId, 7271 parentModuleNavContainerId, 7272 $parentModuleNavMenu; 7273 7274 if ($parentContainer && $parentContainer.length > 0) { 7275 7276 $parentModule = this.$container.parents('.guideAdModule').eq(0); 7277 if ($parentModule && $parentModule.length === 0) { 7278 $parentModule = this.$container.parents('.guideAdModuleGroup').eq(0); 7279 }
7280 parentModuleId = $parentModule.data('guide-view-bind'); 7281 parentModuleNavContainerId = parentModuleId + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_CONTAINER_SUFFIX; 7282 $parentModuleNavMenu = $('[data-guide-id="' + parentModuleNavContainerId + '"]'); 7283 parentContainerId = $parentContainer.attr(guidelib.util.GuideUtil.DATA_LAYOUT_ITEM_INDEX); 7284 itemNavContainerId = parentContainerId + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_CONTAINER_SUFFIX; 7285 itemNavId = parentContainerId + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_SUFFIX; 7286 $parentNavMenu = $parentModuleNavMenu.find('[data-guide-id="' + itemNavContainerId + '"]'); 7287 if (!($parentNavMenu && $parentNavMenu.length > 0)) { 7288 $parentListItem = $parentModuleNavMenu.find('[data-guide-id="' + itemNavId + '"]'); 7289 $parentNavMenu = $('<ul></ul>').attr('data-guide-id', itemNavContainerId); 7290 $parentNavMenu.addClass('tab-navigators tab-navigators-mobile'); 7291 $parentListItem.append($parentNavMenu); 7292 } 7293 } else { 7294 $parentContainer = this.$container.closest('.guideAdModule'); 7295 if ($parentContainer && $parentContainer.length === 0) { 7296 $parentContainer = this.$container.closest('.guideAdModuleGroup'); 7297 } 7298 parentContainerId = $parentContainer.data('guide-view-bind'); 7299 itemNavContainerId = parentContainerId + guidelib.util.GuideUtil.GUIDE_ITEM_NAV_CONTAINER_SUFFIX; 7300 $parentNavMenu = $('[data-guide-id="' + itemNavContainerId + '"]'); 7301 $parentNavMenu.removeClass('hidden'); 7302 } 7303 7304 7305 if (!($parentNavMenu && $parentNavMenu.length > 0)) { 7306 $parentNavMenu = undefined; 7307 } 7308 7309 return $parentNavMenu; 7310 }, 7311 7312 7313 constructItemTitle : function (itemAndTitle, index) { 7314 var $itemTitle = $('<' + this.layoutItemTitleType + '/>'), 7315 $title = itemAndTitle.title, 7316 $item = itemAndTitle.item, 7317 adIndex = 'ad-' + index, 7318 itemContentId = 'itemContent' + adIndex, 7319 itemTitleId = 'itemTitle' + adIndex; 7320 $item.addClass(this.itemClass); 7321 $itemTitle.attr('data-' + this.layoutName + '-id', adIndex); 7322 $itemTitle.addClass(this.itemTitleClass); 7323 $itemTitle.attr('tabindex', 0); 7324 if ($title && $title.length > 0) { 7325 $itemTitle.append($title.text()); 7326 $title.addClass(this.titleClass); 7327 } else { 7328 var itemHtml = $item.html().replace(/<br>|<p>|<\/p>|<div>|<\/div>/gi, ' ').replace(/ +/g, ' '), 7329 itemText = $('<div></div>').append(itemHtml).text(), 7330 itemWordArray = itemText.split(' '), 7331 itemTitleText = ""; 7332 if (itemWordArray) { 7333 if (itemWordArray.length > 4) { 7334 itemTitleText = itemWordArray[0] + ' ' + itemWordArray[1] + ' ' + itemWordArray[2] + ' ' + itemWordArray[3]; 7335 } else { 7336 itemTitleText = itemText; 7337 } 7338 $itemTitle.append(itemTitleText); 7339 } 7340 } 7341 $itemTitle.attr('title', $itemTitle.text()); 7342 7343 $item.attr('data-' + this.layoutName + '-content-id', adIndex); 7344 $item.attr(guidelib.util.GuideUtil.DATA_LAYOUT_ITEM_INDEX, this.containerId + adIndex); 7345 7346 7347 $item.attr('id', itemContentId); 7348 $itemTitle.attr('id', itemTitleId); 7349 $itemTitle.attr('role', 'tab').attr('aria-controls', itemContentId); 7350 $item.attr('role', 'tabpanel').attr('aria-labeledby', itemTitleId); 7351 7352 itemAndTitle.item = $item; 7353 7354 this.updateNavMenuForItem($item, $itemTitle, adIndex); 7355 return $itemTitle; 7356 }, 7357 7358 7359 updateNavMenuForItem : function ($item, $itemTitle, adIndex) { 7360 if (this.$parentNavMenu) { 7361 var menuListItem = $('<li></li>'), 7362 menuListItemAnchor = $('<a></a>'), 7363 titleText = $itemTitle.text(), 7364 navId = this.containerId + adIndex, 7365 parentListItem, 7366 prefixPath = ''; 7367 menuListItem.attr('data-guide-id', navId + guidelib.util.GuideUtil.GUIDE_ITEM_
7367NAV_SUFFIX); 7368 menuListItem.attr('title', titleText); 7369 parentListItem = this.$parentNavMenu.parents('li'); 7370 if (parentListItem && parentListItem.length > 0) { 7371 var closeseListItemPath = $(parentListItem[0]).data('path'); 7372 if (closeseListItemPath) { 7373 prefixPath = closeseListItemPath; 7374 } 7375 } 7376 menuListItem.attr('data-path', prefixPath + '/' + navId); 7377 menuListItemAnchor.attr('data-toggle', 'collapse'); 7378 menuListItemAnchor.attr('data-target', '#guide-mobile-navigator'); 7379 menuListItemAnchor.append(titleText); 7380 menuListItemAnchor.on('click', function () { 7381 7382 menuListItem.siblings().removeClass('active'); 7383 7384 menuListItem.addClass('active'); 7385 $itemTitle.click(); 7386 $('body').animate({ 7387 scrollTop : $item.offset().top 7388 }, 500); 7389 $item.focus(); 7390 }); 7391 menuListItem.append(menuListItemAnchor); 7392 this.$parentNavMenu.append(menuListItem); 7393 } 7394 }, 7395 7396 7397 constructItemTitleForOneActive : function (itemAndTitle, itemIndex) { 7398 var $itemTitle = this.constructItemTitle(itemAndTitle, itemIndex); 7399 if (itemIndex === 0) { 7400 this.makeItemTitleActive(itemAndTitle.item, $itemTitle); 7401 } else { 7402 this.unmarkItemTitleForOneActive(itemAndTitle.item, $itemTitle); 7403 } 7404 if (this.handleItemTitleClick) { 7405 $itemTitle.on('click', {layoutPlugin : this}, this.handleItemTitleClick); 7406 $itemTitle.keydown(this.handleItemTitleKeyDown); 7407 } 7408 return $itemTitle; 7409 }, 7410 7411 7412 handleItemTitleKeyDown : function (event) { 7413 switch (event.keyCode) { 7414 case 32: 7415 $(this).trigger("click"); 7416 break; 7417 } 7418 }, 7419 7420 7421 constructItemTitleContainer : function () { 7422 var $itemTitleContainer = $('<' + this.layoutItemTitleContainerType + '/>'); 7423 $itemTitleContainer.addClass(this.layoutName + 'ItemTitleContainer').attr('data-' + this.layoutName + '-id', this.containerId); 7424 return $itemTitleContainer; 7425 }, 7426 7427 7428 makeItemTitleActive : function ($item, $itemTitle) { 7429 $item.addClass('active').removeClass('hidden'); 7430 $item.attr('aria-hidden', 'false'); 7431 $itemTitle.addClass('active'); 7432 }, 7433 7434 7435 unmarkItemTitleActive : function ($item, $itemTitle) { 7436 $item.removeClass('active'); 7437 $itemTitle.removeClass('active'); 7438 }, 7439 7440 unmarkItemTitleForOneActive : function ($item, $itemTitle) { 7441 $item.addClass('hidden'); 7442 $item.attr('aria-hidden', 'true'); 7443 this.unmarkItemTitleActive($item, $itemTitle); 7444 } 7445 }); 7446}($, _, window.guidelib)); 7447(function ($, _, guidelib) { 7448 var TabLayoutPlugin = guidelib.view.ad.layout.TabLayoutPlugin = guidelib.view.ad.layout.LayoutPlugin.extend({ 7449 layoutName : "adTabbed", 7450 layoutItemTitleType : "li", 7451 layoutItemTitleContainerType : "ul", 7452 7453 addItemTitle : function () { 7454 var $itemTitleContainer = this.constructItemTitleContainer(), 7455 $itemTitleScrollerDiv = $('<div></div>'), 7456 $leftScroll = $('<div></div>').addClass('adTabScroller adTabLeft').attr('data-guide-nav-scroll', 'left'), 7457 $rightScroll = $('<div></div>').addClass('adTabScroller adTabRight').attr('data-guide-nav-scroll', 'right'); 7458 7459 this.$container.attr('data-' + this.layoutName + '-content-id', 'ad-' + this.containerId); 7460 7461 _.each(this.itemAndTitleArray, function (itemAndTitle, itemIndex) { 7462 var $itemTitle = this.constructItemTitleForOneActive(itemAndTitle, itemIndex); 7463 $itemTitleContainer.append($itemTitle); 7464 }, this); 7465 $itemTitleScrollerDiv.append($leftScroll).append($itemTitleContainer).append($rightScroll); 7466 this.$container.before($itemTitleScrollerDiv); 7467 }, 7468 7469 7470 getContainer : function ($optionsContainer) { 7471 if (!$optionsContainer.is('ul') && !$optionsContainer.is('ol') && this.itemAndTitleArray && this.itemAndTitleArray.length > 0) { 7472 var firstItem = this.itemAndTitleArray[0].item[0], 7473 $itemParent = $(firstItem).parent(), 7474 allChildren = $itemParent.children(), 7475 filteredList = [], 7476 addToFilterList = false;
7477 _.each(allChildren, function (containerChild) { 7478 if (firstItem == containerChild) { 7479 addToFilterList = true; 7480 } 7481 if (addToFilterList) { 7482 filteredList.push(containerChild); 7483 } 7484 }); 7485 return $(filteredList).wrapAll('<div></div>').parent(); 7486 } 7487 return $optionsContainer; 7488 }, 7489 7490 handleItemTitleClick : function (event) { 7491 var $itemTitle = $(this); 7492 if (!$itemTitle.hasClass('active')) { 7493 var layoutPlugin = event.data.layoutPlugin, 7494 dataAttrtName = 'data-' + layoutPlugin.layoutName.toLowerCase() + '-content-id', 7495 dataAttrValueItem = $itemTitle.data(layoutPlugin.layoutName.toLowerCase() + '-id'), 7496 $itemTitleContainer = $itemTitle.parent(layoutPlugin.layoutItemTitleContainerType), 7497 dataAttrValueItemContainer = $itemTitleContainer.data(layoutPlugin.layoutName.toLowerCase() + '-id'), 7498 $itemContainer = $itemTitleContainer.parent().siblings('[' + dataAttrtName + '="ad-' + dataAttrValueItemContainer + '"]'), 7499 $item = $itemContainer.children('[' + dataAttrtName + '="' + dataAttrValueItem + '"]'), 7500 list, 7501 scrollPos, 7502 navPos, 7503 scrollDirection, 7504 scrollStep; 7505 layoutPlugin.unmarkItemTitleForOneActive($itemContainer.children('.active'), $itemTitleContainer.children('.active')); 7506 layoutPlugin.makeItemTitleActive($item, $itemTitle); 7507 list = $itemTitleContainer.eq(0); 7508 if (_.isUndefined(list.data("guideNavScrollPos"))) { 7509 list.data("guideNavScrollPos", 0); 7510 } 7511 scrollPos = list.data("guideNavScrollPos"); 7512 7513 navPos = parseInt($itemTitle.data('adtabbedId').substr(3)); 7514 if (navPos > scrollPos) { 7515 scrollDirection = "right"; 7516 } else { 7517 scrollDirection = "left"; 7518 } 7519 scrollStep = Math.abs(navPos - scrollPos); 7520 guidelib.util.GuideUtil.navScroll(list, scrollDirection, scrollStep, '.adTabbedItemTitle'); 7521 guidelib.util.GuideUtil.showHideNavScroll(); 7522 } 7523 }, 7524 7525 done : function () { 7526 var parentCard = this.$container.parents('.' + this.layoutName); 7527 7528 if (!(parentCard && parentCard.length > 0)) { 7529 guidelib.util.GuideUtil.showHideNavScroll(); 7530 } 7531 } 7532 }); 7533}($, _, window.guidelib)); 7534 7535(function ($, _, guidelib) { 7536 var AccordionLayoutPlugin = guidelib.view.ad.layout.AccordionLayoutPlugin = guidelib.view.ad.layout.LayoutPlugin.extend({ 7537 layoutName : "adAccordion", 7538 layoutItemTitleType : "div", 7539 7540 addItemTitle : function () { 7541 _.each(this.itemAndTitleArray, function (itemAndTitle, itemIndex) { 7542 var $item = itemAndTitle.item, 7543 $itemTitle; 7544 7545 if ($item.is('li')) { 7546 $item.wrapInner('<div></div>'); 7547 $item = $item.children('div'); 7548 itemAndTitle.item = $item; 7549 } 7550 $itemTitle = this.constructItemTitleForOneActive(itemAndTitle, itemIndex); 7551 $item.before($itemTitle); 7552 }, this); 7553 }, 7554 7555 handleItemTitleClick : function (event) { 7556 var $itemTitle = $(this), 7557 layoutPlugin = event.data.layoutPlugin, 7558 dataAttrtName = 'data-' + layoutPlugin.layoutName.toLowerCase() + '-content-id', 7559 dataAttrValue = $itemTitle.data(layoutPlugin.layoutName.toLowerCase() + '-id'), 7560 $itemContainer = $itemTitle.parent(), 7561 $item = $itemContainer.children('[' + dataAttrtName + '="' + dataAttrValue + '"]'), 7562 $prevActiveItemTitle, 7563 $prevActiveItem; 7564 if (!$itemTitle.hasClass('active')) { 7565 if ($itemContainer.is("li")) { 7566 $itemContainer = $itemContainer.parent().children(); 7567 } 7568 $prevActiveItem = $itemContainer.children('.active[' + dataAttrtName + ']'); 7569 $prevActiveItemTitle = $itemContainer.children('.active'); 7570 layoutPlugin.unmarkItemTitleForOneActive($prevActiveItem, $prevActiveItemTitle); 7571 layoutPlugin.makeItemTitleActive($item, $itemTitle); 7572 } else { 7573 $itemTitle.removeClass('active'); 7574 $item.toggleClass('hidden'); 7575 } 7576 } 7577 }); 7578}($, _, window.guidelib)); 7579 7580 7581(function ($, _, guidelib) { 7582 var AnchorLayoutPlugin = guidelib.view.ad.layout.AnchorLayoutPlugin = guidelib.view.ad.layout.LayoutPlugin.extend({ 7583 layoutName : "adAnchor", 7584 layoutItemTitleType : "a", 7585 layoutItemTitleContainerType : "ul", 7586 7587 initialize : function (options) { 7588 7589 this.mergeWithParent = this.options.mergeWithParent || true; 7590 AnchorLayoutPlugin._super.initialize.call(this, options); 7591 }, 7592 7593 addItemTitle : function () { 7594 var $itemTitleContainer = this.constructItemTitleContainer(), 7595 titleClassSelector = '.' + this.titleClass, 7596 dataUidAttr = 'data-' + this.layoutName + '-uid'; 7597 7598 this.$container.attr('data-' + this.layoutName + '-content-id', 'ad-' + this.containerId); 7599 7600 _.each(this.itemAndTitleArray, function (itemAndTitle, itemIndex) { 7601 var $item = itemAndTitle.item, 7602 $itemTitle = this.constructItemTitle(itemAndTitle, itemIndex), 7603 itemUid = this.containerId + 'data-' + itemIndex + '-val-' + $itemTitle.html(), 7604 $itemAnchor, 7605 $title; 7606 $item.attr(dataUidAttr, itemUid); 7607 $itemTitle.attr('href', '#' + itemUid); 7608 $itemTitle.wrap('<li></li>'); 7609 if (this.$titles) { 7610 $title = $(this.$titles[itemIndex]); 7611 } else { 7612 $title = $item.find(titleClassSelector); 7613 } 7614 $itemAnchor = $('<a></a>').attr('name', itemUid); 7615 if ($title && $title.length > 0) { 7616 $title.before($itemAnchor); 7617 } else { 7618 $item.prepend($itemAnchor); 7619 } 7620 $itemTitleContainer.append($itemTitle.parent()); 7621 }, this); 7622 7623 if (this.mergeWithParent) { 7624 var $parentAnchorItem = this.$container.closest('[' + dataUidAttr + ']'), 7625 $anchorList, 7626 uidCondition, 7627 $parentAnchor; 7628 if ($parentAnchorItem && $parentAnchorItem.length > 0) { 7629 $anchorList = this.$element.siblings('.' + this.layoutName + 'ItemTitleContainer'); 7630 uidCondition = '[href="#' + $parentAnchorItem.attr(dataUidAttr) + '"]';
7631 $parentAnchor = $anchorList.find(uidCondition); 7632 if ($parentAnchor && $parentAnchor.length > 0) { 7633 $parentAnchor.parent().append($itemTitleContainer); 7634 } 7635 } else { 7636 7637 this.$element.before($itemTitleContainer); 7638 } 7639 } else { 7640 this.$container.before($itemTitleContainer); 7641 } 7642 } 7643 }); 7644}($, _, window.guidelib)); 7645 7646(function ($, _, guidelib) { 7647 var CardLayoutPlugin = guidelib.view.ad.layout.CardLayoutPlugin = guidelib.view.ad.layout.LayoutPlugin.extend({ 7648 layoutName : "adCard", 7649 layoutItemTitleType : "div", 7650 layoutColumns : 2, 7651 7652 initialize : function (options) { 7653 7654 if (this.options.layoutColumns && this.options.layoutColumns !== null) { 7655 this.layoutColumns = parseInt(this.options.layoutColumns); 7656 } 7657 CardLayoutPlugin._super.initialize.call(this, options); 7658 }, 7659 7660 addItemTitle : function () { 7661 _.each(this.itemAndTitleArray, function (itemAndTitle, itemIndex) { 7662 var $itemTitle = this.constructItemTitle(itemAndTitle, itemIndex); 7663 itemAndTitle.item.prepend($itemTitle); 7664 }, this); 7665 }, 7666 7667 expandCard : function (event) { 7668 var context = event.data.context, 7669 $this = $(this), 7670 $cardItem = $this.closest('.' + context.itemClass); 7671 $this.toggleClass('adCardCollapse'); 7672 $cardItem.toggleClass('adCardFull'); 7673 }, 7674 7675 getExpandCard : function () { 7676 var $expand = $('<div></div>').addClass('adCardExpand').on('click', {context : this}, this.expandCard), 7677 $expandShade = $('<div></div>').addClass('adCardShade'), 7678 $expandIcon = $('<div></div>').addClass('adCardIcon'); 7679 $expand.append($expandShade, $expandIcon); 7680 return $expand; 7681 }, 7682 7683 done : function () { 7684 var parentCard = this.$container.parents('.' + this.layoutName); 7685 7686 if (!(parentCard && parentCard.length > 0)) { 7687 var $expand = this.getExpandCard(), 7688 $cardContainer = this.itemAndTitleArray[0].item.closest('.' + this.layoutName); 7689 7690 $cardContainer.find('.' + this.itemClass).append($expand); 7691 7692 if (this.layoutColumns > 1) {
7693 var $cardDesktopContainer = $('<div></div>').addClass('adCardDesktop').attr('data-adCardCol', this.layoutColumns), 7694 divColArray = [], 7695 itemList; 7696 7697 for (var i = 0; i < this.layoutColumns; i++) { 7698 var $divCol = $('<div></div>').attr('data-adCardColNum', i); 7699 divColArray.push($divCol); 7700 } 7701 7702 itemList = $cardContainer.children('.' + this.itemClass); 7703 _.each(itemList, function (item, itemIndex) { 7704 var $item = $(item), 7705 colIndex = itemIndex % this.layoutColumns; 7706 divColArray[colIndex].append($item.clone(true)); 7707 $item.addClass('adCardMobile'); 7708 }, this); 7709 7710 for (i = 0; i < this.layoutColumns; i++) { 7711 $cardDesktopContainer.append(divColArray[i]); 7712 } 7713 7714 $cardContainer.append($cardDesktopContainer); 7715 } 7716 } 7717 } 7718 }); 7719}($, _, window.guidelib)); 7720 7721(function ($, _, guidelib) { 7722 var LayoutStrategy = guidelib.view.ad.layout.LayoutStrategy = guidelib.view.ad.layout.LayoutBase.extend({ 7723 7724 layoutStrategy : "", 7725 7726 initialize : function (options) { 7727 this.options = this.options || {}; 7728 7729 7730 this.$element = this.options.$element; 7731 7732 7733 this.layoutConfigs = this.getStrategyLayoutConfigs(this.options.layoutConfigs || []); 7734 7735 this.layoutInstances = []; 7736 }, 7737 7738 getStrategyLayoutConfigs : function (layoutConfigArray) { 7739 var strategyLayoutConfigs = []; 7740 _.each(layoutConfigArray, function (layoutConfig) { 7741 if (layoutConfig.layoutStrategy === this.layoutStrategy) { 7742 strategyLayoutConfigs.push(layoutConfig); 7743 } 7744 }, this); 7745 return strategyLayoutConfigs; 7746 }, 7747 7748 applyLayoutConfig : function (layoutConfig, itemAndTitleArray, $container, containerId) { 7749 if (layoutConfig && layoutConfig.layoutName) { 7750 var layoutPlugin = eval(layoutConfig.layoutName), 7751 layoutInstance; 7752 if (layoutPlugin) { 7753 layoutInstance = new layoutPlugin({ 7754 $element : this.$element, 7755 itemAndTitleArray : itemAndTitleArray, 7756 $container : $container, 7757 containerId : containerId, 7758 layoutColumns : layoutConfig.layoutColumns 7759 }); 7760 this.layoutInstances.push(layoutInstance); 7761 } 7762 } 7763 }, 7764 7765 done : function () { 7766 _.each(this.layoutInstances, function (layoutInstance, instanceIndex) { 7767 layoutInstance.done(); 7768 this.layoutInstances[instanceIndex] = null; 7769 }, this); 7770 } 7771 }); 7772}($, _, window.guidelib)); 7773(function ($, _, guidelib) { 7774 var ContainerLayoutStrategy = guidelib.view.ad.layout.ContainerLayoutStrategy = guidelib.view.ad.layout.LayoutStrategy.extend({ 7775 7776 layoutStrategy : "adContainerStrategy", 7777 7778 initialize : function (options) { 7779 ContainerLayoutStrategy._super.initialize.call(this, options); 7780 _.each(this.layoutConfigs, this.applyLayouts, this); 7781 }, 7782 7783 applyLayouts : function (layoutConfig, layoutConfigIndex) { 7784 var containerSelector, 7785 containerSelectorLevel, 7786 titleSelectors, 7787 itemSelector, 7788 containerArray; 7789 7790 7791 containerSelector = layoutConfig.containerSelector || 'ol,ul'; 7792 7793 7794 containerSelectorLevel = (layoutConfig.containerSelectorLevel ? parseInt(layoutConfig.containerSelectorLevel) : layoutConfig.containerSelectorLevel) || 0; 7795 7796 7797 titleSelectors = this.getTitleSelectors(layoutConfig.titleSelector); 7798 7799 7800 itemSelector = layoutConfig.itemSelector || 'li'; 7801 7802 7803 containerArray = this.getContainers(containerSelector, containerSelectorLevel); 7804 7805 _.each(containerArray, function ($container, containerIndex) { 7806 var $items = $container.children(itemSelector), 7807 itemAndTitleArray = [], 7808 containerId; 7809 _.each($items, function (item, itemIndex) { 7810 var $item = $(item), 7811 $title = this.getTitle($(item), titleSelectors); 7812 itemAndTitleArray.push({item : $item, title : $title}); 7813 }, this); 7814 containerId = layoutConfigIndex + '-' + containerIndex; 7815 this.applyLayoutConfig(layoutConfig, itemAndTitleArray, $container, containerId); 7816 }, this); 7817 }, 7818 7819 7820 getTitleSelectors : function (titleSelector) { 7821 var titleSelectors = []; 7822 if (titleSelector) { 7823 titleSelectors.push(titleSelector); 7824 } 7825 titleSelectors.push('h1'); 7826 titleSelectors.push('h2'); 7827 titleSelectors.push('h3'); 7828 titleSelectors.push('h4'); 7829 titleSelectors.push('h5'); 7830 titleSelectors.push('h6'); 7831 return titleSelectors; 7832 }, 7833 7834 7835 getTitle : function ($item, titleSelectors) { 7836 var $candidateTitles = [], 7837 $title; 7838 for (var i = 0; i < titleSelectors.length; i++) { 7839 $candidateTitles = $item.find(titleSelectors[i]); 7840 if ($candidateTitles.length > 0) { 7841 $title = $($candidateTitles[0]); 7842 break; 7843 } 7844 } 7845 return $title; 7846 }, 7847 7848 7849 getContainers : function (containerSelector, containerSelectorLevel) { 7850 var $itemContainers = this.$element.find(containerSelector), 7851 containerArray = []; 7852 7853 $itemContainers.each(function (itemIndex, itemContainer) { 7854 var $itemContainer = $(itemContainer), 7855 $itemContainerParents = $itemContainer.parents(containerSelector); 7856 7857 if (containerSelectorLevel < 0 || ($itemContainerParents.length === containerSelectorLevel)) { 7858 containerArray.push($itemContainer); 7859 } 7860 }); 7861 return containerArray; 7862 } 7863 }); 7864}($, _, window.guidelib)); 7865(function ($, _, guidelib) { 7866 var DelimiterLayoutStrategy = guidelib.view.ad.layout.DelimiterLayoutStrategy = guidelib.view.ad.layout.LayoutStrategy.extend({ 7867 7868 layoutStrategy : "adDelimiterStrategy", 7869 7870 standardDelimiters : ["h1", "h2", "h3", "h4", "h5", "h6"], 7871 7872 standardLevels : ["first", "second", "third"], 7873 7874 initialize : function (options) { 7875 7876 DelimiterLayoutStrategy._super.initialize.call(this, options); 7877 7878 7879 this.delimiterSelectors = this.extractConfigDelimiters(); 7880 7881 if (this.layoutConfigs && this.layoutConfigs.length > 0) { 7882 this.applyLayouts(0, this.$element, 0); 7883 } 7884 }, 7885 7886 extractConfigDelimiters : function () { 7887 var prependStandardDelimiters = false, 7888 delimiters = []; 7889 _.each(this.layoutConfigs, function (layoutConfig) { 7890 var delimiter = layoutConfig.itemDelimiter; 7891 if ((this.standardLevels.indexOf(layoutConfig.layoutType) > -1 && !delimiter) 7892 || this.standardDelimiters.indexOf(delimiter) > -1) { 7893 prependStandardDelimiters = true; 7894 } else if (delimiter) { 7895 7896 delimiters.push(delimiter); 7897 } 7898 }, this); 7899 if (prependStandardDelimiters) { 7900 delimiters = [].concat(this.standardDelimiters).concat(delimiters); 7901 } 7902 return delimiters; 7903 }, 7904 7905 getDelimiterLayoutConfig : function (delimiter, delimiterEncounter) { 7906 var delimiterLayoutConfig; 7907 _.each(this.layoutConfigs, function (layoutConfig) { 7908 _.each(this.standardLevels, function (standardLevel, index) { 7909 if ((!layoutConfig.itemDelimiter && layoutConfig.layoutType === standardLevel && delimiterEncounter === index) 7910 || (layoutConfig.itemDelimiter && layoutConfig.itemDelimiter === delimiter)) { 7911 delimiterLayoutConfig = layoutConfig; 7912 } 7913 }, this); 7914 }, this); 7915 return delimiterLayoutConfig; 7916 }, 7917 7918 7919 applyLayouts : function (delimiterIndex, $element, delimiterEncounter) { 7920 var delimiter, 7921 itemAndTitleArray = [], 7922 $itemDelimiters, 7923 $items = [], 7924 $container = $element, 7925 layoutConfig, 7926 containerId; 7927 7928 if (delimiterIndex >= this.delimiterSelectors.length) { 7929 return; 7930 } 7931 delimiter = this.delimiterSelectors[delimiterIndex]; 7932 $itemDelimiters = $element.find(delimiter); 7933 7934 if ($itemDelimiters && $itemDelimiters.length === 0) { 7935 return this.applyLayouts(delimiterIndex + 1, $element, delimiterEncounter); 7936 } 7937 7938 layoutConfig = this.getDelimiterLayoutConfig(delimiter, delimiterEncounter); 7939 7940 7941 $itemDelimiters.each(function (index, itemDelimiter) { 7942 var $itemDelimiter = $(itemDelimiter), 7943 $itemElements = $itemDelimiter.nextUntil(delimiter), 7944 $item, 7945 $title = $itemDelimiter; 7946 7947 $itemElements.splice(0, 0, itemDelimiter); 7948 $itemElements.wrapAll('<div></div>'); 7949 $item = $itemElements.parent(); 7950 $items.push($item); 7951 if (layoutConfig && layoutConfig.titleSelector) { 7952 var $titles = $item.find(layoutConfig.titleSelector); 7953 if ($titles && $titles.length > 0) { 7954 $title = $($titles[0]); 7955 } 7956 } 7957 itemAndTitleArray.push({item : $item, title : $title}); 7958 }); 7959 7960 if (layoutConfig) { 7961 containerId = layoutConfig.layoutType + '-' + delimiter; 7962 this.applyLayoutConfig(layoutConfig, itemAndTitleArray, $container, containerId); 7963 } 7964 7965 _.each($items, function ($item) { 7966 this.applyLayouts(delimiterIndex + 1, $item, delimiterEncounter + 1); 7967 }, this); 7968 } 7969 }); 7970}($, _, window.guidelib)); 7971 7972/* 7973 * ********************************************************************** 7974 * ADOBE CONFIDENTIAL 7975 * __________________ 7976 * 7977 * Copyright 2015 Adobe Systems Incorporated 7978 * All Rights Reserved. 7979 *
7980 * NOTICE: All information contained herein is, and remains 7981 * the property of Adobe Systems Incorporated and its suppliers, 7982 * if any. The intellectual and technical concepts contained 7983 * herein are proprietary to Adobe Systems Incorporated and its 7984 * suppliers and may be covered by U.S. and Foreign Patents, 7985 * patents in process, and are protected by trade secret or copyright law. 7986 * Dissemination of this information or reproduction of this material 7987 * is strictly forbidden unless prior written permission is obtained 7988 * from Adobe Systems Incorporated. 7989 * ********************************************************************** 7990 */ 7991 7992(function (window, $, guidelib) { 7993 guidelib.util.AdUtil = { 7994 descriptionPlugin : function () { 7995 if (_.isFunction($.prototype.tooltip)) { 7996 $(this).find('[data-description]').tooltip({ 7997 title : function () { 7998 //using browser native 'decodeURIComponent' as that is what is used for encoding in CM 7999 return decodeURIComponent($(this).data('description')); 8000 }, 8001 placement : 'top', 8002 html : true 8003 }); 8004 } 8005 }, 8006 8007 applyLayouts : function (options) { 8008 var strategies = []; 8009 strategies.push(new guidelib.view.ad.layout.DelimiterLayoutStrategy(options)); 8010 strategies.push(new guidelib.view.ad.layout.ContainerLayoutStrategy(options)); 8011 _.each(strategies, function (strategy, index) { 8012 strategy.done(); 8013 strategies[index] = null; 8014 }); 8015 }, 8016 8017 applyDescriptionPlugin : function () { 8018 $('.guideAdModule, .guideAdModuleGroup').one('mouseenter', guidelib.util.AdUtil.descriptionPlugin); 8019 } 8020 }; 8021}(window, $, guidelib)); 8022 8023/************************************************************************* 8024 * 8025 * ADOBE CONFIDENTIAL 8026 * __________________ 8027 * 8028 * Copyright 2024 Adobe Systems Incorporated 8029 * All Rights Reserved. 8030 *
8031 * NOTICE: All information contained herein is, and remains 8032 * the property of Adobe Systems Incorporated and its suppliers, 8033 * if any. The intellectual and technical concepts contained 8034 * herein are proprietary to Adobe Systems Incorporated and its 8035 * suppliers and may be covered by U.S. and Foreign Patents, 8036 * patents in process, and are protected by trade secret or copyright law. 8037 * Dissemination of this information or reproduction of this material 8038 * is strictly forbidden unless prior written permission is obtained 8039 * from Adobe Systems Incorporated. 8040 **************************************************************************/ 8041/** 8042* Constants declared for Feature Toggle 8043*/ 8044 8045(function($, guidelib) { 8046 var FeatureToggleConstants = guidelib.util.FeatureToggleConstants = { 8047 FT_TURNSTILE_HCAPTCHA : "FT_FORMS-12407", 8048 FT_DATE_PICKER_ERRORMESSAGE : "FT_FORMS-15308", 8049 FT_BROWSERLESS_SUBMISSION : "FT_FORMS-14595", 8050 FT_VALID_NAV_UL_CHILDREN : "FT_FORMS-21930" 8051 }; 8052}($, guidelib)); 8053/************************************************************************* 8054 * 8055 * ADOBE CONFIDENTIAL 8056 * __________________ 8057 * 8058 * Copyright 2022 Adobe Systems Incorporated 8059 * All Rights Reserved. 8060 *
8061 * NOTICE: All information contained herein is, and remains 8062 * the property of Adobe Systems Incorporated and its suppliers, 8063 * if any. The intellectual and technical concepts contained 8064 * herein are proprietary to Adobe Systems Incorporated and its 8065 * suppliers and may be covered by U.S. and Foreign Patents, 8066 * patents in process, and are protected by trade secret or copyright law. 8067 * Dissemination of this information or reproduction of this material 8068 * is strictly forbidden unless prior written permission is obtained 8069 * from Adobe Systems Incorporated. 8070 **************************************************************************/ 8071/** 8072 * @package guidelib.util.GuideUtil 8073 * Utility methods to handle recaptcha 8074 */ 8075 8076(function (window,$, guidelib,_) { 8077 var RecaptchaUtil = guidelib.util.RecaptchaUtil = { 8078 8079 constants : { 8080 ENTERPRISE_VERSION : 'enterprise', 8081 SCORE_KEY : 'score', 8082 CHECKBOX_KEY : 'checkbox', 8083 TIMEOUT_MULTIPLIER : 1000 8084 }, 8085 8086 _tokenChange : function (element, recaptchaConfigData) { 8087 var tokenData = null, token = element.attr("af-grecaptcha-response"); 8088 if (!_.isEmpty(token)) { 8089 tokenData = { 8090 'g_recaptcha_response' : token, 8091 'rcCloudServicePath' : recaptchaConfigData.rcCloudServicePath 8092 }; 8093 } 8094 if($._data( element[0] , 'events').tokenChange != undefined) { 8095 element.trigger({ 8096 type: "tokenChange.captcha", 8097 token: tokenData 8098 }); 8099 return; 8100 } 8101 8102 var recaptchaInvisibleElement = $("#recaptchaInvisible"), 8103 model = window.guideBridge._resolveId(recaptchaInvisibleElement.attr("modelId")); 8104 model.value = tokenData; 8105 8106 if(model._triggerPostSubmission) { 8107 recaptchaInvisibleElement.removeAttr("af-recaptcha-execute"); 8108 setTimeout( function () { 8109 window.guideBridge._submitAfterValidation(model._submitParameters.options, model._submitParameters.success, model._submitParameters.error); 8110 }); 8111 } 8112 }, 8113 8114 /* render recaptcha by adding g-recaptcha element */ 8115 renderRecaptcha : function (element, recaptchaConfigData) { 8116 var INVISIBLE = "invisible"; 8117 var recaptcha_url = guidelib.util.RecaptchaUtil.isRecaptchaEnterprise(recaptchaConfigData) 8118 ? 'recaptcha/enterprise.js' 8119 : 'recaptcha/api.js'; 8120 var domain = element.data('externaldomain') || ''; 8121 var url = ''; 8122 // CQ-4327044: Below code is because URL is not supported in IE11 8123 // and neither "".endsWith("<>") is available on IE11 8124 // ToDo: Remove if check once support for IE11 is dropped 8125 if (typeof(window.URL) === "function") { 8126 // supports URL class 8127 url = new URL(recaptcha_url, domain).toString(); 8128 } else { 8129 if (domain.length > 0 && domain[domain.length - 1] != '/') { 8130 domain = domain + '/'; 8131 } 8132 url = domain + recaptcha_url; 8133 } 8134 8135 8136 var gparameters = { 8137 'sitekey' : recaptchaConfigData.rcSitekey, 8138 'theme' : recaptchaConfigData.rcTheme || 'light', 8139 'type' : recaptchaConfigData.rcType || 'image', 8140 'size' : recaptchaConfigData.rcSize || 'invisible' 8141 }; 8142 if (guidelib.util.CaptchaUtil.isHcaptchaTurnstileFTenabled()) { 8143 guidelib.util.CaptchaUtil.renderCaptcha(element, recaptchaConfigData, url, 'af-grecaptcha-response', gparameters) 8144 } else { 8145 element.append('<div class="g-recaptcha"></div>'); 8146 var gcontainer = $("div.g-recaptcha")[0]; 8147 var widgetId; 8148 guidelib.util.RecaptchaUtil.successCallback = function (response) { 8149 element.attr("af-grecaptcha-response", response); 8150 RecaptchaUtil._tokenChange(element, recaptchaConfigData); 8151 }; 8152 8153 guidelib.util.RecaptchaUtil.expiredCallback = function () { 8154 if (RecaptchaUtil.isRecaptchaEnterprise(recaptchaConfigData)) { 8155 grecaptcha.enterprise.reset(widgetId); 8156 } else { 8157 grecaptcha.reset(widgetId); 8158 } 8159 element.removeAttr("af-grecaptcha-response"); 8160 if(gparameters.size == INVISIBLE && recaptchaConfigData.mandatory) { 8161 element.attr("af-recaptcha-execute", ""); 8162 return; 8163 } 8164 RecaptchaUtil._tokenChange(element, recaptchaConfigData); 8165 }; 8166 gparameters['callback'] = guidelib.util.RecaptchaUtil.successCallback; 8167 gparameters['expired-callback'] = guidelib.util.RecaptchaUtil.successCallback; 8168 8169 onloadCallbackInternal = function () { 8170 if (RecaptchaUtil.isRecaptchaEnterprise(recaptchaConfigData)) { 8171 if (recaptchaConfigData.rcKeyType === RecaptchaUtil.constants.SCORE_KEY) { 8172 return; 8173 } 8174 widgetId = grecaptcha.enterprise.render( 8175 gcontainer, 8176 gparameters 8177 ); 8178 } else { 8179 widgetId = grecaptcha.render( 8180 gcontainer, 8181 gparameters 8182 ); 8183 } 8184 return widgetId; 8185 }; 8186 8187 window.onloadRecaptchaCallback = onloadCallbackInternal; 8188 var runtimeLocale = element.data("locale"); 8189 8190 if (RecaptchaUtil.isRecaptchaEnterprise(recaptchaConfigData) && recaptchaConfigData.rcKeyType === RecaptchaUtil.constants.SCORE_KEY) { 8191 element.append('<script src="' + url + '?onload=onloadRecaptchaCallback&render=' + recaptchaConfigData.rcSitekey + '&hl=' + runtimeLocale + '" async defer></script>'); 8192 } else { 8193 element.append('<script src="' + url + '?onload=onloadRecaptchaCallback&render=explicit&hl=' + runtimeLocale + '" async defer></script>'); 8194 } 8195 } 8196 }, 8197 8198 recaptchaExecution : function (options) { 8199 var model = window.guideBridge._resolveId($(RecaptchaUtil.getInvisibleCaptchaSelector()).attr("modelId")); 8200 model._submitParameters = options.submitParameters; 8201 model._triggerPostSubmission = options.triggerPostSubmission; 8202 if (RecaptchaUtil.isRecaptchaEnterprise(model.jsonModel)) { 8203 var retryCount = 1; 8204 var actionName = "submit_" + guideBridge._getFormName(model.jsonModel['jcr:path']) + "_" + model.jsonModel.name; 8205 //Allowed characters for actionName are "A-Za-z/_" 8206 actionName = guidelib.util.GuideUtil.replaceAll(actionName, "-", "_"); 8207 RecaptchaUtil.recaptchaEnterpriseExecution(model.jsonModel, actionName, retryCount); 8208 } else { 8209 grecaptcha.execute(); 8210 } 8211 }, 8212 8213 recaptchaEnterpriseExecution : function(recaptchaConfigData, actionName, retryCount) { 8214 var reCaptchaExecuteFail , reCaptchaExecuteSuccess; 8215 grecaptcha.enterprise.ready(function() { 8216 if (reCaptchaExecuteFail == true) { 8217 return; 8218 } 8219 grecaptcha.enterprise.execute(recaptchaConfigData.rcSitekey, {action: actionName}).then(function(token) { 8220 if (reCaptchaExecuteFail == true) { 8221 return; 8222 } 8223 reCaptchaExecuteSuccess = true; 8224 var recaptchaElement = $(RecaptchaUtil.getInvisibleCaptchaSelector()); 8225 recaptchaElement.attr("af-grecaptcha-response", token); 8226 if (FD.isToggleEnabled(guidelib.util.FeatureToggleConstants.FT_TURNSTILE_HCAPTCHA)) { 8227 guidelib.util.CaptchaUtil._tokenChange(recaptchaElement, recaptchaConfigData,'af-grecaptcha-response'); 8228 } else { 8229 RecaptchaUtil._tokenChange(recaptchaElement, recaptchaConfigData); 8230 } 8231 }); 8232 }); 8233 setTimeout(function () { 8234 if (reCaptchaExecuteSuccess == true){ 8235 return; 8236 } 8237 reCaptchaExecuteFail = true; 8238 if (retryCount > 2) { 8239 window.guideBridge._handleCaptchaTimeout(); 8240 } else { 8241 RecaptchaUtil.recaptchaEnterpriseExecution(recaptchaConfigData, actionName, retryCount + 1); 8242 } 8243 }, Math.pow(2, retryCount) * RecaptchaUtil.constants.TIMEOUT_MULTIPLIER); 8244 }, 8245 8246 isRecaptchaEnterprise : function (recaptchaConfigData) { 8247 return recaptchaConfigData.rcVersion === RecaptchaUtil.constants.ENTERPRISE_VERSION; 8248 }, 8249 8250 getInvisibleCaptchaSelector : function () { 8251 return FD.isToggleEnabled(guidelib.util.FeatureToggleConstants.FT_TURNSTILE_HCAPTCHA) ? 8252 "#captchaInvisible" : "#recaptchaInvisible"; 8253 } 8254 8255 } 8256})(window, $, guidelib, window._); 8257/************************************************************************* 8258 * 8259 * ADOBE CONFIDENTIAL 8260 * __________________ 8261 * 8262 * Copyright 2024 Adobe 8263 * All Rights Reserved. 8264 *
8265 * NOTICE: All information contained herein is, and remains 8266 * the property of Adobe and its suppliers, if any. The intellectual 8267 * and technical concepts contained herein are proprietary to Adobe 8268 * and its suppliers and are protected by all applicable intellectual 8269 * property laws, including trade secret and copyright laws. 8270 * Dissemination of this information or reproduction of this material 8271 * is strictly forbidden unless prior written permission is obtained 8272 * from Adobe. 8273 **************************************************************************/ 8274 8275/** 8276 * @package guidelib.util.GuideUtil 8277 * Utility methods to handle captcha 8278 */ 8279 8280(function (window,$, guidelib,_) { 8281 var CaptchaUtil = guidelib.util.CaptchaUtil = { 8282 8283 HCAPTCHA : "hcaptcha", 8284 TURNSTILE : "turnstile", 8285 8286 _tokenChange : function (element, captchaConfigData, responseIdentifier) { 8287 var tokenData = null, token = element.attr(responseIdentifier); 8288 if (!_.isEmpty(token)) { 8289 //For recaptcha the response in token data should have the key g_recaptcha_response 8290 if (CaptchaUtil.isHcaptchaTurnstileFTenabled() && CaptchaUtil.getCaptchaService(captchaConfigData) !== 'recaptcha') { 8291 tokenData = {} 8292 tokenData[responseIdentifier] = token; 8293 } else { 8294 tokenData = { 8295 'g_recaptcha_response' : token, 8296 'rcCloudServicePath' : captchaConfigData.rcCloudServicePath 8297 }; 8298 } 8299 } 8300 if($._data( element[0] , 'events').tokenChange != undefined) { 8301 element.trigger({ 8302 type: "tokenChange.captcha", 8303 token: tokenData 8304 }); 8305 return; 8306 } 8307 8308 var recaptchaInvisibleElement = $("#captchaInvisible"), 8309 model = window.guideBridge._resolveId(recaptchaInvisibleElement.attr("modelId")); 8310 model.value = tokenData; 8311 8312 if(model._triggerPostSubmission) { 8313 recaptchaInvisibleElement.removeAttr("af-recaptcha-execute"); 8314 setTimeout( function () { 8315 window.guideBridge._submitAfterValidation(model._submitParameters.options, model._submitParameters.success, model._submitParameters.error); 8316 }); 8317 } 8318 }, 8319 8320 /* render any third-party captcha */ 8321 renderCaptcha : function (element, captchaConfigData, url, responseIdentifier, captchaParameters) { 8322 var INVISIBLE = "invisible"; 8323 //ToDo change name of the div 8324 element.append('<div class="g-recaptcha"></div>'); 8325 var captchaContainer = $("div.g-recaptcha")[0]; 8326 var widgetId; 8327 guidelib.util.CaptchaUtil.successCallback = function (response) { 8328 element.attr(responseIdentifier, response); 8329 CaptchaUtil._tokenChange(element, captchaConfigData, responseIdentifier); 8330 }; 8331 8332 guidelib.util.CaptchaUtil.expiredCallback = function () { 8333 if (CaptchaUtil.isHcaptchaTurnstileFTenabled() && CaptchaUtil.getCaptchaService(captchaConfigData) == CaptchaUtil.TURNSTILE) { 8334 turnstile.reset(widgetId); 8335 } else if (CaptchaUtil.isHcaptchaTurnstileFTenabled() && CaptchaUtil.getCaptchaService(captchaConfigData) == CaptchaUtil.HCAPTCHA) { 8336 hcaptcha.reset(widgetId); 8337 } else { 8338 if (guidelib.util.RecaptchaUtil.isRecaptchaEnterprise(captchaConfigData)) { 8339 grecaptcha.enterprise.reset(widgetId); 8340 } else { 8341 grecaptcha.reset(widgetId); 8342 } 8343 } 8344 element.removeAttr(responseIdentifier); 8345 //ToDo: common functionality for invisible 8346 if(gparameters.size == INVISIBLE && captchaConfigData.mandatory) { 8347 element.attr("af-recaptcha-execute", ""); 8348 return; 8349 } 8350 CaptchaUtil._tokenChange(element, captchaConfigData, responseIdentifier); 8351 }; 8352 8353 captchaParameters['callback'] = guidelib.util.CaptchaUtil.successCallback; 8354 captchaParameters['expired-callback'] = guidelib.util.CaptchaUtil.successCallback; 8355 8356 onloadCallbackInternal = function () { 8357 if (CaptchaUtil.isHcaptchaTurnstileFTenabled() && CaptchaUtil.getCaptchaService(captchaConfigData) == CaptchaUtil.TURNSTILE) { 8358 widgetId = turnstile.render( 8359 captchaContainer, 8360 captchaParameters 8361 ); 8362 } else if (CaptchaUtil.isHcaptchaTurnstileFTenabled() && CaptchaUtil.getCaptchaService(captchaConfigData) == CaptchaUtil.HCAPTCHA) { 8363 widgetId = hcaptcha.render( 8364 captchaContainer, 8365 captchaParameters 8366 ); 8367 } else { 8368 if (guidelib.util.RecaptchaUtil.isRecaptchaEnterprise(captchaConfigData)) { 8369 if (captchaConfigData.rcKeyType === guidelib.util.RecaptchaUtil.constants.SCORE_KEY) { 8370 return; 8371 } 8372 widgetId = grecaptcha.enterprise.render( 8373 captchaContainer, 8374 captchaParameters 8375 ); 8376 } else { 8377 widgetId = grecaptcha.render( 8378 captchaContainer, 8379 captchaParameters 8380 ); 8381 } 8382 } 8383 return widgetId; 8384 }; 8385 8386 window.onloadRecaptchaCallback = onloadCallbackInternal; 8387 8388 var runtimeLocale = element.data("locale"); 8389 8390 if (guidelib.util.RecaptchaUtil.isRecaptchaEnterprise(captchaConfigData) && captchaConfigData.rcKeyType === guidelib.util.RecaptchaUtil.constants.SCORE_KEY) { 8391 element.append('<script src="' + url + '?onload=onloadRecaptchaCallback&render=' + captchaConfigData.rcSitekey + '&hl=' + runtimeLocale + '" async defer></script>'); 8392 } else { 8393 var scriptUrl = url + '?onload=onloadRecaptchaCallback&render=explicit' + ( 8394 (CaptchaUtil.getCaptchaService(captchaConfigData) === 'recaptcha' || CaptchaUtil.getCaptchaService(captchaConfigData) == CaptchaUtil.HCAPTCHA) ? ('&hl=' + runtimeLocale) : ''); 8395 element.append('<script src="' + scriptUrl + '" async defer></script>'); 8396 } 8397 }, 8398 8399 captchaExecution : function (options) { 8400 var model = window.guideBridge._resolveId($("#captchaInvisible").attr("modelId")); 8401 model._submitParameters = options.submitParameters; 8402 model._triggerPostSubmission = options.triggerPostSubmission; 8403 if(model.captchaWidget === 'turnstile') { 8404 turnstile.execute(); 8405 } else { 8406 if (guidelib.util.RecaptchaUtil.isRecaptchaEnterprise(model.jsonModel)) { 8407 var retryCount = 1; 8408 var actionName = "submit_" + guideBridge._getFormName(model.jsonModel['jcr:path']) + "_" + model.jsonModel.name; 8409 //Allowed characters for actionName are "A-Za-z/_" 8410 actionName = actionName.replaceAll("-","_"); 8411 guidelib.util.RecaptchaUtil.recaptchaEnterpriseExecution(model.jsonModel, actionName, retryCount); 8412 } else { 8413 grecaptcha.execute(); 8414 } 8415 } 8416 }, 8417 8418 getCaptchaService : function (captchaConfigData) { 8419 return captchaConfigData.captchaService; 8420 }, 8421 8422 isHcaptchaTurnstileFTenabled : function () { 8423 return FD.isToggleEnabled(guidelib.util.FeatureToggleConstants.FT_TURNSTILE_HCAPTCHA); 8424 } 8425 } 8426})(window, $, guidelib, window._); 8427/************************************************************************* 8428 * 8429 * ADOBE CONFIDENTIAL 8430 * __________________ 8431 * 8432 * Copyright 2014 Adobe Systems Incorporated 8433 * All Rights Reserved. 8434 *
8435 * NOTICE: All information contained herein is, and remains 8436 * the property of Adobe Systems Incorporated and its suppliers, 8437 * if any. The intellectual and technical concepts contained 8438 * herein are proprietary to Adobe Systems Incorporated and its 8439 * suppliers and may be covered by U.S. and Foreign Patents, 8440 * patents in process, and are protected by trade secret or copyright law. 8441 * Dissemination of this information or reproduction of this material 8442 * is strictly forbidden unless prior written permission is obtained 8443 * from Adobe Systems Incorporated. 8444 **************************************************************************/ 8445 8446(function (guidelib) { 8447 guidelib.i18n = { 8448 "calendarSymbols" : { 8449 "monthNames" : ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], 8450 "abbrmonthNames" : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 8451 "dayNames" : ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], 8452 "abbrdayNames" : ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 8453 "meridiemNames" : ["AM", "PM"], 8454 "eraNames" : ["BC", "AD"], 8455 "day" : "day", 8456 "days" : "days", 8457 "month" : "month", 8458 "months" : "months", 8459 "year" : "year", 8460 "years" : "years", 8461 "more" : "more", 8462 "less" : "less" 8463 }, 8464 "datePatterns" : { 8465 "full" : "EEEE D MMMM YYYY", 8466 "long" : "D MMMM YYYY", 8467 "med" : "DD-MMM-YY", 8468 "short" : "DD/MM/YY" 8469 }, 8470 "timePatterns" : { 8471 "full" : "h:MM:SS A Z", 8472 "long" : "h:MM:SS A Z", 8473 "med" : "h:MM:SS A", 8474 "short" : "h:MM A" 8475 }, 8476 "dateTimeSymbols" : "GyMdkHmsSEDFwWahKzZ", 8477 "numberPatterns" : { 8478 "numeric" : "z,zz9.zzz", 8479 "currency" : "$ z,zz9.99", 8480 "percent" : "z,zz9%" 8481 }, 8482 "numberSymbols" : { 8483 "decimal" : ".", 8484 "grouping" : ",", 8485 "percent" : "%", 8486 "minus" : "-", 8487 "zero" : "0" 8488 }, 8489 "currencySymbols" : { 8490 "symbol" : "$", 8491 "isoname" : "USD", 8492 "decimal" : "." 8493 }, 8494 "typefaces" : {} 8495 }; 8496}(guidelib)); 8497 8498/************************************************************************* 8499 * 8500 * ADOBE CONFIDENTIAL 8501 * __________________ 8502 * 8503 * Copyright 2014 Adobe Systems Incorporated 8504 * All Rights Reserved. 8505 *
8506 * NOTICE: All information contained herein is, and remains 8507 * the property of Adobe Systems Incorporated and its suppliers, 8508 * if any. The intellectual and technical concepts contained 8509 * herein are proprietary to Adobe Systems Incorporated and its 8510 * suppliers and may be covered by U.S. and Foreign Patents, 8511 * patents in process, and are protected by trade secret or copyright law. 8512 * Dissemination of this information or reproduction of this material 8513 * is strictly forbidden unless prior written permission is obtained 8514 * from Adobe Systems Incorporated. 8515 **************************************************************************/ 8516 8517(function (guidelib) { 8518 guidelib.i18n.strings = { 8519 8520 "LostInternetConnection" : "Current functionality needs internet connectivity to work. Please connect your " + 8521 "device to the internet." , //Added in AEM 6.0 SP1 8522 "ESignDisabled" : "The privileges to sign the filled form are not available to you. Please, continue to the " + 8523 "next action or submit the form.", 8524 "VerifyDisabled" : "The privileges to verify the filled data are not available to you. Please, continue to " + 8525 "the next action or submit the form.", 8526 "validatingForm" : "Validating...", 8527 "submittingForm" : "Submitting...", 8528 "generatingSignAgreement" : "Preparing document for signature", 8529 "maxValErrorMessage" : "The value must be less than or equal to {0}", 8530 "exclusiveMaxValErrorMessage" : "The value must be strictly less than {0}", 8531 "minValErrorMessage" : "The value must be greater than or equal to {0}", 8532 "exclusiveMinValErrorMessage" : "The value must be strictly greater than {0}", 8533 "minimumLengthMessage" : "The number of characters must be greater than or equal to {0}", 8534 "totalLengthMessage" : "The number of characters must be equal to {0}", 8535 "totalDigitMessage" : "The number of digits must be less than or equal to {0}", 8536 "formAlreadySigned" : "The Form has been signed.", 8537 "formAlreadySubmitted" : "The Form has been submitted.", 8538 "datatypeMessage" : "The value must be of {0} datatype.", 8539 "genericInvalidDatePart" : "A {0} can not have {1} than {2} {3}.", 8540 "genericInvalidYearPart": "Year can not have less than four digit.", 8541 "nonFebruaryMessage" : "{0} can not have more than {1} days.", 8542 "februaryMessage" : "February can not have more than {0} days in {1}.", 8543 "draftSavedSuccessMessage" : "Draft Saved Successfully", 8544 "formHasBeenReset" : "The form has been reset.", 8545 "formSubmitFail" : "Failed to submit the form.", 8546 "showingField" : "Field {0} is now showing", 8547 "hidingField" : "Field {0} is now hidden" 8548 }; 8549 /* Do not put any new message here. Use the guidelib.i18n.strings object */ 8550 guidelib.i18n.LogMessages = { 8551 "AEM-AF-901-001" : "[AEM-AF-901-001]: Error in retrieving the form state.", 8552 "AEM-AF-901-003" : "[AEM-AF-901-003]: Unable to connect to the server.", 8553 "AEM-AF-901-004" : "[AEM-AF-901-004]: Encountered an internal error while submitting the form.", 8554 "AEM-AF-901-005" : " This Field is a required field.", 8555 "AEM-AF-901-006" : " There is a validation error in the field.", 8556 "AEM-AF-901-007" : " Field not filled in expected format.", 8557 "AEM-AF-901-008" : " Server is not reachable", 8558 "AEM-AF-901-009" : " Error occurred while draft saving", 8559 "AEM-AF-901-010" : "Verify works only with XFA-based Adaptive Forms.", 8560 "AEM-AF-901-011" : "Failed to restore the form state.", 8561 "AEM-AF-901-012" : "Failed to retrieve the form state.", 8562 "AEM-AF-901-013" : "User email undefined. Unable to generate signable PDF.", 8563 "AEM-AF-901-014" : "XDP title or Guide title undefined. Unable to generate signable PDF.", 8564 "AEM-AF-901-015" : "Error while submitting the guide: ", 8565 "AEM-AF-901-016" : "No signing field in the form. Please continue!", 8566 "AEM-AF-901-017" : "Failed to obtain data XML from HTML form: ", 8567 "AEM-AF-901-018" : "Please sign all the mandatory fields", 8568 "AEM-AF-901-019" : "Please esign the form.", 8569 "AEM-AF-901-020" : "Submitting the form...", 8570 "AEM-AF-901-021" : "Verify Component works only for XDP based DoR template.", 8571 "AEM-AF-901-022" : "The document is ready for signing but could not be loaded. We have sent the document to your email. Check your email to continue signing.", 8572 "AEM-AF-901-024" : "You cannot submit a form with empty attachment(s). Check these attachment(s) and resubmit the form: {0}", 8573 "AEM-AF-901-025" : "Google reCAPTCHA services are currently experiencing low availability. You can try again later after some time or contact your administrator if the issue continues." 8574 }; 8575}(guidelib)); 8576
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.